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

Public Member Functions

 CRTOnlineMonitor (fhicl::ParameterSet const &p)
 
 CRTOnlineMonitor (CRTOnlineMonitor const &)=delete
 
 CRTOnlineMonitor (CRTOnlineMonitor &&)=delete
 
CRTOnlineMonitoroperator= (CRTOnlineMonitor const &)=delete
 
CRTOnlineMonitoroperator= (CRTOnlineMonitor &&)=delete
 
void analyze (art::Event const &e) override
 
void beginJob () override
 
void beginRun (art::Run const &r) override
 
void endRun (art::Run const &r) override
 
void onFileClose ()
 
- 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 (SharedResources const &resources)
 
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 &)
 
fhicl::ParameterSetID selectorConfig () const
 
- Public Member Functions inherited from art::ModuleBase
virtual ~ModuleBase () noexcept
 
 ModuleBase ()
 
ModuleDescription const & moduleDescription () const
 
void setModuleDescription (ModuleDescription const &)
 
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 Types

using dir_t = CRT::FlatDirectory< art::ServiceHandle< art::TFileService >>
 

Private Attributes

std::unique_ptr< CRT::OnlinePlotter< std::shared_ptr< dir_t > > > fPlotter
 
art::InputTag fCRTLabel
 

Additional Inherited Members

- Public Types inherited from art::EDAnalyzer
using WorkerType = WorkerT< EDAnalyzer >
 
using ModuleType = EDAnalyzer
 
- Protected Member Functions inherited from art::Observer
std::string const & processName () const
 
bool wantAllEvents () const noexcept
 
bool wantEvent (ScheduleID id, Event const &e) const
 
Handle< TriggerResultsgetTriggerResults (Event const &e) const
 
 Observer (fhicl::ParameterSet const &config)
 
 Observer (std::vector< std::string > const &select_paths, std::vector< std::string > const &reject_paths, fhicl::ParameterSet const &config)
 
- Protected Member Functions inherited from art::ModuleBase
ConsumesCollectorconsumesCollector ()
 
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 ()
 

Detailed Description

Definition at line 34 of file CRTOnlineMonitor_module.cc.

Member Typedef Documentation

using CRTOnlineMonitor::dir_t = CRT::FlatDirectory<art::ServiceHandle<art::TFileService>>
private

Definition at line 59 of file CRTOnlineMonitor_module.cc.

Constructor & Destructor Documentation

CRTOnlineMonitor::CRTOnlineMonitor ( fhicl::ParameterSet const &  p)
explicit

Definition at line 67 of file CRTOnlineMonitor_module.cc.

68  :
69  EDAnalyzer(p), fPlotter(nullptr), fCRTLabel(p.get<art::InputTag>("CRTLabel"))
70  // More initializers here.
71 {
72  consumes<std::vector<CRT::Trigger>>(fCRTLabel);
73 
74  //Register callback to create new histograms for each file processed
76  tfs->registerFileSwitchCallback(this, &CRTOnlineMonitor::onFileClose);
77 }
std::unique_ptr< CRT::OnlinePlotter< std::shared_ptr< dir_t > > > fPlotter
EDAnalyzer(fhicl::ParameterSet const &pset)
Definition: EDAnalyzer.h:25
p
Definition: test.py:223
CRTOnlineMonitor::CRTOnlineMonitor ( CRTOnlineMonitor const &  )
delete
CRTOnlineMonitor::CRTOnlineMonitor ( CRTOnlineMonitor &&  )
delete

Member Function Documentation

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

Implements art::EDAnalyzer.

Definition at line 79 of file CRTOnlineMonitor_module.cc.

80 {
81  // Implementation of required member function here.
82  try
83  {
84  const auto& triggers = e.getValidHandle<std::vector<CRT::Trigger>>(fCRTLabel);
85  fPlotter->AnalyzeEvent(*triggers);
86  }
87  catch(const cet::exception& e)
88  {
89  mf::LogWarning("MissingData") << "Caught exception when trying to find CRT::Triggers from label " << fCRTLabel << ":\n"
90  << e.what() << "\n";
91  }
92 }
std::unique_ptr< CRT::OnlinePlotter< std::shared_ptr< dir_t > > > fPlotter
const double e
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
void CRTOnlineMonitor::beginJob ( )
overridevirtual

Reimplemented from art::EDAnalyzer.

Definition at line 94 of file CRTOnlineMonitor_module.cc.

95 {
96  // Implementation of optional member function here.
97  onFileClose();
98 }
void CRTOnlineMonitor::beginRun ( art::Run const &  r)
overridevirtual

Reimplemented from art::EDAnalyzer.

Definition at line 108 of file CRTOnlineMonitor_module.cc.

109 {
110  // Implementation of optional member function here.
111  fPlotter->ReactBeginRun(""); //TODO: Remove std::string from interface for OnlinePlotter and friends
112 }
std::unique_ptr< CRT::OnlinePlotter< std::shared_ptr< dir_t > > > fPlotter
void CRTOnlineMonitor::endRun ( art::Run const &  r)
overridevirtual

Reimplemented from art::EDAnalyzer.

Definition at line 114 of file CRTOnlineMonitor_module.cc.

115 {
116  // Implementation of optional member function here.
117  fPlotter->ReactEndRun(""); //TODO: Remove std::string from interface for OnlinePlotter and friends
118 }
std::unique_ptr< CRT::OnlinePlotter< std::shared_ptr< dir_t > > > fPlotter
void CRTOnlineMonitor::onFileClose ( )

Definition at line 100 of file CRTOnlineMonitor_module.cc.

101 {
103  auto dirPtr = std::shared_ptr<dir_t>(new dir_t(tfs));
104  fPlotter.reset(new CRT::OnlinePlotter<std::shared_ptr<dir_t>>(dirPtr));
105  fPlotter->ReactBeginRun("");
106 }
std::unique_ptr< CRT::OnlinePlotter< std::shared_ptr< dir_t > > > fPlotter
CRT::FlatDirectory< art::ServiceHandle< art::TFileService >> dir_t
CRTOnlineMonitor& CRTOnlineMonitor::operator= ( CRTOnlineMonitor const &  )
delete
CRTOnlineMonitor& CRTOnlineMonitor::operator= ( CRTOnlineMonitor &&  )
delete

Member Data Documentation

art::InputTag CRTOnlineMonitor::fCRTLabel
private

Definition at line 63 of file CRTOnlineMonitor_module.cc.

std::unique_ptr<CRT::OnlinePlotter<std::shared_ptr<dir_t> > > CRTOnlineMonitor::fPlotter
private

Definition at line 60 of file CRTOnlineMonitor_module.cc.


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