CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
edm::IOVSyncValue Class Reference

#include <IOVSyncValue.h>

Public Member Functions

bool comparable (const IOVSyncValue &iOther) const
 
const EventIDeventID () const
 
 IOVSyncValue ()
 
 IOVSyncValue (const EventID &iID)
 
 IOVSyncValue (const Timestamp &iTime)
 
 IOVSyncValue (const EventID &iID, const Timestamp &iTime)
 
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 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
 
void throwInvalidComparison () const
 

Private Attributes

EventID eventID_
 
bool haveID_
 
bool haveTime_
 
Timestamp time_
 

Detailed Description

Definition at line 31 of file IOVSyncValue.h.

Constructor & Destructor Documentation

IOVSyncValue::IOVSyncValue ( )

Definition at line 33 of file IOVSyncValue.cc.

33  : eventID_(), time_(),
34 haveID_(true), haveTime_(true)
35 {
36 }
IOVSyncValue::IOVSyncValue ( const EventID iID)
explicit

Definition at line 38 of file IOVSyncValue.cc.

38  : eventID_(iID), time_(),
39 haveID_(true), haveTime_(false)
40 {
41 }
IOVSyncValue::IOVSyncValue ( const Timestamp iTime)
explicit

Definition at line 43 of file IOVSyncValue.cc.

43  : eventID_(), time_(iTime),
44 haveID_(false), haveTime_(true)
45 {
46 }
IOVSyncValue::IOVSyncValue ( const EventID iID,
const Timestamp iTime 
)

Definition at line 48 of file IOVSyncValue.cc.

48  :
49 eventID_(iID), time_(iTime),
50 haveID_(true), haveTime_(true)
51 {
52 }

Member Function Documentation

const IOVSyncValue & IOVSyncValue::beginOfTime ( )
static

Definition at line 103 of file IOVSyncValue.cc.

References edm::Timestamp::beginOfTime().

Referenced by AlignmentProducer::applyDB(), PCLTrackerAlProducer::applyDB(), Phase2TrackerCablingCfgESSource::setIntervalFor(), SiPixelFakeCPEGenericErrorParmESSource::setIntervalFor(), SiPixelFakeGenErrorDBObjectESSource::setIntervalFor(), SiPixelFakeTemplateDBObjectESSource::setIntervalFor(), SiStripFedCablingFakeESSource::setIntervalFor(), SiStripHashedDetIdFakeESSource::setIntervalFor(), XMLIdealGeometryESSource::setIntervalFor(), QGLikelihoodESProducer::setIntervalFor(), QGLikelihoodSystematicsESProducer::setIntervalFor(), SiStripGainESSource::setIntervalFor(), RPCPerformanceESSource::setIntervalFor(), SiStripNoiseESSource::setIntervalFor(), SiStripPedestalsESSource::setIntervalFor(), CSCFakeNoiseMatrixConditions::setIntervalFor(), PhysicsTools::MVAComputerESSourceImpl< RecordType >::setIntervalFor(), CSCGainsConditions::setIntervalFor(), CSCCrosstalkConditions::setIntervalFor(), CSCPedestalsDBConditions::setIntervalFor(), CSCFakeDBGains::setIntervalFor(), SiStripTemplateEmptyFakeESSource< TObject, TRecord >::setIntervalFor(), CastorHardcodeCalibrations::setIntervalFor(), CSCNoiseMatrixConditions::setIntervalFor(), CSCNoiseMatrixDBConditions::setIntervalFor(), CSCCrosstalkDBConditions::setIntervalFor(), CSCFakeDBCrosstalk::setIntervalFor(), CSCFakeDBNoiseMatrix::setIntervalFor(), BeamSpotFakeConditions::setIntervalFor(), CSCFakeDBPedestals::setIntervalFor(), SiStripTemplateDepFakeESSource< TObject, TRecord, TService, DepTRecord, DepTObj >::setIntervalFor(), CSCBadChambersConditions::setIntervalFor(), SiStripTemplateFakeESSource< TObject, TRecord, TService >::setIntervalFor(), CSCBadStripsConditions::setIntervalFor(), CSCGainsDBConditions::setIntervalFor(), CSCGasGainCorrectionDBConditions::setIntervalFor(), CSCL1TPParametersConditions::setIntervalFor(), CSCChipSpeedCorrectionDBConditions::setIntervalFor(), CSCBadWiresConditions::setIntervalFor(), CSCCrateMapValues::setIntervalFor(), CSCDDUMapValues::setIntervalFor(), CSCChamberMapValues::setIntervalFor(), CSCFakeCrosstalkConditions::setIntervalFor(), CSCChamberIndexValues::setIntervalFor(), CSCChamberTimeCorrectionsValues::setIntervalFor(), SiStripQualityFakeESSource::setIntervalFor(), CSCFakeGainsConditions::setIntervalFor(), CSCFakePedestalsConditions::setIntervalFor(), CastorTextCalibrations::setIntervalFor(), HiTrivialConditionRetriever::setIntervalFor(), HcalOmdsCalibrations::setIntervalFor(), HepPDTESSource::setIntervalFor(), edm::eventsetup::IntersectingIOVRecordIntervalFinder::setIntervalFor(), DTFakeT0ESProducer::setIntervalFor(), SiPixelFakeGainOfflineESSource::setIntervalFor(), SiPixelFakeGainESSource::setIntervalFor(), edm::ESProducerLooper::setIntervalFor(), SiPixelFakeGainForHLTESSource::setIntervalFor(), SiPixelFakeLorentzAngleESSource::setIntervalFor(), SiPixelFakeQualityESSource::setIntervalFor(), ElectronLikelihoodESSource::setIntervalFor(), SiPixelQualityESProducer::setIntervalFor(), HcalTextCalibrations::setIntervalFor(), edm::eventsetup::DependentRecordIntervalFinder::setIntervalFor(), HcalHardcodeCalibrations::setIntervalFor(), CaloMiscalibTools::setIntervalFor(), CaloMiscalibToolsMC::setIntervalFor(), ESTrivialConditionRetriever::setIntervalFor(), SiStripFedCablingBuilderFromDb::setIntervalFor(), JetCorrectionESSource< Corrector >::setIntervalFor(), FakeAlignmentSource::setIntervalFor(), and EcalTrivialConditionRetriever::setIntervalFor().

