ATLAS Offline Software
DecoratePLIT.h
Go to the documentation of this file.
1 // This is -*- c++ -*-
2 
3 /*
4  Copyright (C) 2002-2024 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"
22 
23 // xAOD
25 #include "xAODMuon/MuonContainer.h"
26 
27 
28 namespace Prompt {
29 
30  // Definition of the 4-momentum type
31  typedef TLorentzVector FourMom_t;
32 
34 
35  public:
36  DecoratePLIT(const std::string &name, ISvcLocator *pSvcLocator);
37 
38  virtual StatusCode initialize() override;
39  virtual StatusCode execute (const EventContext&) const override;
40 
41  private:
42  std::shared_ptr<const FlavorTagDiscriminants::OnnxUtil> m_onnxUtil{};
43  std::shared_ptr<const FlavorTagDiscriminants::OnnxUtil> m_onnxUtil_endcap{};
44 
47 
49 
51  const xAOD::JetContainer &trackjets,
52  const xAOD::TrackParticleContainer &tracks,
53  const xAOD::CaloClusterContainer &caloclusters,
54  std::vector<SG::WriteDecorHandle<xAOD::ElectronContainer, float>> &dec_el_plit_output,
55  const EventContext& ctx) const;
57  const xAOD::JetContainer &trackjets,
58  const xAOD::TrackParticleContainer &tracks,
59  std::vector<SG::WriteDecorHandle<xAOD::MuonContainer, float>> &dec_mu_plit_output,
60  const EventContext& ctx) const;
61 
63  bool passed_r22tracking_cuts(const xAOD::TrackParticle &tp, const EventContext& ctx) const;
65  float dr_lepton,
66  bool isUsedForElectron,
67  bool isUsedForMuon,
68  const xAOD::Jet* trackJet,
69  const xAOD::TrackParticle* trackLep) const;
70  StatusCode fillParticles(std::vector<const xAOD::IParticle *> &parts,
71  const xAOD::IParticle &lepton,
72  const xAOD::TrackParticle *trackLep,
73  const xAOD::Jet *trackJet,
74  const xAOD::TrackParticleContainer &trackContainer,
75  const EventContext& ctx) const;
76 
77  // Properties:
78  Gaudi::Property<std::string> m_leptonsName {
79  this, "LeptonContainerName", "",
80  "Container's name of the lepton that you want to decorate. Also need to set ElectronContainerKey or MuonContainerKey accordingly"
81  };
82  Gaudi::Property<std::string> m_configPath {this, "ConfigPath", "", "Path of the directory containing the onnx files"};
83  Gaudi::Property<std::string> m_configFileVersion {this, "ConfigFileVersion", "", "Vector of tagger score files"};
84  Gaudi::Property<std::string> m_configFileVersion_endcap {this, "ConfigFileVersion_endcap", "", "Vector of tagger score files for endcap"};
85  Gaudi::Property<std::string> m_TaggerName {this, "TaggerName", "", "Tagger name"};
86  Gaudi::Property<float> m_maxLepTrackJetdR{
87  this, "maxLepTrackJetdR", 0.4, "Maximum distance between lepton and trackjet"};
88  Gaudi::Property<float> m_maxLepTrackdR{
89  this, "maxLepTrackdR", 0.4, "Maximum distance between lepton and track"};
90  Gaudi::Property<float> m_lepCalErelConeSize{
91  this, "lepCalErelConeSize", 0.15, "Cone size for relative calo cluster energy sum"};
92  Gaudi::Property<std::string> m_btagIp_prefix{
93  this, "btagIp_prefix", "btagIp_", "Prefix of b-tagging impact parameter variables (w.r.t. primary vertex)"};
94 
95  // Read/write handles
97  this, "ElectronContainerKey", "Electrons",
98  "Electron container name"
99  };
101  this, "MuonContainerKey", "Muons",
102  "Muon container name"
103  };
105  this, "TrackJetContainerKey", "AntiKtVR30Rmax4Rmin02PV0TrackJets",
106  "VR track jet container name"
107  };
109  this, "TracksContainerKey", "InDetTrackParticles",
110  "Tracks container name"
111  };
113  this, "CaloClusterContainerKey", "egammaClusters",
114  "Calo cluster container name"
115  };
116 
117  // Accessor declarations
118  SG::ReadDecorHandleKey<xAOD::MuonContainer> m_acc_mu_ptvarcone30TTVA {this, "acc_mu_ptvarcone30TTVA",m_muonsKey, "ptvarcone30_Nonprompt_All_MaxWeightTTVA_pt500"};
119  SG::ReadDecorHandleKey<xAOD::MuonContainer> m_acc_mu_topoetcone30 {this, "acc_mu_topoetcone30",m_muonsKey, "topoetcone30"};
120 
123 
133 
136 
137  };
138 }
139 
140 #endif
LArG4FSStartPointFilter.part
part
Definition: LArG4FSStartPointFilter.py:21
Prompt::DecoratePLIT::m_num_lepton_features
int m_num_lepton_features
Definition: DecoratePLIT.h:45
Prompt::DecoratePLIT::findClosestTrackJet
const xAOD::Jet * findClosestTrackJet(const xAOD::IParticle &part, const xAOD::JetContainer &jets) const
Definition: DecoratePLIT.cxx:688
xAOD::muon
@ muon
Definition: TrackingPrimitives.h:195
Prompt::DecoratePLIT::m_acc_trk_z0SinTheta
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_acc_trk_z0SinTheta
Definition: DecoratePLIT.h:128
Prompt
Definition: DecoratePLIT.h:28
Prompt::DecoratePLIT::m_acc_trk_ptfrac
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_acc_trk_ptfrac
Definition: DecoratePLIT.h:124
Prompt::DecoratePLIT::m_onnxUtil
std::shared_ptr< const FlavorTagDiscriminants::OnnxUtil > m_onnxUtil
Definition: DecoratePLIT.h:42
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:112
Prompt::DecoratePLIT::initialize
virtual StatusCode initialize() override
Definition: DecoratePLIT.cxx:19
Prompt::DecoratePLIT::m_electronsKey
SG::ReadHandleKey< xAOD::ElectronContainer > m_electronsKey
Definition: DecoratePLIT.h:96
Prompt::DecoratePLIT::m_configFileVersion_endcap
Gaudi::Property< std::string > m_configFileVersion_endcap
Definition: DecoratePLIT.h:84
ParticleTest.tp
tp
Definition: ParticleTest.py:25
SG::HandleKeyArray
Definition: StoreGate/StoreGate/HandleKeyArray.h:38
Prompt::DecoratePLIT::execute
virtual StatusCode execute(const EventContext &) const override
Definition: DecoratePLIT.cxx:104
Prompt::DecoratePLIT::m_dec_mu_plit_output
SG::WriteDecorHandleKeyArray< xAOD::MuonContainer > m_dec_mu_plit_output
Definition: DecoratePLIT.h:135
SG::ReadHandleKey< xAOD::ElectronContainer >
Prompt::DecoratePLIT::m_acc_trk_z0SinThetaUncertainty
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_acc_trk_z0SinThetaUncertainty
Definition: DecoratePLIT.h:130
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:131
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
Prompt::DecoratePLIT::initializeAccessors
StatusCode initializeAccessors()
Definition: DecoratePLIT.cxx:142
Prompt::DecoratePLIT::m_acc_mu_topoetcone30
SG::ReadDecorHandleKey< xAOD::MuonContainer > m_acc_mu_topoetcone30
Definition: DecoratePLIT.h:119
ElectronContainer.h
Prompt::DecoratePLIT::m_acc_el_ptvarcone30
SG::ReadDecorHandleKey< xAOD::ElectronContainer > m_acc_el_ptvarcone30
Definition: DecoratePLIT.h:121
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_acc_el_topoetcone30
SG::ReadDecorHandleKey< xAOD::ElectronContainer > m_acc_el_topoetcone30
Definition: DecoratePLIT.h:122
Prompt::DecoratePLIT::m_maxLepTrackdR
Gaudi::Property< float > m_maxLepTrackdR
Definition: DecoratePLIT.h:88
Prompt::DecoratePLIT::passed_r22tracking_cuts
bool passed_r22tracking_cuts(const xAOD::TrackParticle &tp, const EventContext &ctx) const
Definition: DecoratePLIT.cxx:703
Prompt::DecoratePLIT::m_dec_el_plit_output
SG::WriteDecorHandleKeyArray< xAOD::ElectronContainer > m_dec_el_plit_output
Definition: DecoratePLIT.h:134
Prompt::DecoratePLIT::m_maxLepTrackJetdR
Gaudi::Property< float > m_maxLepTrackJetdR
Definition: DecoratePLIT.h:86
Prompt::DecoratePLIT::m_configFileVersion
Gaudi::Property< std::string > m_configFileVersion
Definition: DecoratePLIT.h:83
Prompt::FourMom_t
TLorentzVector FourMom_t
Definition: DecoratePLIT.h:31
Prompt::DecoratePLIT::m_tracksKey
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_tracksKey
Definition: DecoratePLIT.h:108
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
Prompt::DecoratePLIT
Definition: DecoratePLIT.h:33
WriteDecorHandle.h
Handle class for adding a decoration to an object.
Prompt::DecoratePLIT::m_acc_trk_dr_trackjet
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_acc_trk_dr_trackjet
Definition: DecoratePLIT.h:125
Prompt::DecoratePLIT::m_acc_trk_dr_lepton
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_acc_trk_dr_lepton
Definition: DecoratePLIT.h:126
AthReentrantAlgorithm.h
Prompt::DecoratePLIT::m_onnxUtil_endcap
std::shared_ptr< const FlavorTagDiscriminants::OnnxUtil > m_onnxUtil_endcap
Definition: DecoratePLIT.h:43
Prompt::DecoratePLIT::m_TaggerName
Gaudi::Property< std::string > m_TaggerName
Definition: DecoratePLIT.h:85
PathResolver.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
xAOD::Electron_v1
Definition: Electron_v1.h:34
MuonContainer.h
Prompt::DecoratePLIT::m_muonsKey
SG::ReadHandleKey< xAOD::MuonContainer > m_muonsKey
Definition: DecoratePLIT.h:100
Prompt::DecoratePLIT::m_lepCalErelConeSize
Gaudi::Property< float > m_lepCalErelConeSize
Definition: DecoratePLIT.h:90
xAOD::Jet_v1
Class describing a jet.
Definition: Jet_v1.h:57
Prompt::DecoratePLIT::m_configPath
Gaudi::Property< std::string > m_configPath
Definition: DecoratePLIT.h:82
Prompt::DecoratePLIT::m_acc_trk_d0
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_acc_trk_d0
Definition: DecoratePLIT.h:127
Prompt::DecoratePLIT::m_acc_trk_electron_track
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_acc_trk_electron_track
Definition: DecoratePLIT.h:132
Prompt::DecoratePLIT::m_acc_mu_ptvarcone30TTVA
SG::ReadDecorHandleKey< xAOD::MuonContainer > m_acc_mu_ptvarcone30TTVA
Definition: DecoratePLIT.h:118
WriteDecorHandleKeyArray.h
Prompt::DecoratePLIT::m_num_track_features
int m_num_track_features
Definition: DecoratePLIT.h:46
xAOD::EgammaParameters::electron
@ electron
Definition: EgammaEnums.h:18
Prompt::DecoratePLIT::m_btagIp_prefix
Gaudi::Property< std::string > m_btagIp_prefix
Definition: DecoratePLIT.h:92
doL1CaloHVCorrections.parts
parts
Definition: doL1CaloHVCorrections.py:334
defineDB.jets
list jets
Definition: JetTagCalibration/share/defineDB.py:24
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
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:129
Prompt::DecoratePLIT::decorateTrack
StatusCode decorateTrack(const xAOD::TrackParticle &track, float dr_lepton, bool isUsedForElectron, bool isUsedForMuon, const xAOD::Jet *trackJet, const xAOD::TrackParticle *trackLep) const
Definition: DecoratePLIT.cxx:837
Prompt::DecoratePLIT::predictMuon
StatusCode predictMuon(const xAOD::Muon &muon, const xAOD::JetContainer &trackjets, const xAOD::TrackParticleContainer &tracks, std::vector< SG::WriteDecorHandle< xAOD::MuonContainer, float >> &dec_mu_plit_output, const EventContext &ctx) const
Definition: DecoratePLIT.cxx:163
Prompt::DecoratePLIT::predictElec
StatusCode predictElec(const xAOD::Electron &electron, const xAOD::JetContainer &trackjets, 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:397
Prompt::DecoratePLIT::m_leptonsName
Gaudi::Property< std::string > m_leptonsName
Definition: DecoratePLIT.h:78
OnnxUtil.h
Prompt::DecoratePLIT::m_trackjetsKey
SG::ReadHandleKey< xAOD::JetContainer > m_trackjetsKey
Definition: DecoratePLIT.h:104
Prompt::DecoratePLIT::fillParticles
StatusCode fillParticles(std::vector< const xAOD::IParticle * > &parts, const xAOD::IParticle &lepton, const xAOD::TrackParticle *trackLep, const xAOD::Jet *trackJet, const xAOD::TrackParticleContainer &trackContainer, const EventContext &ctx) const
Definition: DecoratePLIT.cxx:783