ProtoDUNEAnalCosmicTree_module.cc
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 // Class: ProtoDUNEAnalCosmicTree
3 // File: ProtoDUNEAnalCosmicTree_module.cc
4 //
5 // Extract protoDUNE useful information, do a firs tpre-selection and save output to a flat tree
6 //
7 // Georgios Christodoulou - georgios.christodoulou at cern.ch
8 //
9 ////////////////////////////////////////////////////////////////////////
10 
17 #include "art_root_io/TFileService.h"
19 #include "canvas/Persistency/Common/FindManyP.h"
20 #include "fhiclcpp/ParameterSet.h"
22 
35 
40 #include "dune/Protodune/singlephase/DataUtils/ProtoDUNEDataUtils.h"
41 
42 // ROOT includes
43 #include "TTree.h"
44 #include "TFile.h"
45 #include "TString.h"
46 #include "TTimeStamp.h"
47 
48 // C++ Includes
49 #include <fstream>
50 #include <string>
51 #include <sstream>
52 #include <cmath>
53 #include <algorithm>
54 #include <iostream>
55 #include <vector>
56 
57 // Maximum number of beam particles to save
58 const int NMAXCOSMICPARTICLES = 100;
59 
60 namespace protoana {
61  class ProtoDUNEAnalCosmicTree;
62 }
63 
64 
66 public:
67 
69 
74 
75  virtual void beginJob() override;
76  virtual void endJob() override;
77 
78  // Required functions.
79  void analyze(art::Event const & evt) override;
80 
81 private:
82 
83  // Helper utility functions
88 
89  // Track momentum algorithm calculates momentum based on track range
91 
92  // Initialise tree variables
93  void Initialise();
94 
95  // Fill cosmics tree
96  void FillCosmicsTree(art::Event const & evt);
97 
98  // fcl parameters
107 
109 
110  // Tree variables
111  int fRun;
112  int fSubRun;
113  int fevent;
114  double fTimeStamp;
116 
117  // Cosmic tree variables
128  //double fcosmicMomentum[NMAXCOSMICPARTICLES];
129  //double fcosmicEndMomentum[NMAXCOSMICPARTICLES];
134 
142 
144 
156 
157 };
158 
159 
161  :
162  EDAnalyzer(p),
163  dataUtil(p.get<fhicl::ParameterSet>("DataUtils")),
164  fBeamModuleLabel(p.get< art::InputTag >("BeamModuleLabel")),
165  fCalorimetryTag(p.get<std::string>("CalorimetryTag")),
166  fParticleIDTag(p.get<std::string>("ParticleIDTag")),
167  fTrackerTag(p.get<std::string>("TrackerTag")),
168  fShowerTag(p.get<std::string>("ShowerTag")),
169  fPFParticleTag(p.get<std::string>("PFParticleTag")),
170  fGeneratorTag(p.get<std::string>("GeneratorTag")),
171  fMinimumTrackLength(p.get<double>("MinimumTrackLength"))
172 {
173 
174 }
175 
177 
179 
180  fPandoraCosmics = tfs->make<TTree>("PandoraCosmics", "Cosmic tracks reconstructed with Pandora");
181  fPandoraCosmics->Branch("run", &fRun, "run/I");
182  fPandoraCosmics->Branch("subrun", &fSubRun, "subrun/I");
183  fPandoraCosmics->Branch("event", &fevent, "event/I");
184  fPandoraCosmics->Branch("timestamp", &fTimeStamp, "timestamp/D");
185  fPandoraCosmics->Branch("Nactivefembs", &fNactivefembs, "Nactivefembs[5]/I");
186  fPandoraCosmics->Branch("NCOSMICS", &fNCOSMICS, "NCOSMICS/I");
187  fPandoraCosmics->Branch("cosmicIsClear", &fcosmicIsClear, "cosmicIsClear[NCOSMICS]/I");
188  fPandoraCosmics->Branch("cosmicBDTScore", &fcosmicBDTScore, "cosmicBDTScore[NCOSMICS]/D");
189  fPandoraCosmics->Branch("cosmicNHits", &fcosmicNHits, "cosmicNHits[NCOSMICS]/I");
190  fPandoraCosmics->Branch("iscosmictrack", &fiscosmictrack, "iscosmictrack[NCOSMICS]/I");
191  fPandoraCosmics->Branch("iscosmicshower", &fiscosmicshower, "iscosmicshower[NCOSMICS]/I");
192  fPandoraCosmics->Branch("cosmicID", &fcosmicID, "cosmicID[NCOSMICS]/I");
193  fPandoraCosmics->Branch("cosmicTheta", &fcosmicTheta, "cosmicTheta[NCOSMICS]/D");
194  fPandoraCosmics->Branch("cosmicPhi", &fcosmicPhi, "cosmicPhi[NCOSMICS]/D");
195  fPandoraCosmics->Branch("cosmicLength", &fcosmicLength, "cosmicLength[NCOSMICS]/D");
196  //fPandoraCosmics->Branch("cosmicMomentum", &fcosmicMomentum, "cosmicMomentum[NCOSMICS]/D");
197  //fPandoraCosmics->Branch("cosmicEndMomentum", &fcosmicEndMomentum, "cosmicEndMomentum[NCOSMICS]/D");
198  fPandoraCosmics->Branch("cosmicOpeningAngle", &fcosmicOpeningAngle, "cosmicOpeningAngle[NCOSMICS]/D");
199  fPandoraCosmics->Branch("cosmicShowerBestPlane", &fcosmicShowerBestPlane, "cosmicShowerBestPlane[NCOSMICS]/I");
200  fPandoraCosmics->Branch("cosmicEndPosition", &fcosmicEndPosition, "cosmicEndPosition[NCOSMICS][3]/D");
201  fPandoraCosmics->Branch("cosmicStartPosition", &fcosmicStartPosition, "cosmicStartPosition[NCOSMICS][3]/D");
202  fPandoraCosmics->Branch("cosmicEndDirection", &fcosmicEndDirection, "cosmicEndDirection[NCOSMICS][3]/D");
203  fPandoraCosmics->Branch("cosmicStartDirection", &fcosmicStartDirection, "cosmicStartDirection[NCOSMICS][3]/D");
204  fPandoraCosmics->Branch("cosmicMomentumByRangeMuon", &fcosmicMomentumByRangeMuon, "cosmicMomentumByRangeMuon[NCOSMICS]/D");
205  fPandoraCosmics->Branch("cosmicMomentumByRangeProton", &fcosmicMomentumByRangeProton, "cosmicMomentumByRangeProton[NCOSMICS]/D");
206  fPandoraCosmics->Branch("cosmicKineticEnergy", &fcosmicKineticEnergy, "cosmicKineticEnergy[NCOSMICS][3]/D");
207  fPandoraCosmics->Branch("cosmicRange", &fcosmicRange, "cosmicRange[NCOSMICS][3]/D");
208  fPandoraCosmics->Branch("cosmicTrkPitchC", &fcosmicTrkPitchC, "cosmicTrkPitchC[NCOSMICS][3]/D");
209  fPandoraCosmics->Branch("cosmicT0", &fcosmicT0, "cosmicT0[NCOSMICS]/D");
210 
211  fPandoraCosmics->Branch("cosmicPID_Pdg", &fcosmicPID_Pdg, "cosmicPID_Pdg[NCOSMICS][3]/I");
212  fPandoraCosmics->Branch("cosmicPID_Ndf", &fcosmicPID_Ndf, "cosmicPID_Ndf[NCOSMICS][3]/I");
213  fPandoraCosmics->Branch("cosmicPID_MinChi2", &fcosmicPID_MinChi2, "cosmicPID_MinChi2[NCOSMICS][3]/D");
214  fPandoraCosmics->Branch("cosmicPID_DeltaChi2", &fcosmicPID_DeltaChi2, "cosmicPID_DeltaChi2[NCOSMICS][3]/D");
215  fPandoraCosmics->Branch("cosmicPID_Chi2Proton", &fcosmicPID_Chi2Proton, "cosmicPID_Chi2Proton[NCOSMICS][3]/D");
216  fPandoraCosmics->Branch("cosmicPID_Chi2Kaon", &fcosmicPID_Chi2Kaon, "cosmicPID_Chi2Kaon[NCOSMICS][3]/D");
217  fPandoraCosmics->Branch("cosmicPID_Chi2Pion", &fcosmicPID_Chi2Pion, "cosmicPID_Chi2Pion[NCOSMICS][3]/D");
218  fPandoraCosmics->Branch("cosmicPID_Chi2Muon", &fcosmicPID_Chi2Muon, "cosmicPID_Chi2Muon[NCOSMICS][3]/D");
219  fPandoraCosmics->Branch("cosmicPID_MissingE", &fcosmicPID_MissingE, "cosmicPID_MissingE[NCOSMICS][3]/D");
220  fPandoraCosmics->Branch("cosmicPID_MissingEavg", &fcosmicPID_MissingEavg, "cosmicPID_MissingEavg[NCOSMICS][3]/D");
221  fPandoraCosmics->Branch("cosmicPID_PIDA", &fcosmicPID_PIDA, "cosmicPID_PIDA[NCOSMICS][3]/D");
222 
223 }
224 
226 
227  // Initialise tree parameters
228  Initialise();
229 
230  fRun = evt.run();
231  fSubRun = evt.subRun();
232  fevent = evt.id().event();
233  art::Timestamp ts = evt.time();
234  if (ts.timeHigh() == 0){
235  TTimeStamp ts2(ts.timeLow());
236  fTimeStamp = ts2.AsDouble();
237  }
238  else{
239  TTimeStamp ts2(ts.timeHigh(), ts.timeLow());
240  fTimeStamp = ts2.AsDouble();
241  }
242 
243  // Get number of active fembs
244  int allactivefembs = 0;
245  if(!evt.isRealData()){
246  allactivefembs = 120;
247  for(int k=0; k < 6; k++)
248  fNactivefembs[0] = 20;
249  }
250  else{
251  for(int k=0; k < 6; k++){
253  allactivefembs += fNactivefembs[k];
254  }
255  }
256 
257  //trmom.SetMinLength(100);
258 
259  // For cosmics only save events if the all fembs are active
260  if(allactivefembs != 120) return;
261 
262  FillCosmicsTree(evt);
263 
264 }
265 
267 
268 }
269 
271 
272  unsigned int npfParticles = pfpUtil.GetNumberPrimaryPFParticle(evt,fPFParticleTag);
273 
274  if(npfParticles == 0){
275  std::cout << "WARNING::No PfParticles found! Skipping event!" << std::endl;
276  return;
277  }
278 
279  // Do not process more than NMAXCOSMICPARTICLES
280  if(fNCOSMICS >= NMAXCOSMICPARTICLES) return;
281 
282  // Get all PFParticles
283  auto recoParticles = evt.getValidHandle<std::vector<recob::PFParticle>>(fPFParticleTag);
284 
285  for(unsigned int i = 0; i < recoParticles->size(); i++){
286  recob::PFParticle* pfparticle = const_cast<recob::PFParticle*>(&(recoParticles->at(i)));
287  //const recob::PFParticle* pfparticle = &(recoParticles->at(i));
288 
289  // Only consider primary particles
290  if(!pfparticle->IsPrimary()) continue;
291 
292  // Do not consider beam particles
293  if(pfpUtil.IsBeamParticle(*pfparticle, evt, fPFParticleTag)) continue;
294 
295  // Get the T0 for this pfParticle
296  std::vector<anab::T0> pfT0vec = pfpUtil.GetPFParticleT0(*pfparticle,evt,fPFParticleTag);
297  //if(pfT0vec.empty()) continue;
298 
299  const recob::Track* thisTrack = pfpUtil.GetPFParticleTrack(*pfparticle,evt,fPFParticleTag,fTrackerTag);
300  const recob::Shower* thisShower = pfpUtil.GetPFParticleShower(*pfparticle,evt,fPFParticleTag,fShowerTag);
301 
302  // Do not save very short cosmic tracks
303  if(thisTrack != 0x0 && thisTrack->Length() < fMinimumTrackLength) continue;
304  if(thisShower != 0x0 && thisShower->Length() < fMinimumTrackLength) continue;
305 
306  // Pandora's BDT beam-cosmic score
308 
309  // NHits associated with this pfParticle
311 
312  if(!pfT0vec.empty())
313  fcosmicT0[fNCOSMICS] = pfT0vec[0].Time();
314 
315  // Check if it is clear cosmic
317 
318  if(thisTrack != 0x0){
321  fcosmicID[fNCOSMICS] = thisTrack->ParticleId();
322  fcosmicTheta[fNCOSMICS] = thisTrack->Theta();
323  fcosmicPhi[fNCOSMICS] = thisTrack->Phi();
324  fcosmicLength[fNCOSMICS] = thisTrack->Length();
325  //fcosmicMomentum[fNCOSMICS] = thisTrack->StartMomentum();
326  //fcosmicEndMomentum[fNCOSMICS] = thisTrack->EndMomentum();
327  fcosmicEndPosition[fNCOSMICS][0] = thisTrack->Trajectory().End().X();
328  fcosmicEndPosition[fNCOSMICS][1] = thisTrack->Trajectory().End().Y();
329  fcosmicEndPosition[fNCOSMICS][2] = thisTrack->Trajectory().End().Z();
330  fcosmicStartPosition[fNCOSMICS][0] = thisTrack->Trajectory().Start().X();
331  fcosmicStartPosition[fNCOSMICS][1] = thisTrack->Trajectory().Start().Y();
332  fcosmicStartPosition[fNCOSMICS][2] = thisTrack->Trajectory().Start().Z();
333  fcosmicEndDirection[fNCOSMICS][0] = thisTrack->Trajectory().EndDirection().X();
334  fcosmicEndDirection[fNCOSMICS][1] = thisTrack->Trajectory().EndDirection().Y();
335  fcosmicEndDirection[fNCOSMICS][2] = thisTrack->Trajectory().EndDirection().Z();
336  fcosmicStartDirection[fNCOSMICS][0] = thisTrack->Trajectory().StartDirection().X();
337  fcosmicStartDirection[fNCOSMICS][1] = thisTrack->Trajectory().StartDirection().Y();
338  fcosmicStartDirection[fNCOSMICS][2] = thisTrack->Trajectory().StartDirection().Z();
339 
342 
343  // Calorimetry
344  std::vector<anab::Calorimetry> calovector = trackUtil.GetRecoTrackCalorimetry(*thisTrack, evt, fTrackerTag, fCalorimetryTag);
345  if(calovector.size() != 3)
346  std::cerr << "WARNING::Calorimetry vector size for cosmic is = " << calovector.size() << std::endl;
347 
348  for(size_t k = 0; k < calovector.size() && k<3; k++){
349  int plane = calovector[k].PlaneID().Plane;
350  if(plane < 0) continue;
351  if(plane > 2) continue;
352  fcosmicKineticEnergy[fNCOSMICS][plane] = calovector[k].KineticEnergy();
353  fcosmicRange[fNCOSMICS][plane] = calovector[k].Range();
354  fcosmicTrkPitchC[fNCOSMICS][plane] = calovector[k].TrkPitchC();
355  }
356 
357  // PID
358  std::vector<anab::ParticleID> pids = trackUtil.GetRecoTrackPID(*thisTrack, evt, fTrackerTag, fParticleIDTag);
359  if(pids.size() != 3)
360  std::cerr << "WARNING::PID vector size for primary is = " << pids.size() << std::endl;
361 
362  for(size_t k = 0; k < pids.size() && k<3; k++){
363  int plane = pids[k].PlaneID().Plane;
364  if(plane < 0) continue;
365  if(plane > 2) continue;
366  fcosmicPID_Pdg[fNCOSMICS][plane] = pids[plane].Pdg();
367  fcosmicPID_Ndf[fNCOSMICS][plane] = pids[plane].Ndf();
368  fcosmicPID_MinChi2[fNCOSMICS][plane] = pids[plane].MinChi2();
369  fcosmicPID_DeltaChi2[fNCOSMICS][plane] = pids[plane].DeltaChi2();
370  fcosmicPID_Chi2Proton[fNCOSMICS][plane] = pids[plane].Chi2Proton();
371  fcosmicPID_Chi2Kaon[fNCOSMICS][plane] = pids[plane].Chi2Kaon();
372  fcosmicPID_Chi2Pion[fNCOSMICS][plane] = pids[plane].Chi2Pion();
373  fcosmicPID_Chi2Muon[fNCOSMICS][plane] = pids[plane].Chi2Muon();
374  fcosmicPID_MissingE[fNCOSMICS][plane] = pids[plane].MissingE();
375  fcosmicPID_MissingEavg[fNCOSMICS][plane] = pids[plane].MissingEavg();
376  fcosmicPID_PIDA[fNCOSMICS][plane] = pids[plane].PIDA();
377  }
378 
379  }
380  else if(thisShower != 0x0){
383 
384  fcosmicID[fNCOSMICS] = thisShower->ID();
385  fcosmicLength[fNCOSMICS] = thisShower->Length();
387  fcosmicOpeningAngle[fNCOSMICS] = thisShower->OpenAngle();
388  fcosmicStartPosition[fNCOSMICS][0] = thisShower->ShowerStart().X();
389  fcosmicStartPosition[fNCOSMICS][1] = thisShower->ShowerStart().Y();
390  fcosmicStartPosition[fNCOSMICS][2] = thisShower->ShowerStart().Z();
391  fcosmicStartDirection[fNCOSMICS][0] = thisShower->Direction().X();
392  fcosmicStartDirection[fNCOSMICS][1] = thisShower->Direction().Y();
393  fcosmicStartDirection[fNCOSMICS][2] = thisShower->Direction().Z();
394  }
395  else{
396  std::cout << "INFO::Cosmic pfParticle is not track or shower. Skip!" << std::endl;
397  continue;
398  }
399 
400  // Increment number of cosmic tracks
401  fNCOSMICS++;
402 
403  }
404 
405  fPandoraCosmics->Fill();
406 
407 }
408 
410 
411  fRun = -999;
412  fSubRun = -999;
413  fevent = -999;
414  fTimeStamp = -999.0;
415  for(int k=0; k < 5; k++)
416  fNactivefembs[k] = -999;
417 
418  // Cosmics tree
419  fNCOSMICS = 0;
420  for(int k=0; k < NMAXCOSMICPARTICLES; k++){
421  fcosmicIsClear[k] = -999;
422  fcosmicNHits[k] = -999;
423  fcosmicBDTScore[k] = -999.0;
424  fiscosmictrack[k] = -999;
425  fiscosmicshower[k] = -999;
426  fcosmicID[k] = -999;
427  fcosmicTheta[k] = -999.0;
428  fcosmicPhi[k] = -999.0;
429  fcosmicLength[k] = -999.0;
430  //fcosmicMomentum[k] = -999.0;
431  //fcosmicEndMomentum[k] = -999.0;
432  fcosmicMomentumByRangeMuon[k] = -999.0;
434  fcosmicT0[k] = -999.0;
435  fcosmicShowerBestPlane[k] = -999.0;
436  fcosmicOpeningAngle[k] = -999.0;
437 
438  for(int l=0; l < 3; l++){
439  fcosmicEndPosition[k][l] = -999.0;
440  fcosmicStartPosition[k][l] = -999.0;
441  fcosmicEndDirection[k][l] = -999.0;
442  fcosmicStartDirection[k][l] = -999.0;
443  fcosmicKineticEnergy[k][l] = -999.0;
444  fcosmicRange[k][l] = -999.0;
445  fcosmicTrkPitchC[k][l] = -999.0;
446 
447  fcosmicPID_Pdg[k][l] = -999.0;
448  fcosmicPID_Ndf[k][l] = -999.0;
449  fcosmicPID_MinChi2[k][l] = -999.0;
450  fcosmicPID_DeltaChi2[k][l] = -999.0;
451  fcosmicPID_Chi2Proton[k][l] = -999.0;
452  fcosmicPID_Chi2Kaon[k][l] = -999.0;
453  fcosmicPID_Chi2Pion[k][l] = -999.0;
454  fcosmicPID_Chi2Muon[k][l] = -999.0;
455  fcosmicPID_MissingE[k][l] = -999.0;
456  fcosmicPID_MissingEavg[k][l] = -999.0;
457  fcosmicPID_PIDA[k][l] = -999.0;
458  }
459  }
460 
461 }
462 
464 
double fcosmicMomentumByRangeMuon[NMAXCOSMICPARTICLES]
int best_plane() const
Definition: Shower.h:200
const TVector3 & ShowerStart() const
Definition: Shower.h:192
std::vector< anab::ParticleID > GetRecoTrackPID(const recob::Track &track, art::Event const &evt, const std::string trackModule, const std::string pidModule) const
Get the PID from a given track.
double fcosmicPID_Chi2Kaon[NMAXCOSMICPARTICLES][3]
constexpr std::uint32_t timeLow() const
Definition: Timestamp.h:29
bool IsBeamParticle(const recob::PFParticle &particle, art::Event const &evt, const std::string particleLabel) const
Use the pandora metadata to tell us if this is a beam particle or not.
protoana::ProtoDUNEPFParticleUtils pfpUtil
double fcosmicPID_Chi2Proton[NMAXCOSMICPARTICLES][3]
std::vector< anab::T0 > GetPFParticleT0(const recob::PFParticle &particle, art::Event const &evt, std::string particleLabel) const
Get the T0(s) from a given PFParticle.
ProtoDUNEAnalCosmicTree(fhicl::ParameterSet const &p)
double fcosmicStartPosition[NMAXCOSMICPARTICLES][3]
double fcosmicPID_MinChi2[NMAXCOSMICPARTICLES][3]
double Length() const
Definition: Shower.h:201
int ParticleId() const
Definition: Track.h:171
const recob::Shower * GetPFParticleShower(const recob::PFParticle &particle, art::Event const &evt, const std::string particleLabel, const std::string showerLabel) const
Get the shower associated to this particle. Returns a null pointer if not found.
std::string string
Definition: nybbler.cc:12
const recob::TrackTrajectory & Trajectory() const
Access to the stored recob::TrackTrajectory.
Definition: Track.h:98
std::vector< anab::Calorimetry > GetRecoTrackCalorimetry(const recob::Track &track, art::Event const &evt, const std::string trackModule, const std::string caloModule) const
Get the Calorimetry(s) from a given reco track.
constexpr std::uint32_t timeHigh() const
Definition: Timestamp.h:34
double fcosmicPID_PIDA[NMAXCOSMICPARTICLES][3]
const std::vector< const recob::Hit * > GetPFParticleHits(const recob::PFParticle &particle, art::Event const &evt, const std::string particleLabel) const
Get the hits associated to the PFParticle.
bool IsClearCosmic(const recob::PFParticle &particle, art::Event const &evt, const std::string particleLabel) const
Pandora tags and removes clear cosmics before slicing, so check if this particle is a clear cosmic...
STL namespace.
double fcosmicKineticEnergy[NMAXCOSMICPARTICLES][3]
EDAnalyzer(fhicl::ParameterSet const &pset)
Definition: EDAnalyzer.h:25
Particle class.
double fcosmicStartDirection[NMAXCOSMICPARTICLES][3]
static QStrList * l
Definition: config.cpp:1044
const int NMAXCOSMICPARTICLES
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
Definition: StdUtils.h:92
bool isRealData() const
double Phi() const
Definition: Track.h:178
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
double fcosmicMomentumByRangeProton[NMAXCOSMICPARTICLES]
double Theta() const
Access to spherical or geographical angles at vertex or at any point.
Definition: Track.h:176
const recob::Track * GetPFParticleTrack(const recob::PFParticle &particle, art::Event const &evt, const std::string particleLabel, const std::string trackLabel) const
Get the track associated to this particle. Returns a null pointer if not found.
double fcosmicEndDirection[NMAXCOSMICPARTICLES][3]
double OpenAngle() const
Definition: Shower.h:202
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
Definition: DataViewImpl.h:441
p
Definition: test.py:223
SubRunNumber_t subRun() const
Definition: DataViewImpl.cc:78
double fcosmicPID_MissingE[NMAXCOSMICPARTICLES][3]
bool IsPrimary() const
Returns whether the particle is the root of the flow.
Definition: PFParticle.h:86
const TVector3 & Direction() const
Definition: Shower.h:189
RunNumber_t run() const
Definition: DataViewImpl.cc:71
double fcosmicEndPosition[NMAXCOSMICPARTICLES][3]
void analyze(art::Event const &evt) override
Vector_t EndDirection() const
Returns the direction of the trajectory at the last point.
double fcosmicPID_MissingEavg[NMAXCOSMICPARTICLES][3]
Declaration of signal hit object.
ProtoDUNEAnalCosmicTree & operator=(ProtoDUNEAnalCosmicTree const &)=delete
Hierarchical representation of particle flow.
Definition: PFParticle.h:44
int GetNActiveFembsForAPA(art::Event const &evt, int apa) const
Get number of active fembs in an APA.
Point_t const & End() const
Returns the position of the last valid point of the trajectory [cm].
Provides recob::Track data product.
double fcosmicPID_DeltaChi2[NMAXCOSMICPARTICLES][3]
EventNumber_t event() const
Definition: EventID.h:116
TCEvent evt
Definition: DataStructs.cxx:7
auto const & get(AssnsNode< L, R, D > const &r)
Definition: AssnsNode.h:115
unsigned int GetNumberPrimaryPFParticle(art::Event const &evt, const std::string particleLabel) const
Get the number of primary PFParticles.
double fcosmicPID_Chi2Muon[NMAXCOSMICPARTICLES][3]
double fcosmicTrkPitchC[NMAXCOSMICPARTICLES][3]
Vector_t StartDirection() const
Returns the direction of the trajectory at the first point.
Point_t const & Start() const
Returns the position of the first valid point of the trajectory [cm].
double fcosmicPID_Chi2Pion[NMAXCOSMICPARTICLES][3]
int ID() const
Definition: Shower.h:187
float GetBeamCosmicScore(const recob::PFParticle &particle, art::Event const &evt, const std::string particleLabel) const
Access the BDT output used to decide if a slice is beam-like or cosmic-like.
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
double GetTrackMomentum(double trkrange, int pdg) const
QTextStream & endl(QTextStream &s)