ATLAS Offline Software
LuminosityCondAlg.cxx
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration.
3  */
12 #include "LuminosityCondAlg.h"
16 #include "CoolKernel/IObject.h"
18 #include "CxxUtils/get_unaligned.h"
19 #include <sstream>
20 
21 
22 namespace {
23 
24 // from from BunchCrossingCondAlg, decodes bunch pattern from metadata string
25 std::vector<float> tokenize( const std::string& pattern ) {
26 
27  if (pattern == "None") {
28  return std::vector<float>(LuminosityCondData::TOTAL_LHC_BCIDS, 1.);
29  }
30 
31  std::vector< float > result;
32  const char* c= pattern.data();
33  const char* cEnd= c + pattern.size();
34  while(c<cEnd) {
35  //This loop swallows actually any string containing numbers
36  //separated by non-numbers
37  char* end;
38  float f=std::strtof(c,&end);
39  if (c==end) {//Can't convert, try next
40  c++;
41  }
42  else { //got a value
43  result.push_back(f);
44  c=end;
45  }
46  }//end while loop
47  return result;
48 }
49 
50 } // anonymous namespace
51 
52 
58 {
60 
61  // May be empty if configured for MC.
64 
65  // May be empty if configured for data.
68  ATH_CHECK( m_actualMuKey.initialize(m_isMC) );
69  ATH_CHECK( m_averageMuKey.initialize(m_isMC) );
70 
71  // Only used for run1.
75  return StatusCode::SUCCESS;
76 }
77 
78 
84 LuminosityCondAlg::execute (const EventContext& ctx) const
85 {
86  auto lumi = std::make_unique<LuminosityCondData>();
88  (m_luminosityOutputKey, ctx);
89 
90  if (m_isMC) {
91  // MC case.
92  const auto* eventinfo = SG::get(m_eventInfoKey, ctx);
93  // define a range for this one LB with one second validity
94  EventIDRange range = EventIDRange(EventIDBase(eventinfo->runNumber(),
95  EventIDBase::UNDEFEVT,
96  eventinfo->timeStamp(),
97  eventinfo->timeStampNSOffset(),
98  eventinfo->lumiBlock()),
99  EventIDBase(eventinfo->runNumber(),
100  EventIDBase::UNDEFEVT,
101  eventinfo->timeStamp()+1,
102  eventinfo->timeStampNSOffset(),
103  eventinfo->lumiBlock()+1));
104 
105 
107  luminosityCondData.addDependency(range);
108 
109  const float avgMu = eventinfo->averageInteractionsPerCrossing();
110  const auto& attr = (**digitizationFolder)[std::string("BeamIntensityPattern")];
111  const std::string& sbunches = attr.data<std::string>();
112  std::vector<float> bunchpattern = tokenize(sbunches);
113 
114  if (bunchpattern.size() != LuminosityCondData::TOTAL_LHC_BCIDS) {
115  ATH_MSG_ERROR("Decoding MC bunch structure failed, improper number of LHC BCIDs");
116  bunchpattern = std::vector<float>(LuminosityCondData::TOTAL_LHC_BCIDS, 1.);
117  }
118 
119  float totintensity = 0.;
120  for (size_t i = 0; i < bunchpattern.size(); ++i) {
121  totintensity += bunchpattern[i];
122  bunchpattern[i] *= (avgMu*m_muToLumi);
123  }
124 
125  lumi->setLbAverageInteractionsPerCrossing(avgMu);
126  lumi->setLbAverageLuminosity(totintensity*avgMu*m_muToLumi);
127  lumi->setLbLuminosityPerBCIDVector(std::move(bunchpattern));
128  lumi->setMuToLumi(m_muToLumi);
129  }
130  else {
133  luminosityCondData.addDependency(luminosityFolder);
134 
135  unsigned int preferredChannel;
136  unsigned int calibChannel;
137  const coral::Blob* bunchInstLumiBlob = nullptr;
138  ATH_CHECK( updateAvgLumi (**luminosityFolder,
139  *lumi,
140  preferredChannel,
141  calibChannel,
142  bunchInstLumiBlob) );
143 
145  bunchInstLumiBlob,
146  preferredChannel,
147  calibChannel,
148  luminosityCondData,
149  *lumi) );
150  }
151 
152 
153  ATH_CHECK( luminosityCondData.record (std::move (lumi)) );
154  return StatusCode::SUCCESS;
155 }
156 
157 
175  unsigned int& preferredChannel,
176  unsigned int& calibChannel,
177  const coral::Blob*& bunchInstLumiBlob) const
178 
179 {
180  preferredChannel = 0;
181  calibChannel = 0;
182  bunchInstLumiBlob = nullptr;
183 
184  const coral::AttributeList& attrList = lumiData.attributeList (m_lumiChannel);
185  if (attrList.size() == 0 || attrList["Valid"].isNull()) {
186  ATH_MSG_DEBUG ("Can't find luminosity information for channel " << m_lumiChannel);
187  return StatusCode::SUCCESS;
188  }
189 
190  if (msgLvl (MSG::DEBUG)) {
191  std::ostringstream attrStr1;
192  attrList.toOutputStream( attrStr1 );
193  ATH_MSG_DEBUG( "ChanNum " << m_lumiChannel << " Attribute list "
194  << attrStr1.str() );
195  }
196 
197  // Check data availability
198  if (attrList["LBAvInstLumi"].isNull() || attrList["LBAvEvtsPerBX"].isNull()) {
199  ATH_MSG_ERROR( " NULL Luminosity information in database " );
200  return StatusCode::FAILURE;
201  }
202 
203  // Check validity (don't bother continuing if invalid)
204  uint32_t valid = attrList["Valid"].data<cool::UInt32>();
205  lumi.setLbAverageValid (valid);
206  if (valid & 0x01) {
207  if (m_skipInvalid) {
208  if (!m_expectInvalid) {
209  ATH_MSG_WARNING( " Invalid LB Average luminosity ... set lumi to 0" );
210  }
211  return StatusCode::SUCCESS;
212  } else {
213  ATH_MSG_WARNING( " Invalid LB Average luminosity ... continuing because skipInvalid == FALSE" );
214  }
215  }
216 
217  // Get preferred channel (needed for per-BCID calculation)
218  if (m_lumiChannel == 0u) {
219 
220  // Check if we have a payload for this (Run2 only)
221  bool hasAlgorithmID = false;
222  for (coral::AttributeList::const_iterator attr = attrList.begin();
223  attr != attrList.end(); ++attr) {
224  if (attr->specification().name() == "AlgorithmID") {
225  hasAlgorithmID = true;
226  break;
227  }
228  }
229 
230  if (hasAlgorithmID) {
231  // In Run2, channel 0 should be good. Leave as is
232  preferredChannel = m_lumiChannel;
233  calibChannel = attrList["AlgorithmID"].data<cool::UInt32>();
234 
235  } else {
236  // In Run1, we need to recalculate from the actual channel number
237  preferredChannel = (valid >> 22);
238  calibChannel = preferredChannel;
239  }
240 
241  } else {
242  preferredChannel = m_lumiChannel;
243  calibChannel = m_lumiChannel;
244  }
245 
246  float LBAvInstLumi = attrList["LBAvInstLumi"].data<cool::Float>(); // Lumi
247  float LBAvEvtsPerBX = attrList["LBAvEvtsPerBX"].data<cool::Float>(); // Mu
248 
249  // Check (and protect for NaN
250  if ( std::isnan (LBAvInstLumi) ) {
251  ATH_MSG_WARNING( " Luminosity is not a number.. " << LBAvInstLumi << " ... set it to 0 " );
252  LBAvInstLumi=0.;
253  }
254 
255  if ( std::isnan (LBAvEvtsPerBX) ) {
256  ATH_MSG_WARNING( " Luminosity is not a number.. " << LBAvEvtsPerBX << " ... set it to 0 " );
257  LBAvEvtsPerBX=0.;
258  }
259 
260  lumi.setLbAverageLuminosity (LBAvInstLumi);
261  lumi.setLbAverageInteractionsPerCrossing (LBAvEvtsPerBX);
262 
263  // Check validity of per-BCID luminosity (will issue warning in recalcPerBCIDLumi
264  int perBcidValid = ((valid&0x3ff)/10) % 10;
265  if ((perBcidValid > 0) && m_skipInvalid) {
266  return StatusCode::SUCCESS;
267  }
268 
269  // Also save per-BCID blob if it exists
270  for (coral::AttributeList::const_iterator attr = attrList.begin();
271  attr != attrList.end(); ++attr)
272  {
273  if (attr->specification().name() == "BunchInstLumi") {
274  if (!attrList["BunchInstLumi"].isNull())
275  bunchInstLumiBlob = &attrList["BunchInstLumi"].data<coral::Blob>();
276  break;
277  }
278  }
279 
280  return StatusCode::SUCCESS;
281 }
282 
283 
296 LuminosityCondAlg::updatePerBunchLumi (const EventContext& ctx,
297  const coral::Blob* bunchInstLumiBlob,
298  unsigned int preferredChannel,
299  unsigned int calibChannel,
301  LuminosityCondData& lumi) const
302 {
303  if (lumi.lbAverageLuminosity() <= 0.) {
304  if (!m_expectInvalid) {
305  ATH_MSG_WARNING( "LBAvInstLumi is zero or negative in updatePerBunchLumi():"
306  << lumi.lbAverageLuminosity());
308  }
309  return StatusCode::SUCCESS;
310  }
311  bool isValid = true;
312  ATH_CHECK( updateMuToLumi (ctx, calibChannel, wHdl, lumi, isValid) );
313 
314  // Check here if we want to do this the Run1 way (hard) or the Run2 way (easy)
315 
316  if (!isValid) {
317  // Skip if not valid.
318  }
319  else if (bunchInstLumiBlob != nullptr) { // Run2 way, easy
320  ATH_CHECK( updatePerBunchLumiRun2 (*bunchInstLumiBlob,
321  preferredChannel,
322  lumi) );
323  }
324  else { // Run1 way, hard!
326  preferredChannel,
327  wHdl,
328  lumi) );
329  }
330 
331  ATH_MSG_DEBUG( "finished updatePerBunchLumi() for alg: "
332  << preferredChannel );
333  return StatusCode::SUCCESS;
334 }
335 
336 
347 LuminosityCondAlg::updateMuToLumi (const EventContext& ctx,
348  unsigned int calibChannel,
351  bool& isValid) const
352 {
355  wHdl.addDependency(onlineLumiCalibration);
356 
357  // This is the only correct way to do this!
358  // The division below gives average mu (over all bunches) to total lumi
359  float muToLumi = onlineLumiCalibration->getMuToLumi (calibChannel);
360 
361  // Check if this is reasonable
362  if (muToLumi < 0.) {
363  ATH_MSG_WARNING(" Found muToLumi = " << muToLumi << " for channel " << calibChannel << ". Try backup channel..." );
364  muToLumi = onlineLumiCalibration->getMuToLumi(m_calibBackupChannel);
365  ATH_MSG_WARNING(" Found muToLumi = " << muToLumi << " for backup channel " << m_calibBackupChannel);
366  }
367 
368  lumi.setMuToLumi (muToLumi);
369 
370  // Check validity
371  isValid = true;
372  int perBcidValid = ((lumi.lbAverageValid()&0x3ff)/10) % 10;
373  if ((lumi.lbAverageValid() & 0x03) || (perBcidValid > 0)) { // Skip if either per-BCID or LBAv is invalid
374  isValid = false;
375  if (m_skipInvalid) {
376  ATH_MSG_WARNING( " Invalid per-BCID luminosity found: "
377  << lumi.lbAverageValid() << "!" );
378  return StatusCode::SUCCESS;
379  } else {
380  ATH_MSG_WARNING( " Invalid per-BCID luminosity found: "
381  << lumi.lbAverageValid()
382  << " continuing because skipInvalid == FALSE" );
383  }
384  }
385 
386  // Now check muToLumi and report depending upon whether lumi is valid or not
387  if (muToLumi < 0.) {
388  if (isValid) {
389  ATH_MSG_ERROR(" Found invalid muToLumi = " << muToLumi << " for backup channel " << m_calibBackupChannel << "!");
390  } else {
391  ATH_MSG_WARNING(" Found invalid muToLumi = " << muToLumi << " for backup channel " << m_calibBackupChannel << "!");
392  }
393 
394  // Don't keep negative values
395  muToLumi = 0.;
396  lumi.setMuToLumi (muToLumi);
397  }
398 
399  ATH_MSG_DEBUG(" Found muToLumi = " << muToLumi << " for channel "
400  << calibChannel );
401 
402  return StatusCode::SUCCESS;
403 }
404 
405 
414  unsigned int preferredChannel,
415  LuminosityCondData& lumi) const
416 {
417  ATH_MSG_DEBUG( "starting updatePerBunchLumiRun2() for alg: " << preferredChannel );
418 
419  // Check that the length isn't zero
420  if (bunchInstLumiBlob.size() == 0) {
421  ATH_MSG_ERROR("BunchInstLumi blob found with zero length!");
422  return StatusCode::FAILURE;
423  }
424 
425  // Hardcode the Run2 BLOB decoding (should use CoolLumiUtilities...)
426  const uint8_t* ATH_RESTRICT pchar =
427  static_cast<const uint8_t*>(bunchInstLumiBlob.startingAddress()); // First byte holds storage size and mode
428  unsigned int bss = ((*pchar) % 100) / 10; // Byte storage size
429  unsigned int smod = ((*pchar) % 10); // Storage mode
430  ++pchar; // Points to next char after header
431 
432  ATH_MSG_DEBUG( "BunchInstLumi blob found with storage mode " << smod
433  << " and byte storage size " << bss );
434 
435  // Make sure we have what we think we have
436  if (bss != 4 || smod != 1) {
437  ATH_MSG_ERROR( "BunchInstLumi blob found with storage mode " << smod << " and byte storage size " << bss << " - Unknown!");
438  return StatusCode::FAILURE;
439  }
440 
441  unsigned int nbcids = LuminosityCondData::TOTAL_LHC_BCIDS;
442  unsigned int bloblength = bss * nbcids + 1;
443 
444  if (static_cast<cool::UInt32>(bunchInstLumiBlob.size()) != bloblength) {
445  ATH_MSG_ERROR( "BunchRawInstLumi blob found with length"
446  << bunchInstLumiBlob.size() << "in storage mode" << smod
447  << ", expecting " << bloblength << "!" );
448  return StatusCode::FAILURE;
449  }
450 
451  // Length is correct, read raw data according to packing scheme
452  // This is absolute luminosity, so just unpack values into our array
453 
454  ATH_MSG_DEBUG( "Unpacking lumi value from blob");
455  std::vector<float> instLumi (nbcids);
456  for (unsigned int i=0; i<nbcids; i++) {
457  // Can't use assignment directly because source may be misaligned.
458  instLumi[i] = CxxUtils::get_unaligned_float (pchar);
459  }
460 
461  if (msgLvl (MSG::DEBUG)) {
462  for (unsigned int i=0; i<nbcids; i++) {
463  ATH_MSG_DEBUG( "Bcid: " << i << " Lumi: " << instLumi[i] );
464  }
465  }
466 
467  lumi.setLbLuminosityPerBCIDVector (std::move (instLumi));
468 
469  return StatusCode::SUCCESS;
470 }
471 
472 
481  unsigned int preferredChannel,
483  LuminosityCondData& lumi) const
484 {
485  ATH_MSG_DEBUG( "starting updatePerBunchLumiRun1() for alg: " << preferredChannel );
486 
487  if (preferredChannel == 0) {
488  return StatusCode::SUCCESS;
489  }
490 
491  // Nothing to do if we don't have the ingredients
493  ATH_MSG_DEBUG( "OnlineLumiCalibrationInputKey.empty() is TRUE, skipping..." );
494  return StatusCode::SUCCESS;
495  }
496  if (m_bunchLumisInputKey.empty()) {
497  ATH_MSG_DEBUG( "BunchLumisInputKey.empty() is TRUE, skipping..." );
498  return StatusCode::SUCCESS;
499  }
500  if (m_bunchGroupInputKey.empty()) {
501  ATH_MSG_DEBUG( "BunchGroupTool.empty() is TRUE, skipping..." );
502  return StatusCode::SUCCESS;
503  }
504  if (m_fillParamsInputKey.empty()) {
505  ATH_MSG_DEBUG( "FillParamsInputKey.empty() is TRUE, skipping..." );
506  return StatusCode::SUCCESS;
507  }
508 
511  wHdl.addDependency(onlineLumiCalibration);
513  wHdl.addDependency(bunchLumis);
515  wHdl.addDependency(bunchGroup);
517  wHdl.addDependency(fillParams);
518 
519  const std::vector<unsigned int>& luminousBunches = fillParams->luminousBunches();
520  ATH_MSG_DEBUG( "N LuminousBunches:" << luminousBunches.size() );
521 
522  // Get the raw data for the preferred channel
523  const std::vector<float>& rawLumiVec = bunchLumis->rawLuminosity(preferredChannel);
524  if (rawLumiVec.empty()) {
525  ATH_MSG_DEBUG( "Empty raw luminosity vector" );
526  return StatusCode::SUCCESS;
527  }
528 
529  //
530  // Calibration step
531  //
532 
533  // Here we want to go through and calibrate raw values in the luminous bunches only.
534  // This is what the OL adds up, and since these are online calibrations, we want to rescale the total
535  // to agree to whatever offline tag we are using.
536  std::vector<float> calLumiVec (LuminosityCondData::TOTAL_LHC_BCIDS, 0.);
537 
538  // Update muToLumi while we are at it (also check that calibration exists)
539  float muToLumi = onlineLumiCalibration->getMuToLumi (preferredChannel);
540  if (muToLumi <= 0.) {
541  ATH_MSG_ERROR( " dont have calibration information for preferred channel "
542  << preferredChannel << "!" );
543  return StatusCode::FAILURE;
544  }
545  lumi.setMuToLumi (muToLumi);
546 
547  double lumiSum = 0.;
548  for (unsigned int bcid : luminousBunches) {
549  // Don't waste time on zero lumi
550  if (rawLumiVec.at(bcid) <= 0.) {
551  ATH_MSG_DEBUG( "Calibrate BCID " << bcid << " with raw "
552  << rawLumiVec.at(bcid) << " -> skipping" );
553  continue;
554  }
555 
556  // Calibrate
557  if (!onlineLumiCalibration->calibrateLumi(preferredChannel,
558  rawLumiVec[bcid],
559  calLumiVec[bcid]))
560  {
561  ATH_MSG_DEBUG( "Calibrate BCID " << bcid << " with raw " << rawLumiVec[bcid] << " -> calibration failed!" );
562  ATH_MSG_WARNING( "Per-BCID calibration failed for bcid " << bcid << " with raw lumi = " << rawLumiVec[bcid] );
563  continue;
564  }
565 
566  lumiSum += calLumiVec[bcid];
567 
568  ATH_MSG_DEBUG( "Calibrate BCID " << bcid << " with raw " << rawLumiVec[bcid] << " -> " << calLumiVec[bcid] );
569  }
570 
571  // Work out scale factor between offline and online estimate
572  float offlineOnlineRatio = 1.;
573  if (lumiSum > 0.) offlineOnlineRatio = lumi.lbAverageLuminosity() / lumiSum;
574 
575  ATH_MSG_DEBUG( " Offline/Online scale factor: " << lumi.lbAverageLuminosity()
576  << " / " << lumiSum << " = " << offlineOnlineRatio );
577 
578  // Make sure we have values for all BCIDs in the physics bunch group
579  for (unsigned int bcid : bunchGroup->bunchGroup (1)) {
580  // Don't repeat if value already exists
581  if (calLumiVec[bcid] > 0.) continue;
582  if (rawLumiVec[bcid] <= 0.) continue;
583 
584  // Calibrate
585  if (!onlineLumiCalibration->calibrateLumi(preferredChannel,
586  rawLumiVec[bcid],
587  calLumiVec[bcid]))
588  {
589  ATH_MSG_DEBUG( " -> Calibration failed!" );
590  ATH_MSG_WARNING( "Per-BCID calibration failed for bcid " << bcid
591  << " with raw lumi = " << rawLumiVec[bcid] );
592  continue;
593  }
594  }
595 
596  // Almost done, now we apply the scale factor to all BCIDs
597  for (float& lumi : calLumiVec) {
598  lumi *= offlineOnlineRatio;
599  }
600 
601  lumi.setLbLuminosityPerBCIDVector (std::move (calLumiVec));
602 
603  return StatusCode::SUCCESS;
604 }
mergePhysValFiles.pattern
pattern
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:26
python.CaloRecoConfig.f
f
Definition: CaloRecoConfig.py:127
LuminosityCondAlg.h
Conditions algorithm for luminosity data.
get_generator_info.result
result
Definition: get_generator_info.py:21
CondAttrListCollection.h
This file defines the class for a collection of AttributeLists where each one is associated with a ch...
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
LuminosityCondAlg::updateMuToLumi
StatusCode updateMuToLumi(const EventContext &ctx, unsigned int calibChannel, SG::WriteCondHandle< LuminosityCondData > &wHdl, LuminosityCondData &lumi, bool &isValid) const
Fill in mu-to-lumi calibration.
Definition: LuminosityCondAlg.cxx:347
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:575
FillParamsCondData::luminousBunches
const std::vector< unsigned int > & luminousBunches() const
Definition: FillParamsCondData.cxx:27
LuminosityCondAlg::m_luminosityOutputKey
SG::WriteCondHandleKey< LuminosityCondData > m_luminosityOutputKey
Output conditions object.
Definition: LuminosityCondAlg.h:194
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
LuminosityCondAlg::m_luminosityFolderInputKey
SG::ReadCondHandleKey< CondAttrListCollection > m_luminosityFolderInputKey
Definition: LuminosityCondAlg.h:157
LuminosityCondAlg::updatePerBunchLumi
StatusCode updatePerBunchLumi(const EventContext &ctx, const coral::Blob *bunchInstLumiBlob, unsigned int preferredChannel, unsigned int calibChannel, SG::WriteCondHandle< LuminosityCondData > &wHdl, LuminosityCondData &lumi) const
Fill in per-bunch luminosity data.
Definition: LuminosityCondAlg.cxx:296
CxxUtils::tokenize
std::vector< std::string > tokenize(const std::string &the_str, std::string_view delimiters)
Splits the string into smaller substrings.
Definition: Control/CxxUtils/Root/StringUtils.cxx:15
LuminosityCondAlg::m_onlineLumiCalibrationInputKey
SG::ReadCondHandleKey< OnlineLumiCalibrationCondData > m_onlineLumiCalibrationInputKey
Definition: LuminosityCondAlg.h:161
AthCommonMsg< Gaudi::Algorithm >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
python.subdetectors.tile.Blob
Blob
Definition: tile.py:17
LuminosityCondAlg::m_fillParamsInputKey
SG::ReadCondHandleKey< FillParamsCondData > m_fillParamsInputKey
Definition: LuminosityCondAlg.h:173
LuminosityCondData::TOTAL_LHC_BCIDS
static constexpr unsigned int TOTAL_LHC_BCIDS
Definition: LuminosityCondData.h:27
python.PyKernel.AttributeList
AttributeList
Definition: PyKernel.py:36
isValid
bool isValid(const T &p)
Definition: AtlasPID.h:214
SG::VarHandleKey::empty
bool empty() const
Test if the key is blank.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:150
SG::WriteCondHandle::record
StatusCode record(const EventIDRange &range, T *t)
record handle, with explicit range DEPRECATED
Definition: WriteCondHandle.h:157
LuminosityCondAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override
Algorithm execute method.
Definition: LuminosityCondAlg.cxx:84
CondAttrListCollection
This class is a collection of AttributeLists where each one is associated with a channel number....
Definition: CondAttrListCollection.h:52
Trk::u
@ u
Enums for curvilinear frames.
Definition: ParamDefs.h:83
ReadCondHandle.h
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
ATH_RESTRICT
#define ATH_RESTRICT
Definition: restrict.h:31
LuminosityCondAlg::m_calibBackupChannel
Gaudi::Property< unsigned long > m_calibBackupChannel
Definition: LuminosityCondAlg.h:140
CxxUtils::get_unaligned_float
float get_unaligned_float(const uint8_t *ATH_RESTRICT &p)
Read little-endian float value from a possibly unaligned pointer.
Definition: get_unaligned.h:122
calibdata.valid
list valid
Definition: calibdata.py:45
LuminosityCondAlg::m_eventInfoKey
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
Definition: LuminosityCondAlg.h:182
LuminosityCondAlg::m_bunchGroupInputKey
SG::ReadCondHandleKey< BunchGroupCondData > m_bunchGroupInputKey
Definition: LuminosityCondAlg.h:169
LuminosityCondAlg::m_expectInvalid
Gaudi::Property< bool > m_expectInvalid
Definition: LuminosityCondAlg.h:146
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
lumiFormat.i
int i
Definition: lumiFormat.py:92
LuminosityCondAlg::initialize
virtual StatusCode initialize() override
Gaudi initialize method.
Definition: LuminosityCondAlg.cxx:57
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
WriteCondHandle.h
LuminosityCondAlg::m_muToLumi
Gaudi::Property< float > m_muToLumi
Definition: LuminosityCondAlg.h:153
IOVInfiniteRange::infiniteRunLB
static EventIDRange infiniteRunLB()
Produces an EventIDRange that is infinite in RunLumi and invalid in Time.
Definition: IOVInfiniteRange.h:39
LuminosityCondAlg::m_actualMuKey
SG::ReadDecorHandleKey< xAOD::EventInfo > m_actualMuKey
Definition: LuminosityCondAlg.h:185
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
CondAttrListCollection::attributeList
const AttributeList & attributeList(ChanNum chanNum) const
attribute list for a given channel number
Definition: CondAttrListCollection.h:401
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
get_unaligned.h
Read little-endian values through possibly unaligned pointers.
LuminosityCondData
Definition: LuminosityCondData.h:23
IOVInfiniteRange.h
LuminosityCondAlg::updateAvgLumi
StatusCode updateAvgLumi(const CondAttrListCollection &lumiData, LuminosityCondData &lumi, unsigned int &preferredChannel, unsigned int &calibChannel, const coral::Blob *&bunchInstLumiBlob) const
Unpack luminosity data from the attribute list.
Definition: LuminosityCondAlg.cxx:173
LuminosityCondAlg::updatePerBunchLumiRun1
StatusCode updatePerBunchLumiRun1(const EventContext &ctx, unsigned int preferredChannel, SG::WriteCondHandle< LuminosityCondData > &wHdl, LuminosityCondData &lumi) const
Fill in per-bunch luminosity data, run 1.
Definition: LuminosityCondAlg.cxx:480
BunchLumisCondData::rawLuminosity
const std::vector< float > & rawLuminosity(unsigned int channel) const
Return vector of per-BCID raw luminosity for a given channel.
Definition: BunchLumisCondData.cxx:22
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
xAOD::bcid
setEventNumber setTimeStamp bcid
Definition: EventInfo_v1.cxx:133
LuminosityCondAlg::m_isMC
Gaudi::Property< bool > m_isMC
Definition: LuminosityCondAlg.h:150
OnlineLumiCalibrationCondData::getMuToLumi
float getMuToLumi(unsigned int channel) const
Return muToLumi parameter.
Definition: OnlineLumiCalibrationCondData.cxx:32
COOLRates.luminousBunches
luminousBunches
Definition: COOLRates.py:1245
BunchGroupCondData::bunchGroup
const std::vector< unsigned int > & bunchGroup(unsigned int group) const
Return filled BCIDs for one bunch group.
Definition: BunchGroupCondData.cxx:35
LuminosityCondAlg::updatePerBunchLumiRun2
StatusCode updatePerBunchLumiRun2(const coral::Blob &bunchInstLumiBlob, unsigned int preferredChannel, LuminosityCondData &lumi) const
Fill in per-bunch luminosity data, run 2 and later.
Definition: LuminosityCondAlg.cxx:413
lumiFormat.lumi
lumi
Definition: lumiFormat.py:113
OnlineLumiCalibrationCondData::calibrateLumi
bool calibrateLumi(unsigned int channel, float raw, float &lumi) const
Luminosity calibration.
Definition: OnlineLumiCalibrationCondData.cxx:49
LuminosityCondAlg::m_bunchLumisInputKey
SG::ReadCondHandleKey< BunchLumisCondData > m_bunchLumisInputKey
Definition: LuminosityCondAlg.h:165
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
AsgConfigHelper::strtof
bool strtof(const std::string &input, T &f)
Definition: AsgEGammaConfigHelper.cxx:47
DEBUG
#define DEBUG
Definition: page_access.h:11
LuminosityCondAlg::m_skipInvalid
Gaudi::Property< bool > m_skipInvalid
Definition: LuminosityCondAlg.h:143
LuminosityCondAlg::m_mcDigitizationInputKey
SG::ReadCondHandleKey< AthenaAttributeList > m_mcDigitizationInputKey
Definition: LuminosityCondAlg.h:178
SG::get
const T * get(const ReadHandleKey< T > &key)
Convenience function to retrieve an object given a ReadHandleKey.
SG::AllowEmpty
@ AllowEmpty
Definition: StoreGate/StoreGate/VarHandleKey.h:30
python.compressB64.c
def c
Definition: compressB64.py:93
SG::WriteCondHandle
Definition: WriteCondHandle.h:26
LuminosityCondAlg::m_lumiChannel
Gaudi::Property< unsigned long > m_lumiChannel
Definition: LuminosityCondAlg.h:137
LuminosityCondAlg::m_averageMuKey
SG::ReadDecorHandleKey< xAOD::EventInfo > m_averageMuKey
Definition: LuminosityCondAlg.h:189
SG::WriteCondHandle::addDependency
void addDependency(const EventIDRange &range)
Definition: WriteCondHandle.h:275