CMS 3D CMS Logo

Functions
BeamSpotOnlinePopConSourceHandler.cc File Reference
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "CondFormats/Common/interface/TimeConversions.h"
#include "CondTools/BeamSpot/interface/BeamSpotOnlinePopConSourceHandler.h"
#include <chrono>
#include <memory>

Go to the source code of this file.

Functions

bool checkPayloadAge (const BeamSpotOnlineObjects &payload, unsigned int maxAge)
 
std::unique_ptr< BeamSpotOnlineObjectsmakeDummyPayload ()
 

Function Documentation

◆ checkPayloadAge()

bool checkPayloadAge ( const BeamSpotOnlineObjects payload,
unsigned int  maxAge 
)

Definition at line 18 of file BeamSpotOnlinePopConSourceHandler.cc.

18  {
19  long creationTimeInSeconds = payload.GetCreationTime() >> 32;
20  auto timeNow = std::chrono::system_clock::now();
21  auto nowSinceEpoch = std::chrono::duration_cast<std::chrono::seconds>(timeNow.time_since_epoch()).count();
22  long age = nowSinceEpoch - creationTimeInSeconds;
23  return age < maxAge;
24 }

References submitPVResolutionJobs::count, submitPVValidationJobs::now, and jets_cff::payload.

Referenced by BeamSpotOnlinePopConSourceHandler::getNewObjects().

◆ makeDummyPayload()

std::unique_ptr<BeamSpotOnlineObjects> makeDummyPayload ( )

Definition at line 26 of file BeamSpotOnlinePopConSourceHandler.cc.

26  {
27  // implement here
28  std::unique_ptr<BeamSpotOnlineObjects> ret;
29  ret = std::make_unique<BeamSpotOnlineObjects>();
30  auto timeNow = std::chrono::system_clock::now();
31  auto nowSinceEpoch = std::chrono::duration_cast<std::chrono::seconds>(timeNow.time_since_epoch()).count();
32  ret->SetCreationTime(nowSinceEpoch << 32);
33  return ret;
34 }

References submitPVResolutionJobs::count, submitPVValidationJobs::now, and runTheMatrix::ret.

Referenced by BeamSpotOnlinePopConSourceHandler::getNewObjects().

runTheMatrix.ret
ret
prodAgent to be discontinued
Definition: runTheMatrix.py:373
submitPVValidationJobs.now
now
Definition: submitPVValidationJobs.py:639
submitPVResolutionJobs.count
count
Definition: submitPVResolutionJobs.py:352
jets_cff.payload
payload
Definition: jets_cff.py:32