ATLAS Offline Software
METRemappingAlg.h
Go to the documentation of this file.
1 
3 /*
4  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
5  */
6 
7 #ifndef DERIVATIONFRAMEWORK_METREMAPPINGALG_H
8 #define DERIVATIONFRAMEWORK_METREMAPPINGALG_H
9 
10 #include <string>
11 #include <vector>
12 #include <map>
13 
14 #include "Gaudi/Property.h"
15 #include "GaudiKernel/ToolHandle.h"
16 #include "StoreGate/DataHandle.h"
18 #include "AthLinks/ElementLink.h"
19 
20 #include "xAODBase/IParticle.h"
24 #include "xAODMuon/MuonContainer.h"
30 
31 namespace DerivationFramework {
32  class METRemappingAlg : public AthAlgorithm {
33  public:
34  METRemappingAlg(const std::string& name, ISvcLocator* pSvcLocator);
35  virtual ~METRemappingAlg() = default;
36 
37  virtual StatusCode initialize() override;
38  virtual StatusCode execute() override;
39 
40  private:
41  typedef std::map<const xAOD::IParticle*, ElementLink<xAOD::IParticleContainer>> linkMap_t;
42  template<typename handle_t> StatusCode fillLinkMap(linkMap_t &map, handle_t &handle);
43 
44  SG::ReadHandleKey<xAOD::JetContainer> m_jetContKey{this, "JetCollectionKey", "AnalysisJets", "SG key for the analysis jets collection"};
45  SG::ReadHandleKey<xAOD::PhotonContainer> m_photonContKey{this, "PhotonCollectionKey", "AnalysisPhotons", "SG key for the analysis photons collection"};
46  SG::ReadHandleKey<xAOD::ElectronContainer> m_electronContKey{this, "ElectronCollectionKey", "AnalysisElectrons", "SG key for the analysis electrons collection"};
47  SG::ReadHandleKey<xAOD::MuonContainer> m_muonContKey{this, "MuonCollectionKey", "AnalysisMuons", "SG key for the analysis muons collection"};
48  SG::ReadHandleKey<xAOD::TauJetContainer> m_tauContKey{this, "TauCollectionKey", "AnalysisTauJets", "SG key for the analysis tau jets collection"};
49  SG::ReadHandleKey<xAOD::MissingETAssociationMap> m_inputMapKey{this, "AssociationInputKey", "METAssoc_AntiKt4EMPFlow", "SG key for the input MissingETAssociationMap"};
50  SG::ReadHandleKey<xAOD::MissingETContainer> m_inputCoreKey{this, "METCoreInputKey", "MET_Core_AntiKt4EMPFlow", "SG key for the input MET core container"};
51  SG::WriteHandleKey<xAOD::MissingETAssociationMap> m_outputMapKey{this, "AssociationOutputKey", "METAssoc_AnalysisMET", "SG key for the output MissingETAssociationMap"};
52  SG::WriteHandleKey<xAOD::MissingETContainer> m_outputCoreKey{this, "METCoreOutputKey", "MET_Core_AnalysisMET", "SG key for the output MET core container"};
53 
55 
56  }; //> end class METRemappingAlg
57 } //> end namespace DerivationFramework
58 
59 #endif //> !DERIVATIONFRAMEWORK_METREMAPPINGALG_H
DerivationFramework::METRemappingAlg
Definition: METRemappingAlg.h:32
DerivationFramework::METRemappingAlg::m_accOriginalObject
const SG::AuxElement::ConstAccessor< ElementLink< xAOD::IParticleContainer > > m_accOriginalObject
Definition: METRemappingAlg.h:54
IParticle.h
DerivationFramework::METRemappingAlg::linkMap_t
std::map< const xAOD::IParticle *, ElementLink< xAOD::IParticleContainer > > linkMap_t
Definition: METRemappingAlg.h:41
DerivationFramework::METRemappingAlg::m_photonContKey
SG::ReadHandleKey< xAOD::PhotonContainer > m_photonContKey
Definition: METRemappingAlg.h:45
DerivationFramework::METRemappingAlg::initialize
virtual StatusCode initialize() override
Definition: METRemappingAlg.cxx:19
DerivationFramework::METRemappingAlg::fillLinkMap
StatusCode fillLinkMap(linkMap_t &map, handle_t &handle)
Definition: METRemappingAlg.cxx:172
DerivationFramework::METRemappingAlg::~METRemappingAlg
virtual ~METRemappingAlg()=default
SG::ConstAccessor
Helper class to provide constant type-safe access to aux data.
Definition: ConstAccessor.h:55
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition: StoreGate/StoreGate/ReadHandleKey.h:39
DerivationFramework::METRemappingAlg::METRemappingAlg
METRemappingAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: METRemappingAlg.cxx:13
DerivationFramework::METRemappingAlg::m_inputCoreKey
SG::ReadHandleKey< xAOD::MissingETContainer > m_inputCoreKey
Definition: METRemappingAlg.h:50
DerivationFramework::METRemappingAlg::m_muonContKey
SG::ReadHandleKey< xAOD::MuonContainer > m_muonContKey
Definition: METRemappingAlg.h:47
DataHandle.h
DerivationFramework::METRemappingAlg::execute
virtual StatusCode execute() override
Definition: METRemappingAlg.cxx:37
AthAlgorithm.h
SG::WriteHandleKey
Property holding a SG store/key/clid from which a WriteHandle is made.
Definition: StoreGate/StoreGate/WriteHandleKey.h:40
ElectronContainer.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
IParticleContainer.h
MissingETAuxContainer.h
DerivationFramework::METRemappingAlg::m_inputMapKey
SG::ReadHandleKey< xAOD::MissingETAssociationMap > m_inputMapKey
Definition: METRemappingAlg.h:49
DerivationFramework
THE reconstruction tool.
Definition: ParticleSortingAlg.h:24
TauJetContainer.h
DerivationFramework::METRemappingAlg::m_jetContKey
SG::ReadHandleKey< xAOD::JetContainer > m_jetContKey
Definition: METRemappingAlg.h:44
AthAlgorithm
Definition: AthAlgorithm.h:47
DerivationFramework::METRemappingAlg::m_tauContKey
SG::ReadHandleKey< xAOD::TauJetContainer > m_tauContKey
Definition: METRemappingAlg.h:48
DerivationFramework::METRemappingAlg::m_outputMapKey
SG::WriteHandleKey< xAOD::MissingETAssociationMap > m_outputMapKey
Definition: METRemappingAlg.h:51
DerivationFramework::METRemappingAlg::m_electronContKey
SG::ReadHandleKey< xAOD::ElectronContainer > m_electronContKey
Definition: METRemappingAlg.h:46
DerivationFramework::METRemappingAlg::m_outputCoreKey
SG::WriteHandleKey< xAOD::MissingETContainer > m_outputCoreKey
Definition: METRemappingAlg.h:52
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
MissingETAuxAssociationMap.h
MuonContainer.h
MissingETAssociationMap.h
PhotonContainer.h
MissingETContainer.h