Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
rndm::NuRandomServiceHelper::ArtState Class Reference

Describe the current state of art processing, as understood by the NuRandomService. More...

#include <ArtState.h>

Public Types

enum  state_type {
  unDefined, inServiceConstructor, inModuleConstructor, inBeginRun,
  inModuleBeginRun, inEvent, inModuleEvent, inEndJob,
  inOther
}
 
using EventInfo_t = art::EventAuxiliary
 

Public Member Functions

 ArtState (state_type start_state=unDefined)
 
EventSeedInputData getEventSeedInputData () const
 
void set_state (state_type astate)
 Records the status of ART. More...
 
state_type transit_to (state_type astate)
 Records the new status of ART and returns the old one. More...
 
void reset_state ()
 Resets the status to "something else" (inOther) More...
 
void set_event (art::Event const &evt)
 Records the specified event ID. More...
 
void reset_event ()
 
void set_module (art::ModuleDescription const &desc)
 Records the specified module description. More...
 
void reset_module ()
 
void set_process_name (std::string pn)
 
void set_process_name (art::ModuleDescription const &currentModuleDesc)
 
state_type state () const
 Getters. More...
 
std::string stateName () const
 
art::EventID const & eventID () const
 
EventInfo_t const & eventInfo () const
 
art::ModuleDescription const & moduleDesc () const
 
std::string moduleLabel () const
 
std::string processName () const
 

Static Public Member Functions

static std::string stateName (state_type state)
 

Protected Attributes

state_type artState
 current state of the art More...
 
EventInfo_t lastEvent
 
art::ModuleDescription lastModule
 
std::string procName
 

Detailed Description

Describe the current state of art processing, as understood by the NuRandomService.

Definition at line 32 of file ArtState.h.

Member Typedef Documentation

Definition at line 46 of file ArtState.h.

Member Enumeration Documentation

Enumerator
unDefined 

not assigned yet

inServiceConstructor 

in service construction phase

inModuleConstructor 

in module construction phase

inBeginRun 

in begin of run phase

inModuleBeginRun 

in begin of run for a module

inEvent 

in event phase

inModuleEvent 

in event processing by a module

inEndJob 

in end job

inOther 

none of the above

Definition at line 34 of file ArtState.h.

34  {
35  unDefined, ///< not assigned yet
36  inServiceConstructor, ///< in service construction phase
37  inModuleConstructor, ///< in module construction phase
38  inBeginRun, ///< in begin of run phase
39  inModuleBeginRun, ///< in begin of run for a module
40  inEvent, ///< in event phase
41  inModuleEvent, ///< in event processing by a module
42  inEndJob, ///< in end job
43  inOther ///< none of the above
44  } state_type; ///< type of state of art (what's doing)
in event processing by a module
Definition: ArtState.h:41

Constructor & Destructor Documentation

rndm::NuRandomServiceHelper::ArtState::ArtState ( state_type  start_state = unDefined)
inline

Definition at line 49 of file ArtState.h.

50  : artState(start_state)
51  , lastEvent()
52  , lastModule()
53  , procName()
54  {}
state_type artState
current state of the art
Definition: ArtState.h:168
art::ModuleDescription lastModule
Definition: ArtState.h:171

Member Function Documentation

art::EventID const& rndm::NuRandomServiceHelper::ArtState::eventID ( ) const
inline

Definition at line 116 of file ArtState.h.

116 { return lastEvent.id(); }
EventID const & id() const noexcept
EventInfo_t const& rndm::NuRandomServiceHelper::ArtState::eventInfo ( ) const
inline

Definition at line 118 of file ArtState.h.

118 { return lastEvent; }
EventSeedInputData rndm::NuRandomServiceHelper::ArtState::getEventSeedInputData ( ) const
inline

Definition at line 128 of file ArtState.h.

129  {
130  EventSeedInputData data;
131  data.runNumber = eventID().run();
132  data.subRunNumber = eventID().subRun();
133  data.eventNumber = eventID().event();
134 
135  data.time = eventInfo().time().value();
136  data.isTimeValid
138 
139  data.isData = eventInfo().isRealData();
140 
141  data.processName = processName();
142  data.moduleType = moduleDesc().moduleName();
143  data.moduleLabel = moduleLabel();
144 
145  return data;
146  } // getEventSeedInputData()
std::string moduleLabel() const
Definition: ArtState.h:122
art::EventID const & eventID() const
Definition: ArtState.h:116
std::string processName() const
Definition: ArtState.h:124
constexpr TimeValue_t value() const
Definition: Timestamp.h:23
RunNumber_t run() const
Definition: EventID.h:98
EventInfo_t const & eventInfo() const
Definition: ArtState.h:118
std::string const & moduleName() const
static constexpr Timestamp invalidTimestamp()
Definition: Timestamp.h:82
EventNumber_t event() const
Definition: EventID.h:116
bool isRealData() const noexcept
art::ModuleDescription const & moduleDesc() const
Definition: ArtState.h:120
SubRunNumber_t subRun() const
Definition: EventID.h:110
Timestamp const & time() const noexcept
art::ModuleDescription const& rndm::NuRandomServiceHelper::ArtState::moduleDesc ( ) const
inline

Definition at line 120 of file ArtState.h.

