ATLAS Offline Software
ConstituentsLoaderTauCluster.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 
4  This is a subclass of IConstituentsLoader. It is used to load the CaloVertexedTopoClusters from the tau
5  and extract their features for the NN evaluation.
6 */
7 
8 #pragma once
9 
10 // local includes
13 
14 // EDM includes
15 #include <xAODTau/TauJet.h>
18 
19 // STL includes
20 #include <string>
21 #include <vector>
22 #include <functional>
23 
24 
25 namespace TauClusterVars {
26 
27 bool et_log(
28  const xAOD::TauJet &tau, const xAOD::CaloVertexedTopoCluster &cluster, float &out);
29 
30 bool pt_tau_log(
31  const xAOD::TauJet &tau, const xAOD::CaloVertexedTopoCluster &cluster, float &out);
32 
33 bool pt_jetseed_log(
34  const xAOD::TauJet &tau, const xAOD::CaloVertexedTopoCluster &cluster, float &out);
35 
36 bool dEta(
37  const xAOD::TauJet &tau, const xAOD::CaloVertexedTopoCluster &cluster, float &out);
38 
39 bool dPhi(
40  const xAOD::TauJet &tau, const xAOD::CaloVertexedTopoCluster &cluster, float &out);
41 
42 bool SECOND_R(
43  const xAOD::TauJet &tau, const xAOD::CaloVertexedTopoCluster &cluster, float &out);
44 
45 bool SECOND_LAMBDA(
46  const xAOD::TauJet &tau, const xAOD::CaloVertexedTopoCluster &cluster, float &out);
47 
48 bool CENTER_LAMBDA(
49  const xAOD::TauJet &tau, const xAOD::CaloVertexedTopoCluster &cluster, float &out);
50 
52  const xAOD::TauJet &tau, const xAOD::CaloVertexedTopoCluster &cluster, float &out);
53 
55  const xAOD::TauJet &tau, const xAOD::CaloVertexedTopoCluster &cluster, float &out);
56 
58  const xAOD::TauJet &tau, const xAOD::CaloVertexedTopoCluster &cluster, float &out);
59 
60 //Extension - Variables for GNTau
61 bool e(
62  const xAOD::TauJet &tau, const xAOD::CaloVertexedTopoCluster &cluster, float &out);
63 
64 bool et(
65  const xAOD::TauJet &tau, const xAOD::CaloVertexedTopoCluster &cluster, float &out);
66 
67 bool FIRST_ENG_DENS(
68  const xAOD::TauJet &tau, const xAOD::CaloVertexedTopoCluster &cluster, float &out);
69 
70 bool EM_PROBABILITY(
71  const xAOD::TauJet &tau, const xAOD::CaloVertexedTopoCluster &cluster, float &out);
72 
73 bool CENTER_MAG(
74  const xAOD::TauJet &tau, const xAOD::CaloVertexedTopoCluster &cluster, float &out);
75 } // namespace TauClusterVars
76 
77 
78 namespace FlavorTagInference {
79  // Subclass for IParticles loader inherited from abstract IConstituentsLoader class
81  public:
82  ConstituentLoaderTauCluster(const ConstituentsInputConfig& cfg, double max_cluster_dr, bool doVertexCorrection);
83  std::tuple<Inputs, std::vector<const xAOD::IParticle*>> getData(const xAOD::IParticle& p) const override ;
84  const std::string& getName() const override;
85  const ConstituentsType& getType() const override;
86  const FTagDataDependencyNames& getDependencies() const override;
87  const std::set<std::string>& getUsedRemap() const override;
88  private:
90  bool m_doVertexCorrection = false;
91  using FeatureFunc_t = std::function<float(const xAOD::CaloVertexedTopoCluster&, const xAOD::TauJet&)>;
92  using FeatureFuncAsReference_t = std::function<bool(const xAOD::TauJet&, const xAOD::CaloVertexedTopoCluster&, float&)>;
93  std::vector<FeatureFunc_t> m_feature_extractors;
94  FeatureFunc_t getFeatureExtractor(const std::string& var_name) const;
95  std::vector<xAOD::CaloVertexedTopoCluster> getTauClusters(const xAOD::TauJet* tau) const;
96  Inputs getFeatures(const xAOD::TauJet* tau, const std::vector<xAOD::CaloVertexedTopoCluster>& tau_clusters) const;
97  inline static const std::unordered_map<std::string, FeatureFuncAsReference_t> m_func_map = {
98  {"dEta", TauClusterVars::dEta},
99  {"dPhi", TauClusterVars::dPhi},
100  {"SECOND_R", TauClusterVars::SECOND_R},
101  {"SECOND_LAMBDA", TauClusterVars::SECOND_LAMBDA},
102  {"CENTER_LAMBDA", TauClusterVars::CENTER_LAMBDA},
103  {"et", TauClusterVars::et}
104  };
105  };
106 }
107 
ConstituentsLoader.h
FlavorTagInference::ConstituentLoaderTauCluster::m_max_cluster_dr
double m_max_cluster_dr
Definition: ConstituentsLoaderTauCluster.h:89
FlavorTagInference::IConstituentsLoader
Definition: PhysicsAnalysis/JetTagging/FlavorTagInference/FlavorTagInference/ConstituentsLoader.h:81
FlavorTagInference
This file contains "getter" functions used for accessing tagger inputs from the EDM.
Definition: PhysicsAnalysis/JetTagging/FlavorTagInference/FlavorTagInference/ConstituentsLoader.h:27
CheckAppliedSFs.var_name
var_name
Definition: CheckAppliedSFs.py:241
FlavorTagInference::ConstituentLoaderTauCluster::getType
const ConstituentsType & getType() const override
Definition: ConstituentLoaderTauCluster.cxx:84
TauClusterVars::EM_PROBABILITY
bool EM_PROBABILITY(const xAOD::TauJet &, const xAOD::CaloVertexedTopoCluster &cluster, float &out)
Definition: ConstituentLoaderTauCluster.cxx:209
TauClusterVars::SECOND_R
bool SECOND_R(const xAOD::TauJet &, const xAOD::CaloVertexedTopoCluster &cluster, float &out)
Definition: ConstituentLoaderTauCluster.cxx:124
FlavorTagInference::ConstituentLoaderTauCluster::m_func_map
static const std::unordered_map< std::string, FeatureFuncAsReference_t > m_func_map
Definition: ConstituentsLoaderTauCluster.h:97
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:70
FlavorTagInference::ConstituentLoaderTauCluster::getUsedRemap
const std::set< std::string > & getUsedRemap() const override
Definition: ConstituentLoaderTauCluster.cxx:90
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition: Event/xAOD/xAODBase/xAODBase/IParticle.h:41
TauClusterVars
Definition: ConstituentLoaderTauCluster.cxx:96
TauClusterVars::dPhi
bool dPhi(const xAOD::TauJet &tau, const xAOD::CaloVertexedTopoCluster &cluster, float &out)
Definition: ConstituentLoaderTauCluster.cxx:119
TauClusterVars::dEta
bool dEta(const xAOD::TauJet &tau, const xAOD::CaloVertexedTopoCluster &cluster, float &out)
Definition: ConstituentLoaderTauCluster.cxx:114
TauClusterVars::pt_jetseed_log
bool pt_jetseed_log(const xAOD::TauJet &tau, const xAOD::CaloVertexedTopoCluster &, float &out)
Definition: ConstituentLoaderTauCluster.cxx:109
TauClusterVars::et_log
bool et_log(const xAOD::TauJet &, const xAOD::CaloVertexedTopoCluster &cluster, float &out)
Definition: ConstituentLoaderTauCluster.cxx:99
TauClusterVars::e
bool e(const xAOD::TauJet &, const xAOD::CaloVertexedTopoCluster &cluster, float &out)
Definition: ConstituentLoaderTauCluster.cxx:192
TauClusterVars::CENTER_MAG
bool CENTER_MAG(const xAOD::TauJet &, const xAOD::CaloVertexedTopoCluster &cluster, float &out)
Definition: ConstituentLoaderTauCluster.cxx:216
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:209
TauClusterVars::SECOND_LAMBDAOverClustersMeanSecondLambda
bool SECOND_LAMBDAOverClustersMeanSecondLambda(const xAOD::TauJet &tau, const xAOD::CaloVertexedTopoCluster &cluster, float &out)
Definition: ConstituentLoaderTauCluster.cxx:145
TauClusterVars::CENTER_LAMBDAOverClustersMeanCenterLambda
bool CENTER_LAMBDAOverClustersMeanCenterLambda(const xAOD::TauJet &tau, const xAOD::CaloVertexedTopoCluster &cluster, float &out)
Definition: ConstituentLoaderTauCluster.cxx:154
FlavorTagInference::ConstituentsInputConfig
Definition: PhysicsAnalysis/JetTagging/FlavorTagInference/FlavorTagInference/ConstituentsLoader.h:64
FlavorTagInference::ConstituentLoaderTauCluster::getDependencies
const FTagDataDependencyNames & getDependencies() const override
Definition: ConstituentLoaderTauCluster.cxx:87
xAOD::TauJet_v3
Class describing a tau jet.
Definition: TauJet_v3.h:41
FlavorTagInference::ConstituentLoaderTauCluster::ConstituentLoaderTauCluster
ConstituentLoaderTauCluster(const ConstituentsInputConfig &cfg, double max_cluster_dr, bool doVertexCorrection)
Definition: ConstituentLoaderTauCluster.cxx:10
FlavorTagInference::FTagDataDependencyNames
Definition: FTagDataDependencyNames.h:12
TauClusterVars::FIRST_ENG_DENS
bool FIRST_ENG_DENS(const xAOD::TauJet &, const xAOD::CaloVertexedTopoCluster &cluster, float &out)
Definition: ConstituentLoaderTauCluster.cxx:202
FlavorTagInference::ConstituentLoaderTauCluster::getFeatures
Inputs getFeatures(const xAOD::TauJet *tau, const std::vector< xAOD::CaloVertexedTopoCluster > &tau_clusters) const
Definition: ConstituentLoaderTauCluster.cxx:46
FlavorTagInference::ConstituentLoaderTauCluster
Definition: ConstituentsLoaderTauCluster.h:80
FlavorTagInference::ConstituentLoaderTauCluster::m_feature_extractors
std::vector< FeatureFunc_t > m_feature_extractors
Definition: ConstituentsLoaderTauCluster.h:93
FlavorTagInference::ConstituentLoaderTauCluster::m_doVertexCorrection
bool m_doVertexCorrection
Definition: ConstituentsLoaderTauCluster.h:90
TauClusterVars::FirstEngDensOverClustersMeanFirstEngDens
bool FirstEngDensOverClustersMeanFirstEngDens(const xAOD::TauJet &tau, const xAOD::CaloVertexedTopoCluster &cluster, float &out)
Definition: ConstituentLoaderTauCluster.cxx:171
FlavorTagInference::ConstituentsType
ConstituentsType
Definition: PhysicsAnalysis/JetTagging/FlavorTagInference/FlavorTagInference/ConstituentsLoader.h:48
FlavorTagInference::ConstituentLoaderTauCluster::FeatureFunc_t
std::function< float(const xAOD::CaloVertexedTopoCluster &, const xAOD::TauJet &)> FeatureFunc_t
Definition: ConstituentsLoaderTauCluster.h:91
FlavorTagInference::ConstituentLoaderTauCluster::getTauClusters
std::vector< xAOD::CaloVertexedTopoCluster > getTauClusters(const xAOD::TauJet *tau) const
Definition: ConstituentLoaderTauCluster.cxx:20
WriteCaloSwCorrections.cfg
cfg
Definition: WriteCaloSwCorrections.py:23
CaloVertexedTopoCluster.h
Evaluate cluster kinematics with a different vertex / signal state.
FlavorTagInference::ConstituentLoaderTauCluster::getName
const std::string & getName() const override
Definition: ConstituentLoaderTauCluster.cxx:81
TauClusterVars::pt_tau_log
bool pt_tau_log(const xAOD::TauJet &tau, const xAOD::CaloVertexedTopoCluster &, float &out)
Definition: ConstituentLoaderTauCluster.cxx:104
FlavorTagInference::ConstituentLoaderTauCluster::getFeatureExtractor
FeatureFunc_t getFeatureExtractor(const std::string &var_name) const
Definition: ConstituentLoaderTauCluster.cxx:64
FlavorTagInference::ConstituentLoaderTauCluster::FeatureFuncAsReference_t
std::function< bool(const xAOD::TauJet &, const xAOD::CaloVertexedTopoCluster &, float &)> FeatureFuncAsReference_t
Definition: ConstituentsLoaderTauCluster.h:92
CustomGetterUtils.h
TauClusterVars::et
bool et(const xAOD::TauJet &, const xAOD::CaloVertexedTopoCluster &cluster, float &out)
Definition: ConstituentLoaderTauCluster.cxx:197
FlavorTagInference::ConstituentLoaderTauCluster::getData
std::tuple< Inputs, std::vector< const xAOD::IParticle * > > getData(const xAOD::IParticle &p) const override
Definition: ConstituentLoaderTauCluster.cxx:58
TauJet.h
HelperFunctions.h
TauClusterVars::CENTER_LAMBDA
bool CENTER_LAMBDA(const xAOD::TauJet &, const xAOD::CaloVertexedTopoCluster &cluster, float &out)
Definition: ConstituentLoaderTauCluster.cxx:138
FlavorTagInference::Inputs
std::pair< std::vector< float >, std::vector< int64_t > > Inputs
Definition: ISaltModel.h:22
xAOD::CaloVertexedTopoCluster
Evaluate cluster kinematics with a different vertex / signal state.
Definition: Event/xAOD/xAODCaloEvent/xAODCaloEvent/CaloVertexedTopoCluster.h:38
TauClusterVars::SECOND_LAMBDA
bool SECOND_LAMBDA(const xAOD::TauJet &, const xAOD::CaloVertexedTopoCluster &cluster, float &out)
Definition: ConstituentLoaderTauCluster.cxx:131
xAOD::bool
setBGCode setTAP setLVL2ErrorBits bool
Definition: TrigDecision_v1.cxx:60
python.LArMinBiasAlgConfig.float
float
Definition: LArMinBiasAlgConfig.py:65