ATLAS Offline Software
Loading...
Searching...
No Matches
egammaAODFixes Class Reference

Algorithm to handle various AOD fixes : More...

#include <egammaAODFixes.h>

Inheritance diagram for egammaAODFixes:

Public Member Functions

 egammaAODFixes (const std::string &name, ISvcLocator *pSvcLocator)
StatusCode initialize () override final
StatusCode execute (const EventContext &ctx) const override final
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual bool isClonable () const override
 Specify if the algorithm is clonable.
virtual unsigned int cardinality () const override
 Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
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.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
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)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

void getLayerE (std::vector< const CaloCell * > &cells, std::vector< float > &lE) const
StatusCode getCorrection (const xAOD::Egamma *eg, float &aET, std::vector< float > &lECl) const
StatusCode getCorrectionC (const xAOD::Egamma *eg, float &aET, IegammaCellRecoveryTool::Info &info) const
void rebuildLink (xAOD::EgammaContainer *egC, xAOD::CaloClusterContainer *egclC, const EventContext &ctx) const
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

SG::WriteHandleKey< xAOD::ElectronContainerm_electronOutputKey
 Name of the electron output collection.
SG::ReadHandleKey< xAOD::ElectronContainerm_electronInputKey
 Name of the electron input collection.
SG::WriteHandleKey< xAOD::PhotonContainerm_photonOutputKey
 Name of the photon output collection.
SG::ReadHandleKey< xAOD::PhotonContainerm_photonInputKey
 Name of the photon input collection.
SG::ReadHandleKey< CaloCellContainerm_CaloCellsKey
 Name of the calo cell container.
SG::WriteHandleKey< xAOD::CaloClusterContainerm_egClusOutputKey
 Name of the egamma cluster output collection.
SG::ReadHandleKey< xAOD::CaloClusterContainerm_egClusInputKey
 Name of the egamma cluster input collection.
SG::WriteHandleKey< CaloClusterCellLinkContainerm_egClusCellLinkOutputKey
 Key of the output cluster container cell links: name taken from containter name; only dummy configurable.
SG::ReadCondHandleKey< CaloDetDescrManagerm_caloDetDescrMgrKey
 Key for calo detector description manager.
ToolHandle< IegammaCellRecoveryToolm_egammaCellRecoveryTool
 Pointer to the egammaCellRecoveryTool.
Gaudi::Property< bool > m_correctCluster
 correct also layer energies ?
Gaudi::Property< bool > m_ambiguityFix
 correct ambiguity links ?
Gaudi::Property< bool > m_tpetcFix
 correct topoetcone isolation ?
ToolHandle< IegammaSwToolm_clusterCorrectionTool
 Tool to handle cluster corrections.
ServiceHandle< IegammaMVASvcm_MVACalibSvc
 Handle to the MVA calibration service.
ToolHandle< CP::IIsolationCorrectionToolm_IsoLeakCorrectionTool
 Handle to the isolation leakage correction tool.
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Algorithm to handle various AOD fixes :

  • ambiguity relinking for electrons and photons
  • the consequence of the timing cut in egamma

This class is responsible for reading input electron and photon containers, processing them to in order to link ambiguous candidates, and to correct the topoetcone isolation variables and the cluster layer 2 and 3 energies and writing to the output containers. It is used in the context of an AODFix to correct an ambiguityLink association bug in the Athena Rel24 up to 24.0.83, and to mitigate the impact of the timing cut for topocluster building in egamma reconstruction, in Athena Rel24.

  • Input electron container: specified by ElectronInputName.
  • Output electron container: specified by ElectronOutputName.
  • Input photon container: specified by PhotonInputName.
  • Output photon container: specified by PhotonOutputName.

Definition at line 49 of file egammaAODFixes.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ egammaAODFixes()

egammaAODFixes::egammaAODFixes ( const std::string & name,
ISvcLocator * pSvcLocator )

Definition at line 26 of file egammaAODFixes.cxx.

28 : AthReentrantAlgorithm(name, pSvcLocator)
29{}

Member Function Documentation

◆ cardinality()

unsigned int AthCommonReentrantAlgorithm< Gaudi::Algorithm >::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.

Definition at line 75 of file AthCommonReentrantAlgorithm.cxx.

64{
65 return 0;
66}

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

StatusCode egammaAODFixes::execute ( const EventContext & ctx) const
finaloverride

Definition at line 62 of file egammaAODFixes.cxx.

