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

The last step of the electron and photon reconstruction algorithm. More...

#include <xAODEgammaBuilder.h>

Inheritance diagram for xAODEgammaBuilder:
Collaboration diagram for xAODEgammaBuilder:

Public Member Functions

 xAODEgammaBuilder (const std::string &name, ISvcLocator *pSvcLocator)
StatusCode initialize () override final
StatusCode finalize () 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

bool getElectron (const egammaRec *egRec, xAOD::ElectronContainer *electronContainer, const unsigned int author, const uint8_t type) const
 Given an egammaRec object, a pointer to the electron container and the author, create and dress an electron, pushing it back to the container and calling the relevant tools.
bool getPhoton (const egammaRec *egRec, xAOD::PhotonContainer *photonContainer, const unsigned int author, uint8_t type) const
 Given an egammaRec object, a pointer to the photon container and the author, create and dress a photon, pushing it back to the container and calling the relevant tools.
template<typename T>
StatusCode CallTool (const EventContext &ctx, const ToolHandle< IegammaBaseTool > &tool, DataVector< T > *container) const
 Call a tool using contExecute and an electron or photon container.
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

ToolHandleArray< IegammaBaseToolm_electronTools
 Vector of tools for dressing ONLY electrons.
ToolHandleArray< IegammaBaseToolm_photonTools
 Vector of tools for dressing ONLY photons.
ToolHandle< IEMClusterToolm_clusterTool
 Tool to do the final electron/photon cluster building.
ToolHandle< IEMShowerBuilderm_ShowerTool
 Tool to compute shower shapes.
ToolHandle< IEGammaAmbiguityToolm_ambiguityTool
 Tool to resolve electron/photon ambiguity.
ToolHandle< IegammaOQFlagsBuilderm_egammaOQTool
 Tool to add electron/photon Object Quality info.
SG::WriteHandleKey< xAOD::ElectronContainerm_electronOutputKey
 Name of the electron output collection.
SG::WriteHandleKey< xAOD::PhotonContainerm_photonOutputKey
 Name of the photon output collection.
SG::ReadHandleKey< EgammaRecContainerm_electronClusterRecContainerKey
 Name of input super cluster electron egammaRec container.
SG::ReadHandleKey< EgammaRecContainerm_photonClusterRecContainerKey
 Name of input super cluster photon egammaRec container.
SG::ReadCondHandleKey< CaloDetDescrManagerm_caloDetDescrMgrKey
SG::WriteHandleKey< xAOD::ElectronContainerm_dummyElectronOutputKey
 Name of the dummy electron output collection.
Gaudi::Property< bool > m_isTruth {this, "isTruth", false, "is truth"}
 Option to do truth.
Gaudi::Property< bool > m_doPhotons {this, "doPhotons", true, "Run the Photon reconstruction"}
Gaudi::Property< bool > m_doElectrons {this, "doElectrons", true, "Run the Electron reconstruction"}
std::unique_ptr< electronPearShapeAlignmentCorrectionm_deltaEta1Pear
bool m_doAmbiguity {}
bool m_doOQ {}
bool m_doDummyElectrons = false
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

The last step of the electron and photon reconstruction algorithm.

The algorithm builds physics objects (xAOD::Electron, xAOD::Photon) from the egammaRec containers built by the previous algorithms. In the step of the chain electron and photon reconstruction are merged again and the ambiguity resolution is applied.

Input collections:

  • InputElectronRecCollectionName: default=ElectronSuperRecCollection. A container of egammaRec for electrons
  • InputPhotonRecCollectionName: default=PhotonSuperRecCollection. A container of egammaRec for photons

Output collections:

If the algorithm runs on both electrons and photons, which is the default (see doPhotons and doElectrons properties), the ambiguity resolution is applied. If there are two egammaRec, one coming from the electron input container, one coming from the photon input container, with the same eta and phi of the hottest cells then the ambiguity tool decides if to save only one or both. The author and the ambiguityType are set accordingly to that decision. If both particles are saved a link between them is saved (ambiguityLink). All the properties of electrons are set:

All the properties of photons are set:

Several tools are then applied to the particle:

  • Shower shapes are computed thanks to the tool configured by EMShowerTool property, implementing the interface IEMShowerBuilder, by default EMShowerBuilder.
  • Object quality is filled by the tool specified by the property ObjectQualityTool (no default). If the property is not set object quality is skipped.
  • finalize the cluster with the tool specified by the property EMClusterTool (default=EMClusterTool), for example applying energy calibration
  • tools specified by the properties egammaTools, ElectronTools, PhotonTools are executed (default: none)

Definition at line 87 of file xAODEgammaBuilder.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

◆ xAODEgammaBuilder()

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

Definition at line 32 of file xAODEgammaBuilder.cxx.

34 : AthReentrantAlgorithm(name, pSvcLocator)
35{}

Member Function Documentation

◆ CallTool()

template<typename T>
StatusCode xAODEgammaBuilder::CallTool ( const EventContext & ctx,
const ToolHandle< IegammaBaseTool > & tool,
DataVector< T > * container ) const
private

Call a tool using contExecute and an electron or photon container.

Definition at line 278 of file xAODEgammaBuilder.cxx.

282{
283 if (container) {
284 for (T *egamma : *container) {
285 ATH_CHECK(tool->execute(ctx, egamma));
286 }
287 }
288
289 return StatusCode::SUCCESS;
290}
#define ATH_CHECK
Evaluate an expression and check for errors.

◆ 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 xAODEgammaBuilder::execute ( const EventContext & ctx) const
finaloverride

Definition at line 84 of file xAODEgammaBuilder.cxx.

