18 "el_secondLambda",
"el_lateral",
"el_longitudinal",
"el_centerLambda",
19 "el_fracMax",
"el_secondR",
"el_significance",
"el_secondDensity"
40 StatusCode
sc(StatusCode::SUCCESS);
45 "You need to specify the input PDF file name before you call "
46 "initialize() with setPDFFileName('your/file/name.root') ");
47 sc = StatusCode::FAILURE;
52 ATH_MSG_ERROR(
"Configuration issue : CutLikelihood expected size "
53 << number_of_expected_bin <<
" input size "
56 "Could NOT initialize! Please fix the errors mentioned above...");
57 sc = StatusCode::FAILURE;
66 m_acceptInfo.addCut(
"kinematicEta",
"pass kinematic eta");
68 sc = StatusCode::FAILURE;
70 m_acceptInfo.addCut(
"kinematicEt",
"pass kinematic Et ");
72 sc = StatusCode::FAILURE;
77 sc = StatusCode::FAILURE;
81 if (
sc == StatusCode::FAILURE) {
83 "! Something went wrong with the setup of the return objects...");
93 gSystem->ExpandPathName(tmpString);
94 std::string fname(tmpString.Data());
95 m_pdfFile = TFile::Open(fname.c_str(),
"READ");
99 return StatusCode::FAILURE;
103 for (
unsigned int varIndex = 0; varIndex <
s_fnVariables; varIndex++) {
104 const std::string& vstr =
fVariables[varIndex];
121 ATH_MSG_DEBUG(
"Initialization complete for a LH tool with these specs:"
122 <<
"\n - PdfFileName : "
124 <<
"\n - Variable bitmask : "
126 <<
"\n - VariableNames : "
133 unsigned int varIndex)
135 for (
unsigned int s_or_b = 0; s_or_b < 2; ++s_or_b) {
136 for (
unsigned int ip = 0; ip < IP_FBINS; ++ip) {
140 std::string sig_bkg = (s_or_b == 0) ?
"sig" :
"bkg";
143 unsigned int eta_tmp =
eta;
144 unsigned int et_tmp =
et;
147 const std::string pdfdir = std::format(
"{}/{}", vstr, sig_bkg);
148 std::string pdf = std::format(
"{}_{}_smoothed_hist_from_KDE_{}",
149 vstr, sig_bkg, binname);
151 if (!
m_pdfFile->GetListOfKeys()->Contains(vstr.c_str())) {
153 << vstr <<
" because the folder does not exist.");
156 if (!((TDirectory*)
m_pdfFile->Get(vstr.c_str()))
158 ->Contains(sig_bkg.c_str())) {
160 << vstr <<
" because the folder does not exist.");
164 if (
et == 0 && !((TDirectory*)
m_pdfFile->Get(pdfdir.c_str()))
166 ->Contains(pdf.c_str())) {
167 ATH_MSG_INFO(
"using lowest GeV bin in place of all below.");
169 pdf = std::format(
"{}_{}_smoothed_hist_from_KDE_{}",
170 vstr, sig_bkg, binname);
172 if (((TDirectory*)
m_pdfFile->Get(pdfdir.c_str()))
174 ->Contains(pdf.c_str())) {
176 (TH1F*)(((TDirectory*)
m_pdfFile->Get(pdfdir.c_str()))->Get(pdf.c_str()));
178 std::make_unique<EGSelectors::SafeTH1>(hist);
180 ATH_MSG_INFO(
"Warning: Object " << pdf <<
" does not exist.");
181 ATH_MSG_INFO(
"Skipping all other histograms with this variable.");
217 bool passKineEta(
true);
218 bool passKineEt(
true);
221 if (std::fabs(vars_struct.
eta) < 2.5) {
224 <<
", which is fabs(eta)<2.5 Returning False.");
238 << vars_struct.
eT <<
". Returning false..");
248 double cutDiscriminant = -999.;
249 unsigned int ibin_combined = etbin *
s_fnEtaBins + etabin;
265 if (vars_struct.
likelihood < cutDiscriminant) {
283 double secondDensity,
307 double result = -999;
312 std::vector<double>
vec(arr, arr +
sizeof(arr) /
sizeof(
double));
316 vec, vars_struct.
eT, vars_struct.
eta, vars_struct.
ip);
322 const std::vector<float>& varVector,
327 std::vector<double>
vec;
330 vec.push_back(varVector[var]);
337 const std::vector<double>& varVector,
357 ATH_MSG_WARNING(
"Error! Variable vector size mismatch! Check your vector!");
373 for (
unsigned int s_or_b = 0; s_or_b < 2; s_or_b++) {
376 m_fPDFbins[s_or_b][ipbin][etbin][etabin][var]->FindBin(varVector[var]);
380 double(
m_fPDFbins[s_or_b][ipbin][etbin][etabin][var]->Integral());
383 "Error! PDF integral == 0!");
389 prob = double(
m_fPDFbins[s_or_b][ipbin][etbin][etabin][var]->GetBinContent(
395 else if (s_or_b == 1)
410 double fEpsilon = 1e-99;
416 double disc = ps / double(ps + pb);
420 else if (disc <= 0.0)
424 disc = -std::log(1.0 / disc - 1.0) * (1. / double(tau));
434 for (
unsigned int ipBin = 0; ipBin < IP_FBINS; ++ipBin) {
446 const double etaBins[nEtaBins] = { 2.6, 2.7, 2.8, 2.9, 3.0,
447 3.1, 3.16, 3.35, 3.6, 4.9 };
448 for (
unsigned int etaBin = 0; etaBin < nEtaBins; ++etaBin) {
449 if (std::fabs(
eta) < etaBins[etaBin])
452 return (nEtaBins - 1);
458 const double GeV = 1000;
460 const double eTBins[nEtBins] = {
463 for (
unsigned int eTBin = 0; eTBin < nEtBins; ++eTBin) {
464 if (eT < eTBins[eTBin]) {
468 return (nEtBins - 1);
478 const std::string& iptype)
480 double eta_bounds[
s_fnEtaBins] = { 2.5, 2.6, 2.7, 2.8, 2.9,
481 3.0, 3.1, 3.16, 3.35, 3.6 };
483 if (!iptype.empty()) {
484 return std::format(
"{}{}et{:02}eta{:.2f}",
486 et_bounds[etbin], eta_bounds[etabin]);
488 return std::format(
"et{}eta{:.2f}",
489 et_bounds[etbin], eta_bounds[etabin]);
495 const std::string& vars)
const
497 unsigned int mask = 0x0;
500 if (vars.find(
fVariables[var]) != std::string::npos) {
502 mask = mask | 0x1 << var;
Scalar eta() const
pseudorapidity method
#define ATH_MSG_WARNING(x)
std::vector< size_t > vec
void setCutResult(const std::string &cutName, bool cutResult)
Set the result of a cut, based on the cut name (safer).
AsgMessaging(const std::string &name)
Constructor with a name.
Extra patterns decribing particle interation process.