62 {
63
64 static const SG::AuxElement::Accessor<float> acce2("Eadded_Lr2");
65 static const SG::AuxElement::Accessor<float> acce3("Eadded_Lr3");
66 static const SG::AuxElement::Accessor<float> acce2b("Eadded_Lr2b");
67 static const SG::AuxElement::Accessor<float> acce3b("Eadded_Lr3b");
68 static const SG::AuxElement::Accessor<float> acce2e("Eadded_Lr2e");
69 static const SG::AuxElement::Accessor<float> acce3e("Eadded_Lr3e");
70
71 SG::ReadHandle<xAOD::ElectronContainer> el_inputContainer(m_electronInputKey,ctx);
72 SG::WriteHandle<xAOD::ElectronContainer> el_outputContainer(m_electronOutputKey,ctx);
73 SG::ReadHandle<xAOD::PhotonContainer> ph_inputContainer(m_photonInputKey,ctx);
74 SG::WriteHandle<xAOD::PhotonContainer> ph_outputContainer(m_photonOutputKey,ctx);
75
76 ATH_CHECK(el_outputContainer.record(std::make_unique<xAOD::ElectronContainer>(),
77 std::make_unique<xAOD::ElectronAuxContainer>()));
78
79 ATH_CHECK(ph_outputContainer.record(std::make_unique<xAOD::PhotonContainer>(),
80 std::make_unique<xAOD::PhotonAuxContainer>()));
81
82 xAOD::ElectronContainer* electrons = el_outputContainer.ptr();
83 xAOD::PhotonContainer* photons = ph_outputContainer.ptr();
84 electrons->reserve(el_inputContainer->size());
85 photons->reserve(ph_inputContainer->size());
86
87 ATH_MSG_VERBOSE("Running on " << el_inputContainer->size() << " electrons"
88 " and " << ph_inputContainer->size() << " photons");
89
90 std::map<size_t,std::pair<const xAOD::Egamma*,IegammaCellRecoveryTool::Info>>
91 icegRecoveryInfo;
92
93 // Whatever the fix : copy old container content into a new one
94 for (const xAOD::Electron* old_el : *el_inputContainer) {
95 xAOD::Electron* electron = electrons->push_back(std::make_unique<xAOD::Electron>());
96 *electron=*old_el;
97
98 if (m_tpetcFix) {
99 float aET = 0;
100 IegammaCellRecoveryTool::Info info{};
101 if (getCorrectionC(old_el,aET,info).isFailure()) {
102 ATH_MSG_WARNING("Failed to recover energies for electron "
103 << old_el->index() << " pT = " << old_el->pt());
104 }
107 float oiso = 9e9;
108 if (!old_el->isolation(oiso,t)) {
109 ATH_MSG_WARNING("Electron " << old_el->index() << " has no "
110 << xAOD::Iso::toCString(t) << " isolation");
111 }
112 electron->setIsolation(oiso+aET, t);
113 }
114 std::vector<float> layerEnergies(4);
115 getLayerE(info.addedCells,layerEnergies);
116 // Legacy info
117 acce2(*electron) = layerEnergies[0]+layerEnergies[2];
118 acce3(*electron) = layerEnergies[1]+layerEnergies[3];
119 // more granular for debug
120 acce2b(*electron) = layerEnergies[0];
121 acce3b(*electron) = layerEnergies[1];
122 acce2e(*electron) = layerEnergies[2];
123 acce3e(*electron) = layerEnergies[3];
124
125 if (m_correctCluster) {
126 icegRecoveryInfo[old_el->caloCluster()->index()] =
127 std::make_pair(old_el,info);
128 }
129 }
130 }
131
132 for (const xAOD::Photon* old_ph : *ph_inputContainer) {
133 xAOD::Photon* photon = photons->push_back(std::make_unique<xAOD::Photon>());
134 *photon=*old_ph;
135
136 if (m_tpetcFix) {
137 float aET = 0;
138 IegammaCellRecoveryTool::Info info{};
139 if (getCorrectionC(old_ph,aET,info).isFailure()) {
140 ATH_MSG_WARNING("Failed to recover energies for photon "
141 << old_ph->index() << " pT = " << old_ph->pt());
142 }
145 float oiso = 9e9;
146 if (!old_ph->isolation(oiso,t)) {
147 ATH_MSG_WARNING("Photon " << old_ph->index() << " has no "
148 << xAOD::Iso::toCString(t) << " isolation");
149 }
150 photon->setIsolation(oiso+aET, t);
151 }
152 std::vector<float> layerEnergies(4);
153 getLayerE(info.addedCells,layerEnergies);
154 // legacy info
155 acce2(*photon) = layerEnergies[0]+layerEnergies[2];
156 acce3(*photon) = layerEnergies[1]+layerEnergies[3];
157 // more granular for debug
158 acce2b(*photon) = layerEnergies[0];
159 acce3b(*photon) = layerEnergies[1];
160 acce2e(*photon) = layerEnergies[2];
161 acce3e(*photon) = layerEnergies[3];
162
163 if (m_correctCluster) {
164 icegRecoveryInfo[old_ph->caloCluster()->index()] =
165 std::make_pair(old_ph,info);
166 }
167 }
168 }
169
170 // Ambiguity link fix
171 if (m_ambiguityFix) {
172 egAmbLinkHelper::doAmbiguityLinks(ctx, electrons, photons);
173 egAmbLinkHelper::doAmbiguityLinks(ctx, photons, electrons);
174 }
175
176 // Correct also layer energies (L2 and L3) and in addition the corresponding
177 // cluster energy (raw, alt, cal)
178 if (m_correctCluster) {
179
180 // The calo Det Descr manager
181 SG::ReadCondHandle<CaloDetDescrManager> caloDetDescrMgrHandle{
183 };
184 ATH_CHECK(caloDetDescrMgrHandle.isValid());
185 const CaloDetDescrManager* mgr = *caloDetDescrMgrHandle;
186
187 static const std::vector<xAOD::CaloCluster::CaloSample> caloSam{
188 CaloSampling::EMB2, CaloSampling::EMB3,
189 CaloSampling::EME2, CaloSampling::EME3 };
190
191 SG::ReadHandle<xAOD::CaloClusterContainer> egcl_inputContainer(m_egClusInputKey,ctx);
192
193 SG::WriteHandle<CaloClusterCellLinkContainer> egcl_CellLinkContainer(
195 ATH_CHECK(egcl_CellLinkContainer.record(
196 std::make_unique<CaloClusterCellLinkContainer>()));
197
198 SG::WriteHandle<xAOD::CaloClusterContainer> egcl_outputContainer(m_egClusOutputKey,ctx);
199 ATH_CHECK(egcl_outputContainer.record(std::make_unique<xAOD::CaloClusterContainer>(),
200 std::make_unique<xAOD::CaloClusterAuxContainer>()));
201
202 xAOD::CaloClusterContainer* egClusters = egcl_outputContainer.ptr();
203 egClusters->reserve(egcl_inputContainer->size());
204
205 for (const xAOD::CaloCluster* old_egcl : *egcl_inputContainer) {
206 xAOD::CaloCluster* cluster =
207 egClusters->push_back(std::make_unique<xAOD::CaloCluster>());
208 *cluster=*old_egcl;
209
210 ATH_MSG_VERBOSE("cluster ptrs old " << old_egcl << " new " << cluster
211 << " indices " << old_egcl->index() << " " << cluster->index());
212
213 size_t index = old_egcl->index();
214 std::vector<const CaloCell*> cc;
215 if (icegRecoveryInfo.find(index) != icegRecoveryInfo.end()) {
216 cc = icegRecoveryInfo[index].second.addedCells;
217 } else {
218 ATH_MSG_WARNING("Could not find added calo cells"
219 " for cluster with index " << index);
220 return StatusCode::FAILURE;
221 }
222
223 bool doAddCell_condition1 = cc.size() > 0;
224 const xAOD::Egamma* eg = icegRecoveryInfo[index].first;
225 float addedE2 = icegRecoveryInfo[index].second.eCells[0];
226 bool doAddCell_condition2 = addedE2 > 0 ||
227 addedE2 + old_egcl->energyBE(2) > 0;
228 if (!doAddCell_condition2) {
230 "Cluster should be corrected, but the additional energy in S2 "
231 << addedE2 << " is too negative w.r.t. original one " <<
232 old_egcl->energyBE(2));
233 }
234 if (doAddCell_condition1 && doAddCell_condition2) {
235 ATH_MSG_VERBOSE("Number of cells " << old_egcl->getCellLinks()->size()
236 << " " << cluster->getCellLinks()->size());
237
238 const CaloClusterCellLink* cellLinks = cluster->getOwnCellLinks();
239 CaloClusterCellLink::const_iterator cellItr = cellLinks->begin();
240 CaloClusterCellLink::const_iterator cellEnd = cellLinks->end();
241 for (; cellItr != cellEnd; ++cellItr) {
242 ATH_MSG_VERBOSE("A cell in the new cluster w = " << cellItr.weight()
243 << " e = " << cellItr->e());
244 }
245 const CaloClusterCellLink* ocellLinks = old_egcl->getCellLinks();
246 cellItr = ocellLinks->begin();
247 cellEnd = ocellLinks->end();
248 for (; cellItr != cellEnd; ++cellItr) {
249 ATH_MSG_VERBOSE("A cell in the old cluster w = " << cellItr.weight()
250 << " e = " << cellItr->e());
251 }
252
253 const CaloCellContainer* inputcells =
254 cluster->getCellLinks()->getCellContainer();
255 for (const auto *cell : cc) {
256 int cindex = inputcells->findIndex(cell->caloDDE()->calo_hash());
257 cluster->addCell(cindex,1.);
258 }
259 ATH_MSG_VERBOSE("After adding the cells, number of cells "
260 << cellLinks->size());
261 cellItr = cellLinks->begin();
262 cellEnd = cellLinks->end();
263 for (; cellItr != cellEnd; ++cellItr) {
264 ATH_MSG_VERBOSE("After addding a cell in the new cluster w = "
265 << cellItr.weight()
266 << " e = " << cellItr->e());
267 }
268 CaloClusterKineHelper::calculateKine(cluster, true, true);
269
271 // Save the state before the corrections
272 cluster->setAltE(cluster->e());
273 cluster->setAltEta(cluster->eta());
274 cluster->setAltPhi(cluster->phi());
275
280 } else if (xAOD::EgammaHelpers::isPhoton(eg)) {
282 }
284 ctx, cluster, egType, xAOD::EgammaHelpers::isBarrel(cluster)));
285 cluster->setRawE(cluster->e());
286 cluster->setRawEta(cluster->eta());
287 cluster->setRawPhi(cluster->phi());
288 //
290 //
291 if (m_MVACalibSvc->execute(*cluster,
292 *eg).isFailure()) {
293 ATH_MSG_ERROR("Problem executing MVA cluster tool");
294 }
295 }
296 }
298 ctx,
299 egcl_outputContainer,
300 egcl_CellLinkContainer);
301 rebuildLink(photons, egClusters, ctx);
302 rebuildLink(electrons, egClusters, ctx);
305 }
306
307 return StatusCode::SUCCESS;
308}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
int findIndex(const IdentifierHash theHash) const
Return index of the cell with a given hash.
virtual double e() const override final
get energy (data member) (synonym to method energy()
Definition CaloCell.h:333
static void calculateKine(xAOD::CaloCluster *clu, const bool useweight=true, const bool updateLayers=true, const bool useGPUCriteria=false)
Helper class to calculate cluster kinematics based on cells.
static StatusCode finalizeClusters(SG::WriteHandle< CaloClusterCellLinkContainer > &h, xAOD::CaloClusterContainer *pClusterColl)
Finalize clusters (move CaloClusterCellLink to a separate container).
void reserve(size_type n)
Attempt to preallocate enough memory for a specified number of elements.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
size_t index() const
Return the index of this element within its container.
SG::WriteHandleKey< CaloClusterCellLinkContainer > m_egClusCellLinkOutputKey
Key of the output cluster container cell links: name taken from containter name; only dummy configura...
Gaudi::Property< bool > m_ambiguityFix
correct ambiguity links ?
void getLayerE(std::vector< const CaloCell * > &cells, std::vector< float > &lE) const
StatusCode getCorrectionC(const xAOD::Egamma *eg, float &aET, IegammaCellRecoveryTool::Info &info) const
ServiceHandle< IegammaMVASvc > m_MVACalibSvc
Handle to the MVA calibration service.
SG::WriteHandleKey< xAOD::ElectronContainer > m_electronOutputKey
Name of the electron output collection.
ToolHandle< IegammaSwTool > m_clusterCorrectionTool
Tool to handle cluster corrections.
SG::WriteHandleKey< xAOD::CaloClusterContainer > m_egClusOutputKey
Name of the egamma cluster output collection.
void rebuildLink(xAOD::EgammaContainer *egC, xAOD::CaloClusterContainer *egclC, const EventContext &ctx) const
SG::ReadHandleKey< xAOD::PhotonContainer > m_photonInputKey
Name of the photon input collection.
SG::ReadHandleKey< xAOD::ElectronContainer > m_electronInputKey
Name of the electron input collection.
SG::WriteHandleKey< xAOD::PhotonContainer > m_photonOutputKey
Name of the photon output collection.
SG::ReadHandleKey< xAOD::CaloClusterContainer > m_egClusInputKey
Name of the egamma cluster input collection.
Gaudi::Property< bool > m_correctCluster
correct also layer energies ?
Gaudi::Property< bool > m_tpetcFix
correct topoetcone isolation ?
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloDetDescrMgrKey
Key for calo detector description manager.
void setRawEta(flt_t)
Set for signal state UNCALIBRATED.
void setAltPhi(flt_t)
Set for signal state ALTCALIBRATED.
void setRawPhi(flt_t)
Set for signal state UNCALIBRATED.
const CaloClusterCellLink * getCellLinks() const
Get a pointer to the CaloClusterCellLink object (const version)
void setRawE(flt_t)
Set Energy for signal state UNCALIBRATED.
virtual double eta() const
The pseudorapidity ( ) of the particle.
void setAltEta(flt_t)
Set for signal state ALTCALIBRATED.
virtual double e() const
The total energy of the particle.
virtual double phi() const
The azimuthal angle ( ) of the particle.
CaloClusterCellLink * getOwnCellLinks()
Get a pointer to the owned CaloClusterCellLink object (non-const version)
void setAltE(flt_t)
Set Energy for signal state ALTCALIBRATED.
bool addCell(const unsigned index, const double weight)
Method to add a cell to the cluster (Beware: Kinematics not updated!)
str index
Definition DeMoScan.py:362
void calculate(xAOD::Electron &electron)
void doAmbiguityLinks(const EventContext &ctx, DataVector< SrcT > *srcContainer, DataVector< DestT > *destContainer)
void fillPositionsInCalo(xAOD::CaloCluster *cluster, const CaloDetDescrManager &mgr)
Function to decorate the calo cluster with position variables.
void refineEta1Position(xAOD::CaloCluster *cluster, const CaloDetDescrManager &mgr)
function to refine position in eta1
bool isBarrel(const xAOD::Egamma *eg)
return true if the cluster is in the barrel
bool isConvertedPhoton(const xAOD::Egamma *eg, bool excludeTRT=false)
is the object a converted photon
bool isPhoton(const xAOD::Egamma *eg)
is the object a photon
@ topoetcone20
Topo-cluster ET-sum.
static const char * toCString(IsolationConeSize conesize)
PhotonContainer_v1 PhotonContainer
Definition of the current "photon container version".
ElectronContainer_v1 ElectronContainer
Definition of the current "electron container version".
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
Egamma_v1 Egamma
Definition of the current "egamma version".
Definition Egamma.h:17
Photon_v1 Photon
Definition of the current "egamma version".
CaloClusterContainer_v1 CaloClusterContainer
Define the latest version of the calorimeter cluster container.
Electron_v1 Electron
Definition of the current "egamma version".

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

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 & AthCommonReentrantAlgorithm< Gaudi::Algorithm >::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 94 of file AthCommonReentrantAlgorithm.cxx.

90{
91 // If we didn't find any symlinks to add, just return the collection
92 // from the base class. Otherwise, return the extended collection.
93 if (!m_extendedExtraObjects.empty()) {
95 }
97}
An algorithm that can be simultaneously executed in multiple threads.

◆ filterPassed()

virtual bool AthCommonReentrantAlgorithm< Gaudi::Algorithm >::filterPassed ( const EventContext & ctx) const
inlinevirtualinherited

Definition at line 96 of file AthCommonReentrantAlgorithm.h.

96 {
97 return execState( ctx ).filterPassed();
98 }
virtual bool filterPassed(const EventContext &ctx) const

◆ getCorrection()

StatusCode egammaAODFixes::getCorrection ( const xAOD::Egamma * eg,
float & aET,
std::vector< float > & lECl ) const
private

Definition at line 310 of file egammaAODFixes.cxx.

313 {
314
315 const xAOD::CaloCluster *clus = eg->caloCluster();
316 egammaCellUtils::MaxECell maxECell(clus);
317 if (maxECell.sc == StatusCode::FAILURE) {
318 ATH_MSG_WARNING("Issues in finding maximum energy cell");
319 return maxECell.sc;
320 }
321 IegammaCellRecoveryTool::Info info{};
322 info.etamax = maxECell.etaCell;
323 info.phimax = maxECell.phiCell;
324 if (m_egammaCellRecoveryTool->execute(*clus,info).isFailure()) {
325 ATH_MSG_WARNING("Issue trying to recover cells");
326 }
327 double aE2 = info.eCells[0];
328 double aE3 = info.eCells[1];
329 std::string type = (eg->type() == xAODType::Photon) ? "Photon " :
330 ((eg->type() == xAODType::Electron) ? "Electron " : "Unknown ");
331 ATH_MSG_VERBOSE(type << eg->index()
332 << " added Energies in Layer 2 " << aE2 << " and 3 " << aE3
333 << " cluster index = " << clus->index());
334 double iceta = 1./std::cosh(clus->etaBE(2));
335 aET = (aE2+aE3)*iceta;
336 if (m_correctCluster) {
337 getLayerE(info.addedCells, lE);
338 ATH_MSG_VERBOSE("Per layer "
339 << lE[0] << " " << lE[1] << " "
340 << lE[2] << " " << lE[3]);
341 }
342 return StatusCode::SUCCESS;
343}
ToolHandle< IegammaCellRecoveryTool > m_egammaCellRecoveryTool
Pointer to the egammaCellRecoveryTool.
float etaBE(const unsigned layer) const
Get the eta in one layer of the EM Calo.
virtual Type::ObjectType type() const override=0
The type of the object as a simple enumeration, remains pure virtual in e/gamma.
const xAOD::CaloCluster * caloCluster(size_t index=0) const
Pointer to the xAOD::CaloCluster/s that define the electron candidate.
@ Photon
The object is a photon.
Definition ObjectType.h:47
@ Electron
The object is an electron.
Definition ObjectType.h:46

◆ getCorrectionC()

StatusCode egammaAODFixes::getCorrectionC ( const xAOD::Egamma * eg,
float & aET,
IegammaCellRecoveryTool::Info & info ) const
private

Definition at line 345 of file egammaAODFixes.cxx.

348 {
349
350 const xAOD::CaloCluster *clus = eg->caloCluster();
351 egammaCellUtils::MaxECell maxECell(clus);
352 if (maxECell.sc == StatusCode::FAILURE) {
353 ATH_MSG_WARNING("Issues in finding maximum energy cell");
354 return maxECell.sc;
355 }
356 info.etamax = maxECell.etaCell;
357 info.phimax = maxECell.phiCell;
358 if (m_egammaCellRecoveryTool->execute(*clus,info).isFailure()) {
359 ATH_MSG_WARNING("Issue trying to recover cells");
360 }
361 double aE2 = info.eCells[0];
362 double aE3 = info.eCells[1];
363 std::string type = (eg->type() == xAODType::Photon) ? "Photon " :
364 ((eg->type() == xAODType::Electron) ? "Electron " : "Unknown ");
365 ATH_MSG_VERBOSE(type << eg->index()
366 << " added Energies in Layer 2 " << aE2 << " and 3 " << aE3
367 << " cluster index = " << clus->index());
368 double iceta = 1./std::cosh(clus->etaBE(2));
369 aET = (aE2+aE3)*iceta;
370 return StatusCode::SUCCESS;
371}

◆ getLayerE()

void egammaAODFixes::getLayerE ( std::vector< const CaloCell * > & cells,
std::vector< float > & lE ) const
private

Definition at line 374 of file egammaAODFixes.cxx.

377{
378 if (lE.size() != 4) {
379 ATH_MSG_WARNING("The passed layer energies should have a size 4");
380 lE.resize(4);
381 }
382 for (auto *cell : cells) {
383 int layer = cell->caloDDE()->getSampling();
384 if (layer == CaloSampling::EMB2)
385 lE[0] += cell->e();
386 else if (layer == CaloSampling::EMB3)
387 lE[1] += cell->e();
388 else if (layer == CaloSampling::EME2)
389 lE[2] += cell->e();
390 else if (layer == CaloSampling::EME3)
391 lE[3] += cell->e();
392 }
393}
@ layer
Definition HitInfo.h:79

◆ initialize()

StatusCode egammaAODFixes::initialize ( )
finaloverride

Definition at line 32 of file egammaAODFixes.cxx.

33{
34 // The main tool
35 if (m_tpetcFix) {
37 // The calo cell need to be there
38 ATH_CHECK(m_CaloCellsKey.initialize());
39 if (m_correctCluster) {
40 ATH_CHECK(m_egClusOutputKey.initialize());
41 ATH_CHECK(m_egClusInputKey.initialize());
42 ATH_CHECK(m_caloDetDescrMgrKey.initialize());
44 ATH_CHECK(m_MVACalibSvc.retrieve());
47 m_egClusOutputKey.key() + "_links";
49 }
50 }
51
52 // the data handle keys
53 ATH_CHECK(m_electronOutputKey.initialize());
54 ATH_CHECK(m_electronInputKey.initialize());
55 ATH_CHECK(m_photonOutputKey.initialize());
56 ATH_CHECK(m_photonInputKey.initialize());
57
58 return StatusCode::SUCCESS;
59}
SG::ReadHandleKey< CaloCellContainer > m_CaloCellsKey
Name of the calo cell container.
ToolHandle< CP::IIsolationCorrectionTool > m_IsoLeakCorrectionTool
Handle to the isolation leakage correction tool.

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::inputHandles ( ) const
overridevirtualinherited

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()

◆ msg()

MsgStream & AthCommonMsg< Gaudi::Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< Gaudi::Algorithm >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::outputHandles ( ) const
overridevirtualinherited

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.

◆ rebuildLink()

void egammaAODFixes::rebuildLink ( xAOD::EgammaContainer * egC,
xAOD::CaloClusterContainer * egclC,
const EventContext & ctx ) const
private

Definition at line 395 of file egammaAODFixes.cxx.

398 {
399
400 for (xAOD::Egamma *eg : *egContainer) {
401
402 // link the new eg object (update for isolation)
403 // to the new cluster (update for layer energies)
404 ElementLink<xAOD::CaloClusterContainer> clusterLink(
405 *egclContainer, eg->caloCluster()->index(), ctx);
406 std::vector<ElementLink<xAOD::CaloClusterContainer>> egClustersLink{
407 clusterLink };
408 eg->setCaloClusterLinks(egClustersLink);
409
410 // Also update the leakage correction
411 // as it depends on the cluster LAr+PS energy
414 if (!eg->setIsolationCaloCorrection(
415 m_IsoLeakCorrectionTool->GetPtCorrection(*eg,t),
417 ATH_MSG_WARNING("could not set leakage correction for isolation type"
418 << xAOD::Iso::toCString(t) << " and object pT, eta = "
419 << eg->pt() << " " << eg->eta());
420 }
421 }
422 }
423
424}

◆ renounce()

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 > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
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)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ setFilterPassed()

