PandaRoot
PndSdsDetector.h
Go to the documentation of this file.
1 //****************************************************************************
2 //* This file is part of PandaRoot. *
3 //* *
4 //* PandaRoot is distributed under the terms of the *
5 //* GNU General Public License (GPL) version 3, *
6 //* copied verbatim in the file "LICENSE". *
7 //* *
8 //* Copyright (C) 2006 - 2024 FAIR GmbH and copyright holders of PandaRoot *
9 //* The copyright holders are listed in the file "COPYRIGHTHOLDERS". *
10 //* The authors are listed in the file "AUTHORS". *
11 //****************************************************************************
12 
13 // -------------------------------------------------------------------------
14 // ----- PndSdsDetector header file -----
15 // ----- Based on PndMvdDetector -----
16 // ----- Created 6/04/06 by T. Stockmanns -----
17 // -------------------------------------------------------------------------
18 
26 #ifndef PNDSDSDETECTOR_H
27 #define PNDSDSDETECTOR_H
28 
29 //#include "TClonesArray.h"
30 #include "TLorentzVector.h"
31 #include "TVector3.h"
32 #include "FairDetector.h"
33 #include "TString.h"
34 #include "PndGeoHandling.h"
35 #include "PndDetectorList.h"
36 
37 #include <string>
38 #include <vector>
39 #include <map>
40 
41 class TClonesArray;
42 class TGeoNode;
43 class PndSdsMCPoint;
44 class FairVolume;
45 
46 class PndSdsDetector : public FairDetector {
47 
48  public:
51 
53  : FairDetector(other), fPersistance(other.fPersistance), fTrackID(other.fTrackID), fVolumeID(other.fVolumeID), fPosIn(other.fPosIn), fPosOut(other.fPosOut),
54  fMomIn(other.fMomIn), fMomOut(other.fMomOut), fTime(other.fTime), fLength(other.fLength), fELoss(other.fELoss), fGeoH(other.fGeoH), fPosIndex(other.fPosIndex),
61  PndSdsDetector(const char *name, Bool_t active);
62 
64  virtual ~PndSdsDetector();
65 
67  {
68  fPersistance = other.fPersistance;
69  fTrackID = other.fTrackID;
70  fVolumeID = other.fVolumeID;
71  fPosIn = other.fPosIn;
72  fPosOut = other.fPosOut;
73  fMomIn = other.fMomIn;
74  fMomOut = other.fMomOut;
75  fTime = other.fTime;
76  fLength = other.fLength;
77  fELoss = other.fELoss;
78  fGeoH = other.fGeoH;
79  fPosIndex = other.fPosIndex;
83  fFolderName = other.fFolderName;
84  fDetectorID = other.fDetectorID;
86  return *this;
87  };
88 
89  virtual void Initialize();
90 
96  virtual void SetBranchNames() = 0;
97 
103  virtual void SetDefaultSensorNames() = 0;
104  void SetExclusiveSensorType(const TString sens);
105 
113  virtual Bool_t ProcessHits(FairVolume *vol = 0);
114 
120  virtual void EndOfEvent();
121 
122  virtual void FinishRun();
123 
128  virtual void Register();
129 
131  virtual TClonesArray *GetCollection(Int_t iColl) const;
132 
137  virtual void Print() const;
138 
143  virtual void SetSpecialPhysicsCuts();
144 
149  virtual void Reset();
150 
158  virtual void CopyClones(TClonesArray *cl1, TClonesArray *cl2, Int_t offset);
159 
164  virtual void ConstructGeometry();
165  // void ConstructRootGeometry();
166  virtual void ConstructASCIIGeometry();
167  // void ExpandNode(TGeoNode *fN);
168 
170  {
171  fDetectorID = id;
172  fDetId = static_cast<int>(id);
173  }
174 
175  void SetRadDamOption(bool val) { fUseRadDamOption = val; };
176  bool GetRadDamOption() { return fUseRadDamOption; };
177 
178  // overload function from FairModule
179  void SetVerboseLevel(Int_t level)
180  {
181  fVerboseLevel = level;
182  fGeoH->SetVerbose(level);
183  }
184 
185  void SetPersistance(Bool_t p = kTRUE) { fPersistance = p; };
186  Bool_t GetPersistance() { return fPersistance; };
187 
188  protected:
189  Bool_t fPersistance; // switch to turn on/off storing the arrays to a file
190 
193  Int_t fTrackID;
194  Int_t fVolumeID;
195  TLorentzVector fPosIn;
196  TLorentzVector fPosOut;
197  TLorentzVector fMomIn;
198  TLorentzVector fMomOut;
199  Double32_t fTime;
200  Double32_t fLength;
201  Double32_t fELoss;
202  // std::map<TString, Int_t> fVolumeIDMap; //! map to create a unique Detector ID
204  Int_t fPosIndex;
205  TClonesArray *fPndSdsCollection;
207  TString fOutBranchName;
208  TString fFolderName;
210 
211  std::vector<std::string> fListOfSensitives;
212 
213  bool CheckIfSensitive(std::string name);
214 
219  PndSdsMCPoint *
220  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);
221 
226  void ResetParameters();
227 
229 };
230 
232 {
233  fTrackID = 0;
234  fVolumeID = 1;
235  fPosIn.SetXYZM(0.0, 0.0, 0.0, 0.0);
236  fPosOut.SetXYZM(0.0, 0.0, 0.0, 0.0);
237  fMomIn.SetXYZM(0.0, 0.0, 0.0, 0.0);
238  fMomOut.SetXYZM(0.0, 0.0, 0.0, 0.0);
239  fTime = fLength = fELoss = 0;
240  fPosIndex = 0;
241 }
242 
243 #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