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.

References submitPVResolutionJobs::count, submitPVValidationJobs::now, jetsAK4_Puppi_cff::payload, and seconds().

Referenced by BeamSpotOnlinePopConSourceHandler::getNewObjects().

18  {
19  long creationTimeInSeconds = payload.creationTime() >> 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 }
double seconds()

◆ makeDummyPayload()

std::unique_ptr<BeamSpotOnlineObjects> makeDummyPayload ( )

Definition at line 26 of file BeamSpotOnlinePopConSourceHandler.cc.

References submitPVResolutionJobs::count, submitPVValidationJobs::now, runTheMatrix::ret, and seconds().

Referenced by BeamSpotOnlinePopConSourceHandler::getNewObjects().

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 }
double seconds()
ret
prodAgent to be discontinued