BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
BmnSilicon.h
Go to the documentation of this file.
1#ifndef BMNSILICON_H
2#define BMNSILICON_H
3
4#include "BmnSiliconPoint.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 BmnSilicon : public FairDetector
14{
15
16 public:
17 // *@param name detector name
18 // *@param active sensitivity flag
19 BmnSilicon(const char* name, Bool_t active);
20
22 virtual ~BmnSilicon();
23
24 // Defines the action to be taken when a step is inside the
25 // active volume. Creates BmnSiliconPoints and adds them to the collection.
26 // @param vol Pointer to the active volume
27 virtual Bool_t ProcessHits(FairVolume* vol = 0);
28
29 // If verbosity level is set, print hit collection at the
30 // end of the event and resets it afterwards.
31 virtual void EndOfEvent();
32
33 // Registers the hit collection in the ROOT manager.
34 virtual void Register();
35
36 // Accessor to the hit collection
37 virtual TClonesArray* GetCollection(Int_t iColl) const;
38
39 // Screen output of hit collection.
40 virtual void Print(Option_t*) const;
41
42 // Clears the hit collection
43 virtual void Reset();
44
45 // *@param cl1 Origin
46 // *@param cl2 Target
47 // *@param offset Index offset
48 virtual void CopyClones(TClonesArray* cl1, TClonesArray* cl2, Int_t offset);
49
50 // Constructs the Silicon geometry
51 virtual void ConstructGeometry();
52
53 // Construct the geometry from a GDML geometry file
55
57
58 // Check whether a volume is sensitive.
59 // The decision is based on the volume name. Only used in case
60 // of GDML and ROOT geometry.
61 // @param name Volume name
62 // @value kTRUE if volume is sensitive, else kFALSE
63 virtual Bool_t CheckIfSensitive(std::string name);
64
65 private:
66 // Track information to be stored until the track leaves the active volume.
67 Int_t fTrackID; //! track index
68 Int_t fVolumeID; //! volume id
69 TVector3 fPosIn; //! position (in)
70 TVector3 fPosOut; //! position (out)
71 TVector3 fMomIn; //! momentum (in)
72 TVector3 fMomOut; //! momentum (out)
73 Double32_t fTime; //! time
74 Double32_t fLength; //! length
75 Double32_t fELoss; //! energy loss
76 Int_t fIsPrimary; //! is track primary?
77 Double_t fCharge; //! track charge
78 Int_t fPdgId; //! pdg id of particle
79
80 Int_t fPosIndex; //!
81 TClonesArray* fPointCollection; //! Hit collection
82
83 std::map<TString, TGeoMedium*> fFixedMedia; // List of media "repaired" after importing GMDL
84
85 // Adds a BmnSiliconPoint to the HitCollection
87 Int_t detID,
88 TVector3 posIn,
89 TVector3 posOut,
90 TVector3 momIn,
91 TVector3 momOut,
92 Double_t time,
93 Double_t length,
94 Double_t eLoss,
95 Int_t isPrimary,
96 Double_t charge,
97 Int_t pdgId);
98
99 // Resets the private members for the track parameters
101 BmnSilicon(const BmnSilicon&) = delete;
103
105};
106
107//------------------------------------------------------------------------------
108inline void BmnSilicon::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 /* BMNSILICON_H */
bool Bool_t
int Int_t
double Double32_t
double Double_t
const char Option_t
#define ClassDef(name, id)
Double32_t fELoss
length
Definition BmnSilicon.h:75
virtual void Register()
Double_t fCharge
is track primary?
Definition BmnSilicon.h:77
void ResetParameters()
virtual void CopyClones(TClonesArray *cl1, TClonesArray *cl2, Int_t offset)
BmnSiliconPoint * 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)
Int_t fVolumeID
track index
Definition BmnSilicon.h:68
TVector3 fPosIn
volume id
Definition BmnSilicon.h:69
Int_t fTrackID
Definition BmnSilicon.h:67
Double32_t fLength
time
Definition BmnSilicon.h:74
virtual Bool_t ProcessHits(FairVolume *vol=0)
Int_t fPosIndex
pdg id of particle
Definition BmnSilicon.h:80
BmnSilicon(const BmnSilicon &)=delete
Int_t fPdgId
track charge
Definition BmnSilicon.h:78
BmnSilicon(const char *name, Bool_t active)
virtual void Reset()
virtual Bool_t CheckIfSensitive(std::string name)
virtual ~BmnSilicon()
Double32_t fTime
momentum (out)
Definition BmnSilicon.h:73
TVector3 fMomOut
momentum (in)
Definition BmnSilicon.h:72
TClonesArray * fPointCollection
Definition BmnSilicon.h:81
void ExpandNodeForGdml(TGeoNode *node)
virtual void ConstructGeometry()
std::map< TString, TGeoMedium * > fFixedMedia
Hit collection.
Definition BmnSilicon.h:83
virtual void ConstructGDMLGeometry(TGeoMatrix *)
BmnSilicon operator=(const BmnSilicon &)=delete
TVector3 fPosOut
position (in)
Definition BmnSilicon.h:70
virtual void Print(Option_t *) const
Int_t fIsPrimary
energy loss
Definition BmnSilicon.h:76
virtual void EndOfEvent()
virtual TClonesArray * GetCollection(Int_t iColl) const
TVector3 fMomIn
position (out)
Definition BmnSilicon.h:71
void SetXYZ(Double_t x, Double_t y, Double_t z)