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

Classes

struct  Config
 

Public Types

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

Public Member Functions

 ValidHandleTester (Parameters 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

art::InputTag input_tag_
 
std::string expected_value_
 

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 ValidHandleTester_module.cc.

Member Typedef Documentation

Definition at line 28 of file ValidHandleTester_module.cc.

Constructor & Destructor Documentation

ValidHandleTester::ValidHandleTester ( Parameters const &  p)
explicit

Definition at line 37 of file ValidHandleTester_module.cc.

39  , input_tag_{ps().input_label()}
40  , expected_value_{ps().expected_value()}
41 {
42  // consumes<std::string>(input_tag_);
43 }
static const double ps
Definition: Units.h:103

Member Function Documentation

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

Implements art::EDAnalyzer.

Definition at line 46 of file ValidHandleTester_module.cc.

47 {
48  // Make sure old-form access works.
50  e.getByLabel(input_tag_, h);
51  assert(h.isValid());
52  assert(*h == expected_value_);
53 
54  // Make sure new-form access works.
55  auto p = e.getValidHandle<std::string>(input_tag_);
56  assert(*p == expected_value_);
57  auto const& prov = *p.provenance();
58  assert(prov == *h.provenance());
59 
60  // Test that Provenance::inputTag() was formed correctly
61  auto const& tag = prov.inputTag();
62  assert(tag.label() == prov.moduleLabel());
63  assert(tag.instance() == prov.productInstanceName());
64  assert(tag.process() == prov.processName());
65 
66  // Make sure conversion-to-pointer works.
67  [&](std::string const* x) { assert(*x == expected_value_); }(p);
68 }
std::string string
Definition: nybbler.cc:12
bool isValid() const
Definition: Handle.h:190
const double e
Provenance const * provenance() const
Definition: Handle.h:204
p
Definition: test.py:228
h
training ###############################
Definition: train_cnn.py:186

Member Data Documentation

std::string ValidHandleTester::expected_value_
private

Definition at line 34 of file ValidHandleTester_module.cc.

art::InputTag ValidHandleTester::input_tag_
private

Definition at line 33 of file ValidHandleTester_module.cc.


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