CMS 3D CMS Logo

GlobalContext.cc
Go to the documentation of this file.
3 
4 #include <ostream>
5 
6 namespace edm {
7 
9  LuminosityBlockID const& luminosityBlockID,
10  RunIndex const& runIndex,
11  LuminosityBlockIndex const& luminosityBlockIndex,
12  Timestamp const & timestamp,
13  ProcessContext const* processContext) :
14  transition_(transition),
15  luminosityBlockID_(luminosityBlockID),
16  runIndex_(runIndex),
17  luminosityBlockIndex_(luminosityBlockIndex),
18  timestamp_(timestamp),
19  processContext_(processContext) {
20  }
21 
22  std::ostream& operator<<(std::ostream& os, GlobalContext const& gc) {
23  os << "GlobalContext: transition = ";
24  switch (gc.transition()) {
26  os << "BeginJob";
27  break;
29  os << "BeginRun";
30  break;
32  os << "BeginLuminosityBlock";
33  break;
35  os << "EndLuminosityBlock";
36  break;
38  os << "EndRun";
39  break;
41  os << "EndJob";
42  break;
44  os << "WriteRun";
45  break;
47  os << "WriteLuminosityBlock";
48  break;
49  }
50  os << "\n " << gc.luminosityBlockID()
51  << "\n runIndex = " << gc.runIndex().value()
52  << " luminosityBlockIndex = " << gc.luminosityBlockIndex().value()
53  << " unixTime = " << gc.timestamp().unixTime()
54  << " microsecondOffset = " << gc.timestamp().microsecondOffset() <<"\n";
55  if(gc.processContext()) {
56  os << " " << *gc.processContext();
57  }
58  return os;
59  }
60 
61  void exceptionContext(std::ostream& os, GlobalContext const& gc) {
62  os << "Processing ";
63  switch (gc.transition()) {
65  os << "begin Job";
66  break;
68  os << "global begin Run " <<RunID(gc.luminosityBlockID().run());
69  break;
71  os << "global begin LuminosityBlock "<<gc.luminosityBlockID();
72  break;
74  os << "global end LuminosityBlock "<<gc.luminosityBlockID();
75  break;
77  os << "global end Run "<<RunID(gc.luminosityBlockID().run());
78  break;
80  os << "endJob";
81  break;
83  os << "write Run "<<RunID(gc.luminosityBlockID().run());
84  break;
86  os << "write LuminosityBlock "<<gc.luminosityBlockID();
87  break;
88  }
89  }
90 
91 }
LuminosityBlockID const & luminosityBlockID() const
Definition: GlobalContext.h:57
unsigned int value() const
Definition: RunIndex.h:50
void exceptionContext(std::ostream &, GlobalContext const &)
unsigned int microsecondOffset() const
Microseconds offset within second.
Definition: Timestamp.h:52
Timestamp const & timestamp() const
Definition: GlobalContext.h:60
RunIndex const & runIndex() const
Definition: GlobalContext.h:58
LuminosityBlockIndex const & luminosityBlockIndex() const
Definition: GlobalContext.h:59
RunNumber_t run() const
unsigned int value() const
unsigned int unixTime() const
Time in seconds since January 1, 1970.
Definition: Timestamp.h:46
GlobalContext(Transition transition, LuminosityBlockID const &luminosityBlockID, RunIndex const &runIndex, LuminosityBlockIndex const &luminosityBlockIndex, Timestamp const &timestamp, ProcessContext const *processContext)
Definition: GlobalContext.cc:8
ProcessContext const * processContext() const
Definition: GlobalContext.h:61
Transition transition() const
Definition: GlobalContext.h:51
HLT enums.
std::ostream & operator<<(std::ostream &ost, const HLTGlobalStatus &hlt)
Formatted printout of trigger tbale.