Public Member Functions | Private Attributes | List of all members
dune::michelremoving Class Reference
Inheritance diagram for dune::michelremoving:
art::EDAnalyzer art::detail::Analyzer art::detail::LegacyModule art::Observer art::ModuleBase

Public Member Functions

 michelremoving (fhicl::ParameterSet const &pset)
 
virtual ~michelremoving ()
 
void beginJob ()
 
void endJob ()
 
void beginRun (const art::Run &run)
 
void analyze (const art::Event &evt)
 
void reset ()
 
- Public Member Functions inherited from art::EDAnalyzer
 EDAnalyzer (fhicl::ParameterSet const &pset)
 
template<typename Config >
 EDAnalyzer (Table< Config > const &config)
 
std::string workerType () const
 
- Public Member Functions inherited from art::detail::Analyzer
virtual ~Analyzer () noexcept
 
 Analyzer (fhicl::ParameterSet const &pset)
 
template<typename Config >
 Analyzer (Table< Config > const &config)
 
void doBeginJob (SharedResources const &resources)
 
void doEndJob ()
 
void doRespondToOpenInputFile (FileBlock const &fb)
 
void doRespondToCloseInputFile (FileBlock const &fb)
 
void doRespondToOpenOutputFiles (FileBlock const &fb)
 
void doRespondToCloseOutputFiles (FileBlock const &fb)
 
bool doBeginRun (RunPrincipal &rp, ModuleContext const &mc)
 
bool doEndRun (RunPrincipal &rp, ModuleContext const &mc)
 
bool doBeginSubRun (SubRunPrincipal &srp, ModuleContext const &mc)
 
bool doEndSubRun (SubRunPrincipal &srp, ModuleContext const &mc)
 
bool doEvent (EventPrincipal &ep, ModuleContext const &mc, std::atomic< std::size_t > &counts_run, std::atomic< std::size_t > &counts_passed, std::atomic< std::size_t > &counts_failed)
 
- Public Member Functions inherited from art::Observer
 ~Observer () noexcept
 
 Observer (Observer const &)=delete
 
 Observer (Observer &&)=delete
 
Observeroperator= (Observer const &)=delete
 
Observeroperator= (Observer &&)=delete
 
void registerProducts (ProductDescriptions &, ModuleDescription const &)
 
void fillDescriptions (ModuleDescription const &)
 
fhicl::ParameterSetID selectorConfig () const
 
- Public Member Functions inherited from art::ModuleBase
virtual ~ModuleBase () noexcept
 
 ModuleBase ()
 
ModuleDescription const & moduleDescription () const
 
void setModuleDescription (ModuleDescription const &)
 
std::array< std::vector< ProductInfo >, NumBranchTypes > const & getConsumables () const
 
void sortConsumables (std::string const &current_process_name)
 
template<typename T , BranchType BT>
ViewToken< T > consumesView (InputTag const &tag)
 
template<typename T , BranchType BT>
ViewToken< T > mayConsumeView (InputTag const &tag)
 

Private Attributes

TTree * fEventTree
 
Int_t run
 
Int_t subrun
 
Int_t event
 
Double_t evttime
 
Int_t year_month_date
 
Int_t hour_min_sec
 
Int_t cross_trks
 
Int_t stopping_trks
 
Int_t all_trks
 
Int_t unbroken_trks
 
Float_t trackthetaxz [kMaxTracks]
 
Float_t trackthetayz [kMaxTracks]
 
Float_t trkstartx [kMaxTracks]
 
Float_t trkstarty [kMaxTracks]
 
Float_t trkstartz [kMaxTracks]
 
Float_t trkendx [kMaxTracks]
 
Float_t trkendy [kMaxTracks]
 
Float_t trkendz [kMaxTracks]
 
Float_t trklen [kMaxTracks]
 
Int_t TrkID [kMaxTracks]
 
Float_t trkstartcosxyz [kMaxTracks][3]
 
Float_t trkendcosxyz [kMaxTracks][3]
 
Int_t ntrkhits [kMaxTracks][3]
 
Float_t trkdqdx [kMaxTracks][3][3000]
 
Float_t trkdedx [kMaxTracks][3][3000]
 
Float_t trkresrange [kMaxTracks][3][3000]
 
Float_t trkhitx [kMaxTracks][3][3000]
 
Float_t trkhity [kMaxTracks][3][3000]
 
Float_t trkhitz [kMaxTracks][3][3000]
 
Float_t trkpitch [kMaxTracks][3][3000]
 
Float_t peakT_max [kMaxTracks]
 
Float_t peakT_min [kMaxTracks]
 
Float_t dist_min [kMaxTracks]
 
Int_t adjacent_hits [kMaxTracks]
 
Int_t lastwire [kMaxTracks]
 
Int_t endtpc [kMaxTracks]
 
Float_t lastpeakt [kMaxTracks]
 
std::string fHitsModuleLabel
 
std::string fTrackModuleLabel
 
std::string fCalorimetryModuleLabel
 
bool fSaveCaloInfo
 
bool fSaveTrackInfo
 

Additional Inherited Members

- Public Types inherited from art::EDAnalyzer
using WorkerType = WorkerT< EDAnalyzer >
 
using ModuleType = EDAnalyzer
 
- Protected Member Functions inherited from art::Observer
std::string const & processName () const
 
bool wantAllEvents () const noexcept
 