85{
86
87 const EgammaRecContainer* inputElRecs = nullptr;
88 const EgammaRecContainer* inputPhRecs = nullptr;
90 xAOD::PhotonContainer* photons = nullptr;
91 /*
92 * From here on if a Read/Write handle
93 * is retrieved the above will be !=
94 * nullptr for electron or photons or both
95 */
96 std::optional<SG::WriteHandle<xAOD::ElectronContainer>> electronContainer;
97 std::optional<SG::WriteHandle<xAOD::PhotonContainer>> photonContainer;
98
99 if (m_doElectrons) {
100 SG::ReadHandle<EgammaRecContainer> electronSuperRecs(
102 inputElRecs = electronSuperRecs.ptr();
103
106 std::make_unique<xAOD::ElectronContainer>(),
107 std::make_unique<xAOD::ElectronAuxContainer>()));
108
110 electrons->reserve(inputElRecs->size());
111 }
112 if (m_doPhotons) {
113 SG::ReadHandle<EgammaRecContainer> photonSuperRecs(
115 inputPhRecs = photonSuperRecs.ptr();
116
118 ATH_CHECK(
119 photonContainer->record(std::make_unique<xAOD::PhotonContainer>(),
120 std::make_unique<xAOD::PhotonAuxContainer>()));
121
122 photons = photonContainer->ptr();
123 photons->reserve(inputPhRecs->size());
124 }
125
126 /*
127 * Now fill the electrons and photons
128 */
129 if (m_doElectrons) {
130 for (const egammaRec* electronRec : *inputElRecs) {
131 // in case for some reasons we reach here with no trackparticles
132 if (electronRec->getNumberOfTrackParticles() == 0) {
133 continue;
134 }
137 if (m_doPhotons) {
138 // get the hottest cell
139 const xAOD::CaloCluster* const elClus = electronRec->caloCluster();
140 const double elEta0 = elClus->eta0();
141 const double elPhi0 = elClus->phi0();
142 for (const egammaRec* photonRec : *inputPhRecs) {
143 const xAOD::CaloCluster* const phClus = photonRec->caloCluster();
144 // See if they have the same hottest cell
145 if (elEta0 == phClus->eta0() && elPhi0 == phClus->phi0()) {
146 if (m_doAmbiguity) { // should be the default
147 author =
148 m_ambiguityTool->ambiguityResolve(elClus,
149 photonRec->vertex(),
150 electronRec->trackParticle(),
151 type);
152 } else { // in case the ambiguity tool is not set ambiguity is not
153 // resolved
155 }
156 break;
157 }
158 }
159 }
160 // Create Electron xAOD objects
163 if (!getElectron(electronRec, electrons, author, type)) {
164 return StatusCode::FAILURE;
165 }
166 }
167 }
168 }
169
170 if (m_doPhotons) {
171 for (const egammaRec* photonRec : *inputPhRecs) {
174 if (m_doElectrons) {
175 // get the hottest cell
176 const xAOD::CaloCluster* const phClus = photonRec->caloCluster();
177 const double phEta0 = phClus->eta0();
178 const double phPhi0 = phClus->phi0();
179 for (const egammaRec* electronRec : *inputElRecs) {
180 const xAOD::CaloCluster* const elClus = electronRec->caloCluster();
181 // See if they have the same hottest cell
182 if (phEta0 == elClus->eta0() && phPhi0 == elClus->phi0()) {
183 if (m_doAmbiguity) { // should be the default
184 author =
185 m_ambiguityTool->ambiguityResolve(elClus,
186 photonRec->vertex(),
187 electronRec->trackParticle(),
188 type);
189 } else { // in case the ambiguity tool is not set ambiguity is not
190 // resolved
192 }
193 break;
194 }
195 }
196 }
197 // Create Photon xAOD objects
200 if (!getPhoton(photonRec, photons, author, type)) {
201 return StatusCode::FAILURE;
202 }
203 }
204 }
205 }
206
207 SG::ReadCondHandle<CaloDetDescrManager> caloDetDescrMgrHandle{
209 };
210 ATH_CHECK(caloDetDescrMgrHandle.isValid());
211 const CaloDetDescrManager* calodetdescrmgr = *caloDetDescrMgrHandle;
212
213 // Shower Shapes
214 if (electrons) {
215 for (xAOD::Electron* electron : *electrons) {
216 ATH_CHECK(m_ShowerTool->execute(ctx, *calodetdescrmgr, electron));
217 }
218 }
219 if (photons) {
220 for (xAOD::Photon* photon : *photons) {
221 ATH_CHECK(m_ShowerTool->execute(ctx, *calodetdescrmgr, photon));
222 }
223 }
224
225 // Object Quality
226 if (m_doOQ) {
227 if (electrons) {
228 for (xAOD::Electron* electron : *electrons) {
229 ATH_CHECK(m_egammaOQTool->execute(ctx, *electron));
230 }
231 }
232 if (photons) {
233 for (xAOD::Photon* photon : *photons) {
234 ATH_CHECK(m_egammaOQTool->execute(ctx, *photon));
235 }
236 }
237 }
238
239 // Energy calibration
240 ATH_CHECK(m_clusterTool->contExecute(ctx, electrons, photons));
241
242 //Followed by 4-Mom Building
245 //Additional tools fpr electrons/photons
246 //e.g identification
247 if (m_doElectrons) {
248 for (const auto& tool : m_electronTools) {
249 ATH_CHECK(CallTool(ctx, tool, electrons));
250 }
251 }
252 if (m_doPhotons) {
253 for (const auto& tool : m_photonTools) {
254 ATH_CHECK(CallTool(ctx, tool, photons));
255 }
256 }
257 // Do the ambiguity Links
258 if (m_doElectrons && m_doPhotons) {
259 egAmbLinkHelper::doAmbiguityLinks(ctx, electrons, photons);
260 egAmbLinkHelper::doAmbiguityLinks(ctx, photons, electrons);
261 }
262
263 if (m_doDummyElectrons) {
264 SG::WriteHandle<xAOD::ElectronContainer> dummyElectronContainer(
266 ATH_CHECK(dummyElectronContainer.record(
267 std::make_unique<xAOD::ElectronContainer>(),
268 std::make_unique<xAOD::ElectronAuxContainer>()));
269
270 dummyElectronContainer->push_back(std::unique_ptr<xAOD::Electron>());
271 }
272
273 return StatusCode::SUCCESS;
274}
xAOD::ElectronContainer * electronContainer
xAOD::PhotonContainer * photonContainer
iterator emplace(iterator position, value_type pElem)
Add a new element to the collection.
void reserve(size_type n)
Attempt to preallocate enough memory for a specified number of elements.
size_type size() const noexcept
Returns the number of elements in the collection.
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloDetDescrMgrKey
ToolHandleArray< IegammaBaseTool > m_photonTools
Vector of tools for dressing ONLY photons.
SG::WriteHandleKey< xAOD::PhotonContainer > m_photonOutputKey
Name of the photon output collection.
Gaudi::Property< bool > m_doElectrons
bool getPhoton(const egammaRec *egRec, xAOD::PhotonContainer *photonContainer, const unsigned int author, uint8_t type) const
Given an egammaRec object, a pointer to the photon container and the author, create and dress a photo...
ToolHandle< IEMShowerBuilder > m_ShowerTool
Tool to compute shower shapes.
ToolHandle< IEGammaAmbiguityTool > m_ambiguityTool
Tool to resolve electron/photon ambiguity.
SG::WriteHandleKey< xAOD::ElectronContainer > m_electronOutputKey
Name of the electron output collection.
SG::WriteHandleKey< xAOD::ElectronContainer > m_dummyElectronOutputKey
Name of the dummy electron output collection.
StatusCode CallTool(const EventContext &ctx, const ToolHandle< IegammaBaseTool > &tool, DataVector< T > *container) const
Call a tool using contExecute and an electron or photon container.
SG::ReadHandleKey< EgammaRecContainer > m_electronClusterRecContainerKey
Name of input super cluster electron egammaRec container.
ToolHandle< IEMClusterTool > m_clusterTool
Tool to do the final electron/photon cluster building.
bool getElectron(const egammaRec *egRec, xAOD::ElectronContainer *electronContainer, const unsigned int author, const uint8_t type) const
Given an egammaRec object, a pointer to the electron container and the author, create and dress an el...
SG::ReadHandleKey< EgammaRecContainer > m_photonClusterRecContainerKey
Name of input super cluster photon egammaRec container.
ToolHandleArray< IegammaBaseTool > m_electronTools
Vector of tools for dressing ONLY electrons.
Gaudi::Property< bool > m_doPhotons
ToolHandle< IegammaOQFlagsBuilder > m_egammaOQTool
Tool to add electron/photon Object Quality info.
flt_t eta0() const
Returns raw of cluster seed.
flt_t phi0() const
Returns raw of cluster seed.
DataVector< egammaRec > EgammaRecContainer
The container is a simple typedef for now.
void calculate(xAOD::Electron &electron)
void doAmbiguityLinks(const EventContext &ctx, DataVector< SrcT > *srcContainer, DataVector< DestT > *destContainer)
const uint16_t AuthorPhoton
Object Reconstructed by standard cluster-based algorithm.
Definition EgammaDefs.h:28
const uint16_t AuthorElectron
Object Reconstructed by standard cluster-based algorithm.
Definition EgammaDefs.h:24
const uint16_t AuthorAmbiguous
Object Reconstructed by standard cluster-based algorithm.
Definition EgammaDefs.h:32
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.
Photon_v1 Photon
Definition of the current "egamma version".
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

