CMS 3D CMS Logo

ELadministrator.h
Go to the documentation of this file.
1 #ifndef MessageService_ELadministrator_h
2 #define MessageService_ELadministrator_h
3 
4 // ----------------------------------------------------------------------
5 //
6 // ELadminstrator.h provides the singleton class that the framework uses to
7 // control logger behavior including attaching destinations.
8 // Includes the methods used by ErrorLog to evoke the logging
9 // behavior in the destinations owned by the ELadminstrator.
10 //
11 // ----------------------------------------------------------------------
12 //
13 // ELadministrator The singleton logger class. One does not instantiate
14 // an ELadministrator. Instead, do
15 // ELadministrator * logger = ELadministrator::instance();
16 // to get a pointer to the (unique) ELadministrator.
17 //
18 // Only the framework should use ELadministrator directly.
19 // Physicist users get at it indirectly through using an ErrorLog
20 // set up in their Module class.
21 //
22 // ELadminDestroyer A class whose sole purpose is the destruction of the
23 // ELadministrator when the program is over. Right now,
24 // we do not have anything that needs to be done when the
25 // ELadministrator (and thus the error logger) goes away;
26 // but since by not deleting the copies of ELdestination's
27 // that were attached we would be left with an apparent
28 // memory leak, we include a protected destructor which will
29 // clean up. ELadminDestroyer provides the only way for
30 // this destructor to be called.
31 //
32 // ----------------------------------------------------------------------
33 //
34 // 7/2/98 mf Created file.
35 // 2/29/00 mf Added method swapContextSupplier for ELrecv to use.
36 // 4/5/00 mf Added method swapProcess for same reason: ELrecv wants to
37 // be able to mock up the process and reset it afterward.
38 // 6/6/00 web Consolidate ELadministrator/X; adapt to consolidated
39 // ELcout/X.
40 // 6/14/00 web Declare classes before granting friendship.
41 // 6/4/01 mf Grant friedship to ELtsErrorLog
42 // 3/6/02 mf Items for recovering handles to attached destinations:
43 // the attachedDestinations map,
44 // an additional signature for attach(),
45 // and getELdestControl() method
46 // 3/17/04 mf exitThreshold and setExitThreshold
47 // 1/10/06 mf finish
48 //
49 // ----------------------------------------------------------------------
50 
57 
58 #include <memory>
59 
60 namespace edm {
61  namespace service {
62 
63  // ----------------------------------------------------------------------
64  // Prerequisite classes:
65  // ----------------------------------------------------------------------
66 
67  class ELdestination;
68  class ELcout;
69  class MessageLoggerScribe;
70 
71  // ----------------------------------------------------------------------
72  // ELadministrator:
73  // ----------------------------------------------------------------------
74 
75  class ELadministrator { // *** Destructable Singleton Pattern ***
76 
77  friend class MessageLoggerScribe; // proper ELadministrator cleanup
78  friend class ThreadSafeLogMessageLoggerScribe; // proper ELadministrator cleanup
79  friend class ELcout; // ELcout behavior
80 
81  // *** Error Logger Functionality ***
82 
83  public:
85 
86  //Replaces ErrorLog which is no longer needed
87  void log(edm::ErrorObj& msg);
88 
89  // --- furnish/recall destinations:
90  //
91  std::shared_ptr<ELdestination> attach(std::shared_ptr<ELdestination> sink);
92 
93  // --- handle severity information:
94  //
96  int severityCount(const ELseverityLevel& sev) const;
97  int severityCount(const ELseverityLevel& from, const ELseverityLevel& to) const;
98  void resetSeverityCount(const ELseverityLevel& sev);
99  void resetSeverityCount(const ELseverityLevel& from, const ELseverityLevel& to);
100  void resetSeverityCount(); // reset all
101 
102  // --- apply the following actions to all attached destinations:
103  //
104  void setThresholds(const ELseverityLevel& sev);
105  void setLimits(const ELstring& id, int limit);
106  void setLimits(const ELseverityLevel& sev, int limit);
107  void setIntervals(const ELstring& id, int interval);
108  void setIntervals(const ELseverityLevel& sev, int interval);
109  void setTimespans(const ELstring& id, int seconds);
110  void setTimespans(const ELseverityLevel& sev, int seconds);
111  void wipe();
112  void finish();
113 
114  protected:
115  // --- member data accessors:
116  //
117  const ELseverityLevel& abortThreshold() const;
118  const ELseverityLevel& exitThreshold() const;
119  const ELseverityLevel& highSeverity() const;
120  int severityCounts(int lev) const;
121 
122  protected:
123  // --- traditional birth/death, but disallowed to users:
124  //
125  ELadministrator();
126 
127  private:
128  // --- traditional member data:
129  //
130  std::list<edm::propagate_const<std::shared_ptr<ELdestination>>> sinks_;
133 
134  std::map<ELstring, edm::propagate_const<std::shared_ptr<ELdestination>>> attachedDestinations_;
135 
136  }; // ELadministrator
137 
138  // ----------------------------------------------------------------------
139 
140  } // end of namespace service
141 } // end of namespace edm
142 
143 #endif // MessageService_ELadministrator_h
Ecal2004TBTDCRanges_v1_cff.endRun
endRun
Definition: Ecal2004TBTDCRanges_v1_cff.py:4
edm::service::ELadministrator::setIntervals
void setIntervals(const ELstring &id, int interval)
Definition: ELadministrator.cc:197
edm::service::ELadministrator::resetSeverityCount
void resetSeverityCount()
Definition: ELadministrator.cc:158
bk::beginJob
void beginJob()
Definition: Breakpoints.cc:14
service
Definition: service.py:1
ELlist.h
edm::RunID
Definition: RunID.h:28
ActivityRegistry
propagate_const.h
callbacks
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those callbacks
Definition: Activities.doc:12
phases
std::vector< int > phases
Definition: compareAlignments.cc:30
modules
Definition: ZHLTMatchFilter.cc:17
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::ErrorObj
Definition: ErrorObj.h:44
edm::service::ELadministrator::severityCounts
int severityCounts(int lev) const
Definition: ELadministrator.cc:169
to
ErrorObj.h
edm::service::ELadministrator::ELadministrator
ELadministrator()
Definition: ELadministrator.cc:233
mps_check.msg
tuple msg
Definition: mps_check.py:285
edm::service::ELadministrator::setThresholds
void setThresholds(const ELseverityLevel &sev)
Definition: ELadministrator.cc:179
edm::service::ELadministrator::highSeverity_
ELseverityLevel highSeverity_
Definition: ELadministrator.h:131
edm::service::ELadministrator::abortThreshold
const ELseverityLevel & abortThreshold() const
HLT_2018_cff.phase
phase
Definition: HLT_2018_cff.py:5346
edm::service::ELadministrator::severityCount
int severityCount(const ELseverityLevel &sev) const
Definition: ELadministrator.cc:131
brackets
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle brackets
Definition: Activities.doc:4
python.cmstools.all
def all(container)
workaround iterator generators for ROOT classes
Definition: cmstools.py:26
end
#define end
Definition: vmac.h:39
any
bool any(const std::vector< T > &v, const T &what)
Definition: ECalSD.cc:34
dqmdumpme.things
things
Definition: dqmdumpme.py:19
edm::ELstring
std::string ELstring
Definition: ELstring.h:21
MainPageGenerator.files
files
Definition: MainPageGenerator.py:256
edm::service::ELadministrator
Definition: ELadministrator.h:75
fileCollector.done
done
Definition: fileCollector.py:123
seconds
double seconds()
edm::service::ELadministrator::wipe
void wipe()
Definition: ELadministrator.cc:221
source
static const std::string source
Definition: EdmProvDump.cc:47
Mar
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Mar
Definition: Activities.doc:4
mix_E10TeV_L13E31_BX432_cfi.Lumi
Lumi
Definition: mix_E10TeV_L13E31_BX432_cfi.py:24
edm::service::MessageLoggerScribe
Definition: MessageLoggerScribe.h:86
LuminosityBlock
Event
edm::service::ELadministrator::setLimits
void setLimits(const ELstring &id, int limit)
Definition: ELadministrator.cc:185
edm::LuminosityBlockID
Definition: LuminosityBlockID.h:31
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
ELdestination.h
edm::service::ELadministrator::exitThreshold
const ELseverityLevel & exitThreshold() const
cppFunctionSkipper.exception
exception
Definition: cppFunctionSkipper.py:10
a
double a
Definition: hdecay.h:119
signature
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined signature
Definition: Activities.doc:4
edm::service::ELadministrator::~ELadministrator
~ELadministrator()
Definition: ELadministrator.cc:245
LaserDQM_cfg.process
process
Definition: LaserDQM_cfg.py:3
beam_dqm_sourceclient-live_cfg.monitor
monitor
Definition: beam_dqm_sourceclient-live_cfg.py:234
postprocess-scan-build.seen
seen
Definition: postprocess-scan-build.py:9
recoMuon::in
Definition: RecoMuonEnumerators.h:6
eventshapeDQM_cfi.order
order
Definition: eventshapeDQM_cfi.py:8
edm::ELseverityLevel::nLevels
Definition: ELseverityLevel.h:121
FrontierConditions_GlobalTag_cff.file
file
Definition: FrontierConditions_GlobalTag_cff.py:13
edm::service::ELadministrator::checkSeverity
ELseverityLevel checkSeverity()
Definition: ELadministrator.cc:124
readEcalDQMStatus.interval
interval
Definition: readEcalDQMStatus.py:18
DBConfiguration_cff.connect
connect
Definition: DBConfiguration_cff.py:18
edm::contains
bool contains(EventRange const &lh, EventID const &rh)
Definition: EventRange.cc:37
edm::service::ELadministrator::setTimespans
void setTimespans(const ELstring &id, int seconds)
Definition: ELadministrator.cc:209
module
Definition: vlib.h:198
edm::service::ELadministrator::attachedDestinations_
std::map< ELstring, edm::propagate_const< std::shared_ptr< ELdestination > > > attachedDestinations_
Definition: ELadministrator.h:134
ELseverityLevel.h
edm::service::ThreadSafeLogMessageLoggerScribe
Definition: ThreadSafeLogMessageLoggerScribe.h:38
timingPdfMaker.can
can
Definition: timingPdfMaker.py:311
edmIntegrityCheck.callback
callback
Definition: edmIntegrityCheck.py:75
mps_fire.Path
Path
Definition: mps_fire.py:290
writedatasetfile.run
run
Definition: writedatasetfile.py:27
edm::ELseverityLevel
Definition: ELseverityLevel.h:96
remoteMonitoring_LED_IterMethod_cfg.limit
limit
Definition: remoteMonitoring_LED_IterMethod_cfg.py:427
edm::service::ELadministrator::ELcout
friend class ELcout
Definition: ELadministrator.h:79
edm::service::ELadministrator::sinks_
std::list< edm::propagate_const< std::shared_ptr< ELdestination > > > sinks_
Definition: ELadministrator.h:130
angle
T angle(T x1, T y1, T z1, T x2, T y2, T z2)
Definition: angle.h:11
edm::service::ELadministrator::finish
void finish()
Definition: ELadministrator.cc:227
or
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
InputSource
Helper class to handle FWLite file input sources.
funct::void
TEMPL(T2) struct Divides void
Definition: Factorize.h:29
mps_check.finished
int finished
Definition: mps_check.py:36
ELstring.h
list
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*", "!HLTx*" if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL. It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of "!*" before the partial wildcard feature was incorporated). Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run
cms::cuda::be
int be
Definition: HistoContainer.h:126
EventSetup
edm::service::ELadministrator::log
void log(edm::ErrorObj &msg)
Definition: ELadministrator.cc:93
edm::EventID
Definition: EventID.h:31
edm::service::ELadministrator::highSeverity
const ELseverityLevel & highSeverity() const
Definition: ELadministrator.cc:167
lumi
Definition: LumiSectionData.h:20
eostools.which
def which(cmd)
Definition: eostools.py:336
edm::service::ELadministrator::severityCounts_
int severityCounts_[ELseverityLevel::nLevels]
Definition: ELadministrator.h:132
edm::service::ELadministrator::attach
std::shared_ptr< ELdestination > attach(std::shared_ptr< ELdestination > sink)
Definition: ELadministrator.cc:118
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
Run
edm::Timestamp
Definition: Timestamp.h:30