Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
arttest::RPTestReader Class Reference
Inheritance diagram for arttest::RPTestReader:
art::ResultsProducer art::ModuleBase art::detail::SharedModule art::ProductRegistryHelper

Classes

struct  Config
 

Public Types

using Parameters = art::ResultsProducer::Table< Config >
 
- Public Types inherited from art::ResultsProducer
template<typename UserConfig , typename KeysToIgnore = void>
using Table = ProducerTable< UserConfig, detail::PluginConfig, KeysToIgnore >
 

Public Member Functions

 RPTestReader (Parameters const &p)
 
 RPTestReader (RPTestReader const &)=delete
 
 RPTestReader (RPTestReader &&)=delete
 
RPTestReaderoperator= (RPTestReader const &)=delete
 
RPTestReaderoperator= (RPTestReader &&)=delete
 
void clear () override
 
void writeResults (art::Results &res) override
 
void event (art::Event const &e) override
 
void readResults (art::Results const &res) override
 
- Public Member Functions inherited from art::ResultsProducer
virtual ~ResultsProducer () noexcept=default
 
void doBeginJob ()
 
void doEndJob ()
 
void doBeginRun (RunPrincipal const &)
 
void doEndRun (RunPrincipal const &)
 
void doBeginSubRun (SubRunPrincipal const &)
 
void doEndSubRun (SubRunPrincipal const &)
 
void doEvent (EventPrincipal const &)
 
void doReadResults (ResultsPrincipal const &)
 
void doWriteResults (ResultsPrincipal &)
 
void doClear ()
 
void registerProducts (ProductDescriptions &producedProducts, ModuleDescription const &md)
 
- 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 Member Functions

bool maybeAccumulateData_ (art::Results const &res)
 

Private Attributes

std::string intResultsLabel_
 
std::size_t expectedResultsSeen_
 
std::size_t resultsSeen_ {}
 
int total_ {}
 

Additional Inherited Members

- Protected Member Functions inherited from art::ResultsProducer
template<class P >
void produces (std::string const &instanceName={})
 

Detailed Description

Definition at line 24 of file RPTestReader_plugin.cc.

Member Typedef Documentation

Definition at line 32 of file RPTestReader_plugin.cc.

Constructor & Destructor Documentation

arttest::RPTestReader::RPTestReader ( Parameters const &  p)
explicit

Definition at line 60 of file RPTestReader_plugin.cc.

61  : intResultsLabel_{p().intResultsLabel()}
62  , expectedResultsSeen_{p().nResultsExpected()}
63 {}
p
Definition: test.py:228
arttest::RPTestReader::RPTestReader ( RPTestReader const &  )
delete
arttest::RPTestReader::RPTestReader ( RPTestReader &&  )
delete

Member Function Documentation

void arttest::RPTestReader::clear ( )
overridevirtual

Implements art::ResultsProducer.

Definition at line 66 of file RPTestReader_plugin.cc.

67 {
68  resultsSeen_ = 0;
69  total_ = 0;
70 }
void arttest::RPTestReader::event ( art::Event const &  e)
overridevirtual

Reimplemented from art::ResultsProducer.

Definition at line 84 of file RPTestReader_plugin.cc.

85 {
86  // NOP.
87 }
bool arttest::RPTestReader::maybeAccumulateData_ ( art::Results const &  res)
private

Definition at line 96 of file RPTestReader_plugin.cc.

97 {
99  bool result = res.getByLabel(intResultsLabel_, hi);
100  if (result) {
101  ++resultsSeen_;
102  if (hi->value != 5.0) {
104  << "Unexcepted value in results int product: " << hi->value << ".\n";
105  }
106  total_ += hi->value;
107  }
108  return result;
109 }
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
RPTestReader& arttest::RPTestReader::operator= ( RPTestReader const &  )
delete
RPTestReader& arttest::RPTestReader::operator= ( RPTestReader &&  )
delete
void arttest::RPTestReader::readResults ( art::Results const &  res)
overridevirtual

Reimplemented from art::ResultsProducer.

Definition at line 90 of file RPTestReader_plugin.cc.

91 {
93 }
bool maybeAccumulateData_(art::Results const &res)
void arttest::RPTestReader::writeResults ( art::Results res)
overridevirtual

Implements art::ResultsProducer.

Definition at line 73 of file RPTestReader_plugin.cc.

74 {
78  << "Expected to see " << expectedResultsSeen_ << ", saw " << resultsSeen_
79  << ".\n";
80  }
81 }
bool maybeAccumulateData_(art::Results const &res)
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66

Member Data Documentation

std::size_t arttest::RPTestReader::expectedResultsSeen_
private

Definition at line 55 of file RPTestReader_plugin.cc.

std::string arttest::RPTestReader::intResultsLabel_
private

Definition at line 54 of file RPTestReader_plugin.cc.

std::size_t arttest::RPTestReader::resultsSeen_ {}
private

Definition at line 56 of file RPTestReader_plugin.cc.

int arttest::RPTestReader::total_ {}
private

Definition at line 57 of file RPTestReader_plugin.cc.


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