28   : 
asg::AsgMessaging(std::string(
name))
 
   29   , m_doRemoveF3AtHighEt(false)
 
   30   , m_doRemoveTRTPIDAtHighEt(false)
 
   31   , m_doSmoothBinInterpolation(false)
 
   32   , m_useOneExtraHighETLHBin(false)
 
   33   , m_highETBinThreshold(125)
 
   34   , m_doPileupTransform(false)
 
   35   , m_doCentralityTransform(false)
 
   36   , m_discMaxForPileupTransform(2.0)
 
   37   , m_pileupMaxForPileupTransform(50)
 
   41   , m_variableBitMask(0x0)
 
   43   , m_cutPosition_kinematic(-9)
 
   44   , m_cutPosition_NSilicon(-9)
 
   45   , m_cutPosition_NPixel(-9)
 
   46   , m_cutPosition_NBlayer(-9)
 
   47   , m_cutPosition_ambiguity(-9)
 
   48   , m_cutPosition_LH(-9)
 
   49   , m_cutPositionTrackA0(-9)
 
   50   , m_cutPositionTrackMatchEta(-9)
 
   51   , m_cutPositionTrackMatchPhiRes(-9)
 
   52   , m_cutPositionWstotAtHighET(-9)
 
   53   , m_cutPositionEoverPAtHighET(-9)
 
   66   if (m_pdfFileName.empty()) {
 
   67     ATH_MSG_WARNING(
"You need to specify the input PDF file name before you " 
   68                     "call initialize() with " 
   69                     "setPDFFileName('your/file/name.root') ");
 
   70     sc = StatusCode::FAILURE;
 
   73   unsigned int number_of_expected_bin_combinedLH;
 
   74   if (m_useOneExtraHighETLHBin)
 
   75     number_of_expected_bin_combinedLH = s_fnDiscEtBinsOneExtra * s_fnEtaBins;
 
   77     number_of_expected_bin_combinedLH = s_fnDiscEtBins * s_fnEtaBins;
 
   78   unsigned int number_of_expected_bin_combinedOther =
 
   79     s_fnDiscEtBins * s_fnEtaBins;
 
   81   if (m_cutLikelihood.size() != number_of_expected_bin_combinedLH) {
 
   82     ATH_MSG_ERROR(
"Configuration issue :  cutLikelihood expected size " 
   83                   << number_of_expected_bin_combinedLH << 
" input size " 
   84                   << m_cutLikelihood.size());
 
   85     sc = StatusCode::FAILURE;
 
   88   if (!m_discHardCutForPileupTransform.empty()) {
 
   89     if (m_discHardCutForPileupTransform.size() !=
 
   90         number_of_expected_bin_combinedLH) {
 
   92         "Configuration issue :   DiscHardCutForPileupTransform expected size " 
   93         << number_of_expected_bin_combinedLH << 
" input size " 
   94         << m_discHardCutForPileupTransform.size());
 
   95       sc = StatusCode::FAILURE;
 
   98   if (!m_discHardCutSlopeForPileupTransform.empty()) {
 
   99     if (m_discHardCutSlopeForPileupTransform.size() !=
 
  100         number_of_expected_bin_combinedLH) {
 
  102                     "DiscHardCutSlopeForPileupTransform expected size " 
  103                     << number_of_expected_bin_combinedLH << 
" input size " 
  104                     << m_discHardCutSlopeForPileupTransform.size());
 
  105       sc = StatusCode::FAILURE;
 
  108   if (!m_discLooseForPileupTransform.empty()) {
 
  109     if (m_discLooseForPileupTransform.size() !=
 
  110         number_of_expected_bin_combinedLH) {
 
  112         "Configuration issue :   DiscLooseForPileupTransform expected size " 
  113         << number_of_expected_bin_combinedLH << 
" input size " 
  114         << m_discLooseForPileupTransform.size());
 
  115       sc = StatusCode::FAILURE;
 
  120   if (!m_cutA0.empty()) {
 
  121     if (m_cutA0.size() != number_of_expected_bin_combinedOther) {
 
  123                     << number_of_expected_bin_combinedOther << 
" input size " 
  125       sc = StatusCode::FAILURE;
 
  130   if (!m_cutDeltaEta.empty()) {
 
  131     if (m_cutDeltaEta.size() != number_of_expected_bin_combinedOther) {
 
  132       ATH_MSG_ERROR(
"Configuration issue :  CutDeltaEta  expected size " 
  133                     << number_of_expected_bin_combinedOther << 
" input size " 
  134                     << m_cutDeltaEta.size());
 
  135       sc = StatusCode::FAILURE;
 
  140   if (!m_cutDeltaPhiRes.empty()) {
 
  141     if (m_cutDeltaPhiRes.size() != number_of_expected_bin_combinedOther) {
 
  142       ATH_MSG_ERROR(
"Configuration issue :  CutDeltaPhiRes  expected size " 
  143                     << number_of_expected_bin_combinedOther << 
" input size " 
  144                     << m_cutDeltaPhiRes.size());
 
  145       sc = StatusCode::FAILURE;
 
  148   if (
sc == StatusCode::FAILURE) {
 
  150       "Could NOT initialize! Please fix the errors mentioned above...");
 
  158   m_cutPosition_kinematic = m_acceptInfo.addCut(
"kinematic", 
"pass kinematic");
 
  159   if (m_cutPosition_kinematic < 0) {
 
  160     sc = StatusCode::FAILURE;
 
  164   m_cutPosition_NSilicon = m_acceptInfo.addCut(
"NSilicon", 
"pass NSilicon");
 
  165   if (m_cutPosition_NSilicon < 0) {
 
  166     sc = StatusCode::FAILURE;
 
  170   m_cutPosition_NPixel = m_acceptInfo.addCut(
"NPixel", 
"pass NPixel");
 
  171   if (m_cutPosition_NPixel < 0) {
 
  172     sc = StatusCode::FAILURE;
 
  176   m_cutPosition_NBlayer = m_acceptInfo.addCut(
"NBlayer", 
"pass NBlayer");
 
  177   if (m_cutPosition_NBlayer < 0) {
 
  178     sc = StatusCode::FAILURE;
 
  182   m_cutPosition_ambiguity = m_acceptInfo.addCut(
"ambiguity", 
"pass ambiguity");
 
  183   if (m_cutPosition_ambiguity < 0) {
 
  184     sc = StatusCode::FAILURE;
 
  188   m_cutPosition_LH = m_acceptInfo.addCut(
"passLH", 
"pass Likelihood");
 
  189   if (m_cutPosition_LH < 0) {
 
  190     sc = StatusCode::FAILURE;
 
  194   m_cutPositionTrackA0 =
 
  195     m_acceptInfo.addCut(
"TrackA0", 
"A0 (aka d0) wrt beam spot < Cut");
 
  196   if (m_cutPositionTrackA0 < 0) {
 
  197     sc = StatusCode::FAILURE;
 
  201   m_cutPositionTrackMatchEta = m_acceptInfo.addCut(
 
  202     "TrackMatchEta", 
"Track match deta in 1st sampling < Cut");
 
  203   if (m_cutPositionTrackMatchEta < 0) {
 
  204     sc = StatusCode::FAILURE;
 
  208   m_cutPositionTrackMatchPhiRes = m_acceptInfo.addCut(
 
  209     "TrackMatchPhiRes", 
"Track match dphi in 2nd sampling, rescaled < Cut");
 
  210   if (m_cutPositionTrackMatchPhiRes < 0) {
 
  211     sc = StatusCode::FAILURE;
 
  215   m_cutPositionWstotAtHighET = m_acceptInfo.addCut(
 
  216     "WstotAtHighET", 
"Above HighETBinThreshold, Wstot < Cut");
 
  217   if (m_cutPositionWstotAtHighET < 0) {
 
  218     sc = StatusCode::FAILURE;
 
  222   m_cutPositionEoverPAtHighET = m_acceptInfo.addCut(
 
  223     "EoverPAtHighET", 
"Above HighETBinThreshold, EoverP < Cut");
 
  224   if (m_cutPositionEoverPAtHighET < 0) {
 
  225     sc = StatusCode::FAILURE;
 
  229   if (
sc == StatusCode::FAILURE) {
 
  231       "! Something went wrong with the setup of the decision objects...");
 
  237   m_variableBitMask = getLikelihoodBitmask(m_variableNames);
 
  241   TString tmpString(m_pdfFileName);
 
  242   gSystem->ExpandPathName(tmpString);
 
  243   std::string 
fname(tmpString.Data());
 
  244   auto pdfFile = std::unique_ptr<TFile>(TFile::Open(
fname.c_str(), 
"READ"));
 
  247     ATH_MSG_ERROR(
" No ROOT file found here: " << m_pdfFileName);
 
  248     return StatusCode::FAILURE;
 
  252   for (
unsigned int varIndex = 0; varIndex < s_fnVariables; varIndex++) {
 
  253     const std::string& vstr = s_fVariables[varIndex];
 
  257     if (m_variableNames.find(vstr) == std::string::npos &&
 
  258         !m_variableNames.empty()) {
 
  261     loadVarHistograms(vstr, pdfFile.get(), varIndex);
 
  268   ATH_MSG_DEBUG(
"Initialization complete for a LH tool with these specs:" 
  269                 << 
"\n - pdfFileName                                  : " 
  271                 << 
"\n - Variable bitmask                             : " 
  272                 << m_variableBitMask);
 
  276                 << 
"\n - (bool)CutBL (yes/no)                         : " 
  277                 << (!m_cutBL.empty() ? 
"yes" : 
"no")
 
  278                 << 
"\n - (bool)CutPi (yes/no)                         : " 
  279                 << (!m_cutPi.empty() ? 
"yes" : 
"no")
 
  280                 << 
"\n - (bool)CutSi (yes/no)                         : " 
  281                 << (!m_cutSi.empty() ? 
"yes" : 
"no")
 
  282                 << 
"\n - (bool)CutAmbiguity (yes/no)                  : " 
  283                 << (!m_cutAmbiguity.empty() ? 
"yes" : 
"no")
 
  284                 << 
"\n - (bool)doRemoveF3AtHighEt (yes/no)            : " 
  285                 << (m_doRemoveF3AtHighEt ? 
"yes" : 
"no")
 
  286                 << 
"\n - (bool)doRemoveTRTPIDAtHighEt (yes/no)        : " 
  287                 << (m_doRemoveTRTPIDAtHighEt ? 
"yes" : 
"no")
 
  288                 << 
"\n - (bool)doSmoothBinInterpolation (yes/no)      : " 
  289                 << (m_doSmoothBinInterpolation ? 
"yes" : 
"no")
 
  290                 << 
"\n - (bool)useOneExtraHighETLHBin(yes/no)         : " 
  291                 << (m_useOneExtraHighETLHBin ? 
"yes" : 
"no")
 
  292                 << 
"\n - (double)HighETBinThreshold                   : " 
  293                 << m_highETBinThreshold
 
  294                 << 
"\n - (bool)doPileupTransform (yes/no)             : " 
  295                 << (m_doPileupTransform ? 
"yes" : 
"no")
 
  296                 << 
"\n - (bool)doCentralityTransform (yes/no)         : " 
  297                 << (m_doCentralityTransform ? 
"yes" : 
"no")
 
  298                 << 
"\n - (bool)CutLikelihood (yes/no)                 : " 
  299                 << (!m_cutLikelihood.empty() ? 
"yes" : 
"no")
 
  300                 << 
"\n - (bool)CutLikelihoodPileupCorrection (yes/no) : " 
  301                 << (!m_cutLikelihoodPileupCorrection.empty() ? 
"yes" : 
"no")
 
  302                 << 
"\n - (bool)CutA0 (yes/no)                         : " 
  303                 << (!m_cutA0.empty() ? 
"yes" : 
"no")
 
  304                 << 
"\n - (bool)CutDeltaEta (yes/no)                   : " 
  305                 << (!m_cutDeltaEta.empty() ? 
"yes" : 
"no")
 
  306                 << 
"\n - (bool)CutDeltaPhiRes (yes/no)                : " 
  307                 << (!m_cutDeltaPhiRes.empty() ? 
"yes" : 
"no")
 
  308                 << 
"\n - (bool)CutWstotAtHighET (yes/no)              : " 
  309                 << (!m_cutWstotAtHighET.empty() ? 
"yes" : 
"no")
 
  310                 << 
"\n - (bool)CutEoverPAtHighET (yes/no)             : " 
  311                 << (!m_cutEoverPAtHighET.empty() ? 
"yes" : 
"no"));
 
  318                                                  unsigned int varIndex)
 
  320   for (
unsigned int s_or_b = 0; s_or_b < 2; ++s_or_b) {
 
  321     for (
unsigned int ip = 0; 
ip < IP_BINS; ++
ip) {
 
  322       for (
unsigned int et = 0; 
et < s_fnEtBinsHist; ++
et) {
 
  323         for (
unsigned int eta = 0; 
eta < s_fnEtaBins; ++
eta) {
 
  325           std::string sig_bkg = (s_or_b == 0) ? 
"sig" : 
"bkg";
 
  329           unsigned int eta_tmp = (
eta > 0) ? 
eta - 1 : 
eta;
 
  332           unsigned int et_tmp = 
et;
 
  333           std::string binname = getBinName(et_tmp, eta_tmp, 
ip, m_ipBinning);
 
  335           if (((std::string(binname).
find(
"2.37") != std::string::npos)) &&
 
  336               (vstr.find(
"el_f3") != std::string::npos)) {
 
  340           if (((std::string(binname).
find(
"2.01") != std::string::npos) ||
 
  341                (std::string(binname).
find(
"2.37") != std::string::npos)) &&
 
  342               (vstr.find(
"TRT") != std::string::npos)) {
 
  346           const std::string pdfdir = 
std::format(
"{}/{}", vstr, sig_bkg);
 
  349                                         vstr, sig_bkg, binname);
 
  351           std::string pdf_newname = 
std::format(
"{}_{}_{}_LHtool_copy_{}",
 
  352                                                 m_name, vstr, sig_bkg, binname);
 
  354           if (!pdfFile->GetListOfKeys()->Contains(vstr.c_str())) {
 
  356                          << vstr << 
" because the folder does not exist.");
 
  359           if (!((TDirectory*)pdfFile->Get(vstr.c_str()))
 
  361                  ->Contains(sig_bkg.c_str())) {
 
  363                          << vstr << 
" because the folder does not exist.");
 
  370           if (
et == 0 && !((TDirectory*)pdfFile->Get(pdfdir.c_str()))
 
  372                             ->Contains(
pdf.c_str())) {
 
  373             binname = getBinName(et_tmp + 1, eta_tmp, 
ip, m_ipBinning);
 
  376                               vstr, sig_bkg, binname);
 
  378             pdf_newname = 
std::format(
"{}_{}_{}_LHtool_copy4GeV_{}",
 
  379                                       m_name, vstr, sig_bkg, binname);
 
  381           if (((TDirectory*)pdfFile->Get(pdfdir.c_str()))
 
  383                 ->Contains(
pdf.c_str())) {
 
  384             TH1F* 
hist = (
TH1F*)(((TDirectory*)pdfFile->Get(pdfdir.c_str()))->Get(
pdf.c_str()));
 
  385             m_fPDFbins[s_or_b][
ip][
et][
eta][varIndex] =
 
  386               std::make_unique<EGSelectors::SafeTH1>(
hist);
 
  389             ATH_MSG_INFO(
"Skipping all other histograms with this variable.");
 
  403                                       int nSiHitsPlusDeadSensors,
 
  418   vars.nSiHitsPlusDeadSensors = nSiHitsPlusDeadSensors;
 
  421   vars.ambiguityBit = ambiguityBit;
 
  424   vars.deltaphires = deltaphires;
 
  443   bool passNSilicon(
true);
 
  444   bool passNPixel(
true);
 
  445   bool passNBlayer(
true);
 
  448   bool passTrackA0(
true);
 
  449   bool passDeltaEta(
true);
 
  450   bool passDeltaPhiRes(
true);
 
  451   bool passWstotAtHighET(
true);
 
  452   bool passEoverPAtHighET(
true);
 
  454   if (std::abs(vars_struct.
eta) > 2.47) {
 
  455     ATH_MSG_DEBUG(
"This electron is std::abs(eta)>2.47 Returning False.");
 
  459   unsigned int etbinLH = getLikelihoodEtDiscBin(vars_struct.
eT, 
true);
 
  460   unsigned int etbinOther = getLikelihoodEtDiscBin(vars_struct.
eT, 
false);
 
  461   unsigned int etabin = getLikelihoodEtaBin(vars_struct.
eta);
 
  464   if (etbinLH >= s_fnDiscEtBinsOneExtra) {
 
  466                     << vars_struct.
eT << 
". Returning false..");
 
  470   if (etbinOther >= s_fnDiscEtBins) {
 
  472                     << vars_struct.
eT << 
". Returning false..");
 
  477   acceptData.
setCutResult(m_cutPosition_kinematic, passKine);
 
  483   if (!m_cutAmbiguity.empty()) {
 
  486           m_cutAmbiguity[etabin])) {
 
  493   if (!m_cutBL.empty()) {
 
  500   if (!m_cutPi.empty()) {
 
  507   if (!m_cutSi.empty()) {
 
  510       passNSilicon = 
false;
 
  514   double cutDiscriminant;
 
  515   unsigned int ibin_combinedLH =
 
  516     etbinLH * s_fnEtaBins + etabin; 
 
  518   unsigned int ibin_combinedOther =
 
  519     etbinOther * s_fnEtaBins +
 
  523   if (!m_cutLikelihood.empty()) {
 
  525     if (ibin_combinedLH >= m_cutLikelihood.size()) {
 
  528                     << 
" is outside of the range specified by the input" 
  529                     << m_cutLikelihood.size() << 
"This should never happen!");
 
  533     if (m_doSmoothBinInterpolation) {
 
  534       cutDiscriminant = InterpolateCuts(
 
  535         m_cutLikelihood, m_cutLikelihood4GeV, vars_struct.
eT, vars_struct.
eta);
 
  536       if (!m_doPileupTransform && !m_cutLikelihoodPileupCorrection.empty() &&
 
  537           !m_cutLikelihoodPileupCorrection4GeV.empty())
 
  539           vars_struct.
ip * InterpolateCuts(m_cutLikelihoodPileupCorrection,
 
  540                                            m_cutLikelihoodPileupCorrection4GeV,
 
  544       if (vars_struct.
eT > 7000. || m_cutLikelihood4GeV.empty()) {
 
  545         cutDiscriminant = m_cutLikelihood[ibin_combinedLH];
 
  548         if (!m_doPileupTransform && !m_cutLikelihoodPileupCorrection.empty()) {
 
  550             vars_struct.
ip * m_cutLikelihoodPileupCorrection[ibin_combinedLH];
 
  553         cutDiscriminant = m_cutLikelihood4GeV[etabin];
 
  554         if (!m_doPileupTransform &&
 
  555             !m_cutLikelihoodPileupCorrection4GeV.empty())
 
  557             vars_struct.
ip * m_cutLikelihoodPileupCorrection4GeV[etabin];
 
  563     if (vars_struct.
likelihood < cutDiscriminant) {
 
  570   if (!m_cutA0.empty()) {
 
  571     if (std::abs(vars_struct.
d0) > m_cutA0[ibin_combinedOther]) {
 
  578   if (!m_cutDeltaEta.empty()) {
 
  579     if (std::abs(vars_struct.
deltaEta) > m_cutDeltaEta[ibin_combinedOther]) {
 
  581       passDeltaEta = 
false;
 
  586   if (!m_cutDeltaPhiRes.empty()) {
 
  588         m_cutDeltaPhiRes[ibin_combinedOther]) {
 
  590       passDeltaPhiRes = 
false;
 
  595   if (vars_struct.
eT > m_highETBinThreshold * 1000) {
 
  597     if (!m_cutWstotAtHighET.empty()) {
 
  598       if (std::abs(vars_struct.
wstot) > m_cutWstotAtHighET[etabin]) {
 
  600         passWstotAtHighET = 
false;
 
  605     if (!m_cutEoverPAtHighET.empty()) {
 
  606       if (std::abs(vars_struct.
EoverP) > m_cutEoverPAtHighET[etabin]) {
 
  608         passEoverPAtHighET = 
false;
 
  614   acceptData.
setCutResult(m_cutPosition_NSilicon, passNSilicon);
 
  615   acceptData.
setCutResult(m_cutPosition_NPixel, passNPixel);
 
  616   acceptData.
setCutResult(m_cutPosition_NBlayer, passNBlayer);
 
  619   acceptData.
setCutResult(m_cutPositionTrackA0, passTrackA0);
 
  620   acceptData.
setCutResult(m_cutPositionTrackMatchEta, passDeltaEta);
 
  621   acceptData.
setCutResult(m_cutPositionTrackMatchPhiRes, passDeltaPhiRes);
 
  622   acceptData.
setCutResult(m_cutPositionWstotAtHighET, passWstotAtHighET);
 
  623   acceptData.
setCutResult(m_cutPositionEoverPAtHighET, passEoverPAtHighET);
 
  660   vars.d0sigma = d0sigma;
 
  662   vars.deltaPoverP = deltaPoverP;
 
  663   vars.deltaphires = deltaphires;
 
  664   vars.TRT_PID = TRT_PID;
 
  678   unsigned int etabin = getLikelihoodEtaBin(vars_struct.
eta);
 
  680   if (etabin == 3 || etabin == 4) {
 
  681     rhad_corr = vars_struct.
rHad;
 
  683     rhad_corr = vars_struct.
rHad1;
 
  687                             : std::abs(vars_struct.
d0) / vars_struct.
d0sigma;
 
  689   std::vector<double> 
vec = {
 
  691     vars_struct.
f1,     vars_struct.
f3,          vars_struct.
Reta,
 
  692     rhad_corr,          vars_struct.
rphi,        vars_struct.
d0,
 
  697   result = this->evaluateLikelihood(
 
  698     vec, vars_struct.
eT, vars_struct.
eta, vars_struct.
ip);
 
  705   const std::vector<float>& varVector,
 
  710   std::vector<double> 
vec;
 
  711   for (
unsigned int var = 0; 
var < s_fnVariables; 
var++) {
 
  712     vec.push_back(varVector[
var]);
 
  719   const std::vector<double>& varVector,
 
  725   const double GeV = 1000;
 
  726   unsigned int etbin = getLikelihoodEtHistBin(
et); 
 
  727   unsigned int etabin = getLikelihoodEtaBin(
eta);
 
  728   unsigned int ipbin = getIpBin(
ip);
 
  731                        << 
" etabin: " << etabin);
 
  733   if (etbin >= s_fnEtBinsHist) {
 
  737   if (etabin >= s_fnEtaBins) {
 
  742   if (varVector.size() != s_fnVariables) {
 
  743     ATH_MSG_WARNING(
"Error! Variable vector size mismatch! Check your vector!");
 
  750   const std::string TRT_string = 
"TRT";
 
  751   const std::string el_f3_string = 
"el_f3";
 
  752   const std::string el_TRT_PID_string = 
"el_TRT_PID";
 
  754   for (
unsigned int var = 0; 
var < s_fnVariables; 
var++) {
 
  756     const std::string& varstr = s_fVariables[
var];
 
  759     if (!(m_variableBitMask & (0
x1 << 
var))) {
 
  763     if (((etabin == 8) || (etabin == 9)) &&
 
  764         (varstr.find(TRT_string) != std::string::npos)) {
 
  768     if ((etabin == 9) && (varstr.find(el_f3_string) != std::string::npos)) {
 
  772     if (m_doRemoveF3AtHighEt && (
et > 80 * 
GeV) &&
 
  773         (varstr.find(el_f3_string) != std::string::npos)) {
 
  777     if (m_doRemoveTRTPIDAtHighEt && (
et > 80 * 
GeV) &&
 
  778         (varstr.find(el_TRT_PID_string) != std::string::npos)) {
 
  781     for (
unsigned int s_or_b = 0; s_or_b < 2; s_or_b++) {
 
  784         m_fPDFbins[s_or_b][ipbin][etbin][etabin][
var]->FindBin(varVector[
var]);
 
  787       if (m_doSmoothBinInterpolation) {
 
  791           double(m_fPDFbins[s_or_b][ipbin][etbin][etabin][
var]->Integral());
 
  799             m_fPDFbins[s_or_b][ipbin][etbin][etabin][
var]->GetBinContent(
bin)) /
 
  805       } 
else if (s_or_b == 1) {
 
  811   return TransformLikelihoodOutput(SigmaS, SigmaB, 
ip, 
et, 
eta);
 
  824   double fEpsilon = 1
e-99;
 
  834   } 
else if (disc <= 0.0) {
 
  846   if (m_doPileupTransform) {
 
  858     if (m_discHardCutForPileupTransform.empty() ||
 
  859         m_discHardCutSlopeForPileupTransform.empty() ||
 
  860         m_discLooseForPileupTransform.empty()) {
 
  862         "Vectors needed for pileup-dependent transform not correctly filled! " 
  863         "Skipping the transform.");
 
  867     if (m_doCentralityTransform &&
 
  868         m_discHardCutQuadForPileupTransform.empty()) {
 
  869       ATH_MSG_WARNING(
"Vectors needed for centrality-dependent transform not " 
  871                       "Skipping the transform.");
 
  875     unsigned int etabin = getLikelihoodEtaBin(
eta);
 
  877     double disc_hard_cut_ref = 0;
 
  878     double disc_hard_cut_ref_slope = 0;
 
  879     double disc_hard_cut_ref_quad =
 
  881     double disc_loose_ref = 0;
 
  882     double disc_max = m_discMaxForPileupTransform;
 
  883     double pileup_max = m_pileupMaxForPileupTransform;
 
  885     if (m_doSmoothBinInterpolation) {
 
  886       disc_hard_cut_ref = InterpolateCuts(m_discHardCutForPileupTransform,
 
  887                                           m_discHardCutForPileupTransform4GeV,
 
  890       disc_hard_cut_ref_slope =
 
  891         InterpolateCuts(m_discHardCutSlopeForPileupTransform,
 
  892                         m_discHardCutSlopeForPileupTransform4GeV,
 
  895       if (m_doCentralityTransform)
 
  896         disc_hard_cut_ref_quad =
 
  897           InterpolateCuts(m_discHardCutQuadForPileupTransform,
 
  898                           m_discHardCutQuadForPileupTransform4GeV,
 
  901       disc_loose_ref = InterpolateCuts(m_discLooseForPileupTransform,
 
  902                                        m_discLooseForPileupTransform4GeV,
 
  907       if (
et > 7000. || m_discHardCutForPileupTransform4GeV.empty()) {
 
  908         unsigned int etfinebinLH = getLikelihoodEtDiscBin(
et, 
true);
 
  909         unsigned int ibin_combined = etfinebinLH * s_fnEtaBins + etabin;
 
  910         disc_hard_cut_ref = m_discHardCutForPileupTransform[ibin_combined];
 
  911         disc_hard_cut_ref_slope =
 
  912           m_discHardCutSlopeForPileupTransform[ibin_combined];
 
  913         if (m_doCentralityTransform)
 
  914           disc_hard_cut_ref_quad =
 
  915             m_discHardCutQuadForPileupTransform[ibin_combined];
 
  916         disc_loose_ref = m_discLooseForPileupTransform[ibin_combined];
 
  918         if (m_discHardCutForPileupTransform4GeV.empty() ||
 
  919             m_discHardCutSlopeForPileupTransform4GeV.empty() ||
 
  920             m_discLooseForPileupTransform4GeV.empty()) {
 
  922                           "correctly filled for 4-7 GeV " 
  923                           "bin! Skipping the transform.");
 
  926         if (m_doCentralityTransform &&
 
  927             m_discHardCutQuadForPileupTransform4GeV.empty()) {
 
  929                           "not correctly filled for 4-7 " 
  930                           "GeV bin! Skipping the transform.");
 
  933         disc_hard_cut_ref = m_discHardCutForPileupTransform4GeV[etabin];
 
  934         disc_hard_cut_ref_slope =
 
  935           m_discHardCutSlopeForPileupTransform4GeV[etabin];
 
  936         if (m_doCentralityTransform)
 
  937           disc_hard_cut_ref_quad =
 
  938             m_discHardCutQuadForPileupTransform4GeV[etabin];
 
  939         disc_loose_ref = m_discLooseForPileupTransform4GeV[etabin];
 
  945     double disc_hard_cut_ref_prime =
 
  946       disc_hard_cut_ref + disc_hard_cut_ref_slope * ip_for_corr +
 
  947       disc_hard_cut_ref_quad * ip_for_corr * ip_for_corr;
 
  949     if (disc <= disc_loose_ref) {
 
  951     } 
else if (disc <= disc_hard_cut_ref_prime) {
 
  953       double denom = 
double(disc_hard_cut_ref_prime - disc_loose_ref);
 
  956       disc = disc_loose_ref + (disc - disc_loose_ref) *
 
  957                                 (disc_hard_cut_ref - disc_loose_ref) / 
denom;
 
  958     } 
else if (disc_hard_cut_ref_prime < disc && disc <= disc_max) {
 
  960       double denom = 
double(disc_max - disc_hard_cut_ref_prime);
 
  963       disc = disc_hard_cut_ref + (disc - disc_hard_cut_ref_prime) *
 
  964                                    (disc_max - disc_hard_cut_ref) / 
denom;
 
  977   for (
unsigned int ipBin = 0; ipBin < IP_BINS; ++ipBin) {
 
  978     if (
ip < s_fIpBounds[ipBin + 1])
 
  989   const unsigned int nEtaBins = s_fnEtaBins;
 
  991                                      1.52, 1.81, 2.01, 2.37, 2.47 };
 
 1005   const double GeV = 1000;
 
 1007   const unsigned int nEtBins = s_fnEtBinsHist;
 
 1008   const double eTBins[nEtBins] = { 7 * 
GeV,  10 * 
GeV, 15 * 
GeV, 20 * 
GeV,
 
 1011   for (
unsigned int eTBin = 0; eTBin < nEtBins; ++eTBin) {
 
 1012     if (
eT < eTBins[eTBin]) {
 
 1025   const bool isLHbinning)
 const 
 1027   const double GeV = 1000;
 
 1029   if (m_useOneExtraHighETLHBin && isLHbinning) {
 
 1030     const unsigned int nEtBins = s_fnDiscEtBinsOneExtra;
 
 1031     const double eTBins[nEtBins] = {
 
 1034       40 * 
GeV,  45 * 
GeV, m_highETBinThreshold * 
GeV,
 
 1038     for (
unsigned int eTBin = 0; eTBin < nEtBins; ++eTBin) {
 
 1039       if (
eT < eTBins[eTBin])
 
 1046   const unsigned int nEtBins = s_fnDiscEtBins;
 
 1047   const double eTBins[nEtBins] = { 10 * 
GeV, 15 * 
GeV, 20 * 
GeV,
 
 1051   for (
unsigned int eTBin = 0; eTBin < nEtBins; ++eTBin) {
 
 1052     if (
eT < eTBins[eTBin])
 
 1065                                           const std::string& iptype) 
 
 1067   const double eta_bounds[9] = { 0.0, 0.6, 0.8, 1.15, 1.37, 1.52, 1.81, 2.01, 2.37 };
 
 1068   const int et_bounds[s_fnEtBinsHist] = { 4, 7, 10, 15, 20, 30, 40 };
 
 1069   if (!iptype.empty()) {
 
 1071                        iptype, 
int(s_fIpBounds[ipbin]),
 
 1072                        et_bounds[etbin], eta_bounds[etabin]);
 
 1075                        et_bounds[etbin], eta_bounds[etabin]);
 
 1081   const std::string& vars)
 const 
 1083   unsigned int mask = 0x0;
 
 1085   for (
unsigned int var = 0; 
var < s_fnVariables; 
var++) {
 
 1086     if (vars.find(s_fVariables[
var]) != std::string::npos) {
 
 1100   const std::vector<double>& 
cuts,
 
 1101   const std::vector<double>& cuts_4gev,
 
 1108   unsigned int etbinLH = getLikelihoodEtDiscBin(
et, 
true);
 
 1109   unsigned int etabin = getLikelihoodEtaBin(
eta);
 
 1110   unsigned int ibin_combinedLH = etbinLH * s_fnEtaBins + etabin;
 
 1111   double cut = 
cuts.at(ibin_combinedLH);
 
 1114   if (!cuts_4gev.empty()) {
 
 1116       cut = cuts_4gev.at(etabin);
 
 1130   if (
et > 47500. || !(etbinLH < s_fnDiscEtBins)) {
 
 1135   if (7000. < 
et && 
et < 10000.) {
 
 1141   const double GeV = 1000;
 
 1142   const double eTBins[s_fnDiscEtBins] = { 8.5 * 
GeV,  12.5 * 
GeV, 17.5 * 
GeV,
 
 1145   double bin_center = eTBins[etbinLH];
 
 1146   if (
et > bin_center) {
 
 1147     double cut_next = 
cut;
 
 1148     if (etbinLH + 1 <= 8)
 
 1149       cut_next = 
cuts.at((etbinLH + 1) * s_fnEtaBins + etabin);
 
 1153   double cut_before = 
cut;
 
 1155     cut_before = 
cuts.at((etbinLH - 1) * s_fnEtaBins + etabin);
 
 1156   } 
else if (etbinLH == 0 && !cuts_4gev.empty()) {
 
 1157     cut_before = cuts_4gev.at(etabin);
 
 1172                                                unsigned int var)
 const 
 1177   int etbin = getLikelihoodEtHistBin(
et); 
 
 1178   int etabin = getLikelihoodEtaBin(
eta);
 
 1180     double(m_fPDFbins[s_or_b][ipbin][etbin][etabin][
var]->Integral());
 
 1182     double(m_fPDFbins[s_or_b][ipbin][etbin][etabin][
var]->GetBinContent(
bin)) /
 
 1185   int Nbins = m_fPDFbins[s_or_b][ipbin][etbin][etabin][
var]->GetNbinsX();
 
 1192   if (22500. < 
et && 
et < 27500.) {
 
 1195   if (32500. < 
et && 
et < 37500.) {
 
 1199   if (7000. < 
et && 
et < 10000.) {
 
 1205   const double GeV = 1000;
 
 1206   const double eTHistBins[s_fnEtBinsHist] = { 6. * 
GeV,   8.5 * 
GeV,
 
 1210   double bin_center = eTHistBins[etbin];
 
 1211   if (etbin == 4 && 
et >= 27500.) {
 
 1212     bin_center = 27500.; 
 
 1214   if (etbin == 5 && 
et >= 37500.) {
 
 1215     bin_center = 37500.; 
 
 1217   if (
et > bin_center) {
 
 1218     double prob_next = 
prob;
 
 1219     if (etbin + 1 <= 6) {
 
 1222         m_fPDFbins[s_or_b][ipbin][etbin + 1][etabin][
var]->GetNbinsX();
 
 1224       if (Nbins < NbinsPlus) {
 
 1226       } 
else if (Nbins > NbinsPlus) {
 
 1230       double integral_next =
 
 1231         double(m_fPDFbins[s_or_b][ipbin][etbin + 1][etabin][
var]->Integral());
 
 1233         double(m_fPDFbins[s_or_b][ipbin][etbin + 1][etabin][
var]->GetBinContent(
 
 1240   double prob_before = 
prob;
 
 1241   if (etbin - 1 >= 0) {
 
 1244       m_fPDFbins[s_or_b][ipbin][etbin - 1][etabin][
var]->GetNbinsX();
 
 1246     if (Nbins < NbinsMinus) {
 
 1247       binminus = 
int(
round(
bin * (Nbins / NbinsMinus)));
 
 1248     } 
else if (Nbins > NbinsMinus) {
 
 1249       binminus = 
int(
round(
bin * (NbinsMinus / Nbins)));
 
 1251     double integral_before =
 
 1252       double(m_fPDFbins[s_or_b][ipbin][etbin - 1][etabin][
var]->Integral());
 
 1254       double(m_fPDFbins[s_or_b][ipbin][etbin - 1][etabin][
var]->GetBinContent(
 
 1265   "el_d0significance",
 
 1273   "el_trackd0pvunbiased",
 
 1276   "el_deltaphiRescaled",