◆ finalize()

StatusCode xAODEgammaBuilder::finalize ( )
finaloverride

Definition at line 78 of file xAODEgammaBuilder.cxx.

79{
80 return StatusCode::SUCCESS;
81}

◆ getElectron()

bool xAODEgammaBuilder::getElectron ( const egammaRec * egRec,
xAOD::ElectronContainer * electronContainer,
const unsigned int author,
const uint8_t type ) const
private

Given an egammaRec object, a pointer to the electron container and the author, create and dress an electron, pushing it back to the container and calling the relevant tools.

Definition at line 293 of file xAODEgammaBuilder.cxx.

297{
298 if (!egRec || !electronContainer) {
299 return false;
300 }
301
302 xAOD::Electron* electron = electronContainer->push_back(std::make_unique<xAOD::Electron>());
303 electron->setAuthor(author);
304
305 static const SG::AuxElement::Accessor<uint8_t> acc("ambiguityType");
306 acc(*electron) = type;
307
308 electron->setCaloClusterLinks(egRec->caloClusterElementLinks());
309 electron->setTrackParticleLinks(egRec->trackParticleElementLinks());
310
311 const xAOD::TrackParticle* trackParticle = electron->trackParticle();
312 if (trackParticle) {
313 electron->setCharge(trackParticle->charge());
314 }
315 // Set DeltaEta, DeltaPhi , DeltaPhiRescaled
316 electron->setTrackCaloMatchValues(
317 egRec->deltaEta(),
318 egRec->deltaPhi(),
319 egRec->deltaPhiRescaled(),
320 egRec->deltaPhiLast()
321 );
322
323 static const SG::AuxElement::Accessor<float> pear("deltaEta1PearDistortion");
324 pear(*electron) = m_isTruth ? 0.0 : m_deltaEta1Pear->getDeltaEtaDistortion(
325 electron->caloCluster()->etaBE(2),
326 electron->caloCluster()->phiBE(2)
327 );
328
329 return true;
330}
value_type push_back(value_type pElem)
Add an element to the end of the collection.
SG::Accessor< T, ALLOC > Accessor
Definition AuxElement.h:572
double deltaPhiLast() const
deltaPhi from Last measurement
const std::vector< ElementLink< xAOD::CaloClusterContainer > > & caloClusterElementLinks() const
Get a reference to the calo cluster links.
Definition egammaRec.cxx:26
const std::vector< ElementLink< xAOD::TrackParticleContainer > > & trackParticleElementLinks() const
Get a reference to the track particle links.
Definition egammaRec.cxx:49
const std::array< double, 4 > & deltaPhiRescaled() const
deltaPhi for rescaled momentum extrapolation from the perigee.
const std::array< double, 4 > & deltaEta() const
deltaEta at pre sampler(0) -> 3rd sampling(3)
const std::array< double, 4 > & deltaPhi() const
deltaPhi at pre sampler(0) -> 3rd sampling(3)
std::unique_ptr< electronPearShapeAlignmentCorrection > m_deltaEta1Pear
Gaudi::Property< bool > m_isTruth
Option to do truth.
float charge() const
Returns the charge.
TrackParticle_v1 TrackParticle
Reference the current persistent version:

