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

Public Member Functions

 TestResultAnalyzer (fhicl::ParameterSet const &)
 
void analyze (art::Event const &e) override
 
void endJob () 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

int passed_ {}
 
int failed_ {}
 
bool dump_
 
int numbits_
 

Additional Inherited Members

- Public Types inherited from art::EDAnalyzer
using WorkerType = WorkerT< EDAnalyzer >
 
using ModuleType = EDAnalyzer
 
- 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 19 of file TestResultAnalyzer_module.cc.

Constructor & Destructor Documentation

arttest::TestResultAnalyzer::TestResultAnalyzer ( fhicl::ParameterSet const &  ps)
explicit

Definition at line 33 of file TestResultAnalyzer_module.cc.

35  , dump_{ps.get<bool>("dump", false)}
36  , numbits_{ps.get<int>("numbits", -1)}
37 {
38  consumesMany<art::TriggerResults>();
39 }
static const double ps
Definition: Units.h:103

Member Function Documentation

void arttest::TestResultAnalyzer::analyze ( art::Event const &  e)
overridevirtual

Implements art::EDAnalyzer.

Definition at line 42 of file TestResultAnalyzer_module.cc.

43 {
44  typedef std::vector<art::Handle<art::TriggerResults>> Trig;
45  Trig prod;
46  e.getManyByType(prod);
47 
48  if (prod.size() == 0)
49  return;
50  if (prod.size() > 1) {
51  mf::LogWarning("MultipleTriggerResults")
52  << "More than one trigger result in the event, using first one.";
53  }
54 
55  if (prod[0]->accept())
56  ++passed_;
57  else
58  ++failed_;
59 
60  if (numbits_ < 0)
61  return;
62 
63  unsigned int numbits = numbits_;
64  if (numbits != prod[0]->size()) {
65  throw cet::exception("WrongNumberBits")
66  << "Should have " << numbits << ", got " << prod[0]->size()
67  << " in TriggerResults\n";
68  }
69 }
const double e
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
void arttest::TestResultAnalyzer::endJob ( )
overridevirtual

Reimplemented from art::EDAnalyzer.

Definition at line 72 of file TestResultAnalyzer_module.cc.

73 {
74  mf::LogAbsolute("TestResultAnalyzerReport")
75  << "passed=" << passed_ << " failed=" << failed_ << "\n";
76 }
MaybeLogger_< ELseverityLevel::ELsev_severe, true > LogAbsolute

Member Data Documentation

bool arttest::TestResultAnalyzer::dump_
private

Definition at line 29 of file TestResultAnalyzer_module.cc.

int arttest::TestResultAnalyzer::failed_ {}
private

Definition at line 28 of file TestResultAnalyzer_module.cc.

int arttest::TestResultAnalyzer::numbits_
private

Definition at line 30 of file TestResultAnalyzer_module.cc.

int arttest::TestResultAnalyzer::passed_ {}
private

Definition at line 27 of file TestResultAnalyzer_module.cc.


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