103  {
104  static IOVSyncValue s_beginOfTime(EventID(1,0,0), Timestamp::beginOfTime());
105  return s_beginOfTime;
106 }
static Timestamp beginOfTime()
Definition: Timestamp.h:103
bool edm::IOVSyncValue::comparable ( const IOVSyncValue iOther) const
inline
returns true if comparison operations are possible. Comparisons only fail if

a time only value is compared to a run/lumi/event only value.

Definition at line 69 of file IOVSyncValue.h.

References haveID_, and haveTime_.

Referenced by operator!=(), operator==(), and edm::eventsetup::DependentRecordIntervalFinder::setIntervalFor().

69  {
70  return (haveID_==iOther.haveID_) || (haveTime_==iOther.haveTime_);
71  }
template<template< typename > class Op>
bool edm::IOVSyncValue::doOp ( const IOVSyncValue iRHS) const
inlineprivate

Definition at line 86 of file IOVSyncValue.h.

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

86  {
87  bool returnValue = false;
88  if(haveID_ && iRHS.haveID_) {
89  if(luminosityBlockNumber()==0 || iRHS.luminosityBlockNumber()==0 || luminosityBlockNumber()==iRHS.luminosityBlockNumber()) {
90  Op<EventID> op;
91  returnValue = op(eventID_, iRHS.eventID_);
92  } else {
93  if(iRHS.eventID_.run() == eventID_.run()) {
94  Op<LuminosityBlockNumber_t> op;
95  returnValue = op(luminosityBlockNumber(), iRHS.luminosityBlockNumber());
96  } else {
97  Op<RunNumber_t> op;
98  returnValue = op(eventID_.run(), iRHS.eventID_.run());
99  }
100  }
101 
102  } else if (haveTime_ && iRHS.haveTime_) {
103  Op<Timestamp> op;
104  returnValue = op(time_, iRHS.time_);
105  } else {
106  //error
108  }
109  return returnValue;
110  }
RunNumber_t run() const
Definition: EventID.h:39
void throwInvalidComparison() const
Definition: IOVSyncValue.cc:83
LuminosityBlockNumber_t luminosityBlockNumber() const
Definition: IOVSyncValue.h:43
const IOVSyncValue & IOVSyncValue::endOfTime ( )
static

