ATLAS Offline Software
Loading...
Searching...
No Matches
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
25namespace TauClusterVars {
26
27bool et_log(
28 const xAOD::TauJet &tau, const xAOD::CaloVertexedTopoCluster &cluster, float &out);
29
30bool pt_tau_log(
31 const xAOD::TauJet &tau, const xAOD::CaloVertexedTopoCluster &cluster, float &out);
32
34 const xAOD::TauJet &tau, const xAOD::CaloVertexedTopoCluster &cluster, float &out);
35
36bool dEta(
37 const xAOD::TauJet &tau, const xAOD::CaloVertexedTopoCluster &cluster, float &out);
38
39bool dPhi(
40 const xAOD::TauJet &tau, const xAOD::CaloVertexedTopoCluster &cluster, float &out);
41
42bool SECOND_R(
43 const xAOD::TauJet &tau, const xAOD::CaloVertexedTopoCluster &cluster, float &out);
44
45bool SECOND_LAMBDA(
46 const xAOD::TauJet &tau, const xAOD::CaloVertexedTopoCluster &cluster, float &out);
47
48bool 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
61bool e(
62 const xAOD::TauJet &tau, const xAOD::CaloVertexedTopoCluster &cluster, float &out);
63
64bool et(
65 const xAOD::TauJet &tau, const xAOD::CaloVertexedTopoCluster &cluster, float &out);
66
68 const xAOD::TauJet &tau, const xAOD::CaloVertexedTopoCluster &cluster, float &out);
69
71 const xAOD::TauJet &tau, const xAOD::CaloVertexedTopoCluster &cluster, float &out);
72
73bool CENTER_MAG(
74 const xAOD::TauJet &tau, const xAOD::CaloVertexedTopoCluster &cluster, float &out);
75} // namespace TauClusterVars
76
77
78namespace 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:
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
Evaluate cluster kinematics with a different vertex / signal state.
std::function< float(const xAOD::CaloVertexedTopoCluster &, const xAOD::TauJet &)> FeatureFunc_t
ConstituentLoaderTauCluster(const ConstituentsInputConfig &cfg, double max_cluster_dr, bool doVertexCorrection)
static const std::unordered_map< std::string, FeatureFuncAsReference_t > m_func_map
const FTagDataDependencyNames & getDependencies() const override
Inputs getFeatures(const xAOD::TauJet *tau, const std::vector< xAOD::CaloVertexedTopoCluster > &tau_clusters) const
std::tuple< Inputs, std::vector< const xAOD::IParticle * > > getData(const xAOD::IParticle &p) const override
const std::set< std::string > & getUsedRemap() const override
FeatureFunc_t getFeatureExtractor(const std::string &var_name) const
std::vector< xAOD::CaloVertexedTopoCluster > getTauClusters(const xAOD::TauJet *tau) const
std::function< bool(const xAOD::TauJet &, const xAOD::CaloVertexedTopoCluster &, float &)> FeatureFuncAsReference_t
const ConstituentsType & getType() const override
Evaluate cluster kinematics with a different vertex / signal state.
Class providing the definition of the 4-vector interface.
This file contains "getter" functions used for accessing tagger inputs from the EDM.
std::pair< std::vector< float >, std::vector< int64_t > > Inputs
bool et_log(const xAOD::TauJet &, const xAOD::CaloVertexedTopoCluster &cluster, float &out)
bool FIRST_ENG_DENS(const xAOD::TauJet &, const xAOD::CaloVertexedTopoCluster &cluster, float &out)
bool et(const xAOD::TauJet &, const xAOD::CaloVertexedTopoCluster &cluster, float &out)
bool SECOND_LAMBDAOverClustersMeanSecondLambda(const xAOD::TauJet &tau, const xAOD::CaloVertexedTopoCluster &cluster, float &out)
bool CENTER_MAG(const xAOD::TauJet &, const xAOD::CaloVertexedTopoCluster &cluster, float &out)
bool CENTER_LAMBDA(const xAOD::TauJet &, const xAOD::CaloVertexedTopoCluster &cluster, float &out)
bool dPhi(const xAOD::TauJet &tau, const xAOD::CaloVertexedTopoCluster &cluster, float &out)
bool EM_PROBABILITY(const xAOD::TauJet &, const xAOD::CaloVertexedTopoCluster &cluster, float &out)
bool CENTER_LAMBDAOverClustersMeanCenterLambda(const xAOD::TauJet &tau, const xAOD::CaloVertexedTopoCluster &cluster, float &out)
bool FirstEngDensOverClustersMeanFirstEngDens(const xAOD::TauJet &tau, const xAOD::CaloVertexedTopoCluster &cluster, float &out)
bool SECOND_R(const xAOD::TauJet &, const xAOD::CaloVertexedTopoCluster &cluster, float &out)
bool SECOND_LAMBDA(const xAOD::TauJet &, const xAOD::CaloVertexedTopoCluster &cluster, float &out)
bool dEta(const xAOD::TauJet &tau, const xAOD::CaloVertexedTopoCluster &cluster, float &out)
bool pt_tau_log(const xAOD::TauJet &tau, const xAOD::CaloVertexedTopoCluster &, float &out)
bool e(const xAOD::TauJet &, const xAOD::CaloVertexedTopoCluster &cluster, float &out)
bool pt_jetseed_log(const xAOD::TauJet &tau, const xAOD::CaloVertexedTopoCluster &, float &out)
TauJet_v3 TauJet
Definition of the current "tau version".