FairRoot/PandaRoot
PndSdsDetector.h
Go to the documentation of this file.
1 // -------------------------------------------------------------------------
2 // ----- PndSdsDetector header file -----
3 // ----- Based on PndMvdDetector -----
4 // ----- Created 6/04/06 by T. Stockmanns -----
5 // -------------------------------------------------------------------------
6 
16 #ifndef PNDSDSDETECTOR_H
17 #define PNDSDSDETECTOR_H
18 
19 
20 //#include "TClonesArray.h"
21 #include "TLorentzVector.h"
22 #include "TVector3.h"
23 #include "FairDetector.h"
24 #include "TString.h"
25 #include "PndGeoHandling.h"
26 #include "PndDetectorList.h"
27 
28 #include <string>
29 #include <vector>
30 #include <map>
31 
32 class TClonesArray;
33 class TGeoNode;
34 class PndSdsMCPoint;
35 class FairVolume;
36 
37 
38 
39 class PndSdsDetector : public FairDetector
40 {
41 
42  public:
43 
46 
48  FairDetector(other),
50  fTrackID(other.fTrackID),
51  fVolumeID(other.fVolumeID),
52  fPosIn(other.fPosIn),
53  fPosOut(other.fPosOut),
54  fMomIn(other.fMomIn),
55  fMomOut(other.fMomOut),
56  fTime(other.fTime),
57  fLength(other.fLength),
58  fELoss(other.fELoss),
59  fGeoH(other.fGeoH),
60  fPosIndex(other.fPosIndex),
64  fFolderName(other.fFolderName),
65  fDetectorID(other.fDetectorID),
67  {};
72  PndSdsDetector(const char* name, Bool_t active);
73 
75  virtual ~PndSdsDetector();
76 
78  {
80  fTrackID=other.fTrackID;
81  fVolumeID=other.fVolumeID;
82  fPosIn=other.fPosIn;
83  fPosOut=other.fPosOut;
84  fMomIn=other.fMomIn;
85  fMomOut=other.fMomOut;
86  fTime=other.fTime;
87  fLength=other.fLength;
88  fELoss=other.fELoss;
89  fGeoH=other.fGeoH;
90  fPosIndex=other.fPosIndex;
97  return *this;
98  };
99 
100  virtual void Initialize();
101 
107  virtual void SetBranchNames()=0;
108 
114  virtual void SetDefaultSensorNames() = 0;
115  void SetExclusiveSensorType(const TString sens);
116 
124  virtual Bool_t ProcessHits(FairVolume* vol = 0);
125 
126 
132  virtual void EndOfEvent();
133 
134  virtual void FinishRun();
135 
136 
141  virtual void Register();
142 
143 
145  virtual TClonesArray* GetCollection(Int_t iColl) const;
146 
147 
152  virtual void Print() const;
153 
154 
159  virtual void SetSpecialPhysicsCuts();
160 
161 
166  virtual void Reset();
167 
168 
176  virtual void CopyClones(TClonesArray* cl1, TClonesArray* cl2,
177  Int_t offset);
178 
179 
184  virtual void ConstructGeometry();
185  // void ConstructRootGeometry();
186  virtual void ConstructASCIIGeometry();
187  // void ExpandNode(TGeoNode *fN);
188 
189  void SetDetectorID(DetectorId id){fDetectorID = id;fDetId =id;}
190 
193 
194  // overload function from FairModule
195  void SetVerboseLevel(Int_t level){fVerboseLevel=level;fGeoH->SetVerbose(level);}
196 
199 
200 protected:
201 
202  Bool_t fPersistance; // switch to turn on/off storing the arrays to a file
203 
204 
207  Int_t fTrackID;
208  Int_t fVolumeID;
209  TLorentzVector fPosIn;
210  TLorentzVector fPosOut;
211  TLorentzVector fMomIn;
212  TLorentzVector fMomOut;
213  Double32_t fTime;
214  Double32_t fLength;
215  Double32_t fELoss;
216 // std::map<TString, Int_t> fVolumeIDMap; //! map to create a unique Detector ID
218  Int_t fPosIndex;
219  TClonesArray* fPndSdsCollection;
224 
225  std::vector<std::string> fListOfSensitives;
226 
227  bool CheckIfSensitive(std::string name);
228 
233  PndSdsMCPoint* AddHit(Int_t trackID, Int_t detID, Int_t sensorID,
234  TVector3 posIn, TVector3 posOut,
235  TVector3 momIn, TVector3 momOut,
236  Double_t time, Double_t length, Double_t eLoss);
237 
238 
243  void ResetParameters();
244 
245 
247 
248 };
249 
250 
252  fTrackID = 0;
253  fVolumeID = 1;
254  fPosIn.SetXYZM(0.0, 0.0, 0.0, 0.0);
255  fPosOut.SetXYZM(0.0, 0.0, 0.0, 0.0);
256  fMomIn.SetXYZM(0.0, 0.0, 0.0, 0.0);
257  fMomOut.SetXYZM(0.0, 0.0, 0.0, 0.0);
258  fTime = fLength = fELoss = 0;
259  fPosIndex = 0;
260 }
261 
262 
263 #endif
264 
Double_t p
Definition: anasim.C:58
virtual void SetBranchNames()=0
TClonesArray * fPndSdsCollection
TLorentzVector fPosOut
entry position in global frame
Int_t fVolumeID
track index
void SetExclusiveSensorType(const TString sens)
virtual void CopyClones(TClonesArray *cl1, TClonesArray *cl2, Int_t offset)
TLorentzVector fMomOut
momentum
bool GetRadDamOption()
Double_t val[nBoxes][nFEBox]
Definition: createCalib.C:11
TLorentzVector fPosIn
Det id.
Int_t fPosIndex
Gives Access to the Path info of a hit.
PndSdsDetector(PndSdsDetector &other)
std::vector< std::string > fListOfSensitives
To be set by daughter classes.
Bool_t GetPersistance()
TVector3 offset(2, 0, 0)
virtual void ConstructGeometry()
Class to access the naming information of the MVD.
Double_t
void SetRadDamOption(bool val)
void SetPersistance(Bool_t p=kTRUE)
Double32_t fTime
momentum
void SetDetectorID(DetectorId id)
virtual void FinishRun()
PndGeoHandling * fGeoH
energy loss
virtual Bool_t ProcessHits(FairVolume *vol=0)
ClassDef(PndSdsDetector, 6)
virtual void SetSpecialPhysicsCuts()
virtual void Register()
TString name
virtual ~PndSdsDetector()
void SetVerbose(Int_t v)
PndSdsDetector & operator=(PndSdsDetector &other)
virtual void SetDefaultSensorNames()=0
virtual void Print() const
Double32_t fLength
time
virtual void EndOfEvent()
virtual void Reset()
void SetVerboseLevel(Int_t level)
TString fOutBranchName
enables the detection of neutral particles
virtual void ConstructASCIIGeometry()
Double32_t fELoss
length
void ResetParameters()
TLorentzVector fMomIn
exit position in global frame
bool CheckIfSensitive(std::string name)
PndSdsMCPoint * AddHit(Int_t trackID, Int_t detID, Int_t sensorID, TVector3 posIn, TVector3 posOut, TVector3 momIn, TVector3 momOut, Double_t time, Double_t length, Double_t eLoss)
TString fFolderName
To be set by daughter classes.
DetectorId fDetectorID
To be set by daughter classes.
bool fUseRadDamOption
Hit collection.
virtual TClonesArray * GetCollection(Int_t iColl) const
virtual void Initialize()