CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_7_hltpatch2/src/RecoEcal/EgammaClusterAlgos/interface/EndcapPiZeroDiscriminatorAlgo.h

Go to the documentation of this file.
00001 #ifndef RecoEcal_EgammaClusterAlgos_EndcapPiZeroDiscriminatorAlgo_h
00002 #define RecoEcal_EgammaClusterAlgos_EndcapPiZeroDiscriminatorAlgo_h
00003 
00004 #include "DataFormats/EcalDetId/interface/ESDetId.h"
00005 #include "DataFormats/EcalRecHit/interface/EcalRecHit.h"
00006 #include "RecoCaloTools/Navigation/interface/EcalPreshowerNavigator.h"
00007 
00008 
00009 // C/C++ headers
00010 #include <string>
00011 #include <vector>
00012 #include <map>
00013 
00014 // authors A. Kyriakis , D. Maletic
00015 
00016 class EndcapPiZeroDiscriminatorAlgo {
00017 
00018  public:
00019 
00020    typedef std::map<DetId, EcalRecHit> RecHitsMap;
00021 
00022    EndcapPiZeroDiscriminatorAlgo() :
00023      preshStripEnergyCut_(0.), preshSeededNstr_(5), pathToFiles_("")
00024    {}
00025 
00026    EndcapPiZeroDiscriminatorAlgo(double stripEnergyCut, int nStripCut, 
00027                                  const std::string& path);
00028 
00029    ~EndcapPiZeroDiscriminatorAlgo() {};
00030 
00031    std::vector<float>  findPreshVector(ESDetId strip, RecHitsMap *rechits_map,
00032                                          CaloSubdetectorTopology *topology_p);
00033 
00034    void findPi0Road(ESDetId strip, EcalPreshowerNavigator& theESNav, int plane, std::vector<ESDetId>& vout);
00035 
00036    bool goodPi0Strip(RecHitsMap::iterator candidate_it, ESDetId lastID);
00037 
00038    void readWeightFile(const char *WFile);
00039 
00040    float Activation_fun(float SUM);
00041 
00042    float getNNoutput(int sel_wfile);
00043 
00044    bool calculateNNInputVariables(std::vector<float>& vph1, std::vector<float>& vph2,
00045                                           float pS1_max, float pS9_max, float pS25_max, int EScorr);
00046 
00047    void calculateBarrelNNInputVariables(float et, double s1, double s9, double s25, double m2, double cee, double cep,
00048                                         double cpp, double s4, double s6, double ratio, double xcog, double ycog);  
00049 
00050 
00051    float GetNNOutput(float EE_Et);
00052 
00053    float GetBarrelNNOutput(float EB_Et);  
00054 
00055 
00056    float* get_input_vector() {return input_var;};
00057 
00058  private:
00059 
00060    double preshStripEnergyCut_;
00061    int preshSeededNstr_;
00062    int debugLevel_;
00063 
00064    int inp_var;
00065    int barrelstart;  
00066 
00067    int Nfiles_EB;
00068    int Nfiles_EE;
00069 
00070    int Layers, Indim, Hidden, Outdim;
00071    int EE_Layers, EE_Indim, EE_Hidden, EE_Outdim;
00072    int EB_Layers, EB_Indim, EB_Hidden, EB_Outdim;
00073 
00074    float* I_H_Weight;
00075    float* H_O_Weight;
00076    float* H_Thresh;
00077    float* O_Thresh;
00078 
00079    std::vector<float> I_H_Weight_all;
00080    std::vector<float> H_O_Weight_all;
00081    std::vector<float> H_Thresh_all;
00082    std::vector<float> O_Thresh_all;
00083 
00084    float* input_var;
00085 //   float input_var[25]; // array with the 25 variables to be used as input in NN
00086 
00087 
00088    // The map of hits
00089    RecHitsMap *rechits_map;
00090 
00091    // path to weight files
00092   std::string pathToFiles_;
00093 
00094 };
00095 #endif
00096