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::EventID &iID, const edm::Timestamp &iTime)
 
 IOVSyncValue (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) {}

◆ 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) {}

◆ 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) {}

◆ 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) {}

Member Function Documentation

◆ beginOfTime()

const IOVSyncValue & IOVSyncValue::beginOfTime ( )
static

Definition at line 82 of file IOVSyncValue.cc.

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

References edm::Timestamp::beginOfTime().

◆ doOp()

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

Definition at line 64 of file IOVSyncValue.h.

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  }

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

◆ endOfTime()

const IOVSyncValue & IOVSyncValue::endOfTime ( )
static

◆ eventID()

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

Definition at line 40 of file IOVSyncValue.h.

40 { return eventID_; }

References eventID_.

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

◆ invalidIOVSyncValue()

const IOVSyncValue & IOVSyncValue::invalidIOVSyncValue ( )
static

Definition at line 72 of file IOVSyncValue.cc.

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

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

◆ luminosityBlockNumber()

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

Definition at line 41 of file IOVSyncValue.h.

41 { return eventID_.luminosityBlock(); }

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

Referenced by doOp().

◆ 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.

42 { return time_; }

References time_.

Referenced by FWLiteESSource::setIntervalFor().

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().

edm::Timestamp::beginOfTime
static Timestamp beginOfTime()
Definition: Timestamp.h:84
edm::EventID::luminosityBlock
LuminosityBlockNumber_t luminosityBlock() const
Definition: EventID.h:39
fwlite::IOVSyncValue::haveTime_
bool haveTime_
Definition: IOVSyncValue.h:94
fwlite::IOVSyncValue::luminosityBlockNumber
edm::LuminosityBlockNumber_t luminosityBlockNumber() const
Definition: IOVSyncValue.h:41
fwlite::IOVSyncValue::eventID_
edm::EventID eventID_
Definition: IOVSyncValue.h:91
IOVSyncValue
edm::EventID::run
RunNumber_t run() const
Definition: EventID.h:38
edm::EventID::maxEventNumber
static EventNumber_t maxEventNumber()
Definition: EventID.h:96
edm::Timestamp::endOfTime
static Timestamp endOfTime()
Definition: Timestamp.h:83
fwlite::IOVSyncValue::time_
edm::Timestamp time_
Definition: IOVSyncValue.h:92
edm::EventID
Definition: EventID.h:31
fwlite::IOVSyncValue::haveID_
bool haveID_
Definition: IOVSyncValue.h:93
edm::LuminosityBlockID::maxLuminosityBlockNumber
static LuminosityBlockNumber_t maxLuminosityBlockNumber()
Definition: LuminosityBlockID.h:84