virtual void AthCommonReentrantAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool state,
const EventContext & ctx ) const
inlinevirtualinherited

Definition at line 100 of file AthCommonReentrantAlgorithm.h.

100 {
102 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const

◆ sysExecute()

StatusCode AthCommonReentrantAlgorithm< Gaudi::Algorithm >::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 85 of file AthCommonReentrantAlgorithm.cxx.

77{
78 return BaseAlg::sysExecute (ctx);
79}

◆ sysInitialize()

StatusCode AthCommonReentrantAlgorithm< Gaudi::Algorithm >::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 HypoBase, and InputMakerBase.

Definition at line 61 of file AthCommonReentrantAlgorithm.cxx.

107 {
109
110 if (sc.isFailure()) {
111 return sc;
112 }
113
114 ServiceHandle<ICondSvc> cs("CondSvc",name());
115 for (auto h : outputHandles()) {
116 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
117 // do this inside the loop so we don't create the CondSvc until needed
118 if ( cs.retrieve().isFailure() ) {
119 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
120 return StatusCode::SUCCESS;
121 }
122 if (cs->regHandle(this,*h).isFailure()) {
124 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
125 << " with CondSvc");
126 }
127 }
128 }
129 return sc;
130}
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }

Member Data Documentation

◆ m_ambiguityFix

