std::cerr << "WARNING in LauFlavTag::cacheInputFitVars : Invalid true tag value " << curEvtTrueTagFlv << " for event " << iEvt << ", setting it to +1" << std::endl;
curEvtTrueTagFlv = +1;
} else if ( curEvtTrueTagFlv < -1 ){
std::cerr << "WARNING in LauFlavTag::cacheInputFitVars : Invalid true tag value " << curEvtTrueTagFlv << " for event " << iEvt << ", setting it to -1" << std::endl;
//Transform to omega prime - TODO isn't this the inverse, getLittleOmega is actually giving us omegaPrime and on the next line we convert back to omega?
if (useEtaPrime_){
omegaPrime = (1/(1+TMath::Exp(-1.0*omega)));
}else{
omegaPrime = omega;
}
//little omega must be between 0 and 1. Force this for now, if the fits keep getting stuck can look more closely at it.
static Bool_t tooSmallWarningIssued {kFALSE};
static Bool_t tooLargeWarningIssued {kFALSE};
if (omegaPrime < 0.0){
if ( not tooSmallWarningIssued ) {
std::cerr << "WARNING in LauFlavTag::getCapitalOmega : The value of little omega is less than 0, shifting to 0\n";
std::cerr << " : Further WARNINGs of this type will be suppressed" << std::endl;
tooSmallWarningIssued = kTRUE;
}
omegaPrime = 0.0;
}
if (omegaPrime > 1.0){
if ( not tooLargeWarningIssued ) {
std::cerr << "WARNING in LauFlavTag::getCapitalOmega : The value of little omega is greater than 1, shifting to 1\n";
std::cerr << " : Further WARNINGs of this type will be suppressed" << std::endl;
tooLargeWarningIssued = kTRUE;
}
omegaPrime = 1.0;
}
//eta PDF value
std::vector<Double_t> abs;
abs.push_back(curEvtMistag_[position]);
etaPdfs_[position]->calcLikelihoodInfo(abs);
Double_t h { etaPdfs_[position]->getLikelihood() };
const Double_t u { 2.0 }; // the PDF value for a uniform PDF between 0.0 and 0.5
//If h returns 0 for a tagged event, the event likelihood will be zero
if (h==0 && delta0==0){
std::cerr << "WARNING in LauFlavTag::getCapitalOmega : The value of the eta PDF is zero at eta = " << curEvtMistag_[position] << ", shifting to 0.1" << std::endl;
std::cerr << "ERROR in LauFlavTag::getLittleOmegaBkgnd : Invalid flag, you must request either omega (+1) or omega bar (-1) to be returned" << std::endl;
//Fill in with the various options of flag = +-1, type = signal-like, combinatorial etc
if ( flag == Flavour::Unknown ){
std::cerr << "ERROR in LauFlavTag::getCapitalOmegaBkgnd : Invalid flag, you must request either Omega (+1) or Omega bar (-1) to be returned" << std::endl;
return 0.0;
}
//Delta functions to control which terms contribute
Int_t deltap1(0), deltam1(0), delta0(0);
if (curEvtTagFlv_[position] == Flavour::Bbar){
deltam1 = 1;
} else if(curEvtTagFlv_[position] == Flavour::B){
deltap1 = 1;
} else{
delta0 = 1;
}
//Efficiency
Double_t effB0(0.0), effB0bar(0.0);
if (useAveDelta_){
if (tagEffBkgnd_ave_[classID][position]==nullptr){
std::cout << "INFO in LauFlavTag::setBkgndParams : Added efficiency parameters and eta PDF for background " << bkgndName << " for tagger " << taggerName << std::endl;
std::cout << "INFO in LauFlavTag::setBkgndParams : Added efficiency histograms and eta PDF for background " << bkgndName << " for tagger " << taggerName << std::endl;
std::cout << "INFO in LauFlavTag::addP0GaussianConstraints : Added Gaussian constraints for the P0 calibration parameters of tagger " << name << std::endl;
std::cout << "INFO in LauFlavTag::addP1GaussianConstraints : Added Gaussian constraints for the P1 calibration parameters of tagger " << name << std::endl;
std::cout << "INFO in LauFlavTag::addTagEffGaussianConstraints : Added Gaussian constraints for the tagging efficiency parameters of tagger " << name << std::endl;