CMS 3D CMS Logo

Classes | Functions | Variables
theLHCInfoImpl Namespace Reference

Classes

struct  IOVComp
 

Functions

bool comparePayloads (const LHCInfo &rhs, const LHCInfo &lhs)
 
bool makeFillPayload (std::unique_ptr< LHCInfo > &targetPayload, const cond::OMSServiceResult &queryResult)
 
std::vector< std::pair< cond::Time_t, std::shared_ptr< LHCInfo > > >::const_iterator search (const cond::Time_t &val, const std::vector< std::pair< cond::Time_t, std::shared_ptr< LHCInfo >>> &container)
 
void setElementData (cond::Time_t since, const std::string &dipVal, unsigned int elementNr, float value, LHCInfo &payload, std::set< cond::Time_t > &initList)
 
size_t transferPayloads (const std::vector< std::pair< cond::Time_t, std::shared_ptr< LHCInfo >>> &buffer, std::map< cond::Time_t, std::shared_ptr< LHCInfo >> &iovsToTransfer, std::shared_ptr< LHCInfo > &prevPayload)
 

Variables

static const std::map< std::string, int > vecMap
 

Function Documentation

◆ comparePayloads()

bool theLHCInfoImpl::comparePayloads ( const LHCInfo rhs,
const LHCInfo lhs 
)

Definition at line 498 of file LHCInfoPopConSourceHandler.cc.

References LHCInfo::betaStar(), LHCInfo::crossingAngle(), LHCInfo::ctppsStatus(), LHCInfo::delivLumi(), LHCInfo::fillNumber(), LHCInfo::instLumi(), LHCInfo::instLumiError(), LHCInfo::lhcComment(), LHCInfo::lhcState(), and LHCInfo::recLumi().

Referenced by transferPayloads().

498  {
499  if (rhs.fillNumber() != lhs.fillNumber() || rhs.delivLumi() != lhs.delivLumi() || rhs.recLumi() != lhs.recLumi() ||
500  rhs.instLumi() != lhs.instLumi() || rhs.instLumiError() != lhs.instLumiError() ||
501  rhs.crossingAngle() != lhs.crossingAngle() || rhs.betaStar() != lhs.betaStar() ||
502  rhs.lhcState() != lhs.lhcState() || rhs.lhcComment() != lhs.lhcComment() ||
503  rhs.ctppsStatus() != lhs.ctppsStatus()) {
504  return false;
505  }
506  return true;
507  }
std::string const & ctppsStatus() const
Definition: LHCInfo.cc:216
float const instLumiError() const
Definition: LHCInfo.cc:198
std::string const & lhcComment() const
Definition: LHCInfo.cc:214
unsigned short const fillNumber() const
Definition: LHCInfo.cc:158
float const recLumi() const
Definition: LHCInfo.cc:194
float const betaStar() const
Definition: LHCInfo.cc:184
float const instLumi() const
Definition: LHCInfo.cc:196
float const crossingAngle() const
Definition: LHCInfo.cc:182
std::string const & lhcState() const
Definition: LHCInfo.cc:212
float const delivLumi() const
Definition: LHCInfo.cc:192

◆ makeFillPayload()

bool theLHCInfoImpl::makeFillPayload ( std::unique_ptr< LHCInfo > &  targetPayload,
const cond::OMSServiceResult queryResult 
)

Definition at line 112 of file LHCInfoPopConSourceHandler.cc.

References cond::OMSServiceResult::begin(), beamSpotPI::creationTime, cond::OMSServiceResult::empty(), hcalRecHitTable_cff::energy, cond::time::from_boost(), runTheMatrix::ret, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by LHCInfoPopConSourceHandler::getNewObjects().

112  {
113  bool ret = false;
114  if (!queryResult.empty()) {
115  auto row = *queryResult.begin();
116  auto currentFill = row.get<unsigned short>("fill_number");
117  auto bunches1 = row.get<unsigned short>("bunches_beam1");
118  auto bunches2 = row.get<unsigned short>("bunches_beam2");
119  auto collidingBunches = row.get<unsigned short>("bunches_colliding");
120  auto targetBunches = row.get<unsigned short>("bunches_target");
121  auto fillType = row.get<LHCInfo::FillType>("fill_type_runtime");
122  auto particleType1 = row.get<LHCInfo::ParticleType>("fill_type_party1");
123  auto particleType2 = row.get<LHCInfo::ParticleType>("fill_type_party2");
124  auto intensityBeam1 = row.get<float>("intensity_beam1");
125  auto intensityBeam2 = row.get<float>("intensity_beam2");
126  auto energy = row.get<float>("energy");
127  auto creationTime = row.get<boost::posix_time::ptime>("start_time");
128  auto stableBeamStartTime = row.get<boost::posix_time::ptime>("start_stable_beam");
129  auto beamDumpTime = row.get<boost::posix_time::ptime>("end_time");
130  auto injectionScheme = row.get<std::string>("injection_scheme");
131  targetPayload = std::make_unique<LHCInfo>();
132  targetPayload->setFillNumber(currentFill);
133  targetPayload->setBunchesInBeam1(bunches1);
134  targetPayload->setBunchesInBeam2(bunches2);
135  targetPayload->setCollidingBunches(collidingBunches);
136  targetPayload->setTargetBunches(targetBunches);
137  targetPayload->setFillType(fillType);
138  targetPayload->setParticleTypeForBeam1(particleType1);
139  targetPayload->setParticleTypeForBeam2(particleType2);
140  targetPayload->setIntensityForBeam1(intensityBeam1);
141  targetPayload->setIntensityForBeam2(intensityBeam2);
142  targetPayload->setEnergy(energy);
143  targetPayload->setCreationTime(cond::time::from_boost(creationTime));
144  targetPayload->setBeginTime(cond::time::from_boost(stableBeamStartTime));
145  targetPayload->setEndTime(cond::time::from_boost(beamDumpTime));
146  targetPayload->setInjectionScheme(injectionScheme);
147  ret = true;
148  }
149  return ret;
150  }
ret
prodAgent to be discontinued
bool empty() const
Definition: OMSAccess.cc:69
Time_t from_boost(boost::posix_time::ptime bt)
ParticleType
Definition: LHCInfo.h:15
OMSServiceResultIterator begin() const
Definition: OMSAccess.cc:32
FillType
Definition: LHCInfo.h:14

