FairRoot/PandaRoot
PndDrc.cxx
Go to the documentation of this file.
1 
2 // -------------------------------------------------------------------------
3 // ----- PndDrc source file -----
4 // ----- Created 11/10/06 by Annalisa Cecchi -----
5 // ----- Modified 2006++ by Carsten Schwarz -----
6 // ----- Modified 2010++ by Maria Patsyuk -----
7 // ----- -----
8 // -------------------------------------------------------------------------
9 
10 
11 #include "PndGeoDrc.h"
12 #include "PndDrcPDPoint.h"
13 #include "PndDrcBarPoint.h"
14 #include "PndDrcEVPoint.h"
15 #include "PndGeoDrcPar.h"
16 #include "PndDetectorList.h"
17 #include "PndDrc.h"
18 
19 #include "TString.h"
20 using std::endl;
21 using std::cout;
22 
23 #include "TClonesArray.h"
24 #include "TVirtualMC.h"
25 #include "TObjArray.h"
26 #include "TGeoMCGeometry.h"
27 #include "TLorentzVector.h"
28 #include "TParticle.h"
29 #include "TVirtualMC.h"
30 #include "TGeoPgon.h"
31 #include "TGeoSphere.h"
32 #include "TGeoBBox.h"
33 #include "TGeoArb8.h"
34 #include "TGeoCone.h"
35 #include "TGeoTrd2.h"
36 #include "TGeoCompositeShape.h"
37 #include "TGeoMatrix.h"
38 #include "TGeoManager.h"
39 #include "TObject.h"
40 #include "TColor.h"
41 
42 #include "TCanvas.h"
43 #include "TH1.h"
44 #include "TH2.h"
45 
46 #include "FairGeoInterface.h"
47 #include "FairGeoLoader.h"
48 #include "FairGeoNode.h"
49 #include "FairRootManager.h"
50 #include "FairVolume.h"
51 #include "FairGeoMedia.h"
52 #include "FairGeoMedium.h"
53 #include "FairGeoRootBuilder.h"
54 #include "PndStack.h"
55 #include "PndDetectorList.h"
56 
57 // add on for debug
58 //#include "FairGeoG3Builder.h"
59 #include "FairRun.h"
60 //#include "FairRunSim.h"
61 #include "FairRuntimeDb.h"
62 #include "PndGeoHandling.h"
63 
64 #include <cmath>
65 
66 // ----- Default constructor -------------------------------------------
68  : FairDetector("PndDrcDefault",kTRUE),
69  fPersistency(kTRUE),
70  fpi(TMath::Pi()),
71  fzup(-999.),
72  fzdown(-999.),
73  fradius(-999.),
74  fhthick(-999.),
75  fpipehAngle(-999.),
76  fbbGap(-999.),
77  fbbnum(-999.),
78  fbarnum(-999.),
79  fphi0(-999.),
80  fdphi(-999.),
81  fbarwidth(-999.),
82 
83  fGeoH(NULL),
84 
85  fRunCherenkov(kTRUE),
86  fTrackID(-1),
87  fPos(TLorentzVector(0,0,0,0)),
88  fMom(TLorentzVector(0,0,0,0)),
89  fTime(-1),
90  fLength(-1),
91  fAngIn(0),
92  fNBar(0),
93  fPosIndex(-1),
94  volDetector(0),
95  fMass(-1),
96 
97  fDetEff(0x0),
98  fDetEffAtProduction(kFALSE),
99  fTransportEffAtProduction(kFALSE),
100  fRand(),
101  fCollectionEff(-1),//Collection Efficiency
102 
103  fStopTime(kFALSE),
104  fPhoMaxTime(-1),
105 
106  fTakeRealReflectivity(kFALSE),
107  fStopSecondaries(kFALSE),
108  fStopChargedTrackAfterDIRC(kFALSE),
109  fGeo(new PndGeoDrc()),
110 
111  fPdgCode(-1),
112  fThetaC(-1),
113 
114  fDrcPDCollection(new TClonesArray("PndDrcPDPoint")),
115  fDrcEVCollection(new TClonesArray("PndDrcEVPoint")),
116  fDrcBarCollection (new TClonesArray("PndDrcBarPoint")),
117  fEventID(0)
118 {
119  fListOfSensitives.push_back("Sensor");
120  if(fVerboseLevel > 0){
121  std::cout<<"-I- PndBarrelDIRC: fListOfSensitives contains:";
122  for(size_t k=0; k<fListOfSensitives.size(); k++)
123  std::cout<<"\n\t"<<fListOfSensitives[k];
124  std::cout<<std::endl;
125  }
126 
127  if(fGeoH == NULL) fGeoH = PndGeoHandling::Instance();
128 }
129 
130 // ----- Standard constructor ------------------------------------------
131 PndDrc::PndDrc(const char* name, Bool_t active)
132  : FairDetector(name, active),
133  fPersistency(kTRUE),
134  fpi(TMath::Pi()),
135  fzup(-999.),
136  fzdown(-999.),
137  fradius(-999.),
138  fhthick(-999.),
139  fpipehAngle(-999.),
140  fbbGap(-999.),
141  fbbnum(-999.),
142  fbarnum(-999.),
143  fphi0(-999.),
144  fdphi(-999.),
145  fbarwidth(-999.),
146 
147  fGeoH(NULL),
148 
149  fRunCherenkov(kTRUE),
150  fTrackID(-1),
151  fPos(TLorentzVector(0,0,0,0)),
152  fMom(TLorentzVector(0,0,0,0)),
153  fTime(-1),
154  fLength(-1),
155  fAngIn(0),
156  fNBar(0),
157  fPosIndex(-1),
158  volDetector(0),
159  fMass(-1),
160 
161  fDetEff(0x0),
162  fDetEffAtProduction(kFALSE),
163  fTransportEffAtProduction(kFALSE),
164  fRand(),
165  fCollectionEff(-1),//Collection Efficiency
166 
167  fStopTime(kFALSE),
168  fPhoMaxTime(-1),
169 
170  fTakeRealReflectivity(kFALSE),
171  fStopSecondaries(kFALSE),
172 
173  fStopChargedTrackAfterDIRC(kFALSE),
174  fGeo(new PndGeoDrc()),
175 
176  fPdgCode(-1),
177  fThetaC(-1),
178 
179  fDrcPDCollection(new TClonesArray("PndDrcPDPoint")),
180  fDrcEVCollection(new TClonesArray("PndDrcEVPoint")),
181  fDrcBarCollection (new TClonesArray("PndDrcBarPoint")),
182  fEventID(0)
183 {
184  fListOfSensitives.push_back("Sensor");
185  if(fVerboseLevel > 0){
186  std::cout<<"-I- PndBarrelDIRC: fListOfSensitives contains:";
187  for(size_t k=0; k<fListOfSensitives.size(); k++)
188  std::cout<<"\n\t"<<fListOfSensitives[k];
189  std::cout<<std::endl;
190  }
191 
192  if(fGeoH == NULL) fGeoH = PndGeoHandling::Instance();
193 
194 }
195 
196 // ----- Destructor ----------------------------------------------------
198  if (fDrcPDCollection) {
199  fDrcPDCollection->Delete();
200  delete fDrcPDCollection;
201  }
202 
203  if (fDrcEVCollection) {
204  fDrcEVCollection->Delete();
205  delete fDrcEVCollection;
206  }
207 
208  if (fDrcBarCollection) {
209  fDrcBarCollection->Delete();
210  delete fDrcBarCollection;
211  }
212 
213  if (fGeo) delete fGeo;
214 
215 }
216 
217 // ----- Public method Intialize ---------------------------------------
219  cout << " -I- PndDrc: Intialization started... " << endl;
221  //FairRun *sim = FairRun::Instance();
222  //FairRuntimeDb *rtdb = sim->GetRuntimeDb();
223  //PndGeoDrcPar *par = (PndGeoDrcPar*)(rtdb->getContainer("PndGeoDrcPar"));
224 
225  if (0==gGeoManager)
226  cout << "We do not have gGeoManager" << endl;
227  else
228  cout << "there is gGeoManager" << endl;
229 
230 
231  cout << "list of sensitives has " << fListOfSensitives.size() << " entries" << endl;
233  if(fVerboseLevel>0) fGeoH->PrintSensorNames();
234 
235  if (fRunCherenkov==kFALSE) cout << " -I- PndDrc: Switching OFF Cherenkov Propagation" << endl;
236 
237  // basic DIRC parameters:
238  fpi = TMath::Pi();
239  fzup = fGeo->barBoxZUp();
240  fzdown = fGeo->barBoxZDown();
241  fradius = fGeo->radius(); //radius in the middle of the bar = 50.cm
242  fhthick = fGeo->barHalfThick(); //half thickness of the bars=1.7/2 cm
244  fbbGap = fGeo->BBoxGap();
245  fbbnum = fGeo->BBoxNum();
246  fbarnum = fGeo->barNum();
247  fphi0 = (180.-2.*fpipehAngle)/fbbnum + fpipehAngle;
248  fdphi = (180.-2.*fpipehAngle)/fbbnum*2.;
249  fbarwidth = fGeo->BarWidth();
250 
251  // create a detector efficiency function:
252  if(fDetEffAtProduction == kTRUE){
253  fCollectionEff=0.65;//Collection Efficiency
254 
255  // quantum efficiency data from Alex Britting, Jan 25, 2011
256  // unit is percent
257  // first value is at 200 nm, last at 700 nm
258  // credible range start around 250nm, >= 280nm to be safe
259 
260  Int_t credibleLimit=280;
261  Double_t efficiency[501] = {231.84,615.36,657.4,258.78,9839.92,44.67,67.87,51.01,41.49,5.36,49.4,2.13,35.49,8.66,5.03,7.51,13.27,18.71,3.92,3.66,8.2,0.56,7.68,2.87,10.06,3.47,3.39,6.99,6.01,4.92,6.25,5.97,6.92,8.29,10.45,8.68,8.6,9.79,11.76,9.53,10.98,9.9,10.97,11.31,10.88,10.78,12.16,12.38,12.37,13.04,12.36,13.18,13.7,13.85,13.66,13.98,14.55,14.93,14.82,14.97,14.98,15.14,15.35,15.37,15.43,15.49,15.59,15.84,15.84,15.92,16.01,16.22,16.41,16.42,16.52,16.86,17.1,17.17,17.22,17.46,17.79,17.99,18.13,18.33,18.34,18.53,18.72,18.95,19.02,19.15,19.28,19.45,19.66,19.69,19.77,19.73,19.95,19.98,20.17,20.29,20.33,20.37,20.47,20.48,20.57,20.75,20.8,20.84,20.86,20.88,21.0,21.06,21.0,21.06,21.06,21.04,21.1,21.14,21.08,21.17,21.3,21.38,21.49,21.58,21.69,21.77,21.87,22.02,22.13,22.29,22.35,22.45,22.53,22.55,22.64,22.67,22.73,22.74,22.71,22.79,22.76,22.77,22.76,22.75,22.78,22.7,22.68,22.72,22.66,22.64,22.7,22.67,22.71,22.67,22.75,22.77,22.83,22.84,22.93,22.97,23.0,23.08,23.16,23.27,23.25,23.37,23.44,23.49,23.55,23.52,23.58,23.64,23.63,23.58,23.64,23.63,23.62,23.64,23.63,23.66,23.59,23.59,23.56,23.58,23.63,23.57,23.66,23.62,23.67,23.64,23.54,23.57,23.51,23.53,23.45,23.3,23.41,23.25,23.21,23.08,23.01,22.92,22.9,22.76,22.76,22.61,22.53,22.48,22.39,22.29,22.24,22.2,22.12,22.07,21.96,21.89,21.87,21.76,21.74,21.58,21.49,21.48,21.37,21.29,21.2,21.17,21.03,20.98,20.92,20.85,20.76,20.69,20.58,20.56,20.47,20.37,20.32,20.24,20.13,20.08,19.9,19.84,19.77,19.69,19.63,19.51,19.41,19.27,19.06,19.01,18.87,18.7,18.49,18.41,18.17,17.98,17.84,17.69,17.5,17.25,17.15,16.98,16.79,16.66,16.48,16.32,16.19,16.02,15.88,15.77,15.67,15.5,15.39,15.23,15.09,15.04,14.92,14.75,14.7,14.5,14.45,14.34,14.25,14.16,14.13,14.0,13.92,13.84,13.76,13.73,13.61,13.54,13.52,13.45,13.41,13.39,13.31,13.22,13.17,13.13,13.06,13.2,13.09,12.97,12.92,12.73,12.65,12.4,12.22,12.02,11.79,11.59,11.33,11.03,10.68,10.46,10.14,9.88,9.62,9.36,9.14,8.87,8.63,8.51,8.24,8.07,7.88,7.77,7.65,7.52,7.35,7.27,7.21,7.1,6.92,6.89,6.79,6.74,6.56,6.54,6.5,6.39,6.33,6.25,6.27,6.14,6.06,6.04,6.01,5.91,5.89,5.79,5.75,5.75,5.67,5.61,5.51,5.52,5.43,5.43,5.34,5.31,5.35,5.23,5.2,5.14,5.11,5.11,5.01,4.98,4.93,4.99,4.89,4.82,4.87,4.8,4.7,4.65,4.65,4.61,4.49,4.56,4.44,4.42,4.44,4.35,4.35,4.27,4.29,4.19,4.13,4.08,4.02,4.07,3.92,3.95,3.88,3.82,3.86,3.74,3.71,3.66,3.72,3.62,3.55,3.56,3.57,3.45,3.38,3.36,3.36,3.28,3.25,3.19,3.26,3.13,3.17,3.15,3.04,2.98,2.93,2.98,2.9,2.89,2.9,2.81,2.74,2.81,2.68,2.73,2.7,2.57,2.58,2.55,2.55,2.37,2.39,2.39,2.44,2.37,2.26,2.27,2.27,2.23,2.26,2.14,2.08,2.15,2.06,2.09,2.04,2.0,1.95,2.02,1.87,1.9,1.8,1.87,1.85,1.87,1.81,1.86,1.74,1.74,1.63,1.59,1.5,1.5,1.44,1.47,1.32,1.24,1.28,1.19,1.21,1.21,1.1,1.1,1.05,1.06,0.94,0.92,0.87,0.92,0.81,0.86,0.78,0.77,0.8,0.67,0.7,0.81,0.61,0.64,0.71,0.66,0.67,0.68,0.69,0.68,0.73};
262 
263  Double_t lambda[1000];
264  for(Int_t i=0; i<1000; i++) lambda[i] = i;
265 
266  // still need to convert from percent and cut values below credible limit
267  for (Int_t iBin=0;iBin<1000;iBin++){
268  if (iBin<credibleLimit || iBin > 700){
269  fEfficiencyR[iBin]=0.;
270  }else{
271  // total detector efficiency
272  fEfficiencyR[iBin]=efficiency[iBin-200]/100.*fCollectionEff;
273  }
274  }
275 
276  fDetEff = new TGraph(1000, lambda,fEfficiencyR);
277  }
278 
279  cout << " -I- PndDrc: Intialization successfull" << endl;
280 }
281 
282 // -------------------------------------------------------------------------
284  if (fVerboseLevel >0) cout<<" \n\n>>>>>>>>>>>>>>>>>>>>new event in the Barrel DIRC" <<endl;
285  fEventID++;
286 }
287 
288 //TH1F *hSpec = new TH1F("hSpec","hSpec",1000,1,10);
289 
290 // ----- Public method ProcessHits --------------------------------------
291 Bool_t PndDrc::ProcessHits(FairVolume* vol) {
292  TString nam =vol->GetName();
293  Int_t num = vol->getMCid();
294 
295  fEventID = gMC->CurrentEvent();
296  fPdgCode = gMC->TrackPid();
297 
298  fTrackID = gMC->GetStack()->GetCurrentTrackNumber();
299  fTime = gMC->TrackTime() * 1.0e09;
300  fLength = gMC->TrackLength();
301  gMC->TrackPosition(fPos);
302  gMC->TrackMomentum(fMom);
303 
304  // if(nam.BeginsWith("DrcBar") && gMC->IsTrackEntering() && fPdgCode == 50000050){
305  // hSpec->Fill(fMom.Vect().Mag()*1e9);
306  // gMC->StopTrack();
307  // }
308 
309 
310  // // print out info about the charged particle:
311  // if(gMC->GetStack()->GetCurrentParentTrackNumber()==0 && fPdgCode == 11){
312  // Int_t nproc = gMC->StepProcesses(fProc);
313  // cout<<"-I- PndDrc:"<<endl;
314  // for(Int_t ii=0; ii<nproc; ii++){
315  // cout<<"track "<<fPdgCode<<" number "<<gMC->GetStack()->GetCurrentTrackNumber()<<" mother id = "<<gMC->GetStack()->GetCurrentParentTrackNumber()<<": Z pos "<<fPos.Z()<<", R = "<<sqrt(pow(fPos.X(),2) + pow(fPos.Y(),2))<<", "<<ii<<" - "<<fProc[ii]<<", "<<TMCProcessName[fProc[ii]]<<endl;
316  // }
317  // }
318 
319  //stop secondaries so that they do not produce Cherenkov photons
320  if(fStopSecondaries){
321  if(fPdgCode != 50000050){
322  if(gMC->GetStack()->GetCurrentParentTrackNumber() != -1 ){
323  if(gMC->IsNewTrack()) gMC->StopTrack();
324  }
325  }
326  }
327 
328  // stop the track after the DIRC:
330  if(fPdgCode != 50000050 && gMC->IsTrackExiting() && num == gMC->VolId("DrcBarSensor")){
331  cout<<"track is stopped after the Barrel DIRC"<<endl;
332  gMC->StopTrack();
333  }
334  if(nam.BeginsWith("DrcEVSensor") && gMC->IsTrackExiting() && fMom.Z() > 0.) gMC->StopTrack();
335  }
336 
337  if (fPdgCode == 50000050){
338  if (fRunCherenkov==kFALSE ) { //|| fabs(fMom.Vect().Mag()*1.0E9-3.18)>0.2
339  if (fVerboseLevel >0) cout<< "Photon killed" << endl;
340  gMC->StopTrack();
341  }
342 
343  // apply detector efficiency at the production stage:
344  if(fDetEffAtProduction && gMC->IsNewTrack()){
345  Double_t lambda = 197.0*2.0*fpi/(fMom.Vect().Mag()*1.0E9);
346  Double_t ra = fRand.Uniform(0., 1.);
347  if(ra > fDetEff->Eval(lambda)) gMC->StopTrack();
348  //if(ra > fEfficiencyR[(int)lambda]) gMC->StopTrack();
349  }
350 
351  //if the photon goes backward through the lens, stop it
352  if(gMC->IsTrackExiting() && nam.Contains("LENS")){
353  if(fMom.Z() > 0.) gMC->StopTrack();
354  }
355 
356  if(fOptionForLUT && fMom.Z() > 0.) gMC->StopTrack();
357 
358  // apply transport efficiency at production stage (Maria Patsyuk 20.04.2012):
359  if(fTransportEffAtProduction && gMC->IsNewTrack()){
360  Double_t lam_tr = (197.0*2.0*fpi/(fMom.Vect().Mag()*1.0E9)) / 1000.;
361 
362  // current volume (should be the radiator bar)
363  Int_t barId = fGeoH->GetShortID(gMC->CurrentVolPath());
364  //calculate the number of bounces:
365  Int_t NbouncesX, NbouncesY;
366  Double_t angleX, angleY;
367  // photon initial direction
368  TVector3 PphoInitBar = fGeoH->MasterToLocalShortId(fMom.Vect(), barId)- fGeoH->MasterToLocalShortId(TVector3(0.,0.,0.), barId); // vector
369  NumberOfBounces(fPos.Vect(), PphoInitBar, barId, &NbouncesX, &NbouncesY, &angleX, &angleY);
370  // calculate the bounce probability
371  Double_t n_quartz = sqrt(1. + (0.696*lam_tr*lam_tr/(lam_tr*lam_tr-pow(0.068,2))) + (0.407*lam_tr*lam_tr/(lam_tr*lam_tr-pow(0.116,2))) + 0.897*lam_tr*lam_tr/(lam_tr*lam_tr-pow(9.896,2)));
372  Double_t bounce_probX = 1. - pow(4.*fpi*cos(angleX)*fGeo->Roughness()*n_quartz/lam_tr,2);
373  Double_t bounce_probY = 1. - pow(4.*fpi*cos(angleY)*fGeo->Roughness()*n_quartz/lam_tr,2);
374 
375  Double_t TotalTrProb = pow(bounce_probX, (Int_t)NbouncesX)*pow(bounce_probY, (Int_t)NbouncesY);
376  Double_t ra_tr = fRand.Uniform(0., 1.);
377  if(ra_tr > TotalTrProb) gMC->StopTrack();
378  }
379 
380  // kill photons older than fPhoMaxTime:
381  if (fStopTime == kTRUE && gMC->TrackTime()*1.0e09 > fPhoMaxTime){
382  gMC->StopTrack();
383  }
384 
385  if(gMC->IsTrackEntering() && num == gMC->VolId("DrcEVSensor")){
386  gMC->TrackMomentum(fMomAtEV);
387  }
388 
389  if(gMC->IsTrackEntering()){
390  if(gMC->IsNewTrack()) fTimeStart = fTime; // charged particle time at entrance of radiator bar
391 
392  // if(nam.BeginsWith("DrcLENS1Sensor")){ //DrcEntranceBox
393  // // save the direction of the photon when it enters EntranceBox (for LUT generation)
394  // Double_t nx,ny,nz;
395  // bool bres = gMC->CurrentBoundaryNormal(nx,ny,nz);
396  // AddEVHit(fTrackID, 9375, fPos.Vect(), fMom.Vect().Unit(),
397  // fTime, fLength, fPdgCode,
398  // fEventID, fTimeStart, fTimeAtEVEntrance, fVeloPhoton, TVector3(nx,ny,nz));
399  // }
400 
401  if(nam.BeginsWith("DrcEVSensor")){
402  if(fTimeAtEVEntrance ==0.){
403  fTimeAtEVEntrance= gMC->TrackTime()*1.0e09;
405  }
407 
408  Double_t nmast[3];
409  //bool bres = gMC->CurrentBoundaryNormal(nmast[0],nmast[1],nmast[2]); //[R.K. 01/2017] unused variable?
410  //TVector3 lnorm = fGeoH->MasterToLocalShortId(TVector3(nx,ny,nz), fGeoH->GetShortID(gMC->CurrentVolPath()));
411 
412  Double_t result[3];
413  gGeoManager->MasterToLocalVect(nmast, result);
414  TVector3 lnorm = TVector3(result[0],result[1],result[2]);
415 
416  //if(bres)
417  AddEVHit(fTrackID, 0, fPos.Vect(), fMom.Vect(),
420 
421  fTimeAtEVEntrance = 0.0;
422  }
423  }
424 
425  // if a photon is exiting the readout bar end
426  if (gMC->IsTrackExiting() && num == gMC->VolId("DrcBarSensor") && fPos.Z()<-118.99){
427  fTimeAtEV = gMC->TrackTime()*1.0e09;
428  //cout<<"time at EV = "<<fTimeAtEV<<endl;
429  }
430 
431  if (gMC->IsTrackEntering()){
432  if (nam.BeginsWith("DrcCathodeSensor")){
433  if(0==fGeoH) {
434  std::cout<<" -E- No PndGeoHandling loaded."<<std::endl;
435  abort();
436  }
437  Int_t sensorId = fGeoH->GetShortID(gMC->CurrentVolPath());
438  Int_t mcpId, prismId;
439  sscanf(gMC->CurrentVolPath(), "/cave_1/BarrelDIRC_0/DrcPDbase_%d/DrcMCP_%d", &prismId, &mcpId);
440  if(fTrackID>-2){
441  AddHit(fTrackID, sensorId, mcpId,
442  fPos.Vect(),fMom.Vect(),fMomAtEV.Vect(), fTimeAtEV,
444  }
445 
446  gMC->StopTrack();
447  }
448  PndStack* stack = (PndStack*) gMC->GetStack();
449  stack->AddPoint(kDRC);
450  }
451  }
452 
453 
454  if(gMC->TrackCharge()!=0 || fOptionForLUT){
455  if(nam.BeginsWith("DrcBar") && gMC->IsTrackEntering()){
456 
457  bool bpass = true;
458  // if(fDrcBarCollection->GetEntriesFast()>0){
459  // PndDrcBarPoint *tBarPoint = (PndDrcBarPoint*) fDrcBarCollection->At(fDrcBarCollection->GetEntriesFast()-1);
460  // if(tBarPoint->GetTrackID()==fTrackID && fLength - tBarPoint->GetLength()<0.1) bpass = false;
461  // }
462 
463  if(bpass && nam.BeginsWith("DrcBarSensor") ){
464  Int_t s=0, b=0; //side and bar
465  fNBar=0;
466  TString path = gMC->CurrentVolPath();
467  if (fVerboseLevel >1) cout<< "Volume: " << nam << endl;
468  sscanf(path, "/cave_1/BarrelDIRC_0/DrcBarBox_%d/DrcBarBoxCover_0/DrcBarBoxAir_0/DrcBarSensor_%d", &s, &b);
469 
470  if(s < 17) fNBar = s*10 + b;
471  else std::cout<<"Error: Wrong BarBox Id "<< s <<std::endl;
472 
473  TVector3 barMom = fMom.Vect();
474  Double_t fP = barMom.Mag();
475  fMass = gMC->TrackMass();
476  Double_t fEnergy = TMath::Sqrt(fP*fP + fMass*fMass);
477 
478  if ( fP == 0. || fabs(1./(fGeo->nQuartz()*(fP/fEnergy)))>1){
479  fThetaC = -1;
480  }else{
481  fThetaC = acos(1/(fGeo->nQuartz()*(fP/fEnergy)));
482  }
483 
484  AddBarHit(fTrackID, fGeoH->GetShortID(path), fPos.Vect(), barMom,
486 
487  PndStack* stack = (PndStack*) gMC->GetStack();
488  stack->AddPoint(kDRC);
489  }
490  }
491  }
492 
493  ResetParameters();
494  return kTRUE;
495 }
496 
498 
499 //------ Find Nubmer of Bounces -----------------------------------------
500 void PndDrc::NumberOfBounces(TVector3 start, TVector3 dir, Int_t barId, Int_t *n1, Int_t *n2, Double_t *alpha1, Double_t *alpha2) {
501  // start - photon production point in global coord system
502  // dir - photon direction in bar coord system
503 
504  // calculates the number of bounces in x and y direction and reflection angles in these directions.
505 
506  // Find coordinates of X0, Y0:
507  Double_t Z0, X0, Y0;
508  if(dir.Theta() < 3.1415/2.){
509  Z0 = -(fabs(fzup) + 2.*fzdown - start.Z());
510  }
511  if(dir.Theta() >= 3.1415/2.){
512  Z0 = -(start.Z() - fzup);
513  }
514  X0 = Z0*tan(dir.Theta())*cos(dir.Phi());
515  Y0 = Z0*tan(dir.Theta())*sin(dir.Phi());
516  //cout<<"-I- NumberOfBounces: X0 = "<<X0<<", Y0 = "<<Y0<<endl;
517 
518  // Find the start position of the photon with respect to the middle of the bar:
519  TVector3 startLocal = fGeoH->MasterToLocalShortId(start, barId); // point
520 
521  // Find the number of bounces in each direction
522  Double_t N1, N2;
523  FindOutPoint(X0, startLocal.X() + fbarwidth/2., fbarwidth, &N1, 0);
524  FindOutPoint(Y0, startLocal.Y() + fhthick, 2.*fhthick, &N2, 0);
525  //cout<<"-I- NumberOfBounces: N1 = "<<N1<<", N2 = "<<N2<<endl;
526 
527  *n1 = (Int_t)N1;
528  *n2 = (Int_t)N2;
529 
530  // calculate the reflection angles in x and y directions:
531  TVector3 up_down;
532  up_down.SetXYZ(0.,1.,0.);
533  TVector3 left_right;
534  left_right.SetXYZ(1.,0.,0.);
535  Double_t angle1 = dir.Angle(left_right);
536  if(angle1 > fpi/2.){angle1 = fpi - dir.Angle(left_right);}
537  Double_t angle2 = dir.Angle(up_down);
538  if(angle2 > fpi/2.){angle2 = fpi - dir.Angle(up_down);}
539  *alpha1 = angle1;
540  *alpha2 = angle2;
541  //cout<<"-I- NumberOfBounces: angle1 = "<<angle1<<", angle2 = "<<angle2<<endl;
542 }
543 
544 //-----------------------------------------------------------------------------
546  Double_t m=99.;
547  Double_t n=TMath::Floor(x0/a);
548  m = n;
549  if(print){std::cout<<"n = "<<n<<", NN = "<<*NN<<", x0 = "<<x0<<", a = "<<a<<std::endl;}
550  Double_t x1 = x0 - n*a;
551  if(x0 < 0.){x1 = x0 - (n+1)*a;}
552  if(print){std::cout<<"xy = "<< x1<<std::endl;}
553  Double_t xK = 0.;
554  if((m/2. - TMath::Floor(m/2.)) == 0.) { // 4etnoe
555  if(print){std::cout<<"odd==0"<<std::endl;}
556  if(x0 >= 0. && x1 + xEn <= a){xK = x1 + xEn;}
557  if(x0 >= 0. && x1 + xEn > a){xK = 2*a - x1 - xEn; n = 1. + n;}
558  if(x0 < 0. && x1 + xEn >= 0.){xK = a - (x1 + xEn); n = -1. -n;}
559  if(x0 < 0. && x1 + xEn < 0.) {xK = a + x1 + xEn; n = -n;}
560  if(print){std::cout<<"xK = "<< xK<<", n = "<<n<<std::endl;}
561 
562  }
563 
564  if((m/2. - TMath::Floor(m/2.)) != 0.) { // ne4etnoe
565  if(print){std::cout<<"even!=0"<<std::endl;}
566  if(x0 >= 0. && x1 + xEn <= a){xK = a - (x1 + xEn);}
567  if(x0 >= 0. && x1 + xEn > a){xK = x1 + xEn - a; n = 1. + n;}
568  if(x0 < 0. && x1 + xEn >= 0.){xK = x1 + xEn; n = -1. -n;}
569  if(x0 < 0. && x1 + xEn < 0.) {xK = - (x1 + xEn); n = -n;}
570  if(print){std::cout<<"xK = "<< xK<<", n = "<<n<<std::endl;}
571 
572  }
573 
574  *NN = n;
575  return xK;
576 }
577 
578 // ----- Public method EndOfEvent -----------------------------------------
580  if (fVerboseLevel) Print();
581  Reset();
582 }
583 
585  // hSpec->Draw();
586 }
587 
588 // ----- Public method Register -------------------------------------------
590  FairRootManager::Instance()->Register("DrcBarPoint","Drc", fDrcBarCollection, fPersistency);
591  FairRootManager::Instance()->Register("DrcEVPoint","Drc", fDrcEVCollection, fPersistency);
592  FairRootManager::Instance()->Register("DrcPDPoint","Drc", fDrcPDCollection, fPersistency);
593 }
594 
595 // ----- Public method GetCollection --------------------------------------
596 TClonesArray* PndDrc::GetCollection(Int_t iColl) const {
597  if (iColl == 0) return fDrcPDCollection;
598  if (iColl == 1) return fDrcEVCollection;
599  if (iColl == 2) return fDrcBarCollection;
600 
601  return NULL;
602 }
603 
604 // ----- Public method Print ----------------------------------------------
605 void PndDrc::Print() const {
606  Int_t nPDHits = fDrcPDCollection->GetEntriesFast();
607  Int_t nBarHits = fDrcBarCollection->GetEntriesFast();
608  Int_t nEVHits = fDrcEVCollection->GetEntriesFast();
609 
610  cout << "-I- PndDrc: " << nPDHits << " points registered in the photodetector for this event." << endl;
611  cout << "-I- PndDrc: " << nEVHits << " points registered in the expansion volume for this event." << endl;
612  cout << "-I- PndDrc: " << nBarHits << " points registered in the bar for this event." << endl;
613 
614  if (fVerboseLevel>1){
615  for (Int_t i=0; i<nPDHits; i++) (*fDrcPDCollection)[i]->Print();
616  for (Int_t i=0; i<nEVHits; i++) (*fDrcEVCollection)[i]->Print();
617  for (Int_t i=0; i<nBarHits; i++) (*fDrcBarCollection)[i]->Print();
618  }
619 }
620 
621 // ----- Public method Reset ----------------------------------------------
623  fDrcPDCollection->Delete();
624  fDrcEVCollection->Delete();
625  fDrcBarCollection->Delete();
626  fPosIndex = 0;
627 }
628 
629 // ----- Public method CopyClones -----------------------------------------
630 void PndDrc::CopyClones(TClonesArray* clPD1, TClonesArray* clPD2,TClonesArray* clBar1, TClonesArray* clBar2, Int_t offset ) {
631  Int_t nPDEntries = clPD1->GetEntriesFast();
632  cout << "-I- PndDrc: " << nPDEntries << " entries to add." << endl;
633  TClonesArray& clrefPD = *clPD2;
634 
635  Int_t nBarEntries = clBar1->GetEntriesFast();
636  cout << "-I- PndDrc: " << nBarEntries << " entries to add." << endl;
637  TClonesArray& clrefBar = *clBar2;
638 
639  PndDrcPDPoint* oldpointPD = NULL;
640  PndDrcBarPoint* oldpointBar = NULL;
641 
642  for (Int_t i=0; i<nPDEntries; i++) {
643  oldpointPD = (PndDrcPDPoint*) clPD1->At(i);
644  Int_t indexPD = oldpointPD->GetTrackID() + offset;
645  oldpointPD->SetTrackID(indexPD);
646  new (clrefPD[fPosIndex]) PndDrcPDPoint(*oldpointPD);
647  fPosIndex++;
648  }
649 
650  for (Int_t i=0; i<nBarEntries; i++) {
651  oldpointBar = (PndDrcBarPoint*) clBar1->At(i);
652  Int_t indexBar = oldpointBar->GetTrackID() + offset;
653  oldpointBar->SetTrackID(indexBar);
654  new (clrefBar[fPosIndex]) PndDrcBarPoint(*oldpointBar);
655  fPosIndex++;
656  }
657 
658  cout << " -I- PndDrc: " << clPD2->GetEntriesFast() << " merged entries." << endl;
659  cout << " -I- PndDrc: " << clBar2->GetEntriesFast() << " merged entries." << endl;
660 }
661 
662 // ----- Public method ConstructGeometry -----------------------------------
664  cout<< " " << endl;
665  cout<< " ======= DRC:: ConstructGeometry() ======== " << endl;
666  cout<< " ============================================= " << endl;
667 
668  TString fileName = GetGeometryFileName();
669  if(fileName.EndsWith(".root")){
670  ConstructRootGeometry();
671  } else{
672  std::cout<<"Geometry format not supported!"<<std::endl;
673  }
674 
675  cout<< " ============================================= " << endl;
676 }
677 
678 // ----- Public Method Construct Optical Geometry ---------------------------
680  cout<< " ==================================================== " << endl;
681  cout<< " ======= DRC:: ConstructOpticalGeometry() ======== " << endl;
682 
683  // ideal reflectivity:
684  Int_t npoints_i = 2;
685  Double_t ephoton_i[npoints_i];
686  ephoton_i[0] = 1.907*1.0e-09; // 1 eV
687  ephoton_i[1] = 6.199*1.0e-09; // 10 eV
688  Double_t reflectivity_i[npoints_i];
689  reflectivity_i[0] = 1.;
690  reflectivity_i[1] = 1.;
691 
692  // black reflectivity:
693  Double_t reflectivity_b[npoints_i];
694  reflectivity_b[0] = 0.;
695  reflectivity_b[1] = 0.;
696 
697  // real reflectivity (added 18.05.2011, measured by Jerry for BABAR):
698  Int_t npoints_r = 46;
699  Double_t ephoton_r[npoints_r];
700  ephoton_r[0] = 1.907*1.0e-09; //eV
701  ephoton_r[1] = 1.937*1.0e-09;
702  ephoton_r[2] = 1.968*1.0e-09;
703  ephoton_r[3] = 2.000*1.0e-09;
704  ephoton_r[4] = 2.033*1.0e-09;
705  ephoton_r[5] = 2.066*1.0e-09;
706  ephoton_r[6] = 2.101*1.0e-09;
707  ephoton_r[7] = 2.138*1.0e-09;
708  ephoton_r[8] = 2.175*1.0e-09;
709  ephoton_r[9] = 2.214*1.0e-09;
710  ephoton_r[10] = 2.254*1.0e-09;
711  ephoton_r[11] = 2.296*1.0e-09;
712  ephoton_r[12] = 2.339*1.0e-09;
713  ephoton_r[13] = 2.384*1.0e-09;
714  ephoton_r[14] = 2.431*1.0e-09;
715  ephoton_r[15] = 2.480*1.0e-09;
716  ephoton_r[16] = 2.530*1.0e-09;
717  ephoton_r[17] = 2.583*1.0e-09;
718  ephoton_r[18] = 2.638*1.0e-09;
719  ephoton_r[19] = 2.695*1.0e-09;
720  ephoton_r[20] = 2.755*1.0e-09;
721  ephoton_r[21] = 2.818*1.0e-09;
722  ephoton_r[22] = 2.883*1.0e-09;
723  ephoton_r[23] = 2.952*1.0e-09;
724  ephoton_r[24] = 3.024*1.0e-09;
725  ephoton_r[25] = 3.100*1.0e-09;
726  ephoton_r[26] = 3.179*1.0e-09;
727  ephoton_r[27] = 3.263*1.0e-09;
728  ephoton_r[28] = 3.351*1.0e-09;
729  ephoton_r[29] = 3.444*1.0e-09;
730  ephoton_r[30] = 3.542*1.0e-09;
731  ephoton_r[31] = 3.647*1.0e-09;
732  ephoton_r[32] = 3.757*1.0e-09;
733  ephoton_r[33] = 3.875*1.0e-09;
734  ephoton_r[34] = 3.999*1.0e-09;
735  ephoton_r[35] = 4.133*1.0e-09;
736  ephoton_r[36] = 4.275*1.0e-09;
737  ephoton_r[37] = 4.428*1.0e-09;
738  ephoton_r[38] = 4.592*1.0e-09;
739  ephoton_r[39] = 4.769*1.0e-09;
740  ephoton_r[40] = 4.959*1.0e-09;
741  ephoton_r[41] = 5.166*1.0e-09;
742  ephoton_r[42] = 5.391*1.0e-09;
743  ephoton_r[43] = 5.636*1.0e-09;
744  ephoton_r[44] = 5.904*1.0e-09;
745  ephoton_r[45] = 6.199*1.0e-09;
746 
747  Double_t reflectivity_r[npoints_r];
748  reflectivity_r[0] = 0.870;
749  reflectivity_r[1] = 0.880;
750  reflectivity_r[2] = 0.885;
751  reflectivity_r[3] = 0.890;
752  reflectivity_r[4] = 0.895;
753  reflectivity_r[5] = 0.900;
754  reflectivity_r[6] = 0.905;
755  reflectivity_r[7] = 0.910;
756  reflectivity_r[8] = 0.915;
757  reflectivity_r[9] = 0.920;
758  reflectivity_r[10] = 0.923;
759  reflectivity_r[11] = 0.925;
760  reflectivity_r[12] = 0.926;
761  reflectivity_r[13] = 0.928;
762  reflectivity_r[14] = 0.930;
763  reflectivity_r[15] = 0.935;
764  reflectivity_r[16] = 0.936;
765  reflectivity_r[17] = 0.937;
766  reflectivity_r[18] = 0.938;
767  reflectivity_r[19] = 0.940;
768  reflectivity_r[20] = 0.940;
769  reflectivity_r[21] = 0.939;
770  reflectivity_r[22] = 0.938;
771  reflectivity_r[23] = 0.938;
772  reflectivity_r[24] = 0.937;
773  reflectivity_r[25] = 0.937;
774  reflectivity_r[26] = 0.936;
775  reflectivity_r[27] = 0.935;
776  reflectivity_r[28] = 0.934;
777  reflectivity_r[29] = 0.932;
778  reflectivity_r[30] = 0.930;
779  reflectivity_r[31] = 0.928;
780  reflectivity_r[32] = 0.926;
781  reflectivity_r[33] = 0.924;
782  reflectivity_r[34] = 0.922;
783  reflectivity_r[35] = 0.920;
784  reflectivity_r[36] = 0.910;
785  reflectivity_r[37] = 0.905;
786  reflectivity_r[38] = 0.895;
787  reflectivity_r[39] = 0.890;
788  reflectivity_r[40] = 0.885;
789  reflectivity_r[41] = 0.860;
790  reflectivity_r[42] = 0.840;
791  reflectivity_r[43] = 0.820;
792  reflectivity_r[44] = 0.800;
793  reflectivity_r[45] = 0.780;
794 
795  gMC->DefineOpSurface("LensSurface", kGlisur, kDielectric_dielectric, kGround, 0.0);
796  gMC->DefineOpSurface("MirrSurface", kGlisur, kDielectric_metal, kPolished, 0.0);
797  gMC->DefineOpSurface("EVSurface", kGlisur, kDielectric_metal, kPolished, 0.0);
798  gMC->DefineOpSurface("BlackSurface", kGlisur, kDielectric_dielectric, kPolished, 0.0);
799 
800 
801  // Double_t refractiveIndex[npoints_i];
802  // refractiveIndex[0] = 1.2;
803  // refractiveIndex[1] = 1.2;
804  // Double_t abs_i[npoints_i];
805  // abs_i[0] = 1000.;
806  // abs_i[1] = 1000.;
807 
808  // // gMC->SetCerenkov(gMC->MediumId("BK7G18"),npoints_i, ephoton_i,abs_i , reflectivity_i, refractiveIndex);
809 
810  // gMC->SetMaterialProperty("LensSurface", "RINDEX", npoints_i, ephoton_i, refractiveIndex);
811  // gMC->SetMaterialProperty("LensSurface", "REFLECTIVITY", npoints_i, ephoton_i, reflectivity_i);
812  // gMC->SetSkinSurface("Lens3Sur", "DrcLENS3Sensor", "LensSurface");
813  // return;
814 
815  gMC->SetMaterialProperty("BlackSurface", "REFLECTIVITY", npoints_i, ephoton_i, reflectivity_b);
816 
817  if(fTakeRealReflectivity == kFALSE){
818  gMC->SetMaterialProperty("MirrSurface", "REFLECTIVITY", npoints_i, ephoton_i, reflectivity_i);
819  }else{
820  gMC->SetMaterialProperty("MirrSurface", "REFLECTIVITY", npoints_r, ephoton_r, reflectivity_r);
821  }
822 
823  gMC->SetBorderSurface("BarMirrorSurface", "DrcMirror", 0, "DrcBarBoxAir", 0, "MirrSurface");
824 
825  if(fSetBlackLens == kTRUE){
826  for(Int_t i=0; i<3; i++){ //fGeo->barNum()
827  gMC->SetBorderSurface("Lens1AirSurface", "DrcLENS1Sensor", i, "DrcEntrance", 0, "BlackSurface");
828  gMC->SetBorderSurface("Lens2AirSurface", "DrcLENS2Sensor", i, "DrcEntrance", 0, "BlackSurface");
829  //gMC->SetBorderSurface("Lens3AirSurface", "DrcLENS3Sensor", i, "DrcEntrance", 0, "BlackSurface");
830  }
831  //gMC->SetBorderSurface("BarboxWindowAirSurface", "DrcBarboxWindowSensor", 0, "BarrelDIRC", 0, "EVSurface");
832  //gMC->SetBorderSurface("EVGreaseAirSurface", "DrcEVgrease", 0, "BarrelDIRC", 0, "EVSurface");
833  }
834 
835  //only direct
836  //gMC->SetBorderSurface("EVAirSurface", "DrcEVSensor", 0, "DrcEVCoverSensor", 0, "BlackSurface");
837 
838  gMC->SetSkinSurface("AirMirrorSurface", "DrcMirror", "MirrSurface");
839 
840  cout<<" ======= DRC::ConstructOpGeometry -> Finished! ====== "<< endl;
841 }
842 
843 // ----- Public method CheckIfSensitive --------------------------------------
844 bool PndDrc::CheckIfSensitive(std::string name) {
845  for (size_t i = 0; i < fListOfSensitives.size(); i++){
846  if (name.find(fListOfSensitives[i]) != std::string::npos)
847  return true;
848  }
849  return false;
850 }
851 
852 // ----- Private method AddHit --------------------------------------------
853 PndDrcPDPoint* PndDrc::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) {
854  TClonesArray& clrefPD = *fDrcPDCollection;
855  Int_t size = clrefPD.GetEntriesFast();
856  if (fVerboseLevel>1)
857  cout << "-I- PndDrc: Adding PD Point at (" << pos.X() << ", " << pos.Y()
858  << ", " << pos.Z() << ") cm, detector " << copyNo << ", track "
859  << trackID <<" event "<<eventID << " barId "<< fDrcBarCollection->GetEntriesFast()-1 <<endl;
860  return new(clrefPD[size]) PndDrcPDPoint(trackID,
861  copyNo,
862  mcpId,
863  fDrcBarCollection->GetEntriesFast()-1,
864  pos,
865  mom,
866  momAtEV,
867  timeAtEV,
868  time,
869  length,
870  pdgCode,
871  eventID);
872 
873 }
874 
875 PndDrcEVPoint* PndDrc::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) {
876  TClonesArray& clrefEV = *fDrcEVCollection;
877  Int_t size = clrefEV.GetEntriesFast();
878  if (fVerboseLevel>2)
879  cout << "-I- PndDrc: Adding EV Point at (" << pos.X() << ", " << pos.Y()
880  << ", " << pos.Z() << ") cm, detector " << copyNo << ", track "
881  << trackID <<" event "<<eventID << endl;
882  return new(clrefEV[size]) PndDrcEVPoint(trackID,
883  copyNo,
884  pos,
885  mom,
886  time,
887  length,
888  pdgCode,
889  eventID,
890  timestart,
891  timestartEV,
892  VeloPhoton,normal);
893 
894 }
895 
896 PndDrcBarPoint* PndDrc::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 BarId, Int_t eventID, Double_t mass) {
897  TClonesArray& clrefBar = *fDrcBarCollection;
898  Int_t size = clrefBar.GetEntriesFast();
899  if (fVerboseLevel>1)
900  cout << "-I- PndBarDrc: Adding Bar Point at (" << pos.X() << ", " << pos.Y()
901  << ", " << pos.Z() << ") cm, detector " << copyNo << ", track "
902  << trackID <<" event "<<eventID << " PDG "<<pdgCode<< endl;
903  return new(clrefBar[size]) PndDrcBarPoint(trackID,
904  copyNo,
905  pos,
906  mom,
907  time,
908  length,
909  pdgCode,
910  thetaC,
911  BarId,
912  eventID,
913  mass);
914 }
915 
TVector3 pos
friend F32vec4 acos(const F32vec4 &a)
Definition: P4_F32vec4.h:113
Double_t x0
Definition: checkhelixhit.C:70
Double_t fpipehAngle
Definition: PndDrc.h:234
Double_t fEfficiencyR[1000]
Definition: PndDrc.h:265
friend F32vec4 cos(const F32vec4 &a)
Definition: P4_F32vec4.h:112
virtual void Register()
Definition: PndDrc.cxx:589
Double_t fzdown
Definition: PndDrc.h:231
virtual Bool_t ProcessHits(FairVolume *vol=0)
Definition: PndDrc.cxx:291
virtual void ConstructOpGeometry()
Definition: PndDrc.cxx:679
Double_t fbarwidth
Definition: PndDrc.h:241
TClonesArray * fDrcPDCollection
Definition: PndDrc.h:287
Double_t fzup
Definition: PndDrc.h:230
Double_t BBoxNum()
Definition: PndGeoDrc.h:136
int num[96]
Definition: ranlxd.cxx:381
Int_t i
Definition: run_full.C:25
__m128 m
Definition: P4_F32vec4.h:28
TTree * b
PndGeoHandling * fGeoH
Definition: anasim.C:34
Bool_t fStopTime
Definition: PndDrc.h:274
Double_t lambda(Double_t x, Double_t y, Double_t z)
Definition: drawdal.C:48
TRandom3 fRand
Definition: full_core_ntp.C:28
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:29
Double_t fPhoMaxTime
Definition: PndDrc.h:275
Bool_t fTransportEffAtProduction
Definition: PndDrc.h:270
static T Sqrt(const T &x)
Definition: PndCAMath.h:37
TLorentzVector fMom
position
Definition: PndDrc.h:249
Double_t fbbGap
Definition: PndDrc.h:235
friend F32vec4 sin(const F32vec4 &a)
Definition: P4_F32vec4.h:111
TLorentzVector s
Definition: Pnd2DStar.C:50
Double_t BarWidth()
Definition: PndGeoDrc.h:100
int n
void CreateUniqueSensorId(TString startName, std::vector< std::string > listOfSensitives)
Has to be called during simulation to create unique sensor id.
void NumberOfBounces(TVector3, TVector3, Int_t, Int_t *, Int_t *, Double_t *, Double_t *)
Definition: PndDrc.cxx:500
Bool_t fPersistency
Definition: PndDrc.h:222
virtual void Reset()
Definition: PndDrc.cxx:622
Double_t mom
Definition: plot_dirc.C:14
virtual ~PndDrc()
Definition: PndDrc.cxx:197
Double32_t fTime
momentum
Definition: PndDrc.h:250
Int_t fTrackID
Switch ON/OFF Cherenkov propagation.
Definition: PndDrc.h:246
TVector3 offset(2, 0, 0)
void FinishRun()
Definition: PndDrc.cxx:584
Double_t BBoxGap()
Definition: PndGeoDrc.h:130
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)
Definition: PndDrc.cxx:853
TGeoManager * gGeoManager
TRandom3 fRand
Definition: PndDrc.h:271
Double_t fMass
MC volume ID of drc.
Definition: PndDrc.h:257
Double_t barBoxZDown()
Definition: PndGeoDrc.h:104
Double_t fCollectionEff
Definition: PndDrc.h:272
void AddPoint(DetectorId iDet)
Definition: PndStack.cxx:408
Double32_t fLength
time
Definition: PndDrc.h:251
Double_t PipehAngle()
Definition: PndGeoDrc.h:139
virtual void BeginEvent()
Definition: PndDrc.cxx:283
TLorentzVector fPos
Definition: PndDrc.h:248
Bool_t fOptionForLUT
Definition: PndDrc.h:280
virtual void CopyClones(TClonesArray *clPD1, TClonesArray *clPD2, TClonesArray *clBar1, TClonesArray *clBar2, Int_t offset)
Definition: PndDrc.cxx:630
Int_t a
Definition: anaLmdDigi.C:126
virtual void FinishPrimary()
Definition: PndDrc.cxx:497
Bool_t fRunCherenkov
///&lt; converter for detector names
Definition: PndDrc.h:245
Double_t barBoxZUp()
Definition: PndGeoDrc.h:108
virtual void Print() const
Definition: PndDrc.cxx:605
void PrintSensorNames()
Double_t fphi0
Definition: PndDrc.h:239
TClonesArray * fDrcBarCollection
Hit collection.
Definition: PndDrc.h:289
virtual TClonesArray * GetCollection(Int_t iColl) const
Definition: PndDrc.cxx:596
TGraph * fDetEff
Definition: PndDrc.h:268
Double_t
Definition: PndDrc.h:31
Double_t fdphi
Definition: PndDrc.h:240
Double32_t fLengthEV
length
Definition: PndDrc.h:252
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)
Definition: PndDrc.cxx:875
Int_t fEventID
Hit collection in the bar.
Definition: PndDrc.h:291
Double_t nQuartz()
Definition: PndGeoDrc.h:70
Bool_t fDetEffAtProduction
Detector Efficiency as a function of photon wavelength.
Definition: PndDrc.h:269
Int_t fPdgCode
Pointer to basic DRC geometry data.
Definition: PndDrc.h:284
TClonesArray * fDrcEVCollection
Hit collection.
Definition: PndDrc.h:288
virtual void ConstructGeometry()
Definition: PndDrc.cxx:663
Double_t fTimeAtEVEntrance
Definition: PndDrc.h:260
Int_t GetShortID(TString path)
for a given path the (unique) position of the sensor path in the fSensorNamePar-List is given...
friend F32vec4 fabs(const F32vec4 &a)
Definition: P4_F32vec4.h:47
static PndGeoHandling * Instance()
TString name
PndDrc()
Definition: PndDrc.cxx:67
TVector3 MasterToLocalShortId(const TVector3 &master, const Int_t &shortId)
PndGeoDrc * fGeo
Definition: PndDrc.h:282
Double_t FindOutPoint(Double_t, Double_t, Double_t, Double_t *, Bool_t)
Definition: PndDrc.cxx:545
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)
Definition: PndDrc.cxx:896
Bool_t fStopSecondaries
Definition: PndDrc.h:277
Bool_t fTakeRealReflectivity
Definition: PndDrc.h:276
TLorentzVector fMomAtEV
Definition: PndDrc.h:258
virtual void EndOfEvent()
Definition: PndDrc.cxx:579
Double_t fThetaC
Definition: PndDrc.h:285
Double_t barHalfThick()
Definition: PndGeoDrc.h:96
Double_t fbarnum
Definition: PndDrc.h:238
PndGeoHandling * fGeoH
Definition: PndDrc.h:243
virtual void Initialize()
Definition: PndDrc.cxx:218
std::vector< std::string > fListOfSensitives
Definition: PndDrc.h:179
Double_t fpi
Definition: PndDrc.h:229
Bool_t fStopChargedTrackAfterDIRC
Definition: PndDrc.h:278
Double_t fhthick
Definition: PndDrc.h:233
Int_t fNBar
Definition: PndDrc.h:254
ClassImp(PndAnaContFact)
Int_t fPosIndex
Definition: PndDrc.h:255
void ResetParameters()
Definition: PndDrc.h:301
Double_t fTimeAtEV
Definition: PndDrc.h:259
Double_t fVeloPhoton
Definition: PndDrc.h:262
TString nam
Definition: sim_hypGe.C:48
Double_t Pi
Mvd Initialize()
Double_t barNum()
Definition: PndGeoDrc.h:124
Double_t thetaC
Definition: plot_dirc.C:16
Double_t fTimeStart
Definition: PndDrc.h:261
Double_t fradius
Definition: PndDrc.h:232
Double_t Roughness()
Definition: PndGeoDrc.h:80
Double_t fbbnum
Definition: PndDrc.h:237
Double_t radius()
Definition: PndGeoDrc.h:92
Bool_t fSetBlackLens
Definition: PndDrc.h:279
bool CheckIfSensitive(std::string name)
Definition: PndDrc.cxx:844