Public Member Functions | Private Attributes | List of all members
dune::HitFinder35t Class Reference
Inheritance diagram for dune::HitFinder35t:
art::EDProducer art::detail::Producer art::detail::LegacyModule art::Modifier art::ModuleBase art::ProductRegistryHelper

Public Member Functions

 HitFinder35t (fhicl::ParameterSet const &pset)
 
void produce (art::Event &evt)
 
void beginJob ()
 
void endJob ()
 
void reconfigure (fhicl::ParameterSet const &p)
 
- Public Member Functions inherited from art::EDProducer
 EDProducer (fhicl::ParameterSet const &pset)
 
template<typename Config >
 EDProducer (Table< Config > const &config)
 
std::string workerType () const
 
- Public Member Functions inherited from art::detail::Producer
virtual ~Producer () noexcept
 
 Producer (fhicl::ParameterSet const &)
 
 Producer (Producer const &)=delete
 
 Producer (Producer &&)=delete
 
Produceroperator= (Producer const &)=delete
 
Produceroperator= (Producer &&)=delete
 
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::Modifier
 ~Modifier () noexcept
 
 Modifier ()
 
 Modifier (Modifier const &)=delete
 
 Modifier (Modifier &&)=delete
 
Modifieroperator= (Modifier const &)=delete
 
Modifieroperator= (Modifier &&)=delete
 
- 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

DisambigAlg35t fDisambigAlg
 
TimeBasedDisambig fTimeBasedDisambigAlg
 
art::ServiceHandle< geo::GeometryfGeom
 
std::string fChanHitLabel
 
std::string fAlg
 

Additional Inherited Members

- Public Types inherited from art::EDProducer
using ModuleType = EDProducer
 
using WorkerType = WorkerT< EDProducer >
 
- Public Types inherited from art::detail::Producer
template<typename UserConfig , typename KeysToIgnore = void>
using Table = Modifier::Table< UserConfig, KeysToIgnore >
 
- Public Types inherited from art::Modifier
template<typename UserConfig , typename UserKeysToIgnore = void>
using Table = ProducerTable< UserConfig, detail::ModuleConfig, UserKeysToIgnore >
 
- Static Public Member Functions inherited from art::EDProducer
static void commitEvent (EventPrincipal &ep, Event &e)
 
- 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 49 of file HitFinder35t_module.cc.

Constructor & Destructor Documentation

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

Definition at line 79 of file HitFinder35t_module.cc.

79  :
80  EDProducer(pset),
81  fDisambigAlg(pset.get< fhicl::ParameterSet >("DisambigAlg")),
82  fTimeBasedDisambigAlg(pset.get< fhicl::ParameterSet >("TimeBasedDisambigAlg"))
83  {
84  this->reconfigure(pset);
85 
86  // let HitCollectionCreator declare that we are going to produce
87  // hits and associations with wires and raw digits
88  // (with no particular product label)
90  }
void reconfigure(fhicl::ParameterSet const &p)
EDProducer(fhicl::ParameterSet const &pset)
Definition: EDProducer.h:20
TimeBasedDisambig fTimeBasedDisambigAlg
static void declare_products(art::ProducesCollector &collector, std::string instance_name="", bool doWireAssns=true, bool doRawDigitAssns=true)
Declares the hit products we are going to fill.
Definition: HitCreator.cxx:248
ProducesCollector & producesCollector() noexcept
DisambigAlg35t fDisambigAlg

Member Function Documentation

void dune::HitFinder35t::beginJob ( )
virtual

Reimplemented from art::EDProducer.

Definition at line 105 of file HitFinder35t_module.cc.

106  {
107 
108  }
void dune::HitFinder35t::endJob ( )
virtual

Reimplemented from art::EDProducer.

Definition at line 112 of file HitFinder35t_module.cc.

113  {
114 
115  }
void dune::HitFinder35t::produce ( art::Event evt)
virtual

Implements art::EDProducer.

Definition at line 119 of file HitFinder35t_module.cc.

