8 int ecalsubdet,
int ptbin)
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 const 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 const std::vector<float>& measurements,
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
LikelihoodPdfProduct(const char *name, int ecalsubdet, int ptbin)
void initFromDB(const ElectronLikelihoodCalibration *calibration)
initialize PDFs from CondDB
float getSpeciesProb(const char *specName, const std::vector< float > &measurements, std::string gsfClass)
std::vector< LikelihoodSpecies * > _specList
void split(const std::map< std::string, float > &splitFractions, bool splitPdf=false)
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
float getRatio(const char *specName, const std::vector< float > &measurements, std::string)
get the likelihood ratio p(a priori) * L(specName) / L_tot
std::vector< LikelihoodPdf * > getListOfPdfs()
const ElectronLikelihoodCalibration * _calibration