CMS 3D CMS Logo

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 AlignmentProducerBase::applyDB(), comparable(), RPAlignmentCorrectionsMethods::iovValueToString(), RPAlignmentCorrectionsMethods::loadFromXML(), Phase2TrackerCablingCfgESSource::setIntervalFor(), SiPixelFakeCPEGenericErrorParmESSource::setIntervalFor(), SiPixelFakeTemplateDBObjectESSource::setIntervalFor(), SiPixelFakeGenErrorDBObjectESSource::setIntervalFor(), QGLikelihoodESProducer::setIntervalFor(), QGLikelihoodSystematicsESProducer::setIntervalFor(), XMLIdealGeometryESSource::setIntervalFor(), SiStripFedCablingFakeESSource::setIntervalFor(), SiStripHashedDetIdFakeESSource::setIntervalFor(), SiStripGainESSource::setIntervalFor(), RPCPerformanceESSource::setIntervalFor(), SiStripApvGainFakeESSource::setIntervalFor(), SiStripBackPlaneCorrectionFakeESSource::setIntervalFor(), SiStripConfObjectFakeESSource::setIntervalFor(), SiStripBaseDelayFakeESSource::setIntervalFor(), SiStripLatencyFakeESSource::setIntervalFor(), SiStripThresholdFakeESSource::setIntervalFor(), SiStripPedestalsFakeESSource::setIntervalFor(), SiStripNoiseESSource::setIntervalFor(), SiStripPedestalsESSource::setIntervalFor(), HBHEDarkeningEP::setIntervalFor(), CSCFakeDBGains::setIntervalFor(), SiStripBadModuleConfigurableFakeESSource::setIntervalFor(), HcalTimeSlewEP::setIntervalFor(), CSCFakeNoiseMatrixConditions::setIntervalFor(), PhysicsTools::MVAComputerESSourceImpl< RecordType >::setIntervalFor(), BeamSpotFakeConditions::setIntervalFor(), CSCGainsConditions::setIntervalFor(), SiStripTemplateEmptyFakeESSource< TObject, TRecord >::setIntervalFor(), CastorHardcodeCalibrations::setIntervalFor(), CSCNoiseMatrixDBConditions::setIntervalFor(), CSCPedestalsDBConditions::setIntervalFor(), CSCCrosstalkConditions::setIntervalFor(), CSCFakeDBCrosstalk::setIntervalFor(), CSCFakeDBNoiseMatrix::setIntervalFor(), CSCFakeDBPedestals::setIntervalFor(), CSCNoiseMatrixConditions::setIntervalFor(), CSCChipSpeedCorrectionDBConditions::setIntervalFor(), CSCCrosstalkDBConditions::setIntervalFor(), CSCBadChambersConditions::setIntervalFor(), SiStripNoisesFakeESSource::setIntervalFor(), CSCGainsDBConditions::setIntervalFor(), CSCGasGainCorrectionDBConditions::setIntervalFor(), CSCBadStripsConditions::setIntervalFor(), CSCL1TPParametersConditions::setIntervalFor(), CSCBadWiresConditions::setIntervalFor(), CSCDDUMapValues::setIntervalFor(), CSCFakeCrosstalkConditions::setIntervalFor(), CSCChamberIndexValues::setIntervalFor(), CSCChamberMapValues::setIntervalFor(), CSCCrateMapValues::setIntervalFor(), SiStripQualityFakeESSource::setIntervalFor(), CSCChamberTimeCorrectionsValues::setIntervalFor(), CSCFakeGainsConditions::setIntervalFor(), CSCFakePedestalsConditions::setIntervalFor(), SiStripLorentzAngleFakeESSource::setIntervalFor(), HiTrivialConditionRetriever::setIntervalFor(), DDDetectorESProducer::setIntervalFor(), HepPDTESSource::setIntervalFor(), CastorTextCalibrations::setIntervalFor(), DTFakeT0ESProducer::setIntervalFor(), edm::eventsetup::IntersectingIOVRecordIntervalFinder::setIntervalFor(), SiPixelFakeGainESSource::setIntervalFor(), SiPixelFakeGainOfflineESSource::setIntervalFor(), SiPixelFakeGainForHLTESSource::setIntervalFor(), SiStripBadModuleFedErrESSource::setIntervalFor(), SiPixelFakeQualityESSource::setIntervalFor(), SiPixelFakeLorentzAngleESSource::setIntervalFor(), edm::ESProducerLooper::setIntervalFor(), ElectronLikelihoodESSource::setIntervalFor(), SiPixelQualityESProducer::setIntervalFor(), edm::eventsetup::DependentRecordIntervalFinder::setIntervalFor(), CaloMiscalibTools::setIntervalFor(), CaloMiscalibToolsMC::setIntervalFor(), HcalHardcodeCalibrations::setIntervalFor(), ESTrivialConditionRetriever::setIntervalFor(), SiStripFedCablingBuilderFromDb::setIntervalFor(), JetCorrectionESSource< Corrector >::setIntervalFor(), HcalTextCalibrations::setIntervalFor(), FakeAlignmentSource::setIntervalFor(), EcalTrivialConditionRetriever::setIntervalFor(), RPAlignmentCorrectionsMethods::stringToIOVValue(), and RPAlignmentCorrectionsMethods::writeToXML().

