CMS 3D CMS Logo

Functions
theLHCInfoPerLSImpl Namespace Reference

Functions

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

Function Documentation

◆ comparePayloads()

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

Definition at line 40 of file LHCInfoPerLSPopConAnalyzer.cc.

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

Referenced by transferPayloads().

40  {
41  if (rhs.fillNumber() != lhs.fillNumber() || rhs.runNumber() != lhs.runNumber() ||
42  rhs.crossingAngleX() != lhs.crossingAngleX() || rhs.crossingAngleY() != lhs.crossingAngleY() ||
43  rhs.betaStarX() != lhs.betaStarX() || rhs.betaStarY() != lhs.betaStarY()) {
44  return false;
45  }
46  return true;
47  }
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< pair< cond::Time_t, std::shared_ptr< LHCInfoPerLS >>> &  buffer,
std::map< cond::Time_t, std::shared_ptr< LHCInfoPerLS >> &  iovsToTransfer,
std::shared_ptr< LHCInfoPerLS > &  prevPayload,
const std::map< pair< cond::Time_t, unsigned int >, pair< cond::Time_t, unsigned int >> &  lsIdMap,
cond::Time_t  startStableBeamTime,
cond::Time_t  endStableBeamTime 
)

Definition at line 49 of file LHCInfoPerLSPopConAnalyzer.cc.

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

Referenced by LHCInfoPerLSPopConSourceHandler::getNewObjects().

54  {
55  int lsMissingInPPS = 0;
56  int xAngleBothZero = 0, xAngleBothNonZero = 0, xAngleNegative = 0;
57  int betaNegative = 0;
58  size_t niovs = 0;
59  std::stringstream condIovs;
60  std::stringstream missingLsList;
61  for (auto& iov : buffer) {
62  bool add = false;
63  auto payload = iov.second;
64  cond::Time_t since = iov.first;
65  if (iovsToTransfer.empty()) {
66  add = true;
67  } else {
68  LHCInfoPerLS& lastAdded = *iovsToTransfer.rbegin()->second;
69  if (!comparePayloads(lastAdded, *payload)) {
70  add = true;
71  }
72  }
73  auto id = make_pair(payload->runNumber(), payload->lumiSection());
74  bool stableBeam = since >= startStableBeamTime && since <= endStableBeamTime;
75  bool isMissing = lsIdMap.find(id) != lsIdMap.end() && id != lsIdMap.at(id);
76  if (stableBeam && isMissing) {
77  missingLsList << id.first << "_" << id.second << " ";
78  lsMissingInPPS += isMissing;
79  }
80  if (add && !isMissing) {
81  niovs++;
82  if (stableBeam) {
83  if (payload->crossingAngleX() == 0 && payload->crossingAngleY() == 0)
84  xAngleBothZero++;
85  if (payload->crossingAngleX() != 0 && payload->crossingAngleY() != 0)
86  xAngleBothNonZero++;
87  if (payload->crossingAngleX() < 0 || payload->crossingAngleY() < 0)
88  xAngleNegative++;
89  if (payload->betaStarX() < 0 || payload->betaStarY() < 0)
90  betaNegative++;
91  }
92 
93  condIovs << since << " ";
94  iovsToTransfer.insert(make_pair(since, payload));
95  prevPayload = iov.second;
96  }
97  }
98  unsigned short fillNumber = (!buffer.empty()) ? buffer.front().second->fillNumber() : 0;
99  if (lsMissingInPPS > 0) {
100  edm::LogWarning("transferPayloads")
101  << "Number of stable beam LS in OMS without corresponding record in PPS DB for fill " << fillNumber << ": "
102  << lsMissingInPPS;
103  edm::LogWarning("transferPayloads")
104  << "Stable beam LS in OMS without corresponding record in PPS DB (run_LS): " << missingLsList.str();
105  }
106  if (xAngleBothZero > 0) {
107  edm::LogWarning("transferPayloads")
108  << "Number of payloads written with crossingAngle == 0 for both X and Y for fill " << fillNumber << ": "
109  << xAngleBothZero;
110  }
111  if (xAngleBothNonZero > 0) {
112  edm::LogWarning("transferPayloads")
113  << "Number of payloads written with crossingAngle != 0 for both X and Y for fill " << fillNumber << ": "
114  << xAngleBothNonZero;
115  }
116  if (xAngleNegative > 0) {
117  edm::LogWarning("transferPayloads")
118  << "Number of payloads written with negative crossingAngle for fill " << fillNumber << ": " << xAngleNegative;
119  }
120  if (betaNegative > 0) {
121  edm::LogWarning("transferPayloads")
122  << "Number of payloads written with negative betaSta for fill " << fillNumber << ": " << betaNegative;
123  }
124 
125  edm::LogInfo("transferPayloads") << "TRANSFERED COND IOVS: " << condIovs.str();
126  return niovs;
127  }
unsigned long long Time_t
Definition: Time.h:14
Log< level::Info, false > LogInfo
void add(std::map< std::string, TH1 *> &h, TH1 *hist)
Log< level::Warning, false > LogWarning
bool comparePayloads(const LHCInfoPerLS &rhs, const LHCInfoPerLS &lhs)