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

Public Member Functions

 HitFinderProtoDUNESP (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

DisambigAlgProtoDUNESP fDisambigAlg
 
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 48 of file HitFinderProtoDUNESP_module.cc.

Constructor & Destructor Documentation

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

Definition at line 77 of file HitFinderProtoDUNESP_module.cc.

77  :
78  EDProducer(pset),
79  fDisambigAlg(pset.get< fhicl::ParameterSet >("DisambigAlg"))
80  {
81  this->reconfigure(pset);
82 
83  // let HitCollectionCreator declare that we are going to produce
84  // hits and associations with wires and raw digits
85  // (with no particular product label)
87  }
EDProducer(fhicl::ParameterSet const &pset)
Definition: EDProducer.h:20
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
void reconfigure(fhicl::ParameterSet const &p)

Member Function Documentation

void dune::HitFinderProtoDUNESP::beginJob ( )
virtual

Reimplemented from art::EDProducer.

Definition at line 102 of file HitFinderProtoDUNESP_module.cc.

103  {
104 
105  }
void dune::HitFinderProtoDUNESP::endJob ( )
virtual

Reimplemented from art::EDProducer.

Definition at line 109 of file HitFinderProtoDUNESP_module.cc.

110  {
111 
112  }
void dune::HitFinderProtoDUNESP::produce ( art::Event evt)
virtual

Implements art::EDProducer.

Definition at line 116 of file HitFinderProtoDUNESP_module.cc.

117  {
118 
119  auto ChannelHits = evt.getValidHandle<std::vector<recob::Hit>>(fChanHitLabel);
120 
121  // also get the associated wires and raw digits;
122  // we assume they have been created by the same module as the hits
123  art::FindOneP<raw::RawDigit> ChannelHitRawDigits
124  (ChannelHits, evt, fChanHitLabel);
125  art::FindOneP<recob::Wire> ChannelHitWires
126  (ChannelHits, evt, fChanHitLabel);
127 
128  // this object contains the hit collection
129  // and its associations to wires and raw digits:
131  /* doWireAssns */ ChannelHitWires.isValid(),
132  /* doRawDigitAssns */ ChannelHitRawDigits.isValid()
133  );
134 
135  // Make unambiguous collection hits
136  std::vector< art::Ptr<recob::Hit> > ChHits;
137  art::fill_ptr_vector(ChHits, ChannelHits);
138  for( size_t h = 0; h < ChHits.size(); h++ ){
139  if( ChHits[h]->View() != geo::kZ ) continue;
140 
141  art::Ptr<recob::Wire> wire = ChannelHitWires.at(h);
142  art::Ptr<raw::RawDigit> rawdigits = ChannelHitRawDigits.at(h);
143 
144  // just copy it
145  hcol.emplace_back(*ChHits[h], wire, rawdigits);
146 
147  } // for
148 
149  // Run alg on all APAs -- check fAlg if we have more than one algorithm defined (future expansion)
150  auto const detProp = art::ServiceHandle<detinfo::DetectorPropertiesService const>()->DataFor(evt);
151  fDisambigAlg.RunDisambig(detProp, ChHits);
152 
153  for( size_t t=0; t < fDisambigAlg.fDisambigHits.size(); t++ ){
155  geo::WireID wid = fDisambigAlg.fDisambigHits[t].second;
156 
157  // create a new hit copy of the original one, but with new wire ID
158  recob::HitCreator disambiguous_hit(*hit, wid);
159 
160  // get the objects associated with the original hit;
161  // since hit comes from ChannelHits, its key is the index in that collection
162  // and also the index for the query of associated objects
163  art::Ptr<recob::Hit>::key_type hit_index = hit.key();
164  art::Ptr<recob::Wire> wire = ChannelHitWires.at(hit_index);
165  art::Ptr<raw::RawDigit> rawdigits = ChannelHitRawDigits.at(hit_index);
166 
167  hcol.emplace_back(disambiguous_hit.move(), wire, rawdigits);
168  } // for
169 
170 
171  // put the hit collection and associations into the event
172  hcol.put_into(evt);
173 
174  }
AdcChannelData::View View
Planes which measure Z direction.
Definition: geo_types.h:132
std::size_t key_type
Definition: Ptr.h:79
void RunDisambig(detinfo::DetectorPropertiesData const &detProp, const std::vector< art::Ptr< recob::Hit > > &OrigHits)
Run disambiguation as currently configured.
Class managing the creation of a new recob::Hit object.
Definition: HitCreator.h:83
std::vector< std::pair< art::Ptr< recob::Hit >, geo::WireID > > fDisambigHits
The final list of hits to pass back to be made.
A class handling a collection of hits and its associations.
Definition: HitCreator.h:508
key_type key() const noexcept
Definition: Ptr.h:216
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
Definition: DataViewImpl.h:441
Detector simulation of raw signals on wires.
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
Definition: Ptr.h:297
void dune::HitFinderProtoDUNESP::reconfigure ( fhicl::ParameterSet const &  p)

Definition at line 92 of file HitFinderProtoDUNESP_module.cc.

93  {
94 
95  fChanHitLabel = p.get< std::string >("ChanHitLabel");
96  fAlg = p.get < std::string >("Algorithm"); // switch on which algorithm to run
97 
98  }
std::string string
Definition: nybbler.cc:12
p
Definition: test.py:223

Member Data Documentation

std::string dune::HitFinderProtoDUNESP::fAlg
private

Definition at line 67 of file HitFinderProtoDUNESP_module.cc.

std::string dune::HitFinderProtoDUNESP::fChanHitLabel
private

Definition at line 66 of file HitFinderProtoDUNESP_module.cc.

DisambigAlgProtoDUNESP dune::HitFinderProtoDUNESP::fDisambigAlg
private

Definition at line 62 of file HitFinderProtoDUNESP_module.cc.

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

Definition at line 64 of file HitFinderProtoDUNESP_module.cc.


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