BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
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);
19 BmnVSP();
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; //! track index
66 Int_t fVolumeID; //! volume id
67 TVector3 fPosIn; //! position (in)
68 TVector3 fPosOut; //! position (out)
69 TVector3 fMomIn; //! momentum (in)
70 TVector3 fMomOut; //! momentum (out)
71 Double32_t fTime; //! time
72 Double32_t fLength; //! length
73 Double32_t fELoss; //! energy loss
74 Int_t fIsPrimary; //! is track primary?
75 Double_t fCharge; //! track charge
76 Int_t fPdgId; //! pdg id of particle
77
79 TClonesArray* fPointCollection; //! Hit collection
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//------------------------------------------------------------------------------
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 */
bool Bool_t
int Int_t
double Double32_t
double Double_t
const char Option_t
#define ClassDef(name, id)
virtual TClonesArray * GetCollection(Int_t iColl) const
Definition BmnVSP.cxx:166
virtual void Print(Option_t *) const
Definition BmnVSP.cxx:173
virtual void Reset()
Definition BmnVSP.cxx:185
BmnVSP()
Definition BmnVSP.cxx:21
Int_t fPdgId
track charge
Definition BmnVSP.h:76
TVector3 fPosOut
position (in)
Definition BmnVSP.h:68
virtual void CopyClones(TClonesArray *cl1, TClonesArray *cl2, Int_t offset)
Definition BmnVSP.cxx:191
TClonesArray * fPointCollection
Definition BmnVSP.h:79
void ExpandNodeForGdml(TGeoNode *node)
Definition BmnVSP.cxx:276
virtual void ConstructGDMLGeometry(TGeoMatrix *)
Definition BmnVSP.cxx:231
BmnVSP operator=(const BmnVSP &)=delete
Int_t fTrackID
Definition BmnVSP.h:65
virtual void EndOfEvent()
Definition BmnVSP.cxx:153
TVector3 fMomIn
position (out)
Definition BmnVSP.h:69
Int_t fPosIndex
pdg id of particle
Definition BmnVSP.h:78
Double32_t fTime
momentum (out)
Definition BmnVSP.h:71
Int_t fVolumeID
track index
Definition BmnVSP.h:66
virtual Bool_t CheckIfSensitive(std::string name)
Definition BmnVSP.cxx:387
TVector3 fMomOut
momentum (in)
Definition BmnVSP.h:70
BmnVSP(const char *name, Bool_t active)
Definition BmnVSP.cxx:30
std::map< TString, TGeoMedium * > fFixedMedia
Hit collection.
Definition BmnVSP.h:81
Int_t fIsPrimary
energy loss
Definition BmnVSP.h:74
Double_t fCharge
is track primary?
Definition BmnVSP.h:75
virtual ~BmnVSP()
Definition BmnVSP.cxx:39
TVector3 fPosIn
volume id
Definition BmnVSP.h:67
BmnVSPPoint * AddHit(Int_t trackID, Int_t detID, TVector3 posIn, TVector3 posOut, TVector3 momIn, TVector3 momOut, Double_t time, Double_t length, Double_t eLoss, Int_t isPrimary, Double_t charge, Int_t pdgId)
Definition BmnVSP.cxx:398
void ResetParameters()
Definition BmnVSP.h:106
BmnVSP(const BmnVSP &)=delete
virtual Bool_t ProcessHits(FairVolume *vol=0)
Definition BmnVSP.cxx:49
virtual void Register()
Definition BmnVSP.cxx:161
virtual void ConstructGeometry()
Definition BmnVSP.cxx:209
Double32_t fELoss
length
Definition BmnVSP.h:73
Double32_t fLength
time
Definition BmnVSP.h:72