Gaudi::Property<bool> egammaAODFixes::m_ambiguityFix
private
Initial value:
{this,
"FixAmbiguityLinks", true,
"Whether or not to fix the ambiguity links"}

correct ambiguity links ?

Definition at line 128 of file egammaAODFixes.h.

128 {this,
129 "FixAmbiguityLinks", true,
130 "Whether or not to fix the ambiguity links"};

◆ m_CaloCellsKey

SG::ReadHandleKey<CaloCellContainer> egammaAODFixes::m_CaloCellsKey
private
Initial value:
{this,
"CaloCellsName", "AllCalo", "Name of calo cell container"}

Name of the calo cell container.

Definition at line 83 of file egammaAODFixes.h.

83 {this,
84 "CaloCellsName", "AllCalo", "Name of calo cell container"};

◆ m_caloDetDescrMgrKey

SG::ReadCondHandleKey<CaloDetDescrManager> egammaAODFixes::m_caloDetDescrMgrKey
private
Initial value:
{this,
"CaloDetDescrManager",
"",
"SG Key for CaloDetDescrManager in the Condition Store"
}

Key for calo detector description manager.

Definition at line 107 of file egammaAODFixes.h.

107 {this,
108 "CaloDetDescrManager",
109 "",
110 "SG Key for CaloDetDescrManager in the Condition Store"
111 };

