CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 << "BeginProcessBlock";
29  break;
31  os << "AccessInputProcessBlock";
32  break;
34  os << "BeginRun";
35  break;
37  os << "BeginLuminosityBlock";
38  break;
40  os << "EndLuminosityBlock";
41  break;
43  os << "EndRun";
44  break;
46  os << "EndProcessBlock";
47  break;
49  os << "EndJob";
50  break;
52  os << "WriteProcessBlock";
53  break;
55  os << "WriteRun";
56  break;
58  os << "WriteLuminosityBlock";
59  break;
60  }
61  os << "\n " << gc.luminosityBlockID() << "\n runIndex = " << gc.runIndex().value()
62  << " luminosityBlockIndex = " << gc.luminosityBlockIndex().value()
63  << " unixTime = " << gc.timestamp().unixTime() << " microsecondOffset = " << gc.timestamp().microsecondOffset()
64  << "\n";
65  if (gc.processContext()) {
66  os << " " << *gc.processContext();
67  }
68  return os;
69  }
70 
71  void exceptionContext(std::ostream& os, GlobalContext const& gc) {
72  os << "Processing ";
73  switch (gc.transition()) {
75  os << "begin Job";
76  break;
78  os << "begin ProcessBlock";
79  break;
81  os << "access input ProcessBlock";
82  break;
84  os << "global begin Run " << RunID(gc.luminosityBlockID().run());
85  break;
87  os << "global begin LuminosityBlock " << gc.luminosityBlockID();
88  break;
90  os << "global end LuminosityBlock " << gc.luminosityBlockID();
91  break;
93  os << "global end Run " << RunID(gc.luminosityBlockID().run());
94  break;
96  os << "end ProcessBlock";
97  break;
99  os << "endJob";
100  break;
102  os << "write ProcessBlock";
103  break;
105  os << "write Run " << RunID(gc.luminosityBlockID().run());
106  break;
108  os << "write LuminosityBlock " << gc.luminosityBlockID();
109  break;
110  }
111  }
112 
113 } // namespace edm
void exceptionContext(cms::Exception &, ESModuleCallingContext const &)
LuminosityBlockID const & luminosityBlockID() const
Definition: GlobalContext.h:60
unsigned int value() const
Definition: RunIndex.h:45
unsigned int microsecondOffset() const
Microseconds offset within second.
Definition: Timestamp.h:43
Timestamp const & timestamp() const
Definition: GlobalContext.h:63
RunIndex const & runIndex() const
Definition: GlobalContext.h:61
LuminosityBlockIndex const & luminosityBlockIndex() const
Definition: GlobalContext.h:62
RunNumber_t run() const
unsigned int value() const
unsigned int unixTime() const
Time in seconds since January 1, 1970.
Definition: Timestamp.h:40
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:64
Transition transition() const
Definition: GlobalContext.h:53
std::ostream & operator<<(std::ostream &ost, const HLTGlobalStatus &hlt)
Formatted printout of trigger tbale.