◆ getPhoton()

bool xAODEgammaBuilder::getPhoton ( const egammaRec * egRec,
xAOD::PhotonContainer * photonContainer,
const unsigned int author,
uint8_t type ) const
private

Given an egammaRec object, a pointer to the photon container and the author, create and dress a photon, pushing it back to the container and calling the relevant tools.

Definition at line 333 of file xAODEgammaBuilder.cxx.

337{
338 if (!egRec || !photonContainer) {
339 return false;
340 }
341
342 xAOD::Photon* photon = photonContainer->push_back(std::make_unique<xAOD::Photon>());
343 photon->setAuthor(author);
344 static const SG::AuxElement::Accessor<uint8_t> acc("ambiguityType");
345 acc(*photon) = type;
346
347 photon->setCaloClusterLinks(egRec->caloClusterElementLinks());
348 photon->setVertexLinks(egRec->vertexElementLinks());
349
350 // Transfer deltaEta/Phi info
351 float deltaEta = egRec->deltaEtaVtx();
352 float deltaPhi = egRec->deltaPhiVtx();
353 if (!photon->setVertexCaloMatchValue(
355 return false;
356 }
357
358 if (!photon->setVertexCaloMatchValue(
360 return false;
361 }
362 return true;
363}
Scalar deltaPhi(const MatrixBase< Derived > &vec) const
float deltaPhiVtx() const
deltaPhiVtx
const std::vector< ElementLink< xAOD::VertexContainer > > & vertexElementLinks() const
Get a reference to the vertix links.
Definition egammaRec.cxx:71
float deltaEtaVtx() const
deltaEtaVtx
double deltaEta(const I4Momentum &p1, const I4Momentum &p2)
Computes efficiently .
Definition P4Helpers.h:66
@ convMatchDeltaPhi1
difference between the cluster phi and the phi of the first track of the vertex extrapolated to the s...
@ convMatchDeltaEta1
difference between the cluster eta and the eta of the first track of the vertex extrapolated to the s...

◆ initialize()

StatusCode xAODEgammaBuilder::initialize ( )
finaloverride

Definition at line 38 of file xAODEgammaBuilder.cxx.

39{
40 m_deltaEta1Pear = std::make_unique<electronPearShapeAlignmentCorrection>();
41 // the data handle keys
46 ATH_CHECK(m_caloDetDescrMgrKey.initialize());
47
48 // retrieve tools
49 ATH_CHECK(m_clusterTool.retrieve());
50 ATH_CHECK(m_ShowerTool.retrieve());
51
52 if (m_doElectrons) {
53 ATH_CHECK(m_electronTools.retrieve());
54 }
55 if (m_doPhotons) {
56 ATH_CHECK(m_photonTools.retrieve());
57 }
58 m_doOQ = !m_egammaOQTool.empty();
59 if (m_doOQ) {
60 ATH_CHECK(m_egammaOQTool.retrieve());
61 } else {
62 m_egammaOQTool.disable();
63 }
64
65 // do we actually do ambiguity
68 ATH_CHECK(m_ambiguityTool.retrieve());
69 } else {
70 m_ambiguityTool.disable();
71 }
74 return StatusCode::SUCCESS;
75}

◆ 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.

◆ 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}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_WARNING(x)
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_ambiguityTool