Definition at line 97 of file IOVSyncValue.cc.

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

Referenced by EcalTestDevDB::analyze(), AlignmentProducer::applyDB(), PCLTrackerAlProducer::applyDB(), Phase2TrackerCablingCfgESSource::setIntervalFor(), edm::EmptyESSource::setIntervalFor(), SiPixelFakeCPEGenericErrorParmESSource::setIntervalFor(), SiPixelFakeGenErrorDBObjectESSource::setIntervalFor(), SiPixelFakeTemplateDBObjectESSource::setIntervalFor(), QGLikelihoodSystematicsESProducer::setIntervalFor(), SiStripFedCablingFakeESSource::setIntervalFor(), SiStripHashedDetIdFakeESSource::setIntervalFor(), XMLIdealGeometryESSource::setIntervalFor(), QGLikelihoodESProducer::setIntervalFor(), SiStripGainESSource::setIntervalFor(), RPCPerformanceESSource::setIntervalFor(), SiStripPedestalsESSource::setIntervalFor(), SiStripNoiseESSource::setIntervalFor(), CSCFakeNoiseMatrixConditions::setIntervalFor(), PhysicsTools::MVAComputerESSourceImpl< RecordType >::setIntervalFor(), CSCGainsConditions::setIntervalFor(), CSCCrosstalkConditions::setIntervalFor(), CSCPedestalsDBConditions::setIntervalFor(), CSCFakeDBGains::setIntervalFor(), SiStripTemplateEmptyFakeESSource< TObject, TRecord >::setIntervalFor(), CastorHardcodeCalibrations::setIntervalFor(), CSCNoiseMatrixConditions::setIntervalFor(), CSCNoiseMatrixDBConditions::setIntervalFor(), CSCCrosstalkDBConditions::setIntervalFor(), BeamSpotFakeConditions::setIntervalFor(), CSCFakeDBCrosstalk::setIntervalFor(), CSCFakeDBNoiseMatrix::setIntervalFor(), CSCFakeDBPedestals::setIntervalFor(), SiStripTemplateDepFakeESSource< TObject, TRecord, TService, DepTRecord, DepTObj >::setIntervalFor(), CSCBadChambersConditions::setIntervalFor(), SiStripTemplateFakeESSource< TObject, TRecord, TService >::setIntervalFor(), CSCBadStripsConditions::setIntervalFor(), CSCGainsDBConditions::setIntervalFor(), CSCGasGainCorrectionDBConditions::setIntervalFor(), CSCL1TPParametersConditions::setIntervalFor(), CSCChipSpeedCorrectionDBConditions::setIntervalFor(), CSCBadWiresConditions::setIntervalFor(), CSCChamberIndexValues::setIntervalFor(), CSCChamberMapValues::setIntervalFor(), CSCCrateMapValues::setIntervalFor(), CSCFakeCrosstalkConditions::setIntervalFor(), CSCDDUMapValues::setIntervalFor(), CSCChamberTimeCorrectionsValues::setIntervalFor(), SiStripQualityFakeESSource::setIntervalFor(), CSCFakeGainsConditions::setIntervalFor(), CSCFakePedestalsConditions::setIntervalFor(), CastorTextCalibrations::setIntervalFor(), HiTrivialConditionRetriever::setIntervalFor(), HcalOmdsCalibrations::setIntervalFor(), HepPDTESSource::setIntervalFor(), DTFakeT0ESProducer::setIntervalFor(), edm::eventsetup::IntersectingIOVRecordIntervalFinder::setIntervalFor(), SiPixelFakeGainESSource::setIntervalFor(), SiPixelFakeGainForHLTESSource::setIntervalFor(), edm::ESProducerLooper::setIntervalFor(), SiPixelFakeGainOfflineESSource::setIntervalFor(), SiPixelFakeQualityESSource::setIntervalFor(), SiPixelFakeLorentzAngleESSource::setIntervalFor(), TotemRPIncludeAlignments::setIntervalFor(), ElectronLikelihoodESSource::setIntervalFor(), SiPixelQualityESProducer::setIntervalFor(), HcalTextCalibrations::setIntervalFor(), edm::eventsetup::DependentRecordIntervalFinder::setIntervalFor(), HcalHardcodeCalibrations::setIntervalFor(), CaloMiscalibTools::setIntervalFor(), CaloMiscalibToolsMC::setIntervalFor(), ESTrivialConditionRetriever::setIntervalFor(), SiStripFedCablingBuilderFromDb::setIntervalFor(), JetCorrectionESSource< Corrector >::setIntervalFor(), FakeAlignmentSource::setIntervalFor(), FWLiteESSource::setIntervalFor(), and EcalTrivialConditionRetriever::setIntervalFor().

