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 
14 #ifndef PNDSDSDETECTOR_H
15 #define PNDSDSDETECTOR_H
16 
17 //#include "TClonesArray.h"
18 #include "TLorentzVector.h"
19 #include "TVector3.h"
20 #include "FairDetector.h"
21 #include "TString.h"
22 #include "PndGeoHandling.h"
23 #include "PndDetectorList.h"
24 
25 #include <string>
26 #include <vector>
27 #include <map>
28 
29 class TClonesArray;
30 class TGeoNode;
31 class PndSdsMCPoint;
32 class FairVolume;
33 
34 class PndSdsDetector : public FairDetector {
35 
36  public:
39 
41  : FairDetector(other), fPersistance(other.fPersistance), fTrackID(other.fTrackID), fVolumeID(other.fVolumeID), fPosIn(other.fPosIn), fPosOut(other.fPosOut),
42  fMomIn(other.fMomIn), fMomOut(other.fMomOut), fTime(other.fTime), fLength(other.fLength), fELoss(other.fELoss), fGeoH(other.fGeoH), fPosIndex(other.fPosIndex),
49  PndSdsDetector(const char *name, Bool_t active);
50 
52  virtual ~PndSdsDetector();
53 
55  {
56  fPersistance = other.fPersistance;
57  fTrackID = other.fTrackID;
58  fVolumeID = other.fVolumeID;
59  fPosIn = other.fPosIn;
60  fPosOut = other.fPosOut;
61  fMomIn = other.fMomIn;
62  fMomOut = other.fMomOut;
63  fTime = other.fTime;
64  fLength = other.fLength;
65  fELoss = other.fELoss;
66  fGeoH = other.fGeoH;
67  fPosIndex = other.fPosIndex;
71  fFolderName = other.fFolderName;
72  fDetectorID = other.fDetectorID;
74  return *this;
75  };
76 
77  virtual void Initialize();
78 
84  virtual void SetBranchNames() = 0;
85 
91  virtual void SetDefaultSensorNames() = 0;
92  void SetExclusiveSensorType(const TString sens);
93 
101  virtual Bool_t ProcessHits(FairVolume *vol = 0);
102 
108  virtual void EndOfEvent();
109 
110  virtual void FinishRun();
111 
116  virtual void Register();
117 
119  virtual TClonesArray *GetCollection(Int_t iColl) const;
120 
125  virtual void Print() const;
126 
131  virtual void SetSpecialPhysicsCuts();
132 
137  virtual void Reset();
138 
146  virtual void CopyClones(TClonesArray *cl1, TClonesArray *cl2, Int_t offset);
147 
152  virtual void ConstructGeometry();
153  // void ConstructRootGeometry();
154  virtual void ConstructASCIIGeometry();
155  // void ExpandNode(TGeoNode *fN);
156 
158  {
159  fDetectorID = id;
160  fDetId = static_cast<int>(id);
161  }
162 
163  void SetRadDamOption(bool val) { fUseRadDamOption = val; };
164  bool GetRadDamOption() { return fUseRadDamOption; };
165 
166  // overload function from FairModule
167  void SetVerboseLevel(Int_t level)
168  {
169  fVerboseLevel = level;
170  fGeoH->SetVerbose(level);
171  }
172 
173  void SetPersistance(Bool_t p = kTRUE) { fPersistance = p; };
174  Bool_t GetPersistance() { return fPersistance; };
175 
176  protected:
177  Bool_t fPersistance; // switch to turn on/off storing the arrays to a file
178 
181  Int_t fTrackID;
182  Int_t fVolumeID;
183  TLorentzVector fPosIn;
184  TLorentzVector fPosOut;
185  TLorentzVector fMomIn;
186  TLorentzVector fMomOut;
187  Double32_t fTime;
188  Double32_t fLength;
189  Double32_t fELoss;
190  // std::map<TString, Int_t> fVolumeIDMap; //! map to create a unique Detector ID
192  Int_t fPosIndex;
193  TClonesArray *fPndSdsCollection;
195  TString fOutBranchName;
196  TString fFolderName;
198 
199  std::vector<std::string> fListOfSensitives;
200 
201  bool CheckIfSensitive(std::string name);
202 
207  PndSdsMCPoint *
208  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);
209 
214  void ResetParameters();
215 
217 };
218 
220 {
221  fTrackID = 0;
222  fVolumeID = 1;
223  fPosIn.SetXYZM(0.0, 0.0, 0.0, 0.0);
224  fPosOut.SetXYZM(0.0, 0.0, 0.0, 0.0);
225  fMomIn.SetXYZM(0.0, 0.0, 0.0, 0.0);
226  fMomOut.SetXYZM(0.0, 0.0, 0.0, 0.0);
227  fTime = fLength = fELoss = 0;
228  fPosIndex = 0;
229 }
230 
231 #endif
virtual void SetBranchNames()=0
TClonesArray * fPndSdsCollection
virtual void EndOfEvent()
TLorentzVector fPosOut
entry position in global frame
Int_t fVolumeID
track index
void SetExclusiveSensorType(const TString sens)
virtual void Register()
TLorentzVector fMomOut
momentum
bool GetRadDamOption()
virtual Bool_t ProcessHits(FairVolume *vol=0)
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()
virtual void ConstructGeometry()
Class to access the naming information of the MVD.
virtual void ConstructASCIIGeometry()
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)
void SetRadDamOption(bool val)
void SetPersistance(Bool_t p=kTRUE)
Double32_t fTime
momentum
void SetDetectorID(DetectorId id)
PndGeoHandling * fGeoH
energy loss
ClassDef(PndSdsDetector, 6)
virtual ~PndSdsDetector()
void SetVerbose(Int_t v)
PndSdsDetector & operator=(PndSdsDetector &other)
virtual void Reset()
virtual void SetDefaultSensorNames()=0
virtual void SetSpecialPhysicsCuts()
Double32_t fLength
time
virtual void CopyClones(TClonesArray *cl1, TClonesArray *cl2, Int_t offset)
void SetVerboseLevel(Int_t level)
TString fOutBranchName
enables the detection of neutral particles
Double32_t fELoss
length
void ResetParameters()
DetectorId
TLorentzVector fMomIn
exit position in global frame
bool CheckIfSensitive(std::string name)
virtual TClonesArray * GetCollection(Int_t iColl) const
virtual void FinishRun()
TString fFolderName
To be set by daughter classes.
DetectorId fDetectorID
To be set by daughter classes.
bool fUseRadDamOption
Hit collection.
virtual void Initialize()
virtual void Print() const