CMS 3D CMS Logo

Functions
theLHCInfoPerLSImpl Namespace Reference

Functions

bool comparePayloads (const LHCInfoPerLS &rhs, const LHCInfoPerLS &lhs)
 
size_t transferPayloads (const std::vector< std::pair< cond::Time_t, std::shared_ptr< LHCInfoPerLS >>> &buffer, std::map< cond::Time_t, std::shared_ptr< LHCInfoPerLS >> &iovsToTransfer, std::shared_ptr< LHCInfoPerLS > &prevPayload)
 

Function Documentation

◆ comparePayloads()

bool theLHCInfoPerLSImpl::comparePayloads ( const LHCInfoPerLS rhs,
const LHCInfoPerLS lhs 
)

Definition at line 37 of file LHCInfoPerLSPopConAnalyzer.cc.

References LHCInfoPerLS::betaStarX(), LHCInfoPerLS::betaStarY(), LHCInfoPerLS::crossingAngleX(), LHCInfoPerLS::crossingAngleY(), LHCInfoPerLS::fillNumber(), and LHCInfoPerLS::runNumber().

Referenced by transferPayloads().

37  {
38  if (rhs.fillNumber() != lhs.fillNumber() || rhs.runNumber() != lhs.runNumber() ||
39  rhs.crossingAngleX() != lhs.crossingAngleX() || rhs.crossingAngleY() != lhs.crossingAngleY() ||
40  rhs.betaStarX() != lhs.betaStarX() || rhs.betaStarY() != lhs.betaStarY()) {
41  return false;
42  }
43  return true;
44  }
cond::Time_t runNumber() const
Definition: LHCInfoPerLS.cc:23
float const betaStarY() const
Definition: LHCInfoPerLS.cc:21
float const crossingAngleX() const
Definition: LHCInfoPerLS.cc:15
float const crossingAngleY() const
Definition: LHCInfoPerLS.cc:17
unsigned short const fillNumber() const
Definition: LHCInfoPerLS.cc:11
float const betaStarX() const
Definition: LHCInfoPerLS.cc:19

◆ transferPayloads()

size_t theLHCInfoPerLSImpl::transferPayloads ( const std::vector< std::pair< cond::Time_t, std::shared_ptr< LHCInfoPerLS >>> &  buffer,
std::map< cond::Time_t, std::shared_ptr< LHCInfoPerLS >> &  iovsToTransfer,
std::shared_ptr< LHCInfoPerLS > &  prevPayload 
)

Definition at line 46 of file LHCInfoPerLSPopConAnalyzer.cc.

References PVValHelper::add(), edmScanValgrind::buffer, comparePayloads(), jetsAK4_Puppi_cff::payload, and SiStripBadComponentsDQMServiceTemplate_cfg::since.

Referenced by LHCInfoPerLSPopConSourceHandler::getNewObjects().

48  {
49  size_t niovs = 0;
50  std::stringstream condIovs;
51  for (auto& iov : buffer) {
52  bool add = false;
53  auto payload = iov.second;
54  cond::Time_t since = iov.first;
55  if (iovsToTransfer.empty()) {
56  add = true;
57  } else {
58  LHCInfoPerLS& lastAdded = *iovsToTransfer.rbegin()->second;
59  if (!comparePayloads(lastAdded, *payload)) {
60  add = true;
61  }
62  }
63  if (add) {
64  niovs++;
65  condIovs << since << " ";
66  iovsToTransfer.insert(std::make_pair(since, payload));
67  prevPayload = iov.second;
68  }
69  }
70  edm::LogInfo("transferPayloads") << "TRANSFERED COND IOVS: " << condIovs.str();
71  return niovs;
72  }
unsigned long long Time_t
Definition: Time.h:14
Log< level::Info, false > LogInfo
void add(std::map< std::string, TH1 *> &h, TH1 *hist)
bool comparePayloads(const LHCInfoPerLS &rhs, const LHCInfoPerLS &lhs)