#ifndef DCHDETECTOR_H #define DCHDETECTOR_H #include "TClonesArray.h" #include "TLorentzVector.h" #include "CbmDetector.h" using namespace std; class TClonesArray; class DchPoint; //class CbmVolume; class DchDetector : public CbmDetector { public: /** Default constructor **/ DchDetector(); /** Standard constructor. *@param name detetcor name *@param active sensitivity flag **/ DchDetector(const char* name, Bool_t active); /** Destructor **/ virtual ~DchDetector(); /** Virtual method ProcessHits ** Defines the action to be taken when a step is inside the ** active volume. Creates DchPoints and adds ** them to the collections. *@param vol Pointer to the active volume **/ virtual Bool_t ProcessHits(CbmVolume* vol = 0); /** Virtual method EndOfEvent ** ** If verbosity level is set, print hit collection at the ** end of the event and resets it afterwards. **/ virtual void EndOfEvent(); /** Virtual method Register ** ** Registers the hit collection in the ROOT manager. **/ virtual void Register(); /** Accessor to the hit collection **/ virtual TClonesArray* GetCollection(Int_t iColl) const; /** Virtual method Print ** ** Screen output of hit collection. **/ virtual void Print() const; /** Virtual method Reset ** ** Clears the hit collection **/ virtual void Reset(); /** Virtual method Construct geometry ** **/ virtual void ConstructGeometry(); DchPoint* AddHit(Int_t trackID, Int_t detID, Int_t moduleID, TVector3 posIn, TVector3 posOut, TVector3 momIn, TVector3 momOut, Double_t time, Double_t length, Double_t eLoss, TString nam,Int_t evt); private: Int_t fTrackID; //! track index Int_t fVolumeID; //! volume id (copy no) Int_t fModuleID; //! module id TLorentzVector fPosIn, fPosOut; //! position TLorentzVector fMomIn, fMomOut; //! momentum Double32_t fTime; //! time Double32_t fLength; //! length Double32_t fELoss; //! energy loss Int_t fPosIndex; //! Int_t volDetector; //! MC volume ID of DCH TString fcurrnam; TString fcurrnam2; TClonesArray* fDchPointCollection; //! Point collection Int_t fevent; // reset all parameters void ResetParameters(); ClassDef(DchDetector,1) }; inline void DchDetector::ResetParameters() { fTrackID = -999; fVolumeID = -999; fModuleID = -999; fPosIn.SetXYZT(-999., -999., -999., -999.); fPosOut.SetXYZT(-999., -999., -999., -999.) ; fMomIn.SetXYZT(-999., -999., -999., -999.) ; fMomOut.SetXYZT(-999., -999., -999., -999.); fTime = -999; fLength = 0.; fELoss = 0.; } #endif