ATLAS Offline Software
Tool_FeatureExtractor.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 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"
15 
16 // PanTau
21 #include "PanTauAlgs/TauFeature.h"
22 
23 namespace PanTau {
24 
31 
33 
34  public:
35 
36  Tool_FeatureExtractor(const std::string &name);
37  virtual StatusCode initialize() override;
38 
39  //get the features for an input seed
40  virtual StatusCode execute(PanTau::PanTauSeed* inSeed) const override;
41 
42  protected:
43 
44  //handle to the helper function
46  ToolHandle<PanTau::ITool_InformationStore> m_Tool_InformationStore;
48 
49  //Function to calculate basic features
51 
52  //Function to calculate features for one set of constituents
54  int tauConstituentType,
55  const std::map<std::string, double>& variants_SeedEt) const;
56 
57  //Function to add the 4 momenta of the tau constituents to the features
59 
60  //Function to calculate features based on two sets of constituents
62  const std::map<std::string, double>& variants_SeedEt) const;
63 
64  //Function to add impact parameter features
66 
67  //Function to fill the variants_SeedEt member
68  static void fillVariantsSeedEt(const std::vector<PanTau::TauConstituent*>& tauConstituents,
69  std::map<std::string, double>& variants_SeedEt) ;
70 
71  //helper function to fill the variants_SeedEt map
72  static void addFeatureWrtSeedEnergy(PanTau::TauFeature* targetMap,
73  const std::string& featName,
74  double numerator,
75  const std::map<std::string, double>& denominatorMap) ;
76 
78 
79 
81  std::vector<double> m_Config_CellBased_BinEdges_Eta;
84 
85  //make these configured via python! (super trick ;))
86  static const std::string varTypeName_Sum() {return "Sum";}
87  static const std::string varTypeName_Ratio() {return "Ratio";}
88  static const std::string varTypeName_EtInRing() {return "EtInRing";}
89  static const std::string varTypeName_Isolation() {return "Isolation";}
90  static const std::string varTypeName_Num() {return "Num";}
91  static const std::string varTypeName_Mean() {return "Mean";}
92  static const std::string varTypeName_StdDev() {return "StdDev";}
93  static const std::string varTypeName_HLV() {return "HLV";}
94  static const std::string varTypeName_Angle() {return "Angle";}
95  static const std::string varTypeName_DeltaR() {return "DeltaR";}
96  static const std::string varTypeName_JetMoment() {return "JetMoment";}
97  static const std::string varTypeName_Combined() {return "Combined";}
98  static const std::string varTypeName_JetShape() {return "JetShape";}
99  static const std::string varTypeName_ImpactParams() {return "ImpactParams";}
100  static const std::string varTypeName_Basic() {return "Basic";}
101  static const std::string varTypeName_PID() {return "PID";}
102  static const std::string varTypeName_Shots() {return "Shots";}
103 
104  std::string m_varTypeName_Sum;
105  std::string m_varTypeName_Ratio;
108  std::string m_varTypeName_Num;
109  std::string m_varTypeName_Mean;
110  std::string m_varTypeName_StdDev;
111  std::string m_varTypeName_HLV;
112  std::string m_varTypeName_Angle;
113  std::string m_varTypeName_DeltaR;
118  std::string m_varTypeName_Basic;
119  std::string m_varTypeName_PID;
120 
121  bool m_init=false;
122 
123  public:
124  inline bool isInitialized() override {return m_init;}
125 };
126 
127 } // end of namespace PanTau
128 #endif // PANTAUALGS_TOOL_FEATUREEXTRACTOR_H
PanTau::Tool_FeatureExtractor::varTypeName_ImpactParams
static const std::string varTypeName_ImpactParams()
Definition: Tool_FeatureExtractor.h:99
PanTau::Tool_FeatureExtractor::addCombinedFeatures
StatusCode addCombinedFeatures(PanTau::PanTauSeed *inSeed, const std::map< std::string, double > &variants_SeedEt) const
Definition: Tool_FeatureExtractor.cxx:807
PanTau::Tool_FeatureExtractor::calculateBasicFeatures
StatusCode calculateBasicFeatures(PanTau::PanTauSeed *inSeed) const
Definition: Tool_FeatureExtractor.cxx:174
PanTau::Tool_FeatureExtractor::fillVariantsSeedEt
static void fillVariantsSeedEt(const std::vector< PanTau::TauConstituent * > &tauConstituents, std::map< std::string, double > &variants_SeedEt)
Definition: Tool_FeatureExtractor.cxx:79
PanTau::Tool_FeatureExtractor::m_Config_CellBased_EtaBinned_Pi0MVACut_3prong
std::vector< double > m_Config_CellBased_EtaBinned_Pi0MVACut_3prong
Definition: Tool_FeatureExtractor.h:83
PanTau::Tool_FeatureExtractor::varTypeName_HLV
static const std::string varTypeName_HLV()
Definition: Tool_FeatureExtractor.h:93
asg::AsgTool
Base class for the dual-use tool implementation classes.
Definition: AsgTool.h:47
PanTau::Tool_FeatureExtractor::m_varTypeName_Basic
std::string m_varTypeName_Basic
Definition: Tool_FeatureExtractor.h:118
PanTau::Tool_FeatureExtractor::m_varTypeName_Num
std::string m_varTypeName_Num
Definition: Tool_FeatureExtractor.h:108
PanTau::Tool_FeatureExtractor::m_varTypeName_JetMoment
std::string m_varTypeName_JetMoment
Definition: Tool_FeatureExtractor.h:114
PanTau::Tool_FeatureExtractor::varTypeName_JetShape
static const std::string varTypeName_JetShape()
Definition: Tool_FeatureExtractor.h:98
PanTau::Tool_FeatureExtractor::m_varTypeName_ImpactParams
std::string m_varTypeName_ImpactParams
Definition: Tool_FeatureExtractor.h:117
PanTau::Tool_FeatureExtractor::m_varTypeName_EtInRing
std::string m_varTypeName_EtInRing
Definition: Tool_FeatureExtractor.h:106
PanTau::Tool_FeatureExtractor::m_varTypeName_Isolation
std::string m_varTypeName_Isolation
Definition: Tool_FeatureExtractor.h:107
ITool_PanTauTools.h
HelperFunctions.h
PanTau::Tool_FeatureExtractor::initialize
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
Definition: Tool_FeatureExtractor.cxx:44
PanTau::Tool_FeatureExtractor::m_varTypeName_Angle
std::string m_varTypeName_Angle
Definition: Tool_FeatureExtractor.h:112
PanTau::Tool_FeatureExtractor
Definition: Tool_FeatureExtractor.h:30
PanTau::Tool_FeatureExtractor::varTypeName_DeltaR
static const std::string varTypeName_DeltaR()
Definition: Tool_FeatureExtractor.h:95
PanTau::Tool_FeatureExtractor::m_init
bool m_init
Definition: Tool_FeatureExtractor.h:121
PanTau::Tool_FeatureExtractor::Tool_FeatureExtractor
Tool_FeatureExtractor(const std::string &name)
Definition: Tool_FeatureExtractor.cxx:34
PanTau::Tool_FeatureExtractor::varTypeName_Num
static const std::string varTypeName_Num()
Definition: Tool_FeatureExtractor.h:90
PanTau::Tool_FeatureExtractor::addFeatureWrtSeedEnergy
static void addFeatureWrtSeedEnergy(PanTau::TauFeature *targetMap, const std::string &featName, double numerator, const std::map< std::string, double > &denominatorMap)
Definition: Tool_FeatureExtractor.cxx:115
PanTau::TauFeature
Definition: TauFeature.h:19
PanTau::Tool_FeatureExtractor::m_varTypeName_Ratio
std::string m_varTypeName_Ratio
Definition: Tool_FeatureExtractor.h:105
PanTau::Tool_FeatureExtractor::m_varTypeName_DeltaR
std::string m_varTypeName_DeltaR
Definition: Tool_FeatureExtractor.h:113
TauConstituent.h
PanTau::Tool_FeatureExtractor::varTypeName_PID
static const std::string varTypeName_PID()
Definition: Tool_FeatureExtractor.h:101
PanTau::Tool_FeatureExtractor::m_varTypeName_JetShape
std::string m_varTypeName_JetShape
Definition: Tool_FeatureExtractor.h:116
PanTau::Tool_FeatureExtractor::varTypeName_StdDev
static const std::string varTypeName_StdDev()
Definition: Tool_FeatureExtractor.h:92
PanTau::Tool_FeatureExtractor::varTypeName_Ratio
static const std::string varTypeName_Ratio()
Definition: Tool_FeatureExtractor.h:87
PanTau::Tool_FeatureExtractor::m_Tool_InformationStore
ToolHandle< PanTau::ITool_InformationStore > m_Tool_InformationStore
Definition: Tool_FeatureExtractor.h:46
ITool_InformationStore.h
PanTau::HelperFunctions
Definition: Reconstruction/PanTau/PanTauAlgs/PanTauAlgs/HelperFunctions.h:26
PanTau::Tool_FeatureExtractor::isInitialized
bool isInitialized() override
Definition: Tool_FeatureExtractor.h:124
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
PanTau::Tool_FeatureExtractor::m_varTypeName_Combined
std::string m_varTypeName_Combined
Definition: Tool_FeatureExtractor.h:115
PanTau::Tool_FeatureExtractor::varTypeName_Shots
static const std::string varTypeName_Shots()
Definition: Tool_FeatureExtractor.h:102
PanTau::Tool_FeatureExtractor::m_HelperFunctions
PanTau::HelperFunctions m_HelperFunctions
Definition: Tool_FeatureExtractor.h:45
PanTau::Tool_FeatureExtractor::m_varTypeName_Sum
std::string m_varTypeName_Sum
Definition: Tool_FeatureExtractor.h:104
PanTau::Tool_FeatureExtractor::calculateFeatures
StatusCode calculateFeatures(PanTau::PanTauSeed *inSeed, int tauConstituentType, const std::map< std::string, double > &variants_SeedEt) const
Definition: Tool_FeatureExtractor.cxx:298
PanTau::Tool_FeatureExtractor::varTypeName_Sum
static const std::string varTypeName_Sum()
Definition: Tool_FeatureExtractor.h:86
PanTau::Tool_FeatureExtractor::varTypeName_Isolation
static const std::string varTypeName_Isolation()
Definition: Tool_FeatureExtractor.h:89
PanTau::Tool_FeatureExtractor::varTypeName_Combined
static const std::string varTypeName_Combined()
Definition: Tool_FeatureExtractor.h:97
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
PanTau::Tool_FeatureExtractor::m_Config_UseEmptySeeds
int m_Config_UseEmptySeeds
Definition: Tool_FeatureExtractor.h:77
PanTau::Tool_FeatureExtractor::m_Config_CellBased_BinEdges_Eta
std::vector< double > m_Config_CellBased_BinEdges_Eta
Helper members.
Definition: Tool_FeatureExtractor.h:81
PanTau::Tool_FeatureExtractor::varTypeName_Basic
static const std::string varTypeName_Basic()
Definition: Tool_FeatureExtractor.h:100
PanTau::Tool_FeatureExtractor::m_varTypeName_PID
std::string m_varTypeName_PID
Definition: Tool_FeatureExtractor.h:119
PanTau
xAOD EDM
Definition: Reconstruction/PanTau/PanTauAlgs/PanTauAlgs/HelperFunctions.h:18
PanTau::Tool_FeatureExtractor::m_varTypeName_StdDev
std::string m_varTypeName_StdDev
Definition: Tool_FeatureExtractor.h:110
PanTau::Tool_FeatureExtractor::execute
virtual StatusCode execute(PanTau::PanTauSeed *inSeed) const override
Definition: Tool_FeatureExtractor.cxx:129
ASG_TOOL_CLASS1
#define ASG_TOOL_CLASS1
Definition: AsgToolMacros.h:75
PanTau::Tool_FeatureExtractor::addConstituentMomenta
StatusCode addConstituentMomenta(PanTau::PanTauSeed *inSeed) const
Definition: Tool_FeatureExtractor.cxx:236
PanTau::Tool_FeatureExtractor::varTypeName_JetMoment
static const std::string varTypeName_JetMoment()
Definition: Tool_FeatureExtractor.h:96
TauFeature.h
PanTau::Tool_FeatureExtractor::m_Tool_InformationStoreName
std::string m_Tool_InformationStoreName
Definition: Tool_FeatureExtractor.h:47
ToolHandle.h
AsgTool.h
PanTau::Tool_FeatureExtractor::m_Config_CellBased_EtaBinned_Pi0MVACut_1prong
std::vector< double > m_Config_CellBased_EtaBinned_Pi0MVACut_1prong
Definition: Tool_FeatureExtractor.h:82
PanTau::Tool_FeatureExtractor::varTypeName_Angle
static const std::string varTypeName_Angle()
Definition: Tool_FeatureExtractor.h:94
PanTau::Tool_FeatureExtractor::m_varTypeName_Mean
std::string m_varTypeName_Mean
Definition: Tool_FeatureExtractor.h:109
PanTau::Tool_FeatureExtractor::addImpactParameterFeatures
StatusCode addImpactParameterFeatures(PanTau::PanTauSeed *inSeed) const
Definition: Tool_FeatureExtractor.cxx:1008
PanTau::Tool_FeatureExtractor::varTypeName_EtInRing
static const std::string varTypeName_EtInRing()
Definition: Tool_FeatureExtractor.h:88
PanTau::ITool_PanTauTools
Interface for PID from tau seeds.
Definition: ITool_PanTauTools.h:39
PanTau::Tool_FeatureExtractor::m_varTypeName_HLV
std::string m_varTypeName_HLV
Definition: Tool_FeatureExtractor.h:111
PanTau::PanTauSeed
Definition: PanTauSeed.h:24
PanTau::Tool_FeatureExtractor::varTypeName_Mean
static const std::string varTypeName_Mean()
Definition: Tool_FeatureExtractor.h:91