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