|
|
Go to the documentation of this file.
45 : timeThreshold_(
p.getParameter<
int>(
"timeThreshold")),
46 sigmaZThreshold_(
p.getParameter<double>(
"sigmaZThreshold")) {
61 dsc.
add<
int>(
"timeThreshold", 48)->setComment(
"hours");
63 desc.addWithDefaultLabel(dsc);
74 auto diffBStime1 = (currentTime - bs1time).
count();
76 auto diffBStime2 = (currentTime - bs2time).
count();
87 if (diffBStime1 > limitTime && diffBStime2 > limitTime) {
88 edm::LogInfo(
"OnlineBeamSpotESProducer") <<
"Defaulting to fake becuase both payloads are too old.";
90 }
else if (diffBStime2 > limitTime) {
95 <<
"Defaulting to fake because the legacy Beam Spot is not suitable and HLT one is too old.";
98 }
else if (diffBStime1 > limitTime) {
103 <<
"Defaulting to fake because the HLT Beam Spot is not suitable and the legacy one too old.";
113 <<
"Defaulting to fake because despite both payloads are young enough, none has the right BeamType.";
126 auto diffBStime1 = (currentTime - bs1time).
count();
142 if (not legacyRec and not hltRec) {
143 edm::LogInfo(
"OnlineBeamSpotESProducer") <<
"None of the Beam Spots in ES are available! \n returning a fake one.";
148 if (legacyRec and hltRec) {
150 }
else if (legacyRec) {
160 <<
"None of the Online BeamSpots in the ES is suitable, \n returning a fake one. ";
ParameterDescriptionBase * add(U const &iLabel, T const &value)
edm::ESGetToken< BeamSpotOnlineObjects, BeamSpotOnlineLegacyObjectsRcd > bsLegacyToken_
double GetSigmaZ() const
get sigma Z, RMS bunch length
static void fillDescriptions(edm::ConfigurationDescriptions &desc)
int GetBeamType() const
get beam type
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
void SetBeamWidthY(double val)
set average transverse beam width Y
Log< level::Info, false > LogInfo
void SetSigmaZ(double val)
set sigma Z, RMS bunch length
std::shared_ptr< const BeamSpotObjects > produce(const BeamSpotTransientObjectsRcd &)
const double sigmaZThreshold_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void SetPosition(double x, double y, double z)
set XYZ position
const BeamSpotOnlineObjects * checkSingleBS(const BeamSpotOnlineObjects *bs1)
void SetType(int type)
set beam type
cond::Time_t GetCreationTime() const
OnlineBeamSpotESProducer(const edm::ParameterSet &p)
std::optional< DepRecordT > tryToGetRecord() const
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
const edm::ESGetToken< BeamSpotObjects, BeamSpotTransientObjectsRcd > bsToken_
void SetBeamWidthX(double val)
set average transverse beam width X
edm::ESGetToken< BeamSpotOnlineObjects, BeamSpotOnlineHLTObjectsRcd > bsHLTToken_
const BeamSpotOnlineObjects * compareBS(const BeamSpotOnlineObjects *bs1, const BeamSpotOnlineObjects *bs2)
void setComment(std::string const &value)