PandaRoot
PndDrcTimeDigiTask.h
Go to the documentation of this file.
1 // -------------------------------------------------------------------------
2 // ----- PndDrcTimeDigiTask header file -----
3 // ----- HARPHOOL KUMAWAT h.kumawat@gsi.de -----
4 // ----- -----
5 // ----- -----
6 // -------------------------------------------------------------------------
7 
8 /* * PndDrcTimeDigiTask.h
9 
10  **
11  ** Class for producing DRC hits directly from MCPoints
12 
13  * */
14 
15 #ifndef PNDDRCTIMEDIGITASK_H
16 #define PNDDRCTIMEDIGITASK_H
17 
18 #include <PndPersistencyTask.h>
19 #include "FairTimeStamp.h"
20 #include "TClonesArray.h"
21 #include "PndMCTrack.h"
22 #include "PndDrcDigi.h"
23 #include "PndStack.h"
24 #include "FairBaseParSet.h"
25 #include "PndGeoDrcPar.h"
26 #include "TString.h"
27 #include <string>
28 #include "TH1.h"
29 #include "TH2.h"
30 #include "PndGeoDrc.h"
31 #include "PndGeoHandling.h"
32 
33 #include "PndDrcPDPoint.h"
34 #include "PndDrcBarPoint.h"
35 #include "PndMCTrack.h"
36 
37 #ifndef ROOT_TParticlePDG
38 #include "TParticlePDG.h"
39 #endif
40 #ifndef ROOT_TDatabasePDG
41 #include "TDatabasePDG.h"
42 #endif
43 
44 #include <map>
47 
48  public:
51 
53  PndDrcTimeDigiTask(Int_t verbose);
54 
56  virtual ~PndDrcTimeDigiTask();
57 
59  // virtual void SetParContainers();
60  void RunTimeBased() { fTimeOrderedDigi = kFALSE; /*kTRUE;*/ }
61  virtual InitStatus Init();
62 
64  virtual void Exec(Option_t *option);
65 
67  void Reset();
68 
70  virtual void Finish();
75  PndDrcDigi *AddDrcDigi(Int_t index, Int_t iDetectorId, Double_t charge, Double_t TimeStamp, Int_t csflag);
76 
78  void FindDrcHitPosition(Double_t, Double_t, Double_t, Double_t &, Double_t &, Double_t &, Int_t) // xPoint yPoint zPoint xHit yHit zHit pmtID //[R.K.03/2017] unused variable(s)
79  {
80  std::cerr << "WARNNING PndDrcTimeDigiTask::FindDrcHitPosition() not properly implemented." << std::endl;
81  };
84  void SetFakeDetEff();
87  Double_t FindPhiRot(Double_t, Double_t);
88  Double_t FindOutPoint(Double_t, Double_t, Double_t, Double_t *, Bool_t);
89 
90  void SetActiveTime(Double_t ActiveTime = 10) { fActiveTime = ActiveTime; }
91  void SetTimeSmearing(Bool_t ct = 0) { fTimeSmearing = ct; }
92  void SetChargeSharing(Bool_t ct = 0) { fChargeSharing = ct; }
93  TVector3 GetSensorDimensions(Int_t sensorID);
94 
95  //########################################
96  void SetTilt(Double_t tilt = 0.) { ftilt = tilt; } // degrees
97  void SetTimeOrdered(Bool_t TimeOrderedDigi = kFALSE) { fTimeOrderedDigi = TimeOrderedDigi; } // degrees
98  void SetTimeResolution(Double_t Sigmat = 0.1) { fSigmat = Sigmat; }
99  //########################################
100 
101  void DrawDetEfficiency(Bool_t dr = kFALSE) { fDrawing = dr; }
102 
103  protected:
105 
106  private:
108  TClonesArray *fHitArray;
109  // std::vector<TClonesArray*> fHitArray;
110  void ProcessPhotonPoint();
111  void Smear(Double_t &time, Double_t sigt);
112  void ActivatePixel(Int_t DetectorId, Int_t sensorId, Double_t signalTime, Int_t k, Int_t csflag);
113  Double_t FuncD1(Double_t x);
114  Double_t FuncD3(Double_t x, Double_t y);
115 
116  // basic parameters of DIRC
117  Double_t fPDTimeStamp;
118  Double_t fpi;
119  Double_t fzup;
120  Double_t fzdown;
121  Double_t fradius;
122  Double_t fhthick;
123  Double_t fpipehAngle;
124  Double_t fbbGap;
125  Double_t fbbnum;
126  Double_t fbarnum;
127  Double_t fphi0;
128  Double_t fdphi;
129  Double_t flside;
130  Double_t fbarwidth;
131  Double_t fMcpActiveArea;
132  Double_t fPixelSize;
133  Int_t fNpix; // in one column/row
134  Double_t fPixelGap;
135  Double_t fPixelStep;
136  Double_t fPixelSigma;
137  Double_t fDeadTime; //[ns]
138  Double_t fThreshold; // in % of the total probability of 1 to detect a hit
139  Double_t fTimeGranularity; // granularity of the time signal [ns]
140 
141  Bool_t fisDetEff;
142  Bool_t fisPixel;
143  Bool_t fisTransportEff;
144  Bool_t fDrawing;
145  Bool_t fTimeSmearing;
146  Bool_t fChargeSharing;
147  Double_t ftilt;
148  Int_t fDetectorID;
149  TVector3 fPosHit;
150  TVector3 fDPosHit;
151  TVector3 fPosPDHit;
152  Double_t fThetaC, fErrThetaC;
153  Double_t fTime;
154  Int_t fRefIndex;
155  Int_t fPixelID; // fPDRefIndex;
156  Double_t fTimeOfFlight;
157  Double_t fEventTime;
158  Int_t fBarId;
159  Int_t fBoxId;
160  Int_t fTrackId;
161  TVector3 fTrackIniVertex;
162  Int_t fMrId;
163  Int_t fMrIdPho;
164  Int_t fPdg;
165  TVector3 fTrackMom;
166  Double_t fTimeAtBar;
167  Double_t fActiveTime;
168  Int_t fNDigis;
169  TClonesArray *fDigis;
170  Double_t fPileup;
173  std::map<Int_t, Int_t> fPixelMap;
174  std::map<Int_t, Double_t> fTimeMap;
175 
176  TClonesArray *fBarPointArray; // DRC MC points in the bars
178  TClonesArray *fPDPointArray; // DRC MC points in the photon plane
180  PndDrcDigiWriteoutBuffer *fDrcTimeDigiArray;
181  Bool_t fTimeOrderedDigi;
182  TClonesArray *fDrcDigiArray; // DRC Photon Detector hits
183  TClonesArray *fMCArray; // DRC Hits in the photon detector
184 
185  TH2F *detEffLam;
186 
187  PndGeoDrcPar *fPar;
188 
189  PndGeoDrc *fGeo;
190 
192  Int_t fVerbose;
193 
195  Int_t fDetType; // detector type
196 
197  Double_t nRefrac; // Refractive index of photon detector
198  Double_t fSigmat; // Time Resolution in ps
199  Double_t fCollectionEff; // Collection Efficiency
200  Double_t fPackingFraction; // Packing Fraction or Active Area Ratio
201  Double_t fRoughness; // Surface roughness (bars)
202  Int_t fDetection;
203  Int_t nevents;
204 
205  // vars for detector and transport efficiency
206  Double_t flambda_min, flambda_max, flambda_step;
207  Double_t fDetEfficiency[800];
208  Double_t fTranspEfficiency[798];
209  Double_t flambda_min_tr, flambda_max_tr, flambda_step_tr, fangle_step_tr;
210  Int_t flambda_points_tr;
211  TH1D *PileUp;
212  PndDrcPDPoint *fPpt;
213  PndMCTrack *fMCtrk;
214  PndDrcBarPoint *fBarPoint;
215 
217  void SetParameters();
218 
219  ClassDef(PndDrcTimeDigiTask, 1)
220 };
221 
222 #endif
void SetTimeSmearing(Bool_t ct=0)
void SetChargeSharing(Bool_t ct=0)
void SetTimeResolution(Double_t Sigmat=0.1)
void FindDrcHitPosition(Double_t, Double_t, Double_t, Double_t &, Double_t &, Double_t &, Int_t)
virtual ~PndDrcTimeDigiTask()
void DrawDetEfficiency(Bool_t dr=kFALSE)
Double_t FindPhiRot(Double_t, Double_t)
Double_t FindOutPoint(Double_t, Double_t, Double_t, Double_t *, Bool_t)
virtual InitStatus Init()
Class to access the naming information of the MVD.
PndDrcDigi * AddDrcDigi(Int_t index, Int_t iDetectorId, Double_t charge, Double_t TimeStamp, Int_t csflag)
void SetTilt(Double_t tilt=0.)
PndGeoHandling * fGeoH
void SetActiveTime(Double_t ActiveTime=10)
TVector3 GetSensorDimensions(Int_t sensorID)
void SetTimeOrdered(Bool_t TimeOrderedDigi=kFALSE)
virtual void Exec(Option_t *option)
DetectorId
virtual void Finish()