PandaRoot
PndDrc.h
Go to the documentation of this file.
1 // -------------------------------------------------------------------------
2 // ----- PndDrc header file -----
3 // ----- Created 11/10/06 by Annalisa Cecchi -----
4 // ----- -----
5 // -------------------------------------------------------------------------
6 
7 #ifndef PNDDRC_H
8 #define PNDDRC_H
9 
10 #include <array>
11 
12 #include "TLorentzVector.h"
13 #include "FairDetector.h"
14 #include "TGraph.h"
15 #include "TRandom.h"
16 #include "TArrayI.h"
17 #include "PndGeoHandling.h"
18 
19 class TClonesArray;
20 class PndDrcPDPoint;
21 class PndDrcBarPoint;
22 class FairVolume;
23 class PndGeoDrc;
24 class PndDrcEVPoint;
25 class TClonesArray;
26 
27 class PndDrc : public FairDetector {
28 
29  public:
31  PndDrc();
32 
37  PndDrc(const char *name, Bool_t active);
38 
40  virtual ~PndDrc();
41 
45  void StopSecondaries(Bool_t ss = kFALSE) { fStopSecondaries = ss; }
46 
50  void StopChargedTrackAfterDIRC(Bool_t sctad = kTRUE) { fStopChargedTrackAfterDIRC = sctad; }
51 
56  void SetDetEffId(Int_t val = 2) { fDetEffId = val; }
57 
68  void SetDetEffAtProduction(Bool_t dep = kFALSE) { fDetEffAtProduction = dep; }
69 
81  void SetTransportEffAtProduction(Bool_t tra = kFALSE) { fTransportEffAtProduction = tra; }
82 
88  void SetMirrorReal(Bool_t mir = kTRUE) { fTakeRealReflectivity = mir; }
89 
90  void SetBlackLensSides(Bool_t lesi = kFALSE) { fSetBlackLens = lesi; }
91 
95  void SetStopTime(Double_t ti = -1.)
96  {
97  fPhoMaxTime = ti;
98  if (fPhoMaxTime > 0.) {
99  fStopTime = kTRUE;
100  }
101  if (fPhoMaxTime <= 0.) {
102  fStopTime = kFALSE;
103  }
104  }
105 
110  void SetOptionForLUT(Bool_t oplu = kFALSE) { fOptionForLUT = oplu; }
111 
112  virtual void Initialize();
113  void SetPersistency(Bool_t v = kTRUE) { fPersistency = v; }
114 
122  virtual Bool_t ProcessHits(FairVolume *vol = 0);
123 
124  virtual void FinishPrimary();
125 
131  virtual void EndOfEvent();
132 
133  virtual void BeginEvent();
138  virtual void Register();
139 
141  virtual TClonesArray *GetCollection(Int_t iColl) const;
142 
147  virtual void Print() const;
148 
153  virtual void Reset();
154 
162  virtual void CopyClones(TClonesArray *clPD1, TClonesArray *clPD2, TClonesArray *clBar1, TClonesArray *clBar2,
163  /*TClonesArray* clSdsPD1, TClonesArray* clSdsPD2, TClonesArray* clSdsBar1, TClonesArray* clSdsBar2, */ Int_t offset);
164 
165  // Int_t GetSensorId(TString);
166 
167  void FinishRun();
168 
172  virtual void ConstructGeometry();
173  virtual void ConstructOpGeometry();
174  // void ConstructASCIIGeometry();
175  // virtual void ConstructRootGeometry();
176  std::vector<std::string> fListOfSensitives;
177  bool CheckIfSensitive(std::string name);
178 
179  void NumberOfBounces(TVector3, TVector3, Int_t, Int_t *, Int_t *, Double_t *, Double_t *);
180  Double_t FindOutPoint(Double_t, Double_t, Double_t, Double_t *, Bool_t);
181 
182  PndDrcPDPoint *
183  AddHit(Int_t trackID, Int_t copyNo, Int_t mcpId, TVector3 pos, TVector3 mom, TVector3 momAtEV, Double_t timeAtEV, Double_t time, Double_t length, Int_t pdgCode, Int_t eventID);
184 
185  PndDrcEVPoint *AddEVHit(Int_t trackID, Int_t copyNo, TVector3 pos, TVector3 mom, Double_t time, Double_t length, Int_t pdgCode, Int_t eventID, Double_t timestart,
186  Double_t timestartEV, Double_t VeloPhoton, TVector3 normal);
187 
189  AddBarHit(Int_t trackID, Int_t copyNo, TVector3 pos, TVector3 mom, Double_t time, Double_t length, Int_t pdgCode, Double_t thetaC, Int_t nBar, Int_t eventID, Double_t mass);
190 
191  void SetRunCherenkov(Bool_t ch) { fRunCherenkov = ch; };
192 
193  private:
194  Bool_t fPersistency;
195 
196  // basic parameters of DIRC
197  Double_t fpi;
198  Double_t fzup;
199  Double_t fzdown;
200  Double_t fradius;
201  Double_t fhthick;
202  Double_t fpipehAngle;
203  Double_t fbbGap;
204 
205  Double_t fbbnum;
206  Double_t fbarnum;
207  Double_t fphi0;
208  Double_t fdphi;
209  Double_t fbarwidth;
210 
211  PndGeoHandling *fGeoH;
212 
213  Bool_t fRunCherenkov; // Switch ON/OFF Cherenkov propagation
214  Int_t fTrackID; // track index
215  Int_t fBarId;
216  TLorentzVector fPos; // position
217  TLorentzVector fMom; // momentum
218  Double32_t fTime; // time
219  Double32_t fLength; // length
220  Double32_t fLengthEV;
221  Double_t fAngIn;
222  Int_t fNBar;
223  Int_t fPosIndex;
224  Int_t volDetector; // MC volume ID of drc
225  Double_t fMass;
226  TLorentzVector fMomAtEV;
227  TLorentzVector fAna_point;
228  Double_t fTimeAtEV;
229  Double_t fTimeAtEVEntrance;
230  Double_t fTimeStart;
231  Double_t fVeloPhoton;
232  Int_t fEVreflections;
233 
234  std::array<TGraph, 2> fDetEff; // Detector Efficiency as a function of photon wavelength
235  Int_t fDetEffId;
236  Bool_t fDetEffAtProduction;
237  Bool_t fTransportEffAtProduction;
238 
239  Bool_t fStopTime;
240  Double_t fPhoMaxTime;
241  Bool_t fTakeRealReflectivity;
242  Bool_t fStopSecondaries;
243  Bool_t fStopChargedTrackAfterDIRC;
244  Bool_t fSetBlackLens;
245  Bool_t fOptionForLUT;
246 
247  PndGeoDrc *fGeo; // Pointer to basic DRC geometry data
248 
249  Int_t fPdgCode;
250  Double_t fThetaC;
251 
252  TClonesArray *fDrcPDCollection; // Hit collection
253  TClonesArray *fDrcEVCollection; // Hit collection
254  TClonesArray *fDrcBarCollection; // Hit collection in the bar
255 
256  Int_t fEventID;
257 
258  ClassDef(PndDrc, 0)
259 };
260 
261 #endif
virtual void Register()
virtual void EndOfEvent()
void SetStopTime(Double_t ti=-1.)
Set time after which photons are killed.
Definition: PndDrc.h:95
void SetBlackLensSides(Bool_t lesi=kFALSE)
Definition: PndDrc.h:90
virtual void FinishPrimary()
virtual void ConstructOpGeometry()
void SetPersistency(Bool_t v=kTRUE)
Definition: PndDrc.h:113
void NumberOfBounces(TVector3, TVector3, Int_t, Int_t *, Int_t *, Double_t *, Double_t *)
void FinishRun()
__m128 v
Definition: P4_F32vec4.h:3
void StopChargedTrackAfterDIRC(Bool_t sctad=kTRUE)
Kill charged track by exiting the DIRC to avoid it hitting the large EV.
Definition: PndDrc.h:50
virtual void Print() const
void SetTransportEffAtProduction(Bool_t tra=kFALSE)
Kill photons at production point according to the transport efficiency distribution.
Definition: PndDrc.h:81
Class to access the naming information of the MVD.
void SetDetEffId(Int_t val=2)
Set MCP-Pmt&#39;s quantum effeciency.
Definition: PndDrc.h:56
Definition: PndDrc.h:27
PndDrcPDPoint * AddHit(Int_t trackID, Int_t copyNo, Int_t mcpId, TVector3 pos, TVector3 mom, TVector3 momAtEV, Double_t timeAtEV, Double_t time, Double_t length, Int_t pdgCode, Int_t eventID)
virtual Bool_t ProcessHits(FairVolume *vol=0)
void SetDetEffAtProduction(Bool_t dep=kFALSE)
Kill photons at production point according to the detector efficiency distribution.
Definition: PndDrc.h:68
Double_t FindOutPoint(Double_t, Double_t, Double_t, Double_t *, Bool_t)
virtual TClonesArray * GetCollection(Int_t iColl) const
PndDrcEVPoint * AddEVHit(Int_t trackID, Int_t copyNo, TVector3 pos, TVector3 mom, Double_t time, Double_t length, Int_t pdgCode, Int_t eventID, Double_t timestart, Double_t timestartEV, Double_t VeloPhoton, TVector3 normal)
void SetRunCherenkov(Bool_t ch)
Definition: PndDrc.h:191
virtual void Reset()
void StopSecondaries(Bool_t ss=kFALSE)
Kill secondaries at its production point.
Definition: PndDrc.h:45
void SetOptionForLUT(Bool_t oplu=kFALSE)
Definition: PndDrc.h:110
std::vector< std::string > fListOfSensitives
Definition: PndDrc.h:176
virtual void BeginEvent()
void SetMirrorReal(Bool_t mir=kTRUE)
Choose between ideal and real mirror:
Definition: PndDrc.h:88
virtual ~PndDrc()
virtual void ConstructGeometry()
virtual void Initialize()
virtual void CopyClones(TClonesArray *clPD1, TClonesArray *clPD2, TClonesArray *clBar1, TClonesArray *clBar2, Int_t offset)
PndDrcBarPoint * AddBarHit(Int_t trackID, Int_t copyNo, TVector3 pos, TVector3 mom, Double_t time, Double_t length, Int_t pdgCode, Double_t thetaC, Int_t nBar, Int_t eventID, Double_t mass)
bool CheckIfSensitive(std::string name)