8#include "GaudiKernel/EventContext.h"
33 ISvcLocator* pSvcLocator)
40 m_deltaEta1Pear = std::make_unique<electronPearShapeAlignmentCorrection>();
74 return StatusCode::SUCCESS;
80 return StatusCode::SUCCESS;
102 inputElRecs = electronSuperRecs.
ptr();
106 std::make_unique<xAOD::ElectronContainer>(),
107 std::make_unique<xAOD::ElectronAuxContainer>()));
110 electrons->reserve(inputElRecs->
size());
115 inputPhRecs = photonSuperRecs.
ptr();
120 std::make_unique<xAOD::PhotonAuxContainer>()));
130 for (
const egammaRec* electronRec : *inputElRecs) {
132 if (electronRec->getNumberOfTrackParticles() == 0) {
140 const double elEta0 = elClus->
eta0();
141 const double elPhi0 = elClus->
phi0();
142 for (
const egammaRec* photonRec : *inputPhRecs) {
145 if (elEta0 == phClus->
eta0() && elPhi0 == phClus->
phi0()) {
150 electronRec->trackParticle(),
164 return StatusCode::FAILURE;
171 for (
const egammaRec* photonRec : *inputPhRecs) {
177 const double phEta0 = phClus->
eta0();
178 const double phPhi0 = phClus->
phi0();
179 for (
const egammaRec* electronRec : *inputElRecs) {
182 if (phEta0 == elClus->
eta0() && phPhi0 == elClus->
phi0()) {
187 electronRec->trackParticle(),
201 return StatusCode::FAILURE;
267 std::make_unique<xAOD::ElectronContainer>(),
268 std::make_unique<xAOD::ElectronAuxContainer>()));
270 dummyElectronContainer->push_back(std::unique_ptr<xAOD::Electron>());
273 return StatusCode::SUCCESS;
279 const EventContext& ctx,
280 const ToolHandle<IegammaBaseTool>& tool,
289 return StatusCode::SUCCESS;
295 const unsigned int author,
296 const uint8_t
type)
const
303 electron->setAuthor(author);
306 acc(*electron) =
type;
313 electron->setCharge(trackParticle->
charge());
316 electron->setTrackCaloMatchValues(
325 electron->caloCluster()->etaBE(2),
326 electron->caloCluster()->phiBE(2)
335 const unsigned int author,
336 const uint8_t
type)
const
343 photon->setAuthor(author);
353 if (!photon->setVertexCaloMatchValue(
358 if (!photon->setVertexCaloMatchValue(
Scalar deltaPhi(const MatrixBase< Derived > &vec) const
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition of CaloDetDescrManager.
Helpers for checking error return status codes and reporting errors.
Handle class for reading from StoreGate.
Handle class for recording to StoreGate.
xAOD::ElectronContainer * electronContainer
xAOD::PhotonContainer * photonContainer
An algorithm that can be simultaneously executed in multiple threads.
This class provides the client interface for accessing the detector description information common to...
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::Accessor< T, ALLOC > Accessor
const_pointer_type ptr()
Dereference the pointer.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
Represent an egamma object for internal egamma usage during reconstruction.
double deltaPhiLast() const
deltaPhi from Last measurement
const std::vector< ElementLink< xAOD::CaloClusterContainer > > & caloClusterElementLinks() const
Get a reference to the calo cluster links.
const std::vector< ElementLink< xAOD::TrackParticleContainer > > & trackParticleElementLinks() const
Get a reference to the track particle links.
const std::array< double, 4 > & deltaPhiRescaled() const
deltaPhi for rescaled momentum extrapolation from the perigee.
float deltaPhiVtx() const
deltaPhiVtx
const std::vector< ElementLink< xAOD::VertexContainer > > & vertexElementLinks() const
Get a reference to the vertix links.
float deltaEtaVtx() const
deltaEtaVtx
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)
xAODEgammaBuilder(const std::string &name, ISvcLocator *pSvcLocator)
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
StatusCode initialize() override final
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...
StatusCode finalize() override final
ToolHandle< IEMShowerBuilder > m_ShowerTool
Tool to compute shower shapes.
std::unique_ptr< electronPearShapeAlignmentCorrection > m_deltaEta1Pear
ToolHandle< IEGammaAmbiguityTool > m_ambiguityTool
Tool to resolve electron/photon ambiguity.
SG::WriteHandleKey< xAOD::ElectronContainer > m_electronOutputKey
Name of the electron output collection.
Gaudi::Property< bool > m_isTruth
Option to do truth.
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
StatusCode execute(const EventContext &ctx) const override final
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.
float charge() const
Returns the charge.
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.
@ 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...
const uint16_t AuthorElectron
Object Reconstructed by standard cluster-based algorithm.
const uint16_t AuthorAmbiguous
Object Reconstructed by standard cluster-based algorithm.
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.
TrackParticle_v1 TrackParticle
Reference the current persistent version:
Photon_v1 Photon
Definition of the current "egamma version".
Electron_v1 Electron
Definition of the current "egamma version".