All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Member Functions | Private Attributes | List of all members
sbnd::PandoraT0CosmicIdAlg Class Reference

#include <PandoraT0CosmicIdAlg.h>

Classes

struct  BeamTime
 
struct  Config
 

Public Member Functions

 PandoraT0CosmicIdAlg (const Config &config)
 
 PandoraT0CosmicIdAlg (const fhicl::ParameterSet &pset)
 
 ~PandoraT0CosmicIdAlg ()
 
void reconfigure (const Config &config)
 
bool PandoraT0CosmicId (recob::Track track, const art::Event &event)
 
bool PandoraT0CosmicId (recob::PFParticle pfparticle, std::map< size_t, art::Ptr< recob::PFParticle > > pfParticleMap, const art::Event &event)
 

Private Attributes

art::InputTag fPandoraLabel
 
art::InputTag fTpcTrackModuleLabel
 
double fBeamTimeMin
 
double fBeamTimeMax
 

Detailed Description

Definition at line 34 of file sbndcode/sbndcode/CosmicId/Algs/PandoraT0CosmicIdAlg.h.

Constructor & Destructor Documentation

sbnd::PandoraT0CosmicIdAlg::PandoraT0CosmicIdAlg ( const Config config)

Definition at line 5 of file sbndcode/sbndcode/CosmicId/Algs/PandoraT0CosmicIdAlg.cc.

5  {
6 
7  this->reconfigure(config);
8 
9 }
sbnd::PandoraT0CosmicIdAlg::PandoraT0CosmicIdAlg ( const fhicl::ParameterSet &  pset)
inline

Definition at line 76 of file sbndcode/sbndcode/CosmicId/Algs/PandoraT0CosmicIdAlg.h.

76  :
77  PandoraT0CosmicIdAlg(fhicl::Table<Config>(pset, {})()) {}
sbnd::PandoraT0CosmicIdAlg::~PandoraT0CosmicIdAlg ( )

Definition at line 17 of file sbndcode/sbndcode/CosmicId/Algs/PandoraT0CosmicIdAlg.cc.

17  {
18 
19 }

Member Function Documentation

bool sbnd::PandoraT0CosmicIdAlg::PandoraT0CosmicId ( recob::Track  track,
const art::Event &  event 
)

Definition at line 33 of file sbndcode/sbndcode/CosmicId/Algs/PandoraT0CosmicIdAlg.cc.

33  {
34 
35  // Get the pfps and associations
36  art::Handle< std::vector<recob::PFParticle> > pfParticleHandle;
37  event.getByLabel(fPandoraLabel, pfParticleHandle);
38  art::FindManyP<recob::Track> pfPartToTrackAssoc(pfParticleHandle, event, fTpcTrackModuleLabel);
39  art::FindManyP<anab::T0> findManyT0(pfParticleHandle, event, fPandoraLabel);
40 
41  // Loop over all the pfps
42  for(auto const pfp : (*pfParticleHandle)){
43  // Get the associated track if there is one
44  const std::vector< art::Ptr<recob::Track> > associatedTracks(pfPartToTrackAssoc.at(pfp.Self()));
45  if(associatedTracks.size() != 1) continue;
46  recob::Track trk = *associatedTracks.front();
47  if(trk.ID() != track.ID()) continue;
48  // Get the associated t0
49  const std::vector< art::Ptr<anab::T0> > associatedT0s(findManyT0.at(pfp.Self()));
50 
51  // If any t0 outside of beam limits then remove
52  for(size_t i = 0; i < associatedT0s.size(); i++){
53  double pandoraTime = associatedT0s[i]->Time()*1e-3; // [us]
54  if(pandoraTime < fBeamTimeMin || pandoraTime > fBeamTimeMax) return true;
55  }
56  }
57 
58  return false;
59 
60 }
do i e
Track from a non-cascading particle.A recob::Track consists of a recob::TrackTrajectory, plus additional members relevant for a &quot;fitted&quot; track:
bool sbnd::PandoraT0CosmicIdAlg::PandoraT0CosmicId ( recob::PFParticle  pfparticle,
std::map< size_t, art::Ptr< recob::PFParticle > >  pfParticleMap,
const art::Event &  event 
)

Definition at line 63 of file sbndcode/sbndcode/CosmicId/Algs/PandoraT0CosmicIdAlg.cc.

63  {
64 
65  // Get pfp associations to t0s
66  art::Handle< std::vector<recob::PFParticle> > pfParticleHandle;
67  event.getByLabel(fPandoraLabel, pfParticleHandle);
68  art::FindManyP<anab::T0> findManyT0(pfParticleHandle, event, fPandoraLabel);
69 
70  // Loop over daughters
71  for (const size_t daughterId : pfparticle.Daughters()){
72  // Get associated t0s
73  art::Ptr<recob::PFParticle> pParticle = pfParticleMap.at(daughterId);
74  const std::vector< art::Ptr<anab::T0> > associatedT0s(findManyT0.at(pParticle.key()));
75 
76  // If any t0 outside of beam limits then remove
77  for(size_t i = 0; i < associatedT0s.size(); i++){
78  double pandoraTime = associatedT0s[i]->Time()*1e-3; // [us]
79  if(pandoraTime < fBeamTimeMin || pandoraTime > fBeamTimeMax) return true;
80  }
81  }
82 
83  return false;
84 
85 }
const std::vector< size_t > & Daughters() const
Returns the collection of daughter particles.
Definition: PFParticle.h:114
do i e
void sbnd::PandoraT0CosmicIdAlg::reconfigure ( const Config config)

Definition at line 22 of file sbndcode/sbndcode/CosmicId/Algs/PandoraT0CosmicIdAlg.cc.

22  {
23 
24  fPandoraLabel = config.PandoraLabel();
25  fTpcTrackModuleLabel = config.TpcTrackModuleLabel();
26  fBeamTimeMin = config.BeamTimeLimits().BeamTimeMin();
27  fBeamTimeMax = config.BeamTimeLimits().BeamTimeMax();
28 
29  return;
30 }

Member Data Documentation

double sbnd::PandoraT0CosmicIdAlg::fBeamTimeMax
private
double sbnd::PandoraT0CosmicIdAlg::fBeamTimeMin
private
art::InputTag sbnd::PandoraT0CosmicIdAlg::fPandoraLabel
private
art::InputTag sbnd::PandoraT0CosmicIdAlg::fTpcTrackModuleLabel
private

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