CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
fwlite::IOVSyncValue Class Reference

#include <IOVSyncValue.h>

Public Member Functions

const edm::EventIDeventID () const
 
 IOVSyncValue ()
 
 IOVSyncValue (const edm::EventID &iID)
 
 IOVSyncValue (const edm::Timestamp &iTime)
 
 IOVSyncValue (const edm::EventID &iID, const edm::Timestamp &iTime)
 
edm::LuminosityBlockNumber_t luminosityBlockNumber () const
 
bool operator!= (const IOVSyncValue &iRHS) const
 
bool operator< (const IOVSyncValue &iRHS) const
 
bool operator<= (const IOVSyncValue &iRHS) const
 
bool operator== (const IOVSyncValue &iRHS) const
 
bool operator> (const IOVSyncValue &iRHS) const
 
bool operator>= (const IOVSyncValue &iRHS) const
 
const edm::Timestamptime () const
 

Static Public Member Functions

static const IOVSyncValuebeginOfTime ()
 
static const IOVSyncValueendOfTime ()
 
static const IOVSyncValueinvalidIOVSyncValue ()
 

Private Member Functions

template<template< typename > class Op>
bool doOp (const IOVSyncValue &iRHS) const
 

Private Attributes

edm::EventID eventID_
 
bool haveID_
 
bool haveTime_
 
edm::Timestamp time_
 

Detailed Description

Definition at line 31 of file IOVSyncValue.h.

Constructor & Destructor Documentation

◆ IOVSyncValue() [1/4]

IOVSyncValue::IOVSyncValue ( )

Definition at line 31 of file IOVSyncValue.cc.

31 : eventID_(), time_(), haveID_(true), haveTime_(true) {}
edm::EventID eventID_
Definition: IOVSyncValue.h:91
edm::Timestamp time_
Definition: IOVSyncValue.h:92

◆ IOVSyncValue() [2/4]

IOVSyncValue::IOVSyncValue ( const edm::EventID iID)
explicit

Definition at line 33 of file IOVSyncValue.cc.

33 : eventID_(iID), time_(), haveID_(true), haveTime_(false) {}
edm::EventID eventID_
Definition: IOVSyncValue.h:91
edm::Timestamp time_
Definition: IOVSyncValue.h:92

◆ IOVSyncValue() [3/4]

IOVSyncValue::IOVSyncValue ( const edm::Timestamp iTime)
explicit

Definition at line 35 of file IOVSyncValue.cc.

35 : eventID_(), time_(iTime), haveID_(false), haveTime_(true) {}
edm::EventID eventID_
Definition: IOVSyncValue.h:91
edm::Timestamp time_
Definition: IOVSyncValue.h:92

◆ IOVSyncValue() [4/4]

IOVSyncValue::IOVSyncValue ( const edm::EventID iID,
const edm::Timestamp iTime 
)

Definition at line 37 of file IOVSyncValue.cc.

38  : eventID_(iID), time_(iTime), haveID_(true), haveTime_(true) {}
edm::EventID eventID_
Definition: IOVSyncValue.h:91
edm::Timestamp time_
Definition: IOVSyncValue.h:92

Member Function Documentation

◆ beginOfTime()

const IOVSyncValue & IOVSyncValue::beginOfTime ( )
static

Definition at line 82 of file IOVSyncValue.cc.

References edm::Timestamp::beginOfTime().

82  {
83  static const IOVSyncValue s_beginOfTime(edm::EventID(1, 0, 0), edm::Timestamp::beginOfTime());
84  return s_beginOfTime;
85  }
static Timestamp beginOfTime()
Definition: Timestamp.h:77

◆ doOp()

template<template< typename > class Op>
bool fwlite::IOVSyncValue::doOp ( const IOVSyncValue iRHS) const
inlineprivate

Definition at line 64 of file IOVSyncValue.h.

References eventID_, haveID_, haveTime_, luminosityBlockNumber(), findAndChange::op, edm::EventID::run(), and time_.

64  {
65  bool returnValue = false;
66  if (haveID_ && iRHS.haveID_) {
67  if (luminosityBlockNumber() == 0 || iRHS.luminosityBlockNumber() == 0 ||
68  luminosityBlockNumber() == iRHS.luminosityBlockNumber()) {
69  Op<edm::EventID> op;
70  returnValue = op(eventID_, iRHS.eventID_);
71  } else {
72  if (iRHS.eventID_.run() == eventID_.run()) {
73  Op<edm::LuminosityBlockNumber_t> op;
74  returnValue = op(luminosityBlockNumber(), iRHS.luminosityBlockNumber());
75  } else {
76  Op<edm::RunNumber_t> op;
77  returnValue = op(eventID_.run(), iRHS.eventID_.run());
78  }
79  }
80 
81  } else if (haveTime_ && iRHS.haveTime_) {
82  Op<edm::Timestamp> op;
83  returnValue = op(time_, iRHS.time_);
84  } else {
85  //error
86  }
87  return returnValue;
88  }
edm::LuminosityBlockNumber_t luminosityBlockNumber() const
Definition: IOVSyncValue.h:41
edm::EventID eventID_
Definition: IOVSyncValue.h:91
RunNumber_t run() const
Definition: EventID.h:38
edm::Timestamp time_
Definition: IOVSyncValue.h:92

