8 int ecalsubdet,
int ptbin)
10 _name=std::string(name);
20 std::vector<LikelihoodSpecies*>::iterator specItr;
50 std::vector<LikelihoodSpecies*>::const_iterator specItr;
53 if(strcmp(species->
getName(),specname)==0) {
66 const char* catName,
float frac) {
67 std::vector<LikelihoodSpecies*>::const_iterator specItr;
70 if(strcmp(species->
getName(),specname)==0) {
81 std::vector<float> measurements,
84 float sigProb=0, bkgProb=0;
85 std::vector<LikelihoodSpecies*>::const_iterator specItr;
89 std::map<std::string,float>::iterator iter = splitFractions.find(gsfClass);
91 float splitFr= (splitFractions.size()==0) ? 1. : iter->second;
92 if(strcmp(species->
getName(),specname)==0) {
100 return sigProb/(sigProb+bkgProb);
109 std::vector<float> measurements,
110 std::string gsfClass)
113 float priorWeight=1.;
114 std::vector<LikelihoodSpecies*>::const_iterator specItr;
117 if(strcmp(species->
getName(),specName)==0) {
118 for(
unsigned int ipdf=0; ipdf< species->
getListOfPdfs().size(); ipdf++) {
119 bareProb*=species->
getListOfPdfs().at(ipdf)->getVal(measurements.at(ipdf),gsfClass);
125 edm::LogInfo(
"LikelihoodPdfProduct") <<
"Species: " << specName
126 <<
" bare probability = " << bareProb
127 <<
" with a priori probability = " << priorWeight;
128 return priorWeight*bareProb;
void initFromDB(const ElectronLikelihoodCalibration *calibration)
initialize the PDFs from CondDB
void addPdf(LikelihoodPdf *pdf)
void setSplitFraction(std::pair< std::string, float > splitfrac)
void setSplitFrac(const char *specname, const char *catName, float frac=1.0)
set the fraction of one category for a given species
void addSpecies(const char *name, float priorWeight=1.)
add a species (hypothesis) to the likelihood, with a priori probability
float getRatio(const char *specName, std::vector< float > measurements, std::string)
get the likelihood ratio p(a priori) * L(specName) / L_tot
LikelihoodPdfProduct(const char *name, int ecalsubdet, int ptbin)
float getSpeciesProb(const char *specName, std::vector< float > measurements, std::string gsfClass)
void initFromDB(const ElectronLikelihoodCalibration *calibration)
initialize PDFs from CondDB
std::vector< LikelihoodSpecies * > _specList
std::map< std::string, float > getSplitFractions()
void addPdf(const char *specname, const char *name, bool splitPdf=false)
add a pdf for a species, splitted or not
void split(std::map< std::string, float > splitFractions, bool splitPdf=false)
std::vector< LikelihoodPdf * > getListOfPdfs()
const ElectronLikelihoodCalibration * _calibration