97  {
98  static IOVSyncValue s_endOfTime(EventID(0xFFFFFFFFUL, LuminosityBlockID::maxLuminosityBlockNumber(), EventID::maxEventNumber()),
100  return s_endOfTime;
101 }
static Timestamp endOfTime()
Definition: Timestamp.h:102
static LuminosityBlockNumber_t maxLuminosityBlockNumber()
static EventNumber_t maxEventNumber()
Definition: EventID.h:111
const EventID& edm::IOVSyncValue::eventID ( ) const
inline
const IOVSyncValue & IOVSyncValue::invalidIOVSyncValue ( )
static
LuminosityBlockNumber_t edm::IOVSyncValue::luminosityBlockNumber ( ) const
inline
bool edm::IOVSyncValue::operator!= ( const IOVSyncValue iRHS) const
inline

Definition at line 49 of file IOVSyncValue.h.

References comparable().

49  {
50  return (!comparable(iRHS)) || doOp<std::not_equal_to>(iRHS);
51  }
bool comparable(const IOVSyncValue &iOther) const
Definition: IOVSyncValue.h:69
bool edm::IOVSyncValue::operator< ( const IOVSyncValue iRHS) const
inline

Definition at line 53 of file IOVSyncValue.h.

53  {
54  return doOp<std::less>(iRHS);
55  }
bool edm::IOVSyncValue::operator<= ( const IOVSyncValue iRHS) const
inline

Definition at line 56 of file IOVSyncValue.h.

56  {
57  return doOp<std::less_equal>(iRHS);
58  }
bool edm::IOVSyncValue::operator== ( const IOVSyncValue iRHS) const
inline

Definition at line 46 of file IOVSyncValue.h.

References comparable().

46  {
47  return comparable(iRHS) && doOp<std::equal_to>(iRHS);
48  }
bool comparable(const IOVSyncValue &iOther) const
Definition: IOVSyncValue.h:69
bool edm::IOVSyncValue::operator> ( const IOVSyncValue iRHS) const
inline

Definition at line 59 of file IOVSyncValue.h.

59  {
60  return doOp<std::greater>(iRHS);
61  }
bool edm::IOVSyncValue::operator>= ( const IOVSyncValue iRHS) const
inline

Definition at line 62 of file IOVSyncValue.h.

62  {
63  return doOp<std::greater_equal>(iRHS);
64  }
void IOVSyncValue::throwInvalidComparison ( ) const
private

Definition at line 83 of file IOVSyncValue.cc.

References Exception.

Referenced by doOp().

83  {
84  throw cms::Exception("InvalidIOVSyncValueComparison")
85  <<"Attempted to compare a time-only and a run/lumi/event-only IOVSyncValue. Please report this error to the framework experts.";
86 }
const Timestamp& edm::IOVSyncValue::time ( ) const
inline

Member Data Documentation

EventID edm::IOVSyncValue::eventID_
private

Definition at line 113 of file IOVSyncValue.h.

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

bool edm::IOVSyncValue::haveID_
private

Definition at line 115 of file IOVSyncValue.h.

Referenced by comparable(), and doOp().

bool edm::IOVSyncValue::haveTime_
private

Definition at line 116 of file IOVSyncValue.h.

Referenced by comparable(), and doOp().

Timestamp edm::IOVSyncValue::time_
private

Definition at line 114 of file IOVSyncValue.h.

Referenced by doOp(), and time().