All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Attributes | List of all members
sbn::TrackHitFilter Class Reference
Inheritance diagram for sbn::TrackHitFilter:

Public Member Functions

 TrackHitFilter (fhicl::ParameterSet const &p)
 
 TrackHitFilter (TrackHitFilter const &)=delete
 
 TrackHitFilter (TrackHitFilter &&)=delete
 
TrackHitFilteroperator= (TrackHitFilter const &)=delete
 
TrackHitFilteroperator= (TrackHitFilter &&)=delete
 
void produce (art::Event &e) override
 

Private Attributes

art::InputTag fTrackLabel
 
bool fPassBadHits
 

Detailed Description

Definition at line 42 of file TrackHitFilter_module.cc.

Constructor & Destructor Documentation

sbn::TrackHitFilter::TrackHitFilter ( fhicl::ParameterSet const &  p)
explicit

Definition at line 64 of file TrackHitFilter_module.cc.

65  : EDProducer{p},
66  fTrackLabel(p.get<art::InputTag>("TrackLabel", "pandoraTrack")),
67  fPassBadHits(p.get<bool>("PassBadHits", false))
68 {
69  produces<std::vector<recob::Hit>>();
70  produces<art::Assns<recob::Track, recob::Hit, recob::TrackHitMeta>>();
71  // produces<art::Assns<recob::Wire, recob::Hit>>();
72 }
pdgs p
Definition: selectors.fcl:22
sbn::TrackHitFilter::TrackHitFilter ( TrackHitFilter const &  )
delete
sbn::TrackHitFilter::TrackHitFilter ( TrackHitFilter &&  )
delete

Member Function Documentation

TrackHitFilter& sbn::TrackHitFilter::operator= ( TrackHitFilter const &  )
delete
TrackHitFilter& sbn::TrackHitFilter::operator= ( TrackHitFilter &&  )
delete
void sbn::TrackHitFilter::produce ( art::Event &  e)
override

Definition at line 74 of file TrackHitFilter_module.cc.

75 {
76  // output data products
77  std::unique_ptr<art::Assns<recob::Track, recob::Hit, recob::TrackHitMeta>> assn(new art::Assns<recob::Track, recob::Hit, recob::TrackHitMeta>);
78  std::unique_ptr<std::vector<recob::Hit>> outHits(new std::vector<recob::Hit>);
79  // std::unique_ptr<art::Assns<recob::Wire, recob::Hit>> wireAssn(new art::Assns<recob::Wire, recob::Hit>);
80 
81  art::PtrMaker<recob::Hit> hitPtrMaker{e};
82 
83  // input data
84  art::Handle<std::vector<recob::Track>> track_handle;
85  e.getByLabel(fTrackLabel, track_handle);
86 
87  std::vector<art::Ptr<recob::Track>> tracks;
88  art::fill_ptr_vector(tracks, track_handle);
89 
90  art::FindManyP<recob::Hit, recob::TrackHitMeta> fmHits(tracks, e, fTrackLabel);
91 
92  for (unsigned i = 0; i < tracks.size(); i++) {
93  const recob::Track &track = *tracks[i];
94 
95  // get the input hits
96  const std::vector<art::Ptr<recob::Hit>> &trkHits = fmHits.at(i);
97  const std::vector<const recob::TrackHitMeta*> &trkHitMetas = fmHits.data(i);
98 
99  for (unsigned i_hit = 0; i_hit < trkHits.size(); i_hit++) {
100  const recob::Hit &hit = *trkHits[i_hit];
101  const recob::TrackHitMeta &meta = *trkHitMetas[i_hit];
102 
103  // figure out if bad hit -- copy of what Calorimetry module does
104  bool badhit = (meta.Index() == std::numeric_limits<unsigned int>::max()) ||
105  (!track.HasValidPoint(meta.Index()));
106  if (!badhit || fPassBadHits) {
107  // save to output data
108  outHits->push_back(hit);
109  art::Ptr<recob::Hit> thisHitPtr = hitPtrMaker(outHits->size()-1);
110  // add to the association
111  assn->addSingle(tracks[i], thisHitPtr, meta);
112  // wireAssn->addSingle(hitWires.at(i_hit).at(0), thisHitPtr);
113  }
114  }
115  }
116 
117  e.put(std::move(outHits));
118  e.put(std::move(assn));
119  // e.put(std::move(wireAssn));
120 
121 }
ClusterModuleLabel join with tracks
bool HasValidPoint(size_t i) const
process_name use argoneut_mc_hitfinder track
Data related to recob::Hit associated with recob::Track.The purpose is to collect several variables t...
Definition: TrackHitMeta.h:43
process_name hit
Definition: cheaterreco.fcl:51
do i e
unsigned int Index() const
Hit index along the track trajectory.
Definition: TrackHitMeta.h:55
2D representation of charge deposited in the TDC/wire plane
Definition: Hit.h:48
Track from a non-cascading particle.A recob::Track consists of a recob::TrackTrajectory, plus additional members relevant for a &quot;fitted&quot; track:

Member Data Documentation

bool sbn::TrackHitFilter::fPassBadHits
private

Definition at line 60 of file TrackHitFilter_module.cc.

art::InputTag sbn::TrackHitFilter::fTrackLabel
private

Definition at line 59 of file TrackHitFilter_module.cc.


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