ATLAS Offline Software
LuminosityCondAlg.h
Go to the documentation of this file.
1 // This file's extension implies that it's C, but it's really -*- C++ -*-.
2 /*
3  * Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration.
4  */
13 #ifndef LUMIBLOCKCOMPS_LUMINOSITYCONDALG_H
14 #define LUMIBLOCKCOMPS_LUMINOSITYCONDALG_H
15 
16 
26 #include "CoralBase/Blob.h"
28 
29 
34  : public AthReentrantAlgorithm
35 {
36 public:
39 
40 
42  virtual StatusCode initialize() override;
43 
44 
46  virtual StatusCode execute (const EventContext& ctx) const override;
47  virtual bool isReEntrant() const override final { return false; }
48 
49 
50 private:
66  updateAvgLumi (const CondAttrListCollection& lumiData,
68  unsigned int& preferredChannel,
69  unsigned int& calibChannel,
70  const coral::Blob*& bunchInstLumiBlob) const;
71 
72 
85  updatePerBunchLumi (const EventContext& ctx,
86  const coral::Blob* bunchInstLumiBlob,
87  unsigned int preferredChannel,
88  unsigned int calibChannel,
90  LuminosityCondData& lumi) const;
91 
92 
102  StatusCode
103  updateMuToLumi (const EventContext& ctx,
104  unsigned int calibChannel,
107  bool& isValid) const;
108 
109 
116  StatusCode
117  updatePerBunchLumiRun2 (const coral::Blob& bunchInstLumiBlob,
118  unsigned int preferredChannel,
119  LuminosityCondData& lumi) const;
120 
121 
129  StatusCode
130  updatePerBunchLumiRun1 (const EventContext& ctx,
131  unsigned int preferredChannel,
133  LuminosityCondData& lumi) const;
134 
135 
136  Gaudi::Property<unsigned long> m_lumiChannel
137  { this, "LumiChannelNumber", 0, "Luminosity channel to read. 0 means to determine from the data." };
138 
139  Gaudi::Property<unsigned long> m_calibBackupChannel
140  { this, "CalibBackupChannel", 112, "Backup channel in case calibChannel doesn't exist in online calibration folder" };
141 
142  Gaudi::Property<bool> m_skipInvalid
143  { this, "SkipInvalid", true, "Flag to control whether invalid data is skipped: True (default), returning a zero luminosity; false, returning available luminosity values anyway." };
144 
145  Gaudi::Property<bool> m_expectInvalid
146  { this, "ExpectInvalid", false, "Flag to control printouts when invalid data are encountered: True suppresses messages, False (default) leaves them in" };
147 
148  // following properties are for MC
149  Gaudi::Property<bool> m_isMC
150  { this, "IsMC", false, "Set to true when running on MC instead of data" };
151 
152  Gaudi::Property<float> m_muToLumi
153  { this, "MCMuToLumi", 0.140569, "mu to lumi conversion factor in MC (80 mb/LHC rev freq)" };
154 
155 
157  { this, "LuminosityFolderInputKey", "/TRIGGER/OFLLUMI/LBLESTOFL",
158  "Input luminosity COOL folder." };
159 
161  { this, "OnlineLumiCalibrationInputKey", "OnlineLumiCalibrationCondData",
162  "Input luminosity calibration." };
163 
165  { this, "BunchLumisInputKey", "",
166  "Input raw luminosities. Only used for Run 1." };
167 
169  { this, "BunchGroupInputKey", "",
170  "Input filled bunch data. Only used for Run 1." };
171 
173  { this, "FillParamsInputKey", "",
174  "Input luminous bunch data. Only used for Run 1." };
175 
176  // the following are for MC
178  { this, "DigitizationFolderInputKey", "/Digitization/Parameters",
179  "Digitization parameters metadata folder." };
180 
182  { this, "EventInfoKey", "EventInfo", "EventInfo key, used to read in simulated mu in MC" };
183 
185  { this, "actualMuKey", "EventInfo.actualInteractionsPerCrossing",
186  "Decoration for Actual Interaction Per Crossing, for MC" };
187 
189  { this, "averageMuKey", "EventInfo.averageInteractionsPerCrossing",
190  "Decoration for Average Interaction Per Crossing" };
191 
194  { this, "LuminosityOutputKey", "LuminosityCondData",
195  "Output luminosity data." };
196 };
197 
198 
199 #endif // not LUMIBLOCKCOMPS_LUMINOSITYCONDALG_H
CondAttrListCollection.h
This file defines the class for a collection of AttributeLists where each one is associated with a ch...
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
LuminosityCondAlg::m_luminosityOutputKey
SG::WriteCondHandleKey< LuminosityCondData > m_luminosityOutputKey
Output conditions object.
Definition: LuminosityCondAlg.h:194
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
LuminosityCondAlg
Conditions algorithm for luminosity data.
Definition: LuminosityCondAlg.h:35
WriteCondHandleKey.h
LuminosityCondAlg::m_onlineLumiCalibrationInputKey
SG::ReadCondHandleKey< OnlineLumiCalibrationCondData > m_onlineLumiCalibrationInputKey
Definition: LuminosityCondAlg.h:161
python.subdetectors.tile.Blob
Blob
Definition: tile.py:17
LuminosityCondAlg::m_fillParamsInputKey
SG::ReadCondHandleKey< FillParamsCondData > m_fillParamsInputKey
Definition: LuminosityCondAlg.h:173
isValid
bool isValid(const T &p)
Av: we implement here an ATLAS-sepcific convention: all particles which are 99xxxxx are fine.
Definition: AtlasPID.h:620
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
SG::ReadHandleKey< xAOD::EventInfo >
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
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
LuminosityCondAlg::m_calibBackupChannel
Gaudi::Property< unsigned long > m_calibBackupChannel
Definition: LuminosityCondAlg.h:140
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
AthReentrantAlgorithm::AthReentrantAlgorithm
AthReentrantAlgorithm()
Default constructor:
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
LuminosityCondAlg::m_muToLumi
Gaudi::Property< float > m_muToLumi
Definition: LuminosityCondAlg.h:153
FillParamsCondData.h
Holds fill parameters data.
LuminosityCondAlg::m_actualMuKey
SG::ReadDecorHandleKey< xAOD::EventInfo > m_actualMuKey
Definition: LuminosityCondAlg.h:185
OnlineLumiCalibrationCondData.h
Luminosity calibration data, produced by OnlineLumiCalibrationCondAlg.
BunchGroupCondData.h
Holds data on filled bunches.
LuminosityCondData.h
Hold luminosity data produced by LuminosityCondAlg.
LuminosityCondAlg::isReEntrant
virtual bool isReEntrant() const override final
Definition: LuminosityCondAlg.h:47
ReadCondHandleKey.h
AthReentrantAlgorithm.h
LuminosityCondData
Definition: LuminosityCondData.h:23
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
LuminosityCondAlg::m_isMC
Gaudi::Property< bool > m_isMC
Definition: LuminosityCondAlg.h:150
EventInfo.h
SG::ReadCondHandleKey< CondAttrListCollection >
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:106
LuminosityCondAlg::m_bunchLumisInputKey
SG::ReadCondHandleKey< BunchLumisCondData > m_bunchLumisInputKey
Definition: LuminosityCondAlg.h:165
BunchLumisCondData.h
Holds raw luminosity data, per channel.
SG::WriteCondHandleKey< LuminosityCondData >
LuminosityCondAlg::m_skipInvalid
Gaudi::Property< bool > m_skipInvalid
Definition: LuminosityCondAlg.h:143
SG::ReadDecorHandleKey
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
Definition: StoreGate/StoreGate/ReadDecorHandleKey.h:85
LuminosityCondAlg::m_mcDigitizationInputKey
SG::ReadCondHandleKey< AthenaAttributeList > m_mcDigitizationInputKey
Definition: LuminosityCondAlg.h:178
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