294 m_runEigenVectorMethod(
false), m_EVStrategy(
SFEigen), m_useRecommendedEVExclusions(
false), m_verbose(
true),
295 m_absEtaStrategy(
GiveUp), m_otherStrategy(
Flag)
303 m_taggerName = taggerName;
306 env.ReadFile(configname.c_str(),kEnvGlobal);
310 TString
filename =
env.GetValue(
"File",
"BTaggingPerformanceCalibrations.root");
311 m_filenameEff = string(
env.GetValue(
"FileEff",
""));
trim(m_filenameEff);
312 m_filenameSF = string(
env.GetValue(
"FileSF",
""));
trim(m_filenameSF);
313 if (m_filenameEff ==
"") {
314 m_filenameEff = pathname +
filename.Data();
316 if (m_filenameSF ==
"") {
317 m_filenameSF = pathname +
filename.Data();
321 cout <<
"=== CalibrationDataInterfaceROOT::CalibrationDataInterfaceROOT ===" << endl;
322 cout <<
" Config name : " << configname << endl;
323 cout <<
" taggerName : " << taggerName << endl;
324 cout <<
" Efficiency file name : " << m_filenameEff << endl
325 <<
" SF file name : " << m_filenameSF << endl;
328 m_fileEff = TFile::Open(m_filenameEff.c_str(),
"READ");
329 if (m_filenameEff == m_filenameSF)
330 m_fileSF = m_fileEff;
332 m_fileSF = TFile::Open(m_filenameSF.c_str(),
"READ");
336 m_fileSF->GetObject(
"VersionInfo/BuildNumber",
s);
337 if (
s) cout <<
" CDI file build number: " <<
s->GetName() << endl;
341 m_flavours = {
"B",
"C",
"T",
"Light" };
342 string testPrefix(taggerName); testPrefix +=
".";
347 string::size_type
end;
350 std::map<string, std::vector<string> > effNames;
351 for (
auto const& flavour : m_flavours) {
352 string test(testPrefix);
test +=
"EfficiencyCalibration";
test += flavour;
test +=
"Name";
353 effNames[flavour] =
split(
string(
env.GetValue(
test.c_str(),
"default")));
355 setEffCalibrationNames(effNames);
358 std::map<string, string> SFNames;
359 for (
auto const& flavour : m_flavours) {
360 string test(testPrefix);
test +=
"ScaleFactorCalibration";
test += flavour;
test +=
"Name";
361 SFNames[flavour] = string(
env.GetValue(
test.c_str(),
"default"));
trim(SFNames[flavour]);
363 setSFCalibrationNames(SFNames);
369 string AL(
env.GetValue(
"aliases",
""));
377 string::size_type arrow =
alias.find(
"->");
378 if (arrow == string::npos)
continue;
381 if (
end != string::npos) AL = AL.substr(
end+1);
382 }
while (
end != string::npos);
386 string test=
"runEigenVectorMethod";
387 m_runEigenVectorMethod=(
bool)
env.GetValue(
test.c_str(),0);
389 if (m_runEigenVectorMethod) {
394 test =
"excludeFromCovMatrix";
395 std::vector<std::string> to_exclude =
split(
env.GetValue(
test.c_str(),
""));
397 for (
auto const& flavour : m_flavours) {
398 m_excludeFromCovMatrix[flavour] = to_exclude;
400 for (
auto const& flavour : m_flavours) {
401 test =
"excludeFrom";
test += flavour;
test +=
"CovMatrix";
404 m_excludeFromCovMatrix[flavour].insert(m_excludeFromCovMatrix[flavour].
end(), to_exclude.begin(), to_exclude.end());
407 unsigned int n_excluded = 0;
408 for (
auto const& flavour : m_flavours) {
409 n_excluded += m_excludeFromCovMatrix[flavour].size();
412 cout <<
" List of uncertainties to exclude:";
413 if (n_excluded == 0) cout <<
" none";
414 for (
auto const& flavour : m_flavours) {
415 if (m_excludeFromCovMatrix[flavour].
size() > 0) {
416 cout <<
"\n\t" << flavour <<
":\t";
417 for (
unsigned int i = 0;
i < m_excludeFromCovMatrix[flavour].size(); ++
i) {
418 cout << m_excludeFromCovMatrix[flavour].at(
i);
419 if (
i+1 == m_excludeFromCovMatrix[flavour].
size()) cout <<
"; ";
429 m_useRecommendedEVExclusions = (
bool)
env.GetValue(
"ExcludeRecommendedFromEigenVectorTreatment",
false);
432 std::map<string, EVReductionStrategy> mappings;
433 mappings[
"Loose"] =
Loose;
434 mappings[
"Medium"] =
Medium;
435 mappings[
"Tight"] =
Tight;
436 for (
auto const& flavour : m_flavours) {
437 test = testPrefix;
test +=
"EigenvectorReduction";
test += flavour;
438 std::string reduction = string(
env.GetValue(
test.c_str(),
"Loose"));
trim(reduction);
439 m_EVReductions[flavour] = mappings.find(reduction) == mappings.end() ? mappings[
"Loose"] : mappings.find(reduction)->second;
444 m_maxAbsEta =
env.GetValue(
"MaxAbsEta", 2.5);
445 if (m_maxAbsEta < 0) m_maxAbsEta = 2.5;
453 cerr <<
"unknown |eta| extrapolation strategy: " <<
strategy <<
", setting to GiveUp" << endl;
454 m_absEtaStrategy =
GiveUp;
464 cerr <<
"unknown general extrapolation strategy: " <<
strategy <<
", setting to Flag" << endl;
465 m_otherStrategy =
Flag;
469 m_maxTagWeight =
env.GetValue(
"MaxTagWeight", 10.0);
472 m_useMCMCSF = (
bool)
env.GetValue(
"useMCMCSF", 1);
474 m_useTopologyRescaling = (
bool)
env.GetValue(
"useTopologySF", 0);
476 if (m_verbose) cout <<
"======= end of CalibrationDataInterfaceROOT instantiation ========" << endl;