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  std::ostream& operator<<(std::ostream& os, GlobalContext const& gc) {
22  os << "GlobalContext: transition = ";
23  switch (gc.transition()) {
25  os << "BeginJob";
26  break;
28  os << "BeginRun";
29  break;
31  os << "BeginLuminosityBlock";
32  break;
34  os << "EndLuminosityBlock";
35  break;
37  os << "EndRun";
38  break;
40  os << "EndJob";
41  break;
43  os << "WriteRun";
44  break;
46  os << "WriteLuminosityBlock";
47  break;
48  }
49  os << "\n " << gc.luminosityBlockID() << "\n runIndex = " << gc.runIndex().value()
50  << " luminosityBlockIndex = " << gc.luminosityBlockIndex().value()
51  << " unixTime = " << gc.timestamp().unixTime() << " microsecondOffset = " << gc.timestamp().microsecondOffset()
52  << "\n";
53  if (gc.processContext()) {
54  os << " " << *gc.processContext();
55  }
56  return os;
57  }
58 
59  void exceptionContext(std::ostream& os, GlobalContext const& gc) {
60  os << "Processing ";
61  switch (gc.transition()) {
63  os << "begin Job";
64  break;
66  os << "global begin Run " << RunID(gc.luminosityBlockID().run());
67  break;
69  os << "global begin LuminosityBlock " << gc.luminosityBlockID();
70  break;
72  os << "global end LuminosityBlock " << gc.luminosityBlockID();
73  break;
75  os << "global end Run " << RunID(gc.luminosityBlockID().run());
76  break;
78  os << "endJob";
79  break;
81  os << "write Run " << RunID(gc.luminosityBlockID().run());
82  break;
84  os << "write LuminosityBlock " << gc.luminosityBlockID();
85  break;
86  }
87  }
88 
89 } // namespace edm
LuminosityBlockID const & luminosityBlockID() const
Definition: GlobalContext.h:55
unsigned int value() const
Definition: RunIndex.h:44
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:58
RunIndex const & runIndex() const
Definition: GlobalContext.h:56
LuminosityBlockIndex const & luminosityBlockIndex() const
Definition: GlobalContext.h:57
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:59
Transition transition() const
Definition: GlobalContext.h:49
HLT enums.
std::ostream & operator<<(std::ostream &ost, const HLTGlobalStatus &hlt)
Formatted printout of trigger tbale.