PandaRoot
PndDrc.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 // ----- PndDrc header file -----
15 // ----- Created 11/10/06 by Annalisa Cecchi -----
16 // ----- -----
17 // -------------------------------------------------------------------------
18 
19 #ifndef PNDDRC_H
20 #define PNDDRC_H
21 
22 #include <array>
23 
24 #include "TLorentzVector.h"
25 #include "FairDetector.h"
26 #include "TGraph.h"
27 #include "TRandom.h"
28 #include "TArrayI.h"
29 #include "PndGeoHandling.h"
30 
31 class TClonesArray;
32 class PndDrcPDPoint;
33 class PndDrcBarPoint;
34 class FairVolume;
35 class PndGeoDrc;
36 class PndDrcEVPoint;
37 class TClonesArray;
38 
39 class PndDrc : public FairDetector {
40 
41  public:
43  PndDrc();
44 
49  PndDrc(const char *name, Bool_t active);
50 
52  virtual ~PndDrc();
53 
57  void StopSecondaries(Bool_t ss = kFALSE) { fStopSecondaries = ss; }
58 
62  void StopChargedTrackAfterDIRC(Bool_t sctad = kTRUE) { fStopChargedTrackAfterDIRC = sctad; }
63 
68  void SetDetEffId(Int_t val = 2) { fDetEffId = val; }
69 
80  void SetDetEffAtProduction(Bool_t dep = kFALSE) { fDetEffAtProduction = dep; }
81 
93  void SetTransportEffAtProduction(Bool_t tra = kFALSE) { fTransportEffAtProduction = tra; }
94 
100  void SetMirrorReal(Bool_t mir = kTRUE) { fTakeRealReflectivity = mir; }
101 
102  void SetBlackLensSides(Bool_t lesi = kFALSE) { fSetBlackLens = lesi; }
103 
107  void SetStopTime(Double_t ti = -1.)
108  {
109  fPhoMaxTime = ti;
110  if (fPhoMaxTime > 0.) {
111  fStopTime = kTRUE;
112  }
113  if (fPhoMaxTime <= 0.) {
114  fStopTime = kFALSE;
115  }
116  }
117 
122  void SetOptionForLUT(Bool_t oplu = kFALSE) { fOptionForLUT = oplu; }
123 
124  virtual void Initialize();
125  void SetPersistency(Bool_t v = kTRUE) { fPersistency = v; }
126 
134  virtual Bool_t ProcessHits(FairVolume *vol = 0);
135 
136  virtual void FinishPrimary();
137 
143  virtual void EndOfEvent();
144 
145  virtual void BeginEvent();
150  virtual void Register();
151 
153  virtual TClonesArray *GetCollection(Int_t iColl) const;
154 
159  virtual void Print() const;
160 
165  virtual void Reset();
166 
174  virtual void CopyClones(TClonesArray *clPD1, TClonesArray *clPD2, TClonesArray *clBar1, TClonesArray *clBar2,
175  /*TClonesArray* clSdsPD1, TClonesArray* clSdsPD2, TClonesArray* clSdsBar1, TClonesArray* clSdsBar2, */ Int_t offset);
176 
177  // Int_t GetSensorId(TString);
178 
179  void FinishRun();
180 
184  virtual void ConstructGeometry();
185  virtual void ConstructOpGeometry();
186  // void ConstructASCIIGeometry();
187  // virtual void ConstructRootGeometry();
188  std::vector<std::string> fListOfSensitives;
189  bool CheckIfSensitive(std::string name);
190 
191  void NumberOfBounces(TVector3, TVector3, Int_t, Int_t *, Int_t *, Double_t *, Double_t *);
192  Double_t FindOutPoint(Double_t, Double_t, Double_t, Double_t *, Bool_t);
193 
194  PndDrcPDPoint *
195  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);
196 
197  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,
198  Double_t timestartEV, Double_t VeloPhoton, TVector3 normal);
199 
201  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);
202 
203  void SetRunCherenkov(Bool_t ch) { fRunCherenkov = ch; };
204 
205  private:
206  Bool_t fPersistency;
207 
208  // basic parameters of DIRC
209  Double_t fpi;
210  Double_t fzup;
211  Double_t fzdown;
212  Double_t fradius;
213  Double_t fhthick;
214  Double_t fpipehAngle;
215  Double_t fbbGap;
216 
217  Double_t fbbnum;
218  Double_t fbarnum;
219  Double_t fphi0;
220  Double_t fdphi;
221  Double_t fbarwidth;
222 
223  PndGeoHandling *fGeoH;
224 
225  Bool_t fRunCherenkov; // Switch ON/OFF Cherenkov propagation
226  Int_t fTrackID; // track index
227  Int_t fBarId;
228  TLorentzVector fPos; // position
229  TLorentzVector fMom; // momentum
230  Double32_t fTime; // time
231  Double32_t fLength; // length
232  Double32_t fLengthEV;
233  Double_t fAngIn;
234  Int_t fNBar;
235  Int_t fPosIndex;
236  Int_t volDetector; // MC volume ID of drc
237  Double_t fMass;
238  TLorentzVector fMomAtEV;
239  TLorentzVector fAna_point;
240  Double_t fTimeAtEV;
241  Double_t fTimeAtEVEntrance;
242  Double_t fTimeStart;
243  Double_t fVeloPhoton;
244  Int_t fEVreflections;
245 
246  std::array<TGraph, 2> fDetEff; // Detector Efficiency as a function of photon wavelength
247  Int_t fDetEffId;
248  Bool_t fDetEffAtProduction;
249  Bool_t fTransportEffAtProduction;
250 
251  Bool_t fStopTime;
252  Double_t fPhoMaxTime;
253  Bool_t fTakeRealReflectivity;
254  Bool_t fStopSecondaries;
255  Bool_t fStopChargedTrackAfterDIRC;
256  Bool_t fSetBlackLens;
257  Bool_t fOptionForLUT;
258 
259  PndGeoDrc *fGeo; // Pointer to basic DRC geometry data
260 
261  Int_t fPdgCode;
262  Double_t fThetaC;
263 
264  TClonesArray *fDrcPDCollection; // Hit collection
265  TClonesArray *fDrcEVCollection; // Hit collection
266  TClonesArray *fDrcBarCollection; // Hit collection in the bar
267 
268  Int_t fEventID;
269 
270  ClassDef(PndDrc, 0)
271 };
272 
273 #endif
virtual void Register()
virtual void EndOfEvent()
void SetStopTime(Double_t ti=-1.)
Set time after which photons are killed.
Definition: PndDrc.h:107
void SetBlackLensSides(Bool_t lesi=kFALSE)
Definition: PndDrc.h:102
virtual void FinishPrimary()
virtual void ConstructOpGeometry()
void SetPersistency(Bool_t v=kTRUE)
Definition: PndDrc.h:125
void NumberOfBounces(TVector3, TVector3, Int_t, Int_t *, Int_t *, Double_t *, Double_t *)
void FinishRun()
__m128 v
Definition: P4_F32vec4.h:15
void StopChargedTrackAfterDIRC(Bool_t sctad=kTRUE)
Kill charged track by exiting the DIRC to avoid it hitting the large EV.
Definition: PndDrc.h:62
virtual void Print() const
void SetTransportEffAtProduction(Bool_t tra=kFALSE)
Kill photons at production point according to the transport efficiency distribution.
Definition: PndDrc.h:93
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:68
Definition: PndDrc.h:39
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:80
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:203
virtual void Reset()
void StopSecondaries(Bool_t ss=kFALSE)
Kill secondaries at its production point.
Definition: PndDrc.h:57
void SetOptionForLUT(Bool_t oplu=kFALSE)
Definition: PndDrc.h:122
std::vector< std::string > fListOfSensitives
Definition: PndDrc.h:188
virtual void BeginEvent()
void SetMirrorReal(Bool_t mir=kTRUE)
Choose between ideal and real mirror:
Definition: PndDrc.h:100
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)