Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
arttest::PtrVectorSimpleAnalyzer Class Reference
Inheritance diagram for arttest::PtrVectorSimpleAnalyzer:
art::SharedAnalyzer art::detail::Analyzer art::detail::SharedModule art::Observer art::ModuleBase

Classes

struct  Config
 

Public Types

using Parameters = Table< Config >
 
- Public Types inherited from art::SharedAnalyzer
using WorkerType = WorkerT< SharedAnalyzer >
 
using ModuleType = SharedAnalyzer
 

Public Member Functions

 PtrVectorSimpleAnalyzer (Parameters const &p, art::ProcessingFrame const &)
 
- Public Member Functions inherited from art::SharedAnalyzer
 SharedAnalyzer (fhicl::ParameterSet const &pset)
 
template<typename Config >
 SharedAnalyzer (Table< Config > const &config)
 
std::string workerType () const
 
- Public Member Functions inherited from art::detail::Analyzer
virtual ~Analyzer () noexcept
 
 Analyzer (fhicl::ParameterSet const &pset)
 
template<typename Config >
 Analyzer (Table< Config > const &config)
 
void doBeginJob ()
 
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::Observer
 ~Observer () noexcept
 
 Observer (Observer const &)=delete
 
 Observer (Observer &&)=delete
 
Observeroperator= (Observer const &)=delete
 
Observeroperator= (Observer &&)=delete
 
void registerProducts (ProductDescriptions &, ModuleDescription const &)
 
void fillDescriptions (ModuleDescription const &)
 
std::string const & processName () const
 
bool wantAllEvents () const
 
bool wantEvent (Event const &e)
 
fhicl::ParameterSetID selectorConfig () const
 
Handle< TriggerResultsgetTriggerResults (Event const &e) const
 
- Public Member Functions inherited from art::ModuleBase
virtual ~ModuleBase () noexcept
 
 ModuleBase ()
 
ModuleDescription const & moduleDescription () const
 
void setModuleDescription (ModuleDescription const &)
 
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 ()
 
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)
 
- Public Member Functions inherited from art::detail::SharedModule
 SharedModule ()
 
 SharedModule (std::string const &moduleLabel)
 
 ~SharedModule () noexcept
 
hep::concurrency::SerialTaskQueueChain * serialTaskQueueChain () const
 
void createQueues ()
 
template<BranchType BT = InEvent, typename... T>
void serialize (T const &...)
 
template<BranchType BT = InEvent>
void async ()
 
template<BranchType , typename... T>
void serialize (T const &...resources)
 

Private Member Functions

void analyze (art::Event const &e, art::ProcessingFrame const &) override
 

Private Attributes

std::string const input_label_
 

Additional Inherited Members

- Protected Member Functions inherited from art::Observer
 Observer (fhicl::ParameterSet const &config)
 
 Observer (std::vector< std::string > const &paths, fhicl::ParameterSet const &config)
 
detail::ProcessAndEventSelectorsprocessAndEventSelectors ()
 

Detailed Description

Definition at line 20 of file PtrVectorSimpleAnalyzer_module.cc.

Member Typedef Documentation

Definition at line 25 of file PtrVectorSimpleAnalyzer_module.cc.

Constructor & Destructor Documentation

arttest::PtrVectorSimpleAnalyzer::PtrVectorSimpleAnalyzer ( Parameters const &  p,
art::ProcessingFrame const &   
)
explicit

Definition at line 35 of file PtrVectorSimpleAnalyzer_module.cc.

38  : art::SharedAnalyzer{p}, input_label_{p().input_label()}
39 {
40  async<art::InEvent>();
41 }
p
Definition: test.py:228

Member Function Documentation

void arttest::PtrVectorSimpleAnalyzer::analyze ( art::Event const &  e,
art::ProcessingFrame const &   
)
overrideprivatevirtual

Implements art::SharedAnalyzer.

Definition at line 44 of file PtrVectorSimpleAnalyzer_module.cc.

46 {
47  using SimplePtrVector = art::PtrVector<arttest::Simple>;
48 
49  auto p = e.getPointerByLabel<SimplePtrVector>(input_label_);
50  assert(p);
51  assert(p->size() > 0);
52  // assert( p->pop_back()); // This fails to compile, because *p is const.
53 
55  bool const status = e.getByLabel(input_label_, h);
56  assert(status);
57 
58  int const event_num = e.id().event();
59  size_t const sz = h->size();
60  size_t i = 0;
61  for (auto const ptr : *h) {
62  assert((unsigned)ptr->key == sz - i + event_num);
63  double const expect = 1.5 * i + 100.0;
64  assert(ptr->value == expect);
65  assert(ptr->dummy() == 16.25);
66  ++i;
67  }
68 }
const double e
p
Definition: test.py:228
h
training ###############################
Definition: train_cnn.py:186

Member Data Documentation

std::string const arttest::PtrVectorSimpleAnalyzer::input_label_
private

Definition at line 32 of file PtrVectorSimpleAnalyzer_module.cc.


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