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

Classes

struct  Config
 

Public Types

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

Public Member Functions

 ToyRawProductAnalyzer (Parameters const &p)
 
- 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 Member Functions

void analyze (art::Event const &e) override
 
void beginRun (art::Run const &r) override
 
void beginSubRun (art::SubRun const &sr) override
 

Private Attributes

bool const doBeginRun_
 
bool const doBeginSubRun_
 

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 16 of file ToyRawProductAnalyzer_module.cc.

Member Typedef Documentation

Definition at line 22 of file ToyRawProductAnalyzer_module.cc.

Constructor & Destructor Documentation

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

Definition at line 34 of file ToyRawProductAnalyzer_module.cc.

36  , doBeginRun_{p().beginRun()}
37  , doBeginSubRun_{p().beginSubRun()}
38 {}
p
Definition: test.py:228

Member Function Documentation

void arttest::ToyRawProductAnalyzer::analyze ( art::Event const &  e)
overrideprivatevirtual

Implements art::EDAnalyzer.

Definition at line 41 of file ToyRawProductAnalyzer_module.cc.

42 {
43  e.getRun(); // Will throw if subRun or run are unavailable.
44  std::vector<art::Handle<int>> hv;
45  e.getManyByType(hv);
46  assert(hv.size() == 1u);
47  art::Handle<int>& h = hv[0];
48  std::cerr << e.id() << " int = " << (*h) << "\n";
49  art::Handle<bool> hb1, hb2;
50  assert(e.getByLabel("m2", "a", hb1));
51  std::cerr << e.id() << " bool a = " << (*hb1) << "\n";
52  assert(e.getByLabel(art::InputTag("m2", "b"), hb2));
53  std::cerr << e.id() << " bool b = " << (*hb2) << "\n";
54  auto ph = e.getValidHandle<art::Ptr<double>>("m3");
55  assert(**ph == 3.7);
56 }
const double e
h
training ###############################
Definition: train_cnn.py:186
void arttest::ToyRawProductAnalyzer::beginRun ( art::Run const &  r)
overrideprivatevirtual

Reimplemented from art::EDAnalyzer.

Definition at line 59 of file ToyRawProductAnalyzer_module.cc.

60 {
61  if (!doBeginRun_)
62  return;
63  std::vector<art::Handle<double>> hv;
64  r.getManyByType(hv);
65  assert(hv.size() == 1u);
66  art::Handle<double>& h = hv[0];
67  std::cerr << r.id() << " double = " << (*h) << "\n";
68 }
h
training ###############################
Definition: train_cnn.py:186
void arttest::ToyRawProductAnalyzer::beginSubRun ( art::SubRun const &  sr)
overrideprivatevirtual

Reimplemented from art::EDAnalyzer.

Definition at line 71 of file ToyRawProductAnalyzer_module.cc.

72 {
73  if (!doBeginSubRun_)
74  return;
75  sr.getRun(); // Will throw if not available.
76  std::vector<art::Handle<double>> hv;
77  sr.getManyByType(hv);
78  assert(hv.size() == 1u);
79  art::Handle<double>& h = hv[0];
80  std::cerr << sr.id() << " double = " << (*h) << "\n";
81 }
static const double sr
Definition: Units.h:167
h
training ###############################
Definition: train_cnn.py:186

Member Data Documentation

bool const arttest::ToyRawProductAnalyzer::doBeginRun_
private

Definition at line 30 of file ToyRawProductAnalyzer_module.cc.

bool const arttest::ToyRawProductAnalyzer::doBeginSubRun_
private

Definition at line 31 of file ToyRawProductAnalyzer_module.cc.


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