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

Public Member Functions

 HitRepeater (fhicl::ParameterSet const &pset)
 
void reconfigure (fhicl::ParameterSet const &p)
 
void produce (art::Event &evt)
 
void beginJob ()
 
void endJob ()
 
- 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

art::ServiceHandle< geo::Geometrygeom
 
std::string fChanHitLabel
 

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 HitRepeater_module.cc.

Constructor & Destructor Documentation

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

Definition at line 64 of file HitRepeater_module.cc.

65  : EDProducer(pset) {
66  this->reconfigure(pset);
67  // let HitCollectionCreator declare that we are going to produce
68  // hits and associations with wires and raw digits
69  // (with no particular product label)
71  }
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::HitRepeater::beginJob ( )
inlinevirtual

Reimplemented from art::EDProducer.

Definition at line 54 of file HitRepeater_module.cc.

54 {}
void dune::HitRepeater::endJob ( )
inlinevirtual

Reimplemented from art::EDProducer.

Definition at line 55 of file HitRepeater_module.cc.

55 {}
void dune::HitRepeater::produce ( art::Event evt)
virtual

Implements art::EDProducer.

Definition at line 77 of file HitRepeater_module.cc.

77  {
78  auto ChannelHits = evt.getHandle< std::vector<recob::Hit> >(fChanHitLabel);
79 
80  // also get the associated wires and raw digits;
81  // we assume they have been created by the same module as the hits
82  art::FindOneP<raw::RawDigit> ChannelHitRawDigits(ChannelHits, evt, fChanHitLabel);
83  art::FindOneP<recob::Wire> ChannelHitWires (ChannelHits, evt, fChanHitLabel);
84 
85  // this object contains the hit collection
86  // and its associations to wires and raw digits:
88  ChannelHitWires.isValid(), // doWireAssns
89  ChannelHitRawDigits.isValid() // doRawDigitAssns
90  );
91 
92  // Make hits collection
93  std::vector< art::Ptr<recob::Hit> > ChHits;
94  art::fill_ptr_vector(ChHits, ChannelHits);
95 
96  for( size_t h = 0; h < ChHits.size(); h++ ) {
97  std::vector<geo::WireID> cwids = geom->ChannelToWire(ChHits[h]->Channel());
98  for(size_t w = 0; w < cwids.size(); w++) {
99  art::Ptr<recob::Hit> hit = ChHits[h];
100  geo::WireID wid = cwids[w];
101  recob::HitCreator repeated_hit(*hit, wid);
102  art::Ptr<recob::Hit>::key_type hit_index = hit.key();
103  art::Ptr<recob::Wire> wire = ChannelHitWires.at(hit_index);
104  art::Ptr<raw::RawDigit> rawdigits = ChannelHitRawDigits.at(hit_index);
105 
106  hcol.emplace_back(repeated_hit.move(), wire, rawdigits);
107  }
108  }
109 
110  // put the hit collection and associations into the event
111  hcol.put_into(evt);
112  }
Handle< PROD > getHandle(SelectorBase const &) const
Definition: DataViewImpl.h:382
std::vector< geo::WireID > ChannelToWire(raw::ChannelID_t const channel) const
Returns a list of wires connected to the specified TPC channel.
std::size_t key_type
Definition: Ptr.h:79
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
Detector simulation of raw signals on wires.
art::ServiceHandle< geo::Geometry > geom
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
Definition: Ptr.h:297
void dune::HitRepeater::reconfigure ( fhicl::ParameterSet const &  p)

Definition at line 73 of file HitRepeater_module.cc.

73  {
74  fChanHitLabel = p.get< std::string >("ChanHitLabel");
75  }
std::string string
Definition: nybbler.cc:12
p
Definition: test.py:223

Member Data Documentation

std::string dune::HitRepeater::fChanHitLabel
private

Definition at line 59 of file HitRepeater_module.cc.

art::ServiceHandle<geo::Geometry> dune::HitRepeater::geom
private

Definition at line 58 of file HitRepeater_module.cc.


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