11 m_name(
pset.getUntrackedParameter<
std::
string>(
"name",
"BeamSpotOnlineSourceHandler")),
12 m_maxAge(
pset.getUntrackedParameter<unsigned
int>(
"maxAge", 86400)),
13 m_runNumber(
pset.getUntrackedParameter<unsigned
int>(
"runNumber", 1)),
14 m_sourcePayloadTag(
pset.getUntrackedParameter<
std::
string>(
"sourcePayloadTag",
"")) {}
19 long creationTimeInSeconds =
payload.GetCreationTime() >> 32;
21 auto nowSinceEpoch = std::chrono::duration_cast<std::chrono::seconds>(timeNow.time_since_epoch()).
count();
22 long age = nowSinceEpoch - creationTimeInSeconds;
28 std::unique_ptr<BeamSpotOnlineObjects>
ret;
29 ret = std::make_unique<BeamSpotOnlineObjects>();
31 auto nowSinceEpoch = std::chrono::duration_cast<std::chrono::seconds>(timeNow.time_since_epoch()).
count();
32 ret->SetCreationTime(nowSinceEpoch << 32);
37 bool addNewPayload =
false;
53 session.transaction().start(
true);
56 session.transaction().commit();
66 edm::LogInfo(
m_name) <<
"Nothing to do, last payload satisfies maximum age requirement.";