◆ m_clusterCorrectionTool

ToolHandle<IegammaSwTool> egammaAODFixes::m_clusterCorrectionTool
private
Initial value:
{ this,
"ClusterCorrectionTool",
"",
"tool that applies cluster corrections" }

Tool to handle cluster corrections.

Definition at line 138 of file egammaAODFixes.h.

138 { this,
139 "ClusterCorrectionTool",
140 "",
141 "tool that applies cluster corrections" };

◆ m_correctCluster

Gaudi::Property<bool> egammaAODFixes::m_correctCluster
private
Initial value:
{this,
"CorrectCluster", false,
"Whether or not to correct the cluster"}

correct also layer energies ?

Definition at line 123 of file egammaAODFixes.h.

123 {this,
124 "CorrectCluster", false,
125 "Whether or not to correct the cluster"};

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_egammaCellRecoveryTool

ToolHandle<IegammaCellRecoveryTool> egammaAODFixes::m_egammaCellRecoveryTool
private
Initial value:
{
this,
"egammaCellRecoveryTool",
"egammaCellRecoveryTool/egammaCellRecoveryTool",
"Tool that adds cells in L2 or L3 "
"that could have been rejected by timing cut"
}

Pointer to the egammaCellRecoveryTool.

Definition at line 114 of file egammaAODFixes.h.

