CMS 3D CMS Logo

Classes | Functions
theLHCInfoPerLSImpl Namespace Reference

Classes

struct  LumiSectionFilter
 

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 96 of file LHCInfoPerLSPopConAnalyzer.cc.

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

Referenced by transferPayloads().

96  {
97  if (rhs.fillNumber() != lhs.fillNumber())
98  return false;
99  if (rhs.runNumber() != lhs.runNumber())
100  return false;
101  if (rhs.crossingAngleX() != lhs.crossingAngleX())
102  return false;
103  if (rhs.crossingAngleY() != lhs.crossingAngleY())
104  return false;
105  if (rhs.betaStarX() != lhs.betaStarX())
106  return false;
107  if (rhs.betaStarY() != lhs.betaStarY())
108  return false;
109  return true;
110  }
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 112 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().

117  {
118  int lsMissingInPPS = 0;
119  int xAngleBothZero = 0, xAngleBothNonZero = 0, xAngleNegative = 0;
120  int betaNegative = 0;
121  size_t niovs = 0;
122  std::stringstream condIovs;
123  std::stringstream missingLsList;
124  for (auto& iov : buffer) {
125  bool add = false;
126  auto payload = iov.second;
127  cond::Time_t since = iov.first;
128  if (iovsToTransfer.empty()) {
129  add = true;
130  } else {
131  LHCInfoPerLS& lastAdded = *iovsToTransfer.rbegin()->second;
132  if (!comparePayloads(lastAdded, *payload)) {
133  add = true;
134  }
135  }
136  auto id = make_pair(payload->runNumber(), payload->lumiSection());
137  bool stableBeam = since >= startStableBeamTime && since <= endStableBeamTime;
138  bool isMissing = lsIdMap.find(id) != lsIdMap.end() && id != lsIdMap.at(id);
139  if (stableBeam && isMissing) {
140  missingLsList << id.first << "_" << id.second << " ";
141  lsMissingInPPS += isMissing;
142  }
143  if (add && !isMissing) {
144  niovs++;
145  if (stableBeam) {
146  if (payload->crossingAngleX() == 0 && payload->crossingAngleY() == 0)
147  xAngleBothZero++;
148  if (payload->crossingAngleX() != 0 && payload->crossingAngleY() != 0)
149  xAngleBothNonZero++;
150  if (payload->crossingAngleX() < 0 || payload->crossingAngleY() < 0)
151  xAngleNegative++;
152  if (payload->betaStarX() < 0 || payload->betaStarY() < 0)
153  betaNegative++;
154  }
155 
156  condIovs << since << " ";
157  iovsToTransfer.insert(make_pair(since, payload));
158  prevPayload = iov.second;
159  }
160  }
161  unsigned short fillNumber = (!buffer.empty()) ? buffer.front().second->fillNumber() : 0;
162  if (lsMissingInPPS > 0) {
163  edm::LogWarning("transferPayloads")
164  << "Number of stable beam LS in OMS without corresponding record in PPS DB for fill " << fillNumber << ": "
165  << lsMissingInPPS;
166  edm::LogWarning("transferPayloads")
167  << "Stable beam LS in OMS without corresponding record in PPS DB (run_LS): " << missingLsList.str();
168  }
169  if (xAngleBothZero > 0) {
170  edm::LogWarning("transferPayloads")
171  << "Number of payloads written with crossingAngle == 0 for both X and Y for fill " << fillNumber << ": "
172  << xAngleBothZero;
173  }
174  if (xAngleBothNonZero > 0) {
175  edm::LogWarning("transferPayloads")
176  << "Number of payloads written with crossingAngle != 0 for both X and Y for fill " << fillNumber << ": "
177  << xAngleBothNonZero;
178  }
179  if (xAngleNegative > 0) {
180  edm::LogWarning("transferPayloads")
181  << "Number of payloads written with negative crossingAngle for fill " << fillNumber << ": " << xAngleNegative;
182  }
183  if (betaNegative > 0) {
184  edm::LogWarning("transferPayloads")
185  << "Number of payloads written with negative betaSta for fill " << fillNumber << ": " << betaNegative;
186  }
187 
188  edm::LogInfo("transferPayloads") << "TRANSFERED COND IOVS: " << condIovs.str();
189  return niovs;
190  }
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)