103  {
104  static const 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 beginOfTime(), endOfTime(), haveID_, haveTime_, invalidIOVSyncValue(), and throwInvalidComparison().

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(), AlignmentProducerBase::applyDB(), comparable(), RPAlignmentCorrectionsMethods::iovValueToString(), RPAlignmentCorrectionsMethods::loadFromXML(), Phase2TrackerCablingCfgESSource::setIntervalFor(), edm::EmptyESSource::setIntervalFor(), SiPixelFakeCPEGenericErrorParmESSource::setIntervalFor(), SiPixelFakeTemplateDBObjectESSource::setIntervalFor(), SiPixelFakeGenErrorDBObjectESSource::setIntervalFor(), QGLikelihoodESProducer::setIntervalFor(), QGLikelihoodSystematicsESProducer::setIntervalFor(), XMLIdealGeometryESSource::setIntervalFor(), SiStripFedCablingFakeESSource::setIntervalFor(), SiStripHashedDetIdFakeESSource::setIntervalFor(), SiStripGainESSource::setIntervalFor(), RPCPerformanceESSource::setIntervalFor(), SiStripApvGainFakeESSource::setIntervalFor(), SiStripBackPlaneCorrectionFakeESSource::setIntervalFor(), SiStripConfObjectFakeESSource::setIntervalFor(), SiStripBaseDelayFakeESSource::setIntervalFor(), SiStripLatencyFakeESSource::setIntervalFor(), SiStripThresholdFakeESSource::setIntervalFor(), SiStripPedestalsFakeESSource::setIntervalFor(), SiStripNoiseESSource::setIntervalFor(), SiStripPedestalsESSource::setIntervalFor(), HBHEDarkeningEP::setIntervalFor(), CSCFakeDBGains::setIntervalFor(), SiStripBadModuleConfigurableFakeESSource::setIntervalFor(), HcalTimeSlewEP::setIntervalFor(), CSCFakeNoiseMatrixConditions::setIntervalFor(), PhysicsTools::MVAComputerESSourceImpl< RecordType >::setIntervalFor(), BeamSpotFakeConditions::setIntervalFor(), CSCGainsConditions::setIntervalFor(), SiStripTemplateEmptyFakeESSource< TObject, TRecord >::setIntervalFor(), CastorHardcodeCalibrations::setIntervalFor(), CSCNoiseMatrixDBConditions::setIntervalFor(), CSCPedestalsDBConditions::setIntervalFor(), CSCCrosstalkConditions::setIntervalFor(), CSCFakeDBCrosstalk::setIntervalFor(), CSCFakeDBNoiseMatrix::setIntervalFor(), CSCFakeDBPedestals::setIntervalFor(), CSCNoiseMatrixConditions::setIntervalFor(), CSCChipSpeedCorrectionDBConditions::setIntervalFor(), CSCCrosstalkDBConditions::setIntervalFor(), CSCBadChambersConditions::setIntervalFor(), SiStripNoisesFakeESSource::setIntervalFor(), CSCGainsDBConditions::setIntervalFor(), CSCGasGainCorrectionDBConditions::setIntervalFor(), CSCBadStripsConditions::setIntervalFor(), CSCL1TPParametersConditions::setIntervalFor(), CSCBadWiresConditions::setIntervalFor(), CSCChamberMapValues::setIntervalFor(), CSCFakeCrosstalkConditions::setIntervalFor(), CSCChamberIndexValues::setIntervalFor(), CSCCrateMapValues::setIntervalFor(), CSCDDUMapValues::setIntervalFor(), SiStripQualityFakeESSource::setIntervalFor(), CSCChamberTimeCorrectionsValues::setIntervalFor(), CSCFakeGainsConditions::setIntervalFor(), CSCFakePedestalsConditions::setIntervalFor(), HiTrivialConditionRetriever::setIntervalFor(), SiStripLorentzAngleFakeESSource::setIntervalFor(), DDDetectorESProducer::setIntervalFor(), HepPDTESSource::setIntervalFor(), CastorTextCalibrations::setIntervalFor(), DTFakeT0ESProducer::setIntervalFor(), edm::eventsetup::IntersectingIOVRecordIntervalFinder::setIntervalFor(), SiPixelFakeGainESSource::setIntervalFor(), SiPixelFakeGainOfflineESSource::setIntervalFor(), SiPixelFakeGainForHLTESSource::setIntervalFor(), SiStripBadModuleFedErrESSource::setIntervalFor(), SiPixelFakeQualityESSource::setIntervalFor(), SiPixelFakeLorentzAngleESSource::setIntervalFor(), edm::ESProducerLooper::setIntervalFor(), ElectronLikelihoodESSource::setIntervalFor(), SiPixelQualityESProducer::setIntervalFor(), CTPPSIncludeAlignmentsFromXML::setIntervalFor(), edm::eventsetup::DependentRecordIntervalFinder::setIntervalFor(), CaloMiscalibToolsMC::setIntervalFor(), CaloMiscalibTools::setIntervalFor(), HcalHardcodeCalibrations::setIntervalFor(), ESTrivialConditionRetriever::setIntervalFor(), SiStripFedCablingBuilderFromDb::setIntervalFor(), JetCorrectionESSource< Corrector >::setIntervalFor(), HcalTextCalibrations::setIntervalFor(), FakeAlignmentSource::setIntervalFor(), FWLiteESSource::setIntervalFor(), EcalTrivialConditionRetriever::setIntervalFor(), RPAlignmentCorrectionsMethods::stringToIOVValue(), and RPAlignmentCorrectionsMethods::writeToXML().

97  {
98  static const 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 comparable(), and 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().