ATLAS Offline Software
IsoCloseByCorrectionTrkSelAlg.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef IsoCloseByCorrectionTrkSelAlg_H
6 #define IsoCloseByCorrectionTrkSelAlg_H
7 
8 // Gaudi & Athena basics
14 #include "GaudiKernel/SystemOfUnits.h"
25 #include "xAODMuon/MuonContainer.h"
32 namespace CP {
33 
35  public:
36  IsoCloseByCorrectionTrkSelAlg(const std::string& name, ISvcLocator* svcLoc);
37 
38  StatusCode execute(const EventContext& ctx) const override;
39  StatusCode initialize() override;
40  StatusCode finalize() override;
41 
42  private:
43  bool passSelection(const EventContext& ctx, const xAOD::Electron* elec) const;
44  bool passSelection(const EventContext& ctx, const xAOD::Photon* phot) const;
45  bool passSelection(const EventContext& ctx, const xAOD::Muon* muon) const;
46  using LepContainer = std::set<const xAOD::IParticle*>;
47  template <class CONT_TYPE>
48  StatusCode loadTracks(const EventContext& ctx, const SG::ReadHandleKey<CONT_TYPE>& key, TrackSet& tracks,
49  LepContainer& prim_objs) const;
50 
52  SG::ReadHandleKey<xAOD::MuonContainer> m_muonKey{this, "MuonContainer", "Muons"};
53  SG::ReadHandleKey<xAOD::ElectronContainer> m_elecKey{this, "EleContainer", "Electrons"};
54  SG::ReadHandleKey<xAOD::PhotonContainer> m_photKey{this, "PhotContainer", "Photons"};
55 
57  Gaudi::Property<std::string> m_selDecoration{this, "SelectionDecorator", "",
58  "Optional char decorator flag that the leptons have to pass in order to be selected"};
65  ToolHandle<CP::IMuonSelectionTool> m_muonSelTool{this, "MuonSelectionTool", ""};
66  ToolHandle<IAsgElectronLikelihoodTool> m_elecSelTool{this, "ElectronSelectionTool", ""};
67  ToolHandle<IAsgPhotonIsEMSelector> m_photSelTool{this, "PhotonSelectionTool", ""};
68 
70  ToolHandle<CP::IIsolationCloseByCorrectionTool> m_closeByCorrTool{this, "IsoCloseByCorrectionTool", "",
71  "The isolation close by correction tool."};
72 
74  Gaudi::Property<float> m_minElecPt{this, "MinElecPt", 4.5 * Gaudi::Units::GeV,
75  "Minimum pt cut that the electron needs to pass in order to be selected"};
76  Gaudi::Property<float> m_minMuonPt{this, "MinMuonPt", 3. * Gaudi::Units::GeV,
77  "Minimum pt cut that the muon needs to pass in order to be selected"};
78  Gaudi::Property<float> m_minPhotPt{this, "MinPhotPt", 25. * Gaudi::Units::GeV,
79  "Minimum pt cut that the photon needs to pass in order to be selected"};
80 
81  Gaudi::Property<float> m_maxConeSize{this, "ConeSize", 0.3};
82 
84  Gaudi::Property<std::string> m_stream{this, "OutputStream", "", "Stream"};
85  SG::ThinningHandleKey<xAOD::TrackParticleContainer> m_thinKey{this, "ThinninKey", "InDetTrackParticles",
86  "Apply the thinning decision to. Decision is set to OR"};
89  "The associated track particles can be written to an outpt container"};
90 
93  mutable std::array<std::atomic<Long64_t>, 3> m_accepted_trks ATLAS_THREAD_SAFE;
94  mutable std::array<std::atomic<Long64_t>, 3> m_selected_obj ATLAS_THREAD_SAFE;
96  mutable std::atomic<Long64_t> m_tot_trks{};
97  };
98 } // namespace CP
99 #endif
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
CP::IsoCloseByCorrectionTrkSelAlg::ATLAS_THREAD_SAFE
std::array< std::atomic< Long64_t >, 3 > m_selected_obj ATLAS_THREAD_SAFE
Definition: IsoCloseByCorrectionTrkSelAlg.h:94
xAOD::muon
@ muon
Definition: TrackingPrimitives.h:195
ReadDecorHandleKey.h
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
CP::IsoCloseByCorrectionTrkSelAlg::finalize
StatusCode finalize() override
Definition: IsoCloseByCorrectionTrkSelAlg.cxx:54
CP::IsoCloseByCorrectionTrkSelAlg::m_photSelTool
ToolHandle< IAsgPhotonIsEMSelector > m_photSelTool
Definition: IsoCloseByCorrectionTrkSelAlg.h:67
CP::IsoCloseByCorrectionTrkSelAlg::m_photKey
SG::ReadHandleKey< xAOD::PhotonContainer > m_photKey
Definition: IsoCloseByCorrectionTrkSelAlg.h:54
IAsgPhotonIsEMSelector.h
CP::IsoCloseByCorrectionTrkSelAlg::m_minMuonPt
Gaudi::Property< float > m_minMuonPt
Definition: IsoCloseByCorrectionTrkSelAlg.h:76
CP::IsoCloseByCorrectionTrkSelAlg::m_closeByCorrTool
ToolHandle< CP::IIsolationCloseByCorrectionTool > m_closeByCorrTool
These tools shall be configured to pick up the same Inner detector tracks as for the isolation buildi...
Definition: IsoCloseByCorrectionTrkSelAlg.h:70
SG::ThinningHandleKey
HandleKey object for adding thinning to an object.
Definition: ThinningHandleKey.h:38
IIsolationCloseByCorrectionTool.h
ConstDataVector.h
DataVector adapter that acts like it holds const pointers.
CP::IsoCloseByCorrectionTrkSelAlg::m_elecSelKey
SG::ReadDecorHandleKey< xAOD::ElectronContainer > m_elecSelKey
Definition: IsoCloseByCorrectionTrkSelAlg.h:62
CP::IsoCloseByCorrectionTrkSelAlg::m_thinKey
SG::ThinningHandleKey< xAOD::TrackParticleContainer > m_thinKey
Definition: IsoCloseByCorrectionTrkSelAlg.h:85
CP::TrackSet
std::set< TrackPtr > TrackSet
Definition: PhysicsAnalysis/AnalysisCommon/IsolationSelection/IsolationSelection/Defs.h:72
CP::IsoCloseByCorrectionTrkSelAlg::m_tot_trks
std::atomic< Long64_t > m_tot_trks
Total track counter.
Definition: IsoCloseByCorrectionTrkSelAlg.h:96
CP::IsoCloseByCorrectionTrkSelAlg::m_stream
Gaudi::Property< std::string > m_stream
Output stream to be used for the thinning decision.
Definition: IsoCloseByCorrectionTrkSelAlg.h:84
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
CP::IsoCloseByCorrectionTrkSelAlg::m_muonSelTool
ToolHandle< CP::IMuonSelectionTool > m_muonSelTool
Optionally the user can also parse the elec / muon / photon selection tools.
Definition: IsoCloseByCorrectionTrkSelAlg.h:65
xAOD::Muon_v1
Class describing a Muon.
Definition: Muon_v1.h:38
CP::IsoCloseByCorrectionTrkSelAlg::m_elecSelTool
ToolHandle< IAsgElectronLikelihoodTool > m_elecSelTool
Definition: IsoCloseByCorrectionTrkSelAlg.h:66
CP::IsoCloseByCorrectionTrkSelAlg::initialize
StatusCode initialize() override
Definition: IsoCloseByCorrectionTrkSelAlg.cxx:23
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
CP::IsoCloseByCorrectionTrkSelAlg::LepContainer
std::set< const xAOD::IParticle * > LepContainer
Definition: IsoCloseByCorrectionTrkSelAlg.h:46
IMuonSelectionTool.h
CP::IsoCloseByCorrectionTrkSelAlg::m_muonKey
SG::ReadHandleKey< xAOD::MuonContainer > m_muonKey
Input containers to retrieve from the storegate.
Definition: IsoCloseByCorrectionTrkSelAlg.h:52
IAsgElectronLikelihoodTool.h
SG::WriteHandleKey
Property holding a SG store/key/clid from which a WriteHandle is made.
Definition: StoreGate/StoreGate/WriteHandleKey.h:40
CP::IsoCloseByCorrectionTrkSelAlg
Definition: IsoCloseByCorrectionTrkSelAlg.h:34
WriteDecorHandleKey.h
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
ElectronContainer.h
CP::IsoCloseByCorrectionTrkSelAlg::execute
StatusCode execute(const EventContext &ctx) const override
Definition: IsoCloseByCorrectionTrkSelAlg.cxx:68
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
CP::IsoCloseByCorrectionTrkSelAlg::passSelection
bool passSelection(const EventContext &ctx, const xAOD::Electron *elec) const
Definition: IsoCloseByCorrectionTrkSelAlg.cxx:156
IInDetTrackSelectionTool.h
CP::IsoCloseByCorrectionTrkSelAlg::ATLAS_THREAD_SAFE
std::array< std::atomic< Long64_t >, 3 > m_accepted_trks ATLAS_THREAD_SAFE
Array counting the number of accepted tracks per object type muon[0], electron[1],...
Definition: IsoCloseByCorrectionTrkSelAlg.h:93
AthReentrantAlgorithm.h
WriteHandleKey.h
Property holding a SG store/key/clid from which a WriteHandle is made.
CP::IsoCloseByCorrectionTrkSelAlg::IsoCloseByCorrectionTrkSelAlg
IsoCloseByCorrectionTrkSelAlg(const std::string &name, ISvcLocator *svcLoc)
Definition: IsoCloseByCorrectionTrkSelAlg.cxx:21
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
CP::IsoCloseByCorrectionTrkSelAlg::loadTracks
StatusCode loadTracks(const EventContext &ctx, const SG::ReadHandleKey< CONT_TYPE > &key, TrackSet &tracks, LepContainer &prim_objs) const
Definition: IsoCloseByCorrectionTrkSelAlg.cxx:136
CP::IsoCloseByCorrectionTrkSelAlg::m_trkKey
SG::WriteHandleKey< ConstDataVector< xAOD::TrackParticleContainer > > m_trkKey
Optionally the user can also dump a TrackParticleContainer containing all the tracks entring the cone...
Definition: IsoCloseByCorrectionTrkSelAlg.h:88
xAOD::Electron_v1
Definition: Electron_v1.h:34
CP::IsoCloseByCorrectionTrkSelAlg::m_photSelKey
SG::ReadDecorHandleKey< xAOD::PhotonContainer > m_photSelKey
Definition: IsoCloseByCorrectionTrkSelAlg.h:63
MuonContainer.h
CP::IsoCloseByCorrectionTrkSelAlg::m_elecKey
SG::ReadHandleKey< xAOD::ElectronContainer > m_elecKey
Definition: IsoCloseByCorrectionTrkSelAlg.h:53
CP::IsoCloseByCorrectionTrkSelAlg::m_minPhotPt
Gaudi::Property< float > m_minPhotPt
Definition: IsoCloseByCorrectionTrkSelAlg.h:78
xAOD::Photon_v1
Definition: Photon_v1.h:37
CP::IsoCloseByCorrectionTrkSelAlg::m_minElecPt
Gaudi::Property< float > m_minElecPt
Kinematic cuts. The selection tools do not support kinematic cut selection unfortunately.
Definition: IsoCloseByCorrectionTrkSelAlg.h:74
ThinningHandleKey.h
HandleKey object for adding thinning to an object.
CP::IsoCloseByCorrectionTrkSelAlg::m_mounSelKey
SG::ReadDecorHandleKey< xAOD::MuonContainer > m_mounSelKey
The keys serve to declare the data dependency on the optional selection decorator properly.
Definition: IsoCloseByCorrectionTrkSelAlg.h:61
SG::ReadDecorHandleKey
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
Definition: StoreGate/StoreGate/ReadDecorHandleKey.h:85
checker_macros.h
Define macros for attributes used to control the static checker.
CP::IsoCloseByCorrectionTrkSelAlg::m_selDecoration
Gaudi::Property< std::string > m_selDecoration
External selection criteria.
Definition: IsoCloseByCorrectionTrkSelAlg.h:57
GeV
#define GeV
Definition: CaloTransverseBalanceVecMon.cxx:30
CP::IsoCloseByCorrectionTrkSelAlg::m_maxConeSize
Gaudi::Property< float > m_maxConeSize
Definition: IsoCloseByCorrectionTrkSelAlg.h:81
PhotonContainer.h
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37