|
ATLAS Offline Software
|
Go to the documentation of this file.
8 #include "GaudiKernel/EventContext.h"
32 template <
typename SrcT,
typename DestT>
33 void doAmbiguityLinks(
34 const EventContext& ctx,
41 std::vector<ElementLink<xAOD::CaloClusterContainer>>>
42 caloClusterLinks(
"constituentClusterLinks");
45 ELink(
"ambiguityLink");
48 for (SrcT *
src : *srcContainer) {
49 ELink(*
src) = dummylink;
56 destIndex < destContainer->
size();
59 DestT *
dest = destContainer->
at(destIndex);
64 if (caloClusterLinks(*(
dest->caloCluster())).at(0) ==
65 caloClusterLinks(*(
src->caloCluster())).at(0)) {
67 *destContainer, destIndex, ctx);
77 ISvcLocator* pSvcLocator)
84 m_deltaEta1Pear = std::make_unique<electronPearShapeAlignmentCorrection>();
118 return StatusCode::SUCCESS;
124 return StatusCode::SUCCESS;
146 inputElRecs = electronSuperRecs.
ptr();
150 std::make_unique<xAOD::ElectronContainer>(),
151 std::make_unique<xAOD::ElectronAuxContainer>()));
159 inputPhRecs = photonSuperRecs.
ptr();
164 std::make_unique<xAOD::PhotonAuxContainer>()));
174 for (
const egammaRec* electronRec : *inputElRecs) {
176 if (electronRec->getNumberOfTrackParticles() == 0) {
184 const double elEta0 = elClus->
eta0();
185 const double elPhi0 = elClus->
phi0();
186 for (
const egammaRec* photonRec : *inputPhRecs) {
189 if (elEta0 == phClus->
eta0() && elPhi0 == phClus->
phi0()) {
194 electronRec->trackParticle(),
208 return StatusCode::FAILURE;
215 for (
const egammaRec* photonRec : *inputPhRecs) {
221 const double phEta0 = phClus->
eta0();
222 const double phPhi0 = phClus->
phi0();
223 for (
const egammaRec* electronRec : *inputElRecs) {
226 if (phEta0 == elClus->
eta0() && phPhi0 == elClus->
phi0()) {
231 electronRec->trackParticle(),
245 return StatusCode::FAILURE;
254 ATH_CHECK(caloDetDescrMgrHandle.isValid());
303 doAmbiguityLinks(ctx,
electrons, photons);
304 doAmbiguityLinks(ctx, photons,
electrons);
311 std::make_unique<xAOD::ElectronContainer>(),
312 std::make_unique<xAOD::ElectronAuxContainer>()));
314 dummyElectronContainer->
push_back(std::unique_ptr<xAOD::Electron>());
317 return StatusCode::SUCCESS;
320 template <
typename T>
323 const EventContext& ctx,
324 const ToolHandle<IegammaBaseTool>&
tool,
333 return StatusCode::SUCCESS;
339 const unsigned int author,
379 const unsigned int author,
397 if (!
photon->setVertexCaloMatchValue(
402 if (!
photon->setVertexCaloMatchValue(
void reserve(size_type n)
Attempt to preallocate enough memory for a specified number of elements.
flt_t phi0() const
Returns raw of cluster seed.
const std::array< double, 4 > & deltaPhiRescaled() const
deltaPhi for rescaled momentum extrapolation from the perigee.
xAOD::ElectronContainer * electronContainer
SG::ReadHandleKey< EgammaRecContainer > m_photonClusterRecContainerKey
Name of input super cluster photon egammaRec container.
ToolHandleArray< IegammaBaseTool > m_photonTools
Vector of tools for dressing ONLY photons.
Helper class to provide type-safe access to aux data.
float charge() const
Returns the charge.
StatusCode initialize() override final
Gaudi::Property< bool > m_doPhotons
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setInterceptInner setEtaMap setEtaBin setIsTgcFailure setDeltaPt deltaPhi
StatusCode CallTool(const EventContext &ctx, const ToolHandle< IegammaBaseTool > &tool, DataVector< T > *container) const
Call a tool using contExecute and an electron or photon container.
ToolHandleArray< IegammaBaseTool > m_electronTools
Vector of tools for dressing ONLY electrons.
ToolHandle< IEMClusterTool > m_clusterTool
Tool to do the final electron/photon cluster building.
StatusCode execute(const EventContext &ctx) const override final
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...
const std::vector< ElementLink< xAOD::TrackParticleContainer > > & trackParticleElementLinks() const
Get a reference to the track particle links.
StatusCode finalize() override final
bool empty() const
Test if the key is blank.
SG::WriteHandleKey< xAOD::ElectronContainer > m_electronOutputKey
Name of the electron output collection.
const std::array< double, 4 > & deltaEta() const
deltaEta at pre sampler(0) -> 3rd sampling(3)
Definition of CaloDetDescrManager.
ToolHandle< IEGammaAmbiguityTool > m_ambiguityTool
Tool to resolve electron/photon ambiguity.
An algorithm that can be simultaneously executed in multiple threads.
std::unique_ptr< electronPearShapeAlignmentCorrection > m_deltaEta1Pear
Handle class for recording to StoreGate.
xAODEgammaBuilder(const std::string &name, ISvcLocator *pSvcLocator)
Description of a calorimeter cluster.
const std::array< double, 4 > & deltaPhi() const
deltaPhi at pre sampler(0) -> 3rd sampling(3)
SG::ReadHandleKey< EgammaRecContainer > m_electronClusterRecContainerKey
Name of input super cluster electron egammaRec container.
double deltaPhiLast() const
deltaPhi from Last measurement
double deltaEta(const I4Momentum &p1, const I4Momentum &p2)
Computes efficiently .
const std::vector< ElementLink< xAOD::CaloClusterContainer > > & caloClusterElementLinks() const
Get a reference to the calo cluster links.
const uint16_t AuthorAmbiguous
Object Reconstructed by standard cluster-based algorithm.
::StatusCode StatusCode
StatusCode definition for legacy code.
float deltaPhiVtx() const
deltaPhiVtx
SG::WriteHandleKey< xAOD::ElectronContainer > m_dummyElectronOutputKey
Name of the dummy electron output collection.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Gaudi::Property< bool > m_isTruth
Option to do truth.
@ convMatchDeltaPhi1
difference between the cluster phi and the phi of the first track of the vertex extrapolated to the s...
ToolHandle< IEMShowerBuilder > m_ShowerTool
Tool to compute shower shapes.
xAOD::PhotonContainer * photonContainer
ElementLink implementation for ROOT usage.
void calculate(xAOD::Electron &electron)
Gaudi::Property< bool > m_doElectrons
Helpers for checking error return status codes and reporting errors.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
StatusCode initialize(bool used=true)
const std::vector< ElementLink< xAOD::VertexContainer > > & vertexElementLinks() const
Get a reference to the vertix links.
const_pointer_type ptr()
Dereference the pointer.
flt_t eta0() const
Returns raw of cluster seed.
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< IegammaOQFlagsBuilder > m_egammaOQTool
Tool to add electron/photon Object Quality info.
This class provides the client interface for accessing the detector description information common to...
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
@ convMatchDeltaEta1
difference between the cluster eta and the eta of the first track of the vertex extrapolated to the s...
const uint16_t AuthorPhoton
Object Reconstructed by standard cluster-based algorithm.
iterator emplace(iterator position, value_type pElem)
Add a new element to the collection.
Class describing a TrackParticle.
const T * at(size_type n) const
Access an element, as an rvalue.
SG::WriteHandleKey< xAOD::PhotonContainer > m_photonOutputKey
Name of the photon output collection.
Handle class for reading from StoreGate.
size_type size() const noexcept
Returns the number of elements in the collection.
float deltaEtaVtx() const
deltaEtaVtx
const uint16_t AuthorElectron
Object Reconstructed by standard cluster-based algorithm.
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloDetDescrMgrKey