Loading [MathJax]/jax/output/SVG/config.js
 |
ATLAS Offline Software
|
Go to the documentation of this file.
24 :
EL::AnaReentrantAlgorithm(
name, svcLoc)
52 return StatusCode::SUCCESS;
60 std::unique_ptr<ConstDataVector<xAOD::ElectronContainer>> transientContainer = std::make_unique<ConstDataVector<xAOD::ElectronContainer>>(
SG::VIEW_ELEMENTS);
61 std::unique_ptr<xAOD::ElectronContainer> outputCol = std::make_unique<xAOD::ElectronContainer>();
64 std::unique_ptr<xAOD::ElectronAuxContainer> outputAuxCol;
69 outputAuxCol = std::make_unique<xAOD::ElectronAuxContainer>();
70 outputCol->setStore(outputAuxCol.get());
79 return StatusCode::FAILURE;
84 return StatusCode::FAILURE;
88 std::set<const xAOD::Electron *> ElectronsToRemove;
91 ATH_MSG_DEBUG(
"Size of overlapping electrons to remove: " << ElectronsToRemove.size());
105 transientContainer->reserve(promptCol->size() + lrtCol->size());
107 mergeElectron(*promptCol, transientContainer.get(), ElectronsToRemove);
108 mergeElectron(*lrtCol, transientContainer.get(), ElectronsToRemove);
112 outputCol->reserve(promptCol->size() + lrtCol->size());
114 mergeElectron(*promptCol, outputCol.get(), ElectronsToRemove);
126 ATH_CHECK(h_write.
record(std::move(outputCol), std::move(outputAuxCol)));
131 return StatusCode::SUCCESS;
140 const std::set<const xAOD::Electron *> &ElectronsToRemove)
const
143 if (!electronCol.
empty())
150 for (
const auto *
const electron : electronCol)
153 if (
m_doRemoval && ElectronsToRemove.find(electron) != ElectronsToRemove.end())
157 std::unique_ptr<xAOD::Electron> newElectron = std::make_unique<xAOD::Electron>(*electron);
160 originalElectronLink(*newElectron) = eLink;
164 outputCol->
push_back(std::move(newElectron));
169 ATH_MSG_DEBUG(
"Size of merged output electron collection " << outputCol->
size());
178 const std::set<const xAOD::Electron *> &ElectronsToRemove)
const
181 if (!electronCol.
empty())
185 for (
const auto *
const electron : electronCol)
188 if (
m_doRemoval && ElectronsToRemove.find(electron) != ElectronsToRemove.end())
195 ATH_MSG_DEBUG(
"Size of transient merged electron collection " << outputCol->size());
Gaudi::Property< bool > m_isDAOD
StatusCode initialize() override
StatusCode execute(const EventContext &ctx) const override
SG::ReadHandleKey< xAOD::ElectronContainer > m_lrtElectronLocation
Standard electron collection to be merged.
Gaudi::Property< bool > m_createViewCollection
Protected data:
Helper class to provide type-safe access to aux data.
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
bool toIndexedElement(BaseConstReference data, index_type elemID, IProxyDict *sg=0)
Set the link to an element given by index and pointer to container.
SG::WriteDecorHandleKey< xAOD::ElectronContainer > m_promptIsLRTKey
Gaudi::Property< bool > m_doRemoval
Create a view to avoid deep copy.
const std::string & key() const
Return the StoreGate ID for the referenced object.
Select isolated Photons, Electrons and Muons.
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Gaudi::Property< int > m_ORstrategy
Delta R threshold for matching in overlap removal.
Helper class to provide type-safe access to aux data.
::StatusCode StatusCode
StatusCode definition for legacy code.
Handle class for adding a decoration to an object.
SG::WriteHandleKey< xAOD::ElectronContainer > m_outElectronLocation
LRT electron collection to be merged.
This module defines the arguments passed from the BATCH driver to the BATCH worker.
ElectronLRTMergingAlg(const std::string &name, ISvcLocator *pSvcLocator)
the standard constructor
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
ElementLink implementation for ROOT usage.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
ToolHandle< CP::IElectronLRTOverlapRemovalTool > m_overlapRemovalTool
Combined electron collection.
SG::WriteDecorHandleKey< xAOD::ElectronContainer > m_lrtIsLRTKey
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
void mergeElectron(const xAOD::ElectronContainer &electronCol, xAOD::ElectronContainer *outputCol, const std::set< const xAOD::Electron * > &LRTElectronsToRemove) const
The lrt electron overlap removal tool.
DataVector adapter that acts like it holds const pointers.
bool setOriginalObjectLink(const IParticle &original, IParticle ©)
This function should be used by CP tools when they make a deep copy of an object in their correctedCo...
SG::ReadHandleKey< xAOD::ElectronContainer > m_promptElectronLocation
Switches method for retrieving electron ID.
size_type size() const noexcept
Returns the number of elements in the collection.
bool empty() const noexcept
Returns true if the collection is empty.