BmnRoot
Loading...
Searching...
No Matches
BmnVSP.h
Go to the documentation of this file.
1#ifndef BMNVSP_H
2#define BMNVSP_H
3
4#include "BmnVSPPoint.h"
5#include "FairDetector.h"
6#include "TClonesArray.h"
7#include "TGeoMedium.h"
8#include "TLorentzVector.h"
9#include "TVector3.h"
10
11#include <map>
12
13class BmnVSP : public FairDetector
14{
15 public:
16 // *@param name detector name
17 // *@param active sensitivity flag
18 BmnVSP(const char* name, Bool_t active);
20 virtual ~BmnVSP();
21
22 // Defines the action to be taken when a step is inside the
23 // active volume. Creates BmnVSPPoints and adds them to the collection.
24 // @param vol Pointer to the active volume
25 virtual Bool_t ProcessHits(FairVolume* vol = 0);
26
27 // If verbosity level is set, print hit collection at the
28 // end of the event and resets it afterwards.
29 virtual void EndOfEvent();
30
31 // Registers the hit collection in the ROOT manager.
32 virtual void Register();
33
34 // Accessor to the hit collection
35 virtual TClonesArray* GetCollection(Int_t iColl) const;
36
37 // Screen output of hit collection.
38 virtual void Print(Option_t*) const;
39
40 // Clears the hit collection
41 virtual void Reset();
42
43 // *@param cl1 Origin
44 // *@param cl2 Target
45 // *@param offset Index offset
46 virtual void CopyClones(TClonesArray* cl1, TClonesArray* cl2, Int_t offset);
47
48 // Constructs the VSP geometry
49 virtual void ConstructGeometry();
50
51 // Construct the geometry from a GDML geometry file
52 virtual void ConstructGDMLGeometry(TGeoMatrix*);
53
54 void ExpandNodeForGdml(TGeoNode* node);
55
56 // Check whether a volume is sensitive.
57 // The decision is based on the volume name. Only used in case
58 // of GDML and ROOT geometry.
59 // @param name Volume name
60 // @value kTRUE if volume is sensitive, else kFALSE
61 virtual Bool_t CheckIfSensitive(std::string name);
62
63 private:
64 // Track information to be stored until the track leaves the active volume.
65 Int_t fTrackID;
66 Int_t fVolumeID;
67 TVector3 fPosIn;
68 TVector3 fPosOut;
69 TVector3 fMomIn;
70 TVector3 fMomOut;
71 Double32_t fTime;
72 Double32_t fLength;
73 Double32_t fELoss;
74 Int_t fIsPrimary;
75 Double_t fCharge;
76 Int_t fPdgId;
77
78 Int_t fPosIndex;
79 TClonesArray* fPointCollection;
80
81 std::map<TString, TGeoMedium*> fFixedMedia; // List of media "repaired" after importing GMDL
82
83 // Adds a BmnVSPPoint to the HitCollection
84 BmnVSPPoint* AddHit(Int_t trackID,
85 Int_t detID,
86 TVector3 posIn,
87 TVector3 posOut,
88 TVector3 momIn,
89 TVector3 momOut,
90 Double_t time,
91 Double_t length,
92 Double_t eLoss,
93 Int_t isPrimary,
94 Double_t charge,
95 Int_t pdgId);
96
97 // Resets the private members for the track parameters
98 void ResetParameters();
99 BmnVSP(const BmnVSP&) = delete;
100 BmnVSP operator=(const BmnVSP&) = delete;
101
102 ClassDef(BmnVSP, 1)
103};
104
105//------------------------------------------------------------------------------
106inline void BmnVSP::ResetParameters()
107{
108 fTrackID = -1;
109 fVolumeID = 0;
110 fPosIn.SetXYZ(0.0, 0.0, 0.0);
111 fPosOut.SetXYZ(0.0, 0.0, 0.0);
112 fMomIn.SetXYZ(0.0, 0.0, 0.0);
113 fMomOut.SetXYZ(0.0, 0.0, 0.0);
114 fTime = fLength = fELoss = 0.0;
115 fPosIndex = 0;
116};
117//------------------------------------------------------------------------------
118
119#endif /* BMNVSP_H */
virtual TClonesArray * GetCollection(Int_t iColl) const
void ExpandNodeForGdml(TGeoNode *node)
virtual void CopyClones(TClonesArray *cl1, TClonesArray *cl2, Int_t offset)
virtual void ConstructGDMLGeometry(TGeoMatrix *)
virtual void Reset()
virtual Bool_t CheckIfSensitive(std::string name)
virtual void Print(Option_t *) const
BmnVSP(const char *name, Bool_t active)
virtual void Register()
virtual Bool_t ProcessHits(FairVolume *vol=0)
virtual void ConstructGeometry()
virtual ~BmnVSP()
virtual void EndOfEvent()