114 {
115 this,
116 "egammaCellRecoveryTool",
117 "egammaCellRecoveryTool/egammaCellRecoveryTool",
118 "Tool that adds cells in L2 or L3 "
119 "that could have been rejected by timing cut"
120 };

◆ m_egClusCellLinkOutputKey

SG::WriteHandleKey<CaloClusterCellLinkContainer> egammaAODFixes::m_egClusCellLinkOutputKey
private
Initial value:
{this,
"DoNotSet_OutputClusterContainerLinks",
"",
"Key of the output cluster container cell links; Do not set! Name taken "
"from associated container"
}

Key of the output cluster container cell links: name taken from containter name; only dummy configurable.

Definition at line 99 of file egammaAODFixes.h.

99 {this,
100 "DoNotSet_OutputClusterContainerLinks",
101 "",
102 "Key of the output cluster container cell links; Do not set! Name taken "
103 "from associated container"
104 };

◆ m_egClusInputKey

SG::ReadHandleKey<xAOD::CaloClusterContainer> egammaAODFixes::m_egClusInputKey
private
Initial value:
{this,
"EGammaClustersInputName", "",
"Name of egamma cluster container to be read in"}

Name of the egamma cluster input collection.

Definition at line 92 of file egammaAODFixes.h.

92 {this,
93 "EGammaClustersInputName", "",
94 "Name of egamma cluster container to be read in"};

