CMS 3D CMS Logo

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    enum DebugLevel_pi0 { pDEBUG = 0, pINFO = 1, pERROR = 2 };
00021 
00022    typedef std::map<DetId, EcalRecHit> RecHitsMap;
00023 
00024    EndcapPiZeroDiscriminatorAlgo() :
00025    preshStripEnergyCut_(0.), preshSeededNstr_(5), debugLevel_(pINFO), pathToFiles_("")
00026    {}
00027 
00028    EndcapPiZeroDiscriminatorAlgo(double stripEnergyCut, int nStripCut, const std::string& path,
00029                                  DebugLevel_pi0 debugLevel );
00030 
00031    ~EndcapPiZeroDiscriminatorAlgo() {};
00032 
00033    std::vector<float>  findPreshVector(ESDetId strip, RecHitsMap *rechits_map,
00034                                          CaloSubdetectorTopology *topology_p);
00035 
00036    void findPi0Road(ESDetId strip, EcalPreshowerNavigator& theESNav, int plane, std::vector<ESDetId>& vout);
00037 
00038    bool goodPi0Strip(RecHitsMap::iterator candidate_it, ESDetId lastID);
00039 
00040    void readWeightFile(const char *WFile);
00041 
00042    float Activation_fun(float SUM);
00043 
00044    float getNNoutput(int sel_wfile);
00045 
00046    bool calculateNNInputVariables(std::vector<float>& vph1, std::vector<float>& vph2,
00047                                           float pS1_max, float pS9_max, float pS25_max);
00048 
00049    void calculateBarrelNNInputVariables(float et, double s1, double s9, double s25, double m2, double cee, double cep,
00050                                         double cpp, double s4, double s6, double ratio, double xcog, double ycog);  
00051 
00052 
00053    float GetNNOutput(float EE_Et);
00054 
00055    float GetBarrelNNOutput(float EB_Et);  
00056 
00057 
00058    float* get_input_vector() {return input_var;};
00059 
00060  private:
00061 
00062    double preshStripEnergyCut_;
00063    int preshSeededNstr_;
00064    int debugLevel_;
00065 
00066    int inp_var;
00067    int barrelstart;  
00068 
00069    int Nfiles_EB;
00070    int Nfiles_EE;
00071 
00072    int Layers, Indim, Hidden, Outdim;
00073    int EE_Layers, EE_Indim, EE_Hidden, EE_Outdim;
00074    int EB_Layers, EB_Indim, EB_Hidden, EB_Outdim;
00075 
00076    float* I_H_Weight;
00077    float* H_O_Weight;
00078    float* H_Thresh;
00079    float* O_Thresh;
00080 
00081    std::vector<float> I_H_Weight_all;
00082    std::vector<float> H_O_Weight_all;
00083    std::vector<float> H_Thresh_all;
00084    std::vector<float> O_Thresh_all;
00085 
00086    float* input_var;
00087 //   float input_var[25]; // array with the 25 variables to be used as input in NN
00088 
00089 
00090    // The map of hits
00091    RecHitsMap *rechits_map;
00092 
00093    // path to weight files
00094   std::string pathToFiles_;
00095 
00096 };
00097 #endif
00098 

Generated on Tue Jun 9 17:43:11 2009 for CMSSW by  doxygen 1.5.4