//-------------------------------------------------------------------------- // File and Version Information: // $Id:$ // // Description: // EMC Digi. // // Software developed for the BaBar Detector at the SLAC B-Factory. // Adapted for the PANDA experiment at GSI // // Author List: // Xiaorong Shi Lawrence Livermore National Lab // Steve Playfer University of Edinburgh // Stephen Gowdy University of Edinburgh // Dima Melnichuk - adaption for PANDA // // Copyright Information: // Copyright (C) 1994 Lawrence Livermore National Lab // /////////////////////////////////////////////////////////////// #ifndef PNDEMCDIGI_H #define PNDEMCDIGI_H #include "TObject.h" #include "PndEmcTwoCoordIndex.h" #include "PndEmcHit.h" #include "TVector3.h" class TVector3; class PndEmcXtal; class PndEmcSharedDigi; class PndEmcDigi : public TObject { public: /** Default constructor **/ PndEmcDigi(); PndEmcDigi(Int_t trackid, Int_t id, Float_t energy, Float_t time); PndEmcDigi(Int_t trackid, Int_t id, Float_t energy, Float_t time,std::vector hitList); /** Destructor **/ virtual ~PndEmcDigi(); /** Output to screen **/ virtual void Print(const Option_t* opt ="") const; enum PositionMethod { surface, depth }; /** Modifiers **/ void SetEnergy(Double32_t energy) { fEnergy = energy ;}; void SetTime(Double32_t time) { fTime = time ;}; void SetTrackId(Int_t id) { fTrackId = id ;}; void SetDetectorId(Int_t id); void addHitToList(PndEmcHit* hit); void SetHitList(std::vector); //check if 2 digis are neigbour or not (prelim for testing) bool isNeighbour(PndEmcDigi* theDigi); /** Accessors **/ Double_t GetEnergy() const; Double_t GetTime() const { return fTime ;}; Int_t GetTrackId() const { return fTrackId ;}; Int_t GetDetectorId() const { return fDetectorId ;}; PndEmcTwoCoordIndex* GetTCI() const { return fTCI ;}; Int_t GetThetaInt() const {return fThetaInd;}; Int_t GetPhiInt() const {return fPhiInd;}; Double_t GetTheta() const {return fTheta;}; Double_t GetPhi() const {return fPhi;}; 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; void ValidateTCI(); std::vector &itsHitList() {return fHitList;} const TVector3 &where() const {return fWhere;}; virtual PndEmcSharedDigi* dynamic_cast_PndEmcSharedDigi(); virtual const PndEmcSharedDigi* dynamic_cast_PndEmcSharedDigi() const; protected: Double_t fEnergy; // digi amplitude Int_t fTrackId; Int_t fDetectorId; Int_t fThetaInd; Int_t fPhiInd; Double_t fTheta; Double_t fPhi; Double_t fTime; // digi time TVector3 fWhere; PndEmcTwoCoordIndex* fTCI; //! transient data std::vector fHitList; // hits contributed to digi PndEmcDigi(const PndEmcDigi&); private: friend class PndEmcWaveformToDigi; friend class PndEmcMakeDigi; static void selectDigiPositionMethod( PositionMethod , double rescaleFactor = 1., double positionDepth = 0. ); static TVector3 surfacePosition( const PndEmcXtal* xtal ); static TVector3 depthPosition( const PndEmcXtal* xtal ); static TVector3 ( *&algPointer() ) ( const PndEmcXtal* ); static double _rescaleFactor; static double _positionDepth; ClassDef(PndEmcDigi,1); }; #endif //PndEmcDigi_H