ATLAS Offline Software
Loading...
Searching...
No Matches
LuminosityCondAlg.cxx
Go to the documentation of this file.
1/*
2 * Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration.
3 */
10
11
12#include "LuminosityCondAlg.h"
17#include "CoolKernel/IObject.h"
21#include <nlohmann/json.hpp>
22#include <sstream>
23
24
25namespace {
26
27// from from BunchCrossingCondAlg, decodes bunch pattern from metadata string
28std::vector<float> tokenize( const std::string& pattern ) {
29
30 if (pattern == "None") {
31 return std::vector<float>(LuminosityCondData::TOTAL_LHC_BCIDS, 1.);
32 }
33
34 std::vector< float > result;
35 const char* c= pattern.data();
36 const char* cEnd= c + pattern.size();
37 while(c<cEnd) {
38 //This loop swallows actually any string containing numbers
39 //separated by non-numbers
40 char* end;
41 float f=std::strtof(c,&end);
42 if (c==end) {//Can't convert, try next
43 c++;
44 }
45 else { //got a value
46 result.push_back(f);
47 c=end;
48 }
49 }//end while loop
50 return result;
51}
52
53} // anonymous namespace
54
55
59StatusCode
61{
62 ATH_CHECK( m_luminosityOutputKey.initialize() );
63
64 // May be empty if configured for MC.
67
68 // May be empty if configured for data, or for MC ByteStream (will use BS metadata instead).
70 // ByteStream metadata is only used in MC mode, but we initialize with AllowEmpty always
71 // since the code may try to access it. For data mode, it will just be unused.
73 ATH_CHECK( m_eventInfoKey.initialize(m_isMC) );
74 ATH_CHECK( m_actualMuKey.initialize(m_isMC) );
75 ATH_CHECK( m_averageMuKey.initialize(m_isMC) );
76
77 // Only used for run1.
81 return StatusCode::SUCCESS;
82}
83
84
89StatusCode
90LuminosityCondAlg::execute (const EventContext& ctx) const
91{
92 auto lumi = std::make_unique<LuminosityCondData>();
95
96 if (m_isMC) {
97 // MC case.
98 const auto* eventinfo = SG::get(m_eventInfoKey, ctx);
99 // define a range for this one LB with one second validity
100 EventIDRange range = EventIDRange(EventIDBase(eventinfo->runNumber(),
101 EventIDBase::UNDEFEVT,
102 eventinfo->timeStamp(),
103 eventinfo->timeStampNSOffset(),
104 eventinfo->lumiBlock()),
105 EventIDBase(eventinfo->runNumber(),
106 EventIDBase::UNDEFEVT,
107 eventinfo->timeStamp()+1,
108 eventinfo->timeStampNSOffset(),
109 eventinfo->lumiBlock()+1));
110
111 luminosityCondData.addDependency(range);
112
113 const float avgMu = eventinfo->averageInteractionsPerCrossing();
114 std::string sbunches;
115
116 // Try to read from digitization folder first (traditional source for POOL files)
117 bool foundInDigitization = false;
118
119 if (!m_mcDigitizationInputKey.empty()) {
121
122 if (digitizationFolder.isValid()) {
123 try {
124 const auto& attr = (**digitizationFolder)[std::string("BeamIntensityPattern")];
125 sbunches = attr.data<std::string>();
126 foundInDigitization = true;
127 ATH_MSG_DEBUG("Read BeamIntensityPattern from Digitization folder");
128 } catch (const std::exception& e) {
129 ATH_MSG_DEBUG("Could not read from Digitization folder: " << e.what());
130 }
131 }
132 }
133
134 // Fall back to ByteStream metadata if not found in digitization folder
135 if (!foundInDigitization) {
137
138 if (bsMetadata.isValid() && !bsMetadata->empty()) {
139 const ByteStreamMetadata* metadata = bsMetadata->at(0);
140 const std::vector<std::string>& freeStrings = metadata->getFreeMetaDataStrings();
141
142 // Look for IOVMeta./Digitization/Parameters= in freeMetaDataStrings
143 for (const std::string& str : freeStrings) {
144 if (str.starts_with("IOVMeta./Digitization/Parameters=")) {
145 // Extract JSON string after the '=' sign
146 size_t eqPos = str.find('=');
147 if (eqPos != std::string::npos && eqPos + 1 < str.size()) {
148 std::string jsonStr = str.substr(eqPos + 1);
149
150 try {
151 nlohmann::json iovMetadata = nlohmann::json::parse(jsonStr);
152
153 // Extract BeamIntensityPattern from the JSON
154 // The JSON structure is: {"iovs": [{"attrs": {"chan65535": {"BeamIntensityPattern": "..."}}}]}
155 if (iovMetadata.contains("iovs") && iovMetadata["iovs"].is_array() && !iovMetadata["iovs"].empty()) {
156 const auto& firstIov = iovMetadata["iovs"][0];
157 if (firstIov.contains("attrs")) {
158 // Look through all channels for BeamIntensityPattern
159 for (const auto& chanItem : firstIov["attrs"].items()) {
160 const auto& chanAttrs = chanItem.value();
161 if (chanAttrs.contains("BeamIntensityPattern")) {
162 sbunches = chanAttrs["BeamIntensityPattern"].get<std::string>();
163 ATH_MSG_INFO("Read BeamIntensityPattern from ByteStream metadata");
164 break;
165 }
166 }
167 if (!sbunches.empty()) break;
168 }
169 }
170 } catch (const std::exception& e) {
171 ATH_MSG_WARNING("Failed to parse IOV metadata from ByteStream: " << e.what());
172 }
173 }
174 }
175 }
176 }
177
178 if (sbunches.empty()) {
179 ATH_MSG_ERROR("Could not read BeamIntensityPattern from either Digitization folder or ByteStream metadata");
180 }
181 }
182
183 std::vector<float> bunchpattern = tokenize(sbunches);
184
185 if (bunchpattern.size() != LuminosityCondData::TOTAL_LHC_BCIDS) {
186 ATH_MSG_ERROR("Decoding MC bunch structure failed, improper number of LHC BCIDs");
187 bunchpattern = std::vector<float>(LuminosityCondData::TOTAL_LHC_BCIDS, 1.);
188 }
189
190 float totintensity = 0.;
191 for (size_t i = 0; i < bunchpattern.size(); ++i) {
192 totintensity += bunchpattern[i];
193 bunchpattern[i] *= (avgMu*m_muToLumi);
194 }
195
196 lumi->setLbAverageInteractionsPerCrossing(avgMu);
197 lumi->setLbAverageLuminosity(totintensity*avgMu*m_muToLumi);
198 lumi->setLbLuminosityPerBCIDVector(std::move(bunchpattern));
199 lumi->setMuToLumi(m_muToLumi);
200 }
201 else {
204 luminosityCondData.addDependency(luminosityFolder);
205
206 unsigned int preferredChannel;
207 unsigned int calibChannel;
208 const coral::Blob* bunchInstLumiBlob = nullptr;
209 ATH_CHECK( updateAvgLumi (**luminosityFolder,
210 *lumi,
211 preferredChannel,
212 calibChannel,
213 bunchInstLumiBlob) );
214
216 bunchInstLumiBlob,
217 preferredChannel,
218 calibChannel,
219 luminosityCondData,
220 *lumi) );
221 }
222
223
224 ATH_CHECK( luminosityCondData.record (std::move (lumi)) );
225 return StatusCode::SUCCESS;
226}
227
228
243StatusCode
245 LuminosityCondData& lumi,
246 unsigned int& preferredChannel,
247 unsigned int& calibChannel,
248 const coral::Blob*& bunchInstLumiBlob) const
249
250{
251 preferredChannel = 0;
252 calibChannel = 0;
253 bunchInstLumiBlob = nullptr;
254
255 const coral::AttributeList& attrList = lumiData.attributeList (m_lumiChannel);
256 if (attrList.size() == 0 || attrList["Valid"].isNull()) {
257 ATH_MSG_DEBUG ("Can't find luminosity information for channel " << m_lumiChannel);
258 return StatusCode::SUCCESS;
259 }
260
261 if (msgLvl (MSG::DEBUG)) {
262 std::ostringstream attrStr1;
263 attrList.toOutputStream( attrStr1 );
264 ATH_MSG_DEBUG( "ChanNum " << m_lumiChannel << " Attribute list "
265 << attrStr1.str() );
266 }
267
268 // Check data availability
269 if (attrList["LBAvInstLumi"].isNull() || attrList["LBAvEvtsPerBX"].isNull()) {
270 ATH_MSG_ERROR( " NULL Luminosity information in database " );
271 return StatusCode::FAILURE;
272 }
273
274 // Check validity (don't bother continuing if invalid)
275 uint32_t valid = attrList["Valid"].data<cool::UInt32>();
276 lumi.setLbAverageValid (valid);
277 if (valid & 0x01) {
278 if (m_skipInvalid) {
279 if (!m_expectInvalid) {
280 ATH_MSG_INFO( " Invalid LB Average luminosity ... set lumi to 0" );
281 }
282 return StatusCode::SUCCESS;
283 } else {
284 ATH_MSG_DEBUG( " Invalid LB Average luminosity ... continuing because skipInvalid == FALSE" );
285 }
286 }
287
288 // Get preferred channel (needed for per-BCID calculation)
289 if (m_lumiChannel == 0u) {
290
291 // Check if we have a payload for this (Run2 only)
292 bool hasAlgorithmID = false;
293 for (coral::AttributeList::const_iterator attr = attrList.begin();
294 attr != attrList.end(); ++attr) {
295 if (attr->specification().name() == "AlgorithmID") {
296 hasAlgorithmID = true;
297 break;
298 }
299 }
300
301 if (hasAlgorithmID) {
302 // In Run2, channel 0 should be good. Leave as is
303 preferredChannel = m_lumiChannel;
304 calibChannel = attrList["AlgorithmID"].data<cool::UInt32>();
305
306 } else {
307 // In Run1, we need to recalculate from the actual channel number
308 preferredChannel = (valid >> 22);
309 calibChannel = preferredChannel;
310 }
311
312 } else {
313 preferredChannel = m_lumiChannel;
314 calibChannel = m_lumiChannel;
315 }
316
317 float LBAvInstLumi = attrList["LBAvInstLumi"].data<cool::Float>(); // Lumi
318 float LBAvEvtsPerBX = attrList["LBAvEvtsPerBX"].data<cool::Float>(); // Mu
319
320 // Check (and protect for NaN
321 if ( std::isnan (LBAvInstLumi) ) {
322 ATH_MSG_WARNING( " Luminosity is not a number.. " << LBAvInstLumi << " ... set it to 0 " );
323 LBAvInstLumi=0.;
324 }
325
326 if ( std::isnan (LBAvEvtsPerBX) ) {
327 ATH_MSG_WARNING( " Luminosity is not a number.. " << LBAvEvtsPerBX << " ... set it to 0 " );
328 LBAvEvtsPerBX=0.;
329 }
330
331 lumi.setLbAverageLuminosity (LBAvInstLumi);
332 lumi.setLbAverageInteractionsPerCrossing (LBAvEvtsPerBX);
333
334 // Check validity of per-BCID luminosity (will issue warning in recalcPerBCIDLumi
335 int perBcidValid = ((valid&0x3ff)/10) % 10;
336 if ((perBcidValid > 0) && m_skipInvalid) {
337 return StatusCode::SUCCESS;
338 }
339
340 // Also save per-BCID blob if it exists
341 for (coral::AttributeList::const_iterator attr = attrList.begin();
342 attr != attrList.end(); ++attr)
343 {
344 if (attr->specification().name() == "BunchInstLumi") {
345 if (!attrList["BunchInstLumi"].isNull())
346 bunchInstLumiBlob = &attrList["BunchInstLumi"].data<coral::Blob>();
347 break;
348 }
349 }
350
351 return StatusCode::SUCCESS;
352}
353
354
366StatusCode
368 const coral::Blob* bunchInstLumiBlob,
369 unsigned int preferredChannel,
370 unsigned int calibChannel,
372 LuminosityCondData& lumi) const
373{
374 if (lumi.lbAverageLuminosity() <= 0.) {
375 if (!m_expectInvalid) {
376 ATH_MSG_INFO( "LBAvInstLumi is zero or negative in updatePerBunchLumi():"
377 << lumi.lbAverageLuminosity());
379 }
380 return StatusCode::SUCCESS;
381 }
382 bool isValid = true;
383 ATH_CHECK( updateMuToLumi (ctx, calibChannel, wHdl, lumi, isValid) );
384
385 // Check here if we want to do this the Run1 way (hard) or the Run2 way (easy)
386
387 if (!isValid) {
388 // Skip if not valid.
389 }
390 else if (bunchInstLumiBlob != nullptr) { // Run2 way, easy
391 ATH_CHECK( updatePerBunchLumiRun2 (*bunchInstLumiBlob,
392 preferredChannel,
393 lumi) );
394 }
395 else { // Run1 way, hard!
397 preferredChannel,
398 wHdl,
399 lumi) );
400 }
401
402 ATH_MSG_DEBUG( "finished updatePerBunchLumi() for alg: "
403 << preferredChannel );
404 return StatusCode::SUCCESS;
405}
406
407
417StatusCode
418LuminosityCondAlg::updateMuToLumi (const EventContext& ctx,
419 unsigned int calibChannel,
421 LuminosityCondData& lumi,
422 bool& isValid) const
423{
426 wHdl.addDependency(onlineLumiCalibration);
427
428 // This is the only correct way to do this!
429 // The division below gives average mu (over all bunches) to total lumi
430 float muToLumi = onlineLumiCalibration->getMuToLumi (calibChannel);
431
432 // Check if this is reasonable
433 if (muToLumi < 0.) {
434 ATH_MSG_WARNING(" Found muToLumi = " << muToLumi << " for channel " << calibChannel << ". Try backup channel..." );
435 muToLumi = onlineLumiCalibration->getMuToLumi(m_calibBackupChannel);
436 ATH_MSG_WARNING(" Found muToLumi = " << muToLumi << " for backup channel " << m_calibBackupChannel);
437 }
438
439 lumi.setMuToLumi (muToLumi);
440
441 // Check validity
442 isValid = true;
443 int perBcidValid = ((lumi.lbAverageValid()&0x3ff)/10) % 10;
444 if ((lumi.lbAverageValid() & 0x03) || (perBcidValid > 0)) { // Skip if either per-BCID or LBAv is invalid
445 isValid = false;
446 if (m_skipInvalid) {
447 ATH_MSG_WARNING( " Invalid per-BCID luminosity found: "
448 << lumi.lbAverageValid() << "!" );
449 return StatusCode::SUCCESS;
450 } else {
451 ATH_MSG_WARNING( " Invalid per-BCID luminosity found: "
452 << lumi.lbAverageValid()
453 << " continuing because skipInvalid == FALSE" );
454 }
455 }
456
457 // Now check muToLumi and report depending upon whether lumi is valid or not
458 if (muToLumi < 0.) {
459 if (isValid) {
460 ATH_MSG_ERROR(" Found invalid muToLumi = " << muToLumi << " for backup channel " << m_calibBackupChannel << "!");
461 } else {
462 ATH_MSG_WARNING(" Found invalid muToLumi = " << muToLumi << " for backup channel " << m_calibBackupChannel << "!");
463 }
464
465 // Don't keep negative values
466 muToLumi = 0.;
467 lumi.setMuToLumi (muToLumi);
468 }
469
470 ATH_MSG_DEBUG(" Found muToLumi = " << muToLumi << " for channel "
471 << calibChannel );
472
473 return StatusCode::SUCCESS;
474}
475
476
483StatusCode
484LuminosityCondAlg::updatePerBunchLumiRun2 (const coral::Blob& bunchInstLumiBlob,
485 unsigned int preferredChannel,
486 LuminosityCondData& lumi) const
487{
488 ATH_MSG_DEBUG( "starting updatePerBunchLumiRun2() for alg: " << preferredChannel );
489
490 // Check that the length isn't zero
491 if (bunchInstLumiBlob.size() == 0) {
492 ATH_MSG_ERROR("BunchInstLumi blob found with zero length!");
493 return StatusCode::FAILURE;
494 }
495
496 // Hardcode the Run2 BLOB decoding (should use CoolLumiUtilities...)
497 const uint8_t* ATH_RESTRICT pchar =
498 static_cast<const uint8_t*>(bunchInstLumiBlob.startingAddress()); // First byte holds storage size and mode
499 unsigned int bss = ((*pchar) % 100) / 10; // Byte storage size
500 unsigned int smod = ((*pchar) % 10); // Storage mode
501 ++pchar; // Points to next char after header
502
503 ATH_MSG_DEBUG( "BunchInstLumi blob found with storage mode " << smod
504 << " and byte storage size " << bss );
505
506 // Make sure we have what we think we have
507 if (bss != 4 || smod != 1) {
508 ATH_MSG_ERROR( "BunchInstLumi blob found with storage mode " << smod << " and byte storage size " << bss << " - Unknown!");
509 return StatusCode::FAILURE;
510 }
511
512 unsigned int nbcids = LuminosityCondData::TOTAL_LHC_BCIDS;
513 unsigned int bloblength = bss * nbcids + 1;
514
515 if (static_cast<cool::UInt32>(bunchInstLumiBlob.size()) != bloblength) {
516 ATH_MSG_ERROR( "BunchRawInstLumi blob found with length"
517 << bunchInstLumiBlob.size() << "in storage mode" << smod
518 << ", expecting " << bloblength << "!" );
519 return StatusCode::FAILURE;
520 }
521
522 // Length is correct, read raw data according to packing scheme
523 // This is absolute luminosity, so just unpack values into our array
524
525 ATH_MSG_DEBUG( "Unpacking lumi value from blob");
526 std::vector<float> instLumi (nbcids);
527 for (unsigned int i=0; i<nbcids; i++) {
528 // Can't use assignment directly because source may be misaligned.
529 instLumi[i] = CxxUtils::get_unaligned_float (pchar);
530 }
531
532 if (msgLvl (MSG::DEBUG)) {
533 for (unsigned int i=0; i<nbcids; i++) {
534 ATH_MSG_DEBUG( "Bcid: " << i << " Lumi: " << instLumi[i] );
535 }
536 }
537
538 lumi.setLbLuminosityPerBCIDVector (std::move (instLumi));
539
540 return StatusCode::SUCCESS;
541}
542
543
550StatusCode
552 unsigned int preferredChannel,
554 LuminosityCondData& lumi) const
555{
556 ATH_MSG_DEBUG( "starting updatePerBunchLumiRun1() for alg: " << preferredChannel );
557
558 if (preferredChannel == 0) {
559 return StatusCode::SUCCESS;
560 }
561
562 // Nothing to do if we don't have the ingredients
564 ATH_MSG_DEBUG( "OnlineLumiCalibrationInputKey.empty() is TRUE, skipping..." );
565 return StatusCode::SUCCESS;
566 }
567 if (m_bunchLumisInputKey.empty()) {
568 ATH_MSG_DEBUG( "BunchLumisInputKey.empty() is TRUE, skipping..." );
569 return StatusCode::SUCCESS;
570 }
571 if (m_bunchGroupInputKey.empty()) {
572 ATH_MSG_DEBUG( "BunchGroupTool.empty() is TRUE, skipping..." );
573 return StatusCode::SUCCESS;
574 }
575 if (m_fillParamsInputKey.empty()) {
576 ATH_MSG_DEBUG( "FillParamsInputKey.empty() is TRUE, skipping..." );
577 return StatusCode::SUCCESS;
578 }
579
582 wHdl.addDependency(onlineLumiCalibration);
584 wHdl.addDependency(bunchLumis);
586 wHdl.addDependency(bunchGroup);
588 wHdl.addDependency(fillParams);
589
590 const std::vector<unsigned int>& luminousBunches = fillParams->luminousBunches();
591 ATH_MSG_DEBUG( "N LuminousBunches:" << luminousBunches.size() );
592
593 // Get the raw data for the preferred channel
594 const std::vector<float>& rawLumiVec = bunchLumis->rawLuminosity(preferredChannel);
595 if (rawLumiVec.empty()) {
596 ATH_MSG_DEBUG( "Empty raw luminosity vector" );
597 return StatusCode::SUCCESS;
598 }
599
600 //
601 // Calibration step
602 //
603
604 // Here we want to go through and calibrate raw values in the luminous bunches only.
605 // This is what the OL adds up, and since these are online calibrations, we want to rescale the total
606 // to agree to whatever offline tag we are using.
607 std::vector<float> calLumiVec (LuminosityCondData::TOTAL_LHC_BCIDS, 0.);
608
609 // Update muToLumi while we are at it (also check that calibration exists)
610 float muToLumi = onlineLumiCalibration->getMuToLumi (preferredChannel);
611 if (muToLumi <= 0.) {
612 ATH_MSG_ERROR( " dont have calibration information for preferred channel "
613 << preferredChannel << "!" );
614 return StatusCode::FAILURE;
615 }
616 lumi.setMuToLumi (muToLumi);
617
618 double lumiSum = 0.;
619 for (unsigned int bcid : luminousBunches) {
620 // Don't waste time on zero lumi
621 if (rawLumiVec.at(bcid) <= 0.) {
622 ATH_MSG_DEBUG( "Calibrate BCID " << bcid << " with raw "
623 << rawLumiVec.at(bcid) << " -> skipping" );
624 continue;
625 }
626
627 // Calibrate
628 if (!onlineLumiCalibration->calibrateLumi(preferredChannel,
629 rawLumiVec[bcid],
630 calLumiVec[bcid]))
631 {
632 ATH_MSG_DEBUG( "Calibrate BCID " << bcid << " with raw " << rawLumiVec[bcid] << " -> calibration failed!" );
633 ATH_MSG_WARNING( "Per-BCID calibration failed for bcid " << bcid << " with raw lumi = " << rawLumiVec[bcid] );
634 continue;
635 }
636
637 lumiSum += calLumiVec[bcid];
638
639 ATH_MSG_DEBUG( "Calibrate BCID " << bcid << " with raw " << rawLumiVec[bcid] << " -> " << calLumiVec[bcid] );
640 }
641
642 // Work out scale factor between offline and online estimate
643 float offlineOnlineRatio = 1.;
644 if (lumiSum > 0.) offlineOnlineRatio = lumi.lbAverageLuminosity() / lumiSum;
645
646 ATH_MSG_DEBUG( " Offline/Online scale factor: " << lumi.lbAverageLuminosity()
647 << " / " << lumiSum << " = " << offlineOnlineRatio );
648
649 // Make sure we have values for all BCIDs in the physics bunch group
650 for (unsigned int bcid : bunchGroup->bunchGroup (1)) {
651 // Don't repeat if value already exists
652 if (calLumiVec[bcid] > 0.) continue;
653 if (rawLumiVec[bcid] <= 0.) continue;
654
655 // Calibrate
656 if (!onlineLumiCalibration->calibrateLumi(preferredChannel,
657 rawLumiVec[bcid],
658 calLumiVec[bcid]))
659 {
660 ATH_MSG_DEBUG( " -> Calibration failed!" );
661 ATH_MSG_WARNING( "Per-BCID calibration failed for bcid " << bcid
662 << " with raw lumi = " << rawLumiVec[bcid] );
663 continue;
664 }
665 }
666
667 // Almost done, now we apply the scale factor to all BCIDs
668 for (float& bclumi : calLumiVec) {
669 bclumi *= offlineOnlineRatio;
670 }
671
672 lumi.setLbLuminosityPerBCIDVector (std::move (calLumiVec));
673
674 return StatusCode::SUCCESS;
675}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
bool isValid(const T &p)
Av: we implement here an ATLAS-sepcific convention: all particles which are 99xxxxx are fine.
Definition AtlasPID.h:878
This file contains the class definition for the ByteStreamMetadata class.
This file defines the class for a collection of AttributeLists where each one is associated with a ch...
Conditions algorithm for luminosity data.
Handle class for reading from StoreGate.
bool msgLvl(const MSG::Level lvl) const
This class is the StoreGate data object for bytestream metadata.
This class is a collection of AttributeLists where each one is associated with a channel number.
const AttributeList & attributeList(ChanNum chanNum) const
attribute list for a given channel number
static EventIDRange infiniteRunLB()
Produces an EventIDRange that is infinite in RunLumi and invalid in Time.
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.
Gaudi::Property< float > m_muToLumi
SG::WriteCondHandleKey< LuminosityCondData > m_luminosityOutputKey
Output conditions object.
SG::ReadCondHandleKey< BunchGroupCondData > m_bunchGroupInputKey
SG::ReadCondHandleKey< OnlineLumiCalibrationCondData > m_onlineLumiCalibrationInputKey
StatusCode updatePerBunchLumiRun1(const EventContext &ctx, unsigned int preferredChannel, SG::WriteCondHandle< LuminosityCondData > &wHdl, LuminosityCondData &lumi) const
Fill in per-bunch luminosity data, run 1.
Gaudi::Property< bool > m_isMC
virtual StatusCode execute(const EventContext &ctx) const override
Algorithm execute method.
SG::ReadDecorHandleKey< xAOD::EventInfo > m_averageMuKey
SG::ReadCondHandleKey< FillParamsCondData > m_fillParamsInputKey
StatusCode updateMuToLumi(const EventContext &ctx, unsigned int calibChannel, SG::WriteCondHandle< LuminosityCondData > &wHdl, LuminosityCondData &lumi, bool &isValid) const
Fill in mu-to-lumi calibration.
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
Gaudi::Property< unsigned long > m_lumiChannel
SG::ReadDecorHandleKey< xAOD::EventInfo > m_actualMuKey
Gaudi::Property< bool > m_skipInvalid
SG::ReadHandleKey< ByteStreamMetadataContainer > m_byteStreamMetadataKey
SG::ReadCondHandleKey< AthenaAttributeList > m_mcDigitizationInputKey
Gaudi::Property< bool > m_expectInvalid
SG::ReadCondHandleKey< BunchLumisCondData > m_bunchLumisInputKey
virtual StatusCode initialize() override
Gaudi initialize method.
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.
StatusCode updatePerBunchLumiRun2(const coral::Blob &bunchInstLumiBlob, unsigned int preferredChannel, LuminosityCondData &lumi) const
Fill in per-bunch luminosity data, run 2 and later.
SG::ReadCondHandleKey< CondAttrListCollection > m_luminosityFolderInputKey
Gaudi::Property< unsigned long > m_calibBackupChannel
static constexpr unsigned int TOTAL_LHC_BCIDS
virtual bool isValid() override final
Can the handle be successfully dereferenced?
void addDependency(const EventIDRange &range)
StatusCode record(const EventIDRange &range, T *t)
record handle, with explicit range DEPRECATED
Read little-endian values through possibly unaligned pointers.
std::vector< std::string > tokenize(const std::string &the_str, std::string_view delimiters)
Splits the string into smaller substrings.
float get_unaligned_float(const uint8_t *ATH_RESTRICT &p)
Read a little-endian float value from a possibly unaligned pointer.
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.
#define ATH_RESTRICT
Definition restrict.h:31