BmnRoot
Loading...
Searching...
No Matches
BmnSiBT.h
Go to the documentation of this file.
1#ifndef BMNSiBT_H
2#define BMNSiBT_H
3
4#include "BmnSiBTPoint.h"
5#include "FairDetector.h"
6#include "TClonesArray.h"
7#include "TGeoMedium.h"
8#include "TVector3.h"
9
10#include <map>
11
12class BmnSiBT : public FairDetector
13{
14 public:
15 // *@param name detector name
16 // *@param active sensitivity flag
17 BmnSiBT(const char* name, Bool_t active);
18
19 BmnSiBT();
20 virtual ~BmnSiBT();
21
22 // Defines the action to be taken when a step is inside the
23 // active volume. Creates BmnSiBTPoints 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 SiBT 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;
82
83 // Adds a BmnSiBTPoint to the HitCollection
84 BmnSiBTPoint* 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 Int_t stationNum,
97 Int_t moduleNum);
98
99 // Resets the private members for the track parameters
100 void ResetParameters();
101 BmnSiBT(const BmnSiBT&) = delete;
102 BmnSiBT operator=(const BmnSiBT&) = delete;
103
104 ClassDef(BmnSiBT, 1)
105};
106
107//------------------------------------------------------------------------------
108inline void BmnSiBT::ResetParameters()
109{
110 fTrackID = -1;
111 fVolumeID = 0;
112 fPosIn.SetXYZ(0.0, 0.0, 0.0);
113 fPosOut.SetXYZ(0.0, 0.0, 0.0);
114 fMomIn.SetXYZ(0.0, 0.0, 0.0);
115 fMomOut.SetXYZ(0.0, 0.0, 0.0);
116 fTime = fLength = fELoss = 0.0;
117 fPosIndex = 0;
118};
119//------------------------------------------------------------------------------
120
121#endif /* BMNSiBT_H */
virtual void CopyClones(TClonesArray *cl1, TClonesArray *cl2, Int_t offset)
Definition BmnSiBT.cxx:178
virtual ~BmnSiBT()
Definition BmnSiBT.cxx:40
virtual Bool_t CheckIfSensitive(std::string name)
Definition BmnSiBT.cxx:374
BmnSiBT()
Definition BmnSiBT.cxx:22
virtual Bool_t ProcessHits(FairVolume *vol=0)
Definition BmnSiBT.cxx:50
virtual void ConstructGDMLGeometry(TGeoMatrix *)
Definition BmnSiBT.cxx:218
virtual void Register()
Definition BmnSiBT.cxx:148
virtual TClonesArray * GetCollection(Int_t iColl) const
Definition BmnSiBT.cxx:153
virtual void Print(Option_t *) const
Definition BmnSiBT.cxx:160
virtual void Reset()
Definition BmnSiBT.cxx:172
void ExpandNodeForGdml(TGeoNode *node)
Definition BmnSiBT.cxx:263
virtual void ConstructGeometry()
Definition BmnSiBT.cxx:196
virtual void EndOfEvent()
Definition BmnSiBT.cxx:140