All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PMTStartCalibTime_module.cc
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 // Class: PMTStartCalibTime
3 // Plugin Type: analyzer (art v2_07_03)
4 // File: PMTStartCalibTime_module.cc
5 //
6 // Prepared by Christian Farnese writing down few ideas for Calibration in time for PMt
7 // starting from PMTcoordinates module.
8 ////////////////////////////////////////////////////////////////////////
9 
10 // ##########################
11 // ### Framework includes ###
12 // ##########################
13 #include "art/Framework/Core/EDAnalyzer.h"
14 #include "art/Framework/Core/ModuleMacros.h"
15 #include "art/Framework/Principal/Event.h"
16 #include "fhiclcpp/ParameterSet.h"
17 #include "art/Framework/Principal/Run.h"
18 #include "art/Framework/Principal/SubRun.h"
19 #include "art/Framework/Principal/Handle.h"
20 #include "canvas/Persistency/Common/Ptr.h"
21 #include "canvas/Persistency/Common/PtrVector.h"
22 #include "art/Framework/Services/Registry/ServiceHandle.h"
23 #include "art_root_io/TFileService.h"
24 #include "art_root_io/TFileDirectory.h"
25 #include "canvas/Persistency/Common/FindOneP.h"
26 #include "canvas/Persistency/Common/FindManyP.h"
27 #include "canvas/Utilities/InputTag.h"
28 #include "messagefacility/MessageLogger/MessageLogger.h"
29 //#include "cetlib/maybe_ref.h"
30 
31 // ########################
32 // ### LArSoft includes ###
33 // ########################
35 #include "larcoreobj/SimpleTypesAndConstants/RawTypes.h" // raw::ChannelID_t
44 #include "lardata/ArtDataHelper/TrackUtils.h" // lar::util::TrackPitchInView()
48 
51 
53 
54 #include "nusimdata/SimulationBase/MCParticle.h"
55 #include "nusimdata/SimulationBase/MCTruth.h"
56 #include "nusimdata/SimulationBase/MCNeutrino.h"
57 
58 #include "nusimdata/SimulationBase/MCTrajectory.h"
59 
60 #include "nug4/ParticleNavigation/ParticleList.h"
61 
63 
64 // #####################
65 // ### ROOT includes ###
66 // #####################
67 #include "TComplex.h"
68 #include "TFile.h"
69 #include "TH2D.h"
70 #include "TF1.h"
71 #include "TTree.h"
72 #include "TTimeStamp.h"
73 
74 ////////////////////////////////// Define some constant variable //////////////////////////////
75 const int nPMTs = 360;
76 //const int PMTs_per_TPC = 90;
77 const int MaxPhotons = 10000;
78 
79 namespace icarus {
80  class PMTStartCalibTime;
81 }
82 
83 
84 class icarus::PMTStartCalibTime : public art::EDAnalyzer
85 {
86 public:
87 explicit PMTStartCalibTime(fhicl::ParameterSet const & p);
88 
89 // Plugins should not be copied or assigned.
90 PMTStartCalibTime(PMTStartCalibTime const &) = delete;
94 
95 // Required functions.
96 void analyze(art::Event const & e) override;
97 
98 // Selected optional functions.
99 void beginJob() override;
100 //void reconfigure(fhicl::ParameterSet const & p);
101 
102 private:
103 
104 //TRandom* Ran;
105 
106 TTree* fTree;
107 
108 ////////////////////////////////// Variable in th tree//////////////////////////////
109 
110 int event;
111 
113 
114 int gt_0;
115 int gt_1;
116 
118 
120 
121 double PMTx[nPMTs];
122 double PMTy[nPMTs];
123 double PMTz[nPMTs];
124 
126 int TPC[nPMTs];
127 
131 
138 
139 
141 
146 
155 
156 
161 
165 
166 double vertex_x;
167 double vertex_y;
168 double vertex_z;
169 
172 
173 art::InputTag photonLabel;
174 art::InputTag chargeLabel;
175 art::InputTag typoLabel;
176 
177 };
178 
179 
181  :
182  EDAnalyzer(p),
183  photonLabel(p.get<art::InputTag>("fottoni", "largeant")),
184  chargeLabel(p.get<art::InputTag>("carconi", "largeant")),
185  typoLabel (p.get<art::InputTag>("tiponi", "generator"))
186  // More initializers here.
187 {
188  std::cout << " Let's try to calib in time the PMTs... " << std::endl;
189 }
190 
191 void icarus::PMTStartCalibTime::analyze(art::Event const & evt)
192 {
193 ////////////////////////////////// Create the LArsoft services and service handle//////////////////////////////
194 
195 art::ServiceHandle<geo::Geometry> geom;
196 
197 std::vector<sim::SimPhotons> const& optical = *(evt.getValidHandle<std::vector<sim::SimPhotons>>(photonLabel));
198 std::vector<sim::SimChannel> const& charge = *(evt.getValidHandle<std::vector<sim::SimChannel>>(chargeLabel));
199 //std::vector<simb::MCTruth> const& type = *(evt.getValidHandle<std::vector<simb::MCTruth>>(typoLabel));
200 
201 ////////////////////////////////// Event number//////////////////////////////
202 
203 event = evt.id().event();
204 
205 //std::vector< art::Handle< std::vector<simb::MCTruth> > > type;
206 //evt.getManyByType(type);
207 auto type = evt.getMany< std::vector<simb::MCTruth> >();
208  art::Handle< std::vector<simb::MCParticle> > particleVecHandle;
209  evt.getByLabel("largeant", particleVecHandle);
210 
211  std::vector<const simb::MCParticle*> particleVec;
212  if (particleVecHandle.isValid())
213  {
214  for(size_t idx = 0; idx < particleVecHandle->size(); idx++) particleVec.push_back(&particleVecHandle->at(idx)); //
215  }
216  art::Handle< std::vector<recob::Track> > trackVecHandle;
217  evt.getByLabel("pandoraTrackICARUSCryo0", trackVecHandle);//at the moment I am calling here directly a particular kind of track: this should be generalized, putting the label of the track type in the fhicl...
218 
219  std::vector<const recob::Track*> trackVec;
220  if (trackVecHandle.isValid())
221  {
222  for(size_t idx = 0; idx < trackVecHandle->size(); idx++) trackVec.push_back(&trackVecHandle->at(idx)); //
223  }
224 
225 
226 ////////////////////////////////// Putting at 0 all the variables//////////////////////////////
227 
228 for (int g=0; g<MaxPhotons; g++)
229 {
230  for (int u=0; u<360; u++)
231  {
232  photon_time[u][g]=0;
233  }
234 }
235 
236 true_barycentre_x =0;
237 true_barycentre_y =0;
238 true_barycentre_z =0;
239 
240 total_quenched_energy =0;
241 
242 ////////////////////////////////// Charge part: identify the baricentre of the event //////////////////////////////
243 
244 for (std::size_t chargechannel = 0; chargechannel<charge.size(); ++chargechannel) //loop on SimChannel
245 {
246  auto const& channeltdcide = charge.at(chargechannel).TDCIDEMap();
247 
248  for (std::size_t TDCnu = 0; TDCnu<channeltdcide.size(); ++TDCnu) //loop on TDC
249  {
250 
251  sim::TDCIDE const& tdcide = channeltdcide.at(TDCnu);
252 
253  for (std::size_t IDEnu = 0; IDEnu<tdcide.second.size(); ++IDEnu) //loop on IDE
254  {
255  sim::IDE const& ida = tdcide.second.at(IDEnu);
256 
257 // std::cout << "IDA " << ida.x << '\t' << ida.y << '\t' << ida.z << std::endl;
258 
259  true_barycentre_x = true_barycentre_x + ida.x*ida.energy;
260  true_barycentre_y = true_barycentre_y + ida.y*ida.energy;
261  true_barycentre_z = true_barycentre_z + ida.z*ida.energy;
262  total_quenched_energy = total_quenched_energy + ida.energy;
263 
264  } //loop on IDE
265 
266  } //loop on TDC
267 
268 }//loop on SimChannel
269 
270 true_barycentre_x = true_barycentre_x/total_quenched_energy;
271 true_barycentre_y = true_barycentre_y/total_quenched_energy;
272 true_barycentre_z = true_barycentre_z/total_quenched_energy;
273 
274 total_quenched_energy = total_quenched_energy/3;
275 
276 ////////////////////////////////// Light part //////////////////////////////////////////////////
277 turned_PMT=0;
278 
279 total_coll_photons=0;
280 
281 for (std::size_t channel = 0; channel < optical.size(); ++channel) {
282 
283  sim::SimPhotons const& photon_vec = optical[channel];
284 
285  noPMT[channel] = channel;
286 
287  photons_collected[channel]= photon_vec.size();
288  //std::cout << " channel " << channel << " photons collected " << photons_collected[channel] << std::endl;
289 // double media = photons_collected[channel]*QE;
290 
291 // QE_photons_collected[channel]= Ran.Poisson(media);
292 
293  QE_photons_collected[channel]= 0.06*photons_collected[channel];
294 
295  if (photons_collected[channel]>0){
296 
297  turned_PMT++;
298  }
299 
300  double xyz[3];
301 
302  geom->OpDetGeoFromOpChannel(channel).GetCenter(xyz);
303 
304  PMTx[channel] = xyz[0];
305  PMTy[channel] = xyz[1];
306  PMTz[channel] = xyz[2];
307 
308  total_coll_photons= total_coll_photons + photons_collected[channel];
309  //std::cout << " channel " << channel << " total photons " << total_coll_photons << std::endl;
310  firstphoton_time[channel] = 100000000;
311 
312  if (photons_collected[channel]>0)
313  {
314  for (size_t i = 0; i<photon_vec.size() && int(i)< MaxPhotons; ++i)
315  {
316  photon_time[channel][i]= photon_vec.at(i).Time;
317 
318  if (photon_time[channel][i]<firstphoton_time[channel])
319  {
320  firstphoton_time[channel]=photon_time[channel][i];
321  }
322  }
323 
324  }
325 
326 
327 // std::cout << PMTx[channel] << '\t' << PMTy[channel] << '\t' << PMTz[channel] << std::endl;
328 
329  if (PMTx[channel]<0){Cryostat[channel]=0;}
330  if (PMTx[channel]>0){Cryostat[channel]=1;}
331 
332  if (PMTx[channel]<-200){TPC[channel]=0;}
333  if (PMTx[channel]>-200 && PMTx[channel]<0){TPC[channel]=1;}
334  if (PMTx[channel]<200 && PMTx[channel]>0){TPC[channel]=2;}
335  if (PMTx[channel]>200){TPC[channel]=3;}
336 
337 }
338 
339 //total_coll_photons = total_coll_photons;
340 
341 std::cout << " fotoni finale = " <<total_coll_photons <<std::endl;
342 
343 
344 
345 for(int ijk=0;ijk<360;ijk++)
346 {
347  firstphoton_time_expected[ijk]=100000000;
348  firstphoton_time_expected_r[ijk]=100000000;
349  firstphoton_tp_expected[ijk]=100000000;
350  firstphoton_tp_expected_r[ijk]=100000000;
351  firstphoton_xp_expected[ijk]=100000000;
352  firstphoton_xp_expected_r[ijk]=100000000;
353  firstphoton_yp_expected[ijk]=100000000;
354  firstphoton_yp_expected_r[ijk]=100000000;
355  firstphoton_zp_expected[ijk]=100000000;
356  firstphoton_zp_expected_r[ijk]=100000000;
357 
358  firstphoton_tp_expected_v2[ijk]=100000000;
359  firstphoton_tp_expected_v3[ijk]=100000000;
360  firstphoton_xp_expected_v2[ijk]=100000000;
361  firstphoton_xp_expected_v3[ijk]=100000000;
362  firstphoton_yp_expected_v2[ijk]=100000000;
363  firstphoton_yp_expected_v3[ijk]=100000000;
364  firstphoton_zp_expected_v2[ijk]=100000000;
365  firstphoton_zp_expected_v3[ijk]=100000000;
366 
367  firstphoton_time_expected_v3[ijk]=100000000;
368  firstphoton_time_expected_v2[ijk]=100000000;
369  firstphoton_time_expected_d2[ijk]=100000000;
370  firstphoton_time_expected_d3[ijk]=100000000;
371 }
372 
373 for(size_t mcl = 0; mcl < type.size(); ++mcl)
374 {
375  art::Handle< std::vector<simb::MCTruth> > mclistHandle = type[mcl];
376 
377  for(size_t m = 0; m < mclistHandle->size(); ++m)
378  {
379  art::Ptr<simb::MCTruth> mct(mclistHandle, m);
380  for(int ipart=0;ipart<mct->NParticles();ipart++)
381  {
382  //int pdg=mct->GetParticle(ipart).PdgCode();
383  //double xx=mct->GetParticle(ipart).Vx();
384  //double yy=mct->GetParticle(ipart).Vy();
385  //double zz=mct->GetParticle(ipart).Vz();
386 
387  event_type=mct->GetParticle(0).PdgCode();
388  vertex_x=mct->GetParticle(0).Vx();
389  vertex_y=mct->GetParticle(0).Vy();
390  vertex_z=mct->GetParticle(0).Vz();
391 
392 
393 
394  }
395  }
396 
397 }
398 
399  gt_0=1;
400  gt_1=1;
401 
402 
403  for(const auto& tracknow3 : trackVec)
404  {
405  std::cout << tracknow3->NumberTrajectoryPoints() << std::endl;
406  int ntraj = tracknow3->NumberTrajectoryPoints();
407  int last_good_point=ntraj;
408  for ( size_t ijk=0;ijk<tracknow3->NumberTrajectoryPoints();ijk++)
409  {
410  auto trajPoint = tracknow3->TrajectoryPoint(ijk);
411  if(trajPoint.position.X()<-600)
412  {
413  last_good_point=ijk;
414  ijk=ntraj+1;
415  }
416  //std::cout << "Start of trajectory at " << trajPoint.position.X() << " " << trajPoint.position.Y() << " " << trajPoint.position.Z() << " cm " << std::endl;
417  }
418 
419 
420 
421  float y_max_value=-150;
422  int point_y_max=-1;
423 
424  for ( size_t ijk=0;ijk<tracknow3->NumberTrajectoryPoints();ijk++)
425  {
426  auto trajPoint = tracknow3->TrajectoryPoint(ijk);
427  if(trajPoint.position.Y()>y_max_value)
428  {
429  point_y_max=ijk;
430  y_max_value=trajPoint.position.Y();
431  }
432  //std::cout << "Start of trajectory at " << trajPoint.position.X() << " " << trajPoint.position.Y() << " " << trajPoint.position.Z() << " cm " << std::endl;
433  }
434 
435 
436  float c_f_x;
437  float c_f_y;
438  float c_f_z;
439 
440 
441 if(point_y_max>-1)
442 {
443  auto first_point=tracknow3->TrajectoryPoint(point_y_max);
444  c_f_x=first_point.position.X();
445  c_f_y=first_point.position.Y();
446  c_f_z=first_point.position.Z();
447 /*
448  auto first_point=tracknow3->TrajectoryPoint(0);
449  auto last_point=tracknow3->TrajectoryPoint(last_good_point);
450  float coordinates_y_0=first_point.position.Y();
451  float coordinates_y_l=last_point.position.Y();
452  float c_f_x;
453  float c_f_y;
454  float c_f_z;
455  if (coordinates_y_0>coordinates_y_l) {
456  c_f_x=first_point.position.X();
457  c_f_y=first_point.position.Y();
458  c_f_z=first_point.position.Z();
459  }
460  if (coordinates_y_0<=coordinates_y_l) {
461  c_f_x=last_point.position.X();
462  c_f_y=last_point.position.Y();
463  c_f_z=last_point.position.Z();
464  }
465 */
466 std::cout << "Start of trajectory at " << first_point.position.X() << " " << first_point.position.Y() << " " << first_point.position.Z() << " cm " << std::endl;
467  for ( int ijk2=0;ijk2<last_good_point;ijk2++)
468  {
469  auto trajPoint = tracknow3->TrajectoryPoint(ijk2);
470  //std::cout << "Start of trajectory at " << trajPoint.position.X() << " " << trajPoint.position.Y() << " " << trajPoint.position.Z() << " cm " << std::endl;
471  float xpr=trajPoint.position.X();
472  float ypr=trajPoint.position.Y();
473  float zpr=trajPoint.position.Z();
474  float distance_from_first_point=sqrt((xpr-c_f_x)*(xpr-c_f_x)+(ypr-c_f_y)*(ypr-c_f_y)+(zpr-c_f_z)*(zpr-c_f_z))/100;
475  float tpr=distance_from_first_point/0.3;
476  int factor=0;
477  if(xpr>0)factor=180;
478  if(xpr>-400)
479  {
480  for(int ijk=0;ijk<180;ijk++)
481  {
482  float distance_x=xpr-PMTx[ijk+factor];
483  float distance_y=ypr-PMTy[ijk+factor];
484  float distance_z=zpr-PMTz[ijk+factor];
485  float total_distance=sqrt(distance_x*distance_x+distance_y*distance_y+distance_z*distance_z)/100;
486  float time_travel_light=total_distance/(0.1);//velocita' e' 3*10^8 m/s cioe' 0.3 m/ns ma sto usando c/n e ho trovato n=1.5 da Petrillo al collaboration meeting
487  //std::cout << time_travel_light+tp << " " << tp << " " << time_travel_light << std::endl;
488  if(firstphoton_time_expected_r[ijk+factor]>(tpr+time_travel_light))
489 {
490 firstphoton_time_expected_r[ijk+factor]=(tpr+time_travel_light);
491  firstphoton_tp_expected_r[ijk+factor]=(tpr);
492  firstphoton_xp_expected_r[ijk+factor]=(xpr);
493  firstphoton_yp_expected_r[ijk+factor]=(ypr);
494  firstphoton_zp_expected_r[ijk+factor]=(zpr);
495 }
496  }
497  }
498  }
499 }
500 
501  /*
502  for ( recob::Trajectory::const_iterator trajectory = tracknow3->Trajectory().begin(); trajectory != tracknow3->Trajectory().end(); ++trajectory)
503  {
504  float xp=(*trajectory).first.X();
505  float yp=(*trajectory).first.Y();
506  float zp=(*trajectory).first.Z();
507  float tp=(*trajectory).first.T();
508  std::cout << xp << " " << yp << " " << zp << " " << tp << std::endl;
509  }
510  */
511  }
512 
513  for(const auto& particlenow3 : particleVec)
514  {
515 
516 for ( simb::MCTrajectory::const_iterator trajectory = particlenow3->Trajectory().begin(); trajectory != particlenow3->Trajectory().end(); ++trajectory)
517 {
518  float xp=(*trajectory).first.X();
519  float yp=(*trajectory).first.Y();
520  float zp=(*trajectory).first.Z();
521  float tp=(*trajectory).first.T();
522  //std::cout << xp << " " << yp << " " << zp << " " << tp << std::endl;
523  int factor=0;
524  if (yp>-185 && yp<140 && fabs(zp)<910)
525  {
526  if (xp<-343 || xp>-247) {
527  gt_0=0;
528  }
529  if (xp<-193 || xp>-98) {
530  gt_1=0;
531  }
532  }
533  if(xp>0)factor=180;
534  if(yp>-185 && yp<140 && fabs(zp)<910 && fabs(xp)<370 && fabs(xp)>70){
535  for(int ijk=0;ijk<180;ijk++)
536  {
537  float distance_x=xp-PMTx[ijk+factor];
538  float distance_y=yp-PMTy[ijk+factor];
539  float distance_z=zp-PMTz[ijk+factor];
540  float total_distance=sqrt(distance_x*distance_x+distance_y*distance_y+distance_z*distance_z)/100;
541  float time_travel_light_v2=total_distance/(0.2);//velocity used is 20 cm/ns
542  float time_travel_light=total_distance/(0.1);//velocity used is 10 cm/ns
543  float time_travel_light_v3=total_distance/(0.05);//velocity used is 5 cm/ns
544  if(firstphoton_time_expected[ijk+factor]>(tp+time_travel_light))
545 {
546 firstphoton_time_expected[ijk+factor]=(tp+time_travel_light);
547 firstphoton_tp_expected[ijk+factor]=(tp);
548 firstphoton_xp_expected[ijk+factor]=(xp);
549 firstphoton_yp_expected[ijk+factor]=(yp);
550 firstphoton_zp_expected[ijk+factor]=(zp);
551 }
552  if(firstphoton_time_expected_v2[ijk+factor]>(tp+time_travel_light_v2))
553 {
554 firstphoton_time_expected_v2[ijk+factor]=(tp+time_travel_light_v2);
555 firstphoton_tp_expected_v2[ijk+factor]=(tp);
556 firstphoton_xp_expected_v2[ijk+factor]=(xp);
557 firstphoton_yp_expected_v2[ijk+factor]=(yp);
558 firstphoton_zp_expected_v2[ijk+factor]=(zp);
559 }
560  if(firstphoton_time_expected_v3[ijk+factor]>(tp+time_travel_light_v3))
561 {
562 firstphoton_time_expected_v3[ijk+factor]=(tp+time_travel_light_v3);
563 firstphoton_tp_expected_v3[ijk+factor]=(tp);
564 firstphoton_xp_expected_v3[ijk+factor]=(xp);
565 firstphoton_yp_expected_v3[ijk+factor]=(yp);
566 firstphoton_zp_expected_v3[ijk+factor]=(zp);
567 }
568 
569  }
570  for(int ijk=0;ijk<180;ijk++)
571  {
572  float distance_x=(xp-25)-PMTx[ijk+factor];
573  float distance_y=yp-PMTy[ijk+factor];
574  float distance_z=zp-PMTz[ijk+factor];
575  float total_distance=sqrt(distance_x*distance_x+distance_y*distance_y+distance_z*distance_z)/100;
576  float time_travel_light_d2=total_distance/(0.1);//velocita' e' 3*10^8 m/s cioe' 0.3 m/ns ma sto usando c/n e ho trovato n=1.5 da Petrillo al collaboration meeting
577  if(firstphoton_time_expected_d2[ijk+factor]>(tp+time_travel_light_d2))firstphoton_time_expected_d2[ijk+factor]=(tp+time_travel_light_d2);
578  }
579  for(int ijk=0;ijk<180;ijk++)
580  {
581  float distance_x=(xp+25)-PMTx[ijk+factor];
582  float distance_y=yp-PMTy[ijk+factor];
583  float distance_z=zp-PMTz[ijk+factor];
584  float total_distance=sqrt(distance_x*distance_x+distance_y*distance_y+distance_z*distance_z)/100;
585  float time_travel_light_d3=total_distance/(0.1);//velocita' e' 3*10^8 m/s cioe' 0.3 m/ns ma sto usando c/n e ho trovato n=1.5 da Petrillo al collaboration meeting
586  if(firstphoton_time_expected_d3[ijk+factor]>(tp+time_travel_light_d3))firstphoton_time_expected_d3[ijk+factor]=(tp+time_travel_light_d3);
587  }
588 }
589 
590 
591  }
592  }
593 
594 
595 
596 fTree->Fill();
597  std::cout << " after filling " << fTree << std::endl;
598 }
599 
601 {
602  std::cout << " PMTStartCalibTime beginjob " << std::endl;
603 
604 art::ServiceHandle<art::TFileService> tfs;
605 fTree = tfs->make<TTree>("lighttree","tree for the light response");
606 
607 fTree->Branch("event",&event,"event/I");
608 fTree->Branch("event_type",&event_type,"event_type/I");
609 fTree->Branch("gt_0",&gt_0,"gt_0/I");
610 fTree->Branch("gt_1",&gt_1,"gt_1/I");
611 fTree->Branch("total_quenched_energy",&total_quenched_energy,"total_quenched_energy");
612 fTree->Branch("Cryostat",&Cryostat,("Cryostat[" + std::to_string(nPMTs) + "]/I").c_str());
613 fTree->Branch("TPC",&TPC,("TPC[" + std::to_string(nPMTs) + "]/I").c_str());
614 fTree->Branch("noPMT",&noPMT,("noPMT[" + std::to_string(nPMTs) + "]/I").c_str());
615 fTree->Branch("PMTx",&PMTx,("PMTx[" + std::to_string(nPMTs) + "]/D").c_str());
616 fTree->Branch("PMTy",&PMTy,("PMTy[" + std::to_string(nPMTs) + "]/D").c_str());
617 fTree->Branch("PMTz",&PMTz,("PMTz[" + std::to_string(nPMTs) + "]/D").c_str());
618 fTree->Branch("turned_PMT",&turned_PMT,"turned_PMT/I");
619 fTree->Branch("total_coll_photons",&total_coll_photons,"total_coll_photons/F");
620 fTree->Branch("photons_colleted",&photons_collected,("photons_collected[" + std::to_string(nPMTs) + "]/F").c_str());
621 fTree->Branch("QE_photons_colleted",&QE_photons_collected,("QE_photons_collected[" + std::to_string(nPMTs) + "]/F").c_str());
622 fTree->Branch("firstphoton_time",&firstphoton_time,("firstphoton_time[" + std::to_string(nPMTs) + "]/F").c_str());
623 fTree->Branch("firstphoton_time_expected",&firstphoton_time_expected,("firstphoton_time_expected[" + std::to_string(nPMTs) + "]/F").c_str());
624 fTree->Branch("firstphoton_time_expected_r",&firstphoton_time_expected_r,("firstphoton_time_expected_r[" + std::to_string(nPMTs) + "]/F").c_str());
625 fTree->Branch("firstphoton_tp_expected",&firstphoton_tp_expected,("firstphoton_tp_expected[" + std::to_string(nPMTs) + "]/F").c_str());
626 fTree->Branch("firstphoton_tp_expected_r",&firstphoton_tp_expected_r,("firstphoton_tp_expected_r[" + std::to_string(nPMTs) + "]/F").c_str());
627 fTree->Branch("firstphoton_xp_expected",&firstphoton_xp_expected,("firstphoton_xp_expected[" + std::to_string(nPMTs) + "]/F").c_str());
628 fTree->Branch("firstphoton_xp_expected_r",&firstphoton_xp_expected_r,("firstphoton_xp_expected_r[" + std::to_string(nPMTs) + "]/F").c_str());
629 fTree->Branch("firstphoton_yp_expected",&firstphoton_yp_expected,("firstphoton_yp_expected[" + std::to_string(nPMTs) + "]/F").c_str());
630 fTree->Branch("firstphoton_yp_expected_r",&firstphoton_yp_expected_r,("firstphoton_yp_expected_r[" + std::to_string(nPMTs) + "]/F").c_str());
631 fTree->Branch("firstphoton_zp_expected",&firstphoton_zp_expected,("firstphoton_zp_expected[" + std::to_string(nPMTs) + "]/F").c_str());
632 fTree->Branch("firstphoton_zp_expected_r",&firstphoton_zp_expected_r,("firstphoton_zp_expected_r[" + std::to_string(nPMTs) + "]/F").c_str());
633 
634 fTree->Branch("firstphoton_tp_expected_v2",&firstphoton_tp_expected_v2,("firstphoton_tp_expected_v2[" + std::to_string(nPMTs) + "]/F").c_str());
635 fTree->Branch("firstphoton_tp_expected_v3",&firstphoton_tp_expected_v3,("firstphoton_tp_expected_v3[" + std::to_string(nPMTs) + "]/F").c_str());
636 fTree->Branch("firstphoton_xp_expected_v2",&firstphoton_xp_expected_v2,("firstphoton_xp_expected_v2[" + std::to_string(nPMTs) + "]/F").c_str());
637 fTree->Branch("firstphoton_xp_expected_v3",&firstphoton_xp_expected_v3,("firstphoton_xp_expected_v3[" + std::to_string(nPMTs) + "]/F").c_str());
638 fTree->Branch("firstphoton_yp_expected_v2",&firstphoton_yp_expected_v2,("firstphoton_yp_expected_v3[" + std::to_string(nPMTs) + "]/F").c_str());
639 fTree->Branch("firstphoton_yp_expected_v3",&firstphoton_yp_expected_v3,("firstphoton_yp_expected_v2[" + std::to_string(nPMTs) + "]/F").c_str());
640 fTree->Branch("firstphoton_zp_expected_v2",&firstphoton_zp_expected_v2,("firstphoton_zp_expected_v2[" + std::to_string(nPMTs) + "]/F").c_str());
641 fTree->Branch("firstphoton_zp_expected_v3",&firstphoton_zp_expected_v3,("firstphoton_zp_expected_v3[" + std::to_string(nPMTs) + "]/F").c_str());
642 
643 
644 fTree->Branch("firstphoton_time_expected_v2",&firstphoton_time_expected_v2,("firstphoton_time_expected_v2[" + std::to_string(nPMTs) + "]/F").c_str());
645 fTree->Branch("firstphoton_time_expected_v3",&firstphoton_time_expected_v3,("firstphoton_time_expected_v3[" + std::to_string(nPMTs) + "]/F").c_str());
646 fTree->Branch("firstphoton_time_expected_d2",&firstphoton_time_expected_d2,("firstphoton_time_expected_d2[" + std::to_string(nPMTs) + "]/F").c_str());
647 fTree->Branch("firstphoton_time_expected_d3",&firstphoton_time_expected_d3,("firstphoton_time_expected_d3[" + std::to_string(nPMTs) + "]/F").c_str());
648 //fTree->Branch("photon_time",&photon_time,"photon_time[360][10000]/F");
649 fTree->Branch("vertex_x",&vertex_x,"vertex_x/D");
650 fTree->Branch("vertex_y",&vertex_y,"vertex_y/D");
651 fTree->Branch("vertex_z",&vertex_z,"vertex_z/D");
652 fTree->Branch("true_barycentre_x",&true_barycentre_x,"true_barycentre_x/F");
653 fTree->Branch("true_barycentre_y",&true_barycentre_y,"true_barycentre_y/F");
654 fTree->Branch("true_barycentre_z",&true_barycentre_z,"true_barycentre_z/F");
655 }
656 
657 DEFINE_ART_MODULE(icarus::PMTStartCalibTime)
float z
z position of ionization [cm]
Definition: SimChannel.h:121
PMTStartCalibTime & operator=(PMTStartCalibTime const &)=delete
std::pair< unsigned short, std::vector< sim::IDE > > TDCIDE
List of energy deposits at the same time (on this channel)
Definition: SimChannel.h:127
Declaration of signal hit object.
pdgs p
Definition: selectors.fcl:22
Class to keep data related to recob::Hit associated with recob::Track.
void analyze(art::Event const &e) override
BEGIN_PROLOG g
float x
x position of ionization [cm]
Definition: SimChannel.h:119
tuple m
now if test mode generate materials, CRT shell, world, gdml header else just generate CRT shell for u...
BEGIN_PROLOG TPC
Simulation objects for optical detectors.
Ionization at a point of the TPC sensitive volume.
Definition: SimChannel.h:86
float energy
energy deposited by ionization by this track ID and time [MeV]
Definition: SimChannel.h:118
Declaration of cluster object.
Definition of data types for geometry description.
Provides recob::Track data product.
float y
y position of ionization [cm]
Definition: SimChannel.h:120
Collection of photons which recorded on one channel.
Definition: SimPhotons.h:136
std::string to_string(WindowPattern const &pattern)
const int MaxPhotons
object containing MC truth information necessary for making RawDigits and doing back tracking ...
do i e
Declaration of basic channel signal object.
PMTStartCalibTime(fhicl::ParameterSet const &p)
art::ServiceHandle< art::TFileService > tfs
TCEvent evt
Definition: DataStructs.cxx:8
float photon_time[nPMTs][MaxPhotons]
Utility functions to extract information from recob::Track
const int nPMTs
Tools and modules for checking out the basics of the Monte Carlo.
art framework interface to geometry description
BEGIN_PROLOG could also be cout