ATLAS Offline Software
Loading...
Searching...
No Matches
Tool_FeatureExtractor.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef PANTAUALGS_TOOL_FEATUREEXTRACTOR_H
6#define PANTAUALGS_TOOL_FEATUREEXTRACTOR_H
7
8#include <string>
9#include <map>
10#include <vector>
11
13#include "AsgTools/AsgTool.h"
14#include "AsgTools/ToolHandle.h"
16
17// PanTau
23
24namespace PanTau {
25
32
34
35 public:
36
37 Tool_FeatureExtractor(const std::string &name);
38 virtual StatusCode initialize() override;
39
40 //get the features for an input seed
41 virtual StatusCode execute(PanTau::PanTauSeed* inSeed) const override;
42
43 protected:
44
45 //handle to the helper function
47 ToolHandle<PanTau::ITool_InformationStore> m_Tool_InformationStore{this, "Tool_InformationStore", "PanTau::Tool_InformationStore/Tool_InformationStore","Tool handle to the information store tool"};
48 Gaudi::Property<std::string> m_Tool_InformationStoreName{this, "Tool_InformationStoreName", "", "Tool handle to the information store tool"};
49
50 //Function to calculate basic features
51 StatusCode calculateBasicFeatures(PanTau::PanTauSeed* inSeed) const;
52
53 //Function to calculate features for one set of constituents
54 StatusCode calculateFeatures(PanTau::PanTauSeed* inSeed,
55 int tauConstituentType,
56 const std::map<std::string, double>& variants_SeedEt) const;
57
58 //Function to add the 4 momenta of the tau constituents to the features
59 StatusCode addConstituentMomenta(PanTau::PanTauSeed* inSeed) const;
60
61 //Function to calculate features based on two sets of constituents
62 StatusCode addCombinedFeatures(PanTau::PanTauSeed* inSeed,
63 const std::map<std::string, double>& variants_SeedEt) const;
64
65 //Function to fill the variants_SeedEt member
66 static void fillVariantsSeedEt(const std::vector<PanTau::TauConstituent*>& tauConstituents,
67 std::map<std::string, double>& variants_SeedEt) ;
68
69 //helper function to fill the variants_SeedEt map
70 static void addFeatureWrtSeedEnergy(PanTau::TauFeature* targetMap,
71 const std::string& featName,
72 double numerator,
73 const std::map<std::string, double>& denominatorMap) ;
74
76
77
79 std::vector<double> m_Config_BinEdges_Eta;
82
83 //make these configured via python! (super trick ;))
84 static const std::string varTypeName_Ratio() {return "Ratio";}
85 static const std::string varTypeName_Mean() {return "Mean";}
86 static const std::string varTypeName_StdDev() {return "StdDev";}
87 static const std::string varTypeName_HLV() {return "HLV";}
88 static const std::string varTypeName_Angle() {return "Angle";}
89 static const std::string varTypeName_DeltaR() {return "DeltaR";}
90 static const std::string varTypeName_JetMoment() {return "JetMoment";}
91 static const std::string varTypeName_Combined() {return "Combined";}
92 static const std::string varTypeName_Basic() {return "Basic";}
93 static const std::string varTypeName_PID() {return "PID";}
94 static const std::string varTypeName_Shots() {return "Shots";}
95
98 std::string m_varTypeName_HLV;
102 std::string m_varTypeName_PID;
103
104 bool m_init=false;
105
106 public:
107 inline bool isInitialized() override {return m_init;}
108};
109
110} // end of namespace PanTau
111#endif // PANTAUALGS_TOOL_FEATUREEXTRACTOR_H
#define ASG_TOOL_CLASS1
Interface for PID from tau seeds.
Class containing features of a tau seed.
Definition TauFeature.h:19
std::vector< double > m_Config_BinEdges_Eta
Helper members.
static const std::string varTypeName_Shots()
Gaudi::Property< std::string > m_Tool_InformationStoreName
static const std::string varTypeName_Ratio()
static const std::string varTypeName_PID()
Tool_FeatureExtractor(const std::string &name)
static const std::string varTypeName_DeltaR()
static const std::string varTypeName_Combined()
static const std::string varTypeName_Basic()
static const std::string varTypeName_HLV()
StatusCode addConstituentMomenta(PanTau::PanTauSeed *inSeed) const
ToolHandle< PanTau::ITool_InformationStore > m_Tool_InformationStore
static const std::string varTypeName_Angle()
StatusCode calculateFeatures(PanTau::PanTauSeed *inSeed, int tauConstituentType, const std::map< std::string, double > &variants_SeedEt) const
std::vector< double > m_Config_CellBased_EtaBinned_Pi0MVACut_3prong
std::vector< double > m_Config_CellBased_EtaBinned_Pi0MVACut_1prong
static const std::string varTypeName_Mean()
static void addFeatureWrtSeedEnergy(PanTau::TauFeature *targetMap, const std::string &featName, double numerator, const std::map< std::string, double > &denominatorMap)
StatusCode addCombinedFeatures(PanTau::PanTauSeed *inSeed, const std::map< std::string, double > &variants_SeedEt) const
static const std::string varTypeName_JetMoment()
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
PanTau::HelperFunctions m_HelperFunctions
virtual StatusCode execute(PanTau::PanTauSeed *inSeed) const override
static const std::string varTypeName_StdDev()
StatusCode calculateBasicFeatures(PanTau::PanTauSeed *inSeed) const
static void fillVariantsSeedEt(const std::vector< PanTau::TauConstituent * > &tauConstituents, std::map< std::string, double > &variants_SeedEt)
Base class for the dual-use tool implementation classes.
Definition AsgTool.h:47