///////////////////////////////////////////////////////////// // // CbmEmcHit // // Emc digitised hit // // Created 14/08/06 by S.Spataro // /////////////////////////////////////////////////////////////// #include "CbmEmcHit.h" #include using namespace std; // ----- Default constructor ------------------------------------------- CbmEmcHit::CbmEmcHit() {} // ------------------------------------------------------------------------- //Copy CbmEmcHit::CbmEmcHit(const CbmEmcHit ©) { fEnergy=copy.fEnergy; fTime=copy.fTime; fTrackId=copy.fTrackId; fDetectorId=copy.fDetectorId; fX=copy.fX; fY=copy.fY; fZ=copy.fZ; fTheta=copy.fTheta; fPhi=copy.fPhi; fTau=copy.fTau; } // ----- Destructor ---------------------------------------------------- CbmEmcHit::~CbmEmcHit() {} // ------------------------------------------------------------------------- // ----- Public method Print ------------------------------------------- void CbmEmcHit::Print(const Option_t* opt) const { cout << "EMC hit: cellid=" << GetDetectorId() << ", Energy=" << fEnergy; if (fTrackId>0) cout << ", TrackID= " << fTrackId; // cout << ", x=" << GetX() << ", y=" << GetY() << endl << flush; } // ------------------------------------------------------------------------- Short_t CbmEmcHit::GetXPad() const { // Return the X pad value for clusterization // Barrel EMC if (GetModule()==1 || GetModule()==2) return (GetCrystal()+(GetCopy()-1)*10); // Endcups and forward EMC if ((GetModule()==3) || (GetModule()==4) || (GetModule()==5)) { if (GetCopy()==1) { return -GetRow()+1;} if (GetCopy()==2) { return -GetRow()+1; } if (GetCopy()==3) { return GetRow();} if (GetCopy()==4) { return GetRow();} } return -1000; // failure } Short_t CbmEmcHit::GetYPad() const { // Return the Y pad value for clusterization // Barrel EMC if (GetModule()==1) return (GetRow()+29); if (GetModule()==2) return GetRow(); // Endcups and forward EMC if ((GetModule()==3) || (GetModule()==4) || (GetModule()==5)) { if (GetCopy()==1) { return GetCrystal(); } if (GetCopy()==2) { return -GetCrystal()+1; } if (GetCopy()==3) { return -GetCrystal()+1; } if (GetCopy()==4) { return GetCrystal(); } } return -1000; // failure } ClassImp(CbmEmcHit)