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

Public Member Functions

 dEdxcalibration (fhicl::ParameterSet const &pset)
 
virtual ~dEdxcalibration ()
 
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 Total_energy [kMaxTracks]
 
Double_t EndE [kMaxTracks]
 
Int_t pdg [kMaxTracks]
 
Double_t evttime
 
Int_t year_month_date
 
Int_t hour_min_sec
 
Int_t cross_trks
 
Int_t true_stopping_muons
 
Int_t mc_stopping50
 
Int_t mc_stopping20
 
Int_t stopping_trks
 
Int_t all_trks
 
Float_t xprojectedlen [kMaxTracks]
 
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]
 
Int_t TrackId_geant [kMaxTracks]
 
Int_t origin [kMaxTracks]
 
Float_t EndPointx [kMaxTracks]
 
Float_t EndPointy [kMaxTracks]
 
Float_t EndPointz [kMaxTracks]
 
Float_t EndPointx_corrected [kMaxTracks]
 
Float_t EndPointy_corrected [kMaxTracks]
 
Float_t EndPointz_corrected [kMaxTracks]
 
Float_t StartPointx [kMaxTracks]
 
Float_t StartPointy [kMaxTracks]
 
Float_t StartPointz [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]
 
Int_t daughter_electrons [kMaxTracks]
 
