// ------------------------------------------------------------------------- // ----- PndEmcHit header file ----- // ----- Created 14/08/06 by S.Spataro ----- // ------------------------------------------------------------------------- /** PndEmcHit.h *@author S.Spataro ** ** Hits in EMC **/ #ifndef PNDEMCHIT_H #define PNDEMCHIT_H #include "TObject.h" #include "TMath.h" #include class PndEmcPoint; class PndEmcHit : public TObject { public: /** Default constructor **/ PndEmcHit(); PndEmcHit(Int_t trackid, Int_t id, Float_t energy, Float_t time, Float_t X, Float_t Y, Float_t Z) : fEnergy(energy), fTime(time), fTrackId(trackid), fDetectorId(id), fX(X), fY(Y), fZ(Z) {}; PndEmcHit(Int_t trackid, Int_t id, Float_t energy, Float_t time, Float_t X, Float_t Y, Float_t Z, std::vector PointList) : fEnergy(energy), fTime(time), fTrackId(trackid), fDetectorId(id), fX(X), fY(Y), fZ(Z), fPointList(PointList) {}; /** Copy **/ PndEmcHit(const PndEmcHit &); /** Destructor **/ virtual ~PndEmcHit(); /** Output to screen **/ virtual void Print(const Option_t* opt ="") const; /** Modifiers **/ virtual void SetEnergy(Double32_t energy) { fEnergy = energy ;}; virtual void SetTime(Double32_t time) { fTime = time ;}; virtual void SetTrackId(Int_t id) { fTrackId = id ;}; virtual void SetDetectorId(Int_t id) { fDetectorId = id ;}; /** Accessors **/ virtual Double_t GetEnergy() const { return fEnergy ;}; virtual Double_t GetTime() const { return fTime ;}; virtual Int_t GetTrackId() const { return fTrackId ;}; virtual Int_t GetDetectorId() const { return fDetectorId ;}; Float_t GetTheta() const { return fX == 0.0 && fY == 0.0 && fZ == 0.0 ? 0.0 : TMath::ATan2(sqrt(fX*fX+fY*fY),fZ)*TMath::RadToDeg() ;}; Float_t GetPhi() const { return fX == 0.0 && fY == 0.0 ? 0.0 : TMath::ATan2(fY,fX)*TMath::RadToDeg() ;}; Float_t GetX() const { return fX;}; Float_t GetY() const { return fY;}; Float_t GetZ() const { return fZ;}; Short_t GetModule() const { return (fDetectorId/100000000) ;}; Short_t GetRow() const { return ((fDetectorId/1000000)%100);}; Short_t GetCrystal() const { return (fDetectorId%10000) ;}; Short_t GetCopy() const { return ((fDetectorId/10000)%100) ;}; Short_t GetXPad() const; Short_t GetYPad() const; std::vector &GetPointList() {return fPointList;} protected: Double32_t fEnergy; // hit amplitude Double32_t fTime; Int_t fTrackId; Int_t fDetectorId; Float_t fX; Float_t fY; Float_t fZ; std::vector fPointList; // points contributed to hit ClassDef(PndEmcHit,1) }; #endif //PNDEMCHIT_H