CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EndcapPiZeroDiscriminatorAlgo.h
Go to the documentation of this file.
1 #ifndef RecoEcal_EgammaClusterAlgos_EndcapPiZeroDiscriminatorAlgo_h
2 #define RecoEcal_EgammaClusterAlgos_EndcapPiZeroDiscriminatorAlgo_h
3 
7 
8 
9 // C/C++ headers
10 #include <string>
11 #include <vector>
12 #include <map>
13 
14 // authors A. Kyriakis , D. Maletic
15 
17 
18  public:
19 
20  enum DebugLevel_pi0 { pDEBUG = 0, pINFO = 1, pERROR = 2 };
21 
22  typedef std::map<DetId, EcalRecHit> RecHitsMap;
23 
26  {}
27 
28  EndcapPiZeroDiscriminatorAlgo(double stripEnergyCut, int nStripCut, const std::string& path,
29  DebugLevel_pi0 debugLevel );
30 
32 
33  std::vector<float> findPreshVector(ESDetId strip, RecHitsMap *rechits_map,
34  CaloSubdetectorTopology *topology_p);
35 
36  void findPi0Road(ESDetId strip, EcalPreshowerNavigator& theESNav, int plane, std::vector<ESDetId>& vout);
37 
38  bool goodPi0Strip(RecHitsMap::iterator candidate_it, ESDetId lastID);
39 
40  void readWeightFile(const char *WFile);
41 
42  float Activation_fun(float SUM);
43 
44  float getNNoutput(int sel_wfile);
45 
46  bool calculateNNInputVariables(std::vector<float>& vph1, std::vector<float>& vph2,
47  float pS1_max, float pS9_max, float pS25_max, int EScorr);
48 
49  void calculateBarrelNNInputVariables(float et, double s1, double s9, double s25, double m2, double cee, double cep,
50  double cpp, double s4, double s6, double ratio, double xcog, double ycog);
51 
52 
53  float GetNNOutput(float EE_Et);
54 
55  float GetBarrelNNOutput(float EB_Et);
56 
57 
58  float* get_input_vector() {return input_var;};
59 
60  private:
61 
62  double preshStripEnergyCut_;
65 
66  int inp_var;
68 
69  int Nfiles_EB;
70  int Nfiles_EE;
71 
75 
76  float* I_H_Weight;
77  float* H_O_Weight;
78  float* H_Thresh;
79  float* O_Thresh;
80 
81  std::vector<float> I_H_Weight_all;
82  std::vector<float> H_O_Weight_all;
83  std::vector<float> H_Thresh_all;
84  std::vector<float> O_Thresh_all;
85 
86  float* input_var;
87 // float input_var[25]; // array with the 25 variables to be used as input in NN
88 
89 
90  // The map of hits
92 
93  // path to weight files
94  std::string pathToFiles_;
95 
96 };
97 #endif
98 
void findPi0Road(ESDetId strip, EcalPreshowerNavigator &theESNav, int plane, std::vector< ESDetId > &vout)
void strip(std::string &input, const std::string &blanks=" \n\t")
Definition: stringTools.cc:16
void calculateBarrelNNInputVariables(float et, double s1, double s9, double s25, double m2, double cee, double cep, double cpp, double s4, double s6, double ratio, double xcog, double ycog)
std::map< DetId, EcalRecHit > RecHitsMap
int path() const
Definition: HLTadd.h:3
std::map< DetId, EcalRecHit > RecHitsMap
Definition: HLTAlCaMonPi0.h:24
std::vector< float > findPreshVector(ESDetId strip, RecHitsMap *rechits_map, CaloSubdetectorTopology *topology_p)
bool goodPi0Strip(RecHitsMap::iterator candidate_it, ESDetId lastID)
#define SUM(A, B)
bool calculateNNInputVariables(std::vector< float > &vph1, std::vector< float > &vph2, float pS1_max, float pS9_max, float pS25_max, int EScorr)