CMS 3D CMS Logo

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  typedef std::map<DetId, EcalRecHit> RecHitsMap;
21 
24  {}
25 
26  EndcapPiZeroDiscriminatorAlgo(double stripEnergyCut, int nStripCut,
27  const std::string& path);
28 
29  std::vector<float> findPreshVector(ESDetId strip, RecHitsMap *rechits_map,
30  CaloSubdetectorTopology *topology_p);
31 
32  void findPi0Road(ESDetId strip, EcalPreshowerNavigator& theESNav, int plane, std::vector<ESDetId>& vout);
33 
34  bool goodPi0Strip(RecHitsMap::iterator candidate_it, ESDetId lastID);
35 
36 
37  bool calculateNNInputVariables(std::vector<float>& vph1, std::vector<float>& vph2,
38  float pS1_max, float pS9_max, float pS25_max, int EScorr);
39 
40  void calculateBarrelNNInputVariables(float et, double s1, double s9, double s25, double m2, double cee, double cep,
41  double cpp, double s4, double s6, double ratio, double xcog, double ycog);
42 
43 
44  float GetNNOutput(float EE_Et);
45 
46  float GetBarrelNNOutput(float EB_Et);
47 
48 
49  std::vector<float>const & get_input_vector() const {return input_var;}
50 
51  private:
52  void readWeightFile(const char *WFile,int& Layers, int& Indim, int& Hidden, int& Outdim);
53  float getNNoutput(int sel_wfile, int Layers, int Indim, int Hidden, int Outdim, int barrelstart) const;
54  float Activation_fun(float SUM) const;
55 
56 
60 
63 
64  std::vector<float> I_H_Weight_all;
65  std::vector<float> H_O_Weight_all;
66  std::vector<float> H_Thresh_all;
67  std::vector<float> O_Thresh_all;
68 
69  std::vector<float> input_var;
70 // float input_var[25]; // array with the 25 variables to be used as input in NN
71 
72 };
73 #endif
74 
void findPi0Road(ESDetId strip, EcalPreshowerNavigator &theESNav, int plane, std::vector< ESDetId > &vout)
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)
float getNNoutput(int sel_wfile, int Layers, int Indim, int Hidden, int Outdim, int barrelstart) const
std::map< DetId, EcalRecHit > RecHitsMap
void readWeightFile(const char *WFile, int &Layers, int &Indim, int &Hidden, int &Outdim)
std::vector< float > findPreshVector(ESDetId strip, RecHitsMap *rechits_map, CaloSubdetectorTopology *topology_p)
std::vector< float > const & get_input_vector() const
bool goodPi0Strip(RecHitsMap::iterator candidate_it, ESDetId lastID)
#define SUM(A, B)
et
define resolution functions of each parameter
bool calculateNNInputVariables(std::vector< float > &vph1, std::vector< float > &vph2, float pS1_max, float pS9_max, float pS25_max, int EScorr)