264 #include <boost/algorithm/string.hpp>
269 #include "TObjString.h"
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;
482 const char* fileSF,
const char* fileEff,
483 const std::vector<std::string>& jetAliases,
484 const std::map<std::string, std::string>& SFNames,
485 const std::map<std::string, std::vector<std::string> >& EffNames,
486 const std::map<std::string, std::vector<std::string> >& excludeFromEV,
487 const std::map<std::string, EVReductionStrategy>& EVReductions,
488 bool useEV,
Uncertainty strat,
bool useMCMCSF,
bool useTopologyRescaling,
489 bool useRecommendedEEVExclusions,
bool verbose,
490 std::vector<std::string> flavours) :
491 m_filenameSF(fileSF), m_filenameEff(
""), m_flavours(flavours),
492 m_runEigenVectorMethod(useEV), m_EVStrategy(strat), m_EVReductions(EVReductions),
493 m_useRecommendedEVExclusions(useRecommendedEEVExclusions), m_verbose(
verbose),
494 m_useMCMCSF(useMCMCSF), m_useTopologyRescaling(useTopologyRescaling),
495 m_maxAbsEta(2.5), m_absEtaStrategy(
GiveUp),
496 m_otherStrategy(
Flag), m_maxTagWeight(10.0)
529 cout <<
"=== CalibrationDataInterfaceROOT::CalibrationDataInterfaceROOT ===" << endl;
530 cout <<
" taggerName : " << taggerName.c_str() << endl;
531 cout <<
" Systematic strategy : ";
533 cout <<
"SFEigen" << endl;
535 cout <<
"SFGlobalEigen" << endl;
537 cout <<
" Other" << endl;
539 if (fileEff) cout <<
" Efficiency file name : " << fileEff << endl;
540 cout <<
" SF file name : " << fileSF << endl
546 m_fileSF = TFile::Open(fileSF,
"READ");
547 if (fileEff && strcmp(fileSF, fileEff) != 0) {
549 m_fileEff = TFile::Open(fileEff,
"READ");
555 m_fileSF->GetObject(
"VersionInfo/BuildNumber",
s);
556 if (
s) cout <<
" CDI file build number: " <<
s->GetName() << endl;
560 for (
unsigned int i = 0;
i < jetAliases.size(); ++
i) {
563 string::size_type arrow = jetAliases[
i].find(
"->");
564 if (arrow == string::npos)
continue;
565 m_aliases[jetAliases[
i].substr(0,arrow)] = jetAliases[
i].substr(arrow+2);
577 unsigned int n_excluded = 0;
582 cout <<
" List of uncertainties to exclude:";
583 if (n_excluded == 0) cout <<
" none";
586 cout <<
"\n\t" << flavour <<
":\t";
599 if (
m_verbose) cout <<
"======= end of CalibrationDataInterfaceROOT instantiation ========" << endl;
614 m_filenameSF(
other.m_filenameSF), m_filenameEff(
other.m_filenameEff),
615 m_eigenVariationsMap(), m_runEigenVectorMethod(
other.m_runEigenVectorMethod), m_EVStrategy(
other.m_EVStrategy),
616 m_excludeFromCovMatrix(
other.m_excludeFromCovMatrix), m_useMCMCSF(
other.m_useMCMCSF), m_useTopologyRescaling(
other.m_useTopologyRescaling),
617 m_refMap(), m_hadronisationReference(),
618 m_maxAbsEta(
other.m_maxAbsEta), m_absEtaStrategy(
other.m_absEtaStrategy), m_otherStrategy(
other.m_otherStrategy),
619 m_etaCounters(
other.m_etaCounters), m_mainCounters(
other.m_mainCounters), m_extrapolatedCounters(
other.m_extrapolatedCounters),
620 m_checkedWeightScaleFactors(
other.m_checkedWeightScaleFactors), m_maxTagWeight(
other.m_maxTagWeight)
636 if ((m_fileEff!=0) && (m_fileSF!=0)) {
637 if (m_fileEff == m_fileSF) {
639 delete m_fileEff; m_fileEff = 0;
643 delete m_fileEff; m_fileEff = 0;
644 delete m_fileSF; m_fileSF = 0;
655 it != m_refMap.end(); ++
it) {
657 {
delete it->second;
it->second=
nullptr; }
661 if (m_absEtaStrategy ==
Flag && m_verbose) {
663 cout <<
"\t\tCalibrationDataInterfaceROOT |eta| out-of-bounds summary:" << endl;
665 if (m_etaCounters[
index] > 0) {
667 cout <<
"\t\t\t" << nameFromIndex(
index) <<
": " << m_etaCounters[
index] << endl;
669 if (!
found) cout <<
"\t\t\tNo issues found" << endl;
671 if (m_otherStrategy ==
Flag && m_verbose) {
673 cout <<
"\t\tCalibrationDataInterfaceROOT object out-of-bounds summary:" << endl;
675 if (m_mainCounters[
index] + m_extrapolatedCounters[
index] > 0) {
677 cout <<
"\t\t\t" << nameFromIndex(
index)
678 <<
" general: " << m_mainCounters[
index]
679 <<
", extrapolated: " << m_extrapolatedCounters[
index]
682 if (!
found) cout <<
"\t\t\tNo issues found" << endl;
689 const std::string& OP,
690 const std::string&
author,
691 bool isSF,
unsigned int&
index,
692 unsigned int mapIndex)
716 std::map<string, unsigned int>::const_iterator
it = m_objectIndices.find(
name);
717 if (
it == m_objectIndices.end()) {
720 string flavour = (
label ==
"N/A") ?
"Light" :
label;
721 string cntname = getContainername(flavour, isSF, mapIndex);
722 if (m_verbose) std::cout <<
"CalibrationDataInterfaceROOT->retrieveCalibrationIndex : container name is " << cntname << std::endl;
723 retrieveContainer(flavour, OP,
author, cntname, isSF, m_verbose);
724 it = m_objectIndices.find(
name);
725 if (
it == m_objectIndices.end())
return false;
727 if (m_verbose) std::cout <<
"CalibrationDataInterfaceROOT->retrieveCalibrationIndex : container " <<
name <<
" already cached! " << std::endl;
737 const string&
label,
const string& OP,
739 unsigned int mapIndex)
753 unsigned int indexEff, indexSF;
754 if (! (retrieveCalibrationIndex (
label, OP,
variables.jetAuthor,
false, indexEff, mapIndex) && retrieveCalibrationIndex (
label, OP,
variables.jetAuthor,
true, indexSF))) {
755 cerr <<
"getScaleFactor: unable to find SF calibration for object " <<
fullName(
variables.jetAuthor, OP,
label,
false, mapIndex) <<
" or SF calibration for object " <<
fullName(
variables.jetAuthor, OP,
label,
true) << endl;
768 unsigned int indexSF,
unsigned int indexEff,
769 Uncertainty unc,
const std::string& flavour,
unsigned int numVariation)
789 unsigned int indexSF,
unsigned int indexEff,
806 cerr <<
"getScaleFactor: error retrieving container!" << endl;
813 cerr <<
"Jet |eta| is outside of the boundary!" << endl;
818 double MCMCSF = m_useMCMCSF ? getMCMCScaleFactor(
variables, indexSF, indexEff) : 1;
822 cerr <<
" ERROR. Trying to call eigenvector method but initialization not switched on in b-tagging configuration." << endl;
823 cerr <<
" Please correct your configuration first. Nominal uncertainties used. " << endl;
828 std::shared_ptr<CalibrationDataEigenVariations> eigenVariation;
830 eigenVariation=m_eigenVariationsMap.at(container);
831 }
catch (
const std::out_of_range&) {
832 cerr <<
" Could not retrieve eigenvector variation, while it should have been there." << endl;
840 if (numVariation > maxVariations-1) {
841 cerr <<
"Asked for " << ((unc ==
SFEigen) ?
"eigenvariation" :
"named variation") <<
" number: " << numVariation <<
" but overall number of available variations is: " << maxVariations << endl;
846 cerr <<
"Eigenvector object is there but cannot retrieve up and down uncertainty histograms." << endl;
853 std::shared_ptr<CalibrationDataGlobalEigenVariations>
GEV = std::dynamic_pointer_cast<CalibrationDataGlobalEigenVariations>(eigenVariation);
855 cerr <<
"Analysis::CalibrationDataInterfaceROOT::getScaleFactor: dynamic cast failed\n";
858 unsigned int maxVariations =
GEV->getNumberOfEigenVariations(flavour);
859 if (numVariation > maxVariations-1) {
860 cerr <<
"Asked for global eigenvariation number: " << numVariation <<
" but overall number of available variations is: " << maxVariations << endl;
863 bool isOK =
GEV->getEigenvectorVariation(flavour, numVariation,
up,down);
865 cerr <<
"Eigenvector object is there but cannot retrieve up and down uncertainty histograms." << endl;
869 extrapolate =
GEV->isExtrapolationVariation(numVariation, flavour);
871 std::cerr <<
"ERROR: you requested " << unc <<
" but that isn't in the set of (SFEigen, SFGlobalEigen, SFNamed) for eigenvariations. " << std::endl;
882 if (m_otherStrategy ==
GiveUp)
886 else if (m_otherStrategy ==
Flag) {
888 increaseCounter(indexSF);
893 result.first = MCMCSF*valueUp;
894 result.second = MCMCSF*valueDown;
910 cerr <<
"getScaleFactor: error retrieving result in non-EV context!" << endl;
913 if (m_otherStrategy ==
GiveUp){
917 }
else if (m_otherStrategy ==
Flag) {
919 increaseCounter(indexSF);
929 cerr <<
"getScaleFactor: error retrieving Scale factor parameter covariance matrix!" << endl;
937 cerr <<
"getScaleFactor: error retrieving Scale factor parameter systematic uncertainty!" << endl;
943 cerr <<
"getScaleFactor: error retrieving Scale factor parameter extrapolation uncertainty!" << endl;
948 cerr <<
"getScaleFactor: error retrieving Scale factor parameter extrapolation uncertainty!" << endl;
951 double uncertainty = combinedUncertainty(
stat, resSyst);
953 result.second = MCMCSF*uncertainty;
964 const string&
label,
const string& OP,
979 cerr <<
"getMCEfficiency: unable to find Eff calibration for object " <<
fullName(
variables.jetAuthor, OP,
label,
false, mapIndex) << endl;
1027 cerr <<
"Jet |eta| is outside of the boundary!" << endl;
1036 if (m_otherStrategy ==
GiveUp)
1038 else if (m_otherStrategy ==
Flag)
1040 this->increaseCounter(
index);
1046 cerr <<
"getMCEfficiency: error retrieving MC efficiency parameter covariance matrix!" << endl;
1060 double uncertainty =
stat;
1062 result.second = uncertainty;
1072 const string&
label,
1073 const string& OP,
Uncertainty unc,
const std::string& flavour,
1074 unsigned int numVariation,
unsigned int mapIndex)
1089 unsigned int indexSF, indexEff;
1090 if (! (retrieveCalibrationIndex (
label, OP,
variables.jetAuthor,
false, indexEff, mapIndex) &&
1091 retrieveCalibrationIndex (
label, OP,
variables.jetAuthor,
true, indexSF))) {
1092 cerr <<
"getEfficiency: unable to find Eff calibration for object " <<
fullName(
variables.jetAuthor, OP,
label,
false, mapIndex) <<
" or SF calibration for object " <<
fullName(
variables.jetAuthor, OP,
label,
true) << endl;
1104 unsigned int indexSF,
unsigned int indexEff,
1105 Uncertainty unc,
const std::string& flavour,
unsigned int numVariation)
1127 unsigned int indexSF,
unsigned int indexEff,
1149 double relative = 0;
1150 double value = effResult.first;
1157 double valueDown = effResult.first*sfResult.second;
1159 result.second = valueDown;
1163 relative = effResult.second/effResult.first;
1164 double sfRelative = sfResult.second/sfResult.first;
1169 relative = TMath::Sqrt(sfRelative*sfRelative + relative*relative);
1173 cerr <<
"ERROR: CalibrationDataInterfaceROOT::getEfficiency: SF null result, SF=" << sfResult.first <<
" MC eff=" << effResult.first <<
"; setting SF=1." << endl;
1187 const string&
label,
1189 unsigned int numVariation,
unsigned int mapIndex)
1205 unsigned int indexSF, indexEff;
1206 if (! (retrieveCalibrationIndex (
label, OP,
variables.jetAuthor,
false, indexEff, mapIndex) &&
1207 retrieveCalibrationIndex (
label, OP,
variables.jetAuthor,
true, indexSF))) {
1208 cerr <<
"getInefficiencyScaleFactor: unable to find Eff calibration for object "
1210 <<
" or SF calibration for object "
1224 unsigned int indexSF,
unsigned int indexEff,
1225 Uncertainty unc,
const std::string& flavour,
unsigned int numVariation)
1248 unsigned int indexSF,
unsigned int indexEff,
1274 double sf = sfResult.first;
1275 double sferr = sfResult.second;
1308 const string&
label,
1310 unsigned int numVariation,
unsigned int mapIndex)
1326 unsigned int indexSF, indexEff;
1327 if (! (retrieveCalibrationIndex (
label, OP,
variables.jetAuthor,
false, indexEff, mapIndex) &&
1328 retrieveCalibrationIndex (
label, OP,
variables.jetAuthor,
true, indexSF))) {
1329 cerr <<
"getInefficiency: unable to find Eff calibration for object "
1331 <<
" or SF calibration for object "
1345 unsigned int indexSF,
unsigned int indexEff,
1346 Uncertainty unc,
const std::string& flavour,
unsigned int numVariation)
1369 unsigned int indexSF,
unsigned int indexEff,
1393 double val =
std::max(0., 1. - effResult.first * sfResult.first);
1397 if (effResult.first <= 0. || sfResult.first <= 0.)
return Analysis::kError;
1402 double valDown =
std::max(0., 1. - effResult.first*sfResult.second);
1408 err = effResult.second/effResult.first*effResult.second/effResult.first
1409 + sfResult.second/sfResult.first*sfResult.second/sfResult.first;
1423 const string&
label,
const string& OP,
1440 return std::make_pair(
std::max(0., 1. - effResult.first), effResult.second);
1460 return std::make_pair(
std::max(0., 1. - effResult.first), effResult.second);
1466 unsigned indexSF,
unsigned int indexEff)
const
1474 int indexSFRef = m_hadronisationReference[indexSF], indexEffRef = m_hadronisationReference[indexEff];
1475 if (indexSFRef < 0 || indexEffRef < 0 || indexSFRef == indexEffRef)
return 1;
1478 double effSFRef; m_objects[indexSFRef]->getResult(
variables, effSFRef);
1479 double effEffRef; m_objects[indexEffRef]->getResult(
variables, effEffRef);
1480 return (effSFRef > 0 && effEffRef > 0) ? effSFRef/effEffRef : 1;
1487 unsigned int numVariation,
unsigned int mapIndex)
1505 static const string cont(
"Continuous");
1507 unsigned int indexSF, indexEff;
1508 if (! (retrieveCalibrationIndex (
label, cont,
variables.jetAuthor,
false, indexEff, mapIndex) &&
1509 retrieveCalibrationIndex (
label, cont,
variables.jetAuthor,
true, indexSF))) {
1510 cerr <<
"getWeightScaleFactor: unable to find Eff calibration for object "
1512 <<
" or SF calibration for object "
1524 unsigned int indexSF,
unsigned int indexEff,
1551 unsigned int indexSF,
unsigned int indexEff,
1578 checkWeightScaleFactors(indexSF, indexEff);
1583 cerr <<
"Jet |eta| is outside of the boundary!" << endl;
1593 else if (m_otherStrategy ==
Flag) {
1595 increaseCounter(indexSF);
1604 double fracMCref = refMCResult.first;
1607 double fracSFref = fracMCref, fracEffref = fracMCref;
1609 int indexSFref = m_hadronisationReference[indexSF], indexEffref = m_hadronisationReference[indexEff];
1610 if (indexSFref < 0 || indexEffref < 0) {
1611 cerr <<
"getWeightScaleFactor: error: generator-specific corrections requested but necessary reference containers lacking " << endl;
1614 m_objects[indexSFref]->getResult(
variables, fracSFref);
1615 m_objects[indexEffref]->getResult(
variables, fracEffref);
1616 if (! (fracSFref > 0. && fracEffref > 0.)) {
1617 cerr <<
"getWeightScaleFactor: error: invalid reference tag weight fraction " <<fracSFref <<
" " <<fracEffref << std::endl;
1628 else if (m_otherStrategy ==
Flag)
1631 if (!(fracMCnew > 0.) and m_useTopologyRescaling) {
1632 cerr <<
"getWeightScaleFactor: error: null fracMCnew would lead to invalid operation" << endl;
1636 if (!m_runEigenVectorMethod && (unc ==
SFEigen || unc ==
SFNamed)) {
1637 cerr <<
"getWeightScaleFactor: ERROR. Trying to call eigenvector method but initialization not switched on in b-tagging .env config file." << endl;
1638 cerr <<
" Please correct your .env config file first. Nominal uncertainties used. " << endl;
1642 std::shared_ptr<CalibrationDataEigenVariations> eigenVariation;
1644 eigenVariation = m_eigenVariationsMap.at(container);
1645 }
catch (
const std::out_of_range&) {
1646 cerr <<
"getWeightScaleFactor: could not retrieve eigenvector variation, while it should have been there." << endl;
1650 if (numVariation > maxVariations-1) {
1651 cerr <<
"getWeightScaleFactor: asked for " << ((unc ==
SFEigen) ?
"eigenvariation" :
"named variation") <<
" number: " << numVariation <<
" but overall number of available variations is: " << maxVariations << endl;
1658 cerr <<
"getWeightScaleFactor: Eigenvector object is there but cannot retrieve up and down uncertainty histograms." << endl;
1671 double variationUp = valueUp -
value;
1672 double variationDown = valueDown -
value;
1674 if (m_useTopologyRescaling)
value = 1.0 + (
value - 1.0) * (fracMCref / fracSFref);
1676 if (m_useMCMCSF)
value *= (fracSFref / fracEffref);
1678 if (m_useTopologyRescaling)
value = 1.0 + (
value - 1.0) * (fracEffref / fracMCnew);
1680 if (m_useTopologyRescaling) {
1681 double f = (fracMCref / fracMCnew);
1684 }
else if (m_useMCMCSF) {
1685 double f = (fracSFref / fracEffref);
1689 valueUp =
value + variationUp;
1690 valueDown =
value + variationDown;
1692 valueUp = 0; increaseCounter(indexSF,
TagWeight);
1693 }
else if (valueUp > m_maxTagWeight) {
1694 valueUp = m_maxTagWeight; increaseCounter(indexSF,
TagWeight);
1696 if (valueDown < 0) {
1697 valueDown = 0; increaseCounter(indexSF,
TagWeight);
1698 }
else if (valueDown > m_maxTagWeight) {
1699 valueDown = m_maxTagWeight; increaseCounter(indexSF,
TagWeight);
1703 result.second = valueDown;
1713 cerr <<
"getWeightScaleFactor: error retrieving Scale factor parameter covariance matrix!" << endl;
1720 cerr <<
"getWeightScaleFactor: error retrieving Scale factor parameter systematic uncertainty!" << endl;
1726 cerr <<
"getWeightScaleFactor: error retrieving Scale factor parameter extrapolation uncertainty!" << endl;
1731 cerr <<
"getWeightScaleFactor: error retrieving Scale factor parameter extrapolation uncertainty!" << endl;
1734 double uncertainty = combinedUncertainty(
stat, uncertaintyResult);
1738 if (m_useTopologyRescaling)
value = 1.0 + (
value - 1.0) * (fracMCref / fracSFref);
1740 if (m_useMCMCSF)
value *= (fracSFref / fracEffref);
1742 if (m_useTopologyRescaling)
value = 1.0 + (
value - 1.0) * (fracEffref / fracMCnew);
1745 }
else if (
value > m_maxTagWeight) {
1749 if (m_useTopologyRescaling) {
1750 uncertainty *= (fracMCref / fracMCnew);
1751 }
else if (m_useMCMCSF) {
1752 uncertainty *= (fracSFref / fracEffref);
1756 result.second = uncertainty;
1764 unsigned int indexEff)
1772 std::vector<std::pair<unsigned int, unsigned int> >::const_iterator
it =
std::find(m_checkedWeightScaleFactors.begin(), m_checkedWeightScaleFactors.end(), std::make_pair(indexSF, indexEff));
1773 if (
it != m_checkedWeightScaleFactors.end())
return;
1780 cerr <<
"CalibrationDataInterfaceROOT::checkWeightScaleFactors: error: container for object " << nameFromIndex(indexSF) <<
" not found!" << endl;
1782 }
else if (! container->GetValue(
"MCreference")) {
1783 cerr <<
"CalibrationDataInterfaceROOT::checkWeightScaleFactors: error: no MCreference histogram for object " << nameFromIndex(indexSF) <<
"!" << endl;
1787 if (! effContainer) {
1788 cerr <<
"CalibrationDataInterfaceROOT::checkWeightScaleFactors: error: container for object " << nameFromIndex(indexEff) <<
" not found!" << endl;
1796 std::map<unsigned int, std::vector<double> > boundaries, effBoundaries, mergedBoundaries;
1797 for (
unsigned int t = 0;
t < vars.size(); ++
t)
1799 for (
unsigned int t = 0;
t < effVars.size(); ++
t)
1814 if (
v[0] < 0 && vEff[0] >= 0) {
1816 std::vector<double> vtmp(vEff);
1818 if (*
it > 0) vEff.insert(vEff.begin(), -(*
it));
1819 }
else if (
v[0] >= 0 && vEff[0] < 0) {
1821 std::vector<double> vtmp(
v);
1823 if (*
it > 0)
v.insert(
v.begin(), -(*
it));
1828 for (
unsigned int t = 0;
t < vars.size(); ++
t) {
1829 if (effBoundaries.find(vars[
t]) == effBoundaries.end())
1831 mergedBoundaries[vars[
t]] = boundaries[vars[
t]];
1835 mergedBoundaries[vars[
t]] = effBoundaries[vars[
t]];
1841 while (itcmp != mergedBoundaries[vars[
t]].
end() &&
1843 *itcmp < *
it) ++itcmp;
1848 mergedBoundaries[vars[
t]].insert(itcmp, *
it);
1853 for (
unsigned int t = 0;
t < effVars.size(); ++
t)
1854 if (boundaries.find(effVars[
t]) == boundaries.end())
1855 mergedBoundaries[effVars[
t]] = effBoundaries[effVars[
t]];
1860 cerr <<
"CalibrationDataInterfaceROOT::checkWeightScaleFactors: " <<
"no tag weight axis found for object " << nameFromIndex(indexSF) << endl;
1862 cerr <<
"CalibrationDataInterfaceROOT::checkWeightScaleFactors: " <<
"no tag weight axis found for object " << nameFromIndex(indexEff) << endl;
1864 cerr <<
"CalibrationDataInterfaceROOT::checkWeightScaleFactors: " <<
"different tag weight binning for objects " << nameFromIndex(indexSF) <<
" (";
1866 for (
unsigned int ib = 0;
ib <
v.size()-1; ++
ib) cerr <<
v[
ib] <<
",";
1867 cerr <<
v[
v.size()-1] <<
") and " << nameFromIndex(indexEff) <<
" (";
1869 for (
unsigned int ib = 0;
ib <
v.size()-1; ++
ib) cerr <<
v[
ib] <<
",";
1870 cerr <<
v[
v.size()-1] <<
") do not match!" << endl;
1883 cout <<
"CalibrationDataInterfaceROOT::checkWeightScaleFactors: cross-checking scale factors for objects " << nameFromIndex(indexSF) <<
" and " << nameFromIndex(indexEff) <<
"\n" << std::setfill(
'-') << std::setw(100) <<
"-" << endl;
1884 cout << std::setfill(
' ');
1888 for (
unsigned int ipt = 0; ipt < vPt.size()-1; ++ipt) {
1889 x.jetPt = (vPt[ipt] + vPt[ipt+1]) * 500.;
1890 for (
unsigned int ieta = 0; ieta < vEta.size()-1; ++ieta) {
1891 x.jetEta = (vEta[ieta] + vEta[ieta+1]) / 2.;
1892 for (
unsigned int iwt = 0; iwt < vTagWeight.size()-1; ++iwt) {
1893 x.jetTagWeight = (vTagWeight[iwt] + vTagWeight[iwt+1]) / 2.;
1899 double fracMCref = uncertaintyResult.first;
1903 if (!(fracMCnew > 0.)) {
1904 cout <<
"\tfor (pt=" <<
x.jetPt <<
",eta=" <<
x.jetEta <<
",tagweight=" <<
x.jetTagWeight <<
"): invalid new MC fraction: " << fracMCnew << endl;
1906 double newvalue = 1.0 + (
value - 1.0) * fracMCref/fracMCnew;
1907 if (newvalue <= 0 || newvalue > m_maxTagWeight) cout <<
"\tfor (pt=" <<
x.jetPt <<
",eta=" <<
x.jetEta <<
",tagweight=" <<
x.jetTagWeight <<
"): old (value=" <<
value <<
",MC=" << fracMCref <<
"), new (value=" << newvalue <<
",MC=" << fracMCnew <<
")" << endl;
1914 m_checkedWeightScaleFactors.push_back(std::make_pair(indexSF, indexEff));
1925 if (m_absEtaStrategy ==
Ignore)
return pass;
1927 switch (m_absEtaStrategy) {
1929 if (std::fabs(
variables.jetEta) > m_maxAbsEta) {
1935 if (std::fabs(
variables.jetEta) > m_maxAbsEta) {
1949 for (std::map<std::string, unsigned int>::const_iterator
it = m_objectIndices.begin();
1950 it != m_objectIndices.end(); ++
it)
1951 if (
it->second ==
index)
return it->first;
1968 if (
index >= m_mainCounters.size()) {
1969 unsigned int minsize = (
index == 0) ? 2 : 2*
index;
1970 m_mainCounters.resize(minsize, 0);
1971 m_etaCounters.resize(minsize, 0);
1972 m_extrapolatedCounters.resize(minsize, 0);
1976 m_mainCounters[
index]++;
break;
1978 m_etaCounters[
index]++;
break;
1981 m_extrapolatedCounters[
index]++;
1988 const string&
label,
2006 cerr <<
"listScaleFactorUncertainties: unable to find SF calibration for object " <<
fullName(
author, OP,
label,
true) << endl;
2007 std::vector<string>
dummy;
2010 return listScaleFactorUncertainties(
index,
label, named);
2016 const std::string& flavour,
bool named)
2029 std::vector<string>
dummy;
2035 if (! m_runEigenVectorMethod)
return dummy;
2036 std::shared_ptr<CalibrationDataEigenVariations> eigenVariation=m_eigenVariationsMap.at(container);
2039 std::vector<string> ordered(unordered.size());
2040 for (
unsigned int i = 0;
i < unordered.size(); ++
i) {
2046 std::shared_ptr<CalibrationDataGlobalEigenVariations>
GEV = std::dynamic_pointer_cast<CalibrationDataGlobalEigenVariations>(eigenVariation);
2047 std::vector<std::string> unordered =
GEV->listNamedVariations(flavour);
2048 std::vector<std::string> ordered(unordered.size());
2049 for (
unsigned int i = 0;
i < unordered.size(); ++
i) {
2050 ordered[
GEV->getNamedVariationIndex(unordered[
i], flavour)] = unordered[
i];
2064 const std::string&
label,
2065 const std::string& OP,
2097 if (! container)
return 0;
2098 std::shared_ptr<CalibrationDataEigenVariations> eigenVariation=m_eigenVariationsMap.at(container);
2100 std::shared_ptr<CalibrationDataGlobalEigenVariations>
GEV = std::dynamic_pointer_cast<CalibrationDataGlobalEigenVariations>(eigenVariation);
2101 return GEV->getNumberOfEigenVariations(flavour);
2109 const std::string&
label,
2110 const std::string& OP)
2121 cerr <<
"getBinnedScaleFactors: unable to find SF calibration for object " <<
fullName(
author, OP,
label,
true) << endl;
2125 return (container) ?
dynamic_cast<TH1*
>(container->GetValue(
"result")) : 0;
2131 const std::string&
label,
2132 const std::string& OP,
2133 unsigned int mapIndex)
2144 if (! retrieveCalibrationIndex (
label, OP,
author,
false,
index, mapIndex)) {
2146 cerr <<
"getMCEfficiencyObject: unable to find efficiency calibration for object "
2151 return (container) ? container->GetValue(
"result") : 0;
2159 const std::string&
label,
2160 const std::string& OP,
2161 const std::string& unc,
2175 if (unc ==
"comment" || unc ==
"result" || unc ==
"combined" || unc ==
"statistics")
return 0;
2180 cerr <<
"getShiftedScaleFactors: unable to find SF calibration for object " <<
fullName(
author, OP,
label,
true) << endl;
2184 if (! container)
return nullptr;
2186 TH1*
result =
dynamic_cast<TH1*
>(container->GetValue(
"result"));
2187 TH1* hunc =
dynamic_cast<TH1*
>(container->GetValue(unc.c_str()));
2189 if ((! hunc) || (!
result))
return nullptr;
2190 if (hunc->GetDimension() !=
result->GetDimension() || hunc->GetNbinsX() !=
result->GetNbinsX() ||
2191 hunc->GetNbinsX() !=
result->GetNbinsX() || hunc->GetNbinsX() !=
result->GetNbinsX())
2199 std::string
name(container->GetName());
name +=
"_";
name += unc;
name +=
"_";
2200 TH1* shifted =
dynamic_cast<TH1*
>(
result->Clone(
name.c_str()));
2201 if (not shifted)
return nullptr;
2202 shifted->Add(hunc, sigmas);
2208 const std::string&
label,
2209 const std::string& OP,
2210 unsigned int mapIndex){
2220 if(!m_runEigenVectorMethod) {
2221 cerr <<
"runEigenVectorRecomposition: Recomposition need to be ran with CalibrationDataInterfaceRoot initialized in eigenvector mode" << endl;
2225 unsigned int indexSF;
2226 if (! retrieveCalibrationIndex (
label, OP,
author,
true, indexSF, mapIndex)) {
2227 cerr <<
"runEigenVectorRecomposition: unable to find SF calibration for object "
2232 return runEigenVectorRecomposition (
label, indexSF);
2237 unsigned int indexSF){
2245 cerr <<
"runEigenVectorRecomposition: error retrieving container!" << endl;
2250 std::shared_ptr<CalibrationDataEigenVariations> eigenVariation;
2252 eigenVariation = m_eigenVariationsMap.at(container);
2253 }
catch (
const std::out_of_range&) {
2254 cerr <<
"runEigenVectorRecomposition: Could not retrieve eigenvector variation, while it should have been there." << endl;
2258 std::map<std::string, std::map<std::string, float>> coefficientMap;
2262 m_coefficientMap = coefficientMap;
2266 std::map<std::string, std::map<std::string, float>>
2268 if(m_coefficientMap.empty())
2269 cerr <<
"getCoefficientMap: Call runEigenVectorRecomposition() before retrieving coefficient map! " <<endl;
2270 return m_coefficientMap;
2278 TMatrixDSym getStatCovarianceMatrix(
const TH1*
hist) {
2279 Int_t nbinx =
hist->GetNbinsX()+2, nbiny =
hist->GetNbinsY()+2, nbinz =
hist->GetNbinsZ()+2;
2281 if (
hist->GetDimension() > 1)
rows *= nbiny;
2282 if (
hist->GetDimension() > 2)
rows *= nbinz;
2284 for (Int_t binx = 1; binx < nbinx; ++binx){
2285 for (Int_t biny = 1; biny < nbiny; ++biny){
2286 for (Int_t binz = 1; binz < nbinz; ++binz) {
2287 Int_t
bin =
hist->GetBin(binx, biny, binz);
2299 TMatrixDSym getSystCovarianceMatrix(
const TH1*
ref,
const TH1* unc,
bool doCorrelated,
const std::string& uncname,
int tagWeightAxis) {
2300 Int_t nbinx =
ref->GetNbinsX()+2, nbiny =
ref->GetNbinsY()+2, nbinz =
ref->GetNbinsZ()+2;
2302 if (
ref->GetDimension() > 1)
rows *= nbiny;
2303 if (
ref->GetDimension() > 2)
rows *= nbinz;
2306 for(
int i=0 ;
i<10 ;
i++){
2307 Int_t
bin = unc->GetBin(1,
i,1);
2308 double uncval = unc->GetBinContent(
bin);
2309 cout << uncval <<
", ";
2313 if (unc->GetNbinsX()+2 != nbinx || unc->GetNbinsY()+2 != nbiny || unc->GetNbinsZ()+2 != nbinz || unc->GetDimension() !=
ref->GetDimension()) {
2314 std::cout <<
"getSystCovarianceMatrix: inconsistency found in histograms " <<
ref->GetName() <<
" and " << unc->GetName() <<
" : " << uncname << std::endl;
2325 if (! doCorrelated) {
2326 if (tagWeightAxis < 0) {
2328 for (Int_t binx = 1; binx < nbinx-1; ++binx){
2329 for (Int_t biny = 1; biny < nbiny-1; ++biny){
2330 for (Int_t binz = 1; binz < nbinz-1; ++binz) {
2331 Int_t
bin =
ref->GetBin(binx, biny, binz);
2332 double err = unc->GetBinContent(
bin);
2338 }
else if (tagWeightAxis == 0) {
2340 for (Int_t biny = 1; biny < nbiny-1; ++biny){
2341 for (Int_t binz = 1; binz < nbinz-1; ++binz){
2342 for (Int_t binx = 1; binx < nbinx-1; ++binx) {
2343 Int_t
bin =
ref->GetBin(binx, biny, binz);
2344 double err = unc->GetBinContent(
bin);
2345 for (Int_t binx2 = 1; binx2 < nbinx-1; ++binx2) {
2346 Int_t
bin2 =
ref->GetBin(binx2, biny, binz);
2347 double err2 = unc->GetBinContent(
bin2);
2354 }
else if (tagWeightAxis == 1) {
2356 for (Int_t binx = 1; binx < nbinx-1; ++binx){
2357 for (Int_t binz = 1; binz < nbinz-1; ++binz){
2358 for (Int_t biny = 1; biny < nbiny-1; ++biny) {
2359 Int_t
bin =
ref->GetBin(binx, biny, binz);
2360 double err = unc->GetBinContent(
bin);
2361 for (Int_t biny2 = 1; biny2 < nbiny-1; ++biny2) {
2362 Int_t
bin2 =
ref->GetBin(binx, biny2, binz);
2363 double err2 = unc->GetBinContent(
bin2);
2370 }
else if (tagWeightAxis == 2) {
2372 for (Int_t binx = 1; binx < nbinx-1; ++binx){
2373 for (Int_t biny = 1; biny < nbiny-1; ++biny){
2374 for (Int_t binz = 1; binz < nbinz-1; ++binz) {
2375 Int_t
bin =
ref->GetBin(binx, biny, binz);
2376 double err = unc->GetBinContent(
bin);
2377 for (Int_t binz2 = 1; binz2 < nbinz-1; ++binz2) {
2378 Int_t
bin2 =
ref->GetBin(binx, biny, binz2);
2379 double err2 = unc->GetBinContent(
bin2);
2389 for (Int_t binx = 1; binx < nbinx-1; ++binx){
2390 for (Int_t biny = 1; biny < nbiny-1; ++biny){
2391 for (Int_t binz = 1; binz < nbinz-1; ++binz) {
2392 Int_t
bin =
ref->GetBin(binx, biny, binz);
2393 double err = unc->GetBinContent(
bin);
2394 for (Int_t binx2 = 1; binx2 < nbinx-1; ++binx2){
2395 for (Int_t biny2 = 1; biny2 < nbiny-1; ++biny2){
2396 for (Int_t binz2 = 1; binz2 < nbinz-1; ++binz2) {
2397 Int_t
bin2 =
ref->GetBin(binx2, biny2, binz2);
2398 double err2 = unc->GetBinContent(
bin2);
2416 const std::string&
label,
2417 const std::string& OP,
2418 const std::string& unc)
2430 if (unc ==
"comment" || unc ==
"result" || unc ==
"combined")
return dummy;
2435 cerr <<
"getScaleFactorCovarianceMatrix: unable to find SF calibration for object " <<
fullName(
author, OP,
label,
true) << endl;
2439 if (!container)
return dummy;
2442 TH1*
result =
dynamic_cast<TH1*
>(container->GetValue(
"result"));
2446 if (unc ==
"statistics") {
2447 return getStatCovarianceMatrix(
result);
2449 TH1* hunc =
dynamic_cast<TH1*
>(container->GetValue(unc.c_str()));
2451 cout <<
"getScaleFactorCovarianceMatrix: no uncertainty object found "
2452 <<
"corresponding to name " << unc << endl;
2462 TMatrixDSym
cov = getStatCovarianceMatrix(
result);
2466 for (
unsigned int t = 0;
t < uncs.size(); ++
t) {
2467 if (uncs[
t] ==
"comment" || uncs[
t] ==
"result" || uncs[
t] ==
"combined" ||
2468 uncs[
t] ==
"statistics" || uncs[
t]==
"extrapolation" || uncs[
t]==
"MChadronisation" ||
2469 uncs[
t]==
"ReducedSets" || uncs[
t]==
"systematics")
continue;
2470 TH1* hunc =
dynamic_cast<TH1*
>(container->GetValue(uncs[
t].c_str()));
2472 std::cerr<<
"Analysis::CalibrationDataInterfaceROOT::getScaleFactorCovarianceMatrix : dynamic cast failed\n";
2489 if((!m_fileEff)||(!m_fileSF)) {
2490 cerr <<
"initialize can only be called once per CalibrationDataInterfaceROOT object" << endl;
2493 cout <<
"initializing BTagCalibrationDataInterfaceROOT for PROOF with jetAuthor = " << jetauthor <<
", tagger = " << m_taggerName <<
", operating point = " << OP <<
", uncertainty = " << unc << endl;
2501 for(
const auto& flavour : m_flavours){
2502 std::pair<double, double> BTagCalibResult;
2503 BTagCalibResult = getScaleFactor(
BTagVars, flavour, OP, unc);
2504 std::cout <<
"CalibrationDataInterfaceROOT->initialize : BTagCalibResult " << std::endl;
2506 std::pair<double, double> BTagCalibMCEff;
2507 BTagCalibMCEff = getMCEfficiency(
BTagVars, flavour, OP, unc);
2508 std::cout <<
"CalibrationDataInterfaceROOT->initialize : BTagCalibMCEff " << std::endl;
2511 if (m_fileEff != m_fileSF) {
2537 string dir = m_taggerName +
"/" + getAlias(
author) +
"/" + OP +
"/" +
label;
2539 string name =
dir +
"/" + cntname;
2543 unsigned int idx = m_objectIndices[
name] = m_objects.size();
2547 (isSF ? m_fileSF : m_fileEff)->GetObject(
name.c_str(),
cnt);
2553 if (!isSF && !
cnt && m_fileSF != m_fileEff) m_fileSF->GetObject(
name.c_str(),
cnt);
2554 m_objects.push_back(
cnt);
2556 cerr <<
"btag Calib: retrieveContainer: failed to retrieve container named " <<
name.c_str() <<
" from file" << endl;
2562 cout <<
"CalibrationDataInterface: retrieved container " <<
name <<
" (with comment: '" <<
cnt->getComment() <<
"' and hadronisation setting '" <<
cnt->getHadronisation() <<
"')" << endl;
2569 if (m_refMap.find(
dir) == m_refMap.end()) {
2573 string hadronisationRefs(
dir +
"/MChadronisation_ref");
2574 TMap* mapSF = 0; m_fileSF->GetObject(hadronisationRefs.c_str(), mapSF);
2575 TMap* mapEff = 0;
if (m_fileEff != m_fileSF) m_fileEff->GetObject(hadronisationRefs.c_str(), mapEff);
2580 string SFCalibName = getContainername(getBasename(
dir),
true);
2581 if (m_objectIndices.find(SFCalibName) == m_objectIndices.end()) retrieveContainer(
label, OP,
author, SFCalibName,
true, doPrint);
2587 if (
idx+1 > m_hadronisationReference.size()) m_hadronisationReference.resize(
idx+1, -1);
2588 m_hadronisationReference[
idx] = -1;
2589 string spec =
cnt->getHadronisation();
2591 std::map<string, HadronisationReferenceHelper*>::const_iterator mapit = m_refMap.find(
dir);
2592 if (mapit != m_refMap.end()) {
2594 if (mapit->second->getReference(
spec,
ref)) {
2600 string refname(
dir +
"/" +
ref);
2601 std::map<string, unsigned int>::const_iterator
it = m_objectIndices.find(refname);
2603 if (
it == m_objectIndices.end()) {
2605 retrieveContainer(
label, OP,
author,
ref, isSF,
false);
it = m_objectIndices.find(refname);
2607 m_hadronisationReference[
idx] =
it->second;
2609 }
else if (m_useMCMCSF) {
2610 cerr <<
"btag Calib: retrieveContainer: MC hadronisation reference map not found -- this should not happen!" << endl;
2613 if (m_hadronisationReference[
idx] == -1 || ! m_objects[m_hadronisationReference[
idx]]){
2617 cerr <<
"btag Calib: retrieveContainer: warning: unable to apply MC/MC scale factors for container " <<
name <<
" with hadronisation reference = '" <<
spec <<
"'" << endl;
2629 if (m_runEigenVectorMethod && isSF &&
name.find(
"_SF") != string::npos) {
2631 if (histoContainer==0) {
2632 cerr <<
"Could not cast Container to a HistogramContainer. " << endl;
2637 std::shared_ptr<CalibrationDataEigenVariations> newEigenVariation(
new CalibrationDataEigenVariations(m_filenameSF, m_taggerName, OP,
author, histoContainer, m_useRecommendedEVExclusions));
2642 string flavour =
dir.substr(
dir.find_last_of(
"/")+1);
2644 for (
auto entry : m_excludeFromCovMatrix[flavour]) {
2649 if (to_retain > -1) {
2650 if (m_verbose) cout <<
"btag Calib: reducing number of eigenvector variations for flavour " << flavour <<
" to " << to_retain << endl;
2653 }
else if (m_EVReductions[flavour] !=
Loose) {
2654 cerr <<
"btag Calib: unable to retrieve eigenvector reduction information for flavour " << flavour <<
" and scheme " << m_EVReductions[flavour] <<
"; not applying any reduction" << endl;
2656 m_eigenVariationsMap[
cnt]=newEigenVariation;
2661 std::map<const CalibrationDataContainer*, std::shared_ptr<CalibrationDataEigenVariations> >
::iterator evit = m_eigenVariationsMap.find(
cnt);
2667 if (evit == m_eigenVariationsMap.end()){
2669 if (m_eigenVariationsMap.empty()){
2670 std::shared_ptr<CalibrationDataGlobalEigenVariations> newEigenVariation(
new CalibrationDataGlobalEigenVariations(m_filenameSF, m_taggerName, OP,
author, m_flavours, histoContainer, m_useRecommendedEVExclusions));
2671 for (
auto entry : m_excludeFromCovMatrix[
label]) {
2678 for (std::string& flavour : m_flavours){
2680 if (to_retain > -1) {
2681 if (m_verbose) cout <<
"btag Calib: reducing number of eigenvector variations for flavour " << flavour <<
" to " << to_retain << endl;
2684 }
else if (m_EVReductions[flavour] !=
Loose) {
2685 cerr <<
"btag Calib: unable to retrieve eigenvector reduction information for flavour " << flavour <<
" and scheme " << m_EVReductions[flavour] <<
"; not applying any reduction" << endl;
2689 m_eigenVariationsMap.insert({
cnt, newEigenVariation});
2694 std::shared_ptr<CalibrationDataEigenVariations> previous_eigenvariation = m_eigenVariationsMap.begin()->second;
2695 m_eigenVariationsMap.insert({
cnt, previous_eigenvariation});
2699 std::cout <<
"CalibrationDataInterfaceROOT->retrieveContainer : the CDGEV object for " <<
name <<
" already exists! " << std::endl;
2715 std::map<string,string>::const_iterator
it = m_aliases.find(
author);
2716 return (
it == m_aliases.end()) ?
author :
it->second;
2722 const string&
label,
bool isSF,
2723 unsigned mapIndex)
const
2733 string flavour = (
label ==
"N/A") ?
"Light" :
label;
2734 string full(m_taggerName +
"/" + getAlias(
author) +
"/" + OP +
"/" + flavour +
"/");
2735 full += getContainername(flavour, isSF, mapIndex);
2756 TMapIter
next(mapSF); TObjString*
spec;
2757 while ((
spec = (TObjString*)
next())) {
2758 TObjString*
ref = (TObjString*) mapSF->GetValue(
spec);
2759 m_refs[string(
spec->GetName())] = string(
ref->GetName());
2766 TMapIter
next(mapEff); TObjString*
spec;
2767 while ((
spec = (TObjString*)
next())) {
2768 TObjString*
ref = (TObjString*) mapEff->GetValue(
spec);
2769 m_refs[string(
spec->GetName())] = string(
ref->GetName());
2785 std::map<string, string>::const_iterator
it = m_refs.find(
spec);
2786 if (
it == m_refs.end())
return false;