120  {
121 
122  auto ChannelHits = evt.getHandle< std::vector<recob::Hit> >(fChanHitLabel);
123 
124  // also get the associated wires and raw digits;
125  // we assume they have been created by the same module as the hits
126 // art::FindOneP<raw::RawDigit> ChannelHitRawDigits
127 // (ChannelHits, evt, fChanHitLabel);
128  art::FindOneP<recob::Wire> ChannelHitWires
129  (ChannelHits, evt, fChanHitLabel);
130 
131  // this object contains the hit collection
132  // and its associations to wires and raw digits:
134  /* doWireAssns */ ChannelHitWires.isValid(),
135  /* doRawDigitAssns */ false
136  );
137 
138  // Make unambiguous collection hits
139  std::vector< art::Ptr<recob::Hit> > ChHits;
140  art::fill_ptr_vector(ChHits, ChannelHits);
141  for( size_t h = 0; h < ChHits.size(); h++ ){
142  if( ChHits[h]->View() != geo::kZ ) continue;
143 
144  art::Ptr<recob::Wire> wire = ChannelHitWires.at(h);
145  //art::Ptr<raw::RawDigit> rawdigits = ChannelHitRawDigits.at(h);
146 
147  // just copy it
148  hcol.emplace_back(*ChHits[h], wire);
149 
150  } // for
151 
152  // Run alg on all APAs
153  if (fAlg == "TripletMatch")
154  {
155  auto const clockData = art::ServiceHandle<detinfo::DetectorClocksService const>()->DataFor(evt);
156  auto const detProp = art::ServiceHandle<detinfo::DetectorPropertiesService const>()->DataFor(evt, clockData);
157  fDisambigAlg.RunDisambig(clockData, detProp, ChHits);
158 
159  for( size_t t=0; t < fDisambigAlg.fDisambigHits.size(); t++ ){
161  geo::WireID wid = fDisambigAlg.fDisambigHits[t].second;
162 
163  // create a new hit copy of the original one, but with new wire ID
164  recob::HitCreator disambiguous_hit(*hit, wid);
165 
166  // get the objects associated with the original hit;
167  // since hit comes from ChannelHits, its key is the index in that collection
168  // and also the index for the query of associated objects
169  art::Ptr<recob::Hit>::key_type hit_index = hit.key();
170  art::Ptr<recob::Wire> wire = ChannelHitWires.at(hit_index);
171  //art::Ptr<raw::RawDigit> rawdigits = ChannelHitRawDigits.at(hit_index);
172 
173  hcol.emplace_back(disambiguous_hit.move(), wire);
174  } // for
175 
176  }
177  else if (fAlg == "TimeBased")
178  {
180 
181  for( size_t t=0; t < fTimeBasedDisambigAlg.fDisambigHits.size(); t++ ){
184 
185  // create a new hit copy of the original one, but with new wire ID
186  recob::HitCreator disambiguous_hit(*hit, wid);
187 
188  // get the objects associated with the original hit;
189  // since hit comes from ChannelHits, its key is the index in that collection
190  // and also the index for the query of associated objects
191  art::Ptr<recob::Hit>::key_type hit_index = hit.key();
192  art::Ptr<recob::Wire> wire = ChannelHitWires.at(hit_index);
193  //art::Ptr<raw::RawDigit> rawdigits = ChannelHitRawDigits.at(hit_index);
194 
195  hcol.emplace_back(disambiguous_hit.move(), wire);
196  } // for
197 
198  }
199  else
200  {
201  throw cet::exception("HitFinder35t") << "Disambiguation algorithm name: " << fAlg << " is not supported.\n" ;
202  }
203 
204 
205  // put the hit collection and associations into the event
206  hcol.put_into(evt);
207 
208  }
AdcChannelData::View View
Handle< PROD > getHandle(SelectorBase const &) const
Definition: DataViewImpl.h:382
TimeBasedDisambig fTimeBasedDisambigAlg
Planes which measure Z direction.
Definition: geo_types.h:132
std::size_t key_type
Definition: Ptr.h:79
std::vector< std::pair< art::Ptr< recob::Hit >, geo::WireID > > fDisambigHits
The final list of hits to pass back to be made.
Class managing the creation of a new recob::Hit object.
Definition: HitCreator.h:83
A class handling a collection of hits and its associations.
Definition: HitCreator.h:508
key_type key() const noexcept
Definition: Ptr.h:216
void RunDisambig(detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, const std::vector< art::Ptr< recob::Hit > > &OrigHits)
Run disambiguation as currently configured.
std::vector< std::pair< art::Ptr< recob::Hit >, geo::WireID > > fDisambigHits
< Run disambiguation as currently configured
Detector simulation of raw signals on wires.
DisambigAlg35t fDisambigAlg
void RunDisambig(const std::vector< art::Ptr< recob::Hit > > &OrigHits)
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
Definition: Ptr.h:297
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
void dune::HitFinder35t::reconfigure ( fhicl::ParameterSet const &  p)

Definition at line 95 of file HitFinder35t_module.cc.

96  {
97 
98  fChanHitLabel = p.get< std::string >("ChanHitLabel");
99  fAlg = p.get < std::string >("Algorithm");
100 
101  }
std::string string
Definition: nybbler.cc:12
p
Definition: test.py:223

Member Data Documentation

std::string dune::HitFinder35t::fAlg
private

Definition at line 69 of file HitFinder35t_module.cc.

std::string dune::HitFinder35t::fChanHitLabel
private

Definition at line 68 of file HitFinder35t_module.cc.

DisambigAlg35t dune::HitFinder35t::fDisambigAlg
private

Definition at line 63 of file HitFinder35t_module.cc.

art::ServiceHandle<geo::Geometry> dune::HitFinder35t::fGeom
private

Definition at line 66 of file HitFinder35t_module.cc.

TimeBasedDisambig dune::HitFinder35t::fTimeBasedDisambigAlg
private

Definition at line 64 of file HitFinder35t_module.cc.


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