BmnRoot 26.10.0-19-g6979a6c6
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
CbmSts.h
Go to the documentation of this file.
1// -------------------------------------------------------------------------
2// ----- CbmSts header file -----
3// ----- Created 26/07/04 by V. Friese -----
4// -------------------------------------------------------------------------
5
6/** CbmSts.h
7 *@author V.Friese <v.friese@gsi.de>
8 **
9 ** Defines the active detector STS. Constructs the geometry and
10 ** registeres MCPoints.
11 **/
12
13#ifndef CBMSTS_H
14#define CBMSTS_H
15
16#include "CbmStsPoint.h"
17#include "FairDetector.h"
18#include "TLorentzVector.h"
19
20#include <map>
21
22class CbmSts : public FairDetector
23{
24 public:
25 /** Default constructor **/
26 CbmSts();
27
28 /** Standard constructor.
29 *@param name detetcor name
30 *@param active sensitivity flag
31 **/
32 CbmSts(const char* name, Bool_t active);
33
34 /** Destructor **/
35 virtual ~CbmSts();
36
37 /** Virtual method ProcessHits
38 **
39 ** Defines the action to be taken when a step is inside the
40 ** active volume. Creates a CbmStsPoint and adds it to the
41 ** collection.
42 *@param vol Pointer to the active volume
43 **/
44 virtual Bool_t ProcessHits(FairVolume* vol = 0);
45
46 /** Virtual method BeginEvent
47 **
48 ** If verbosity level is set, print hit collection at the
49 ** end of the event and resets it afterwards.
50 **/
51
52 virtual void BeginEvent();
53
54 /** Virtual method EndOfEvent
55 **
56 ** If verbosity level is set, print hit collection at the
57 ** end of the event and resets it afterwards.
58 **/
59
60 virtual void EndOfEvent();
61
62 /** Virtual method Register
63 **
64 ** Registers the hit collection in the ROOT manager.
65 **/
66 virtual void Register();
67
68 /** Accessor to the hit collection **/
69 virtual TClonesArray* GetCollection(Int_t iColl) const;
70
71 /** Virtual method Print
72 **
73 ** Screen output of hit collection.
74 **/
75 virtual void Print(Option_t*) const;
76
77 /** Virtual method Reset
78 **
79 ** Clears the hit collection
80 **/
81 virtual void Reset();
82
83 /** Virtual method CopyClones
84 **
85 ** Copies the hit collection with a given track index offset
86 *@param cl1 Origin
87 *@param cl2 Target
88 *@param offset Index offset
89 **/
90 virtual void CopyClones(TClonesArray* cl1, TClonesArray* cl2, Int_t offset);
91
92 /** Construct the STS geometry.
93 ** Depending on the geometry file extension, the base class method
94 ** ConstructRootGeometry is called (.root), or the ASCII geometry
95 ** file is read by the FairGeoLoader (.geo).
96 ** @since 11.06.2012
97 **/
98 virtual void ConstructGeometry();
99
100 /** Construct the geometry from an ASCII geometry file **/
101 virtual void ConstructAsciiGeometry();
102
103 /** Construct the geometry from a GDML geometry file **/
104 virtual void ConstructGDMLGeometry(TGeoMatrix*);
105
106 /** Check whether a volume is sensitive.
107 ** The decision is based on the volume name. Only used in case
108 ** of ROOT geometry.
109 ** @since 11.06.2012
110 ** @param(name) Volume name
111 ** @value kTRUE if volume is sensitive, else kFALSE
112 **/
113 virtual Bool_t CheckIfSensitive(std::string name);
114
115 // void SaveGeoParams();
116
117 private:
118 /** Track information to be stored until the track leaves the active volume. **/
119 Int_t fTrackID; //! track index
120 Int_t fVolumeID; //! volume id
121 Int_t fDetectorId; // ! Unique detector ID
122 TVector3 fPosIn, fPosOut; //! position
123 TVector3 fMomIn, fMomOut; //! momentum
125 Double32_t fLength; //! length
126 Double32_t fELoss; //! energy loss
127
129 TClonesArray* fStsCollection; //! The hit collection
130
131 /** Private method AddHit
132 **
133 ** Adds a StsPoint to the HitCollection
134 **/
135 CbmStsPoint* AddHit(Int_t trackID,
136 Int_t detID,
137 TVector3 posIn,
138 TVector3 pos_out,
139 TVector3 momIn,
140 TVector3 momOut,
141 Double_t time,
142 Double_t length,
143 Double_t eLoss,
144 Int_t stationNum,
145 Int_t moduleNum);
146
147 // Int_t GetCurrentDetectorId();
148
149 /** Private method ResetParameters
150 **
151 ** Resets the private members for the track parameters
152 **/
153 void ResetParameters();
154 CbmSts(const CbmSts&) = delete;
155 CbmSts operator=(const CbmSts&) = delete;
156
157 ClassDef(CbmSts, 1);
158};
159
161{
162 fTrackID = fVolumeID = 0;
163 fPosIn.SetXYZ(0.0, 0.0, 0.0);
164 fPosOut.SetXYZ(0.0, 0.0, 0.0);
165 fMomIn.SetXYZ(0.0, 0.0, 0.0);
166 fMomOut.SetXYZ(0.0, 0.0, 0.0);
167 fTime = fLength = fELoss = 0;
168 fPosIndex = 0;
169};
170
171#endif
bool Bool_t
int Int_t
double Double32_t
double Double_t
const char Option_t
#define ClassDef(name, id)
virtual void Reset()
Virtual method Reset.
Definition CbmSts.cxx:227
TVector3 fMomOut
Definition CbmSts.h:123
CbmSts()
Default constructor.
Definition CbmSts.cxx:39
Double32_t fLength
time
Definition CbmSts.h:125
virtual void ConstructAsciiGeometry()
Construct the geometry from an ASCII geometry file.
Definition CbmSts.cxx:272
TClonesArray * fStsCollection
Definition CbmSts.h:129
virtual TClonesArray * GetCollection(Int_t iColl) const
Accessor to the hit collection.
Definition CbmSts.cxx:209
Double32_t fTime
momentum
Definition CbmSts.h:124
virtual void Print(Option_t *) const
Virtual method Print.
Definition CbmSts.cxx:219
virtual Bool_t ProcessHits(FairVolume *vol=0)
Virtual method ProcessHits.
Definition CbmSts.cxx:98
Int_t fVolumeID
track index
Definition CbmSts.h:120
virtual void ConstructGDMLGeometry(TGeoMatrix *)
Construct the geometry from a GDML geometry file.
Definition CbmSts.cxx:311
virtual void Register()
Virtual method Register.
Definition CbmSts.cxx:202
TVector3 fPosIn
Definition CbmSts.h:122
Int_t fPosIndex
energy loss
Definition CbmSts.h:128
virtual void ConstructGeometry()
Construct the STS geometry.
Definition CbmSts.cxx:254
Int_t fDetectorId
volume id
Definition CbmSts.h:121
virtual void BeginEvent()
Virtual method BeginEvent.
Definition CbmSts.cxx:187
TVector3 fMomIn
position
Definition CbmSts.h:123
CbmStsPoint * AddHit(Int_t trackID, Int_t detID, TVector3 posIn, TVector3 pos_out, TVector3 momIn, TVector3 momOut, Double_t time, Double_t length, Double_t eLoss, Int_t stationNum, Int_t moduleNum)
The hit collection.
Definition CbmSts.cxx:416
CbmSts(const CbmSts &)=delete
Int_t fTrackID
Track information to be stored until the track leaves the active volume.
Definition CbmSts.h:119
TVector3 fPosOut
Definition CbmSts.h:122
CbmSts operator=(const CbmSts &)=delete
virtual Bool_t CheckIfSensitive(std::string name)
Check whether a volume is sensitive.
Definition CbmSts.cxx:405
virtual ~CbmSts()
Destructor.
Definition CbmSts.cxx:88
virtual void EndOfEvent()
Virtual method EndOfEvent.
Definition CbmSts.cxx:189
void ResetParameters()
Private method ResetParameters.
Definition CbmSts.h:160
virtual void CopyClones(TClonesArray *cl1, TClonesArray *cl2, Int_t offset)
Virtual method CopyClones.
Definition CbmSts.cxx:236
Double32_t fELoss
length
Definition CbmSts.h:126