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 fPDFbins[s_or_b][
ip][
et][eta][varIndex] =
390 ATH_MSG_INFO(
"Skipping all other histograms with this variable.");
404 int nSiHitsPlusDeadSensors,
419 vars.nSiHitsPlusDeadSensors = nSiHitsPlusDeadSensors;
422 vars.ambiguityBit = ambiguityBit;
425 vars.deltaphires = deltaphires;
444 bool passNSilicon(
true);
445 bool passNPixel(
true);
446 bool passNBlayer(
true);
449 bool passTrackA0(
true);
450 bool passDeltaEta(
true);
451 bool passDeltaPhiRes(
true);
452 bool passWstotAtHighET(
true);
453 bool passEoverPAtHighET(
true);
455 if (std::abs(vars_struct.
eta) > 2.47) {
456 ATH_MSG_DEBUG(
"This electron is std::abs(eta)>2.47 Returning False.");
460 unsigned int etbinLH = getLikelihoodEtDiscBin(vars_struct.
eT,
true);
461 unsigned int etbinOther = getLikelihoodEtDiscBin(vars_struct.
eT,
false);
462 unsigned int etabin = getLikelihoodEtaBin(vars_struct.
eta);
465 if (etbinLH >= s_fnDiscEtBinsOneExtra) {
467 << vars_struct.
eT <<
". Returning false..");
471 if (etbinOther >= s_fnDiscEtBins) {
473 << vars_struct.
eT <<
". Returning false..");
478 acceptData.
setCutResult(m_cutPosition_kinematic, passKine);
484 if (!m_cutAmbiguity.empty()) {
487 m_cutAmbiguity[etabin])) {
494 if (!m_cutBL.empty()) {
501 if (!m_cutPi.empty()) {
508 if (!m_cutSi.empty()) {
511 passNSilicon =
false;
515 double cutDiscriminant;
516 unsigned int ibin_combinedLH =
517 etbinLH * s_fnEtaBins + etabin;
519 unsigned int ibin_combinedOther =
520 etbinOther * s_fnEtaBins +
524 if (!m_cutLikelihood.empty()) {
526 if (ibin_combinedLH >= m_cutLikelihood.size()) {
529 <<
" is outside of the range specified by the input"
530 << m_cutLikelihood.size() <<
"This should never happen!");
534 if (m_doSmoothBinInterpolation) {
535 cutDiscriminant = InterpolateCuts(
536 m_cutLikelihood, m_cutLikelihood4GeV, vars_struct.
eT, vars_struct.
eta);
537 if (!m_doPileupTransform && !m_cutLikelihoodPileupCorrection.empty() &&
538 !m_cutLikelihoodPileupCorrection4GeV.empty())
540 vars_struct.
ip * InterpolateCuts(m_cutLikelihoodPileupCorrection,
541 m_cutLikelihoodPileupCorrection4GeV,
545 if (vars_struct.
eT > 7000. || m_cutLikelihood4GeV.empty()) {
546 cutDiscriminant = m_cutLikelihood[ibin_combinedLH];
549 if (!m_doPileupTransform && !m_cutLikelihoodPileupCorrection.empty()) {
551 vars_struct.
ip * m_cutLikelihoodPileupCorrection[ibin_combinedLH];
554 cutDiscriminant = m_cutLikelihood4GeV[etabin];
555 if (!m_doPileupTransform &&
556 !m_cutLikelihoodPileupCorrection4GeV.empty())
558 vars_struct.
ip * m_cutLikelihoodPileupCorrection4GeV[etabin];
564 if (vars_struct.
likelihood < cutDiscriminant) {
571 if (!m_cutA0.empty()) {
572 if (std::abs(vars_struct.
d0) > m_cutA0[ibin_combinedOther]) {
579 if (!m_cutDeltaEta.empty()) {
580 if (std::abs(vars_struct.
deltaEta) > m_cutDeltaEta[ibin_combinedOther]) {
582 passDeltaEta =
false;
587 if (!m_cutDeltaPhiRes.empty()) {
589 m_cutDeltaPhiRes[ibin_combinedOther]) {
591 passDeltaPhiRes =
false;
596 if (vars_struct.
eT > m_highETBinThreshold * 1000) {
598 if (!m_cutWstotAtHighET.empty()) {
599 if (std::abs(vars_struct.
wstot) > m_cutWstotAtHighET[etabin]) {
601 passWstotAtHighET =
false;
606 if (!m_cutEoverPAtHighET.empty()) {
607 if (std::abs(vars_struct.
EoverP) > m_cutEoverPAtHighET[etabin]) {
609 passEoverPAtHighET =
false;
615 acceptData.
setCutResult(m_cutPosition_NSilicon, passNSilicon);
616 acceptData.
setCutResult(m_cutPosition_NPixel, passNPixel);
617 acceptData.
setCutResult(m_cutPosition_NBlayer, passNBlayer);
620 acceptData.
setCutResult(m_cutPositionTrackA0, passTrackA0);
621 acceptData.
setCutResult(m_cutPositionTrackMatchEta, passDeltaEta);
622 acceptData.
setCutResult(m_cutPositionTrackMatchPhiRes, passDeltaPhiRes);
623 acceptData.
setCutResult(m_cutPositionWstotAtHighET, passWstotAtHighET);
624 acceptData.
setCutResult(m_cutPositionEoverPAtHighET, passEoverPAtHighET);
661 vars.d0sigma = d0sigma;
663 vars.deltaPoverP = deltaPoverP;
664 vars.deltaphires = deltaphires;
665 vars.TRT_PID = TRT_PID;
679 unsigned int etabin = getLikelihoodEtaBin(vars_struct.
eta);
681 if (etabin == 3 || etabin == 4) {
682 rhad_corr = vars_struct.
rHad;
684 rhad_corr = vars_struct.
rHad1;
688 : std::abs(vars_struct.
d0) / vars_struct.
d0sigma;
690 std::vector<double>
vec = {
692 vars_struct.
f1, vars_struct.
f3, vars_struct.
Reta,
693 rhad_corr, vars_struct.
rphi, vars_struct.
d0,
698 result = this->evaluateLikelihood(
699 vec, vars_struct.
eT, vars_struct.
eta, vars_struct.
ip);
706 const std::vector<float>& varVector,
711 std::vector<double>
vec;
712 for (
unsigned int var = 0;
var < s_fnVariables;
var++) {
713 vec.push_back(varVector[
var]);
715 return evaluateLikelihood(
vec,
et, eta,
ip);
720 const std::vector<double>& varVector,
726 const double GeV = 1000;
727 unsigned int etbin = getLikelihoodEtHistBin(
et);
728 unsigned int etabin = getLikelihoodEtaBin(eta);
729 unsigned int ipbin = getIpBin(
ip);
732 <<
" etabin: " << etabin);
734 if (etbin >= s_fnEtBinsHist) {
738 if (etabin >= s_fnEtaBins) {
743 if (varVector.size() != s_fnVariables) {
744 ATH_MSG_WARNING(
"Error! Variable vector size mismatch! Check your vector!");
751 const std::string TRT_string =
"TRT";
752 const std::string el_f3_string =
"el_f3";
753 const std::string el_TRT_PID_string =
"el_TRT_PID";
755 for (
unsigned int var = 0;
var < s_fnVariables;
var++) {
757 const std::string& varstr = s_fVariables[
var];
760 if (!(m_variableBitMask & (0
x1 <<
var))) {
764 if (((etabin == 8) || (etabin == 9)) &&
765 (varstr.find(TRT_string) != std::string::npos)) {
769 if ((etabin == 9) && (varstr.find(el_f3_string) != std::string::npos)) {
773 if (m_doRemoveF3AtHighEt && (
et > 80 *
GeV) &&
774 (varstr.find(el_f3_string) != std::string::npos)) {
778 if (m_doRemoveTRTPIDAtHighEt && (
et > 80 *
GeV) &&
779 (varstr.find(el_TRT_PID_string) != std::string::npos)) {
782 for (
unsigned int s_or_b = 0; s_or_b < 2; s_or_b++) {
785 fPDFbins[s_or_b][ipbin][etbin][etabin][
var]->FindBin(varVector[
var]);
788 if (m_doSmoothBinInterpolation) {
789 prob = InterpolatePdfs(s_or_b, ipbin,
et, eta,
bin,
var);
792 double(fPDFbins[s_or_b][ipbin][etbin][etabin][
var]->Integral());
800 fPDFbins[s_or_b][ipbin][etbin][etabin][
var]->GetBinContent(
bin)) /
806 }
else if (s_or_b == 1) {
812 return TransformLikelihoodOutput(SigmaS, SigmaB,
ip,
et, eta);
825 double fEpsilon = 1
e-99;
835 }
else if (disc <= 0.0) {
840 disc = -
log(1.0 / disc - 1.0) * (1. /
double(tau));
847 if (m_doPileupTransform) {
859 if (m_discHardCutForPileupTransform.empty() ||
860 m_discHardCutSlopeForPileupTransform.empty() ||
861 m_discLooseForPileupTransform.empty()) {
863 "Vectors needed for pileup-dependent transform not correctly filled! "
864 "Skipping the transform.");
868 if (m_doCentralityTransform &&
869 m_discHardCutQuadForPileupTransform.empty()) {
870 ATH_MSG_WARNING(
"Vectors needed for centrality-dependent transform not "
872 "Skipping the transform.");
876 unsigned int etabin = getLikelihoodEtaBin(eta);
878 double disc_hard_cut_ref = 0;
879 double disc_hard_cut_ref_slope = 0;
880 double disc_hard_cut_ref_quad =
882 double disc_loose_ref = 0;
883 double disc_max = m_discMaxForPileupTransform;
884 double pileup_max = m_pileupMaxForPileupTransform;
886 if (m_doSmoothBinInterpolation) {
887 disc_hard_cut_ref = InterpolateCuts(m_discHardCutForPileupTransform,
888 m_discHardCutForPileupTransform4GeV,
891 disc_hard_cut_ref_slope =
892 InterpolateCuts(m_discHardCutSlopeForPileupTransform,
893 m_discHardCutSlopeForPileupTransform4GeV,
896 if (m_doCentralityTransform)
897 disc_hard_cut_ref_quad =
898 InterpolateCuts(m_discHardCutQuadForPileupTransform,
899 m_discHardCutQuadForPileupTransform4GeV,
902 disc_loose_ref = InterpolateCuts(m_discLooseForPileupTransform,
903 m_discLooseForPileupTransform4GeV,
908 if (
et > 7000. || m_discHardCutForPileupTransform4GeV.empty()) {
909 unsigned int etfinebinLH = getLikelihoodEtDiscBin(
et,
true);
910 unsigned int ibin_combined = etfinebinLH * s_fnEtaBins + etabin;
911 disc_hard_cut_ref = m_discHardCutForPileupTransform[ibin_combined];
912 disc_hard_cut_ref_slope =
913 m_discHardCutSlopeForPileupTransform[ibin_combined];
914 if (m_doCentralityTransform)
915 disc_hard_cut_ref_quad =
916 m_discHardCutQuadForPileupTransform[ibin_combined];
917 disc_loose_ref = m_discLooseForPileupTransform[ibin_combined];
919 if (m_discHardCutForPileupTransform4GeV.empty() ||
920 m_discHardCutSlopeForPileupTransform4GeV.empty() ||
921 m_discLooseForPileupTransform4GeV.empty()) {
923 "correctly filled for 4-7 GeV "
924 "bin! Skipping the transform.");
927 if (m_doCentralityTransform &&
928 m_discHardCutQuadForPileupTransform4GeV.empty()) {
930 "not correctly filled for 4-7 "
931 "GeV bin! Skipping the transform.");
934 disc_hard_cut_ref = m_discHardCutForPileupTransform4GeV[etabin];
935 disc_hard_cut_ref_slope =
936 m_discHardCutSlopeForPileupTransform4GeV[etabin];
937 if (m_doCentralityTransform)
938 disc_hard_cut_ref_quad =
939 m_discHardCutQuadForPileupTransform4GeV[etabin];
940 disc_loose_ref = m_discLooseForPileupTransform4GeV[etabin];
946 double disc_hard_cut_ref_prime =
947 disc_hard_cut_ref + disc_hard_cut_ref_slope * ip_for_corr +
948 disc_hard_cut_ref_quad * ip_for_corr * ip_for_corr;
950 if (disc <= disc_loose_ref) {
952 }
else if (disc <= disc_hard_cut_ref_prime) {
954 double denom =
double(disc_hard_cut_ref_prime - disc_loose_ref);
957 disc = disc_loose_ref + (disc - disc_loose_ref) *
958 (disc_hard_cut_ref - disc_loose_ref) /
denom;
959 }
else if (disc_hard_cut_ref_prime < disc && disc <= disc_max) {
961 double denom =
double(disc_max - disc_hard_cut_ref_prime);
964 disc = disc_hard_cut_ref + (disc - disc_hard_cut_ref_prime) *
965 (disc_max - disc_hard_cut_ref) /
denom;
978 for (
unsigned int ipBin = 0; ipBin < IP_BINS; ++ipBin) {
979 if (
ip < s_fIpBounds[ipBin + 1])
990 const unsigned int nEtaBins = s_fnEtaBins;
992 1.52, 1.81, 2.01, 2.37, 2.47 };
1006 const double GeV = 1000;
1008 const unsigned int nEtBins = s_fnEtBinsHist;
1009 const double eTBins[nEtBins] = { 7 *
GeV, 10 *
GeV, 15 *
GeV, 20 *
GeV,
1012 for (
unsigned int eTBin = 0; eTBin < nEtBins; ++eTBin) {
1013 if (
eT < eTBins[eTBin]) {
1026 const bool isLHbinning)
const
1028 const double GeV = 1000;
1030 if (m_useOneExtraHighETLHBin && isLHbinning) {
1031 const unsigned int nEtBins = s_fnDiscEtBinsOneExtra;
1032 const double eTBins[nEtBins] = {
1035 40 *
GeV, 45 *
GeV, m_highETBinThreshold *
GeV,
1039 for (
unsigned int eTBin = 0; eTBin < nEtBins; ++eTBin) {
1040 if (
eT < eTBins[eTBin])
1047 const unsigned int nEtBins = s_fnDiscEtBins;
1048 const double eTBins[nEtBins] = { 10 *
GeV, 15 *
GeV, 20 *
GeV,
1052 for (
unsigned int eTBin = 0; eTBin < nEtBins; ++eTBin) {
1053 if (
eT < eTBins[eTBin])
1066 const std::string& iptype)
1068 const double eta_bounds[9] = { 0.0, 0.6, 0.8, 1.15, 1.37, 1.52, 1.81, 2.01, 2.37 };
1069 const int et_bounds[s_fnEtBinsHist] = { 4, 7, 10, 15, 20, 30, 40 };
1070 if (!iptype.empty()) {
1072 iptype,
int(s_fIpBounds[ipbin]),
1073 et_bounds[etbin], eta_bounds[etabin]);
1076 et_bounds[etbin], eta_bounds[etabin]);
1082 const std::string& vars)
const
1084 unsigned int mask = 0x0;
1086 for (
unsigned int var = 0;
var < s_fnVariables;
var++) {
1087 if (vars.find(s_fVariables[
var]) != std::string::npos) {
1101 const std::vector<double>&
cuts,
1102 const std::vector<double>& cuts_4gev,
1109 unsigned int etbinLH = getLikelihoodEtDiscBin(
et,
true);
1110 unsigned int etabin = getLikelihoodEtaBin(eta);
1111 unsigned int ibin_combinedLH = etbinLH * s_fnEtaBins + etabin;
1112 double cut =
cuts.at(ibin_combinedLH);
1115 if (!cuts_4gev.empty()) {
1117 cut = cuts_4gev.at(etabin);
1131 if (
et > 47500. || !(etbinLH < s_fnDiscEtBins)) {
1136 if (7000. <
et &&
et < 10000.) {
1142 const double GeV = 1000;
1143 const double eTBins[s_fnDiscEtBins] = { 8.5 *
GeV, 12.5 *
GeV, 17.5 *
GeV,
1146 double bin_center = eTBins[etbinLH];
1147 if (
et > bin_center) {
1148 double cut_next =
cut;
1149 if (etbinLH + 1 <= 8)
1150 cut_next =
cuts.at((etbinLH + 1) * s_fnEtaBins + etabin);
1154 double cut_before =
cut;
1156 cut_before =
cuts.at((etbinLH - 1) * s_fnEtaBins + etabin);
1157 }
else if (etbinLH == 0 && !cuts_4gev.empty()) {
1158 cut_before = cuts_4gev.at(etabin);
1173 unsigned int var)
const
1178 int etbin = getLikelihoodEtHistBin(
et);
1179 int etabin = getLikelihoodEtaBin(eta);
1181 double(fPDFbins[s_or_b][ipbin][etbin][etabin][
var]->Integral());
1183 double(fPDFbins[s_or_b][ipbin][etbin][etabin][
var]->GetBinContent(
bin)) /
1186 int Nbins = fPDFbins[s_or_b][ipbin][etbin][etabin][
var]->GetNbinsX();
1193 if (22500. <
et &&
et < 27500.) {
1196 if (32500. <
et &&
et < 37500.) {
1200 if (7000. <
et &&
et < 10000.) {
1206 const double GeV = 1000;
1207 const double eTHistBins[s_fnEtBinsHist] = { 6. *
GeV, 8.5 *
GeV,
1211 double bin_center = eTHistBins[etbin];
1212 if (etbin == 4 &&
et >= 27500.) {
1213 bin_center = 27500.;
1215 if (etbin == 5 &&
et >= 37500.) {
1216 bin_center = 37500.;
1218 if (
et > bin_center) {
1219 double prob_next =
prob;
1220 if (etbin + 1 <= 6) {
1223 fPDFbins[s_or_b][ipbin][etbin + 1][etabin][
var]->GetNbinsX();
1225 if (Nbins < NbinsPlus) {
1227 }
else if (Nbins > NbinsPlus) {
1231 double integral_next =
1232 double(fPDFbins[s_or_b][ipbin][etbin + 1][etabin][
var]->Integral());
1234 double(fPDFbins[s_or_b][ipbin][etbin + 1][etabin][
var]->GetBinContent(
1241 double prob_before =
prob;
1242 if (etbin - 1 >= 0) {
1245 fPDFbins[s_or_b][ipbin][etbin - 1][etabin][
var]->GetNbinsX();
1247 if (Nbins < NbinsMinus) {
1248 binminus =
int(
round(
bin * (Nbins / NbinsMinus)));
1249 }
else if (Nbins > NbinsMinus) {
1250 binminus =
int(
round(
bin * (NbinsMinus / Nbins)));
1252 double integral_before =
1253 double(fPDFbins[s_or_b][ipbin][etbin - 1][etabin][
var]->Integral());
1255 double(fPDFbins[s_or_b][ipbin][etbin - 1][etabin][
var]->GetBinContent(
1266 "el_d0significance",
1274 "el_trackd0pvunbiased",
1277 "el_deltaphiRescaled",