50 return StatusCode::SUCCESS;
56 auto outputViewCol = std::make_unique<ConstDataVector<xAOD::MuonContainer>>(
SG::VIEW_ELEMENTS);
57 auto outputCol = std::make_unique<xAOD::MuonContainer>();
59 std::unique_ptr<xAOD::MuonAuxContainer> outputAuxCol;
61 outputAuxCol = std::make_unique<xAOD::MuonAuxContainer>();
62 outputCol->setStore(outputAuxCol.get());
70 return StatusCode::FAILURE;
74 return StatusCode::FAILURE;
78 std::vector<bool> writePromptMuon;
79 std::vector<bool> writeLRTMuon;
86 for (
const xAOD::Muon* mu : *promptCol) promptIsLRT(*mu) = 0;
87 for (
const xAOD::Muon* mu : *lrtCol) lrtIsLRT(*mu) = 1;
91 outputViewCol->reserve(promptCol->size() + lrtCol->size());
95 outputCol->reserve(promptCol->size() + lrtCol->size());
106 ATH_CHECK(h_write.
record(std::move(outputCol), std::move(outputAuxCol)));
109 return StatusCode::SUCCESS;
118 const std::vector<bool> & writeMuon,
121 if(muonCol.
empty()) {
return StatusCode::SUCCESS;}
125 if (writeMuon.at(
muon->index())){
129 return StatusCode::SUCCESS;
133 const std::vector<bool> & writeMuon,
136 if(muonCol.
empty()) {
return StatusCode::SUCCESS;}
140 if (writeMuon.at(
muon->index())){
144 originalMuonLink(*newMuon) = myLink;
146 static const SG::Accessor <char> isLRT(
"isLRT");
147 isLRT(*newMuon) = isLRT(*
muon);
151 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
DataVector adapter that acts like it holds const pointers.
ServiceHandle< StoreGateSvc > & evtStore()
ToolHandle< CP::IMuonLRTOverlapRemovalTool > m_overlapRemovalTool
MuonLRTMergingAlg(const std::string &name, ISvcLocator *pSvcLocator)
the standard constructor
SG::WriteHandleKey< xAOD::MuonContainer > m_outMuonLocation
Vector of muon collections to be merged.
SG::WriteDecorHandleKey< xAOD::MuonContainer > m_lrtIsLRTKey
StatusCode initialize() override
Gaudi::Property< bool > m_createViewCollection
Combined muon collection.
StatusCode mergeMuon(const xAOD::MuonContainer &muonCol, const std::vector< bool > &muonIsGood, ConstDataVector< xAOD::MuonContainer > *outputCol) const
Private methods:
SG::WriteDecorHandleKey< xAOD::MuonContainer > m_promptIsLRTKey
SG::ReadHandleKey< xAOD::MuonContainer > m_lrtMuonLocation
Vector of muon collections to be merged.
SG::ReadHandleKey< xAOD::MuonContainer > m_promptMuonLocation
Private data:
StatusCode execute(const EventContext &ctx) const override
Gaudi::Property< bool > m_useRun3WP
Gaudi::Property< int > m_ORstrategy
allows to pass an overlap removal strategy to the underlying removal tool, without manually configuri...
DataVector adapter that acts like it holds const pointers.
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.
bool empty() const noexcept
Returns true if the collection is empty.
AnaReentrantAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
constructor with parameters
ElementLink implementation for ROOT usage.
bool toIndexedElement(BaseConstReference data, index_type elemID, IProxyDict *sg=0)
Set the link to an element given by index and pointer to container.
Helper class to provide type-safe access to aux data.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
Handle class for adding a decoration to an object.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
Select isolated Photons, Electrons and Muons.
This module defines the arguments passed from the BATCH driver to the BATCH worker.
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
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...
Muon_v1 Muon
Reference the current persistent version:
MuonContainer_v1 MuonContainer
Definition of the current "Muon container version".