CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
StreamContext.cc
Go to the documentation of this file.
3 
4 #include <ostream>
5 
6 namespace edm {
7 
9  ProcessContext const* processContext) :
10  streamID_(streamID),
11  transition_(Transition::kInvalid),
12  eventID_(EventID(0,0,0)),
13  runIndex_(RunIndex::invalidRunIndex()),
14  luminosityBlockIndex_(LuminosityBlockIndex::invalidLuminosityBlockIndex()),
15  timestamp_(),
16  processContext_(processContext) {
17  }
18 
20  Transition transition,
21  EventID const& eventID,
22  RunIndex const& runIndex,
23  LuminosityBlockIndex const& luminosityBlockIndex,
24  Timestamp const& timestamp,
25  ProcessContext const* processContext) :
26  streamID_(streamID),
27  transition_(transition),
28  eventID_(eventID),
29  runIndex_(runIndex),
30  luminosityBlockIndex_(luminosityBlockIndex),
31  timestamp_(timestamp),
32  processContext_(processContext) {
33  }
34 
35  std::ostream& operator<<(std::ostream& os, StreamContext const& sc) {
36  os << "StreamContext: StreamID = " << sc.streamID()
37  << " transition = ";
38  switch (sc.transition()) {
40  os << "BeginStream";
41  break;
43  os << "BeginRun";
44  break;
46  os << "BeginLuminosityBlock";
47  break;
49  os << "Event";
50  break;
52  os << "EndLuminosityBlock";
53  break;
55  os << "EndRun";
56  break;
58  os << "EndStream";
59  break;
61  os << "Invalid";
62  break;
63  }
64  os << "\n " << sc.eventID()
65  << "\n runIndex = " << sc.runIndex().value()
66  << " luminosityBlockIndex = " << sc.luminosityBlockIndex().value()
67  << " unixTime = " << sc.timestamp().unixTime()
68  << " microsecondOffset = " << sc.timestamp().microsecondOffset() <<"\n";
69  if(sc.processContext()) {
70  os << " " << *sc.processContext();
71  }
72  return os;
73  }
74 }
LuminosityBlockIndex const & luminosityBlockIndex() const
Definition: StreamContext.h:61
unsigned int value() const
Definition: RunIndex.h:50
RunIndex const & runIndex() const
Definition: StreamContext.h:60
unsigned int microsecondOffset() const
Microseconds offset within second.
Definition: Timestamp.h:52
Transition transition() const
Definition: StreamContext.h:58
StreamContext(StreamID const &streamID, ProcessContext const *processContext)
Definition: StreamContext.cc:8
unsigned int value() const
unsigned int unixTime() const
Time in seconds since January 1, 1970.
Definition: Timestamp.h:46
ProcessContext const * processContext() const
Definition: StreamContext.h:63
StreamID const & streamID() const
Definition: StreamContext.h:57
EventID const & eventID() const
Definition: StreamContext.h:59
std::ostream & operator<<(std::ostream &ost, const HLTGlobalStatus &hlt)
Formatted printout of trigger tbale.
Timestamp const & timestamp() const
Definition: StreamContext.h:62