Loading [MathJax]/extensions/tex2jax.js
|
ATLAS Offline Software
|
Go to the documentation of this file.
22 :
EL::AnaAlgorithm(
name, svcLoc)
48 return StatusCode::SUCCESS;
55 const EventContext &ctx = Gaudi::Hive::currentContext();
58 std::unique_ptr<ConstDataVector<xAOD::ElectronContainer>> transientContainer = std::make_unique<ConstDataVector<xAOD::ElectronContainer>>(
SG::VIEW_ELEMENTS);
59 std::unique_ptr<xAOD::ElectronContainer> outputCol = std::make_unique<xAOD::ElectronContainer>();
62 std::unique_ptr<xAOD::ElectronAuxContainer> outputAuxCol;
67 outputAuxCol = std::make_unique<xAOD::ElectronAuxContainer>();
68 outputCol->setStore(outputAuxCol.get());
77 return StatusCode::FAILURE;
82 return StatusCode::FAILURE;
86 std::set<const xAOD::Electron *> ElectronsToRemove;
89 ATH_MSG_DEBUG(
"Size of overlapping electrons to remove: " << ElectronsToRemove.size());
101 transientContainer->reserve(promptCol->size() + lrtCol->size());
103 mergeElectron(*promptCol, transientContainer.get(), ElectronsToRemove);
104 mergeElectron(*lrtCol, transientContainer.get(), ElectronsToRemove);
108 outputCol->reserve(promptCol->size() + lrtCol->size());
110 mergeElectron(*promptCol, outputCol.get(), ElectronsToRemove);
121 ATH_CHECK(h_write.
record(std::move(outputCol), std::move(outputAuxCol)));
126 return StatusCode::SUCCESS;
134 const std::set<const xAOD::Electron *> &ElectronsToRemove)
const
137 if (!electronCol.
empty())
144 for (
const auto *
const electron : electronCol)
151 std::unique_ptr<xAOD::Electron> newElectron = std::make_unique<xAOD::Electron>(*
electron);
154 originalElectronLink(*newElectron) = eLink;
156 outputCol->
push_back(std::move(newElectron));
159 ATH_MSG_DEBUG(
"Size of merged output electron collection " << outputCol->
size());
168 const std::set<const xAOD::Electron *> &ElectronsToRemove)
const
171 if (!electronCol.
empty())
175 for (
const auto *
const electron : electronCol)
185 ATH_MSG_DEBUG(
"Size of transient merged electron collection " << outputCol->size());
Gaudi::Property< bool > m_isDAOD
StatusCode initialize() override
SG::ReadHandleKey< xAOD::ElectronContainer > m_lrtElectronLocation
Standard electron collection to be merged.
Gaudi::Property< bool > m_createViewCollection
Protected 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.
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.
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.
StatusCode execute() override
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.
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.