◆ m_egClusOutputKey

SG::WriteHandleKey<xAOD::CaloClusterContainer> egammaAODFixes::m_egClusOutputKey
private
Initial value:
{this,
"EGammaClustersOutputName", "",
"Name of egamma cluster container to be created"}

Name of the egamma cluster output collection.

Definition at line 87 of file egammaAODFixes.h.

87 {this,
88 "EGammaClustersOutputName", "",
89 "Name of egamma cluster container to be created"};

◆ m_electronInputKey

SG::ReadHandleKey<xAOD::ElectronContainer> egammaAODFixes::m_electronInputKey
private
Initial value:
{this,
"ElectronInputName", "old_Electrons",
"Name of electron container to be read in"}

Name of the electron input collection.

Definition at line 68 of file egammaAODFixes.h.

68 {this,
69 "ElectronInputName", "old_Electrons",
70 "Name of electron container to be read in"};

◆ m_electronOutputKey

SG::WriteHandleKey<xAOD::ElectronContainer> egammaAODFixes::m_electronOutputKey
private
Initial value:
{this,
"ElectronOutputName", "Electrons",
"Name of electron container to be created"}

Name of the electron output collection.

Definition at line 63 of file egammaAODFixes.h.

63 {this,
64 "ElectronOutputName", "Electrons",
65 "Name of electron container to be created"};

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthCommonReentrantAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.

