ATLAS Offline Software
TestIsolationCloseByCorrAlg.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3  */
4 
5 #ifndef ISOLATIONSELECTION_TESTISOLATIONCLOSEBYCORRATHENAALG_H
6 #define ISOLATIONSELECTION_TESTISOLATIONCLOSEBYCORRATHENAALG_H
7 
8 // Gaudi/Athena include(s):
11 #include "GaudiKernel/SystemOfUnits.h"
15 
16 // Local include(s):
20 
28 #include "xAODMuon/MuonContainer.h"
29 #include "xAODCore/ShallowCopy.h"
30 
40 namespace CP {
42  public:
43  TestIsolationCloseByCorrAlg(const std::string& name, ISvcLocator* svcLoc);
44  virtual ~TestIsolationCloseByCorrAlg() = default;
45  StatusCode initialize() override;
46  StatusCode execute() override;
47  StatusCode finalize() override;
48 
49  unsigned int cardinality() const override { return 1; }
50 
51  private:
52  template <class TARGET_TYPE, class CONT_TYPE, class COPY_TYPE>
53  StatusCode loadContainer(const EventContext& ctx, const SG::ReadHandleKey<CONT_TYPE>& key,
54  std::pair<std::unique_ptr<COPY_TYPE>,
55  std::unique_ptr<xAOD::ShallowAuxContainer>>& cont) const;
56 
57  bool passSelection(const EventContext& ctx, const xAOD::Muon* muon) const;
58  bool passSelection(const EventContext& ctx, const xAOD::Egamma* egamm) const;
59 
61  SG::ReadHandleKey<xAOD::MuonContainer> m_muonKey{this, "MuonContainer", ""};
62  SG::ReadHandleKey<xAOD::EgammaContainer> m_elecKey{this, "EleContainer", ""};
63  SG::ReadHandleKey<xAOD::EgammaContainer> m_photKey{this, "PhotContainer", ""};
65  SG::ReadHandleKey<xAOD::TrackParticleContainer> m_polTrkKey{this, "TrackKey", ""};
66 
67  Gaudi::Property<std::string> m_selDecoration{this, "SelectionDecorator", "",
68  "Optional char decorator flag that the leptons have to pass in order to be selected"};
69 
70  Gaudi::Property<std::string> m_isoDecoration{this, "IsolationDecorator", "", "Decoration of the first isolation selection pass."};
71  Gaudi::Property<std::string> m_updatedIsoDeco{this, "UpdatedIsoDecorator", "", "Decoration of the first isolation selection pass."};
72  Gaudi::Property<std::string> m_backup_prefix{
73  this, "BackupPrefix", "", "Prefix in front of the isolation variables, if the original cone values need to be backuped"};
74 
75  SelectionDecorator m_selDecorator{nullptr};
76  SelectionDecorator m_isoDecorator{nullptr};
77 
79  ToolHandle<CP::IMuonSelectionTool> m_muonSelTool{this, "MuonSelectionTool", ""};
80  ToolHandle<IAsgElectronLikelihoodTool> m_elecSelTool{this, "ElectronSelectionTool", ""};
81  ToolHandle<IAsgPhotonIsEMSelector> m_photSelTool{this, "PhotonSelectionTool", ""};
82 
83  const CP::IsolationCloseByCorrectionTool* correction_tool() const;
84 
85  ToolHandle<CP::IIsolationCloseByCorrectionTool> m_isoCloseByCorrTool{this, "IsoCloseByCorrTool", ""};
86  ToolHandle<CP::IIsolationSelectionTool> m_isoSelectorTool{this, "IsolationSelectionTool", ""};
87 
88  MuonVal::MuonTesterTree m_tree{"IsoCorrTest", "/ISOCORRECTION"};
89  std::shared_ptr<IsoCorrectionTestHelper> m_ele_helper{nullptr};
90  std::shared_ptr<IsoCorrectionTestHelper> m_muo_helper{nullptr};
91  std::shared_ptr<IsoCorrectionTestHelper> m_pho_helper{nullptr};
92 
93  Gaudi::Property<float> m_mu_min_pt{this, "MuonPt", 5 * Gaudi::Units::GeV};
94  Gaudi::Property<float> m_mu_max_eta{this, "MuonEta", 2.7};
95  Gaudi::Property<float> m_el_min_pt{this, "ElectronPt", 7. * Gaudi::Units::GeV};
96  Gaudi::Property<float> m_el_max_eta{this, "ElectronEta", 2.47};
97  Gaudi::Property<float> m_ph_min_pt{this, "PhotonPt", 25. * Gaudi::Units::GeV};
98  Gaudi::Property<float> m_ph_max_eta{this, "PhotonEta", 2.35};
99 
100  Gaudi::Property<bool> m_isMC{this, "isMC", false};
101  };
102 
103 } // namespace CP
104 #endif
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
ShallowCopy.h
xAOD::muon
@ muon
Definition: TrackingPrimitives.h:195
python.tests.PyTestsLib.finalize
def finalize(self)
_info( "content of StoreGate..." ) self.sg.dump()
Definition: PyTestsLib.py:53
ReadDecorHandleKey.h
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
IAsgPhotonIsEMSelector.h
ATLAS_NOT_THREAD_SAFE
#define ATLAS_NOT_THREAD_SAFE
getNoisyStrip() Find noisy strips from hitmaps and write out into xml/db formats
Definition: checker_macros.h:212
IIsolationCloseByCorrectionTool.h
initialize
void initialize()
Definition: run_EoverP.cxx:894
CP::TestIsolationCloseByCorrAlg::cardinality
unsigned int cardinality() const override
Definition: TestIsolationCloseByCorrAlg.h:49
MuonTesterTreeDict.h
xAOD::Egamma_v1
Definition: Egamma_v1.h:56
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition: StoreGate/StoreGate/ReadHandleKey.h:39
CP
Select isolated Photons, Electrons and Muons.
Definition: Control/xAODRootAccess/xAODRootAccess/TEvent.h:48
xAOD::Muon_v1
Class describing a Muon.
Definition: Muon_v1.h:38
AthHistogramAlgorithm.h
LArG4FSStartPointFilterLegacy.execute
execute
Definition: LArG4FSStartPointFilterLegacy.py:20
EgammaContainer.h
IMuonSelectionTool.h
IAsgElectronLikelihoodTool.h
MuonVal::MuonTesterTree
Definition: MuonTesterTree.h:30
ElectronContainer.h
CP::IsolationCloseByCorrectionTool
Definition: IsolationCloseByCorrectionTool.h:37
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthHistogramAlgorithm
Definition: AthHistogramAlgorithm.h:32
TestMacroHelpers.h
CP::TestIsolationCloseByCorrAlg
Definition: TestIsolationCloseByCorrAlg.h:41
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
IIsolationSelectionTool.h
EventInfo.h
MuonContainer.h
CP::TestIsolationCloseByCorrAlg::~TestIsolationCloseByCorrAlg
virtual ~TestIsolationCloseByCorrAlg()=default
checker_macros.h
Define macros for attributes used to control the static checker.
GeV
#define GeV
Definition: CaloTransverseBalanceVecMon.cxx:30
PhotonContainer.h
CP::SelectionDecorator
std::unique_ptr< CharDecorator > SelectionDecorator
Definition: PhysicsAnalysis/AnalysisCommon/IsolationSelection/IsolationSelection/Defs.h:25
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37