ToolHandle<IEGammaAmbiguityTool> xAODEgammaBuilder::m_ambiguityTool
private
Initial value:
{this,
"AmbiguityTool", "EGammaAmbiguityTool/egammaambiguitytool",
"Tool that does electron/photon ambiguity resolution"}

Tool to resolve electron/photon ambiguity.

Definition at line 135 of file xAODEgammaBuilder.h.

135 {this,
136 "AmbiguityTool", "EGammaAmbiguityTool/egammaambiguitytool",
137 "Tool that does electron/photon ambiguity resolution"};

◆ m_caloDetDescrMgrKey

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

Definition at line 168 of file xAODEgammaBuilder.h.

168 {
169 this,
170 "CaloDetDescrManager",
171 "CaloDetDescrManager",
172 "SG Key for CaloDetDescrManager in the Condition Store"
173 };

◆ m_clusterTool

ToolHandle<IEMClusterTool> xAODEgammaBuilder::m_clusterTool
private
Initial value:
{this,
"EMClusterTool", "egammaTools/EMClusterTool",
"Tool that does electron/photon final cluster building"}

Tool to do the final electron/photon cluster building.

Definition at line 125 of file xAODEgammaBuilder.h.

125 {this,
126 "EMClusterTool", "egammaTools/EMClusterTool",
127 "Tool that does electron/photon final cluster building"};

◆ m_deltaEta1Pear

std::unique_ptr<electronPearShapeAlignmentCorrection> xAODEgammaBuilder::m_deltaEta1Pear
private

Definition at line 186 of file xAODEgammaBuilder.h.

◆ 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_doAmbiguity

bool xAODEgammaBuilder::m_doAmbiguity {}
private

Definition at line 187 of file xAODEgammaBuilder.h.

187{};

◆ m_doDummyElectrons

bool xAODEgammaBuilder::m_doDummyElectrons = false
private

Definition at line 189 of file xAODEgammaBuilder.h.

◆ m_doElectrons

Gaudi::Property<bool> xAODEgammaBuilder::m_doElectrons {this, "doElectrons", true, "Run the Electron reconstruction"}
private

Definition at line 185 of file xAODEgammaBuilder.h.

185{this, "doElectrons", true, "Run the Electron reconstruction"};

◆ m_doOQ

bool xAODEgammaBuilder::m_doOQ {}
private

Definition at line 188 of file xAODEgammaBuilder.h.

188{};

◆ m_doPhotons

Gaudi::Property<bool> xAODEgammaBuilder::m_doPhotons {this, "doPhotons", true, "Run the Photon reconstruction"}
private

Definition at line 184 of file xAODEgammaBuilder.h.

184{this, "doPhotons", true, "Run the Photon reconstruction"};

◆ m_dummyElectronOutputKey

SG::WriteHandleKey<xAOD::ElectronContainer> xAODEgammaBuilder::m_dummyElectronOutputKey
private
Initial value:
{this,
"DummyElectronOutputName", "",
"Name of Dummy Electron Container to be created"}

Name of the dummy electron output collection.

Definition at line 176 of file xAODEgammaBuilder.h.

176 {this,
177 "DummyElectronOutputName", "",
178 "Name of Dummy Electron Container to be created"};

◆ m_egammaOQTool

