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 // C/C++ headers
9 #include <string>
10 #include <vector>
11 #include <map>
12 
13 // authors A. Kyriakis , D. Maletic
14 
16 public:
17  typedef std::map<DetId, EcalRecHit> RecHitsMap;
18 
20 
21  EndcapPiZeroDiscriminatorAlgo(double stripEnergyCut, int nStripCut, const std::string& path);
22 
23  std::vector<float> findPreshVector(ESDetId strip, RecHitsMap* rechits_map, CaloSubdetectorTopology* topology_p);
24 
25  void findPi0Road(ESDetId strip, EcalPreshowerNavigator& theESNav, int plane, std::vector<ESDetId>& vout);
26 
27  bool goodPi0Strip(RecHitsMap::iterator candidate_it, ESDetId lastID);
28 
30  std::vector<float>& vph1, std::vector<float>& vph2, float pS1_max, float pS9_max, float pS25_max, int EScorr);
31 
33  double s1,
34  double s9,
35  double s25,
36  double m2,
37  double cee,
38  double cep,
39  double cpp,
40  double s4,
41  double s6,
42  double ratio,
43  double xcog,
44  double ycog);
45 
46  float GetNNOutput(float EE_Et);
47 
48  float GetBarrelNNOutput(float EB_Et);
49 
50  std::vector<float> const& get_input_vector() const { return input_var; }
51 
52 private:
53  void readWeightFile(const char* WFile, int& Layers, int& Indim, int& Hidden, int& Outdim);
54  float getNNoutput(int sel_wfile, int Layers, int Indim, int Hidden, int Outdim, int barrelstart) const;
55  float Activation_fun(float SUM) const;
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 #endif
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)
std::map< DetId, EcalRecHit > RecHitsMap
std::vector< float > const & get_input_vector() const
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)
float getNNoutput(int sel_wfile, int Layers, int Indim, int Hidden, int Outdim, int barrelstart) const
bool goodPi0Strip(RecHitsMap::iterator candidate_it, ESDetId lastID)
#define SUM(A, B)
std::map< DetId, EcalRecHit > RecHitsMap
bool calculateNNInputVariables(std::vector< float > &vph1, std::vector< float > &vph2, float pS1_max, float pS9_max, float pS25_max, int EScorr)