ATLAS Offline Software
TauAODLeptonRemovalTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
9 #ifndef TAURECTOOLS_TAUAODLEPTONREMOVALTOOL_H
10 #define TAURECTOOLS_TAUAODLEPTONREMOVALTOOL_H
11 
13 #include "xAODTau/TauJet.h"
14 #include "xAODMuon/MuonContainer.h"
19 
21 {
22  public:
24  TauAODLeptonRemovalTool(const std::string& type);
25  virtual StatusCode initialize() override;
26  virtual StatusCode execute(xAOD::TauJet&) const override;
27  private:
28  const std::map<std::string, uint> m_mapMuonIdWp = {{"Tight", 0}, {"Medium", 1}, {"Loose", 2}, {"VeryLoose",3}};
29  std::string m_elecWpStr = "DFCommonElectronsLHMedium";
31  SG::ReadHandleKey<xAOD::MuonContainer> m_muonInputContainer{this, "Key_MuonInputContainer", "Muons", "input xAOD muons"};
32  SG::ReadHandleKey<xAOD::ElectronContainer> m_elecInputContainer{this, "Key_ElecInputContainer", "Electrons", "input xAOD electrons"};
33  //properties
34  Gaudi::Property<bool> m_doMuonTrkRm {this, "doMuonTrkRm", false, "Whether to remove the muon tracks from the tau candidate" };
35  Gaudi::Property<bool> m_doElecTrkRm {this, "doElecTrkRm", false, "Whether to remove the electron tracks from the tau candidate" };
36  Gaudi::Property<bool> m_doMuonClsRm {this, "doMuonClsRm", false, "Whether to remove the muon clusters from the tau candidate" };
37  Gaudi::Property<bool> m_doElecClsRm {this, "doElecClsRm", false, "Whether to remove the electron clusters from the tau candidate" };
38  Gaudi::Property<std::string> m_strMinElecIdWp {this, "elecIDWP", "Medium", "minimum electron identification WP, [VeryLoose, Loose, Medium, Tight]"};
39  Gaudi::Property<std::string> m_strMinMuonIdWp {this, "muonIDWP", "Medium", "minimum muon identification WP, [VeryLoose, Loose, Medium, Tight]" };
40  Gaudi::Property<std::string> m_strElecIdWpPrefix {this, "eleIDWPPrefix", "DFCommonElectronsLH", "The prefix of the electron ID WP, leave to default if in confusion" };
41  Gaudi::Property<double> m_lepRemovalConeSize{this, "lepRemovalConeSize", 0.6, "The maximum dR between the lepton and the tau" };
42  //helpers
43  std::vector<const xAOD::CaloCluster*> getOrignalTopoClusters (const xAOD::CaloCluster *cluster) const;
45  std::vector<std::pair<const xAOD::TrackParticle*, const xAOD::Electron*>> getElecAndTrk(const xAOD::TauJet& tau, const xAOD::ElectronContainer& elec_cont) const;
46  std::vector<std::pair<const xAOD::CaloCluster*, const xAOD::Electron*>> getElecAndCls(const xAOD::TauJet& tau, const xAOD::ElectronContainer& elec_cont) const;
47  std::vector<std::pair<const xAOD::TrackParticle*, const xAOD::Muon*>> getMuonAndTrk(const xAOD::TauJet& tau, const xAOD::MuonContainer& muon_cont) const;
48  std::vector<std::pair<const xAOD::CaloCluster*, const xAOD::Muon*>> getMuonAndCls(const xAOD::TauJet& tau, const xAOD::MuonContainer& muon_cont) const;
49  template<typename Tlep, typename Tlinks> std::vector<Tlep> removeTrks(Tlinks& tau_trk_links, std::vector<std::pair<const xAOD::TrackParticle*, Tlep>>& removings) const;
50  template<typename Tlep, typename Tlinks> std::vector<Tlep> removeClss(Tlinks& tau_cls_links, std::vector<std::pair<const xAOD::CaloCluster*, Tlep>>& clusters_and_leps) const;
51 };
52 
53 #endif// TAURECTOOLS_TAUAODLEPTONREMOVALTOOL_H
TauAODLeptonRemovalTool::getOrignalTopoClusters
std::vector< const xAOD::CaloCluster * > getOrignalTopoClusters(const xAOD::CaloCluster *cluster) const
Definition: TauAODLeptonRemovalTool.cxx:86
TauAODLeptonRemovalTool::m_muonWpUi
uint m_muonWpUi
Definition: TauAODLeptonRemovalTool.h:30
PropertyWrapper.h
TauAODLeptonRemovalTool::execute
virtual StatusCode execute(xAOD::TauJet &) const override
Execute - called for each tau candidate.
Definition: TauAODLeptonRemovalTool.cxx:19
ASG_TOOL_CLASS2
#define ASG_TOOL_CLASS2(CLASSNAME, INT1, INT2)
Definition: AsgToolMacros.h:77
TauRecToolBase.h
TauRecToolBase
The base class for all tau tools.
Definition: TauRecToolBase.h:21
TauAODLeptonRemovalTool::m_muonInputContainer
SG::ReadHandleKey< xAOD::MuonContainer > m_muonInputContainer
Definition: TauAODLeptonRemovalTool.h:31
TauAODLeptonRemovalTool::removeTrks
std::vector< Tlep > removeTrks(Tlinks &tau_trk_links, std::vector< std::pair< const xAOD::TrackParticle *, Tlep >> &removings) const
Definition: TauAODLeptonRemovalTool.cxx:188
TauAODLeptonRemovalTool::initialize
virtual StatusCode initialize() override
Tool initializer.
Definition: TauAODLeptonRemovalTool.cxx:11
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition: StoreGate/StoreGate/ReadHandleKey.h:39
TauAODLeptonRemovalTool::m_elecWpStr
std::string m_elecWpStr
Definition: TauAODLeptonRemovalTool.h:29
TauAODLeptonRemovalTool::m_elecInputContainer
SG::ReadHandleKey< xAOD::ElectronContainer > m_elecInputContainer
Definition: TauAODLeptonRemovalTool.h:32
TauAODLeptonRemovalTool::getOrignalTrackParticle
const xAOD::TrackParticle * getOrignalTrackParticle(const xAOD::TrackParticle *trk) const
Definition: TauAODLeptonRemovalTool.cxx:101
uint
unsigned int uint
Definition: LArOFPhaseFill.cxx:20
xAOD::CaloCluster_v1
Description of a calorimeter cluster.
Definition: CaloCluster_v1.h:59
TauAODLeptonRemovalTool::m_doMuonClsRm
Gaudi::Property< bool > m_doMuonClsRm
Definition: TauAODLeptonRemovalTool.h:36
ElectronContainer.h
TauAODLeptonRemovalTool::getMuonAndTrk
std::vector< std::pair< const xAOD::TrackParticle *, const xAOD::Muon * > > getMuonAndTrk(const xAOD::TauJet &tau, const xAOD::MuonContainer &muon_cont) const
Definition: TauAODLeptonRemovalTool.cxx:152
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
xAOD::TauJet_v3
Class describing a tau jet.
Definition: TauJet_v3.h:41
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
TauAODLeptonRemovalTool::getMuonAndCls
std::vector< std::pair< const xAOD::CaloCluster *, const xAOD::Muon * > > getMuonAndCls(const xAOD::TauJet &tau, const xAOD::MuonContainer &muon_cont) const
Definition: TauAODLeptonRemovalTool.cxx:165
TauAODLeptonRemovalTool::m_strElecIdWpPrefix
Gaudi::Property< std::string > m_strElecIdWpPrefix
Definition: TauAODLeptonRemovalTool.h:40
ReadHandle.h
Handle class for reading from StoreGate.
ITauToolBase
The base class for all tau tools.
Definition: ITauToolBase.h:30
MuonContainer.h
TauAODLeptonRemovalTool::m_doElecTrkRm
Gaudi::Property< bool > m_doElecTrkRm
Definition: TauAODLeptonRemovalTool.h:35
TauAODLeptonRemovalTool::getElecAndTrk
std::vector< std::pair< const xAOD::TrackParticle *, const xAOD::Electron * > > getElecAndTrk(const xAOD::TauJet &tau, const xAOD::ElectronContainer &elec_cont) const
Definition: TauAODLeptonRemovalTool.cxx:114
TauAODLeptonRemovalTool::removeClss
std::vector< Tlep > removeClss(Tlinks &tau_cls_links, std::vector< std::pair< const xAOD::CaloCluster *, Tlep >> &clusters_and_leps) const
Definition: TauAODLeptonRemovalTool.cxx:212
TauAODLeptonRemovalTool::m_mapMuonIdWp
const std::map< std::string, uint > m_mapMuonIdWp
Definition: TauAODLeptonRemovalTool.h:28
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
TauJet.h
TauAODLeptonRemovalTool::m_doElecClsRm
Gaudi::Property< bool > m_doElecClsRm
Definition: TauAODLeptonRemovalTool.h:37
TauAODLeptonRemovalTool::m_lepRemovalConeSize
Gaudi::Property< double > m_lepRemovalConeSize
Definition: TauAODLeptonRemovalTool.h:41
TauAODLeptonRemovalTool::m_strMinElecIdWp
Gaudi::Property< std::string > m_strMinElecIdWp
Definition: TauAODLeptonRemovalTool.h:38
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
TauAODLeptonRemovalTool::getElecAndCls
std::vector< std::pair< const xAOD::CaloCluster *, const xAOD::Electron * > > getElecAndCls(const xAOD::TauJet &tau, const xAOD::ElectronContainer &elec_cont) const
Definition: TauAODLeptonRemovalTool.cxx:132
TauAODLeptonRemovalTool::m_strMinMuonIdWp
Gaudi::Property< std::string > m_strMinMuonIdWp
Definition: TauAODLeptonRemovalTool.h:39
TauAODLeptonRemovalTool::TauAODLeptonRemovalTool
TauAODLeptonRemovalTool(const std::string &type)
Definition: TauAODLeptonRemovalTool.cxx:7
TauAODLeptonRemovalTool::m_doMuonTrkRm
Gaudi::Property< bool > m_doMuonTrkRm
Definition: TauAODLeptonRemovalTool.h:34
TauAODLeptonRemovalTool
the tool meant to run at AOD level, to remove the lepton found inside the TauJet.
Definition: TauAODLeptonRemovalTool.h:21