Public Types | Public Member Functions | Private Attributes | List of all members
arttest::MockClusterListAnalyzer Class Reference
Inheritance diagram for arttest::MockClusterListAnalyzer:
art::EDAnalyzer art::detail::Analyzer art::detail::LegacyModule art::Observer art::ModuleBase

Public Types

typedef std::vector< arttest::SimpleDerivedSimpleDerivedProduct
 
- Public Types inherited from art::EDAnalyzer
using WorkerType = WorkerT< EDAnalyzer >
 
using ModuleType = EDAnalyzer
 

Public Member Functions

 MockClusterListAnalyzer (fhicl::ParameterSet const &p)
 
void analyze (art::Event const &e) override
 
- Public Member Functions inherited from art::EDAnalyzer
 EDAnalyzer (fhicl::ParameterSet const &pset)
 
template<typename Config >
 EDAnalyzer (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)
 

Private Attributes

std::string inputLabel_
 
unsigned nvalues_
 

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 30 of file MockClusterListAnalyzer_module.cc.

Member Typedef Documentation

Definition at line 32 of file MockClusterListAnalyzer_module.cc.

Constructor & Destructor Documentation

arttest::MockClusterListAnalyzer::MockClusterListAnalyzer ( fhicl::ParameterSet const &  p)
inlineexplicit

Definition at line 34 of file MockClusterListAnalyzer_module.cc.

36  , inputLabel_(p.get<std::string>("input_label"))
37  , nvalues_(p.get<int>("nvalues"))
38  {}
std::string string
Definition: nybbler.cc:12
p
Definition: test.py:228

Member Function Documentation

void MockClusterListAnalyzer::analyze ( art::Event const &  e)
overridevirtual

Implements art::EDAnalyzer.

Definition at line 49 of file MockClusterListAnalyzer_module.cc.

50 {
51  int event_num = e.id().event();
54  e.getByLabel(inputLabel_, h);
55 
56  assert(h.isValid());
57  unsigned psz = h->size();
58  assert(psz == 2);
59  for (product_t::const_iterator pb = h->begin(), pi = pb, pe = h->end();
60  pi != pe;
61  ++pi) {
62  int pk = pi - pb;
63  size_t csz = pi->cells.size();
64  if (pk == 0) {
65  assert(csz == nvalues_ / 2);
66  } else {
67  assert(csz == nvalues_ - (nvalues_ / 2)); // Remainder
68  }
69  assert(pi->skew == pk + 1);
70  // Try to access the first one directly.
71  art::Ptr<SimpleDerived> sd0 = pi->cells[0];
72  assert(sd0.get() != nullptr);
73 
74  // Now use the iterator to loop over the PtrVector.
75  size_t cell_count = 0;
76  for (product_t::value_type::CellList::const_iterator cb = pi->cells.begin(),
77  ci = cb,
78  ce = pi->cells.end();
79  ci != ce;
80  ++ci, ++cell_count) {
81  int ck = ci - cb;
82  art::Ptr<SimpleDerived> ptsd = *ci;
83  assert((unsigned)ptsd->key == 2 * csz - (ck + pk * csz) + event_num);
84  assert(ptsd->value == 1.5 * (ck + pk * csz) + 100.0);
85  assert(ptsd->dummy() == 16.25);
86  }
87  assert(cell_count == csz);
88  assert(pi->eNum == (unsigned)(event_num + pk));
89  }
90 } // test_PtrVector()
std::vector< arttest::MockCluster > MockClusterList
Definition: MockCluster.h:26
bool isValid() const
Definition: Handle.h:190
static const double pb
Definition: Units.h:90
const double e
intermediate_table::const_iterator const_iterator
key_type key() const
Definition: Ptr.h:240
constexpr T pi()
Returns the constant pi (up to 35 decimal digits of precision)
T const * get() const
Definition: Ptr.h:153
arttest::IntProduct product_t
Definition: Event_t.cc:63
Definition: fwd.h:26
h
training ###############################
Definition: train_cnn.py:186

Member Data Documentation

std::string arttest::MockClusterListAnalyzer::inputLabel_
private

Definition at line 43 of file MockClusterListAnalyzer_module.cc.

unsigned arttest::MockClusterListAnalyzer::nvalues_
private

Definition at line 44 of file MockClusterListAnalyzer_module.cc.


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