|
ATLAS Offline Software
|
Conditions algorithm for luminosity data.
More...
#include <LuminosityCondAlg.h>
|
virtual StatusCode | initialize () override |
| Gaudi initialize method. More...
|
|
virtual StatusCode | execute (const EventContext &ctx) const override |
| Algorithm execute method. More...
|
|
virtual bool | isReEntrant () const override final |
|
| AthReentrantAlgorithm (const std::string &name, ISvcLocator *pSvcLocator) |
| Forward base class ctor. More...
|
|
virtual StatusCode | sysInitialize () override |
| Override sysInitialize. More...
|
|
virtual bool | isClonable () const override |
| Specify if the algorithm is clonable. More...
|
|
virtual unsigned int | cardinality () const override |
| Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant. More...
|
|
virtual StatusCode | sysExecute (const EventContext &ctx) override |
| Execute an algorithm. More...
|
|
virtual const DataObjIDColl & | extraOutputDeps () const override |
| Return the list of extra output dependencies. More...
|
|
virtual bool | filterPassed (const EventContext &ctx) const |
|
virtual void | setFilterPassed (bool state, const EventContext &ctx) const |
|
ServiceHandle< StoreGateSvc > & | evtStore () |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | evtStore () const |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | detStore () const |
| The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
virtual StatusCode | sysStart () override |
| Handle START transition. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override |
| Return this algorithm's input handles. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override |
| Return this algorithm's output handles. More...
|
|
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Property< T > &t) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc="none") |
| Declare a new Gaudi property. More...
|
|
void | updateVHKA (Gaudi::Details::PropertyBase &) |
|
MsgStream & | msg () const |
|
MsgStream & | msg (const MSG::Level lvl) const |
|
bool | msgLvl (const MSG::Level lvl) const |
|
|
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. More...
|
|
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. More...
|
|
StatusCode | updateMuToLumi (const EventContext &ctx, unsigned int calibChannel, SG::WriteCondHandle< LuminosityCondData > &wHdl, LuminosityCondData &lumi, bool &isValid) const |
| Fill in mu-to-lumi calibration. More...
|
|
StatusCode | updatePerBunchLumiRun2 (const coral::Blob &bunchInstLumiBlob, unsigned int preferredChannel, LuminosityCondData &lumi) const |
| Fill in per-bunch luminosity data, run 2 and later. More...
|
|
StatusCode | updatePerBunchLumiRun1 (const EventContext &ctx, unsigned int preferredChannel, SG::WriteCondHandle< LuminosityCondData > &wHdl, LuminosityCondData &lumi) const |
| Fill in per-bunch luminosity data, run 1. More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKey> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &) |
| specialization for handling Gaudi::Property<SG::VarHandleBase> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &) |
| specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
|
|
|
Gaudi::Property< unsigned long > | m_lumiChannel { this, "LumiChannelNumber", 0, "Luminosity channel to read. 0 means to determine from the data." } |
|
Gaudi::Property< unsigned long > | m_calibBackupChannel { this, "CalibBackupChannel", 112, "Backup channel in case calibChannel doesn't exist in online calibration folder" } |
|
Gaudi::Property< bool > | m_skipInvalid { this, "SkipInvalid", true, "Flag to control whether invalid data is skipped: True (default), returning a zero luminosity; false, returning available luminosity values anyway." } |
|
Gaudi::Property< bool > | m_expectInvalid { this, "ExpectInvalid", false, "Flag to control printouts when invalid data are encountered: True suppresses messages, False (default) leaves them in" } |
|
Gaudi::Property< bool > | m_isMC { this, "IsMC", false, "Set to true when running on MC instead of data" } |
|
Gaudi::Property< float > | m_muToLumi { this, "MCMuToLumi", 0.140569, "mu to lumi conversion factor in MC (80 mb/LHC rev freq)" } |
|
SG::ReadCondHandleKey< CondAttrListCollection > | m_luminosityFolderInputKey |
|
SG::ReadCondHandleKey< OnlineLumiCalibrationCondData > | m_onlineLumiCalibrationInputKey |
|
SG::ReadCondHandleKey< BunchLumisCondData > | m_bunchLumisInputKey |
|
SG::ReadCondHandleKey< BunchGroupCondData > | m_bunchGroupInputKey |
|
SG::ReadCondHandleKey< FillParamsCondData > | m_fillParamsInputKey |
|
SG::ReadCondHandleKey< AthenaAttributeList > | m_mcDigitizationInputKey |
|
SG::ReadHandleKey< xAOD::EventInfo > | m_eventInfoKey { this, "EventInfoKey", "EventInfo", "EventInfo key, used to read in simulated mu in MC" } |
|
SG::ReadDecorHandleKey< xAOD::EventInfo > | m_actualMuKey |
|
SG::ReadDecorHandleKey< xAOD::EventInfo > | m_averageMuKey |
|
SG::WriteCondHandleKey< LuminosityCondData > | m_luminosityOutputKey |
| Output conditions object. More...
|
|
DataObjIDColl | m_extendedExtraObjects |
| Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks. More...
|
|
StoreGateSvc_t | m_evtStore |
| Pointer to StoreGate (event store by default) More...
|
|
StoreGateSvc_t | m_detStore |
| Pointer to StoreGate (detector store by default) More...
|
|
std::vector< SG::VarHandleKeyArray * > | m_vhka |
|
bool | m_varHandleArraysDeclared |
|
Conditions algorithm for luminosity data.
Definition at line 33 of file LuminosityCondAlg.h.
◆ StoreGateSvc_t
◆ AthReentrantAlgorithm()
AthReentrantAlgorithm::AthReentrantAlgorithm |
Forward base class ctor.
Definition at line 90 of file AthReentrantAlgorithm.cxx.
30 std::make_unique<AthenaBaseComps::AthAlgorithmDHUpdate>
32 std::move (m_updateDataHandles));
◆ cardinality()
unsigned int AthReentrantAlgorithm::cardinality |
( |
| ) |
const |
|
overridevirtualinherited |
Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.
Override this to return 0 for reentrant algorithms.
Override this to return 0 for reentrant algorithms.
Definition at line 55 of file AthReentrantAlgorithm.cxx.
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleBase
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 245 of file AthCommonDataStore.h.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleKey
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 221 of file AthCommonDataStore.h.
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This is the generic version, for types that do not derive from SG::VarHandleKey
. It just forwards to the base class version of declareProperty
.
Definition at line 333 of file AthCommonDataStore.h.
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This dispatches to either the generic declareProperty
or the one for VarHandle/Key/KeyArray.
Definition at line 352 of file AthCommonDataStore.h.
◆ declareProperty() [6/6]
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ execute()
StatusCode LuminosityCondAlg::execute |
( |
const EventContext & |
ctx | ) |
const |
|
overridevirtual |
Algorithm execute method.
- Parameters
-
Definition at line 84 of file LuminosityCondAlg.cxx.
86 auto lumi = std::make_unique<LuminosityCondData>();
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));
107 luminosityCondData.addDependency(
range);
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);
115 ATH_MSG_ERROR(
"Decoding MC bunch structure failed, improper number of LHC BCIDs");
119 float totintensity = 0.;
120 for (
size_t i = 0;
i < bunchpattern.size(); ++
i) {
121 totintensity += bunchpattern[
i];
125 lumi->setLbAverageInteractionsPerCrossing(avgMu);
127 lumi->setLbLuminosityPerBCIDVector(std::move(bunchpattern));
133 luminosityCondData.addDependency(luminosityFolder);
135 unsigned int preferredChannel;
136 unsigned int calibChannel;
142 bunchInstLumiBlob) );
154 return StatusCode::SUCCESS;
◆ extraDeps_update_handler()
Add StoreName to extra input/output deps as needed.
use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given
◆ extraOutputDeps()
const DataObjIDColl & AthReentrantAlgorithm::extraOutputDeps |
( |
| ) |
const |
|
overridevirtualinherited |
Return the list of extra output dependencies.
This list is extended to include symlinks implied by inheritance relations.
Definition at line 79 of file AthReentrantAlgorithm.cxx.
86 return Algorithm::extraOutputDeps();
◆ filterPassed()
virtual bool AthReentrantAlgorithm::filterPassed |
( |
const EventContext & |
ctx | ) |
const |
|
inlinevirtualinherited |
◆ initialize()
StatusCode LuminosityCondAlg::initialize |
( |
| ) |
|
|
overridevirtual |
◆ inputHandles()
Return this algorithm's input handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ isClonable()
bool AthReentrantAlgorithm::isClonable |
( |
| ) |
const |
|
overridevirtualinherited |
Specify if the algorithm is clonable.
Reentrant algorithms are clonable.
Reimplemented in Simulation::BeamEffectsAlg, InDet::SiTrackerSpacePointFinder, InDet::SCT_Clusterization, InDet::SiSPSeededTrackFinder, SCTRawDataProvider, InDet::GNNSeedingTrackMaker, SCT_PrepDataToxAOD, RoIBResultToxAOD, SCT_CablingCondAlgFromCoraCool, SCT_ReadCalibDataTestAlg, SCT_CablingCondAlgFromText, InDet::SiSPGNNTrackMaker, SCT_ReadCalibChipDataTestAlg, SCT_TestCablingAlg, SCT_ConfigurationConditionsTestAlg, ITkPixelCablingAlg, ITkStripCablingAlg, SCTEventFlagWriter, SCT_ConditionsSummaryTestAlg, SCT_ModuleVetoTestAlg, SCT_MonitorConditionsTestAlg, SCT_LinkMaskingTestAlg, SCT_MajorityConditionsTestAlg, SCT_RODVetoTestAlg, SCT_SensorsTestAlg, SCT_TdaqEnabledTestAlg, SCT_SiliconConditionsTestAlg, SCTSiLorentzAngleTestAlg, SCT_ByteStreamErrorsTestAlg, SCT_ConditionsParameterTestAlg, SCT_FlaggedConditionTestAlg, SCT_StripVetoTestAlg, SCT_RawDataToxAOD, and SCTSiPropertiesTestAlg.
Definition at line 44 of file AthReentrantAlgorithm.cxx.
◆ isReEntrant()
virtual bool LuminosityCondAlg::isReEntrant |
( |
| ) |
const |
|
inlinefinaloverridevirtual |
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ outputHandles()
Return this algorithm's output handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ renounce()
◆ renounceArray()
◆ setFilterPassed()
virtual void AthReentrantAlgorithm::setFilterPassed |
( |
bool |
state, |
|
|
const EventContext & |
ctx |
|
) |
| const |
|
inlinevirtualinherited |
◆ sysExecute()
StatusCode AthReentrantAlgorithm::sysExecute |
( |
const EventContext & |
ctx | ) |
|
|
overridevirtualinherited |
Execute an algorithm.
We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.
Definition at line 67 of file AthReentrantAlgorithm.cxx.
69 return Gaudi::Algorithm::sysExecute (ctx);
◆ sysInitialize()
StatusCode AthReentrantAlgorithm::sysInitialize |
( |
| ) |
|
|
overridevirtualinherited |
Override sysInitialize.
Override sysInitialize from the base class.
Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc
Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc
Reimplemented from AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >.
Reimplemented in InputMakerBase, and HypoBase.
Definition at line 96 of file AthReentrantAlgorithm.cxx.
107 if ( cs.retrieve().isFailure() ) {
109 return StatusCode::SUCCESS;
111 if (cs->regHandle(
this,*
h).isFailure()) {
112 sc = StatusCode::FAILURE;
113 ATH_MSG_ERROR(
"unable to register WriteCondHandle " <<
h->fullKey()
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateAvgLumi()
Unpack luminosity data from the attribute list.
- Parameters
-
lumiData | Input luminosity data. |
lumi | Output luminosity data being filled. |
preferredChannel[out] | Preferred luminosity channel to use. |
calibChannel[out] | Calibration luminosity channel to use. |
bunchInstLumiBlob[out] | Packed per-bunch luminosity data. Set to null for Run 1. |
Unpacks luminosity data from the attribute list. Fills in the average luminosity fields in lumi
, and determines the luminosity channels to use. For Run 2 and later, returns the packed luminosity data.
Definition at line 173 of file LuminosityCondAlg.cxx.
180 preferredChannel = 0;
182 bunchInstLumiBlob =
nullptr;
185 if (attrList.size() == 0 || attrList[
"Valid"].isNull()) {
187 return StatusCode::SUCCESS;
191 std::ostringstream attrStr1;
192 attrList.toOutputStream( attrStr1 );
198 if (attrList[
"LBAvInstLumi"].isNull() || attrList[
"LBAvEvtsPerBX"].isNull()) {
199 ATH_MSG_ERROR(
" NULL Luminosity information in database " );
200 return StatusCode::FAILURE;
209 ATH_MSG_INFO(
" Invalid LB Average luminosity ... set lumi to 0" );
211 return StatusCode::SUCCESS;
213 ATH_MSG_DEBUG(
" Invalid LB Average luminosity ... continuing because skipInvalid == FALSE" );
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;
230 if (hasAlgorithmID) {
233 calibChannel = attrList[
"AlgorithmID"].data<cool::UInt32>();
237 preferredChannel = (
valid >> 22);
238 calibChannel = preferredChannel;
246 float LBAvInstLumi = attrList[
"LBAvInstLumi"].data<cool::Float>();
247 float LBAvEvtsPerBX = attrList[
"LBAvEvtsPerBX"].data<cool::Float>();
250 if ( std::isnan (LBAvInstLumi) ) {
251 ATH_MSG_WARNING(
" Luminosity is not a number.. " << LBAvInstLumi <<
" ... set it to 0 " );
255 if ( std::isnan (LBAvEvtsPerBX) ) {
256 ATH_MSG_WARNING(
" Luminosity is not a number.. " << LBAvEvtsPerBX <<
" ... set it to 0 " );
260 lumi.setLbAverageLuminosity (LBAvInstLumi);
261 lumi.setLbAverageInteractionsPerCrossing (LBAvEvtsPerBX);
264 int perBcidValid = ((
valid&0x3ff)/10) % 10;
266 return StatusCode::SUCCESS;
270 for (coral::AttributeList::const_iterator attr = attrList.begin();
271 attr != attrList.end(); ++attr)
273 if (attr->specification().name() ==
"BunchInstLumi") {
274 if (!attrList[
"BunchInstLumi"].isNull())
275 bunchInstLumiBlob = &attrList[
"BunchInstLumi"].data<coral::Blob>();
280 return StatusCode::SUCCESS;
◆ updateMuToLumi()
Fill in mu-to-lumi calibration.
- Parameters
-
ctx | Event context. |
calibChannel | Calibration luminosity channel to use. |
wHdl | WriteCondHandle of the conditions data being filled. Range is updated if needed. |
lumi | Output luminosity data being filled. |
isValid | Set to false if data are not valid. |
ctx | Event context. |
calibChannel | Calibration luminosity channel to use. |
wHdl | WriteHandle of the conditions data being filled. Range is updated if needed. |
lumi | Output luminosity data being filled. |
isValid | Set to false if data are not valid. |
Definition at line 347 of file LuminosityCondAlg.cxx.
359 float muToLumi = onlineLumiCalibration->getMuToLumi (calibChannel);
363 ATH_MSG_WARNING(
" Found muToLumi = " << muToLumi <<
" for channel " << calibChannel <<
". Try backup channel..." );
368 lumi.setMuToLumi (muToLumi);
372 int perBcidValid = ((
lumi.lbAverageValid()&0x3ff)/10) % 10;
373 if ((
lumi.lbAverageValid() & 0x03) || (perBcidValid > 0)) {
377 <<
lumi.lbAverageValid() <<
"!" );
378 return StatusCode::SUCCESS;
381 <<
lumi.lbAverageValid()
382 <<
" continuing because skipInvalid == FALSE" );
396 lumi.setMuToLumi (muToLumi);
399 ATH_MSG_DEBUG(
" Found muToLumi = " << muToLumi <<
" for channel "
402 return StatusCode::SUCCESS;
◆ updatePerBunchLumi()
Fill in per-bunch luminosity data.
- Parameters
-
ctx | Event context. |
bunchInstLumiBlob | Packed per-bunch luminosity data. Null for Run 1. |
preferredChannel | Preferred luminosity channel to use. |
calibChannel | Calibration luminosity channel to use. |
wHdl | WriteCondHandle conditions data being filled. Range is updated if needed. |
lumi | Output luminosity data being filled. |
ctx | Event context. |
bunchInstLumiBlob | Packed per-bunch luminosity data. Null for Run 1. |
preferredChannel | Preferred luminosity channel to use. |
calibChannel | Calibration luminosity channel to use. |
wHdl | WriteHandle of the conditions data being filled. Range is updated if needed. |
lumi | Output luminosity data being filled. |
Definition at line 296 of file LuminosityCondAlg.cxx.
303 if (
lumi.lbAverageLuminosity() <= 0.) {
305 ATH_MSG_INFO(
"LBAvInstLumi is zero or negative in updatePerBunchLumi():"
306 <<
lumi.lbAverageLuminosity());
309 return StatusCode::SUCCESS;
319 else if (bunchInstLumiBlob !=
nullptr) {
332 << preferredChannel );
333 return StatusCode::SUCCESS;
◆ updatePerBunchLumiRun1()
Fill in per-bunch luminosity data, run 1.
- Parameters
-
preferredChannel | Preferred luminosity channel to use. |
wHdl | WriteHandle of the conditions data being filled. Range is updated if needed. |
lumi | Output luminosity data being filled. |
preferredChannel | Preferred luminosity channel to use. |
wHdl | WriteHandle of the conditions data being filled. |
lumi | Output luminosity data being filled. |
Definition at line 480 of file LuminosityCondAlg.cxx.
485 ATH_MSG_DEBUG(
"starting updatePerBunchLumiRun1() for alg: " << preferredChannel );
487 if (preferredChannel == 0) {
488 return StatusCode::SUCCESS;
493 ATH_MSG_DEBUG(
"OnlineLumiCalibrationInputKey.empty() is TRUE, skipping..." );
494 return StatusCode::SUCCESS;
497 ATH_MSG_DEBUG(
"BunchLumisInputKey.empty() is TRUE, skipping..." );
498 return StatusCode::SUCCESS;
501 ATH_MSG_DEBUG(
"BunchGroupTool.empty() is TRUE, skipping..." );
502 return StatusCode::SUCCESS;
505 ATH_MSG_DEBUG(
"FillParamsInputKey.empty() is TRUE, skipping..." );
506 return StatusCode::SUCCESS;
519 const std::vector<unsigned int>&
luminousBunches = fillParams->luminousBunches();
523 const std::vector<float>& rawLumiVec = bunchLumis->rawLuminosity(preferredChannel);
524 if (rawLumiVec.empty()) {
526 return StatusCode::SUCCESS;
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;
545 lumi.setMuToLumi (muToLumi);
550 if (rawLumiVec.at(
bcid) <= 0.) {
552 << rawLumiVec.at(
bcid) <<
" -> skipping" );
557 if (!onlineLumiCalibration->calibrateLumi(preferredChannel,
561 ATH_MSG_DEBUG(
"Calibrate BCID " <<
bcid <<
" with raw " << rawLumiVec[
bcid] <<
" -> calibration failed!" );
566 lumiSum += calLumiVec[
bcid];
572 float offlineOnlineRatio = 1.;
573 if (lumiSum > 0.) offlineOnlineRatio =
lumi.lbAverageLuminosity() / lumiSum;
576 <<
" / " << lumiSum <<
" = " << offlineOnlineRatio );
579 for (
unsigned int bcid : bunchGroup->bunchGroup (1)) {
581 if (calLumiVec[
bcid] > 0.)
continue;
582 if (rawLumiVec[
bcid] <= 0.)
continue;
585 if (!onlineLumiCalibration->calibrateLumi(preferredChannel,
591 <<
" with raw lumi = " << rawLumiVec[
bcid] );
597 for (
float&
lumi : calLumiVec) {
598 lumi *= offlineOnlineRatio;
601 lumi.setLbLuminosityPerBCIDVector (std::move (calLumiVec));
603 return StatusCode::SUCCESS;
◆ updatePerBunchLumiRun2()
StatusCode LuminosityCondAlg::updatePerBunchLumiRun2 |
( |
const coral::Blob & |
bunchInstLumiBlob, |
|
|
unsigned int |
preferredChannel, |
|
|
LuminosityCondData & |
lumi |
|
) |
| const |
|
private |
Fill in per-bunch luminosity data, run 2 and later.
- Parameters
-
bunchInstLumiBlob | Packed per-bunch luminosity data. |
preferredChannel | Preferred luminosity channel to use. |
lumi | Output luminosity data being filled. |
Definition at line 413 of file LuminosityCondAlg.cxx.
417 ATH_MSG_DEBUG(
"starting updatePerBunchLumiRun2() for alg: " << preferredChannel );
420 if (bunchInstLumiBlob.size() == 0) {
422 return StatusCode::FAILURE;
427 static_cast<const uint8_t*
>(bunchInstLumiBlob.startingAddress());
428 unsigned int bss = ((*pchar) % 100) / 10;
429 unsigned int smod = ((*pchar) % 10);
432 ATH_MSG_DEBUG(
"BunchInstLumi blob found with storage mode " << smod
433 <<
" and byte storage size " << bss );
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;
442 unsigned int bloblength = bss * nbcids + 1;
444 if (
static_cast<cool::UInt32
>(bunchInstLumiBlob.size()) != bloblength) {
446 << bunchInstLumiBlob.size() <<
"in storage mode" << smod
447 <<
", expecting " << bloblength <<
"!" );
448 return StatusCode::FAILURE;
455 std::vector<float> instLumi (nbcids);
456 for (
unsigned int i=0;
i<nbcids;
i++) {
462 for (
unsigned int i=0;
i<nbcids;
i++) {
467 lumi.setLbLuminosityPerBCIDVector (std::move (instLumi));
469 return StatusCode::SUCCESS;
◆ updateVHKA()
◆ m_actualMuKey
Initial value:{ this, "actualMuKey", "EventInfo.actualInteractionsPerCrossing",
"Decoration for Actual Interaction Per Crossing, for MC" }
Definition at line 184 of file LuminosityCondAlg.h.
◆ m_averageMuKey
Initial value:{ this, "averageMuKey", "EventInfo.averageInteractionsPerCrossing",
"Decoration for Average Interaction Per Crossing" }
Definition at line 188 of file LuminosityCondAlg.h.
◆ m_bunchGroupInputKey
Initial value:{ this, "BunchGroupInputKey", "",
"Input filled bunch data. Only used for Run 1." }
Definition at line 168 of file LuminosityCondAlg.h.
◆ m_bunchLumisInputKey
Initial value:{ this, "BunchLumisInputKey", "",
"Input raw luminosities. Only used for Run 1." }
Definition at line 164 of file LuminosityCondAlg.h.
◆ m_calibBackupChannel
Gaudi::Property<unsigned long> LuminosityCondAlg::m_calibBackupChannel { this, "CalibBackupChannel", 112, "Backup channel in case calibChannel doesn't exist in online calibration folder" } |
|
private |
◆ m_detStore
◆ m_eventInfoKey
◆ m_evtStore
◆ m_expectInvalid
Gaudi::Property<bool> LuminosityCondAlg::m_expectInvalid { this, "ExpectInvalid", false, "Flag to control printouts when invalid data are encountered: True suppresses messages, False (default) leaves them in" } |
|
private |
◆ m_extendedExtraObjects
DataObjIDColl AthReentrantAlgorithm::m_extendedExtraObjects |
|
privateinherited |
Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
Empty if no symlinks were found.
Definition at line 153 of file AthReentrantAlgorithm.h.
◆ m_fillParamsInputKey
Initial value:{ this, "FillParamsInputKey", "",
"Input luminous bunch data. Only used for Run 1." }
Definition at line 172 of file LuminosityCondAlg.h.
◆ m_isMC
Gaudi::Property<bool> LuminosityCondAlg::m_isMC { this, "IsMC", false, "Set to true when running on MC instead of data" } |
|
private |
◆ m_lumiChannel
Gaudi::Property<unsigned long> LuminosityCondAlg::m_lumiChannel { this, "LumiChannelNumber", 0, "Luminosity channel to read. 0 means to determine from the data." } |
|
private |
◆ m_luminosityFolderInputKey
Initial value:{ this, "LuminosityFolderInputKey", "/TRIGGER/OFLLUMI/LBLESTOFL",
"Input luminosity COOL folder." }
Definition at line 156 of file LuminosityCondAlg.h.
◆ m_luminosityOutputKey
Initial value:{ this, "LuminosityOutputKey", "LuminosityCondData",
"Output luminosity data." }
Output conditions object.
Definition at line 193 of file LuminosityCondAlg.h.
◆ m_mcDigitizationInputKey
Initial value:{ this, "DigitizationFolderInputKey", "/Digitization/Parameters",
"Digitization parameters metadata folder." }
Definition at line 177 of file LuminosityCondAlg.h.
◆ m_muToLumi
Gaudi::Property<float> LuminosityCondAlg::m_muToLumi { this, "MCMuToLumi", 0.140569, "mu to lumi conversion factor in MC (80 mb/LHC rev freq)" } |
|
private |
◆ m_onlineLumiCalibrationInputKey
Initial value:{ this, "OnlineLumiCalibrationInputKey", "OnlineLumiCalibrationCondData",
"Input luminosity calibration." }
Definition at line 160 of file LuminosityCondAlg.h.
◆ m_skipInvalid
Gaudi::Property<bool> LuminosityCondAlg::m_skipInvalid { this, "SkipInvalid", true, "Flag to control whether invalid data is skipped: True (default), returning a zero luminosity; false, returning available luminosity values anyway." } |
|
private |
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
StatusCode updateMuToLumi(const EventContext &ctx, unsigned int calibChannel, SG::WriteCondHandle< LuminosityCondData > &wHdl, LuminosityCondData &lumi, bool &isValid) const
Fill in mu-to-lumi calibration.
SG::WriteCondHandleKey< LuminosityCondData > m_luminosityOutputKey
Output conditions object.
SG::ReadCondHandleKey< CondAttrListCollection > m_luminosityFolderInputKey
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::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
std::vector< std::string > tokenize(const std::string &the_str, std::string_view delimiters)
Splits the string into smaller substrings.
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
SG::ReadCondHandleKey< OnlineLumiCalibrationCondData > m_onlineLumiCalibrationInputKey
bool msgLvl(const MSG::Level lvl) const
SG::ReadCondHandleKey< FillParamsCondData > m_fillParamsInputKey
static constexpr unsigned int TOTAL_LHC_BCIDS
bool empty() const
Test if the key is blank.
@ u
Enums for curvilinear frames.
virtual void setOwner(IDataHandleHolder *o)=0
Gaudi::Property< unsigned long > m_calibBackupChannel
float get_unaligned_float(const uint8_t *ATH_RESTRICT &p)
Read little-endian float value from a possibly unaligned pointer.
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
SG::ReadCondHandleKey< BunchGroupCondData > m_bunchGroupInputKey
Gaudi::Property< bool > m_expectInvalid
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
::StatusCode StatusCode
StatusCode definition for legacy code.
Gaudi::Property< float > m_muToLumi
static EventIDRange infiniteRunLB()
Produces an EventIDRange that is infinite in RunLumi and invalid in Time.
SG::ReadDecorHandleKey< xAOD::EventInfo > m_actualMuKey
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
const AttributeList & attributeList(ChanNum chanNum) const
attribute list for a given channel number
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
DataObjIDColl m_extendedExtraObjects
Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
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.
virtual StatusCode sysInitialize() override
Override sysInitialize.
StatusCode updatePerBunchLumiRun1(const EventContext &ctx, unsigned int preferredChannel, SG::WriteCondHandle< LuminosityCondData > &wHdl, LuminosityCondData &lumi) const
Fill in per-bunch luminosity data, run 1.
StatusCode initialize(bool used=true)
setEventNumber setTimeStamp bcid
Gaudi::Property< bool > m_isMC
StatusCode updatePerBunchLumiRun2(const coral::Blob &bunchInstLumiBlob, unsigned int preferredChannel, LuminosityCondData &lumi) const
Fill in per-bunch luminosity data, run 2 and later.
SG::ReadCondHandleKey< BunchLumisCondData > m_bunchLumisInputKey
#define ATH_MSG_WARNING(x)
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Gaudi::Property< bool > m_skipInvalid
SG::ReadCondHandleKey< AthenaAttributeList > m_mcDigitizationInputKey
const T * get(const ReadHandleKey< T > &key)
Convenience function to retrieve an object given a ReadHandleKey.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Gaudi::Property< unsigned long > m_lumiChannel
SG::ReadDecorHandleKey< xAOD::EventInfo > m_averageMuKey
void addDependency(const EventIDRange &range)