diffusioncathodet0_module.cc
Go to the documentation of this file.
1 //////////////////////////////////////////////////////////////////////////////
2 // Class: diffusioncathodet0 ///
3 // File: diffusioncathodet0_module.cc ///
4 //Description: ///
5 //drift diffusioncathodet0 calculation module ///
6 //dumps all the infomrmation in TTrees which needs to analysed ///
7 //contact person:apaudel@phys.ksu.edu ///
8 //////////////////////////////////////////////////////////////////////////////
13 #include "art_root_io/TFileService.h"
14 #include "art_root_io/TFileDirectory.h"
16 #include "canvas/Persistency/Common/FindManyP.h"
19 #include "fhiclcpp/ParameterSet.h"
21 #include "dune/Protodune/singlephase/DataUtils/ProtoDUNEDataUtils.h"
23 
33 #include "lardataobj/RawData/raw.h"
57 
58 #include "TFile.h"
59 #include "TTree.h"
60 #include "TDirectory.h"
61 #include "TH1.h"
62 #include "TH2.h"
63 #include "TF1.h"
64 #include "TProfile.h"
65 #include "TROOT.h"
66 #include "TStyle.h"
67 #include "TMath.h"
68 #include "TGraphErrors.h"
69 #include "TMinuit.h"
70 #include "TString.h"
71 #include "TTimeStamp.h"
72 #include "TVectorD.h"
73 #include "TCanvas.h"
74 #include "TFrame.h"
75 #include "TLine.h"
76 #include "TAxis.h"
77 #include "TTimeStamp.h"
78 
79 //Root and C++ include
80 #include "TVector3.h"
81 #include "TLorentzVector.h"
82 #include <vector>
83 #include <fstream>
84 #include "TPaveStats.h"
85 #include <iostream>
86 #include <string>
87 #include "math.h"
88 #include "stdio.h"
89 #include <iterator>
90 
91 //using namespace std;
92 
93 
94 namespace protoana{
96  public:
97  explicit diffusioncathodet0(fhicl::ParameterSet const& pset);
98  virtual ~diffusioncathodet0();
99 
100  void beginJob();
101  void endJob();
102  void beginRun(const art::Run& run);
103  void analyze(const art::Event& evt);
104  void reset();
105 
106  private:
108  TTree* fEventTree;
110 
111  //These are the tree variables I will be using
112  Int_t run;
113  Int_t subrun;
114  Int_t event;
115  Double_t evttime;
117  std::vector<float> trackthetaxz;
118  std::vector<float> trackthetayz;
119  std::vector<float> trkstartx;
120  std::vector<float> trkstarty;
121  std::vector<float> trkstartz;
122  std::vector< std::vector<float> > trkstartcosxyz;
123  std::vector< std::vector<float> > trkendcosxyz;
124  std::vector<float> trkendx;
125  std::vector<float> trkendy;
126  std::vector<float> trkendz;
127 
128 
129  std::vector<float> trklen;
130  std::vector<int> TrkID;
131  std::vector<float> xprojectedlen;
132  std::vector<double> T0_values;
133  std::vector<int> tot_trks;
134  std::vector< std::vector<float> > hit_peakT0;
135  std::vector< std::vector<int> > hit_tpc0;
136  std::vector< std::vector<int> > hit_wire0;
137  std::vector< std::vector<float> > hit_rms0;
138  std::vector< std::vector<float> > hit_deltaT;
139  std::vector< std::vector<float> > trkhitx0;
140  std::vector< std::vector<float> > trkhity0;
141  std::vector< std::vector<float> > trkhitz0;
142  std::vector< std::vector<float> > trkdq_amp0;
143  std::vector< std::vector<float> >trkdq_int0;
144  std::vector< std::vector<float> > hit_peakT1;
145  std::vector< std::vector<int> > hit_tpc1;
146  std::vector< std::vector<int> > hit_wire1;
147  std::vector< std::vector<float> > hit_rms1;
148  std::vector< std::vector<float> > trkhitx1;
149  std::vector< std::vector<float> > trkhity1;
150  std::vector< std::vector<float> > trkhitz1;
151  std::vector< std::vector<float> > trkdq_amp1;
152  std::vector< std::vector<float> > trkdq_int1;
153  std::vector< std::vector<float> > hit_peakT2;
154  std::vector< std::vector<int> > hit_tpc2;
155  std::vector< std::vector<int> > hit_wire2;
156  std::vector< std::vector<float> > hit_rms2;
157  std::vector< std::vector<float> > hit_rms_true;
158  std::vector< std::vector<float> > trkhitx2;
159  std::vector< std::vector<float> > trkhity2;
160  std::vector< std::vector<float> > trkhitz2;
161  std::vector< std::vector<float> > trkhitz_wire2;
162  std::vector< std::vector<float> > trkdq_amp2;
163  std::vector< std::vector<float> > trkdq_int2;
164  std::vector< std::vector<float> > multiplicity2;
165  std::vector< std::vector<float> > goodnessoffit2;
171  };
172 
173  //========================================================================
175  EDAnalyzer(pset),
176  fDataUtils (pset.get<fhicl::ParameterSet>("DataUtils")),
177  fHitsModuleLabel (pset.get< std::string >("HitsModuleLabel","") ),
178  fTrackModuleLabel (pset.get< std::string >("TrackModuleLabel","") ),
179  fCalorimetryModuleLabel (pset.get< std::string >("CalorimetryModuleLabel","") ),
180  fSaveTrackInfo (pset.get< bool>("SaveTrackInfo",false)),
181  fSaveCaloInfo (pset.get< bool>("SaveCaloInfo",false))
182 
183  {
184  if (fSaveTrackInfo == false) fSaveCaloInfo = false;
185  }
186 
187  //========================================================================
189  }
190  //========================================================================
191 
192  //========================================================================
194  std::cout<<"job begin..."<<std::endl;
196  fEventTree = tfs->make<TTree>("Event", "Event Tree from Reco");
197  fEventTree->Branch("event", &event,"event/I");
198  fEventTree->Branch("evttime",&evttime,"evttime/D");
199  fEventTree->Branch("run", &run,"run/I");
200  fEventTree->Branch("Nactivefembs",&fNactivefembs,"Nactivefembs[6]/I");
201  fEventTree->Branch("subrun", &subrun,"surbrun/I");
202  fEventTree->Branch("T0_values",&T0_values);
203  fEventTree->Branch("xprojectedlen",&xprojectedlen);
204  fEventTree->Branch("trackthetaxz",&trackthetaxz);
205  fEventTree->Branch("trackthetayz",&trackthetayz);
206  fEventTree->Branch("trkstartx",&trkstartx);
207  fEventTree->Branch("trkstarty",&trkstarty);
208  fEventTree->Branch("trkstartz",&trkstartz);
209  fEventTree->Branch("trkendx",&trkendx);
210  fEventTree->Branch("trkendy",&trkendy);
211  fEventTree->Branch("trkendz",&trkendz);
212  fEventTree->Branch("trklen",&trklen);
213  fEventTree->Branch("TrkID",&TrkID);
214  fEventTree->Branch("tot_trks",&tot_trks);
215  fEventTree->Branch("hit_peakT0",&hit_peakT0);
216  fEventTree->Branch("hit_tpc0",&hit_tpc0);
217  fEventTree->Branch("hit_wire0",&hit_wire0);
218  fEventTree->Branch("hit_rms0",&hit_rms0);
219  fEventTree->Branch("hit_deltaT",&hit_deltaT);
220  fEventTree->Branch("trkhitx0",&trkhitx0);
221  fEventTree->Branch("trkhity0",&trkhity0);
222  fEventTree->Branch("trkhitz0",&trkhitz0);
223  fEventTree->Branch("trkdq_int0",&trkdq_int0);
224  fEventTree->Branch("trkdq_amp0",&trkdq_amp0);
225  fEventTree->Branch("hit_peakT1",&hit_peakT1);
226  fEventTree->Branch("hit_tpc1",&hit_tpc1);
227  fEventTree->Branch("hit_wire1",&hit_wire1);
228  fEventTree->Branch("hit_rms1",&hit_rms1);
229  fEventTree->Branch("trkhitx1",&trkhitx1);
230  fEventTree->Branch("trkhity1",&trkhity1);
231  fEventTree->Branch("trkhitz1",&trkhitz1);
232  fEventTree->Branch("trkdq_int1",&trkdq_int1);
233  fEventTree->Branch("trkdq_amp1",&trkdq_amp1);
234  fEventTree->Branch("hit_peakT2",&hit_peakT2);
235  fEventTree->Branch("hit_tpc2",&hit_tpc2);
236  fEventTree->Branch("hit_wire2",&hit_wire2);
237  fEventTree->Branch("hit_rms2",&hit_rms2);
238  fEventTree->Branch("hit_rms_true",&hit_rms_true);
239  fEventTree->Branch("trkhitx2",&trkhitx2);
240  fEventTree->Branch("trkhity2",&trkhity2);
241  fEventTree->Branch("trkhitz2",&trkhitz2);
242  fEventTree->Branch("trkhitz_wire2",&trkhitz_wire2);
243  fEventTree->Branch("trkdq_int2",&trkdq_int2);
244  fEventTree->Branch("trkdq_amp2",&trkdq_amp2);
245  fEventTree->Branch("trkstartcosxyz",&trkstartcosxyz);
246  fEventTree->Branch("trkendcosxyz",&trkendcosxyz);
247  fEventTree->Branch("multiplicity2",&multiplicity2);
248  fEventTree->Branch("goodnessoffit2",&goodnessoffit2);
249  }
250 
251  //========================================================================
253 
254  }
255 
256  //========================================================================
258  mf::LogInfo("diffusioncathodet0")<<"begin run..."<<std::endl;
259  }
260  //========================================================================
261 
262  //========================================================================
263 
264  //========================================================================
265 
267  reset();
268 
269  // art::ServiceHandle<cheat::ParticleInventoryService> pi_serv;
271 
272  std::vector<art::Ptr<recob::Track> > tracklist;
273  auto trackListHandle = evt.getHandle< std::vector<recob::Track> >("pandoraTrack");
274  if(trackListHandle) {
275  art::fill_ptr_vector(tracklist, trackListHandle);
276  }
277  else return;
278 
279  std::vector<art::Ptr<recob::PFParticle> > pfplist;
280  auto PFPListHandle = evt.getHandle< std::vector<recob::PFParticle> >("pandora");
281  if (PFPListHandle) art::fill_ptr_vector(pfplist, PFPListHandle);
282 
283  // get information about the hits
284  std::vector<art::Ptr<recob::Hit>> hitlist;
285  auto hitListHandle = evt.getHandle< std::vector<recob::Hit> >(fHitsModuleLabel);
286  if (hitListHandle) art::fill_ptr_vector(hitlist, hitListHandle);
287  art::FindManyP<recob::Hit, recob::TrackHitMeta> fmthm(trackListHandle, evt, fTrackModuleLabel); // to associate tracks and hits
288  art::FindManyP<anab::T0> trk_t0_assn_v(PFPListHandle, evt ,"pandora");
289  art::FindManyP<recob::PFParticle> pfp_trk_assn(trackListHandle,evt,"pandoraTrack");
290  art::FindManyP<anab::T0> fmT0(trackListHandle, evt ,"pmtrack");
291  std::vector<const sim::SimChannel*> fSimChannels;
292  try{
293  evt.getView("largeant", fSimChannels);
294  }catch (art::Exception const&e){
295  }
296 
297 
298  run = evt.run();
299  subrun = evt.subRun();
300  event = evt.id().event();
301  art::Timestamp ts = evt.time();
302  TTimeStamp tts(ts.timeHigh(), ts.timeLow());
303  evttime=tts.AsDouble();
304 
305 
306 
307  // Get number of active fembs
308  if(!evt.isRealData()){
309  for(int k=0; k < 6; k++)
310  fNactivefembs[k] = 20;
311  }
312  else{
313  for(int k=0; k < 6; k++)
315  }
316 
317 
318  //defining the 1D temporary storage vectors
319  std::vector< float> peakT_0; std::vector< float> peakT_1; std::vector< float> peakT_2;
320  std::vector< int > tpc_0; std::vector< int > tpc_1; std::vector<int> tpc_2;
321  std::vector< int > wire_0; std::vector< int > wire_1; std::vector<int> wire_2;
322  std::vector< float > int_0; std::vector< float > int_1; std::vector<float> int_2;
323  std::vector< float > amp_0; std::vector< float > amp_1; std::vector<float> amp_2;
324  std::vector<float> rms_0; std::vector<float> rms_1; std::vector<float> rms_2;
325  std::vector<float> hitx_0; std::vector<float> hitx_1; std::vector<float> hitx_2;
326  std::vector<float> hity_0; std::vector<float> hity_1; std::vector<float> hity_2;
327  std::vector<float> hitz_0; std::vector<float> hitz_1; std::vector<float> hitz_2;
328  std::vector<float> hitz_wire2; std::vector<float> startcosxyz; std::vector<float> endcosxyz;
329  std::vector<float> dT_buffer; std::vector<float> gof, multi,truerms;
330 
331  float max_value;
332  float min_value;
333  int trks=0;
334  size_t NTracks = tracklist.size();
335  for(size_t i=0; i<NTracks;++i){
336 
337  //clearing the 1D temporary storage vectors
338  peakT_0.clear(); peakT_1.clear(); peakT_2.clear();
339  tpc_0.clear(); tpc_1.clear(); tpc_2.clear();
340  wire_0.clear(); wire_1.clear(); wire_2.clear();
341  int_0.clear(); int_1.clear() ; int_2.clear();
342  amp_0.clear(); amp_1.clear() ; amp_2.clear();
343  rms_0.clear(); rms_1.clear(); rms_2.clear();
344  hitx_0.clear(); hitx_1.clear(); hitx_2.clear();
345  hity_0.clear(); hity_1.clear(); hity_2.clear();
346  hitz_0.clear(); hitz_1.clear(); hitz_2.clear();
347  hitz_wire2.clear(); startcosxyz.clear();endcosxyz.clear();
348  dT_buffer.clear(); gof.clear(); multi.clear();
349  truerms.clear();
350 
351 
352  art::Ptr<recob::Track> ptrack(trackListHandle, i);
353 
354  ///this block just saves the t0 values while I include entries with no T0s as well also this saves T0 coming from pandroaTrack alg only
355  double t_zero=-999999;
356  max_value=0.0;
357  min_value=0.0;
358  if(fTrackModuleLabel=="pandoraTrack"){
359  std::vector<art::Ptr<recob::PFParticle>> pfps=pfp_trk_assn.at(i);
360  if(!pfps.size()) continue;
361  std::vector<art::Ptr<anab::T0>> t0s=trk_t0_assn_v.at(pfps[0].key());
362  // if(!t0s.size()) continue;
363  //auto t0 = t0s.at(0);
364  // double t_zero=t0->Time();
365  if(t0s.size()==0) continue;
366  if(t0s.size()){
367  auto t0=t0s.at(0);
368  t_zero=t0->Time();
369  }
370  }
371 
372  if(fTrackModuleLabel=="pmtrack"){
373  std::vector<art::Ptr<anab::T0>> T0s=fmT0.at(i);
374  if(T0s.size()==0)
375  continue;
376  }
377 
378  const recob::Track& track = *ptrack;
379  auto pos = track.Vertex();
380  auto dir_start = track.VertexDirection();
381  auto dir_end = track.EndDirection();
382  auto end = track.End();
383  double theta_xz = std::atan2(dir_start.X(), dir_start.Z());
384  double theta_yz = std::atan2(dir_start.Y(), dir_start.Z());
385 
386  int planenum=999;
387  float xpos=-9999;
388  float ypos=-9999;
389  float zpos=-9999;
390  auto allHits=fmthm.at(i);
391 
392  //hits and calorimetry loop
393  if(fmthm.isValid()){
394  auto vhit=fmthm.at(i);
395  auto vmeta=fmthm.data(i);
396  for (size_t ii = 0; ii<vhit.size(); ++ii){ //loop over all meta data hit
397  bool fBadhit = false;
398  if (vmeta[ii]->Index() == static_cast<unsigned int>(std::numeric_limits<int>::max())){
399  fBadhit = true;
400  //cout<<"fBadHit"<<fBadhit<<endl;
401  continue;
402  }
403  if (vmeta[ii]->Index()>=tracklist[i]->NumberTrajectoryPoints()){
404  throw cet::exception("Calorimetry_module.cc") << "Requested track trajectory index "<<vmeta[ii]->Index()<<" exceeds the total number of trajectory points "<<tracklist[i]->NumberTrajectoryPoints()<<" for track index "<<i<<". Something is wrong with the track reconstruction. Please contact tjyang@fnal.gov!!";
405  }
406  if (!tracklist[i]->HasValidPoint(vmeta[ii]->Index())){
407  fBadhit = true;
408  // cout<<"had valid point "<<fBadhit<<endl;
409  continue;
410  }
411 
412  auto loc = tracklist[i]->LocationAtPoint(vmeta[ii]->Index());
413  xpos=loc.X();
414  ypos=loc.Y();
415  zpos=loc.Z();
416  // cout<<"x, y, z "<<xpos<<" "<<ypos<<" "<<zpos<<endl;
417  // cout<<"BadHit"<<fBadhit<<endl;
418  if (fBadhit) continue; //HY::If BAD hit, skip this hit and go next
419  if (zpos<-100) continue; //hit not on track
420  planenum=vhit[ii]->WireID().Plane;
421  if(planenum==0){
422  peakT_0.push_back(vhit[ii]->PeakTime());
423  tpc_0.push_back(vhit[ii]->WireID().TPC);
424  wire_0.push_back(vhit[ii]->WireID().Wire);
425  int_0.push_back(vhit[ii]->Integral());
426  amp_0.push_back(vhit[ii]->PeakAmplitude());
427  rms_0.push_back(vhit[ii]->RMS());
428  hitx_0.push_back(xpos);
429  hity_0.push_back(ypos);
430  hitz_0.push_back(zpos);
431  }//planenum 0
432  if(planenum==1){
433  peakT_1.push_back(vhit[ii]->PeakTime());
434  tpc_1.push_back(vhit[ii]->WireID().TPC);
435  wire_1.push_back(vhit[ii]->WireID().Wire);
436  int_1.push_back(vhit[ii]->Integral());
437  amp_1.push_back(vhit[ii]->PeakAmplitude());
438  rms_1.push_back(vhit[ii]->RMS());
439  hitx_1.push_back(xpos);
440  hity_1.push_back(ypos);
441  hitz_1.push_back(zpos);
442  }//planenum 1
443  if(planenum==2){
444  peakT_2.push_back(vhit[ii]->PeakTime());
445  tpc_2.push_back(vhit[ii]->WireID().TPC);
446  wire_2.push_back(vhit[ii]->WireID().Wire);
447  int_2.push_back(vhit[ii]->Integral());
448  amp_2.push_back(vhit[ii]->PeakAmplitude());
449  rms_2.push_back(vhit[ii]->RMS());
450  dT_buffer.push_back(vhit[ii]->EndTick()-vhit[ii]->StartTick());
451  hitx_2.push_back(xpos);
452  hity_2.push_back(ypos);
453  hitz_2.push_back(zpos);
454  gof.push_back(vhit[ii]->GoodnessOfFit());
455  multi.push_back(vhit[ii]->Multiplicity());
456  double xyzStart[3];
457  double xyzEnd[3];
458  unsigned int wireno=vhit[ii]->WireID().Wire;
459  fGeometry->WireEndPoints(0,vhit[ii]->WireID().TPC,2,wireno, xyzStart, xyzEnd);
460  hitz_wire2.push_back(xyzStart[2]);
461  double truermsb=-1;
462 
463  //section for using tuth information
464  unsigned int t0=vhit[ii]->PeakTime()-3*(vhit[ii]->RMS());
465  if(t0<0) t0=0;
466  unsigned int t1=vhit[ii]->PeakTime()+3*(vhit[ii]->RMS());
467  if(t1>6000) t1=6000-1;
468 
469  if(!evt.isRealData()){
470  const sim::SimChannel* chan=0;
471  for(size_t sc=0;sc<fSimChannels.size();++sc){
472  if(fSimChannels[sc]->Channel()==vhit[ii]->Channel()) chan=fSimChannels[sc];
473  }
474  if(chan){
475  const auto &tdcidemap = chan->TDCIDEMap();
476  double hit_ch=0;
477  double mean_t=0;
478  double mean_t2=0;
479  double hit_rmsvalue=0;
480  for(auto mapitr = tdcidemap.begin(); mapitr != tdcidemap.end(); mapitr++){
481  if(!((*mapitr).first>t0 && (*mapitr).first<=t1)) continue;
482  // loop over the vector of IDE objects.
483  int hit_nelec=0;
484  const std::vector<sim::IDE> idevec = (*mapitr).second;
485  for(size_t iv = 0; iv < idevec.size(); ++iv){
486  hit_nelec+=idevec[iv].numElectrons;
487  }//iv loop
488  hit_ch+=hit_nelec;
489  // std::cout<<"hit_ch "<<hit_ch<<std::endl;
490  int j=(*mapitr).first;
491  mean_t+=double(j)*double(hit_nelec);
492  double jterm=double(j)*double(j)*double(hit_nelec);
493  mean_t2=mean_t2+jterm;
494  }//mapitr loop
495  mean_t/=hit_ch;
496  mean_t2/=hit_ch;
497  hit_rmsvalue=sqrt(mean_t2-mean_t*mean_t);
498  // std::cout<<"hit rms "<<hit_rmsvalue<<" reco rms "<<vhit[ii]->RMS()<<std::endl;
499  truermsb=hit_rmsvalue;
500  }//if(chan)
501  }//!evt.IsRealData
502  truerms.push_back(truermsb);
503 
504 
505  }//planenum 2
506  }//loop over vhit
507  }//fmthm valid
508  //hits and calorimetry loop
509  if(peakT_2.size()<10) continue;
510  max_value=*std::max_element(peakT_2.begin(),peakT_2.end());
511  min_value=*std::min_element(peakT_2.begin(),peakT_2.end());
512  // if(max_value-min_value<4300) continue;
513  std::cout<<max_value<<" "<<min_value<<std::endl;
514  trks++;
515  hit_peakT0.push_back(peakT_0);
516  hit_tpc0.push_back(tpc_0);
517  hit_wire0.push_back(wire_0);
518  hit_rms0.push_back(rms_0);
519  trkhitx0.push_back(hitx_0);
520  trkhity0.push_back(hity_0);
521  trkhitz0.push_back(hitz_0);
522  trkdq_amp0.push_back(amp_0);
523  trkdq_int0.push_back(int_0);
524 
525  hit_peakT1.push_back(peakT_1);
526  hit_tpc1.push_back(tpc_1);
527  hit_wire1.push_back(wire_1);
528  hit_rms1.push_back(rms_1);
529  trkhitx1.push_back(hitx_1);
530  trkhity1.push_back(hity_1);
531  trkhitz1.push_back(hitz_1);
532  trkdq_amp1.push_back(amp_1);
533  trkdq_int1.push_back(int_1);
534 
535  hit_peakT2.push_back(peakT_2);
536  hit_tpc2.push_back(tpc_2);
537  hit_wire2.push_back(wire_2);
538  hit_rms2.push_back(rms_2);
539  hit_rms_true.push_back(truerms);
540  trkhitx2.push_back(hitx_2);
541  trkhity2.push_back(hity_2);
542  trkhitz2.push_back(hitz_2);
543  trkhitz_wire2.push_back(hitz_wire2);
544  trkdq_amp2.push_back(amp_2);
545  trkdq_int2.push_back(int_2);
546  hit_deltaT.push_back(dT_buffer);
547  multiplicity2.push_back(multi);
548  goodnessoffit2.push_back(gof);
549 
550 
551 
552  xprojectedlen.push_back(TMath::Abs(end.X()-pos.X()));
553  trackthetaxz.push_back(theta_xz);
554  trackthetayz.push_back(theta_yz);
555  trkstartx.push_back(pos.X());
556  trkstarty.push_back(pos.Y());
557  trkstartz.push_back(pos.Z());
558  startcosxyz.push_back(dir_start.X());
559  startcosxyz.push_back(dir_start.Y());
560  startcosxyz.push_back(dir_start.Z());
561  endcosxyz.push_back(dir_end.X());
562  endcosxyz.push_back(dir_end.Y());
563  endcosxyz.push_back(dir_end.Z());
564 
565  trkstartcosxyz.push_back(startcosxyz);
566  trkendcosxyz.push_back(endcosxyz);
567  trkendx.push_back(end.X());
568 
569  trkendy.push_back(end.Y());
570  trkendz.push_back(end.Z());
571  trklen.push_back(track.Length());
572  TrkID.push_back(track.ID());
573  T0_values.push_back(t_zero);
574  } // loop over trks...
575  tot_trks.push_back(trks);
576  fEventTree->Fill();
577  } // end of analyze function
578 
579  /////////////////// Defintion of reset function ///////////
581  run = -9999;
582  subrun = -9999;
583  event = -9999;
584  evttime = -9999;
585  //all_trks = -9999;
586  for(int k=0; k < 6; k++)
587  fNactivefembs[k] = -9999;
588  trackthetaxz.clear();
589  trackthetayz.clear();
590  trkstartx.clear();
591  trkstarty.clear();
592  trkstartz.clear();
593  trkstartcosxyz.clear();
594  trkendcosxyz.clear();
595  trkendx.clear();
596  trkendy.clear();
597  trkendz.clear();
598  trklen.clear();
599  TrkID.clear();
600  tot_trks.clear();
601  T0_values.clear();
602  xprojectedlen.clear();
603  hit_peakT0.clear();
604  hit_tpc0.clear();
605  hit_wire0.clear();
606  trkhitx0.clear();
607  trkhity0.clear();
608  trkhitz0.clear();
609  trkdq_int0.clear();
610  trkdq_amp0.clear();
611  hit_rms0.clear();
612  hit_peakT1.clear();
613  hit_tpc1.clear();
614  hit_wire1.clear();
615  trkhitx1.clear();
616  trkhity1.clear();
617  trkhitz1.clear();
618  trkdq_int1.clear();
619  trkdq_amp1.clear();
620  hit_rms1.clear();
621  hit_peakT2.clear();
622  hit_tpc2.clear();
623  hit_wire2.clear();
624  trkhitx2.clear();
625  trkhity2.clear();
626  trkhitz2.clear();
627  trkhitz_wire2.clear();
628  trkdq_int2.clear();
629  trkdq_amp2.clear();
630  hit_rms2.clear();
631  hit_deltaT.clear();
632  multiplicity2.clear();
633  goodnessoffit2.clear();
634  hit_rms_true.clear();
635  }
636  //////////////////////// End of definition ///////////////
637 
639 }
end
while True: pbar.update(maxval-len(onlies[E][S])) #print iS, "/", len(onlies[E][S]) found = False for...
code to link reconstructed objects back to the MC truth information
std::vector< std::vector< float > > hit_rms0
constexpr std::uint32_t timeLow() const
Definition: Timestamp.h:29
std::vector< std::vector< int > > hit_tpc0
Energy deposited on a readout channel by simulated tracks.
Definition: SimChannel.h:140
TH3F * xpos
Definition: doAna.cpp:29
Handle< PROD > getHandle(SelectorBase const &) const
Definition: DataViewImpl.h:382
std::string string
Definition: nybbler.cc:12
std::vector< std::vector< float > > trkhitz2
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
std::vector< std::vector< float > > multiplicity2
std::vector< std::vector< int > > hit_tpc2
std::vector< std::vector< int > > hit_wire0
constexpr std::uint32_t timeHigh() const
Definition: Timestamp.h:34
std::vector< std::vector< float > > hit_rms2
std::vector< std::vector< float > > trkdq_int2
std::vector< std::vector< float > > hit_peakT1
diffusioncathodet0(fhicl::ParameterSet const &pset)
Class to keep data related to recob::Hit associated with recob::Track.
std::vector< std::vector< float > > trkhitx2
Vector_t VertexDirection() const
Definition: Track.h:132
STL namespace.
unsigned int Index
EDAnalyzer(fhicl::ParameterSet const &pset)
Definition: EDAnalyzer.h:25
Particle class.
object containing MC flux information
art framework interface to geometry description
std::vector< std::vector< float > > trkhity0
Definition: Run.h:17
TH3F * ypos
Definition: doAna.cpp:30
std::vector< std::vector< float > > trkhitz1
std::vector< std::vector< float > > trkdq_amp0
bool isRealData() const
std::vector< std::vector< float > > hit_peakT0
TH3F * zpos
Definition: doAna.cpp:31
const double e
double Length(size_t p=0) const
Access to various track properties.
Definition: Track.h:167
Timestamp time() const
#define DEFINE_ART_MODULE(klass)
Definition: ModuleMacros.h:67
IDparameter< geo::WireID > WireID
Member type of validated geo::WireID parameter.
std::vector< std::vector< float > > trkhity2
def key(type, name=None)
Definition: graph.py:13
std::vector< std::vector< float > > trkdq_amp1
Point_t const & Vertex() const
Definition: Track.h:124
std::vector< std::vector< float > > trkdq_int0
std::vector< std::vector< float > > trkendcosxyz
SubRunNumber_t subRun() const
Definition: DataViewImpl.cc:78
std::vector< std::vector< float > > trkhity1
RunNumber_t run() const
Definition: DataViewImpl.cc:71
static int max(int a, int b)
std::vector< std::vector< float > > trkhitx0
Description of geometry of one entire detector.
std::vector< std::vector< float > > hit_peakT2
std::vector< std::vector< int > > hit_wire1
Definition of data types for geometry description.
std::vector< std::vector< float > > trkhitz_wire2
std::vector< std::vector< float > > trkdq_int1
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
int ID() const
Definition: Track.h:198
Declaration of signal hit object.
std::vector< std::vector< float > > trkdq_amp2
std::vector< std::vector< float > > trkhitx1
std::vector< std::vector< int > > hit_wire2
int GetNActiveFembsForAPA(art::Event const &evt, int apa) const
Get number of active fembs in an APA.
Vector_t EndDirection() const
Definition: Track.h:133
std::vector< std::vector< int > > hit_tpc1
void analyze(const art::Event &evt)
std::vector< std::vector< float > > trkhitz0
Provides recob::Track data product.
std::vector< std::vector< float > > hit_deltaT
void WireEndPoints(geo::WireID const &wireid, double *xyzStart, double *xyzEnd) const
Fills two arrays with the coordinates of the wire end points.
EventNumber_t event() const
Definition: EventID.h:116
Point_t const & End() const
Definition: Track.h:125
Declaration of basic channel signal object.
TDCIDEs_t const & TDCIDEMap() const
Returns all the deposited energy information as stored.
Definition: SimChannel.h:328
std::size_t getView(std::string const &moduleLabel, std::string const &productInstanceName, std::string const &processName, std::vector< ELEMENT const * > &result) const
Definition: DataViewImpl.h:500
TCEvent evt
Definition: DataStructs.cxx:7
std::vector< std::vector< float > > hit_rms1
auto const & get(AssnsNode< L, R, D > const &r)
Definition: AssnsNode.h:115
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
Definition: Ptr.h:297
std::vector< std::vector< float > > goodnessoffit2
int bool
Definition: qglobal.h:345
std::vector< std::vector< float > > hit_rms_true
std::vector< std::vector< float > > trkstartcosxyz
EventID id() const
Definition: Event.cc:34
Track from a non-cascading particle.A recob::Track consists of a recob::TrackTrajectory, plus additional members relevant for a "fitted" track:
Definition: Track.h:49
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
QTextStream & endl(QTextStream &s)
Event finding and building.