CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 32 of file LHCInfoPerLSPopConAnalyzer.cc.

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

Referenced by transferPayloads().

32  {
33  if (rhs.fillNumber() != lhs.fillNumber() || rhs.runNumber() != lhs.runNumber() ||
34  rhs.crossingAngleX() != lhs.crossingAngleX() || rhs.crossingAngleY() != lhs.crossingAngleY() ||
35  rhs.betaStarX() != lhs.betaStarX() || rhs.betaStarY() != lhs.betaStarY()) {
36  return false;
37  }
38  return true;
39  }
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 41 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().

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