ToolHandle<IegammaOQFlagsBuilder> xAODEgammaBuilder::m_egammaOQTool
private
Initial value:
{this,
"ObjectQualityTool", {},
"Tool that adds electron/photon Object Quality info"}

Tool to add electron/photon Object Quality info.

Definition at line 140 of file xAODEgammaBuilder.h.

140 {this,
141 "ObjectQualityTool", {},
142 "Tool that adds electron/photon Object Quality info"};

◆ m_electronClusterRecContainerKey

SG::ReadHandleKey<EgammaRecContainer> xAODEgammaBuilder::m_electronClusterRecContainerKey
private
Initial value:
{this,
"InputElectronRecCollectionName",
"ElectronSuperRecCollection",
"Input container for electron Super Cluster egammaRec objects"}

Name of input super cluster electron egammaRec container.

Definition at line 157 of file xAODEgammaBuilder.h.

157 {this,
158 "InputElectronRecCollectionName",
159 "ElectronSuperRecCollection",
160 "Input container for electron Super Cluster egammaRec objects"};

◆ m_electronOutputKey

SG::WriteHandleKey<xAOD::ElectronContainer> xAODEgammaBuilder::m_electronOutputKey
private
Initial value:
{this,
"ElectronOutputName", "ElectronContainer",
"Name of Electron Container to be created"}

Name of the electron output collection.

Definition at line 147 of file xAODEgammaBuilder.h.

147 {this,
148 "ElectronOutputName", "ElectronContainer",
149 "Name of Electron Container to be created"};

◆ m_electronTools

ToolHandleArray<IegammaBaseTool> xAODEgammaBuilder::m_electronTools
private
Initial value:
{this,
"ElectronTools", {}, "Tools for dressing ONLY electrons"}

Vector of tools for dressing ONLY electrons.

Definition at line 117 of file xAODEgammaBuilder.h.

117 {this,
118 "ElectronTools", {}, "Tools for dressing ONLY electrons"};

◆ 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_isTruth

Gaudi::Property<bool> xAODEgammaBuilder::m_isTruth {this, "isTruth", false, "is truth"}
private

Option to do truth.

Definition at line 183 of file xAODEgammaBuilder.h.

183{this, "isTruth", false, "is truth"};

◆ m_photonClusterRecContainerKey

SG::ReadHandleKey<EgammaRecContainer> xAODEgammaBuilder::m_photonClusterRecContainerKey
private
Initial value:
{this,
"InputPhotonRecCollectionName",
"PhotonSuperRecCollection",
"Input container for electron Super Cluster egammaRec objects"}

Name of input super cluster photon egammaRec container.

Definition at line 163 of file xAODEgammaBuilder.h.

163 {this,
164 "InputPhotonRecCollectionName",
165 "PhotonSuperRecCollection",
166 "Input container for electron Super Cluster egammaRec objects"};

◆ m_photonOutputKey

SG::WriteHandleKey<xAOD::PhotonContainer> xAODEgammaBuilder::m_photonOutputKey
private
Initial value:
{this,
"PhotonOutputName", "PhotonContainer",
"Name of Photon Container to be created"}

Name of the photon output collection.

Definition at line 152 of file xAODEgammaBuilder.h.

152 {this,
153 "PhotonOutputName", "PhotonContainer",
154 "Name of Photon Container to be created"};

◆ m_photonTools

ToolHandleArray<IegammaBaseTool> xAODEgammaBuilder::m_photonTools
private
Initial value:
{this,
"PhotonTools", {}, "Tools for dressing ONLY photons"}

Vector of tools for dressing ONLY photons.

Definition at line 121 of file xAODEgammaBuilder.h.

121 {this,
122 "PhotonTools", {}, "Tools for dressing ONLY photons"};

◆ m_ShowerTool

ToolHandle<IEMShowerBuilder> xAODEgammaBuilder::m_ShowerTool
private
Initial value:
{this,
"EMShowerTool", "egammaTools/EMShowerBuilder",
"Tool that does electron/photon shower shape building"}

Tool to compute shower shapes.

Definition at line 130 of file xAODEgammaBuilder.h.

130 {this,
131 "EMShowerTool", "egammaTools/EMShowerBuilder",
132 "Tool that does electron/photon shower shape building"};

◆ 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: