ATLAS Offline Software
DecoratePLIT.h
Go to the documentation of this file.
1 // This is -*- c++ -*-
2 
3 /*
4  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 #ifndef PROMPT_DECORATEPLIT_H
8 #define PROMPT_DECORATEPLIT_H
9 
10 // Local
12 
13 // Tools
16 
17 // Athena
20 #include "GaudiKernel/ToolHandle.h"
23 
24 // xAOD
26 #include "xAODMuon/MuonContainer.h"
27 
28 
29 namespace Prompt {
30 
31  // Definition of the 4-momentum type
32  typedef TLorentzVector FourMom_t;
33 
35 
36  public:
37  DecoratePLIT(const std::string &name, ISvcLocator *pSvcLocator);
38 
39  virtual StatusCode initialize() override;
40  virtual StatusCode execute (const EventContext&) const override;
41 
42  private:
43  std::shared_ptr<const FlavorTagInference::SaltModel> m_saltModel{};
44  std::shared_ptr<const FlavorTagInference::SaltModel> m_saltModel_endcap{};
45 
48 
50 
55  const xAOD::Electron &electron,
56  const xAOD::TrackParticleContainer &tracks,
57  const xAOD::CaloClusterContainer &caloclusters,
58  std::vector<SG::WriteDecorHandle<xAOD::ElectronContainer, float>> &dec_el_plit_output,
59  const EventContext& ctx) const;
60 
65  const xAOD::Muon &muon,
66  const xAOD::TrackParticleContainer &tracks,
67  std::vector<SG::WriteDecorHandle<xAOD::MuonContainer, float>> &dec_mu_plit_output,
68  const EventContext& ctx) const;
69 
70  bool passed_r22tracking_cuts(const xAOD::TrackParticle &tp, const EventContext& ctx) const;
71 
77  float dr_lepton,
78  bool isUsedForElectron,
79  bool isUsedForMuon,
80  const xAOD::TrackParticle* trackLep) const;
81 
86  std::vector<const xAOD::IParticle *> &parts,
87  const xAOD::IParticle &lepton,
88  const xAOD::TrackParticle *trackLep,
90  const EventContext& ctx) const;
91 
92  // Properties:
93  Gaudi::Property<std::string> m_leptonsName {
94  this, "LeptonContainerName", "",
95  "Container's name of the lepton that you want to decorate. Also need to set ElectronContainerKey or MuonContainerKey accordingly"
96  };
97  Gaudi::Property<std::string> m_configPath {this, "ConfigPath", "", "Path of the directory containing the onnx files"};
98  Gaudi::Property<std::string> m_configFileVersion {this, "ConfigFileVersion", "", "Vector of tagger score files"};
99  Gaudi::Property<std::string> m_configFileVersion_endcap {this, "ConfigFileVersion_endcap", "", "Vector of tagger score files for endcap"};
100  Gaudi::Property<std::string> m_TaggerName {this, "TaggerName", "", "Tagger name"};
101  Gaudi::Property<float> m_maxLepTrackdR{
102  this, "maxLepTrackdR", 0.4, "Maximum distance between lepton and track"};
103  Gaudi::Property<float> m_lepCalErelConeSize{
104  this, "lepCalErelConeSize", 0.15, "Cone size for relative calo cluster energy sum"};
105  Gaudi::Property<std::string> m_btagIp_prefix{
106  this, "btagIp_prefix", "btagIp_", "Prefix of b-tagging impact parameter variables (w.r.t. primary vertex)"};
107 
108  // Read/write handles
110  this, "ElectronContainerKey", "Electrons",
111  "Electron container name"
112  };
114  this, "MuonContainerKey", "Muons",
115  "Muon container name"
116  };
118  this, "TrackJetContainerKey", "AntiKtVR30Rmax4Rmin02PV0TrackJets",
119  "VR track jet container name"
120  };
122  this, "TracksContainerKey", "InDetTrackParticles",
123  "Tracks container name"
124  };
126  this, "CaloClusterContainerKey", "egammaClusters",
127  "Calo cluster container name"
128  };
129 
130  // Accessor declarations
131  SG::ReadDecorHandleKey<xAOD::MuonContainer> m_acc_mu_ptvarcone30TTVA {this, "acc_mu_ptvarcone30TTVA",m_muonsKey, "ptvarcone30_Nonprompt_All_MaxWeightTTVA_pt500"};
132  SG::ReadDecorHandleKey<xAOD::MuonContainer> m_acc_mu_topoetcone30 {this, "acc_mu_topoetcone30",m_muonsKey, "topoetcone30"};
133 
136 
145 
148 
153 
154  };
155 }
156 
157 #endif
SaltModel.h
Prompt::DecoratePLIT::m_num_lepton_features
int m_num_lepton_features
Definition: DecoratePLIT.h:46
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer >
xAOD::muon
@ muon
Definition: TrackingPrimitives.h:196
Prompt::DecoratePLIT::m_acc_trk_z0SinTheta
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_acc_trk_z0SinTheta
Definition: DecoratePLIT.h:140
Prompt
Definition: DecoratePLIT.h:29
Prompt::DecoratePLIT::m_dec_trk_dr_lepton
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_dec_trk_dr_lepton
Definition: DecoratePLIT.h:149
Prompt::DecoratePLIT::DecoratePLIT
DecoratePLIT(const std::string &name, ISvcLocator *pSvcLocator)
Definition: DecoratePLIT.cxx:15
Prompt::DecoratePLIT::m_caloclustersKey
SG::ReadHandleKey< xAOD::CaloClusterContainer > m_caloclustersKey
Definition: DecoratePLIT.h:125
Prompt::DecoratePLIT::initialize
virtual StatusCode initialize() override
Definition: DecoratePLIT.cxx:19
Prompt::DecoratePLIT::m_electronsKey
SG::ReadHandleKey< xAOD::ElectronContainer > m_electronsKey
Definition: DecoratePLIT.h:109
Prompt::DecoratePLIT::m_configFileVersion_endcap
Gaudi::Property< std::string > m_configFileVersion_endcap
Definition: DecoratePLIT.h:99
ParticleTest.tp
tp
Definition: ParticleTest.py:25
SG::HandleKeyArray
Definition: StoreGate/StoreGate/HandleKeyArray.h:45
Prompt::DecoratePLIT::execute
virtual StatusCode execute(const EventContext &) const override
Definition: DecoratePLIT.cxx:116
Prompt::DecoratePLIT::m_dec_mu_plit_output
SG::WriteDecorHandleKeyArray< xAOD::MuonContainer > m_dec_mu_plit_output
Definition: DecoratePLIT.h:147
SG::ReadHandleKey< xAOD::ElectronContainer >
Prompt::DecoratePLIT::m_acc_trk_z0SinThetaUncertainty
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_acc_trk_z0SinThetaUncertainty
Definition: DecoratePLIT.h:142
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition: Event/xAOD/xAODBase/xAODBase/IParticle.h:41
xAOD::Muon_v1
Class describing a Muon.
Definition: Muon_v1.h:38
Prompt::DecoratePLIT::m_acc_trk_muon_track
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_acc_trk_muon_track
Definition: DecoratePLIT.h:143
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:74
Prompt::DecoratePLIT::m_saltModel_endcap
std::shared_ptr< const FlavorTagInference::SaltModel > m_saltModel_endcap
Definition: DecoratePLIT.h:44
Prompt::DecoratePLIT::m_dec_trk_electron_track
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_dec_trk_electron_track
Definition: DecoratePLIT.h:150
Prompt::DecoratePLIT::initializeAccessors
StatusCode initializeAccessors()
Definition: DecoratePLIT.cxx:169
Prompt::DecoratePLIT::m_acc_trk_dr_leptontrack
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_acc_trk_dr_leptontrack
Definition: DecoratePLIT.h:138
Prompt::DecoratePLIT::m_acc_mu_topoetcone30
SG::ReadDecorHandleKey< xAOD::MuonContainer > m_acc_mu_topoetcone30
Definition: DecoratePLIT.h:132
ElectronContainer.h
Prompt::DecoratePLIT::m_acc_el_ptvarcone30
SG::ReadDecorHandleKey< xAOD::ElectronContainer > m_acc_el_ptvarcone30
Definition: DecoratePLIT.h:134
DecoratePromptLeptonImproved.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
SG::WriteDecorHandle
Handle class for adding a decoration to an object.
Definition: StoreGate/StoreGate/WriteDecorHandle.h:100
Prompt::DecoratePLIT::m_saltModel
std::shared_ptr< const FlavorTagInference::SaltModel > m_saltModel
Definition: DecoratePLIT.h:43
Prompt::DecoratePLIT::m_acc_el_topoetcone30
SG::ReadDecorHandleKey< xAOD::ElectronContainer > m_acc_el_topoetcone30
Definition: DecoratePLIT.h:135
Prompt::DecoratePLIT::m_maxLepTrackdR
Gaudi::Property< float > m_maxLepTrackdR
Definition: DecoratePLIT.h:101
Prompt::DecoratePLIT::passed_r22tracking_cuts
bool passed_r22tracking_cuts(const xAOD::TrackParticle &tp, const EventContext &ctx) const
Definition: DecoratePLIT.cxx:689
Prompt::DecoratePLIT::m_dec_el_plit_output
SG::WriteDecorHandleKeyArray< xAOD::ElectronContainer > m_dec_el_plit_output
Definition: DecoratePLIT.h:146
Prompt::DecoratePLIT::m_configFileVersion
Gaudi::Property< std::string > m_configFileVersion
Definition: DecoratePLIT.h:98
Prompt::DecoratePLIT::decorateTrack
StatusCode decorateTrack(SG::WriteDecorHandle< xAOD::TrackParticleContainer, float > &dec_trk_dr_lepton, SG::WriteDecorHandle< xAOD::TrackParticleContainer, float > &dec_trk_dr_leptontrack, SG::WriteDecorHandle< xAOD::TrackParticleContainer, char > &dec_trk_electron_track, SG::WriteDecorHandle< xAOD::TrackParticleContainer, char > &dec_trk_muon_track, const xAOD::TrackParticle &track, float dr_lepton, bool isUsedForElectron, bool isUsedForMuon, const xAOD::TrackParticle *trackLep) const
Definition: DecoratePLIT.cxx:830
python.TrackLeptonConfig.trackContainer
string trackContainer
Definition: TrackLeptonConfig.py:23
Prompt::FourMom_t
TLorentzVector FourMom_t
Definition: DecoratePLIT.h:32
Prompt::DecoratePLIT::m_tracksKey
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_tracksKey
Definition: DecoratePLIT.h:121
DataVector
Derived DataVector<T>.
Definition: DataVector.h:795
Prompt::DecoratePLIT
Definition: DecoratePLIT.h:34
WriteDecorHandle.h
Handle class for adding a decoration to an object.
Prompt::DecoratePLIT::m_acc_trk_dr_lepton
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_acc_trk_dr_lepton
Definition: DecoratePLIT.h:137
AthReentrantAlgorithm.h
Prompt::DecoratePLIT::m_dec_trk_muon_track
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_dec_trk_muon_track
Definition: DecoratePLIT.h:151
Prompt::DecoratePLIT::m_TaggerName
Gaudi::Property< std::string > m_TaggerName
Definition: DecoratePLIT.h:100
PathResolver.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
Prompt::DecoratePLIT::predictElec
StatusCode predictElec(SG::WriteDecorHandle< xAOD::TrackParticleContainer, float > &dec_trk_dr_lepton, SG::WriteDecorHandle< xAOD::TrackParticleContainer, float > &dec_trk_dr_leptontrack, SG::WriteDecorHandle< xAOD::TrackParticleContainer, char > &dec_trk_electron_track, SG::WriteDecorHandle< xAOD::TrackParticleContainer, char > &dec_trk_muon_track, const xAOD::Electron &electron, const xAOD::TrackParticleContainer &tracks, const xAOD::CaloClusterContainer &caloclusters, std::vector< SG::WriteDecorHandle< xAOD::ElectronContainer, float >> &dec_el_plit_output, const EventContext &ctx) const
Definition: DecoratePLIT.cxx:432
xAOD::Electron_v1
Definition: Electron_v1.h:34
Prompt::DecoratePLIT::fillParticles
StatusCode fillParticles(SG::WriteDecorHandle< xAOD::TrackParticleContainer, float > &dec_trk_dr_lepton, SG::WriteDecorHandle< xAOD::TrackParticleContainer, float > &dec_trk_dr_leptontrack, SG::WriteDecorHandle< xAOD::TrackParticleContainer, char > &dec_trk_electron_track, SG::WriteDecorHandle< xAOD::TrackParticleContainer, char > &dec_trk_muon_track, std::vector< const xAOD::IParticle * > &parts, const xAOD::IParticle &lepton, const xAOD::TrackParticle *trackLep, const xAOD::TrackParticleContainer &trackContainer, const EventContext &ctx) const
Definition: DecoratePLIT.cxx:769
MuonContainer.h
Prompt::DecoratePLIT::m_muonsKey
SG::ReadHandleKey< xAOD::MuonContainer > m_muonsKey
Definition: DecoratePLIT.h:113
Prompt::DecoratePLIT::m_lepCalErelConeSize
Gaudi::Property< float > m_lepCalErelConeSize
Definition: DecoratePLIT.h:103
Prompt::DecoratePLIT::m_configPath
Gaudi::Property< std::string > m_configPath
Definition: DecoratePLIT.h:97
Prompt::DecoratePLIT::m_acc_trk_d0
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_acc_trk_d0
Definition: DecoratePLIT.h:139
Prompt::DecoratePLIT::m_acc_trk_electron_track
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_acc_trk_electron_track
Definition: DecoratePLIT.h:144
Prompt::DecoratePLIT::predictMuon
StatusCode predictMuon(SG::WriteDecorHandle< xAOD::TrackParticleContainer, float > &dec_trk_dr_lepton, SG::WriteDecorHandle< xAOD::TrackParticleContainer, float > &dec_trk_dr_leptontrack, SG::WriteDecorHandle< xAOD::TrackParticleContainer, char > &dec_trk_electron_track, SG::WriteDecorHandle< xAOD::TrackParticleContainer, char > &dec_trk_muon_track, const xAOD::Muon &muon, const xAOD::TrackParticleContainer &tracks, std::vector< SG::WriteDecorHandle< xAOD::MuonContainer, float >> &dec_mu_plit_output, const EventContext &ctx) const
Definition: DecoratePLIT.cxx:195
Prompt::DecoratePLIT::m_acc_mu_ptvarcone30TTVA
SG::ReadDecorHandleKey< xAOD::MuonContainer > m_acc_mu_ptvarcone30TTVA
Definition: DecoratePLIT.h:131
WriteDecorHandleKeyArray.h
Prompt::DecoratePLIT::m_num_track_features
int m_num_track_features
Definition: DecoratePLIT.h:47
xAOD::EgammaParameters::electron
@ electron
Definition: EgammaEnums.h:18
Prompt::DecoratePLIT::m_btagIp_prefix
Gaudi::Property< std::string > m_btagIp_prefix
Definition: DecoratePLIT.h:105
doL1CaloHVCorrections.parts
parts
Definition: doL1CaloHVCorrections.py:334
xAOD::track
@ track
Definition: TrackingPrimitives.h:513
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:44
SG::ReadDecorHandleKey
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
Definition: StoreGate/StoreGate/ReadDecorHandleKey.h:85
Prompt::DecoratePLIT::m_acc_trk_d0Uncertainty
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_acc_trk_d0Uncertainty
Definition: DecoratePLIT.h:141
Decorator.h
Helper class to provide type-safe access to aux data.
Prompt::DecoratePLIT::m_leptonsName
Gaudi::Property< std::string > m_leptonsName
Definition: DecoratePLIT.h:93
Prompt::DecoratePLIT::m_trackjetsKey
SG::ReadHandleKey< xAOD::JetContainer > m_trackjetsKey
Definition: DecoratePLIT.h:117
Prompt::DecoratePLIT::m_dec_trk_dr_leptontrack
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_dec_trk_dr_leptontrack
Definition: DecoratePLIT.h:152