// ------------------------------------------------------------------------- // ----- MvdDetector header file ----- // ----- Created 6/04/06 by T. Stockmanns ----- // ----- Based on MvdDetector ----- // ------------------------------------------------------------------------- /** MvdDetector.h *@author T.Stockmanns ** ** Defines the active detector MvdDetector. Constructs the geometry and ** registers MCPoints. **/ #ifndef MVDDETECTOR_H #define MVDDETECTOR_H #include "TClonesArray.h" #include "TLorentzVector.h" #include "TVector3.h" #include "CbmDetector.h" #include "TString.h" #include #include #include class TGeoNode; class MvdPoint; class CbmVolume; class MvdDetector : public CbmDetector { public: /** Default constructor **/ MvdDetector(); /** Standard constructor. *@param name detetcor name *@param active sensitivity flag **/ MvdDetector(const char* name, Bool_t active); /** Destructor **/ virtual ~MvdDetector(); virtual void Initialize(); /** Virtual method ProcessHits ** ** Defines the action to be taken when a step is inside the ** active volume. Creates CbmTrdPoints and adds them to the ** collection. *@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 void FinishRun(); /** 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 CopyClones ** ** Copies the hit collection with a given track index offset *@param cl1 Origin *@param cl2 Target *@param offset Index offset **/ virtual void CopyClones(TClonesArray* cl1, TClonesArray* cl2, Int_t offset); /** Virtual method Construct geometry ** ** Constructs the MvdDetector geometry **/ virtual void ConstructGeometry(); void ConstructRootGeometry(); void ConstructASCIIGeometry(); void ExpandNode(TGeoNode *fN); private: /** Track information to be stored until the track leaves the active volume. **/ Int_t fTrackID; //! track index Int_t fVolumeID; //! volume id TLorentzVector fPosIn; //! entry position in global frame TLorentzVector fPosOut; //! exit position in global frame TLorentzVector fPosInLocal; //! entry position in module frame TLorentzVector fPosOutLocal; //! exit position in module frame TLorentzVector fMomIn; //! momentum TLorentzVector fMomOut; //! momentum Double32_t fTime; //! time Double32_t fLength; //! length Double32_t fELoss; //! energy loss std::map fDetIDMap; //! map to create a unique Detector ID Int_t fPosIndex; //! TClonesArray* fMvdCollection; //! Hit collection std::vector fListOfSensitives; bool CheckIfSensitive(std::string name); /** Private method AddHit ** ** Adds a CbmTrdPoint to the HitCollection **/ MvdPoint* AddHit(Int_t trackID, Int_t detID, TString detName, TVector3 posIn, TVector3 posOut, TVector3 momIn, TVector3 momOut, Double_t time, Double_t length, Double_t eLoss); /** Private method ResetParameters ** ** Resets the private members for the track parameters **/ void ResetParameters(); ClassDef(MvdDetector,4) }; inline void MvdDetector::ResetParameters() { fTrackID = fVolumeID = 0; fPosIn.SetXYZM(0.0, 0.0, 0.0, 0.0); fPosOut.SetXYZM(0.0, 0.0, 0.0, 0.0); fPosInLocal.SetXYZM(0.0, 0.0, 0.0, 0.0); fPosOutLocal.SetXYZM(0.0, 0.0, 0.0, 0.0); fMomIn.SetXYZM(0.0, 0.0, 0.0, 0.0); fMomOut.SetXYZM(0.0, 0.0, 0.0, 0.0); fTime = fLength = fELoss = 0; fPosIndex = 0; }; #endif