◆ search()

std::vector<std::pair<cond::Time_t, std::shared_ptr<LHCInfo> > >::const_iterator theLHCInfoImpl::search ( const cond::Time_t val,
const std::vector< std::pair< cond::Time_t, std::shared_ptr< LHCInfo >>> &  container 
)

Definition at line 104 of file LHCInfoPopConSourceHandler.cc.

References AlCaHLTBitMon_ParallelJobs::p, pfDeepBoostedJetPreprocessParams_cfi::upper_bound, and heppy_batch::val.

105  {
106  if (container.empty())
107  return container.end();
108  auto p = std::upper_bound(container.begin(), container.end(), val, IOVComp());
109  return (p != container.begin()) ? p - 1 : container.end();
110  }

◆ setElementData()

void theLHCInfoImpl::setElementData ( cond::Time_t  since,
const std::string &  dipVal,
unsigned int  elementNr,
float  value,
LHCInfo payload,
std::set< cond::Time_t > &  initList 
)

Definition at line 338 of file LHCInfoPopConSourceHandler.cc.

References LHCInfo::bunchSlots, jetsAK4_Puppi_cff::payload, SiStripBadComponentsDQMServiceTemplate_cfg::since, relativeConstraints::value, and vecMap.

Referenced by LHCInfoPopConSourceHandler::getEcalData().

343  {
344  if (initList.find(since) == initList.end()) {
345  payload.beam1VC().resize(LHCInfo::bunchSlots, 0.);
346  payload.beam2VC().resize(LHCInfo::bunchSlots, 0.);
347  payload.beam1RF().resize(LHCInfo::bunchSlots, 0.);
348  payload.beam2RF().resize(LHCInfo::bunchSlots, 0.);
349  initList.insert(since);
350  }
351  // set the current values to all of the payloads of the lumi section samples after the current since
352  if (elementNr < LHCInfo::bunchSlots) {
353  switch (vecMap.at(dipVal)) {
354  case 1:
355  payload.beam1VC()[elementNr] = value;
356  break;
357  case 2:
358  payload.beam2VC()[elementNr] = value;
359  break;
360  case 3:
361  payload.beam1RF()[elementNr] = value;
362  break;
363  case 4:
364  payload.beam2RF()[elementNr] = value;
365  break;
366  default:
367  break;
368  }
369  }
370  }
static const std::map< std::string, int > vecMap
static size_t const bunchSlots
Definition: LHCInfo.h:58

◆ transferPayloads()

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

Definition at line 509 of file LHCInfoPopConSourceHandler.cc.

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

Referenced by LHCInfoPopConSourceHandler::getNewObjects().

511  {
512  size_t niovs = 0;
513  for (auto& iov : buffer) {
514  bool add = false;
515  auto payload = iov.second;
516  cond::Time_t since = iov.first;
517  if (iovsToTransfer.empty()) {
518  add = true;
519  } else {
520  LHCInfo& lastAdded = *iovsToTransfer.rbegin()->second;
521  if (!comparePayloads(lastAdded, *payload)) {
522  add = true;
523  }
524  }
525  if (add) {
526  niovs++;
527  iovsToTransfer.insert(std::make_pair(since, payload));
528  prevPayload = iov.second;
529  }
530  }
531  return niovs;
532  }
bool comparePayloads(const LHCInfo &rhs, const LHCInfo &lhs)
unsigned long long Time_t
Definition: Time.h:14
void add(std::map< std::string, TH1 *> &h, TH1 *hist)

Variable Documentation

◆ vecMap

const std::map<std::string, int> theLHCInfoImpl::vecMap
static
Initial value:
= {
{"Beam1/beamPhaseMean", 1}, {"Beam2/beamPhaseMean", 2}, {"Beam1/cavPhaseMean", 3}, {"Beam2/cavPhaseMean", 4}}

Definition at line 336 of file LHCInfoPopConSourceHandler.cc.

Referenced by setElementData().