bool wantEvent (ScheduleID id, Event const &e) const
 
Handle< TriggerResultsgetTriggerResults (Event const &e) const
 
 Observer (fhicl::ParameterSet const &config)
 
 Observer (std::vector< std::string > const &select_paths, std::vector< std::string > const &reject_paths, fhicl::ParameterSet const &config)
 
- Protected Member Functions inherited from art::ModuleBase
ConsumesCollectorconsumesCollector ()
 
template<typename T , BranchType = InEvent>
ProductToken< T > consumes (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > consumesView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void consumesMany ()
 
template<typename T , BranchType = InEvent>
ProductToken< T > mayConsume (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 

Detailed Description

Definition at line 84 of file michelremoving_module.cc.

Constructor & Destructor Documentation

dune::michelremoving::michelremoving ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 143 of file michelremoving_module.cc.

143  :
144  EDAnalyzer(pset),
145  fHitsModuleLabel (pset.get< std::string >("HitsModuleLabel","") ),
146  fTrackModuleLabel (pset.get< std::string >("TrackModuleLabel","") ),
147  fCalorimetryModuleLabel (pset.get< std::string >("CalorimetryModuleLabel","") ),
148  fSaveCaloInfo (pset.get< bool>("SaveCaloInfo",false)),
149  fSaveTrackInfo (pset.get< bool>("SaveTrackInfo",false))
150  {
151  if (fSaveTrackInfo == false) fSaveCaloInfo = false;
152  }
std::string string
Definition: nybbler.cc:12
EDAnalyzer(fhicl::ParameterSet const &pset)
Definition: EDAnalyzer.h:25
dune::michelremoving::~michelremoving ( )
virtual

Definition at line 155 of file michelremoving_module.cc.

155  {
156  }

Member Function Documentation

void dune::michelremoving::analyze ( const art::Event evt)

Definition at line 219 of file michelremoving_module.cc.

219  {
220  reset();
221  std::vector<art::Ptr<recob::Track> > tracklist;
222  auto trackListHandle = evt.getHandle< std::vector<recob::Track> >("pandoraTrack");
223  if (trackListHandle){
224  art::fill_ptr_vector(tracklist, trackListHandle);
225  }
226  else return;
227 
228  std::vector<art::Ptr<recob::PFParticle> > pfplist;
229  auto PFPListHandle = evt.getHandle< std::vector<recob::PFParticle> >("pandora");
230  if (PFPListHandle) art::fill_ptr_vector(pfplist, PFPListHandle);
231 
232  /******new lines*************************/
233  std::vector<art::Ptr<recob::Hit>> hitlist;
234  auto hitListHandle = evt.getHandle< std::vector<recob::Hit> >(fHitsModuleLabel) ; // to get information about the hits
235  if (hitListHandle) art::fill_ptr_vector(hitlist, hitListHandle);
236 
237  art::FindManyP<recob::Hit, recob::TrackHitMeta> fmthm(trackListHandle, evt, fTrackModuleLabel); // to associate tracks and hits
238 
239  art::FindManyP<recob::Hit> fmtht(trackListHandle, evt, fTrackModuleLabel); // to associate tracks and hits
240  // art::FindManyP<recob::Track, recob::TrackHitMeta> thass(hitListHandle, evt, fTrackModuleLabel); //to associate hit
241  art::FindManyP<recob::Track> thass(hitListHandle, evt, fTrackModuleLabel); //to associate hit just trying
242 
243  art::FindManyP<anab::Calorimetry> fmcal(trackListHandle, evt, fCalorimetryModuleLabel);
244  if (!fmcal.isValid()){
245  std::cout<<"art::Assns<recob::Track,anab::Calorimetry,void> with module label: "<<fCalorimetryModuleLabel<<" not found."<<std::endl;
246  return;
247  }
248 
249  art::FindManyP<anab::T0> trk_t0_assn_v(PFPListHandle, evt ,"pandora");
250 
251 
252  art::FindManyP<recob::PFParticle> pfp_trk_assn(trackListHandle,evt,"pandoraTrack");
253  art::FindManyP<anab::T0> fmT0(trackListHandle, evt ,"pmtrack");
254 
255 
256  run = evt.run();
257  subrun = evt.subRun();
258  event = evt.id().event();
259  art::Timestamp ts = evt.time();
260  TTimeStamp tts(ts.timeHigh(), ts.timeLow());
261  evttime=tts.AsDouble();
262 
263  UInt_t year=0;
264  UInt_t month=0;
265  UInt_t day=0;
266 
267  year_month_date=tts.GetDate(kTRUE,0,&year,&month,&day);
268 
269  UInt_t hour=0;
270  UInt_t min=0;
271  UInt_t sec=0;
272 
273  hour_min_sec=tts.GetTime(kTRUE,0,&hour,&min,&sec);
274 
275  cross_trks=0;
276  stopping_trks=0;
277  all_trks=0;
278  unbroken_trks=0;
279  // size_t NHits=hitlist.size();
280  size_t NTracks = tracklist.size();
281  for(size_t i=0; i<NTracks;++i){
282  art::Ptr<recob::Track> ptrack(trackListHandle, i);
283  if(fTrackModuleLabel=="pandoraTrack"){
284  std::vector<art::Ptr<recob::PFParticle>> pfps=pfp_trk_assn.at(i);
285  if(!pfps.size()) continue;
286  std::vector<art::Ptr<anab::T0>> t0s=trk_t0_assn_v.at(pfps[0].key());
287  if(!t0s.size()) continue;
288  //auto t0 = t0s.at(0);
289  // double t_zero=t0->Time();
290  }
291 
292 
293 
294 
295  if(fTrackModuleLabel=="pmtrack"){
296  std::vector<art::Ptr<anab::T0>> T0s=fmT0.at(i);
297  if(T0s.size()==0)
298  continue;
299  }
300  all_trks++;
301  std::vector<art::Ptr<anab::Calorimetry>> calos=fmcal.at(i);
302  const recob::Track& track = *ptrack;
303  //TVector3 pos, dir_start, dir_end, end;
304  auto pos = track.Vertex();
305  auto dir_start = track.VertexDirection();
306  auto dir_end = track.EndDirection();
307  auto end = track.End();
308  double theta_xz = std::atan2(dir_start.X(), dir_start.Z());
309  double theta_yz = std::atan2(dir_start.Y(), dir_start.Z());
310  float startx=pos.X();
311  float starty=pos.Y();
312  float startz=pos.Z();
313  float endx=end.X();
314  float endy=end.Y();
315  float endz=end.Z();
316 
317  float startcosx=dir_start.X();
318  float startcosy=dir_start.Y();
319  float startcosz=dir_start.Z();
320  float endcosx=dir_end.X();
321  float endcosy=dir_end.Y();
322  float endcosz=dir_end.Z();
323  float tracklength=track.Length();
324  size_t count = 0;
325  /********************************************************************************************************/
326 
327  /*********************storing hits for each tracks*******************************/
328 
329  std::vector<art::Ptr<recob::Hit>> allHits=fmtht.at(i); //storing hits for ith track
330  std::vector<float> hitpeakT;
331  for(size_t h1=0;h1<allHits.size();h1++){
332  hitpeakT.push_back(allHits[h1]->PeakTime());
333  // if(allHits[h1]->WireID().Plane==2 && allHits[h1]->PeakTime()>420 && allHits[h1]->PeakTime()<530 && allHits[h1]->WireID().TPC==9 && allHits[h1]->WireID().Wire>60 && allHits[h1]->WireID().Wire<80) cout<<"wire id and peak time from allHits this is from track hit association "<<allHits[h1]->WireID().Wire<<" "<<allHits[h1]->PeakTime()<<endl;
334  }
335  float max=-999999;
336  float min=-999999;
337  min=*min_element(hitpeakT.begin(),hitpeakT.end());
338  max=*max_element(hitpeakT.begin(),hitpeakT.end());
339  hitpeakT.clear();
340 
341  float dist0=99999;
342  float dist=99999;
343  float peaktime=-1;
344  int wireno=99999;
345  int counter1=99999;
346  int tpcno=-1;
347 
348  if(((std::abs(pos.X())>330 || pos.Y()<50 || pos.Y()>550 || pos.Z()<50 || pos.Z()>645) && !(std::abs(end.X())>330 || end.Y()<50 || end.Y()>550 || end.Z()<50 || end.Z()>645))||(!(std::abs(pos.X())>330 || pos.Y()<50 || pos.Y()>550 || pos.Z()<50 || pos.Z()>645) && (std::abs(end.X())>330 || end.Y()<50 || end.Y()>550 || end.Z()<50 || end.Z()>645))){
349  stopping_trks++; //these are total stopping tracks, could be broken as well
350 
351  /**********************************broken tracks removal**************************************************************************************/
352  for(size_t k=0;k<NTracks;++k){
353  art::Ptr<recob::Track> ptrack_k(trackListHandle, k);
354  const recob::Track& track_k = *ptrack_k;
355  // TVector3 pos_k, dir_pos_k, dir_end_k, end_k;
356  auto pos_k = track_k.Vertex();
357  auto dir_pos_k= track_k.VertexDirection();
358  auto dir_end_k = track_k.EndDirection();
359  auto end_k = track_k.End();
360  if(k==i) continue;
361  if((std::abs(((end_k.Y()-pos_k.Y())/(end_k.Z()-pos_k.Z()))*(endz-pos_k.Z())+pos_k.Y()-endy)<30||std::abs(((end_k.Y()-pos_k.Y())/(end_k.Z()-pos_k.Z()))*(startz-pos_k.Z())+pos_k.Y()-starty)<30)&&(std::abs(endcosx*dir_pos_k.X()+endcosy*dir_pos_k.Y()+endcosz*dir_pos_k.Z())>0.97||std::abs(startcosx*dir_pos_k.X()+startcosy*dir_pos_k.Y()+startcosz*dir_pos_k.Z())>0.97||std::abs(endcosx*dir_end_k.X()+endcosy*dir_end_k.Y()+endcosz*dir_end_k.Z())>0.97||std::abs(startcosx*dir_end_k.X()+startcosy*dir_end_k.Y()+startcosz*dir_end_k.Z())>0.97)) break;
362  if((std::abs(((end_k.Y()-pos_k.Y())/(end_k.Z()-pos_k.Z()))*(endz-pos_k.Z())+pos_k.Y()-endy)<50||std::abs(((end_k.Y()-pos_k.Y())/(end_k.Z()-pos_k.Z()))*(startz-pos_k.Z())+pos_k.Y()-starty)<50)&&(std::abs(endcosx*dir_pos_k.X()+endcosy*dir_pos_k.Y()+endcosz*dir_pos_k.Z())>0.998||std::abs(startcosx*dir_pos_k.X()+startcosy*dir_pos_k.Y()+startcosz*dir_pos_k.Z())>0.998||std::abs(endcosx*dir_end_k.X()+endcosy*dir_end_k.Y()+endcosz*dir_end_k.Z())>0.998||std::abs(startcosx*dir_end_k.X()+startcosy*dir_end_k.Y()+startcosz*dir_end_k.Z())>0.998)) break;
363  count++;
364  }
365 
366  if(!(count==NTracks-1)|| tracklength<100) continue;
367  unbroken_trks++;
368  //*******************************new stuff*****************************//
369 
370  std::vector<int> wirenos;
371  std::vector<float> peakts;
372 
373 
374 
375  int planenum1=999;
376  float xpos=-9999;
377  float ypos=-9999;
378  float zpos=-9999;
379  if(fmthm.isValid()){
380  auto vhit=fmthm.at(i);
381  auto vmeta=fmthm.data(i);
382  for (size_t ii = 0; ii<vhit.size(); ++ii){ //loop over all meta data hit
383  bool fBadhit = false;
384  if (vmeta[ii]->Index() == static_cast<unsigned int>(std::numeric_limits<int>::max())){
385  fBadhit = true;
386 
387  continue;
388  }
389  if (vmeta[ii]->Index()>=tracklist[i]->NumberTrajectoryPoints()){
390  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!!";
391  }
392  if (!tracklist[i]->HasValidPoint(vmeta[ii]->Index())){
393  fBadhit = true;
394  continue;
395  }
396  // TVector3 loc = tracklist[i]->LocationAtPoint(vmeta[ii]->Index());
397  auto loc = tracklist[i]->LocationAtPoint(vmeta[ii]->Index());
398 
399  xpos=loc.X();
400  ypos=loc.Y();
401  zpos=loc.Z();
402  if (fBadhit) continue; //HY::If BAD hit, skip this hit and go next
403  if (zpos<-100) continue; //hit not on track
404  planenum1=vhit[ii]->WireID().Plane;
405  if(planenum1==2){
406  if(starty<endy) dist=sqrt(pow(xpos-startx,2)+pow(ypos-starty,2)+pow(zpos-startz,2));
407  if(starty>endy) dist=sqrt(pow(xpos-endx,2)+pow(ypos-endy,2)+pow(zpos-endz,2));
408  //if(vhit[ii]->WireID().Plane==2 && vhit[ii]->PeakTime()>420 && vhit[ii]->PeakTime()<530 && vhit[ii]->WireID().TPC==9 && vhit[ii]->WireID().Wire>60 && vhit[ii]->WireID().Wire<80){
409  //cout<<"wire_no and peak time from metadata"<<vhit[ii]->WireID().Wire<<" "<<vhit[ii]->PeakTime()<<endl;
410 
411  wirenos.push_back(vhit[ii]->WireID().Wire);
412  peakts.push_back(vhit[ii]->PeakTime());
413  // }
414 
415  if(dist<dist0){
416  dist0=dist;
417  wireno=vhit[ii]->WireID().Wire;
418  peaktime=vhit[ii]->PeakTime();
419  tpcno=vhit[ii]->WireID().TPC;
420  }
421  }
422  }//loop over vhit
423  }//fmthm valid
424  /*************************************filling the values****************************/
425  counter1=0;
426  // bool test=false;
427  for(size_t hitl=0;hitl<hitlist.size();hitl++){
428  auto & tracks = thass.at(hitlist[hitl].key());
429  //auto & vmeta = thass.data(hitlist[hitl].key());
430  //if (!tracks.empty()&&tracks[0].key() == ptrack.key()&&vmeta[0]->Index()!=static_cast<unsigned int>(std::numeric_limits<int>::max())) continue;
431  //if (!tracks.empty()&&tracks[0].key() == ptrack.key()&&hitlist[hitl]->WireID().Plane==2)
432  //if(!(hitlist[hitl]->WireID().Plane==2 && tracks[0].key() != ptrack.key() && hitlist[hitl]->PeakTime()>420 && hitlist[hitl]->PeakTime()<530 && hitlist[hitl]->WireID().TPC==9 && hitlist[hitl]->WireID().Wire>60 && hitlist[hitl]->WireID().Wire<80)) continue;
433  //cout<<"wire no and peak time from hit to track association...................."<<hitlist[hitl]->WireID().Wire<<" "<<hitlist[hitl]->PeakTime()<<endl;
434  if (!tracks.empty() && tracks[0].key()!=ptrack.key() && tracklist[tracks[0].key()]->Length()>100) continue;
435  bool test=true;
436  float peakth1=hitlist[hitl]->PeakTime();
437  int wireh1=hitlist[hitl]->WireID().Wire;
438  for(size_t m=0;m<wirenos.size();m++){
439  if(wireh1==wirenos[m] && peakth1==peakts[m]){
440  test=false;
441  break;
442  }
443  }
444  if(!test) continue;
445 
446  int planeid=hitlist[hitl]->WireID().Plane;
447  int tpcid=hitlist[hitl]->WireID().TPC;
448  if(abs(wireh1-wireno)<6 && abs(peakth1-peaktime)<50 && planeid==2 && tpcid==tpcno){
449  counter1++;
450  }
451  }
452  // for(size_t t=0;t<peakts.size();t++) cout<<"wire numbers and peak times in the vector "<<wirenos[t]<<" "<<peakts[t]<<endl;
453 
454  wirenos.clear();
455  peakts.clear();
456 
457 
458  cout<<"no of hits closeby "<<counter1<<" "<<"event "<<event<<" TrkackID "<<track.ID()<<" startx, y, z "<<startx<<" "<<starty<<" "<<startz<<" wireno, peakt tpcno "<<wireno<<" "<<peaktime<<" "<<tpcno<<" dist "<<dist0<<"min T, max_T"<<min<<" "<<max<<endl;
459  }
460 
461 
462  cross_trks++; // these are good tracks unbroken
463  dist_min[cross_trks-1]=dist0;
464  adjacent_hits[cross_trks-1]=counter1;
465  lastwire[cross_trks-1]=wireno;
466  lastpeakt[cross_trks-1]=peaktime;
467  endtpc[cross_trks-1]=tpcno;
468 
469 
470 
471  trackthetaxz[cross_trks-1]=theta_xz;
472  trackthetayz[cross_trks-1]=theta_yz;
473  trkstartx[cross_trks-1]=pos.X();
474  trkstarty[cross_trks-1]=pos.Y();
475  trkstartz[cross_trks-1]=pos.Z();
476  trkendx[cross_trks-1]=end.X();
477  trkendy[cross_trks-1]=end.Y();
478  trkendz[cross_trks-1]=end.Z();
479  trklen[cross_trks-1]=track.Length();
480  TrkID[cross_trks-1]=track.ID();
483  trkstartcosxyz[cross_trks-1][0]=dir_start.X();
484  trkstartcosxyz[cross_trks-1][1]=dir_start.Y();
485  trkstartcosxyz[cross_trks-1][2]=dir_start.Z();
486  trkendcosxyz[cross_trks-1][0]=dir_end.X();
487  trkendcosxyz[cross_trks-1][1]=dir_end.Y();
488  trkendcosxyz[cross_trks-1][2]=dir_end.Z();
489  for(size_t ical = 0; ical<calos.size(); ++ical){
490  if(!calos[ical]) continue;
491  if(!calos[ical]->PlaneID().isValid) continue;
492  int planenum = calos[ical]->PlaneID().Plane;
493  if(planenum<0||planenum>2) continue;
494  const size_t NHits = calos[ical] -> dEdx().size();
495  ntrkhits[cross_trks-1][planenum]=int(NHits);
496  for(size_t iHit = 0; iHit < NHits; ++iHit){
497  const auto& TrkPos = (calos[ical] -> XYZ())[iHit];
498  trkdqdx[cross_trks-1][planenum][iHit]=(calos[ical] -> dQdx())[iHit];
499  trkdedx[cross_trks-1][planenum][iHit]=(calos[ical] -> dEdx())[iHit];
500  trkresrange[cross_trks-1][planenum][iHit]=(calos[ical]->ResidualRange())[iHit];
501  trkhitx[cross_trks-1][planenum][iHit]=TrkPos.X();
502  trkhity[cross_trks-1][planenum][iHit]=TrkPos.Y();
503  trkhitz[cross_trks-1][planenum][iHit]=TrkPos.Z();
504  trkpitch[cross_trks-1][planenum][iHit]=(calos[ical]->TrkPitchVec())[iHit];
505  } // loop over iHit..
506  } // loop over ical 2nd time...
507 
508 
509  } // loop over trks...
510 
511  fEventTree->Fill();
512  } // end of analyze function
end
while True: pbar.update(maxval-len(onlies[E][S])) #print iS, "/", len(onlies[E][S]) found = False for...
Float_t lastpeakt[kMaxTracks]
constexpr std::uint32_t timeLow() const
Definition: Timestamp.h:29
Float_t trkhity[kMaxTracks][3][3000]
Float_t trkstartx[kMaxTracks]
TH3F * xpos
Definition: doAna.cpp:29
Handle< PROD > getHandle(SelectorBase const &) const
Definition: DataViewImpl.h:382
Float_t trkhitx[kMaxTracks][3][3000]
constexpr std::uint32_t timeHigh() const
Definition: Timestamp.h:34
constexpr T pow(T x)
Definition: pow.h:72
Float_t trkstartcosxyz[kMaxTracks][3]
Float_t trkendcosxyz[kMaxTracks][3]
Vector_t VertexDirection() const
Definition: Track.h:132
Float_t trkendx[kMaxTracks]
unsigned int Index
Float_t trkdqdx[kMaxTracks][3][3000]
TH3F * ypos
Definition: doAna.cpp:30
Float_t trkstarty[kMaxTracks]
Float_t trackthetayz[kMaxTracks]
T abs(T value)
Float_t trackthetaxz[kMaxTracks]
Float_t trkresrange[kMaxTracks][3][3000]
double dEdx(float dqdx, float Efield)
Definition: doAna.cpp:21
TH3F * zpos
Definition: doAna.cpp:31
double Length(size_t p=0) const
Access to various track properties.
Definition: Track.h:167
Timestamp time() const
IDparameter< geo::WireID > WireID
Member type of validated geo::WireID parameter.
def key(type, name=None)
Definition: graph.py:13
Float_t peakT_max[kMaxTracks]
Int_t ntrkhits[kMaxTracks][3]
Point_t const & Vertex() const
Definition: Track.h:124
Float_t dist_min[kMaxTracks]
SubRunNumber_t subRun() const
Definition: DataViewImpl.cc:78
Float_t peakT_min[kMaxTracks]
RunNumber_t run() const
Definition: DataViewImpl.cc:71
static int max(int a, int b)
Float_t trkendy[kMaxTracks]
Float_t trkhitz[kMaxTracks][3][3000]
Definition: tracks.py:1
int ID() const
Definition: Track.h:198
Float_t trkdedx[kMaxTracks][3][3000]
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:55
constexpr double dist(const TReal *x, const TReal *y, const unsigned int dimension)
Vector_t EndDirection() const
Definition: Track.h:133
Int_t adjacent_hits[kMaxTracks]
Float_t trkstartz[kMaxTracks]
EventNumber_t event() const
Definition: EventID.h:116
Point_t const & End() const
Definition: Track.h:125
detail::Node< FrameID, bool > PlaneID
Definition: CRTID.h:125
Float_t trkpitch[kMaxTracks][3][3000]
Float_t trkendz[kMaxTracks]
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
Definition: Ptr.h:297
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
Float_t trklen[kMaxTracks]
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
QTextStream & endl(QTextStream &s)
void dune::michelremoving::beginJob ( )
virtual

Reimplemented from art::EDAnalyzer.

Definition at line 160 of file michelremoving_module.cc.

160  {
161  std::cout<<"job begin..."<<std::endl;
163  fEventTree = tfs->make<TTree>("Event", "Event Tree from Reco");
164  fEventTree->Branch("event", &event,"event/I");
165  fEventTree->Branch("evttime",&evttime,"evttime/D");
166  fEventTree->Branch("run", &run,"run/I");
167  fEventTree->Branch("subrun", &subrun,"surbrun/I");
168  fEventTree->Branch("year_month_date", &year_month_date,"year_month_date/I");
169  fEventTree->Branch("hour_min_sec", &hour_min_sec,"hour_min_sec/I");
170  fEventTree->Branch("cross_trks",&cross_trks,"cross_trks/I");
171  fEventTree->Branch("stopping_trks",&stopping_trks,"stopping_trks/I");
172  fEventTree->Branch("all_trks",&all_trks,"all_trks/I");
173  fEventTree->Branch("unbroken_trks",&unbroken_trks,"unbroken_trks/I");
174  fEventTree->Branch("trackthetaxz",trackthetaxz,"trackthetaxz[cross_trks]/F");
175  fEventTree->Branch("trackthetayz",trackthetayz,"trackthetayz[cross_trks]/F");
176  fEventTree->Branch("trkstartx",trkstartx,"trkstartx[cross_trks]/F");
177  fEventTree->Branch("trkstarty",trkstarty,"trkstarty[cross_trks]/F");
178  fEventTree->Branch("trkstartz",trkstartz,"trkstartz[cross_trks]/F");
179  fEventTree->Branch("trkendx",trkendx,"trkendx[cross_trks]/F");
180  fEventTree->Branch("trkendy",trkendy,"trkendy[cross_trks]/F");
181  fEventTree->Branch("trkendz",trkendz,"trkendz[cross_trks]/F");
182  fEventTree->Branch("trklen",trklen,"trklen[cross_trks]/F");
183  fEventTree->Branch("peakT_max",peakT_max,"peakT_max[cross_trks]/F");
184  fEventTree->Branch("peakT_min",peakT_min,"peakT_min[cross_trks]/F");
185  fEventTree->Branch("TrkID",TrkID,"TrkID[cross_trks]/I");
186  fEventTree->Branch("trkstartcosxyz",trkstartcosxyz,"trkstartcosxyz[cross_trks][3]/F");
187  fEventTree->Branch("trkendcosxyz",trkendcosxyz,"trkendcosxyz[cross_trks][3]/F");
188  fEventTree->Branch("ntrkhits",ntrkhits,"ntrkhits[cross_trks][3]/I");
189  fEventTree->Branch("trkdqdx",trkdqdx,"trkdqdx[cross_trks][3][3000]/F");
190  fEventTree->Branch("trkdedx",trkdedx,"trkdedx[cross_trks][3][3000]/F");
191  fEventTree->Branch("trkresrange",trkresrange,"trkresrange[cross_trks][3][3000]/F");
192  fEventTree->Branch("trkhitx",trkhitx,"trkhitx[cross_trks][3][3000]/F");
193  fEventTree->Branch("trkhity",trkhity,"trkhity[cross_trks][3][3000]/F");
194  fEventTree->Branch("trkhitz",trkhitz,"trkhitz[cross_trks][3][3000]/F");
195  fEventTree->Branch("trkpitch",trkpitch,"trkpitch[cross_trks][3][3000]/F");
196  fEventTree->Branch("dist_min",dist_min,"dist_min[cross_trks]/F");
197  fEventTree->Branch("adjacent_hits",adjacent_hits,"adjacent_hits[cross_trks]/I");
198  fEventTree->Branch("lastwire",lastwire,"lastwire[cross_trks]/I");
199  fEventTree->Branch("lastpeakt",lastpeakt,"lastpeakt[cross_trks]/F");
200  fEventTree->Branch("endtpc",endtpc,"endtpc[cross_trks]/I");
201 
202  }
Float_t lastpeakt[kMaxTracks]
Float_t trkhity[kMaxTracks][3][3000]
Float_t trkstartx[kMaxTracks]
Float_t trkhitx[kMaxTracks][3][3000]
Float_t trkstartcosxyz[kMaxTracks][3]
Float_t trkendcosxyz[kMaxTracks][3]
Float_t trkendx[kMaxTracks]
Float_t trkdqdx[kMaxTracks][3][3000]
Float_t trkstarty[kMaxTracks]
Float_t trackthetayz[kMaxTracks]
Float_t trackthetaxz[kMaxTracks]
Float_t trkresrange[kMaxTracks][3][3000]
Float_t peakT_max[kMaxTracks]
Int_t ntrkhits[kMaxTracks][3]
Float_t dist_min[kMaxTracks]
Float_t peakT_min[kMaxTracks]
Float_t trkendy[kMaxTracks]
Float_t trkhitz[kMaxTracks][3][3000]
Float_t trkdedx[kMaxTracks][3][3000]
Int_t adjacent_hits[kMaxTracks]
Float_t trkstartz[kMaxTracks]
Float_t trkpitch[kMaxTracks][3][3000]
Float_t trkendz[kMaxTracks]
Float_t trklen[kMaxTracks]
QTextStream & endl(QTextStream &s)
Event finding and building.
void dune::michelremoving::beginRun ( const art::Run run)

Definition at line 210 of file michelremoving_module.cc.

210  {
211  mf::LogInfo("michelremoving")<<"begin run..."<<std::endl;
212  }
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
QTextStream & endl(QTextStream &s)
void dune::michelremoving::endJob ( )
virtual

Reimplemented from art::EDAnalyzer.

Definition at line 205 of file michelremoving_module.cc.

205  {
206 
207  }
void dune::michelremoving::reset ( )

Definition at line 515 of file michelremoving_module.cc.

515  {
516  run = -99999;
517  subrun = -99999;
518  event = -99999;
519  evttime = -99999;
520  cross_trks = -99999;
521  //all_trks = -99999;
522  //unbroken_trks=-99999;
523  year_month_date=-99999;
524  hour_min_sec=-99999;
525  for(int i=0; i<kMaxTracks; i++){
526  trackthetaxz[i]=-99999;
527  trackthetayz[i]=-99999;
528  trkstartx[i]=-99999;
529  trkstarty[i]=-99999;
530  trkstartz[i]=-99999;
531  trkendx[i]=-99999;
532  trkendy[i]=-99999;
533  trkendz[i]=-99999;
534  trklen[i]=-99999;
535  TrkID[i]=-99999;
536 
537  dist_min[i]=-1;
538  adjacent_hits[i]=-1;
539  lastwire[i]=-1;
540  lastpeakt[i]=-1;
541  endtpc[i]=-1;
542  peakT_max[i]=-99999;
543  peakT_min[i]=-99999;
544  trkstartcosxyz[i][0]=-99999;
545  trkstartcosxyz[i][1]=-99999;
546  trkstartcosxyz[i][2]=-99999;
547  trkendcosxyz[i][0]=-99999;
548  trkendcosxyz[i][1]=-99999;
549  trkendcosxyz[i][2]=-99999;
550  ntrkhits[i][0] = -99999;
551  ntrkhits[i][1] = -99999;
552  ntrkhits[i][2] = -99999;
553  for(int j=0; j<3; j++){
554  for(int k=0; k<3000; k++){
555  trkdqdx[i][j][k]=-99999;
556  trkdedx[i][j][k]=-99999;
557  trkresrange[i][j][k]=-99999;
558  trkhitx[i][j][k]=-99999;
559  trkhity[i][j][k]=-99999;
560  trkhitz[i][j][k]=-99999;
561  trkpitch[i][j][k]=-99999;
562  }
563  }
564  }
565  }
Float_t lastpeakt[kMaxTracks]
Float_t trkhity[kMaxTracks][3][3000]
Float_t trkstartx[kMaxTracks]
Float_t trkhitx[kMaxTracks][3][3000]
Float_t trkstartcosxyz[kMaxTracks][3]
Float_t trkendcosxyz[kMaxTracks][3]
Float_t trkendx[kMaxTracks]
Float_t trkdqdx[kMaxTracks][3][3000]
Float_t trkstarty[kMaxTracks]
const int kMaxTracks
Float_t trackthetayz[kMaxTracks]
Float_t trackthetaxz[kMaxTracks]
Float_t trkresrange[kMaxTracks][3][3000]
Float_t peakT_max[kMaxTracks]
Int_t ntrkhits[kMaxTracks][3]
Float_t dist_min[kMaxTracks]
Float_t peakT_min[kMaxTracks]
Float_t trkendy[kMaxTracks]
Float_t trkhitz[kMaxTracks][3][3000]
Float_t trkdedx[kMaxTracks][3][3000]
Int_t adjacent_hits[kMaxTracks]
Float_t trkstartz[kMaxTracks]
Float_t trkpitch[kMaxTracks][3][3000]
Float_t trkendz[kMaxTracks]
Float_t trklen[kMaxTracks]

Member Data Documentation

Int_t dune::michelremoving::adjacent_hits[kMaxTracks]
private

Definition at line 131 of file michelremoving_module.cc.

Int_t dune::michelremoving::all_trks
private

Definition at line 106 of file michelremoving_module.cc.

Int_t dune::michelremoving::cross_trks
private

Definition at line 104 of file michelremoving_module.cc.

Float_t dune::michelremoving::dist_min[kMaxTracks]
private

Definition at line 130 of file michelremoving_module.cc.

Int_t dune::michelremoving::endtpc[kMaxTracks]
private

Definition at line 133 of file michelremoving_module.cc.

Int_t dune::michelremoving::event
private

Definition at line 100 of file michelremoving_module.cc.

Double_t dune::michelremoving::evttime
private

Definition at line 101 of file michelremoving_module.cc.

std::string dune::michelremoving::fCalorimetryModuleLabel
private

Definition at line 137 of file michelremoving_module.cc.

TTree* dune::michelremoving::fEventTree
private

Definition at line 97 of file michelremoving_module.cc.

std::string dune::michelremoving::fHitsModuleLabel
private

Definition at line 135 of file michelremoving_module.cc.

bool dune::michelremoving::fSaveCaloInfo
private

Definition at line 138 of file michelremoving_module.cc.

bool dune::michelremoving::fSaveTrackInfo
private

Definition at line 139 of file michelremoving_module.cc.

std::string dune::michelremoving::fTrackModuleLabel
private

Definition at line 136 of file michelremoving_module.cc.

Int_t dune::michelremoving::hour_min_sec
private

Definition at line 103 of file michelremoving_module.cc.

Float_t dune::michelremoving::lastpeakt[kMaxTracks]
private

Definition at line 134 of file michelremoving_module.cc.

Int_t dune::michelremoving::lastwire[kMaxTracks]
private

Definition at line 132 of file michelremoving_module.cc.

Int_t dune::michelremoving::ntrkhits[kMaxTracks][3]
private

Definition at line 120 of file michelremoving_module.cc.

Float_t dune::michelremoving::peakT_max[kMaxTracks]
private

Definition at line 128 of file michelremoving_module.cc.

Float_t dune::michelremoving::peakT_min[kMaxTracks]
private

Definition at line 129 of file michelremoving_module.cc.

Int_t dune::michelremoving::run
private

Definition at line 98 of file michelremoving_module.cc.

Int_t dune::michelremoving::stopping_trks
private

Definition at line 105 of file michelremoving_module.cc.

Int_t dune::michelremoving::subrun
private

Definition at line 99 of file michelremoving_module.cc.

Float_t dune::michelremoving::trackthetaxz[kMaxTracks]
private

Definition at line 108 of file michelremoving_module.cc.

Float_t dune::michelremoving::trackthetayz[kMaxTracks]
private

Definition at line 109 of file michelremoving_module.cc.

Float_t dune::michelremoving::trkdedx[kMaxTracks][3][3000]
private

Definition at line 122 of file michelremoving_module.cc.

Float_t dune::michelremoving::trkdqdx[kMaxTracks][3][3000]
private

Definition at line 121 of file michelremoving_module.cc.

Float_t dune::michelremoving::trkendcosxyz[kMaxTracks][3]
private

Definition at line 119 of file michelremoving_module.cc.

Float_t dune::michelremoving::trkendx[kMaxTracks]
private

Definition at line 113 of file michelremoving_module.cc.

Float_t dune::michelremoving::trkendy[kMaxTracks]
private

Definition at line 114 of file michelremoving_module.cc.

Float_t dune::michelremoving::trkendz[kMaxTracks]
private

Definition at line 115 of file michelremoving_module.cc.

Float_t dune::michelremoving::trkhitx[kMaxTracks][3][3000]
private

Definition at line 124 of file michelremoving_module.cc.

Float_t dune::michelremoving::trkhity[kMaxTracks][3][3000]
private

Definition at line 125 of file michelremoving_module.cc.

Float_t dune::michelremoving::trkhitz[kMaxTracks][3][3000]
private

Definition at line 126 of file michelremoving_module.cc.

Int_t dune::michelremoving::TrkID[kMaxTracks]
private

Definition at line 117 of file michelremoving_module.cc.

Float_t dune::michelremoving::trklen[kMaxTracks]
private

Definition at line 116 of file michelremoving_module.cc.

Float_t dune::michelremoving::trkpitch[kMaxTracks][3][3000]
private

Definition at line 127 of file michelremoving_module.cc.

Float_t dune::michelremoving::trkresrange[kMaxTracks][3][3000]
private

Definition at line 123 of file michelremoving_module.cc.

Float_t dune::michelremoving::trkstartcosxyz[kMaxTracks][3]
private

Definition at line 118 of file michelremoving_module.cc.

Float_t dune::michelremoving::trkstartx[kMaxTracks]
private

Definition at line 110 of file michelremoving_module.cc.

Float_t dune::michelremoving::trkstarty[kMaxTracks]
private

Definition at line 111 of file michelremoving_module.cc.

Float_t dune::michelremoving::trkstartz[kMaxTracks]
private

Definition at line 112 of file michelremoving_module.cc.

Int_t dune::michelremoving::unbroken_trks
private

Definition at line 107 of file michelremoving_module.cc.

Int_t dune::michelremoving::year_month_date
private

Definition at line 102 of file michelremoving_module.cc.


The documentation for this class was generated from the following file: