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 << "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
edm::GlobalContext::luminosityBlockID
LuminosityBlockID const & luminosityBlockID() const
Definition: GlobalContext.h:60
edm::exceptionContext
void exceptionContext(std::ostream &, GlobalContext const &)
Definition: GlobalContext.cc:71
edm::RunID
Definition: RunID.h:28
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::GlobalContext::processContext
ProcessContext const * processContext() const
Definition: GlobalContext.h:64
edm::ProcessContext
Definition: ProcessContext.h:27
edm::Timestamp::unixTime
unsigned int unixTime() const
Time in seconds since January 1, 1970.
Definition: Timestamp.h:40
edm::GlobalContext::Transition::kWriteProcessBlock
edm::GlobalContext::Transition
Transition
Definition: GlobalContext.h:31
edm::GlobalContext::Transition::kAccessInputProcessBlock
edm::GlobalContext::Transition::kBeginJob
edm::GlobalContext::Transition::kEndRun
edm::GlobalContext::transition
Transition transition() const
Definition: GlobalContext.h:53
edm::operator<<
std::ostream & operator<<(std::ostream &ost, const HLTGlobalStatus &hlt)
Formatted printout of trigger tbale.
Definition: HLTGlobalStatus.h:106
edm::LuminosityBlockIndex::value
unsigned int value() const
Definition: LuminosityBlockIndex.h:47
cond::timestamp
Definition: Time.h:19
edm::LuminosityBlockIndex
Definition: LuminosityBlockIndex.h:33
edm::GlobalContext::luminosityBlockIndex
LuminosityBlockIndex const & luminosityBlockIndex() const
Definition: GlobalContext.h:62
edm::GlobalContext::GlobalContext
GlobalContext(Transition transition, LuminosityBlockID const &luminosityBlockID, RunIndex const &runIndex, LuminosityBlockIndex const &luminosityBlockIndex, Timestamp const &timestamp, ProcessContext const *processContext)
Definition: GlobalContext.cc:8
edm::GlobalContext::Transition::kEndLuminosityBlock
edm::LuminosityBlockID
Definition: LuminosityBlockID.h:31
edm::GlobalContext::Transition::kWriteLuminosityBlock
edm::GlobalContext
Definition: GlobalContext.h:29
csv2json.runIndex
runIndex
Definition: csv2json.py:29
GlobalContext.h
edm::GlobalContext::Transition::kEndProcessBlock
edm::GlobalContext::Transition::kBeginLuminosityBlock
edm::GlobalContext::Transition::kWriteRun
edm::Timestamp::microsecondOffset
unsigned int microsecondOffset() const
Microseconds offset within second.
Definition: Timestamp.h:43
edm::GlobalContext::timestamp
Timestamp const & timestamp() const
Definition: GlobalContext.h:63
edm::GlobalContext::Transition::kEndJob
edm::RunIndex
Definition: RunIndex.h:32
edm::LuminosityBlockID::run
RunNumber_t run() const
Definition: LuminosityBlockID.h:41
edm::GlobalContext::runIndex
RunIndex const & runIndex() const
Definition: GlobalContext.h:61
edm::GlobalContext::Transition::kBeginProcessBlock
ProcessContext.h
edm::RunIndex::value
unsigned int value() const
Definition: RunIndex.h:45
edm::GlobalContext::Transition::kBeginRun
edm::Timestamp
Definition: Timestamp.h:30