Empty if no symlinks were found.

Definition at line 114 of file AthCommonReentrantAlgorithm.h.

◆ m_IsoLeakCorrectionTool

ToolHandle<CP::IIsolationCorrectionTool> egammaAODFixes::m_IsoLeakCorrectionTool
private
Initial value:
{this,
"IsoLeakCorrectionTool", "",
"Handle on the leakage correction tool"}

Handle to the isolation leakage correction tool.

Definition at line 150 of file egammaAODFixes.h.

150 {this,
151 "IsoLeakCorrectionTool", "",
152 "Handle on the leakage correction tool"};

◆ m_MVACalibSvc

ServiceHandle<IegammaMVASvc> egammaAODFixes::m_MVACalibSvc
private
Initial value:
{ this,
"MVACalibSvc",
"",
"calibration service" }

Handle to the MVA calibration service.

Definition at line 144 of file egammaAODFixes.h.

144 { this,
145 "MVACalibSvc",
146 "",
147 "calibration service" };

◆ m_photonInputKey

SG::ReadHandleKey<xAOD::PhotonContainer> egammaAODFixes::m_photonInputKey
private
Initial value:
{this,
"PhotonInputName", "old_Photons",
"Name of photon container to be read in"}

Name of the photon input collection.

Definition at line 78 of file egammaAODFixes.h.

78 {this,
79 "PhotonInputName", "old_Photons",
80 "Name of photon container to be read in"};

◆ m_photonOutputKey

SG::WriteHandleKey<xAOD::PhotonContainer> egammaAODFixes::m_photonOutputKey
private
Initial value:
{this,
"PhotonOutputName", "Photons",
"Name of photon container to be created"}

Name of the photon output collection.

Definition at line 73 of file egammaAODFixes.h.

73 {this,
74 "PhotonOutputName", "Photons",
75 "Name of photon container to be created"};

◆ m_tpetcFix

Gaudi::Property<bool> egammaAODFixes::m_tpetcFix
private
Initial value:
{this,
"FixEGTopoetcone", true,
"Whether or not to fix topoetcone variables"}

correct topoetcone isolation ?

Definition at line 133 of file egammaAODFixes.h.

133 {this,
134 "FixEGTopoetcone", true,
135 "Whether or not to fix topoetcone variables"};

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files: