Tool_FeatureExtractor.h 6.1 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*
  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/

///////////////////////////////////////////////////////////////////
//  Header file for class Tool_FeatureExtractor
///////////////////////////////////////////////////////////////////
// (c) ATLAS Detector software
///////////////////////////////////////////////////////////////////
// Tool to extract jet features from tau seeds
///////////////////////////////////////////////////////////////////
// sebastian.fleischmann@cern.ch
///////////////////////////////////////////////////////////////////

#ifndef PANTAUALGS_TOOL_FEATUREEXTRACTOR_H
#define PANTAUALGS_TOOL_FEATUREEXTRACTOR_H

#include <string>
#include <map>
#include <vector>

22
23
24
//! ASG
#include "AsgTools/AsgTool.h"
#include "AsgTools/ToolHandle.h"
25
26

// PanTau
27
28
29
30
31
32
33
#include "PanTauAlgs/HelperFunctions.h"
#include "PanTauAlgs/ITool_PanTauTools.h"
#include "PanTauAlgs/ITool_InformationStore.h"
#include "PanTauAlgs/TauConstituent.h"
#include "PanTauAlgs/TauFeature.h"

//#include "ITrackToVertex/ITrackToVertex.h"
34
35
36
37
38
39
40
41
42


namespace PanTau {
    
/** @class Tool_FeatureExtractor
    Tool to extract jet features from tau seeds.
    @author Christian Limbach
    @author Sebastian Fleischmann
*/
43
44
45
  class Tool_FeatureExtractor : public asg::AsgTool, virtual public PanTau::ITool_PanTauTools {

    ASG_TOOL_CLASS1(Tool_FeatureExtractor, PanTau::ITool_PanTauTools)
46
47
48
    
    public:

49
        Tool_FeatureExtractor(const std::string &name);
50
51
52
53
54
55
//         virtual ~Tool_FeatureExtractor ();
        virtual StatusCode initialize();
//         virtual StatusCode finalize  ();
        
        
        //get the features for an input seed
56
        virtual StatusCode execute(PanTau::PanTauSeed2* inSeed);
57
58
59
60
61
        void Log10();
        
    protected:
        
        //handle to the helper function
62
        PanTau::HelperFunctions   m_HelperFunctions;
63
        ToolHandle<PanTau::ITool_InformationStore>  m_Tool_InformationStore;
64
	std::string m_Tool_InformationStoreName;
65
	//ToolHandle<Reco::ITrackToVertex> m_trackToVertexTool;
66
67
68
69
70
        
        //map containing different methods to calc seed et
        std::map<std::string, double>   m_Variants_SeedEt;
        
        //Function to calculate basic features
71
        StatusCode calculateBasicFeatures(PanTau::PanTauSeed2* inSeed);
72
73
        
        //Function to calculate features for one set of constituents
74
        StatusCode calculateFeatures(PanTau::PanTauSeed2*    inSeed,
75
76
77
                                     int                    tauConstituentType);
        
        //Function to add the 4 momenta of the tau constituents to the features
78
        StatusCode addConstituentMomenta(PanTau::PanTauSeed2* inSeed);
79
80
        
        //Function to calculate features based on two sets of constituents
81
        StatusCode addCombinedFeatures(PanTau::PanTauSeed2* inSeed);
82
83
        
        //Function to calculate generic jet features
84
        StatusCode addGenericJetFeatures(PanTau::PanTauSeed2* inSeed) const;
85
86
        
        //Function to add impact parameter features
87
        StatusCode addImpactParameterFeatures(PanTau::PanTauSeed2* inSeed) const;
88
89
        
        //Function to fill the m_Variants_SeedEt member
90
        void fillVariantsSeedEt(std::vector<PanTau::TauConstituent2*> tauConstituents);
91
92
93
        
        
        //helper function to fill the m_Variants_SeedEt map
94
        void    addFeatureWrtSeedEnergy(PanTau::TauFeature2* targetMap,
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
                                        std::string featName,
                                        double numerator,
                                        std::map<std::string, double>* denominatorMap) const;
        
        int     m_Config_UseEmptySeeds;
        
        
        //! Helper members  m_Config_CellBased_EtaBinned_Pi0MVACut_3prong
        std::vector<double> m_Config_CellBased_BinEdges_Eta;
        std::vector<double> m_Config_CellBased_EtaBinned_Pi0MVACut_1prong;
        std::vector<double> m_Config_CellBased_EtaBinned_Pi0MVACut_3prong;
        
        //make these configured via python! (super trick ;))
        static const std::string varTypeName_Sum()          {return "Sum";}
        static const std::string varTypeName_Ratio()        {return "Ratio";}
        static const std::string varTypeName_EtInRing()     {return "EtInRing";}
        static const std::string varTypeName_Isolation()    {return "Isolation";}
        static const std::string varTypeName_Num()          {return "Num";}
        static const std::string varTypeName_Mean()         {return "Mean";}
        static const std::string varTypeName_StdDev()       {return "StdDev";}
        static const std::string varTypeName_HLV()          {return "HLV";}
        static const std::string varTypeName_Angle()        {return "Angle";}
        static const std::string varTypeName_DeltaR()       {return "DeltaR";}
        static const std::string varTypeName_JetMoment()    {return "JetMoment";}
        static const std::string varTypeName_Combined()     {return "Combined";}
        static const std::string varTypeName_JetShape()     {return "JetShape";}
        static const std::string varTypeName_ImpactParams() {return "ImpactParams";}
        static const std::string varTypeName_Basic()        {return "Basic";}
        static const std::string varTypeName_PID()          {return "PID";}
        static const std::string varTypeName_Shots()        {return "Shots";}
        
        std::string m_varTypeName_Sum;
        std::string m_varTypeName_Ratio;
        std::string m_varTypeName_EtInRing;
        std::string m_varTypeName_Isolation;
        std::string m_varTypeName_Num;
        std::string m_varTypeName_Mean;
        std::string m_varTypeName_StdDev;
        std::string m_varTypeName_HLV;
        std::string m_varTypeName_Angle;
        std::string m_varTypeName_DeltaR;
        std::string m_varTypeName_JetMoment;
        std::string m_varTypeName_Combined;
        std::string m_varTypeName_JetShape;
        std::string m_varTypeName_ImpactParams;
        std::string m_varTypeName_Basic;
        std::string m_varTypeName_PID;
142
143
144
145

	bool m_init=false;
  public:
	inline bool isInitialized(){return m_init;}
146
147
148
149
150
};

} // end of namespace PanTau
#endif // PANTAUALGS_TOOL_FEATUREEXTRACTOR_H