Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
recob::test::HitCollectionCreatorTest Class Reference

Test module for recob::HitCollector. More...

Inheritance diagram for recob::test::HitCollectionCreatorTest:
art::EDProducer art::detail::Producer art::detail::LegacyModule art::Modifier art::ModuleBase art::ProductRegistryHelper

Classes

struct  Config
 

Public Types

using Parameters = art::EDProducer::Table< Config >
 
- 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 >
 

Public Member Functions

 HitCollectionCreatorTest (Parameters const &config)
 
virtual void produce (art::Event &event) override
 
- 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 Member Functions

void produceHits (art::Event &event, std::string instanceName)
 Produces a collection of hits and stores it into the event. More...
 

Private Attributes

recob::HitCollectionCreatorManager hitCollManager
 
std::string fInstanceName
 Instance name to be used for products. More...
 

Additional Inherited Members

- 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

Test module for recob::HitCollector.

Currently exercises:

Todo:

Throws an exception on failure.

Service requirements

This module requires no service.

Configuration parameters

Definition at line 51 of file HitCollectionCreatorTest_module.cc.

Member Typedef Documentation

Definition at line 68 of file HitCollectionCreatorTest_module.cc.

Constructor & Destructor Documentation

recob::test::HitCollectionCreatorTest::HitCollectionCreatorTest ( Parameters const &  config)
explicit

Definition at line 100 of file HitCollectionCreatorTest_module.cc.

102  , hitCollManager(
103  producesCollector(), config().instanceName(),
104  false /* doWireAssns */, false /* doRawDigitAssns */
105  ) // produces<>() hit collections
106  {}
static Config * config
Definition: config.cpp:1054
recob::HitCollectionCreatorManager hitCollManager
ProducesCollector & producesCollector() noexcept

Member Function Documentation

void recob::test::HitCollectionCreatorTest::produce ( art::Event event)
overridevirtual

Implements art::EDProducer.

Definition at line 110 of file HitCollectionCreatorTest_module.cc.

110  {
111  produceHits(event, fInstanceName);
112 } // HitCollectionCreatorTest::produce()
std::string fInstanceName
Instance name to be used for products.
void produceHits(art::Event &event, std::string instanceName)
Produces a collection of hits and stores it into the event.
void recob::test::HitCollectionCreatorTest::produceHits ( art::Event event,
std::string  instanceName 
)
private

Produces a collection of hits and stores it into the event.

Definition at line 117 of file HitCollectionCreatorTest_module.cc.

118 {
119 
120  // this object will contain al the hits until they are moved into the event;
121  // while it's useful to test the creation of the associations, that is too
122  // onerous for this test
123  auto Hits = hitCollManager.collectionWriter(event);
124 
125  // create hits, one by one
126  for (double time: { 0.0, 200.0, 400.0 }) {
128  recob::Hit(
129  raw::InvalidChannelID, /* channel */
130  raw::TDCtick_t(1000 + time), /* start_tick */
131  raw::TDCtick_t(1010 + time), /* end_tick */
132  time, /* peak_time */
133  1.0, /* sigma_peak_time */
134  5.0, /* rms */
135  100.0, /* peak_amplitude */
136  1.0, /* sigma_peak_amplitude */
137  500.0, /* summedADC */
138  500.0, /* hit_integral */
139  1.0, /* hit_sigma_integral */
140  1, /* multiplicity */
141  0, /* local_index */
142  1.0, /* goodness_of_fit */
143  7, /* dof */
144  geo::kUnknown, /* view */
145  geo::kMysteryType, /* signal_type */
146  geo::WireID{} /* wireID */
147  )
148  );
149  } // for hits
150 
151  Hits.put_into(event);
152 
153 } // recob::test::HitCollectionCreatorTest::produceHits()
Who knows?
Definition: geo_types.h:147
Writer_t collectionWriter(art::Event &event) const
Returns a new writer already configured.
Definition: HitCreator.h:1106
Unknown view.
Definition: geo_types.h:136
void emplace_back(Args &&...args)
Definition: PtrVector.h:448
int TDCtick_t
Type representing a TDC tick.
Definition: RawTypes.h:25
constexpr ChannelID_t InvalidChannelID
ID of an invalid channel.
Definition: RawTypes.h:32
recob::HitCollectionCreatorManager hitCollManager
art::PtrVector< recob::Hit > Hits
2D representation of charge deposited in the TDC/wire plane
Definition: Hit.h:48

Member Data Documentation

std::string recob::test::HitCollectionCreatorTest::fInstanceName
private

Instance name to be used for products.

Definition at line 80 of file HitCollectionCreatorTest_module.cc.

recob::HitCollectionCreatorManager recob::test::HitCollectionCreatorTest::hitCollManager
private

Definition at line 78 of file HitCollectionCreatorTest_module.cc.


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