CbmRoot
CbmPsdMC.h
Go to the documentation of this file.
1 
8 #ifndef CBMPSDMC_H
9 #define CBMPSDMC_H 1
10 
11 #include "FairDetector.h"
12 #include "FairRootManager.h"
13 #include "TClonesArray.h"
14 #include "TLorentzVector.h"
15 #include "TString.h"
16 
17 class FairVolume;
18 
19 
29 class CbmPsdMC : public FairDetector {
30 
31 public:
36  CbmPsdMC(Bool_t active = kTRUE, const char* name = "PSDMC");
37 
38 
40  virtual ~CbmPsdMC();
41 
42 
50  virtual Bool_t CheckIfSensitive(std::string name) {
51  return (TString(name).Contains("scint", TString::kIgnoreCase) ? kTRUE
52  : kFALSE);
53  }
54 
55 
63  virtual void ConstructGeometry();
64 
65 
71  virtual void EndOfEvent();
72 
73 
79  virtual TClonesArray* GetCollection(Int_t iColl) const {
80  return (iColl ? nullptr : fPsdPoints);
81  }
82 
83 
88  virtual void Print(Option_t* opt = "") const;
89 
90 
100  virtual Bool_t ProcessHits(FairVolume* volume = 0);
101 
102 
107  virtual void Register() {
108  FairRootManager::Instance()->Register(
109  "PsdPoint", GetName(), fPsdPoints, kTRUE);
110  }
111 
112 
117  virtual void Reset() { fPsdPoints->Delete(); };
118 
119 
129  void SetPosition(Double_t xPos, Double_t zPos, Double_t rotY) {
130  fPosX = xPos;
131  fPosZ = zPos;
132  fRotY = rotY;
133  fUserPlacement = kTRUE;
134  }
135 
136 
137 private:
138  Double_t fPosX; // x position of PSD centre in cave [cm]
139  Double_t fPosZ; // z position of PSD centre in cave [cm]
140  Double_t fRotY; // Rotation angle of PSD around Y axis [degrees]
141  Bool_t fUserPlacement; // Flag to override placement from file
142  TClonesArray* fPsdPoints;
143 
145  Int_t fTrackID;
146  Int_t fAddress;
147  TLorentzVector fPos;
148  TLorentzVector fMom;
149  Double_t fTime;
150  Double_t fLength;
151  Double_t fEloss;
152  Int_t fLayerID;
153  Int_t fModuleID;
154 
162  void RegisterSensitiveVolumes(TGeoNode* node);
163 
164 
166  CbmPsdMC(const CbmPsdMC&) = delete;
167  CbmPsdMC operator=(const CbmPsdMC&) = delete;
168 
169 
170  ClassDef(CbmPsdMC, 1)
171 };
172 
173 
174 #endif //? CBMPSDMC_H
CbmPsdMC::Reset
virtual void Reset()
Clear output array.
Definition: CbmPsdMC.h:117
CbmPsdMC::Print
virtual void Print(Option_t *opt="") const
Screen log Prints current number of StsPoints in array. Virtual from TObject.
Definition: CbmPsdMC.cxx:145
CbmPsdMC::fEloss
Double_t fEloss
length
Definition: CbmPsdMC.h:151
CbmPsdMC::CbmPsdMC
CbmPsdMC(const CbmPsdMC &)=delete
CbmPsdMC::ProcessHits
virtual Bool_t ProcessHits(FairVolume *volume=0)
Stepping action.
Definition: CbmPsdMC.cxx:153
CbmPsdMC::EndOfEvent
virtual void EndOfEvent()
Action at end of event.
Definition: CbmPsdMC.cxx:137
CbmPsdMC::ConstructGeometry
virtual void ConstructGeometry()
Construct the PSD geometry in the TGeoManager.
Definition: CbmPsdMC.cxx:56
CbmPsdMC::fRotY
Double_t fRotY
Definition: CbmPsdMC.h:140
CbmPsdMC::CbmPsdMC
CbmPsdMC(Bool_t active=kTRUE, const char *name="PSDMC")
Constructor.
Definition: CbmPsdMC.cxx:26
CbmPsdMC::fUserPlacement
Bool_t fUserPlacement
Definition: CbmPsdMC.h:141
CbmPsdMC::fTime
Double_t fTime
momentum
Definition: CbmPsdMC.h:149
CbmPsdMC::GetCollection
virtual TClonesArray * GetCollection(Int_t iColl) const
Get output array of CbmPsdPoints.
Definition: CbmPsdMC.h:79
CbmPsdMC::CheckIfSensitive
virtual Bool_t CheckIfSensitive(std::string name)
Check whether a volume is sensitive.
Definition: CbmPsdMC.h:50
CbmPsdMC::fModuleID
Int_t fModuleID
layer ID
Definition: CbmPsdMC.h:153
CbmPsdMC::fLength
Double_t fLength
time
Definition: CbmPsdMC.h:150
CbmPsdMC::~CbmPsdMC
virtual ~CbmPsdMC()
Definition: CbmPsdMC.cxx:46
CbmPsdMC::operator=
CbmPsdMC operator=(const CbmPsdMC &)=delete
CbmPsdMC::RegisterSensitiveVolumes
void RegisterSensitiveVolumes(TGeoNode *node)
module ID
Definition: CbmPsdMC.cxx:200
CbmPsdMC
Class for the MC transport of the CBM-PSD.
Definition: CbmPsdMC.h:29
CbmPsdMC::fPosX
Double_t fPosX
Definition: CbmPsdMC.h:138
CbmPsdMC::SetPosition
void SetPosition(Double_t xPos, Double_t zPos, Double_t rotY)
Define the PSD position in the cave.
Definition: CbmPsdMC.h:129
CbmPsdMC::fLayerID
Int_t fLayerID
energy loss
Definition: CbmPsdMC.h:152
CbmPsdMC::fMom
TLorentzVector fMom
position
Definition: CbmPsdMC.h:148
CbmPsdMC::fPos
TLorentzVector fPos
address (module and layer)
Definition: CbmPsdMC.h:147
CbmPsdMC::Register
virtual void Register()
Register the output array.
Definition: CbmPsdMC.h:107
CbmPsdMC::fAddress
Int_t fAddress
track index
Definition: CbmPsdMC.h:146
CbmPsdMC::fPosZ
Double_t fPosZ
Definition: CbmPsdMC.h:139
CbmPsdMC::fTrackID
Int_t fTrackID
Output array.
Definition: CbmPsdMC.h:145
CbmPsdMC::fPsdPoints
TClonesArray * fPsdPoints
Definition: CbmPsdMC.h:142