120 { return lastModule; }
art::ModuleDescription lastModule
Definition: ArtState.h:171
std::string rndm::NuRandomServiceHelper::ArtState::moduleLabel ( ) const
inline

Definition at line 122 of file ArtState.h.

122 { return lastModule.moduleLabel(); }
std::string const & moduleLabel() const
art::ModuleDescription lastModule
Definition: ArtState.h:171
std::string rndm::NuRandomServiceHelper::ArtState::processName ( ) const
inline

Definition at line 124 of file ArtState.h.

124 { return procName; }
void rndm::NuRandomServiceHelper::ArtState::reset_event ( )
inline

Definition at line 83 of file ArtState.h.

void rndm::NuRandomServiceHelper::ArtState::reset_module ( )
inline

Definition at line 91 of file ArtState.h.

void rndm::NuRandomServiceHelper::ArtState::reset_state ( )
inline

Resets the status to "something else" (inOther)

Definition at line 74 of file ArtState.h.

74 { transit_to(inOther); }
state_type transit_to(state_type astate)
Records the new status of ART and returns the old one.
Definition: ArtState.h:63
void rndm::NuRandomServiceHelper::ArtState::set_event ( art::Event const &  evt)
inline

Records the specified event ID.

Definition at line 77 of file ArtState.h.

78  {
79  lastEvent = {
80  evt.id(), evt.time(), evt.isRealData(), evt.experimentType()
81  };
82  } // set_event()
TCEvent evt
Definition: DataStructs.cxx:7
void rndm::NuRandomServiceHelper::ArtState::set_module ( art::ModuleDescription const &  desc)
inline

Records the specified module description.

Definition at line 86 of file ArtState.h.

87  {
88  lastModule = desc;
90  }
void set_process_name(std::string pn)
Definition: ArtState.h:93
art::ModuleDescription lastModule
Definition: ArtState.h:171
void rndm::NuRandomServiceHelper::ArtState::set_process_name ( std::string  pn)
inline

Definition at line 93 of file ArtState.h.

void rndm::NuRandomServiceHelper::ArtState::set_process_name ( art::ModuleDescription const &  currentModuleDesc)
inline

Definition at line 94 of file ArtState.h.

95  {
96  if (!procName.empty()
97  && (procName != currentModuleDesc.processName()))
98  {
100  << "Process name changed from '" << procName << "' to '"
101  << currentModuleDesc.processName() << "'?!?";
102  }
103  procName = currentModuleDesc.processName();
104  } // set_process_name()
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
void rndm::NuRandomServiceHelper::ArtState::set_state ( state_type  astate)
inline

Records the status of ART.

Definition at line 60 of file ArtState.h.

60 { artState = astate; }
state_type artState
current state of the art
Definition: ArtState.h:168
state_type rndm::NuRandomServiceHelper::ArtState::state ( ) const
inline

Getters.

Definition at line 112 of file ArtState.h.

112 { return artState; }
state_type artState
current state of the art
Definition: ArtState.h:168
std::string rndm::NuRandomServiceHelper::ArtState::stateName ( ) const
inline

Definition at line 114 of file ArtState.h.

114 { return stateName(state()); }
std::string stateName() const
Definition: ArtState.h:114
state_type state() const
Getters.
Definition: ArtState.h:112
static std::string rndm::NuRandomServiceHelper::ArtState::stateName ( state_type  state)
inlinestatic

Definition at line 149 of file ArtState.h.

150  {
151  switch (state) {
152  case unDefined: return "(not assigned yet)";
153  case inServiceConstructor: return "service construction";
154  case inModuleConstructor: return "module construction";
155  case inBeginRun: return "begin of run";
156  case inModuleBeginRun: return "begin of run for module";
157  case inEvent: return "event preparation";
158  case inModuleEvent: return "event processing by a module";
159  case inEndJob: return "end job";
160  case inOther: return "unidentified";
161  } // switch
163  << "artext::NuRandomServiceHelper::ArtState::stateName: unknown state #"
164  << ((int) state) << "\n";
165  } // stateName()
in event processing by a module
Definition: ArtState.h:41
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
state_type state() const
Getters.
Definition: ArtState.h:112
state_type rndm::NuRandomServiceHelper::ArtState::transit_to ( state_type  astate)
inline

Records the new status of ART and returns the old one.

Definition at line 63 of file ArtState.h.

64  {
65  state_type old_state = state();
66  set_state(astate);
67  MF_LOG_DEBUG("ArtState")
68  << "NuRandomService::ArtState: transition from "
69  << stateName(old_state) << " to " << stateName();
70  return old_state;
71  } // transit_to()
std::string stateName() const
Definition: ArtState.h:114
void set_state(state_type astate)
Records the status of ART.
Definition: ArtState.h:60
state_type state() const
Getters.
Definition: ArtState.h:112
#define MF_LOG_DEBUG(id)

Member Data Documentation

state_type rndm::NuRandomServiceHelper::ArtState::artState
protected

current state of the art

Definition at line 168 of file ArtState.h.

EventInfo_t rndm::NuRandomServiceHelper::ArtState::lastEvent
protected

Definition at line 170 of file ArtState.h.

art::ModuleDescription rndm::NuRandomServiceHelper::ArtState::lastModule
protected

Definition at line 171 of file ArtState.h.

std::string rndm::NuRandomServiceHelper::ArtState::procName
protected

Definition at line 172 of file ArtState.h.


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