00001 #ifndef LikelihoodPdf_H 00002 #define LikelihoodPdf_H 00003 00004 #include "CondFormats/PhysicsToolsObjects/interface/Histogram.h" 00005 #include "CondFormats/EgammaObjects/interface/ElectronLikelihoodCalibration.h" 00006 #include <TH1F.h> 00007 #include <TDirectory.h> 00008 #include <string> 00009 #include <vector> 00010 #include <map> 00011 00012 class LikelihoodPdf { 00013 00014 public: 00015 LikelihoodPdf() {}; 00016 LikelihoodPdf(const LikelihoodPdf& pdf) {}; 00017 LikelihoodPdf(const char* name, const char* species, int ecalsubdet, int ptbin); 00018 virtual ~LikelihoodPdf(); 00019 00021 void initFromDB(const ElectronLikelihoodCalibration *calibration); 00022 00025 void split(std::map<std::string,float> splitFractions, bool splitPdf = false); 00026 00028 float getVal(float x, std::string catName="NOSPLIT", bool normalized = true); 00029 00031 std::string getName() { return _name; } 00032 00034 std::string getSpecies() { return _species; } 00035 00036 00037 00038 private: 00039 00040 float normalization(const PhysicsTools::Calibration::HistogramF *thePdf); 00041 00042 std::string _name; 00043 std::string _species; 00044 int _ecalsubdet; 00045 int _ptbin; 00046 00047 std::map<std::string,const PhysicsTools::Calibration::HistogramF*> _splitPdf; 00048 std::map<std::string,std::string> _splitRule; 00049 00050 }; 00051 00052 #endif