◆ endOfTime()

const IOVSyncValue & IOVSyncValue::endOfTime ( )
static

Definition at line 76 of file IOVSyncValue.cc.

References edm::Timestamp::endOfTime(), edm::EventID::maxEventNumber(), and edm::LuminosityBlockID::maxLuminosityBlockNumber().

76  {
77  static const IOVSyncValue s_endOfTime(
80  return s_endOfTime;
81  }
static Timestamp endOfTime()
Definition: Timestamp.h:76
static LuminosityBlockNumber_t maxLuminosityBlockNumber()
static EventNumber_t maxEventNumber()
Definition: EventID.h:96

◆ eventID()

const edm::EventID& fwlite::IOVSyncValue::eventID ( ) const
inline

Definition at line 40 of file IOVSyncValue.h.

References eventID_.

Referenced by main(), and FWLiteESSource::setIntervalFor().

40 { return eventID_; }
edm::EventID eventID_
Definition: IOVSyncValue.h:91

◆ invalidIOVSyncValue()

const IOVSyncValue & IOVSyncValue::invalidIOVSyncValue ( )
static

Definition at line 72 of file IOVSyncValue.cc.

Referenced by fwlite::Record::syncTo().

72  {
73  static const IOVSyncValue s_invalid;
74  return s_invalid;
75  }

◆ luminosityBlockNumber()

edm::LuminosityBlockNumber_t fwlite::IOVSyncValue::luminosityBlockNumber ( ) const
inline

Definition at line 41 of file IOVSyncValue.h.

References eventID_, and edm::EventID::luminosityBlock().

Referenced by doOp().

41 { return eventID_.luminosityBlock(); }
LuminosityBlockNumber_t luminosityBlock() const
Definition: EventID.h:39
edm::EventID eventID_
Definition: IOVSyncValue.h:91

◆ operator!=()

bool fwlite::IOVSyncValue::operator!= ( const IOVSyncValue iRHS) const
inline

Definition at line 45 of file IOVSyncValue.h.

45 { return doOp<std::not_equal_to>(iRHS); }

◆ operator<()

bool fwlite::IOVSyncValue::operator< ( const IOVSyncValue iRHS) const
inline

Definition at line 47 of file IOVSyncValue.h.

47 { return doOp<std::less>(iRHS); }

◆ operator<=()

bool fwlite::IOVSyncValue::operator<= ( const IOVSyncValue iRHS) const
inline

Definition at line 48 of file IOVSyncValue.h.

48 { return doOp<std::less_equal>(iRHS); }

◆ operator==()

bool fwlite::IOVSyncValue::operator== ( const IOVSyncValue iRHS) const
inline

Definition at line 44 of file IOVSyncValue.h.

44 { return doOp<std::equal_to>(iRHS); }

◆ operator>()

bool fwlite::IOVSyncValue::operator> ( const IOVSyncValue iRHS) const
inline

Definition at line 49 of file IOVSyncValue.h.

49 { return doOp<std::greater>(iRHS); }

◆ operator>=()

bool fwlite::IOVSyncValue::operator>= ( const IOVSyncValue iRHS) const
inline

Definition at line 50 of file IOVSyncValue.h.

50 { return doOp<std::greater_equal>(iRHS); }

◆ time()

const edm::Timestamp& fwlite::IOVSyncValue::time ( ) const
inline

Definition at line 42 of file IOVSyncValue.h.

References time_.

Referenced by FWLiteESSource::setIntervalFor().

42 { return time_; }
edm::Timestamp time_
Definition: IOVSyncValue.h:92

Member Data Documentation

◆ eventID_

edm::EventID fwlite::IOVSyncValue::eventID_
private

Definition at line 91 of file IOVSyncValue.h.

Referenced by doOp(), eventID(), and luminosityBlockNumber().

◆ haveID_

bool fwlite::IOVSyncValue::haveID_
private

Definition at line 93 of file IOVSyncValue.h.

Referenced by doOp().

◆ haveTime_

bool fwlite::IOVSyncValue::haveTime_
private

Definition at line 94 of file IOVSyncValue.h.

Referenced by doOp().

◆ time_

edm::Timestamp fwlite::IOVSyncValue::time_
private

Definition at line 92 of file IOVSyncValue.h.

Referenced by doOp(), and time().