Int_t daughter_positrons [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 81 of file dEdxcalibration_module.cc.

Constructor & Destructor Documentation

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

Definition at line 154 of file dEdxcalibration_module.cc.

154  :
155  EDAnalyzer(pset),
156  fHitsModuleLabel (pset.get< std::string >("HitsModuleLabel","") ),
157  fTrackModuleLabel (pset.get< std::string >("TrackModuleLabel","") ),
158  fCalorimetryModuleLabel (pset.get< std::string >("CalorimetryModuleLabel","") ),
159  fSaveCaloInfo (pset.get< bool>("SaveCaloInfo",false)),
160  fSaveTrackInfo (pset.get< bool>("SaveTrackInfo",false))
161  {
162  if (fSaveTrackInfo == false) fSaveCaloInfo = false;
163  }
std::string string
Definition: nybbler.cc:12
EDAnalyzer(fhicl::ParameterSet const &pset)
Definition: EDAnalyzer.h:25
dune::dEdxcalibration::~dEdxcalibration ( )
virtual

Definition at line 166 of file dEdxcalibration_module.cc.

166  {
167  }

Member Function Documentation

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

Definition at line 243 of file dEdxcalibration_module.cc.

243  {
244  reset();
247 
248  std::vector<art::Ptr<recob::Track> > tracklist;
249  auto trackListHandle = evt.getHandle< std::vector<recob::Track> >(fTrackModuleLabel);
250  if (trackListHandle) art::fill_ptr_vector(tracklist, trackListHandle);
251 
252  std::vector<art::Ptr<recob::PFParticle> > pfplist;
253  auto PFPListHandle = evt.getHandle< std::vector<recob::PFParticle> >("pandora");
254  if (PFPListHandle) art::fill_ptr_vector(pfplist, PFPListHandle);
255 
256  /******new lines*************************/
257  std::vector<art::Ptr<recob::Hit>> hitlist;
258  auto hitListHandle = evt.getHandle< std::vector<recob::Hit> >(fHitsModuleLabel); // to get information about the hits
259  if (hitListHandle)
260  art::fill_ptr_vector(hitlist, hitListHandle);
261 
262  art::FindManyP<recob::Hit> fmtht(trackListHandle, evt, fTrackModuleLabel); // to associate tracks and hits
263 
264 
265  art::FindManyP<anab::Calorimetry> fmcal(trackListHandle, evt, fCalorimetryModuleLabel);
266  art::FindManyP<anab::T0> trk_t0_assn_v(PFPListHandle, evt ,"pandora");
267  art::FindManyP<recob::PFParticle> pfp_trk_assn(trackListHandle,evt,"pandoraTrack");
268  art::FindManyP<anab::T0> fmT0(trackListHandle, evt ,"pmtrack");
269 
270 
271  run = evt.run();
272  subrun = evt.subRun();
273  event = evt.id().event();
274  art::Timestamp ts = evt.time();
275  TTimeStamp tts(ts.timeHigh(), ts.timeLow());
276  evttime=tts.AsDouble();
277 
278  UInt_t year=0;
279  UInt_t month=0;
280  UInt_t day=0;
281 
282  year_month_date=tts.GetDate(kTRUE,0,&year,&month,&day);
283 
284  UInt_t hour=0;
285  UInt_t min=0;
286  UInt_t sec=0;
287 
288  hour_min_sec=tts.GetTime(kTRUE,0,&hour,&min,&sec);
289 
290  cross_trks=0;
291  stopping_trks=0;
292  all_trks=0;
294  mc_stopping20=0;
295  mc_stopping50=0;
296 
297  auto const clockData = art::ServiceHandle<detinfo::DetectorClocksService const>()->DataFor(evt);
298 
299  size_t NTracks = tracklist.size();
300  for(size_t i=0; i<NTracks;++i){
301  art::Ptr<recob::Track> ptrack(trackListHandle, i);
302  if(fTrackModuleLabel=="pandoraTrack"){
303  std::vector<art::Ptr<recob::PFParticle>> pfps=pfp_trk_assn.at(i);
304  if(!pfps.size()) continue;
305  std::vector<art::Ptr<anab::T0>> t0s=trk_t0_assn_v.at(pfps[0].key());
306  if(!t0s.size()) continue;
307  //auto t0 = t0s.at(0);
308  // double t_zero=t0->Time();
309  }
310 
311 
312 
313 
314  if(fTrackModuleLabel=="pmtrack"){
315  std::vector<art::Ptr<anab::T0>> T0s=fmT0.at(i);
316  if(T0s.size()==0)
317  continue;
318  }
319  all_trks++;
320  std::vector<art::Ptr<anab::Calorimetry>> calos=fmcal.at(i);
321  const recob::Track& track = *ptrack;
322  auto pos = track.Vertex<TVector3>();
323  auto dir_start = track.VertexDirection<TVector3>();
324  auto dir_end = track.EndDirection<TVector3>();
325  auto end = track.End();
326  double theta_xz = std::atan2(dir_start.X(), dir_start.Z());
327  double theta_yz = std::atan2(dir_start.Y(), dir_start.Z());
328  float starty=pos.Y();
329  float startz=pos.Z();
330  float endy=end.Y();
331  float endz=end.Z();
332  float startcosx=dir_start.X();
333  float startcosy=dir_start.Y();
334  float startcosz=dir_start.Z();
335  float endcosx=dir_end.X();
336  float endcosy=dir_end.Y();
337  float endcosz=dir_end.Z();
338  float tracklength=track.Length();
339  size_t count = 0;
340  /********************************************************************************************************/
341  /*********************storing hits for each tracks*******************************/
342 
343 
344  std::vector<art::Ptr<recob::Hit>> allHits=fmtht.at(i); //storing hits for ith track
345  int trackid=-1;
348  std::map<int,double> trkide;
349  std::vector<float> hitpeakT;
350  //selection based on hitpeakT
351  for(size_t h1=0;h1<allHits.size();h1++){
352  hitpeakT.push_back(allHits[h1]->PeakTime());
353  }
354  float max=-999999;
355  float min=-999999;
356  min=*min_element(hitpeakT.begin(),hitpeakT.end());
357  max=*max_element(hitpeakT.begin(),hitpeakT.end());
358  hitpeakT.clear();
359  // if(min<250) continue;
360  for(size_t h=0; h<allHits.size();h++){
361  art::Ptr<recob::Hit> hit=allHits[h];
362  std::vector<sim::TrackIDE> eveIDs = bt_serv->HitToTrackIDEs(clockData, hit);
363  for(size_t e=0;e<eveIDs.size(); ++e){
364  trkide[eveIDs[e].trackID] += eveIDs[e].energy;
365  }
366  }
367  double maxe = -1;
368  double tote = 0;
369  for(std::map<int,double>::iterator ii = trkide.begin(); ii!=trkide.end(); ++ii){
370  tote += ii->second;
371  if((ii->second)>maxe){
372  maxe = ii->second;
373  trackid = ii->first;
374 
375  }
376  }
377  float EndE1=-99999;
378  int pdg1=-99999;
379  int mc_endx=-99999;
380  int mc_endy=-99999;
381  int mc_endz=-99999;
382  const art::Ptr<simb::MCTruth> mc=pi_serv->TrackIdToMCTruth_P(trackid);
383  const simb::MCParticle *particle = pi_serv->TrackIdToParticle_P(trackid);
384  if(particle){
385  EndE1 = particle->EndE();
386  pdg1=particle->PdgCode();
387  mc_endx=particle->EndPosition()[0];
388  mc_endy=particle->EndPosition()[1];
389  mc_endz=particle->EndPosition()[2];
390  };
391  if(std::abs(pdg1)==13 && std::abs(mc_endx)<310 && mc_endy>50 && mc_endy<550 && mc_endz>50 && mc_endz<645) mc_stopping50++;
392  if(std::abs(pdg1)==13 && std::abs(mc_endx)<340 && mc_endy>20 && mc_endy<580 && mc_endz>20 && mc_endz<675) mc_stopping20++;
393  if(std::abs(pdg1)==13 && EndE1<0.106) true_stopping_muons++;
394  if(!particle) continue;
395 
396 
397 
398 
399 
400 
401  if(!(((std::abs(pos.X())>340 || pos.Y()<20 || pos.Y()>580 || pos.Z()<20 || pos.Z()>675) && !(std::abs(end.X())>310 || end.Y()<50 || end.Y()>550 || end.Z()<50 || end.Z()>645))||(!(std::abs(pos.X())>310 || pos.Y()<50 || pos.Y()>550 || pos.Z()<50 || pos.Z()>645) && (std::abs(end.X())>340 || end.Y()<20 || end.Y()>580 || end.Z()<20 || end.Z()>675)))) continue;
402  // if(!(((std::abs(pos.X())>340 || pos.Y()<20 || pos.Y()>580 || pos.Z()<20 || pos.Z()>675) && !(std::abs(end.X())>320 || end.Y()<40 || end.Y()>560 || end.Z()<40 || end.Z()>655))||(!(std::abs(pos.X())>320 || pos.Y()<40 || pos.Y()>560 || pos.Z()<40 || pos.Z()>655) && (std::abs(end.X())>340 || end.Y()<20 || end.Y()>580 || end.Z()<20 || end.Z()>675)))) continue;
403  stopping_trks++;
404 
405  /**********************************broken tracks removal**************************************************************************************/
406  for(size_t k=0;k<NTracks;++k){
407  art::Ptr<recob::Track> ptrack_k(trackListHandle, k);
408  const recob::Track& track_k = *ptrack_k;
409  auto pos_k = track_k.Vertex();
410  auto dir_pos_k= track_k.VertexDirection();
411  auto dir_end_k = track_k.EndDirection();
412  auto end_k = track_k.End();
413  if(k==i) continue;
414  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;
415  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;
416  count++;
417 
418  }
419  if(!(count==NTracks-1)|| tracklength<100) continue;
420  int geant_trkID=particle->TrackId();
421  int n_daughters_electron=0;
422  int n_daughters_positron=0;
423  if(abs(pdg1)==13){
424  const sim::ParticleList& plist = pi_serv->ParticleList();
425  sim::ParticleList::const_iterator itPart=plist.begin(),pend=plist.end();
426  for(size_t iPart = 0;(iPart<plist.size()) && (itPart!=pend); ++iPart){
427  const simb::MCParticle* pPart = (itPart++)->second;
428  int pdgcode = pPart->PdgCode();
429  // if(abs(pdgcode)==11) std::cout<<pdgcode<<" "<<pPart->Process()<<" "<<pPart->Mother()<<" "<<geant_trkID<<std::endl;
430  if(pPart->Mother()==geant_trkID && pdgcode==11) n_daughters_electron++;
431  if(pPart->Mother()==geant_trkID && pdgcode==-11) n_daughters_positron++;
432  }
433  }
434  /*************************************filling the values****************************/
435  cross_trks++;
436 
437  auto const* SCE = lar::providerFrom<spacecharge::SpaceChargeService>();
438  EndPointx_corrected[cross_trks-1]=particle->EndPosition()[0]-SCE->GetPosOffsets(geo::Point_t(particle->EndPosition()[0],particle->EndPosition()[1],particle->EndPosition()[2])).X();
439  EndPointy_corrected[cross_trks-1]=particle->EndPosition()[1]+SCE->GetPosOffsets(geo::Point_t(particle->EndPosition()[0],particle->EndPosition()[1],particle->EndPosition()[2])).Y();
440  EndPointz_corrected[cross_trks-1]=particle->EndPosition()[2]+SCE->GetPosOffsets(geo::Point_t(particle->EndPosition()[0],particle->EndPosition()[1],particle->EndPosition()[2])).Z();
441  origin[cross_trks-1]=mc->Origin();
442  daughter_electrons[cross_trks-1]=n_daughters_electron++;
443  daughter_positrons[cross_trks-1]=n_daughters_positron++;
444  EndE[cross_trks-1]=particle->EndE();
445  pdg[cross_trks-1]=particle->PdgCode();
446  TrackId_geant[cross_trks-1]=particle->TrackId();
447  EndPointx[cross_trks-1]=particle->EndPosition()[0];
448  EndPointy[cross_trks-1]=particle->EndPosition()[1];
449  EndPointz[cross_trks-1]=particle->EndPosition()[2];
450  StartPointx[cross_trks-1]=particle->Vx();
451  StartPointy[cross_trks-1]=particle->Vy();
452  StartPointz[cross_trks-1]=particle->Vz();
453  Total_energy[cross_trks-1]=tote;
454  trackthetaxz[cross_trks-1]=theta_xz;
455  trackthetayz[cross_trks-1]=theta_yz;
456  trkstartx[cross_trks-1]=pos.X();
457  trkstarty[cross_trks-1]=pos.Y();
458  trkstartz[cross_trks-1]=pos.Z();
459  trkendx[cross_trks-1]=end.X();
460  trkendy[cross_trks-1]=end.Y();
461  trkendz[cross_trks-1]=end.Z();
462  trklen[cross_trks-1]=track.Length();
463  TrkID[cross_trks-1]=track.ID();
466  trkstartcosxyz[cross_trks-1][0]=dir_start.X();
467  trkstartcosxyz[cross_trks-1][1]=dir_start.Y();
468  trkstartcosxyz[cross_trks-1][2]=dir_start.Z();
469  trkendcosxyz[cross_trks-1][0]=dir_end.X();
470  trkendcosxyz[cross_trks-1][1]=dir_end.Y();
471  trkendcosxyz[cross_trks-1][2]=dir_end.Z();
472  for(size_t ical = 0; ical<calos.size(); ++ical){
473  if(!calos[ical]) continue;
474  if(!calos[ical]->PlaneID().isValid) continue;
475  int planenum = calos[ical]->PlaneID().Plane;
476  if(planenum<0||planenum>2) continue;
477  const size_t NHits = calos[ical] -> dEdx().size();
478  ntrkhits[cross_trks-1][planenum]=int(NHits);
479  for(size_t iHit = 0; iHit < NHits; ++iHit){
480  const auto& TrkPos = (calos[ical] -> XYZ())[iHit];
481  trkdqdx[cross_trks-1][planenum][iHit]=(calos[ical] -> dQdx())[iHit];
482  trkdedx[cross_trks-1][planenum][iHit]=(calos[ical] -> dEdx())[iHit];
483  trkresrange[cross_trks-1][planenum][iHit]=(calos[ical]->ResidualRange())[iHit];
484  trkhitx[cross_trks-1][planenum][iHit]=TrkPos.X();
485  trkhity[cross_trks-1][planenum][iHit]=TrkPos.Y();
486  trkhitz[cross_trks-1][planenum][iHit]=TrkPos.Z();
487  trkpitch[cross_trks-1][planenum][iHit]=(calos[ical]->TrkPitchVec())[iHit];
488  } // loop over iHit..
489  } // loop over ical 2nd time...
490  } // loop over trks...
491  // stopping_muons->Fill(stopping_trks);
492  fEventTree->Fill();
493  } // 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 trkstartcosxyz[kMaxTracks][3]
intermediate_table::iterator iterator
int PdgCode() const
Definition: MCParticle.h:212
constexpr std::uint32_t timeLow() const
Definition: Timestamp.h:29
Float_t EndPointx[kMaxTracks]
Float_t StartPointz[kMaxTracks]
double EndE() const
Definition: MCParticle.h:244
const TLorentzVector & EndPosition() const
Definition: MCParticle.h:225
std::vector< sim::TrackIDE > HitToTrackIDEs(detinfo::DetectorClocksData const &clockData, recob::Hit const &hit) const
Int_t daughter_positrons[kMaxTracks]
Handle< PROD > getHandle(SelectorBase const &) const
Definition: DataViewImpl.h:382
const simb::MCParticle * TrackIdToParticle_P(int id) const
int Mother() const
Definition: MCParticle.h:213
Float_t StartPointx[kMaxTracks]
constexpr std::uint32_t timeHigh() const
Definition: Timestamp.h:34
simb::Origin_t Origin() const
Definition: MCTruth.h:74
Vector_t VertexDirection() const
Definition: Track.h:132
Float_t trackthetayz[kMaxTracks]
Float_t peakT_max[kMaxTracks]
intermediate_table::const_iterator const_iterator
Float_t trkstarty[kMaxTracks]
Float_t trkhitz[kMaxTracks][3][3000]
Float_t trkhitx[kMaxTracks][3][3000]
int TrackId() const
Definition: MCParticle.h:210
Float_t EndPointy_corrected[kMaxTracks]
Float_t trkstartx[kMaxTracks]
Float_t EndPointx_corrected[kMaxTracks]
T abs(T value)
Float_t EndPointz[kMaxTracks]
double dEdx(float dqdx, float Efield)
Definition: doAna.cpp:21
Double_t EndE[kMaxTracks]
const double e
double Length(size_t p=0) const
Access to various track properties.
Definition: Track.h:167
Timestamp time() const
def key(type, name=None)
Definition: graph.py:13
const art::Ptr< simb::MCTruth > & TrackIdToMCTruth_P(int id) const
Float_t trackthetaxz[kMaxTracks]
Point_t const & Vertex() const
Definition: Track.h:124
Double_t Total_energy[kMaxTracks]
SubRunNumber_t subRun() const
Definition: DataViewImpl.cc:78
Float_t StartPointy[kMaxTracks]
RunNumber_t run() const
Definition: DataViewImpl.cc:71
static int max(int a, int b)
Detector simulation of raw signals on wires.
Float_t trkhity[kMaxTracks][3][3000]
const sim::ParticleList & ParticleList() const
Float_t EndPointy[kMaxTracks]
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
Definition: geo_vectors.h:184
double Vx(const int i=0) const
Definition: MCParticle.h:221
int ID() const
Definition: Track.h:198
Float_t trkendcosxyz[kMaxTracks][3]
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:55
Vector_t EndDirection() const
Definition: Track.h:133
Float_t trkresrange[kMaxTracks][3][3000]
double Vz(const int i=0) const
Definition: MCParticle.h:223
Float_t trkdedx[kMaxTracks][3][3000]
EventNumber_t event() const
Definition: EventID.h:116
Point_t const & End() const
Definition: Track.h:125
Float_t peakT_min[kMaxTracks]
detail::Node< FrameID, bool > PlaneID
Definition: CRTID.h:125
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
Definition: Ptr.h:297
Float_t trkpitch[kMaxTracks][3][3000]
Int_t ntrkhits[kMaxTracks][3]
second_as<> second
Type of time stored in seconds, in double precision.
Definition: spacetime.h:85
Float_t trkdqdx[kMaxTracks][3][3000]
Float_t EndPointz_corrected[kMaxTracks]
Float_t trkstartz[kMaxTracks]
Int_t daughter_electrons[kMaxTracks]
EventID id() const
Definition: Event.cc:34
double Vy(const int i=0) const
Definition: MCParticle.h:222
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
void dune::dEdxcalibration::beginJob ( )
virtual

Reimplemented from art::EDAnalyzer.

Definition at line 171 of file dEdxcalibration_module.cc.

171  {
172  std::cout<<"job begin..."<<std::endl;
174  fEventTree = tfs->make<TTree>("Event", "Event Tree from Reco");
175  fEventTree->Branch("event", &event,"event/I");
176  fEventTree->Branch("evttime",&evttime,"evttime/D");
177  fEventTree->Branch("run", &run,"run/I");
178  fEventTree->Branch("subrun", &subrun,"surbrun/I");
179  fEventTree->Branch("year_month_date", &year_month_date,"year_month_date/I");
180  fEventTree->Branch("hour_min_sec", &hour_min_sec,"hour_min_sec/I");
181  fEventTree->Branch("cross_trks",&cross_trks,"cross_trks/I");
182  fEventTree->Branch("mc_stopping20",&mc_stopping20,"mc_stopping20/I");
183  fEventTree->Branch("mc_stopping50",&mc_stopping50,"mc_stopping50/I");
184  fEventTree->Branch("true_stopping_muons",&true_stopping_muons,"true_stopping_muons/I");
185  fEventTree->Branch("stopping_trks",&stopping_trks,"stopping_trks/I");
186  fEventTree->Branch("all_trks",&all_trks,"all_trks/I");
187  fEventTree->Branch("xprojectedlen",xprojectedlen,"xprojectedlen[all_trks]/F");
188  fEventTree->Branch("trackthetaxz",trackthetaxz,"trackthetaxz[cross_trks]/F");
189  fEventTree->Branch("trackthetayz",trackthetayz,"trackthetayz[cross_trks]/F");
190  fEventTree->Branch("trkstartx",trkstartx,"trkstartx[cross_trks]/F");
191  fEventTree->Branch("trkstarty",trkstarty,"trkstarty[cross_trks]/F");
192  fEventTree->Branch("trkstartz",trkstartz,"trkstartz[cross_trks]/F");
193  fEventTree->Branch("trkendx",trkendx,"trkendx[cross_trks]/F");
194  fEventTree->Branch("trkendy",trkendy,"trkendy[cross_trks]/F");
195  fEventTree->Branch("trkendz",trkendz,"trkendz[cross_trks]/F");
196  fEventTree->Branch("trklen",trklen,"trklen[cross_trks]/F");
197  fEventTree->Branch("Total_energy",Total_energy,"Total_energy[cross_trks]/D");
198  fEventTree->Branch("EndE",EndE,"EndE[cross_trks]/D");
199  fEventTree->Branch("peakT_max",peakT_max,"peakT_max[cross_trks]/F");
200  fEventTree->Branch("peakT_min",peakT_min,"peakT_min[cross_trks]/F");
201  fEventTree->Branch("pdg",pdg,"pdg[cross_trks]/I");
202  fEventTree->Branch("origin",origin,"origin[cross_trks]/I");
203  fEventTree->Branch("TrkID",TrkID,"TrkID[cross_trks]/I");
204  fEventTree->Branch("TrackId_geant",TrackId_geant,"TrackId_geant[cross_trks]/I");
205  fEventTree->Branch("daughter_electrons",daughter_electrons,"daughter_electrons[cross_trks]/I");
206  fEventTree->Branch("daughter_positrons",daughter_positrons,"daughter_positrons[cross_trks]/I");
207  fEventTree->Branch("EndPointx",EndPointx,"EndPointx[cross_trks]/F");
208  fEventTree->Branch("EndPointy",EndPointy,"EndPointy[cross_trks]/F");
209  fEventTree->Branch("EndPointz",EndPointz,"EndPointz[cross_trks]/F");
210  fEventTree->Branch("EndPointx_corrected",EndPointx_corrected,"EndPointx_corrected[cross_trks]/F");
211  fEventTree->Branch("EndPointy_corrected",EndPointy_corrected,"EndPointy_corrected[cross_trks]/F");
212  fEventTree->Branch("EndPointz_corrected",EndPointz_corrected,"EndPointz_corrected[cross_trks]/F");
213  fEventTree->Branch("StartPointx",StartPointx,"StartPointx[cross_trks]/F");
214  fEventTree->Branch("StartPointy",StartPointy,"StartPointy[cross_trks]/F");
215  fEventTree->Branch("StartPointz",StartPointz,"StartPointz[cross_trks]/F");
216  fEventTree->Branch("trkstartcosxyz",trkstartcosxyz,"trkstartcosxyz[cross_trks][3]/F");
217  fEventTree->Branch("trkendcosxyz",trkendcosxyz,"trkendcosxyz[cross_trks][3]/F");
218  fEventTree->Branch("ntrkhits",ntrkhits,"ntrkhits[cross_trks][3]/I");
219  fEventTree->Branch("trkdqdx",trkdqdx,"trkdqdx[cross_trks][3][3000]/F");
220  fEventTree->Branch("trkdedx",trkdedx,"trkdedx[cross_trks][3][3000]/F");
221  fEventTree->Branch("trkresrange",trkresrange,"trkresrange[cross_trks][3][3000]/F");
222  fEventTree->Branch("trkhitx",trkhitx,"trkhitx[cross_trks][3][3000]/F");
223  fEventTree->Branch("trkhity",trkhity,"trkhity[cross_trks][3][3000]/F");
224  fEventTree->Branch("trkhitz",trkhitz,"trkhitz[cross_trks][3][3000]/F");
225  fEventTree->Branch("trkpitch",trkpitch,"trkpitch[cross_trks][3][3000]/F");
226  }
Float_t trkstartcosxyz[kMaxTracks][3]
Float_t EndPointx[kMaxTracks]
Float_t StartPointz[kMaxTracks]
Int_t daughter_positrons[kMaxTracks]
Float_t StartPointx[kMaxTracks]
Float_t trackthetayz[kMaxTracks]
Float_t peakT_max[kMaxTracks]
Float_t trkstarty[kMaxTracks]
Float_t trkhitz[kMaxTracks][3][3000]
Float_t trkhitx[kMaxTracks][3][3000]
Float_t EndPointy_corrected[kMaxTracks]
Float_t trkstartx[kMaxTracks]
Float_t EndPointx_corrected[kMaxTracks]
Float_t EndPointz[kMaxTracks]
Double_t EndE[kMaxTracks]
Float_t trackthetaxz[kMaxTracks]
Double_t Total_energy[kMaxTracks]
Float_t StartPointy[kMaxTracks]
Float_t trkhity[kMaxTracks][3][3000]
Float_t EndPointy[kMaxTracks]
Float_t xprojectedlen[kMaxTracks]
Float_t trkendcosxyz[kMaxTracks][3]
Float_t trkresrange[kMaxTracks][3][3000]
Float_t trkdedx[kMaxTracks][3][3000]
Float_t peakT_min[kMaxTracks]
Float_t trkpitch[kMaxTracks][3][3000]
Int_t ntrkhits[kMaxTracks][3]
Float_t trkdqdx[kMaxTracks][3][3000]
Float_t EndPointz_corrected[kMaxTracks]
Float_t trkstartz[kMaxTracks]
Int_t daughter_electrons[kMaxTracks]
QTextStream & endl(QTextStream &s)
Event finding and building.
void dune::dEdxcalibration::beginRun ( const art::Run run)

Definition at line 234 of file dEdxcalibration_module.cc.

234  {
235  mf::LogInfo("dEdxcalibration")<<"begin run..."<<std::endl;
236  }
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
QTextStream & endl(QTextStream &s)
void dune::dEdxcalibration::endJob ( )
virtual

Reimplemented from art::EDAnalyzer.

Definition at line 229 of file dEdxcalibration_module.cc.

229  {
230 
231  }
void dune::dEdxcalibration::reset ( )

Definition at line 496 of file dEdxcalibration_module.cc.

496  {
497  run = -99999;
498  subrun = -99999;
499  event = -99999;
500  evttime = -99999;
501  cross_trks = -99999;
502  true_stopping_muons=-99999;
503  mc_stopping20=-99999;
504  mc_stopping50=-99999;
505  all_trks = -99999;
506  year_month_date=-99999;
507  hour_min_sec=-99999;
508  for(int i=0; i<kMaxTracks; i++){
509  trackthetaxz[i]=-99999;
510  trackthetayz[i]=-99999;
511  trkstartx[i]=-99999;
512  trkstarty[i]=-99999;
513  trkstartz[i]=-99999;
514  trkendx[i]=-99999;
515  trkendy[i]=-99999;
516  trkendz[i]=-99999;
517  trklen[i]=-99999;
518  TrkID[i]=-99999;
519  TrackId_geant[i]=-99999;
520  origin[i]=-99999;
521  EndE[i]=-99999;
522  pdg[i]=-99999;
523  Total_energy[i]=-999999;
524  daughter_electrons[i]=-99999;
525  daughter_positrons[i]=-99999;
526  EndPointx[i]=-99999;
527  EndPointy[i]=-99999;
528  EndPointz[i]=-99999;
529  EndPointx_corrected[i]=-99999;
530  EndPointy_corrected[i]=-99999;
531  EndPointz_corrected[i]=-99999;
532  StartPointx[i]=-99999;
533  StartPointy[i]=-99999;
534  StartPointz[i]=-99999;
535  pdg[i]=-99999;
536  EndE[i]=-99999;
537  peakT_max[i]=-99999;
538  peakT_min[i]=-99999;
539  xprojectedlen[i]=-99999;
540  trkstartcosxyz[i][0]=-99999;
541  trkstartcosxyz[i][1]=-99999;
542  trkstartcosxyz[i][2]=-99999;
543  trkendcosxyz[i][0]=-99999;
544  trkendcosxyz[i][1]=-99999;
545  trkendcosxyz[i][2]=-99999;
546  ntrkhits[i][0] = -99999;
547  ntrkhits[i][1] = -99999;
548  ntrkhits[i][2] = -99999;
549  for(int j=0; j<3; j++){
550  for(int k=0; k<3000; k++){
551  trkdqdx[i][j][k]=-99999;
552  trkdedx[i][j][k]=-99999;
553  trkresrange[i][j][k]=-99999;
554  trkhitx[i][j][k]=-99999;
555  trkhity[i][j][k]=-99999;
556  trkhitz[i][j][k]=-99999;
557  trkpitch[i][j][k]=-99999;
558  }
559  }
560  }
561  }
Float_t trkstartcosxyz[kMaxTracks][3]
Float_t EndPointx[kMaxTracks]
Float_t StartPointz[kMaxTracks]
Int_t daughter_positrons[kMaxTracks]
Float_t StartPointx[kMaxTracks]
Float_t trackthetayz[kMaxTracks]
Float_t peakT_max[kMaxTracks]
Float_t trkstarty[kMaxTracks]
Float_t trkhitz[kMaxTracks][3][3000]
Float_t trkhitx[kMaxTracks][3][3000]
Float_t EndPointy_corrected[kMaxTracks]
Float_t trkstartx[kMaxTracks]
Float_t EndPointx_corrected[kMaxTracks]
Float_t EndPointz[kMaxTracks]
Double_t EndE[kMaxTracks]
Float_t trackthetaxz[kMaxTracks]
const int kMaxTracks
Double_t Total_energy[kMaxTracks]
Float_t StartPointy[kMaxTracks]
Float_t trkhity[kMaxTracks][3][3000]
Float_t EndPointy[kMaxTracks]
Float_t xprojectedlen[kMaxTracks]
Float_t trkendcosxyz[kMaxTracks][3]
Float_t trkresrange[kMaxTracks][3][3000]
Float_t trkdedx[kMaxTracks][3][3000]
Float_t peakT_min[kMaxTracks]
Float_t trkpitch[kMaxTracks][3][3000]
Int_t ntrkhits[kMaxTracks][3]
Float_t trkdqdx[kMaxTracks][3][3000]
Float_t EndPointz_corrected[kMaxTracks]
Float_t trkstartz[kMaxTracks]
Int_t daughter_electrons[kMaxTracks]

Member Data Documentation

Int_t dune::dEdxcalibration::all_trks
private

Definition at line 109 of file dEdxcalibration_module.cc.

Int_t dune::dEdxcalibration::cross_trks
private

Definition at line 104 of file dEdxcalibration_module.cc.

Int_t dune::dEdxcalibration::daughter_electrons[kMaxTracks]
private

Definition at line 144 of file dEdxcalibration_module.cc.

Int_t dune::dEdxcalibration::daughter_positrons[kMaxTracks]
private

Definition at line 145 of file dEdxcalibration_module.cc.

Double_t dune::dEdxcalibration::EndE[kMaxTracks]
private

Definition at line 99 of file dEdxcalibration_module.cc.

Float_t dune::dEdxcalibration::EndPointx[kMaxTracks]
private

Definition at line 123 of file dEdxcalibration_module.cc.

Float_t dune::dEdxcalibration::EndPointx_corrected[kMaxTracks]
private

Definition at line 126 of file dEdxcalibration_module.cc.

Float_t dune::dEdxcalibration::EndPointy[kMaxTracks]
private

Definition at line 124 of file dEdxcalibration_module.cc.

Float_t dune::dEdxcalibration::EndPointy_corrected[kMaxTracks]
private

Definition at line 127 of file dEdxcalibration_module.cc.

Float_t dune::dEdxcalibration::EndPointz[kMaxTracks]
private

Definition at line 125 of file dEdxcalibration_module.cc.

Float_t dune::dEdxcalibration::EndPointz_corrected[kMaxTracks]
private

Definition at line 128 of file dEdxcalibration_module.cc.

Int_t dune::dEdxcalibration::event
private

Definition at line 97 of file dEdxcalibration_module.cc.

Double_t dune::dEdxcalibration::evttime
private

Definition at line 101 of file dEdxcalibration_module.cc.

std::string dune::dEdxcalibration::fCalorimetryModuleLabel
private

Definition at line 148 of file dEdxcalibration_module.cc.

TTree* dune::dEdxcalibration::fEventTree
private

Definition at line 94 of file dEdxcalibration_module.cc.

std::string dune::dEdxcalibration::fHitsModuleLabel
private

Definition at line 146 of file dEdxcalibration_module.cc.

bool dune::dEdxcalibration::fSaveCaloInfo
private

Definition at line 149 of file dEdxcalibration_module.cc.

bool dune::dEdxcalibration::fSaveTrackInfo
private

Definition at line 150 of file dEdxcalibration_module.cc.

std::string dune::dEdxcalibration::fTrackModuleLabel
private

Definition at line 147 of file dEdxcalibration_module.cc.

Int_t dune::dEdxcalibration::hour_min_sec
private

Definition at line 103 of file dEdxcalibration_module.cc.

Int_t dune::dEdxcalibration::mc_stopping20
private

Definition at line 107 of file dEdxcalibration_module.cc.

Int_t dune::dEdxcalibration::mc_stopping50
private

Definition at line 106 of file dEdxcalibration_module.cc.

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

Definition at line 134 of file dEdxcalibration_module.cc.

Int_t dune::dEdxcalibration::origin[kMaxTracks]
private

Definition at line 122 of file dEdxcalibration_module.cc.

Int_t dune::dEdxcalibration::pdg[kMaxTracks]
private

Definition at line 100 of file dEdxcalibration_module.cc.

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

Definition at line 142 of file dEdxcalibration_module.cc.

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

Definition at line 143 of file dEdxcalibration_module.cc.

Int_t dune::dEdxcalibration::run
private

Definition at line 95 of file dEdxcalibration_module.cc.

Float_t dune::dEdxcalibration::StartPointx[kMaxTracks]
private

Definition at line 129 of file dEdxcalibration_module.cc.

Float_t dune::dEdxcalibration::StartPointy[kMaxTracks]
private

Definition at line 130 of file dEdxcalibration_module.cc.

Float_t dune::dEdxcalibration::StartPointz[kMaxTracks]
private

Definition at line 131 of file dEdxcalibration_module.cc.

Int_t dune::dEdxcalibration::stopping_trks
private

Definition at line 108 of file dEdxcalibration_module.cc.

Int_t dune::dEdxcalibration::subrun
private

Definition at line 96 of file dEdxcalibration_module.cc.

Double_t dune::dEdxcalibration::Total_energy[kMaxTracks]
private

Definition at line 98 of file dEdxcalibration_module.cc.

Int_t dune::dEdxcalibration::TrackId_geant[kMaxTracks]
private

Definition at line 121 of file dEdxcalibration_module.cc.

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

Definition at line 111 of file dEdxcalibration_module.cc.

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

Definition at line 112 of file dEdxcalibration_module.cc.

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

Definition at line 136 of file dEdxcalibration_module.cc.

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

Definition at line 135 of file dEdxcalibration_module.cc.

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

Definition at line 133 of file dEdxcalibration_module.cc.

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

Definition at line 116 of file dEdxcalibration_module.cc.

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

Definition at line 117 of file dEdxcalibration_module.cc.

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

Definition at line 118 of file dEdxcalibration_module.cc.

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

Definition at line 138 of file dEdxcalibration_module.cc.

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

Definition at line 139 of file dEdxcalibration_module.cc.

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

Definition at line 140 of file dEdxcalibration_module.cc.

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

Definition at line 120 of file dEdxcalibration_module.cc.

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

Definition at line 119 of file dEdxcalibration_module.cc.

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

Definition at line 141 of file dEdxcalibration_module.cc.

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

Definition at line 137 of file dEdxcalibration_module.cc.

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

Definition at line 132 of file dEdxcalibration_module.cc.

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

Definition at line 113 of file dEdxcalibration_module.cc.

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

Definition at line 114 of file dEdxcalibration_module.cc.

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

Definition at line 115 of file dEdxcalibration_module.cc.

Int_t dune::dEdxcalibration::true_stopping_muons
private

Definition at line 105 of file dEdxcalibration_module.cc.

Float_t dune::dEdxcalibration::xprojectedlen[kMaxTracks]
private

Definition at line 110 of file dEdxcalibration_module.cc.

Int_t dune::dEdxcalibration::year_month_date
private

Definition at line 102 of file dEdxcalibration_module.cc.


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