CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ConvertIOVSyncValue.cc
Go to the documentation of this file.
3 
4 
5 namespace cond {
6 
8  switch (timetype) {
9  case cond::runnumber :
10  return edm::IOVSyncValue( edm::EventID(time,
11  startOrStop ? 0 : edm::EventID::maxEventNumber(),
12  startOrStop ? 0 : edm::EventID::maxEventNumber())
13  );
14  case cond::lumiid :
15  {
18  l.luminosityBlock(),
19  startOrStop ? 0 : edm::EventID::maxEventNumber())
20  );
21  }
22  case cond::timestamp :
23  return edm::IOVSyncValue( edm::Timestamp(time));
24  default:
26  }
27  }
28 
30  switch (timetype) {
31  case cond::runnumber :
32  return time.eventID().run();
33  case cond::lumiid :
34  {
36  return lum.value();
37  }
38  case cond::timestamp :
39  return time.time().value();
40  default:
41  return 0;
42  }
43  }
44 
45  // the minimal maximum-time an IOV can extend to
47  switch (timetype) {
48  case cond::runnumber :
49  // last lumi and event of this run
50  return edm::IOVSyncValue( edm::EventID(time,
53  );
54  case cond::lumiid :
55  {
56  // the same lumiblock
59  l.luminosityBlock(),
61  );
62  }
63  case cond::timestamp :
64  // next event ?
66  default:
68  }
69  }
70 
72  switch (timetype) {
73  case cond::runnumber :
74  // last event of this run
75  return edm::IOVSyncValue(edm::EventID(time.eventID().run(),
78  );
79  case cond::lumiid :
80  // the same lumiblock
81  return edm::IOVSyncValue(edm::EventID(time.eventID().run(),
82  time.luminosityBlockNumber(),
84  );
85  case cond::timestamp :
86  // same lumiblock
87  return edm::IOVSyncValue(edm::EventID(time.eventID().run(),
88  time.luminosityBlockNumber(),
90  );
91  default:
93  }
94  }
95 
96 }
97 
98 
RunNumber_t run() const
Definition: EventID.h:42
edm::IOVSyncValue limitedIOVSyncValue(cond::Time_t time, cond::TimeType timetype)
const EventID & eventID() const
Definition: IOVSyncValue.h:42
boost::uint64_t value() const
TimeType
Definition: Time.h:21
edm::IOVSyncValue toIOVSyncValue(cond::Time_t time, cond::TimeType timetype, bool startOrStop)
unsigned long long Time_t
Definition: Time.h:16
LuminosityBlockNumber_t luminosityBlockNumber() const
Definition: IOVSyncValue.h:43
RunNumber_t run() const
TimeValue_t value() const
Definition: Timestamp.cc:72
LuminosityBlockNumber_t luminosityBlock() const
static EventNumber_t maxEventNumber()
Definition: EventID.h:106
const Timestamp & time() const
Definition: IOVSyncValue.h:44
cond::Time_t fromIOVSyncValue(edm::IOVSyncValue const &time, cond::TimeType timetype)
static const IOVSyncValue & invalidIOVSyncValue()
Definition: IOVSyncValue.cc:92