ATLAS Offline Software
Loading...
Searching...
No Matches
Analysis::CalibrationDataInterfaceROOT Class Reference

This tool provides an interface to flavour tagging performance estimates. More...

#include <CalibrationDataInterfaceROOT.h>

Inheritance diagram for Analysis::CalibrationDataInterfaceROOT:

Classes

class  HadronisationReferenceHelper

Public Types

enum  variableType { kEta , kAbsEta , kPt }
 known variable types that can be used as function arguments More...

Public Member Functions

 CalibrationDataInterfaceROOT (const std::string &taggerName, const std::string &configname="BTagCalibration.env", const std::string &pathname="")
 main constructor for "stand-alone" use (with information fed in from a .env configuration file read by TEnv)
 CalibrationDataInterfaceROOT (const std::string &taggerName, const char *fileSF, const char *fileEff, const std::vector< std::string > &jetAliases, const std::map< std::string, std::string > &SFNames, const std::map< std::string, std::vector< std::string > > &EffNames, const std::map< std::string, std::vector< std::string > > &excludeFromEV, const std::map< std::string, Analysis::EVReductionStrategy > &EVReductions, bool useEV=true, Uncertainty strat=SFEigen, bool useMCMCSF=true, bool useTopologyRescaling=false, bool useRecommendedEVExclusions=false, bool verbose=true, std::vector< std::string > flavours={"B", "C", "Light", "T"})
 alternative constructor passing configuration information explicitly (so that no .env file is needed)
 CalibrationDataInterfaceROOT ()
 default constructor for PROOF object retrieval
 CalibrationDataInterfaceROOT (const CalibrationDataInterfaceROOT &other)
 copy constructor
virtual ~CalibrationDataInterfaceROOT ()
 default destructor
CalibResult getScaleFactor (const CalibrationDataVariables &variables, const std::string &label, const std::string &OP, Uncertainty unc, unsigned int numVariation=0, unsigned int mapIndex=0)
 efficiency scale factor retrieval by name.
CalibResult getEfficiency (const CalibrationDataVariables &variables, const std::string &label, const std::string &OP, Uncertainty unc, const std::string &flavour, unsigned int numVariation=0, unsigned int mapIndex=0)
 efficiency retrieval by name
CalibResult getInefficiencyScaleFactor (const CalibrationDataVariables &variables, const std::string &label, const std::string &OP, Uncertainty unc, unsigned int numVariation=0, unsigned int mapIndex=0)
 "MC" inefficiency scale factor retrieval by name
CalibResult getInefficiency (const CalibrationDataVariables &variables, const std::string &label, const std::string &OP, Uncertainty unc, unsigned int numVariation=0, unsigned int mapIndex=0)
 inefficiency retrieval by name
CalibResult getMCEfficiency (const CalibrationDataVariables &variables, const std::string &label, const std::string &OP, Uncertainty unc=None, unsigned int mapIndex=0)
 "MC" efficiency retrieval by name
CalibResult getMCInefficiency (const CalibrationDataVariables &variables, const std::string &label, const std::string &OP, Uncertainty unc=None, unsigned int mapIndex=0)
 "MC" inefficiency retrieval by name
std::vector< std::string > listScaleFactorUncertainties (const std::string &author, const std::string &label, const std::string &OP, bool named=false)
 retrieve the list of "uncertainties" relevant to the calibration object.
unsigned int getNumVariations (const std::string &author, const std::string &label, const std::string &OP, Uncertainty unc)
 retrieve the number of variations relevant to the calibration object.
bool retrieveCalibrationIndex (const std::string &label, const std::string &OP, const std::string &author, bool isSF, unsigned int &index, unsigned int mapIndex=0)
 Retrieve the index of the calibration object (container) starting from the label and operating point.
std::string nameFromIndex (unsigned int index) const
 Retrieve the name of the calibration object (container) given its index.
CalibResult getScaleFactor (const CalibrationDataVariables &variables, unsigned int indexSF, unsigned int indexEff, Uncertainty unc, const std::string &flavour, unsigned int numVariation=0)
 efficiency scale factor retrieval by index #2
CalibResult getEfficiency (const CalibrationDataVariables &variables, unsigned int indexSF, unsigned int indexEff, Uncertainty unc, const std::string &flavour, unsigned int numVariation=0)
 efficiency retrieval by index
CalibResult getInefficiencyScaleFactor (const CalibrationDataVariables &variables, unsigned int indexSF, unsigned int indexEff, Uncertainty unc, const std::string &flavour, unsigned int numVariation=0)
 "MC" inefficiency scale factor retrieval by index
CalibResult getInefficiency (const CalibrationDataVariables &variables, unsigned int indexSF, unsigned int indexEff, Uncertainty unc, const std::string &flavour, unsigned int numVariation=0)
 inefficiency retrieval by index
CalibResult getMCEfficiency (const CalibrationDataVariables &variables, unsigned int index, Uncertainty unc=None)
 "MC" efficiency retrieval by index
CalibResult getMCInefficiency (const CalibrationDataVariables &variables, unsigned int index, Uncertainty unc=None)
 "MC" inefficiency retrieval by index
double getMCMCScaleFactor (const CalibrationDataVariables &variables, unsigned indexSF, unsigned int indexEff) const
 MC/MC scale factor retrieval.
std::vector< std::string > listScaleFactorUncertainties (unsigned int index, const std::string &flavour, bool named=false)
 retrieve the list of "uncertainties" relevant to the calibration object.
unsigned int getNumVariations (unsigned int index, Uncertainty unc, const std::string &flavour)
 retrieve the number of variations relevant to the calibration object.
std::string fullName (const std::string &author, const std::string &OP, const std::string &label, bool isSF, unsigned mapIndex=0) const
 @ brief construct the full object pathname from its individual components
CalibrationStatus getScaleFactor (const CalibrationDataVariables &variables, unsigned int indexSF, unsigned int indexEff, Uncertainty unc, unsigned int numVariation, CalibResult &result, const std::string &flavour)
 efficiency scale factor retrieval by index #3
CalibrationStatus getEfficiency (const CalibrationDataVariables &variables, unsigned int indexSF, unsigned int indexEff, Uncertainty unc, unsigned int numVariation, CalibResult &result, const std::string &flavour)
 efficiency retrieval by index
CalibrationStatus getInefficiencyScaleFactor (const CalibrationDataVariables &variables, unsigned int indexSF, unsigned int indexEff, Uncertainty unc, unsigned int numVariation, CalibResult &result, const std::string &flavour)
 "MC" inefficiency scale factor retrieval by index
CalibrationStatus getInefficiency (const CalibrationDataVariables &variables, unsigned int indexSF, unsigned int indexEff, Uncertainty unc, unsigned int numVariation, CalibResult &result, const std::string &flavour)
 inefficiency retrieval by index
CalibrationStatus getMCEfficiency (const CalibrationDataVariables &variables, unsigned int index, Uncertainty unc, CalibResult &result)
 "MC" efficiency retrieval by index
CalibResult getWeightScaleFactor (const CalibrationDataVariables &variables, const std::string &label, Uncertainty unc, unsigned int numVariation=0, unsigned int mapIndex=0)
 efficiency scale factor retrieval by name
CalibResult getWeightScaleFactor (const CalibrationDataVariables &variables, unsigned int indexSF, unsigned int indexEff, Uncertainty unc, unsigned int numVariation=0)
 efficiency scale factor retrieval by index
CalibrationStatus getWeightScaleFactor (const CalibrationDataVariables &variables, unsigned int indexSF, unsigned int indexEff, Uncertainty unc, unsigned int numVariation, CalibResult &result)
 efficiency scale factor retrieval by index, with different signature
CalibrationStatus runEigenVectorRecomposition (const std::string &author, const std::string &label, const std::string &OP, unsigned int mapindex=0)
 run EigenVector Recomposition method
CalibrationStatus runEigenVectorRecomposition (const std::string &label, unsigned int mapindex=0)
std::map< std::string, std::map< std::string, float > > getEigenVectorRecompositionCoefficientMap ()
 Get Eigenvector recomposition map after running runEigenVectorRecomposition().
const TObject * getMCEfficiencyObject (const std::string &author, const std::string &label, const std::string &OP, unsigned int mapIndex=0)
 retrieve the MC efficiency (central values) object for the given flavour label and operating point.
const TH1 * getBinnedScaleFactors (const std::string &author, const std::string &label, const std::string &OP)
 retrieve the binned calibration object for the given flavour label and operating point.
const TH1 * getShiftedScaleFactors (const std::string &author, const std::string &label, const std::string &OP, const std::string &unc, double sigmas)
 retrieve the binned calibration object for the given flavour label and operating point, with the result shifted by the given number of standard deviations for the given systematic uncertainty.
TMatrixDSym getScaleFactorCovarianceMatrix (const std::string &author, const std::string &label, const std::string &OP, const std::string &unc="all")
 retrieve the named covariance matrix element corresponding to the binned calibration object.
void initialize (const std::string &jetauthor, const std::string &OP, Uncertainty unc)
 initialization for PROOF usage
CalibrationDataContainerretrieveContainer (const std::string &label, const std::string &OP, const std::string &author, const std::string &cntname, bool isSF, bool doPrint=true)
 utility function taking care of object retrieval
const std::string & EffCalibrationName (const std::string &flavour, unsigned int mapIndex=0) const
 Main interface methods accessing the flavour tagging performance information.
void setEffCalibrationNames (const std::map< std::string, std::vector< std::string > > &names)
const std::string & SFCalibrationName (const std::string &flavour) const
void setSFCalibrationNames (const std::map< std::string, std::string > &names)

Protected Member Functions

std::string getContainername (const std::string &flavour, bool SF, unsigned int mapIndex=0) const
 auxiliary function for retrieval of container name
std::string getBasename (const std::string &name) const
 auxiliary function for retrieval of name within the directory
double combinedUncertainty (double stat, const std::pair< double, double > &syst) const
 utility function for combination of statistical and (a priori asymmetric) systematic uncertainty.

Protected Attributes

std::string m_taggerName
 tagging algorithm name

Private Member Functions

std::string getAlias (const std::string &author) const
 associated alias retrieval method
bool checkAbsEta (const CalibrationDataVariables &variables, unsigned int index)
void increaseCounter (unsigned int index, OutOfBoundsType oob=Main)
void checkWeightScaleFactors (unsigned int indexSF, unsigned int indexEff)

Private Attributes

TFile * m_fileEff {}
 pointer to the TFile object providing access to the calibrations
TFile * m_fileSF {}
 Do not attempt to persistify (PROOF).
std::map< std::string, std::string > m_aliases
 Do not attempt to persistify (PROOF).
std::vector< CalibrationDataContainer * > m_objects
 cache the objects themselves (so that the user will not have to delete them after each call etc.).
std::map< std::string, unsigned int > m_objectIndices
std::string m_filenameSF
 in addition, store also the filenames themselves (needed for the copy constructor)
std::string m_filenameEff
std::vector< std::string > m_flavours
std::map< const CalibrationDataContainer *, std::shared_ptr< CalibrationDataEigenVariations > > m_eigenVariationsMap
 store the eigenvector class and associate to its CalibrationDataContainer
bool m_runEigenVectorMethod {}
 decide whether to run the eigenvector method or not
Uncertainty m_EVStrategy {}
std::map< std::string, Analysis::EVReductionStrategym_EVReductions
 Eigenvector reduction strategy (per flavour).
std::map< std::string, std::vector< std::string > > m_excludeFromCovMatrix
 store the uncertainties which should be excluded from building the full covariance matrix
bool m_useRecommendedEVExclusions {}
 if true, exclude pre-recommended lists of uncertainties from the covariance matrix building, in addition to the above user specified lists
bool m_verbose {}
 if true, allow also for some informational (and not only error/warning) messages
bool m_useMCMCSF {}
 specify whether or not to use MC/MC (hadronisation) scale factors (the fact that this is steerable is intended to be temporary only)
bool m_useTopologyRescaling {}
 specify whether or not to use MC/MC (topology) scale factors (also this steering option may be removed)
std::map< std::string, HadronisationReferenceHelper * > m_refMap
 the following maps (one for each directory) specify the name of the container serving as the 'hadronisation' reference for each object
std::vector< int > m_hadronisationReference
 store the 'hadronisation' reference for each object (-1 means no reference found)
std::map< std::string, std::map< std::string, float > > m_coefficientMap
double m_maxAbsEta {}
 |eta| bounds and strategy for dealing with out-of-bounds conditions
OutOfBoundsStrategy m_absEtaStrategy {}
OutOfBoundsStrategy m_otherStrategy {}
std::vector< unsigned int > m_etaCounters
 counters for flagging out-of-bound cases
std::vector< unsigned int > m_mainCounters
std::vector< unsigned int > m_extrapolatedCounters
std::vector< std::pair< unsigned int, unsigned int > > m_checkedWeightScaleFactors
double m_maxTagWeight {}
std::map< std::string, std::vector< std::string > > m_calibrationEffNames
 this simply collects the per-flavour properties.
std::map< std::string, std::string > m_calibrationSFNames

Detailed Description

This tool provides an interface to flavour tagging performance estimates.

A separate instance should be used for each different tagging algorithm. For each instance, all appropriate jet collections and tagger operating points need to be specified.

The model:

  • b-jets: data-MC scale factor (factorised 2D function of eta, pt) MC reference the product is the data efficiency; alternatively, the scale factor may be used
  • c-jets: as for b-jets, but with a different MC reference
  • light-flavour jets: data-MC scale factor (factorised 2D function of eta, pt) MC reference Besides the results, it is also possible to retrieve associated uncertainties. This need not be configured, and a choice as to the uncertainty component can be made on a case-by-case basis.

The idea is to use the same physical ROOT file that is also accessed through COOL, but to do so in a stand-alone fashion, so that there is no COOL or Athena dependence. Apart from this, the same infrastructure and limitations as with COOL access (

Definition at line 87 of file CalibrationDataInterfaceROOT.h.

Member Enumeration Documentation

◆ variableType

Constructor & Destructor Documentation

◆ CalibrationDataInterfaceROOT() [1/4]

Analysis::CalibrationDataInterfaceROOT::CalibrationDataInterfaceROOT ( const std::string & taggerName,
const std::string & configname = "BTagCalibration.env",
const std::string & pathname = "" )

main constructor for "stand-alone" use (with information fed in from a .env configuration file read by TEnv)

◆ CalibrationDataInterfaceROOT() [2/4]

Analysis::CalibrationDataInterfaceROOT::CalibrationDataInterfaceROOT ( const std::string & taggerName,
const char * fileSF,
const char * fileEff,
const std::vector< std::string > & jetAliases,
const std::map< std::string, std::string > & SFNames,
const std::map< std::string, std::vector< std::string > > & EffNames,
const std::map< std::string, std::vector< std::string > > & excludeFromEV,
const std::map< std::string, Analysis::EVReductionStrategy > & EVReductions,
bool useEV = true,
Uncertainty strat = SFEigen,
bool useMCMCSF = true,
bool useTopologyRescaling = false,
bool useRecommendedEVExclusions = false,
bool verbose = true,
std::vector< std::string > flavours = {"B", "C", "Light", "T"} )

alternative constructor passing configuration information explicitly (so that no .env file is needed)

Definition at line 486 of file CalibrationDataInterfaceROOT.cxx.

495 :
496 m_filenameSF(fileSF), m_filenameEff(""), m_flavours(std::move(flavours)),
497 m_runEigenVectorMethod(useEV), m_EVStrategy(strat), m_EVReductions(EVReductions),
498 m_useRecommendedEVExclusions(useRecommendedEEVExclusions), m_verbose(verbose),
499 m_useMCMCSF(useMCMCSF), m_useTopologyRescaling(useTopologyRescaling),
502{
503 // Normal constructor avoiding the need for a .env file.
504 //
505 // taggerName: this should correspond to the tagger name as used in the calibration ROOT file
506 // fileSF: full path of the calibration ROOT file containing the calibration scale factors
507 // fileEff: optional full path name of a ROOT file containing additional MC efficiency maps
508 // (use a null pointer to disable the use of such additional file)
509 // flavours; This should correspond to the list of flavour labels that's used by a tagger, and
510 // which corresponds to the labels used in internal maps
511 // jetAliases: this can be used to convert jet collection names to the corresponding names in the
512 // calibration ROOT file (this may be useful as e.g. the collection names in the
513 // calibration ROOT file have the JVF criterion attached as a suffix).
514 // Each alias is specified as
515 // nameOrig->nameTarget,
516 // where nameOrig and nameTarget are the names of the input jet collection and the
517 // jet collection name as used in the calibration ROOT file, respectively.
518 // SFNames: map specifying for each of the calibration flavours ("B", "C", "T", "Light") the
519 // name of the scale factor calibration object
520 // EffNames: map specifying for each of the calibration flavours ("B", "C", "T", "Light") the
521 // names of the possibly relevant efficiency calibration objects
522 // excludeFromEV: map specifying for each of the calibration flavours ("B", "C", "T", "Light") the
523 // systematic uncertainties to be excluded from the Eigenvector variation treatment
524 // (this is used only if Eigenvector variations are used to begin with)
525 // EVReductions: Eigenvector variation reduction strategies for "B", "C", "Light" jets (again,
526 // this is only relevant if Eigenvector variations are used to begin with)
527 // useEV: switch specifying if Eigenvector variations will be used or not
528 // useMCMCSF: switch specifying if generator-dependent scale factors are to be applied or not
529
530 // Note: at present, the means to change the strategies and maximum values initialized above do not exist
531 // when using this constructor
532
533 if (m_verbose) {
534 cout << "=== CalibrationDataInterfaceROOT::CalibrationDataInterfaceROOT ===" << endl;
535 cout << " taggerName : " << taggerName << endl;
536 cout << " Systematic strategy : ";
537 if (m_EVStrategy == Analysis::Uncertainty::SFEigen){
538 cout << "SFEigen" << endl;
539 } else if (m_EVStrategy == Analysis::Uncertainty::SFGlobalEigen){
540 cout << "SFGlobalEigen" << endl;
541 } else {
542 cout << " Other" << endl;
543 }
544 if (fileEff) cout << " Efficiency file name : " << fileEff << endl;
545 cout << " SF file name : " << fileSF << endl
546 << endl;
547 }
548
549 m_taggerName = taggerName;
550
551 m_fileSF = TFile::Open(fileSF, "READ");
552 if (fileEff && strcmp(fileSF, fileEff) != 0) {
553 m_filenameEff = string(fileEff);
554 m_fileEff = TFile::Open(fileEff, "READ");
555 } else
557
558 if (m_verbose) {
559 TObjString* s;
560 m_fileSF->GetObject("VersionInfo/BuildNumber", s);
561 if (s) cout << " CDI file build number: " << s->GetName() << endl;
562 cout << endl;
563 }
564
565 for (unsigned int i = 0; i < jetAliases.size(); ++i) {
566 // Each alias specification uses an arrow ("->"). Forget about entries
567 // not properly following this specification.
568 string::size_type arrow = jetAliases[i].find("->");
569 if (arrow == string::npos) continue;
570 m_aliases[jetAliases[i].substr(0,arrow)] = jetAliases[i].substr(arrow+2);
571 }
572
573 setEffCalibrationNames(EffNames);
574 setSFCalibrationNames(SFNames);
575
577 // if we want to run EV, then decide which one
578 // The following should hold for both eigenvector decomposition methods (SFEigen and SFGlobalEigen)
579 // The global one simply adapts itself to using the m_excludeFromCovMatrix to perform the same task
580
581 m_excludeFromCovMatrix = excludeFromEV;
582 unsigned int n_excluded = 0;
583 for (auto const& flavour : m_flavours) {
584 n_excluded += m_excludeFromCovMatrix[flavour].size();
585 }
586 if (m_verbose) {
587 cout << " List of uncertainties to exclude:";
588 if (n_excluded == 0) cout << " none";
589 for (auto const& flavour : m_flavours) {
590 if (m_excludeFromCovMatrix[flavour].size() > 0) {
591 cout << "\n\t" << flavour << ":\t";
592 for (unsigned int i = 0; i < m_excludeFromCovMatrix[flavour].size(); ++i) {
593 cout << m_excludeFromCovMatrix[flavour].at(i);
594 if (i+1 == m_excludeFromCovMatrix[flavour].size()) cout << "; ";
595 }
596 cout << endl;
597 }
598 }
599 cout << endl;
600 }
601
602 }
603
604 if (m_verbose) cout << "======= end of CalibrationDataInterfaceROOT instantiation ========" << endl;
605}
size_t size() const
Number of registered mappings.
std::string m_taggerName
tagging algorithm name
void setEffCalibrationNames(const std::map< std::string, std::vector< std::string > > &names)
void setSFCalibrationNames(const std::map< std::string, std::string > &names)
bool m_verbose
if true, allow also for some informational (and not only error/warning) messages
bool m_useTopologyRescaling
specify whether or not to use MC/MC (topology) scale factors (also this steering option may be remove...
std::map< std::string, std::string > m_aliases
Do not attempt to persistify (PROOF).
TFile * m_fileSF
Do not attempt to persistify (PROOF).
bool m_useRecommendedEVExclusions
if true, exclude pre-recommended lists of uncertainties from the covariance matrix building,...
TFile * m_fileEff
pointer to the TFile object providing access to the calibrations
bool m_runEigenVectorMethod
decide whether to run the eigenvector method or not
std::map< std::string, Analysis::EVReductionStrategy > m_EVReductions
Eigenvector reduction strategy (per flavour).
bool m_useMCMCSF
specify whether or not to use MC/MC (hadronisation) scale factors (the fact that this is steerable is...
std::map< std::string, std::vector< std::string > > m_excludeFromCovMatrix
store the uncertainties which should be excluded from building the full covariance matrix
double m_maxAbsEta
|eta| bounds and strategy for dealing with out-of-bounds conditions
std::string m_filenameSF
in addition, store also the filenames themselves (needed for the copy constructor)
bool verbose
Definition hcg.cxx:75
End of vector before end of string
Definition Arrayrep.cxx:228

◆ CalibrationDataInterfaceROOT() [3/4]

Analysis::CalibrationDataInterfaceROOT::CalibrationDataInterfaceROOT ( )

default constructor for PROOF object retrieval

Definition at line 608 of file CalibrationDataInterfaceROOT.cxx.

609{
610 // Default constructor for PROOF purposes
611
612 m_fileEff=0;
613 m_fileSF=0;
614}

◆ CalibrationDataInterfaceROOT() [4/4]

Analysis::CalibrationDataInterfaceROOT::CalibrationDataInterfaceROOT ( const CalibrationDataInterfaceROOT & other)

copy constructor

Definition at line 617 of file CalibrationDataInterfaceROOT.cxx.

617 :
618 Analysis::CalibrationDataInterfaceBase(other), m_aliases(other.m_aliases), m_objects(), m_objectIndices(),
619 m_filenameSF(other.m_filenameSF), m_filenameEff(other.m_filenameEff),
620 m_eigenVariationsMap(), m_runEigenVectorMethod(other.m_runEigenVectorMethod), m_EVStrategy(other.m_EVStrategy),
621 m_excludeFromCovMatrix(other.m_excludeFromCovMatrix), m_useMCMCSF(other.m_useMCMCSF), m_useTopologyRescaling(other.m_useTopologyRescaling),
623 m_maxAbsEta(other.m_maxAbsEta), m_absEtaStrategy(other.m_absEtaStrategy), m_otherStrategy(other.m_otherStrategy),
624 m_etaCounters(other.m_etaCounters), m_mainCounters(other.m_mainCounters), m_extrapolatedCounters(other.m_extrapolatedCounters),
625 m_checkedWeightScaleFactors(other.m_checkedWeightScaleFactors), m_maxTagWeight(other.m_maxTagWeight)
626{
627 // Copy constructor. Note that the "cacheable" items aren't copied (they will be re-created if needed)
628
629 // The TFile objects cannot be copied. Therefore, create duplicate objects starting from the filenames
630 m_fileSF = TFile::Open(m_filenameSF.c_str(), "READ");
633 else
634 m_fileEff = TFile::Open(m_filenameEff.c_str(), "READ");
635}
std::vector< std::pair< unsigned int, unsigned int > > m_checkedWeightScaleFactors
std::map< std::string, unsigned int > m_objectIndices
std::map< std::string, HadronisationReferenceHelper * > m_refMap
the following maps (one for each directory) specify the name of the container serving as the 'hadroni...
std::vector< int > m_hadronisationReference
store the 'hadronisation' reference for each object (-1 means no reference found)
std::vector< CalibrationDataContainer * > m_objects
cache the objects themselves (so that the user will not have to delete them after each call etc....
std::vector< unsigned int > m_etaCounters
counters for flagging out-of-bound cases
std::map< const CalibrationDataContainer *, std::shared_ptr< CalibrationDataEigenVariations > > m_eigenVariationsMap
store the eigenvector class and associate to its CalibrationDataContainer

◆ ~CalibrationDataInterfaceROOT()

Analysis::CalibrationDataInterfaceROOT::~CalibrationDataInterfaceROOT ( )
virtual

default destructor

Definition at line 638 of file CalibrationDataInterfaceROOT.cxx.

639{
640 // Destructor
641 if ((m_fileEff!=0) && (m_fileSF!=0)) {
642 if (m_fileEff == m_fileSF) {
643 m_fileEff->Close();
644 delete m_fileEff; m_fileEff = 0;
645 } else {
646 m_fileEff->Close();
647 m_fileSF->Close();
648 delete m_fileEff; m_fileEff = 0;
649 delete m_fileSF; m_fileSF = 0;
650 }
651 }
652 // delete also the stored objects (these are owned by us)
653 for (std::vector<CalibrationDataContainer*>::iterator it = m_objects.begin(); it != m_objects.end(); ++it) {
654 if (*it) {
655 delete *it; *it = 0;
656 }
657 }
658
659 for (std::map<std::string, HadronisationReferenceHelper*>::iterator it = m_refMap.begin();
660 it != m_refMap.end(); ++it) {
661 if(it->second)
662 { delete it->second; it->second=nullptr; }
663 }
664
665 // Print summary output on out-of-bounds issues
666 if (m_absEtaStrategy == Flag && m_verbose) {
667 bool found = false;
668 cout << "\t\tCalibrationDataInterfaceROOT |eta| out-of-bounds summary:" << endl;
669 for (unsigned int index = 0; index < m_mainCounters.size(); ++index)
670 if (m_etaCounters[index] > 0) {
671 found = true;
672 cout << "\t\t\t" << nameFromIndex(index) << ": " << m_etaCounters[index] << endl;
673 }
674 if (!found) cout << "\t\t\tNo issues found" << endl;
675 }
676 if (m_otherStrategy == Flag && m_verbose) {
677 bool found = false;
678 cout << "\t\tCalibrationDataInterfaceROOT object out-of-bounds summary:" << endl;
679 for (unsigned int index = 0; index < m_mainCounters.size(); ++index)
680 if (m_mainCounters[index] + m_extrapolatedCounters[index] > 0) {
681 found = true;
682 cout << "\t\t\t" << nameFromIndex(index)
683 << " general: " << m_mainCounters[index]
684 << ", extrapolated: " << m_extrapolatedCounters[index]
685 << endl;
686 }
687 if (!found) cout << "\t\t\tNo issues found" << endl;
688 }
689}
std::string nameFromIndex(unsigned int index) const
Retrieve the name of the calibration object (container) given its index.
str index
Definition DeMoScan.py:362

Member Function Documentation

◆ checkAbsEta()

bool Analysis::CalibrationDataInterfaceROOT::checkAbsEta ( const CalibrationDataVariables & variables,
unsigned int index )
nodiscardprivate

Definition at line 1926 of file CalibrationDataInterfaceROOT.cxx.

1928{
1929 // Check whether the jet eta value is outside the range of validity, subject to the strategy
1930 // specified in the configuration file.
1931 bool pass = true;
1932 if (m_absEtaStrategy == Ignore) return pass;
1933
1934 switch (m_absEtaStrategy) {
1935 case GiveUp:
1936 if (std::fabs(variables.jetEta) > m_maxAbsEta) {
1937 pass = false;
1938 }
1939 break;
1940 case Flag:
1941 default:
1942 if (std::fabs(variables.jetEta) > m_maxAbsEta) {
1943 increaseCounter(index, Eta);
1944 }
1945
1946 }
1947 return pass;
1948}
void increaseCounter(unsigned int index, OutOfBoundsType oob=Main)

◆ checkWeightScaleFactors()

void Analysis::CalibrationDataInterfaceROOT::checkWeightScaleFactors ( unsigned int indexSF,
unsigned int indexEff )
private

Definition at line 1772 of file CalibrationDataInterfaceROOT.cxx.

1774{
1775 // Check the tag weight scale factors that would result from the combination of
1776 // the provided scale factor and MC tag weight objects.
1777 // The way this is done is by determining the binning that would apply to the
1778 // combination of the two individual inputs, and then by explicitly computing
1779 // the scale factors in each of these resulting bins.
1780
1781 std::vector<std::pair<unsigned int, unsigned int> >::const_iterator it = std::find(m_checkedWeightScaleFactors.begin(), m_checkedWeightScaleFactors.end(), std::make_pair(indexSF, indexEff));
1782 if (it != m_checkedWeightScaleFactors.end()) return;
1783
1784
1785 // Assume that only histogram containers are involved here (this should be the case
1786 // as at least a strict tag weight binning should be applied).
1787 CalibrationDataHistogramContainer* container = dynamic_cast<CalibrationDataHistogramContainer*>(m_objects[indexSF]);
1788 if (! container) {
1789 cerr << "CalibrationDataInterfaceROOT::checkWeightScaleFactors: error: container for object " << nameFromIndex(indexSF) << " not found!" << endl;
1790 return;
1791 } else if (! container->GetValue("MCreference")) {
1792 cerr << "CalibrationDataInterfaceROOT::checkWeightScaleFactors: error: no MCreference histogram for object " << nameFromIndex(indexSF) << "!" << endl;
1793 return;
1794 }
1795 CalibrationDataHistogramContainer* effContainer = dynamic_cast<CalibrationDataHistogramContainer*>(m_objects[indexEff]);
1796 if (! effContainer) {
1797 cerr << "CalibrationDataInterfaceROOT::checkWeightScaleFactors: error: container for object " << nameFromIndex(indexEff) << " not found!" << endl;
1798 return;
1799 }
1800
1801 // Retrieve the variable types and corresponding bin boundaries
1802 std::vector<unsigned int> vars = container->getVariableTypes();
1803 std::vector<unsigned int> effVars = effContainer->getVariableTypes();
1804 // Retrieve the corresponding bin boundaries
1805 std::map<unsigned int, std::vector<double> > boundaries, effBoundaries, mergedBoundaries;
1806 for (unsigned int t = 0; t < vars.size(); ++t)
1807 boundaries[vars[t]] = container->getBinBoundaries(vars[t]);
1808 for (unsigned int t = 0; t < effVars.size(); ++t)
1809 effBoundaries[effVars[t]] = effContainer->getBinBoundaries(effVars[t]);
1810
1811 // Special case: handle |eta| versus eta differences, by transforming to the latter
1812 if (boundaries.find(CalibrationDataContainer::kEta) == boundaries.end() && boundaries.find(CalibrationDataContainer::kAbsEta) != boundaries.end()) {
1814 boundaries.erase(CalibrationDataContainer::kAbsEta);
1815 }
1816 if (effBoundaries.find(CalibrationDataContainer::kEta) == effBoundaries.end() && effBoundaries.find(CalibrationDataContainer::kAbsEta) != effBoundaries.end()) {
1818 effBoundaries.erase(CalibrationDataContainer::kAbsEta);
1819 }
1820 if (boundaries.find(CalibrationDataContainer::kEta) != boundaries.end() && effBoundaries.find(CalibrationDataContainer::kEta) != effBoundaries.end()) {
1821 std::vector<double>& v = boundaries[CalibrationDataContainer::kEta];
1822 std::vector<double>& vEff = effBoundaries[CalibrationDataContainer::kEta];
1823 if (v[0] < 0 && vEff[0] >= 0) {
1824 // in this case, supplement the positive entries in vEff with their negative analogues
1825 std::vector<double> vtmp(vEff);
1826 for (std::vector<double>::iterator it = vtmp.begin(); it != vtmp.end(); ++it)
1827 if (*it > 0) vEff.insert(vEff.begin(), -(*it));
1828 } else if (v[0] >= 0 && vEff[0] < 0) {
1829 // in this case, supplement the positive entries in v with their negative analogues
1830 std::vector<double> vtmp(v);
1831 for (std::vector<double>::iterator it = vtmp.begin(); it != vtmp.end(); ++it)
1832 if (*it > 0) v.insert(v.begin(), -(*it));
1833 }
1834 }
1835
1836 // Now that the individual sets of boundaries have been determined, merge these
1837 for (unsigned int t = 0; t < vars.size(); ++t) {
1838 if (effBoundaries.find(vars[t]) == effBoundaries.end())
1839 // Variables not present in the efficiency object can go in unmodified
1840 mergedBoundaries[vars[t]] = boundaries[vars[t]];
1841 else {
1842 // Merge the boundaries for variables existing in both objects.
1843 // Take the MC array as a starting point, as it's likely to be the longest.
1844 mergedBoundaries[vars[t]] = effBoundaries[vars[t]];
1845
1846 for (std::vector<double>::iterator it = boundaries[vars[t]].begin(); it != boundaries[vars[t]].end(); ++it) {
1847 std::vector<double>::iterator itcmp = mergedBoundaries[vars[t]].begin();
1848 // Iterate until we've found a value in the target array equal to
1849 // or larger than the given element
1850 while (itcmp != mergedBoundaries[vars[t]].end() &&
1851 (! CalibrationDataContainer::isNearlyEqual(*itcmp, *it)) &&
1852 *itcmp < *it) ++itcmp;
1853 // Nothing needs to be done if the values are "nearly identical"
1854 // (or if we don't find such an element).
1855 if (itcmp == mergedBoundaries[vars[t]].end() || CalibrationDataContainer::isNearlyEqual(*itcmp, *it)) continue;
1856 // Otherwise insert the given element (this can mean adding to the end)
1857 mergedBoundaries[vars[t]].insert(itcmp, *it);
1858 }
1859 }
1860 }
1861 // Variables not present in the scale factor object still need to go in
1862 for (unsigned int t = 0; t < effVars.size(); ++t)
1863 if (boundaries.find(effVars[t]) == boundaries.end())
1864 mergedBoundaries[effVars[t]] = effBoundaries[effVars[t]];
1865
1866 // Carry out a rudimentary cross-check of the tag weight bin
1867 // (the binning used for the scale factor and MC objects should be identical).
1868 if (boundaries.find(CalibrationDataContainer::kTagWeight) == boundaries.end()) {
1869 cerr << "CalibrationDataInterfaceROOT::checkWeightScaleFactors: " << "no tag weight axis found for object " << nameFromIndex(indexSF) << endl;
1870 } else if (effBoundaries.find(CalibrationDataContainer::kTagWeight) == effBoundaries.end()) {
1871 cerr << "CalibrationDataInterfaceROOT::checkWeightScaleFactors: " << "no tag weight axis found for object " << nameFromIndex(indexEff) << endl;
1872 } else if (boundaries[CalibrationDataContainer::kTagWeight].size() != effBoundaries[CalibrationDataContainer::kTagWeight].size()) {
1873 cerr << "CalibrationDataInterfaceROOT::checkWeightScaleFactors: " << "different tag weight binning for objects " << nameFromIndex(indexSF) << " (";
1874 std::vector<double>& v = boundaries[CalibrationDataContainer::kTagWeight];
1875 for (unsigned int ib = 0; ib < v.size()-1; ++ib) cerr << v[ib] << ",";
1876 cerr << v[v.size()-1] << ") and " << nameFromIndex(indexEff) << " (";
1877 v = effBoundaries[CalibrationDataContainer::kTagWeight];
1878 for (unsigned int ib = 0; ib < v.size()-1; ++ib) cerr << v[ib] << ",";
1879 cerr << v[v.size()-1] << ") do not match!" << endl;
1880 } else {
1881 // Make sure that (possibly) dummy vectors exist for _all_ known variables
1882 // (this is a mere technicality allowing to loop over all variables explicitly).
1883 mergedBoundaries.try_emplace(CalibrationDataContainer::kPt, std::vector<double>{20.,300.});
1884 mergedBoundaries.try_emplace(CalibrationDataContainer::kEta, std::vector<double>{-2.5, 2.5});
1885
1886 // Finally, carry out the cross-check that all this is about: recompute the scale factor
1887 // in each pseudo-bin
1888 if (m_verbose){
1889 cout << "CalibrationDataInterfaceROOT::checkWeightScaleFactors: cross-checking scale factors for objects " << nameFromIndex(indexSF) << " and " << nameFromIndex(indexEff) << "\n" << std::setfill('-') << std::setw(100) << "-" << endl;
1890 cout << std::setfill(' ');
1891 }
1892 CalibrationDataVariables x;
1893 std::vector<double>& vPt = mergedBoundaries[CalibrationDataContainer::kPt], vEta = mergedBoundaries[CalibrationDataContainer::kEta], vTagWeight = mergedBoundaries[CalibrationDataContainer::kTagWeight];
1894 const std::string mcRefStr{"MCreference"};
1895 for (unsigned int ipt = 0; ipt < vPt.size()-1; ++ipt) {
1896 x.jetPt = (vPt[ipt] + vPt[ipt+1]) * 500.; // account for MeV -> GeV conversion
1897 for (unsigned int ieta = 0; ieta < vEta.size()-1; ++ieta) {
1898 x.jetEta = (vEta[ieta] + vEta[ieta+1]) / 2.;
1899 for (unsigned int iwt = 0; iwt < vTagWeight.size()-1; ++iwt) {
1900 x.jetTagWeight = (vTagWeight[iwt] + vTagWeight[iwt+1]) / 2.;
1901 // Retrieve the central scale factor value and the old and new MC tag weight fractions
1902 double value;
1903 container->getResult(x, value);
1904 Analysis::UncertaintyResult uncertaintyResult(0,0);
1905 container->getUncertainty(mcRefStr, x, uncertaintyResult);
1906 double fracMCref = uncertaintyResult.first;
1907 double fracMCnew;
1908 effContainer->getResult(x, fracMCnew);
1909 // Compute the new scale factor value
1910 if (!(fracMCnew > 0.)) {
1911 cout << "\tfor (pt=" << x.jetPt << ",eta=" << x.jetEta << ",tagweight=" << x.jetTagWeight << "): invalid new MC fraction: " << fracMCnew << endl;
1912 } else {
1913 double newvalue = 1.0 + (value - 1.0) * fracMCref/fracMCnew;
1914 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;
1915 }
1916 }
1917 }
1918 }
1919 }
1920
1921 m_checkedWeightScaleFactors.push_back(std::make_pair(indexSF, indexEff));
1922}
#define x
static bool isNearlyEqual(double a, double b)
utility for comparison of doubles
virtual std::vector< double > getBinBoundaries(unsigned int vartype)
Retrieve the bin boundaries for the specified variable type (which should be a CalibrationParametriza...
virtual CalibrationStatus getResult(const CalibrationDataVariables &x, double &result, TObject *obj=0, bool extrapolate=false)
retrieve the calibration result.
std::pair< double, double > UncertaintyResult
The following typedef is for convenience: most uncertainties can be asymmetric.
const SG::AuxVectorData * container() const
Return the container holding this element.

◆ combinedUncertainty()

double Analysis::CalibrationDataInterfaceBase::combinedUncertainty ( double stat,
const std::pair< double, double > & syst ) const
protectedinherited

utility function for combination of statistical and (a priori asymmetric) systematic uncertainty.

NB perhaps this should be in its own

Definition at line 147 of file CalibrationDataInterfaceBase.cxx.

149{
150 // Return the total (combined statistical and systematic) uncertainty started from
151 // its individual components. The result is symmetrised by using only the larger of
152 // the (a priori asymmetric) up- and downward systematic uncertainties.
153
154 // The systematic uncertainty is (a priori) asymmetric, but this interface doesn't
155 // at present allow for asymmetric uncertainties.
156 // Address this by taking the larger (absolute) value of the two.
157 double largest = syst.first;
158 if (TMath::Abs(syst.second) > TMath::Abs(largest)) largest = syst.second;
159
160 return TMath::Sqrt(stat*stat + largest*largest);
161}

◆ EffCalibrationName()

const std::string & Analysis::CalibrationDataInterfaceBase::EffCalibrationName ( const std::string & flavour,
unsigned int mapIndex = 0 ) const
inherited

Main interface methods accessing the flavour tagging performance information.

Note that for both of the following, the label is assumed to adhere to the TruthInfo conventions (see package PhysicsAnalysis/JetTagging/JetTagInfo).

Definition at line 47 of file CalibrationDataInterfaceBase.cxx.

49{
50 // Return the MC efficiency name for the given flavour.
51 // Note that no check is performed on the validity of the flavour.
52
53 try {
54 return m_calibrationEffNames.at(flavour)[mapIndex];
55 }
56 catch (const std::out_of_range& e) {
57 std::cerr << "EffCalibrationName: flavour '" << flavour << "' is not known." << std::endl;
58 throw e;
59 }
60}
std::map< std::string, std::vector< std::string > > m_calibrationEffNames
this simply collects the per-flavour properties.

◆ fullName()

string Analysis::CalibrationDataInterfaceROOT::fullName ( const std::string & author,
const std::string & OP,
const std::string & label,
bool isSF,
unsigned mapIndex = 0 ) const

@ brief construct the full object pathname from its individual components

Definition at line 2731 of file CalibrationDataInterfaceROOT.cxx.

2734{
2735 // Construct the full calibration object's pathname within the calibration ROOT file.
2736 //
2737 // author: jet collection name
2738 // OP: tagger working point
2739 // label: jet flavour label
2740 // isSF: set to true (false) for scale factors (MC efficiencies)
2741 // mapIndex: index in the list of MC efficiency calibration objects
2742
2743 string flavour = (label == "N/A") ? "Light" : label;
2744 string full(m_taggerName + "/" + getAlias(author) + "/" + OP + "/" + flavour + "/");
2745 full += getContainername(flavour, isSF, mapIndex);
2746 // full += getAlias(author); full += "/";
2747 // string name = (isSF) ?
2748 // getBasename(OP, label, "_SF", true) :
2749 // getBasename(OP, label, "_Eff", false, mapIndex);
2750 // full += name;
2751 return full;
2752}
std::string getContainername(const std::string &flavour, bool SF, unsigned int mapIndex=0) const
auxiliary function for retrieval of container name
std::string getAlias(const std::string &author) const
associated alias retrieval method
std::string label(const std::string &format, int i)
Definition label.h:19

◆ getAlias()

string Analysis::CalibrationDataInterfaceROOT::getAlias ( const std::string & author) const
private

associated alias retrieval method

Definition at line 2720 of file CalibrationDataInterfaceROOT.cxx.

2721{
2722 // Return the alias for the given jet collection name, if an alias exists.
2723 // If this is not the case, the return value will simply equal the input jet collection name.
2724
2725 std::map<string,string>::const_iterator it = m_aliases.find(author);
2726 return (it == m_aliases.end()) ? author : it->second;
2727}

◆ getBasename()

std::string Analysis::CalibrationDataInterfaceBase::getBasename ( const std::string & name) const
protectedinherited

auxiliary function for retrieval of name within the directory

Definition at line 138 of file CalibrationDataInterfaceBase.cxx.

139{
140 // Retrieve the name within the directory starting from the full name
141
142 return name.substr(name.find_last_of('/')+1, std::string::npos);
143}

◆ getBinnedScaleFactors()

const TH1 * Analysis::CalibrationDataInterfaceROOT::getBinnedScaleFactors ( const std::string & author,
const std::string & label,
const std::string & OP )

retrieve the binned calibration object for the given flavour label and operating point.

A null result will be returned in case of error (e.g. if the calibration object isn't binned to begin with).

Definition at line 2115 of file CalibrationDataInterfaceROOT.cxx.

2118{
2119 // Retrieve the actual histogrammed calibration scale factors, identifying the object by name.
2120 //
2121 // author: jet collection name
2122 // label: jet flavour label
2123 // OP: tagger working point
2124
2125 unsigned int index;
2126 if (! retrieveCalibrationIndex (label, OP, author, true, index)) {
2127 // Return a dummy result if the object is not found
2128 cerr << "getBinnedScaleFactors: unable to find SF calibration for object " << fullName(author, OP, label, true) << endl;
2129 return 0;
2130 }
2131 CalibrationDataHistogramContainer* container = dynamic_cast<CalibrationDataHistogramContainer*>(m_objects[index]);
2132 return (container) ? dynamic_cast<TH1*>(container->GetValue("result")) : 0;
2133}
bool retrieveCalibrationIndex(const std::string &label, const std::string &OP, const std::string &author, bool isSF, unsigned int &index, unsigned int mapIndex=0)
Retrieve the index of the calibration object (container) starting from the label and operating point.
std::string fullName(const std::string &author, const std::string &OP, const std::string &label, bool isSF, unsigned mapIndex=0) const
@ brief construct the full object pathname from its individual components

◆ getContainername()

std::string Analysis::CalibrationDataInterfaceBase::getContainername ( const std::string & flavour,
bool SF,
unsigned int mapIndex = 0 ) const
protectedinherited

auxiliary function for retrieval of container name

Definition at line 118 of file CalibrationDataInterfaceBase.cxx.

120{
121 // Construct the full pathname corresponding to the container indicated by the combination
122 // of tagging operating point, jet flavour, and a possible extra extension. The calibration
123 // container name (stored internally) is also attached.
124
125 const std::vector<std::string>& effNames = m_calibrationEffNames.at(flavour);
126 if (!SF && mapIndex >= effNames.size()) {
127 std::cerr << "getContainername: given mapIndex=" << mapIndex << " incompatible with array size "
128 << effNames.size() << "; resetting to 0" << std::endl;
129 mapIndex = 0;
130 }
131 std::string name = SF ? m_calibrationSFNames.at(flavour) : effNames[mapIndex];
132 name += SF ? "_SF" : "_Eff";
133
134 return name;
135}
std::map< std::string, std::string > m_calibrationSFNames
const float SF[NF]
Cross sections for Fluor.

◆ getEfficiency() [1/3]

Analysis::CalibResult Analysis::CalibrationDataInterfaceROOT::getEfficiency ( const CalibrationDataVariables & variables,
const std::string & label,
const std::string & OP,
Uncertainty unc,
const std::string & flavour,
unsigned int numVariation = 0,
unsigned int mapIndex = 0 )

efficiency retrieval by name

Definition at line 1080 of file CalibrationDataInterfaceROOT.cxx.

1084{
1085 // Data efficiency retrieval identifying the requested calibration objects by name.
1086 // The data efficiency is computed as the product of MC efficiency and data/MC efficiency scale factor.
1087 // The return value is either a (value, uncertainty) or an (up, down) variation pair, as documented
1088 // above, and will be a dummy value in case an error occurs.
1089 //
1090 // variables: object holding kinematic (and other) information needed to compute the result
1091 // label: jet flavour label
1092 // OP: tagger operating point
1093 // unc: keyword indicating what uncertainties to evaluate (or whether eigenvector or
1094 // named variations are to be computed)
1095 // numVariation: variation index (in case of eigenvector or named variations)
1096 // mapIndex: index to the efficiency map to be used
1097
1098 unsigned int indexSF, indexEff;
1099 if (! (retrieveCalibrationIndex (label, OP, variables.jetAuthor, false, indexEff, mapIndex) &&
1100 retrieveCalibrationIndex (label, OP, variables.jetAuthor, true, indexSF))) {
1101 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;
1102 // Return a dummy result if the object is not found
1103 return Analysis::dummyResult;
1104 }
1105
1107 return (getEfficiency(variables, indexSF, indexEff, unc, numVariation, result, flavour) == Analysis::kError) ? Analysis::dummyResult : result;
1108}
CalibResult getEfficiency(const CalibrationDataVariables &variables, const std::string &label, const std::string &OP, Uncertainty unc, const std::string &flavour, unsigned int numVariation=0, unsigned int mapIndex=0)
efficiency retrieval by name
const CalibResult dummyResult(dummyValue, dummyValue)
std::pair< double, double > CalibResult

◆ getEfficiency() [2/3]

Analysis::CalibResult Analysis::CalibrationDataInterfaceROOT::getEfficiency ( const CalibrationDataVariables & variables,
unsigned int indexSF,
unsigned int indexEff,
Uncertainty unc,
const std::string & flavour,
unsigned int numVariation = 0 )

efficiency retrieval by index

Definition at line 1112 of file CalibrationDataInterfaceROOT.cxx.

1115{
1116 // Data efficiency retrieval identifying the requested calibration objects by index.
1117 // The data efficiency is computed as the product of MC efficiency and data/MC efficiency scale factor.
1118 // The return value is either a (value, uncertainty) or an (up, down) variation pair, as documented
1119 // above, and will be a dummy value in case an error occurs.
1120 //
1121 // variables: object holding kinematic (and other) information needed to compute the result
1122 // indexSF: index to scale factor calibration object
1123 // indexEff: index to MC efficiency object
1124 // unc: keyword indicating what uncertainties to evaluate (or whether eigenvector or
1125 // named variations are to be computed)
1126 // numVariation: variation index (in case of eigenvector or named variations)
1127
1129 return (getEfficiency(variables, indexSF, indexEff, unc, numVariation, result, flavour) == Analysis::kError) ?
1131}

◆ getEfficiency() [3/3]

Analysis::CalibrationStatus Analysis::CalibrationDataInterfaceROOT::getEfficiency ( const CalibrationDataVariables & variables,
unsigned int indexSF,
unsigned int indexEff,
Uncertainty unc,
unsigned int numVariation,
Analysis::CalibResult & result,
const std::string & flavour )

efficiency retrieval by index

Definition at line 1135 of file CalibrationDataInterfaceROOT.cxx.

1139{
1140 // Data efficiency retrieval identifying the requested calibration objects by index.
1141 //
1142 // variables: object holding kinematic (and other) information needed to compute the result
1143 // indexSF: index to scale factor calibration object
1144 // indexEff: index to MC efficiency object
1145 // unc: keyword indicating what uncertainties to evaluate (or whether eigenvector or
1146 // named variations are to be computed)
1147 // numVariation: variation index (in case of eigenvector or named variations)
1148 // result: (value, uncertainty) or (up, down) variation pair, depending on the unc value.
1149 // A dummy value will be returned in case of an error.
1150
1151 Analysis::CalibResult sfResult;
1152 Analysis::CalibrationStatus sfStatus = getScaleFactor(variables, indexSF, indexEff, unc, numVariation, sfResult, flavour);
1153 if (sfStatus == Analysis::kError) return sfStatus;
1154 Analysis::CalibResult effResult;
1155 Analysis::CalibrationStatus effStatus= getMCEfficiency(variables, indexEff, unc, effResult);
1156 if (effStatus == Analysis::kError) return effStatus;
1157
1158 double relative = 0;
1159 double value = effResult.first;
1160 if (TMath::Abs(sfResult.first) > Analysis::CalibZERO) {
1161 value = std::min(effResult.first*sfResult.first, 1.);
1162
1163 // Treat the scale factor variation cases separately since the contents of the CalibResult are different
1164 // (e.g. 'value' above contains the upward variation)
1165 if (unc == SFEigen || unc == SFNamed) {
1166 double valueDown = effResult.first*sfResult.second;
1167 result.first = value; // up/down variataions of data-efficiency
1168 result.second = valueDown;
1169 return sfStatus;
1170 }
1171 if (value > 0.) {
1172 relative = effResult.second/effResult.first;
1173 double sfRelative = sfResult.second/sfResult.first;
1174 /*
1175 cout << "sferr=" << sfResult.second
1176 << "btag Calib relative=" << relative << " sfRelative=" << sfRelative << endl;
1177 */
1178 relative = TMath::Sqrt(sfRelative*sfRelative + relative*relative);
1179 }
1180 } else {
1181 // now never happens due to protection of SF return value:
1182 cerr << "ERROR: CalibrationDataInterfaceROOT::getEfficiency: SF null result, SF=" << sfResult.first << " MC eff=" << effResult.first << "; setting SF=1." << endl;
1183 relative = Analysis::dummyValue;
1184 }
1185
1186 result.first = value;
1187 result.second = value*relative;
1188 // "Select" the status code for the actual calibration (it is subject to more constraints)
1189 return sfStatus;
1190}
CalibResult getScaleFactor(const CalibrationDataVariables &variables, const std::string &label, const std::string &OP, Uncertainty unc, unsigned int numVariation=0, unsigned int mapIndex=0)
efficiency scale factor retrieval by name.
CalibResult getMCEfficiency(const CalibrationDataVariables &variables, const std::string &label, const std::string &OP, Uncertainty unc=None, unsigned int mapIndex=0)
"MC" efficiency retrieval by name

◆ getEigenVectorRecompositionCoefficientMap()

std::map< std::string, std::map< std::string, float > > Analysis::CalibrationDataInterfaceROOT::getEigenVectorRecompositionCoefficientMap ( )

Get Eigenvector recomposition map after running runEigenVectorRecomposition().

Definition at line 2274 of file CalibrationDataInterfaceROOT.cxx.

2274 {
2275 if(m_coefficientMap.empty())
2276 cerr << "getCoefficientMap: Call runEigenVectorRecomposition() before retrieving coefficient map! " <<endl;
2277 return m_coefficientMap;
2278}
std::map< std::string, std::map< std::string, float > > m_coefficientMap

◆ getInefficiency() [1/3]

Analysis::CalibResult Analysis::CalibrationDataInterfaceROOT::getInefficiency ( const CalibrationDataVariables & variables,
const std::string & label,
const std::string & OP,
Uncertainty unc,
unsigned int numVariation = 0,
unsigned int mapIndex = 0 )

inefficiency retrieval by name

Definition at line 1316 of file CalibrationDataInterfaceROOT.cxx.

1320{
1321 // Data inefficiency retrieval identifying the requested calibration objects by name.
1322 // The data efficiency is computed as the product of MC efficiency and data/MC efficiency scale factor;
1323 // the inefficiency is then computed as the 1 minus the efficiency.
1324 // The return value is either a (value, uncertainty) or an (up, down) variation pair, as documented
1325 // above, and will be a dummy value in case an error occurs.
1326 //
1327 // variables: object holding kinematic (and other) information needed to compute the result
1328 // label: jet flavour label
1329 // OP: tagger operating point
1330 // unc: keyword indicating what uncertainties to evaluate (or whether eigenvector or
1331 // named variations are to be computed)
1332 // numVariation: variation index (in case of eigenvector or named variations)
1333 // mapIndex: index to the efficiency map to be used
1334
1335 unsigned int indexSF, indexEff;
1336 if (! (retrieveCalibrationIndex (label, OP, variables.jetAuthor, false, indexEff, mapIndex) &&
1337 retrieveCalibrationIndex (label, OP, variables.jetAuthor, true, indexSF))) {
1338 cerr << "getInefficiency: unable to find Eff calibration for object "
1339 << fullName(variables.jetAuthor, OP, label, false, mapIndex)
1340 << " or SF calibration for object "
1341 << fullName(variables.jetAuthor, OP, label, true) << endl;
1342 // Return a dummy result if the object is not found
1343 return Analysis::dummyResult;
1344 }
1345
1347 return (getInefficiency(variables, indexSF, indexEff, unc, numVariation, result, label) == Analysis::kError) ?
1349}
CalibResult getInefficiency(const CalibrationDataVariables &variables, const std::string &label, const std::string &OP, Uncertainty unc, unsigned int numVariation=0, unsigned int mapIndex=0)
inefficiency retrieval by name

◆ getInefficiency() [2/3]

Analysis::CalibResult Analysis::CalibrationDataInterfaceROOT::getInefficiency ( const CalibrationDataVariables & variables,
unsigned int indexSF,
unsigned int indexEff,
Uncertainty unc,
const std::string & flavour,
unsigned int numVariation = 0 )

inefficiency retrieval by index

Definition at line 1353 of file CalibrationDataInterfaceROOT.cxx.

1356{
1357 // Data inefficiency retrieval identifying the requested calibration objects by index.
1358 // The data efficiency is computed as the product of MC efficiency and data/MC efficiency scale factor;
1359 // the inefficiency is then computed as the 1 minus the efficiency.
1360 // The return value is either a (value, uncertainty) or an (up, down) variation pair, as documented
1361 // above, and will be a dummy value in case an error occurs.
1362 //
1363 // variables: object holding kinematic (and other) information needed to compute the result
1364 // indexSF: index to scale factor calibration object
1365 // indexEff: index to MC efficiency object
1366 // unc: keyword indicating what uncertainties to evaluate (or whether eigenvector or
1367 // named variations are to be computed)
1368 // numVariation: variation index (in case of eigenvector or named variations)
1369
1371 return (getInefficiency(variables, indexSF, indexEff, unc, numVariation, result, flavour) == Analysis::kError) ?
1373}

◆ getInefficiency() [3/3]

Analysis::CalibrationStatus Analysis::CalibrationDataInterfaceROOT::getInefficiency ( const CalibrationDataVariables & variables,
unsigned int indexSF,
unsigned int indexEff,
Uncertainty unc,
unsigned int numVariation,
Analysis::CalibResult & result,
const std::string & flavour )

inefficiency retrieval by index

Definition at line 1377 of file CalibrationDataInterfaceROOT.cxx.

1381{
1382 // Data inefficiency retrieval identifying the requested calibration objects by index.
1383 // The data efficiency is computed as the product of MC efficiency and data/MC efficiency scale factor;
1384 // the inefficiency is then computed as the 1 minus the efficiency.
1385 //
1386 // variables: object holding kinematic (and other) information needed to compute the result
1387 // indexSF: index to scale factor calibration object
1388 // indexEff: index to MC efficiency object
1389 // unc: keyword indicating what uncertainties to evaluate (or whether eigenvector or
1390 // named variations are to be computed)
1391 // numVariation: variation index (in case of eigenvector or named variations)
1392 // result: (value, uncertainty) or (up, down) variation pair, depending on the unc value.
1393 // A dummy value will be returned in case of an error.
1394
1395 Analysis::CalibResult sfResult;
1396 Analysis::CalibrationStatus sfStatus = getScaleFactor(variables, indexSF, indexEff, unc, numVariation, sfResult, flavour);
1397 if (sfStatus == Analysis::kError) return sfStatus;
1398 Analysis::CalibResult effResult;
1399 Analysis::CalibrationStatus effStatus= getMCEfficiency(variables, indexEff, unc, effResult);
1400 if (effStatus == Analysis::kError) return effStatus;
1401
1402 double val = std::max(0., 1. - effResult.first * sfResult.first);
1403 double err = 0.; // Analysis::dummyValue;
1404
1405 // Bail out here if not both results are strictly positive
1406 if (effResult.first <= 0. || sfResult.first <= 0.) return Analysis::kError;
1407
1408 // Treat the scale factor variation cases separately since the contents of the CalibResult are different
1409 // (e.g. 'val' above contains the upward variation)
1410 if (unc == SFEigen || unc == SFNamed) {
1411 double valDown = std::max(0., 1. - effResult.first*sfResult.second);
1412
1413 result.first = val;
1414 result.second = valDown;
1415 } else {
1416 // safer than pow(x, 2):
1417 err = effResult.second/effResult.first*effResult.second/effResult.first
1418 + sfResult.second/sfResult.first*sfResult.second/sfResult.first;
1419 err = val*TMath::Sqrt(err);
1420
1421 result.first = std::max(0., std::min(1., val));
1422 result.second = err;
1423 }
1424
1425 // "Select" the status code for the actual calibration (it is subject to more constraints)
1426 return sfStatus;
1427}

◆ getInefficiencyScaleFactor() [1/3]

Analysis::CalibResult Analysis::CalibrationDataInterfaceROOT::getInefficiencyScaleFactor ( const CalibrationDataVariables & variables,
const std::string & label,
const std::string & OP,
Uncertainty unc,
unsigned int numVariation = 0,
unsigned int mapIndex = 0 )

"MC" inefficiency scale factor retrieval by name

Definition at line 1195 of file CalibrationDataInterfaceROOT.cxx.

1199{
1200 // Inefficiency scale factor retrieval identifying the requested calibration objects by name.
1201 // The data efficiency is computed as the product of MC efficiency and data/MC efficiency scale factor;
1202 // the inefficiency scale factor is then computed as the ratio of data to MC inefficiencies.
1203 // The return value is either a (value, uncertainty) or an (up, down) variation pair, as documented
1204 // above, and will be a dummy value in case an error occurs.
1205 //
1206 // variables: object holding kinematic (and other) information needed to compute the result
1207 // label: jet flavour label
1208 // OP: tagger operating point
1209 // unc: keyword indicating what uncertainties to evaluate (or whether eigenvector or
1210 // named variations are to be computed)
1211 // numVariation: variation index (in case of eigenvector or named variations)
1212 // mapIndex: index to the efficiency map to be used
1213
1214 unsigned int indexSF, indexEff;
1215 if (! (retrieveCalibrationIndex (label, OP, variables.jetAuthor, false, indexEff, mapIndex) &&
1216 retrieveCalibrationIndex (label, OP, variables.jetAuthor, true, indexSF))) {
1217 cerr << "getInefficiencyScaleFactor: unable to find Eff calibration for object "
1218 << fullName(variables.jetAuthor, OP, label, false, mapIndex)
1219 << " or SF calibration for object "
1220 << fullName(variables.jetAuthor, OP, label, true) << endl;
1221 // Return a dummy result if the object is not found
1222 return Analysis::dummyResult;
1223 }
1224
1226 return (getInefficiencyScaleFactor(variables, indexSF, indexEff, unc, numVariation, result, label) == Analysis::kError) ?
1228}
CalibResult getInefficiencyScaleFactor(const CalibrationDataVariables &variables, const std::string &label, const std::string &OP, Uncertainty unc, unsigned int numVariation=0, unsigned int mapIndex=0)
"MC" inefficiency scale factor retrieval by name

◆ getInefficiencyScaleFactor() [2/3]

Analysis::CalibResult Analysis::CalibrationDataInterfaceROOT::getInefficiencyScaleFactor ( const CalibrationDataVariables & variables,
unsigned int indexSF,
unsigned int indexEff,
Uncertainty unc,
const std::string & flavour,
unsigned int numVariation = 0 )

"MC" inefficiency scale factor retrieval by index

Definition at line 1232 of file CalibrationDataInterfaceROOT.cxx.

1235{
1236 // Inefficiency scale factor retrieval identifying the requested calibration objects by index.
1237 // The data efficiency is computed as the product of MC efficiency and data/MC efficiency scale factor;
1238 // the inefficiency scale factor is then computed as the ratio of data to MC inefficiencies.
1239 // The return value is either a (value, uncertainty) or an (up, down) variation pair, as documented
1240 // above, and will be a dummy value in case an error occurs.
1241 //
1242 // variables: object holding kinematic (and other) information needed to compute the result
1243 // indexSF: index to scale factor calibration object
1244 // indexEff: index to MC efficiency object
1245 // unc: keyword indicating what uncertainties to evaluate (or whether eigenvector or
1246 // named variations are to be computed)
1247 // numVariation: variation index (in case of eigenvector or named variations)
1248
1250 return (getInefficiencyScaleFactor(variables, indexSF, indexEff, unc, numVariation, result, flavour) == Analysis::kError) ?
1252}

◆ getInefficiencyScaleFactor() [3/3]

Analysis::CalibrationStatus Analysis::CalibrationDataInterfaceROOT::getInefficiencyScaleFactor ( const CalibrationDataVariables & variables,
unsigned int indexSF,
unsigned int indexEff,
Uncertainty unc,
unsigned int numVariation,
Analysis::CalibResult & result,
const std::string & flavour )

"MC" inefficiency scale factor retrieval by index

Definition at line 1256 of file CalibrationDataInterfaceROOT.cxx.

1260{
1261 // Inefficiency scale factor retrieval identifying the requested calibration objects by index.
1262 // The data efficiency is computed as the product of MC efficiency and data/MC efficiency scale factor;
1263 // the inefficiency scale factor is then computed as the ratio of data to MC inefficiencies.
1264 //
1265 // variables: object holding kinematic (and other) information needed to compute the result
1266 // indexSF: index to scale factor calibration object
1267 // indexEff: index to MC efficiency object
1268 // unc: keyword indicating what uncertainties to evaluate (or whether eigenvector or
1269 // named variations are to be computed)
1270 // numVariation: variation index (in case of eigenvector or named variations)
1271 // result: (value, uncertainty) or (up, down) variation pair, depending on the unc value.
1272 // A dummy value will be returned in case of an error.
1273
1274 Analysis::CalibResult sfResult;
1275 Analysis::CalibrationStatus sfStatus = getScaleFactor(variables, indexSF, indexEff, unc, numVariation, sfResult, flavour);
1276 if (sfStatus == Analysis::kError) return sfStatus;
1277 Analysis::CalibResult effResult;
1278 Analysis::CalibrationStatus effStatus= getMCEfficiency(variables, indexEff, unc, effResult);
1279 if (effStatus == Analysis::kError) return effStatus;
1280
1281 double eff = std::min(effResult.first, 1.);
1282 // double efferr = effResult.second; // not needed as (per the code change indicated below) we are not doing anything with MC statistical uncertainties
1283 double sf = sfResult.first;
1284 double sferr = sfResult.second;
1285
1286 double val = 0.; // Analysis::dummyValue;
1287 double err = 0.; // Analysis::dummyValue;
1288 if (1. - eff > CalibZERO) {
1289 // Protect against negative scale factors
1290 val = std::max((1. - eff*sf), CalibZERO) / (1. - eff);
1291 // Treat the scale factor variation cases separately since the contents of the CalibResult are different
1292 // ('sf' and 'sferr' above contain the upward and downward variations, respectively).
1293 if (unc == SFEigen || unc == SFNamed) {
1294 double valDown = std::max((1. - eff*sferr), CalibZERO) / (1. - eff);
1295 result.first = val;
1296 result.second = valDown;
1297 return sfStatus;
1298 }
1299 // When using eigenvector (or named) variations (as above), only scale factor variations are considered.
1300 // For the sake of consistency, it has been decided (see https://its.cern.ch/jira/browse/AFT-350) to remove them also when EV variations aren't used
1301 //err = pow((1. - sf) / (1. - eff) * efferr, 2) + pow(eff*sferr, 2);
1302 err = pow(eff*sferr, 2);
1303 if (err > 0.)
1304 err = 1./(1. - eff) * TMath::Sqrt(err);
1305 // cout << "btag Calib Ineff err=" << err << endl;
1306 }
1307
1308 result.first = std::max(CalibZERO, val);
1309 result.second = err;
1310 // "Select" the status code for the actual calibration (it is subject to more constraints)
1311 return sfStatus;
1312}
constexpr int pow(int x)
Definition conifer.h:27

◆ getMCEfficiency() [1/3]

Analysis::CalibResult Analysis::CalibrationDataInterfaceROOT::getMCEfficiency ( const CalibrationDataVariables & variables,
const std::string & label,
const std::string & OP,
Uncertainty unc = None,
unsigned int mapIndex = 0 )

"MC" efficiency retrieval by name

Definition at line 972 of file CalibrationDataInterfaceROOT.cxx.

975{
976 // MC efficiency retrieval identifying the requested calibration object by name.
977 // The return value is a (value, uncertainty) pair, as documented above, and will
978 // be a dummy value in case an error occurs.
979 //
980 // variables: object holding kinematic (and other) information needed to compute the result
981 // label: jet flavour label
982 // OP: tagger operating point
983 // unc: keyword indicating what uncertainties to evaluate
984 // mapIndex: index to the efficiency map to be used
985
986 unsigned int index;
987 if (! retrieveCalibrationIndex (label, OP, variables.jetAuthor, false, index, mapIndex)) {
988 cerr << "getMCEfficiency: unable to find Eff calibration for object " << fullName(variables.jetAuthor, OP, label, false, mapIndex) << endl;
989 // Return a dummy result if the object is not found
991 }
992
994 return (getMCEfficiency(variables, index, unc, result) == Analysis::kError) ?
996}

◆ getMCEfficiency() [2/3]

Analysis::CalibrationStatus Analysis::CalibrationDataInterfaceROOT::getMCEfficiency ( const CalibrationDataVariables & variables,
unsigned int index,
Uncertainty unc,
Analysis::CalibResult & result )

"MC" efficiency retrieval by index

Definition at line 1018 of file CalibrationDataInterfaceROOT.cxx.

1021{
1022 // MC efficiency retrieval identifying the requested calibration object by index.
1023 //
1024 // variables: object holding kinematic (and other) information needed to compute the result
1025 // index: index to calibration object
1026 // unc: keyword indicating what uncertainties to evaluate
1027 // result: (value, uncertainty) variation pair.
1028 // A dummy value will be returned in case of an error.
1029
1030 CalibrationDataContainer* container = m_objects[index];
1031 if (! container) return Analysis::kError;
1032
1033 // perform out-of-bound check of jet eta
1034 if (!checkAbsEta(variables, index)) {
1035 if (m_verbose)
1036 cerr << "Jet |eta| is outside of the boundary!" << endl;
1037 return Analysis::kRange;
1038 }
1039
1040
1041 // always retrieve the result itself
1042 double value;
1043 Analysis::CalibrationStatus status = container->getResult(variables, value);
1044 if (status == Analysis::kError) return status;
1045 if (m_otherStrategy == GiveUp)
1046 assert (status != Analysis::kRange); // no need to test also statDown
1047 else if (m_otherStrategy == Flag)
1048 if (status == Analysis::kRange)
1049 this->increaseCounter(index);
1050
1051 // retrieve the statistical uncertainty if desired
1052 double stat(0);
1053 if (unc == Total || unc == Statistical) {
1054 if (container->getStatUncertainty(variables, stat) == Analysis::kError) {
1055 cerr << "getMCEfficiency: error retrieving MC efficiency parameter covariance matrix!" << endl;
1056 return Analysis::kError;
1057 }
1058 }
1059
1060 // Temporary(?) hack: comment this out since the present MC results don't have "systematics" contributions
1061 // Analysis::UncertaintyResult resSyst(0,0);
1062 // if (unc == Total || unc == Systematic) {
1063 // if (container->getSystUncertainty(variables, resSyst) == Analysis::kError)
1064 // cerr << "getScaleFactor: error retrieving Scale factor parameter covariance matrix!"
1065 // << endl;
1066 // }
1067
1068 // since there is no combination of stat/syst uncertainties to be made, comment this out too
1069 double uncertainty = stat; // combinedUncertainty(stat, resSyst);
1070 result.first = std::max(0., std::min(1., value));
1071 result.second = uncertainty;
1072
1073 return status;
1074}
bool checkAbsEta(const CalibrationDataVariables &variables, unsigned int index)
status
Definition merge.py:16

◆ getMCEfficiency() [3/3]

Analysis::CalibResult Analysis::CalibrationDataInterfaceROOT::getMCEfficiency ( const CalibrationDataVariables & variables,
unsigned int index,
Uncertainty unc = None )

"MC" efficiency retrieval by index

Definition at line 1000 of file CalibrationDataInterfaceROOT.cxx.

1002{
1003 // MC efficiency retrieval identifying the requested calibration object by index.
1004 // The return value is a (value, uncertainty) pair, as documented above, and will
1005 // be a dummy value in case an error occurs.
1006 //
1007 // variables: object holding kinematic (and other) information needed to compute the result
1008 // index: index to calibration object
1009 // unc: keyword indicating what uncertainties to evaluate
1010
1012 return (getMCEfficiency(variables, index, unc, result) == Analysis::kError) ?
1014}

◆ getMCEfficiencyObject()

const TObject * Analysis::CalibrationDataInterfaceROOT::getMCEfficiencyObject ( const std::string & author,
const std::string & label,
const std::string & OP,
unsigned int mapIndex = 0 )

retrieve the MC efficiency (central values) object for the given flavour label and operating point.

A null result will be returned in case of error (e.g. if the calibration object isn't binned to begin with). It is the user's responsibility to verify whether the object derives from a TH1 or a TF1.

Definition at line 2137 of file CalibrationDataInterfaceROOT.cxx.

2141{
2142 // Retrieve the actual central values object for the MC efficiences, identifying the object by name.
2143 // The object returned can be either a TH1 or a TF1; it is up to the user to determine which.
2144 //
2145 // author: jet collection name
2146 // label: jet flavour label
2147 // OP: tagger working point
2148 // mapIndex: index to the efficiency map to be used
2149
2150 unsigned int index;
2151 if (! retrieveCalibrationIndex (label, OP, author, false, index, mapIndex)) {
2152 // Return a dummy result if the object is not found
2153 cerr << "getMCEfficiencyObject: unable to find efficiency calibration for object "
2154 << fullName(author, OP, label, false, mapIndex) << endl;
2155 return 0;
2156 }
2157 CalibrationDataContainer* container = m_objects[index];
2158 return (container) ? container->GetValue("result") : 0;
2159}

◆ getMCInefficiency() [1/2]

Analysis::CalibResult Analysis::CalibrationDataInterfaceROOT::getMCInefficiency ( const CalibrationDataVariables & variables,
const std::string & label,
const std::string & OP,
Uncertainty unc = None,
unsigned int mapIndex = 0 )

"MC" inefficiency retrieval by name

Definition at line 1431 of file CalibrationDataInterfaceROOT.cxx.

1434{
1435 // Data inefficiency retrieval identifying the requested calibration objects by name.
1436 // The inefficiency is computed as the 1 minus the efficiency.
1437 // The return value is a (value, uncertainty), as documented above, and will be a dummy value
1438 // in case an error occurs.
1439 //
1440 // variables: object holding kinematic (and other) information needed to compute the result
1441 // label: jet flavour label
1442 // OP: tagger operating point
1443 // unc: keyword indicating what uncertainties to evaluate (or whether eigenvector or
1444 // named variations are to be computed)
1445 // numVariation: variation index (in case of eigenvector or named variations)
1446 // mapIndex: index to the efficiency map to be used
1447
1448 Analysis::CalibResult effResult = getMCEfficiency(variables, label, OP, unc, mapIndex);
1449 return std::make_pair(std::max(0., 1. - effResult.first), effResult.second);
1450}

◆ getMCInefficiency() [2/2]

Analysis::CalibResult Analysis::CalibrationDataInterfaceROOT::getMCInefficiency ( const CalibrationDataVariables & variables,
unsigned int index,
Uncertainty unc = None )

"MC" inefficiency retrieval by index

Definition at line 1454 of file CalibrationDataInterfaceROOT.cxx.

1456{
1457 // MC inefficiency retrieval identifying the requested calibration object by index.
1458 // The inefficiency is computed as the 1 minus the efficiency.
1459 // The return value is a (value, uncertainty), as documented above, and will be a dummy value
1460 // in case an error occurs.
1461 //
1462 // variables: object holding kinematic (and other) information needed to compute the result
1463 // index: index to MC efficiency object
1464 // unc: keyword indicating what uncertainties to evaluate (or whether eigenvector or
1465 // named variations are to be computed)
1466 // numVariation: variation index (in case of eigenvector or named variations)
1467
1468 Analysis::CalibResult effResult = getMCEfficiency(variables, index, unc);
1469 return std::make_pair(std::max(0., 1. - effResult.first), effResult.second);
1470}

◆ getMCMCScaleFactor()

double Analysis::CalibrationDataInterfaceROOT::getMCMCScaleFactor ( const CalibrationDataVariables & variables,
unsigned indexSF,
unsigned int indexEff ) const

MC/MC scale factor retrieval.

Normally this is to be used only internally; however, since this information may be of interest it is made public anyway.

Definition at line 1474 of file CalibrationDataInterfaceROOT.cxx.

1476{
1477 // Retrieve the MC/MC scale factor given the set of scale factor and efficiency indices.
1478 // variables: object holding kinematic (and other) information needed to compute the result
1479 // indexSF: index to scale factor calibration object
1480 // indexEff: index to MC efficiency object
1481
1482 // If either reference doesn't exist, or if they are the same, nothing can / needs to be done.
1483 int indexSFRef = m_hadronisationReference[indexSF], indexEffRef = m_hadronisationReference[indexEff];
1484 if (indexSFRef < 0 || indexEffRef < 0 || indexSFRef == indexEffRef) return 1;
1485
1486 // Verify also that the individual efficiencies are physically meaningful.
1487 double effSFRef; m_objects[indexSFRef]->getResult(variables, effSFRef);
1488 double effEffRef; m_objects[indexEffRef]->getResult(variables, effEffRef);
1489 return (effSFRef > 0 && effEffRef > 0) ? effSFRef/effEffRef : 1;
1490}

◆ getNumVariations() [1/2]

unsigned int Analysis::CalibrationDataInterfaceROOT::getNumVariations ( const std::string & author,
const std::string & label,
const std::string & OP,
Uncertainty unc )

retrieve the number of variations relevant to the calibration object.

The Uncertainty enum is used to specify the category.

Definition at line 2070 of file CalibrationDataInterfaceROOT.cxx.

2074{
2075 // Retrieve the number of eigenvector variations or named variations relevant for
2076 // the given scale factor calibration object, identifying the object by name.
2077 //
2078 // author: jet collection name
2079 // label: jet flavour label
2080 // OP: tagger working point
2081 // unc: should be set to SFEigen or SFNamed for the cases of
2082 // eigenvector variations or named variations, respectively
2083
2084 unsigned int index;
2085
2086 if (! retrieveCalibrationIndex (label, OP, author, true, index)) return 0;
2087 return getNumVariations(index, unc, label);
2088}
unsigned int getNumVariations(const std::string &author, const std::string &label, const std::string &OP, Uncertainty unc)
retrieve the number of variations relevant to the calibration object.

◆ getNumVariations() [2/2]

unsigned int Analysis::CalibrationDataInterfaceROOT::getNumVariations ( unsigned int index,
Uncertainty unc,
const std::string & flavour )

retrieve the number of variations relevant to the calibration object.

The Uncertainty enum is used to specify the category.

Definition at line 2092 of file CalibrationDataInterfaceROOT.cxx.

2094{
2095 // Retrieve the number of eigenvector variations or named variations relevant for
2096 // the given scale factor calibration object, identifying the object by index.
2097 //
2098 // index: index to calibration scale factor object
2099 // unc: should be set to SFEigen or SFNamed for the cases of
2100 // eigenvector variations or named variations, respectively
2101
2102 if (! (unc == SFEigen || unc == SFNamed || unc == SFGlobalEigen)) return 0;
2103 CalibrationDataContainer* container = m_objects[index];
2104 if (! container) return 0;
2105 std::shared_ptr<CalibrationDataEigenVariations> eigenVariation=m_eigenVariationsMap.at(container);
2106 if (unc == SFGlobalEigen){
2107 std::shared_ptr<CalibrationDataGlobalEigenVariations> GEV = std::dynamic_pointer_cast<CalibrationDataGlobalEigenVariations>(eigenVariation);
2108 return GEV->getNumberOfEigenVariations(flavour);
2109 }
2110 return (unc == SFEigen) ? eigenVariation->getNumberOfEigenVariations() : eigenVariation->getNumberOfNamedVariations();
2111}
#define GEV

◆ getScaleFactor() [1/3]

Analysis::CalibResult Analysis::CalibrationDataInterfaceROOT::getScaleFactor ( const CalibrationDataVariables & variables,
const std::string & label,
const std::string & OP,
Uncertainty unc,
unsigned int numVariation = 0,
unsigned int mapIndex = 0 )

efficiency scale factor retrieval by name.

#1

Definition at line 741 of file CalibrationDataInterfaceROOT.cxx.

745{
746 // Scale factor retrieval identifying the requested calibration object by name.
747 // The return value is either a (value, uncertainty) or an (up, down) variation pair, as documented
748 // above, and will be a dummy value in case an error occurs.
749 //
750 // variables: object holding kinematic (and other) information needed to compute the result
751 // label: jet flavour label
752 // OP: tagger operating point
753 // unc: keyword indicating what uncertainties to evaluate (or whether eigenvector or
754 // named variations are to be computed)
755 // numVariation: variation index (in case of eigenvector or named variations)
756 // mapIndex: index to the efficiency map to be used (this is needed for MC/MC scale factor
757 // application)
758 unsigned int indexEff, indexSF;
759 if (! (retrieveCalibrationIndex (label, OP, variables.jetAuthor, false, indexEff, mapIndex) && retrieveCalibrationIndex (label, OP, variables.jetAuthor, true, indexSF))) {
760 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;
761 // Return a dummy result if the object is not found
763 }
764
765 Analysis::CalibResult result; // the following is SF #3
766 return (getScaleFactor(variables, indexSF, indexEff, unc, numVariation, result, label) == Analysis::kError) ?
768}

◆ getScaleFactor() [2/3]

Analysis::CalibResult Analysis::CalibrationDataInterfaceROOT::getScaleFactor ( const CalibrationDataVariables & variables,
unsigned int indexSF,
unsigned int indexEff,
Uncertainty unc,
const std::string & flavour,
unsigned int numVariation = 0 )

efficiency scale factor retrieval by index #2

Definition at line 772 of file CalibrationDataInterfaceROOT.cxx.

775{
776 // Scale factor retrieval identifying the requested calibration object by index.
777 // The return value is either a (value, uncertainty) or an (up, down) variation pair, as documented
778 // above, and will be a dummy value in case an error occurs.
779 //
780 // variables: object holding kinematic (and other) information needed to compute the result
781 // indexSF: index to scale factor calibration object
782 // indexEff: index to MC efficiency object
783 // unc: keyword indicating what uncertainties to evaluate (or whether eigenvector or
784 // named variations are to be computed)
785 // numVariation: variation index (in case of eigenvector or named variations)
786 Analysis::CalibResult result; // the following is SF #3
787 return (getScaleFactor(variables, indexSF, indexEff, unc, numVariation, result, flavour) == Analysis::kError) ?
789}

◆ getScaleFactor() [3/3]

Analysis::CalibrationStatus Analysis::CalibrationDataInterfaceROOT::getScaleFactor ( const CalibrationDataVariables & variables,
unsigned int indexSF,
unsigned int indexEff,
Uncertainty unc,
unsigned int numVariation,
Analysis::CalibResult & result,
const std::string & flavour )

efficiency scale factor retrieval by index #3

Definition at line 793 of file CalibrationDataInterfaceROOT.cxx.

797{
798 // Scale factor retrieval identifying the requested calibration object by index.
799 //
800 // variables: object holding kinematic (and other) information needed to compute the result
801 // indexSF: index to scale factor calibration object
802 // indexEff: index to MC efficiency object
803 // unc: keyword indicating what uncertainties to evaluate (or whether eigenvector or
804 // named variations are to be computed)
805 // numVariation: variation index (in case of eigenvector or named variations)
806 // result: (value, uncertainty) or (up, down) variation pair, depending on the unc value.
807 // A dummy value will be returned in case of an error.
808
809 CalibrationDataContainer* container = m_objects[indexSF];
810 if (! container) {
811 cerr << "getScaleFactor: error retrieving container!" << endl;
812 return Analysis::kError;
813 }
814
815 // perform out-of-bound check of jet eta
816 if (!checkAbsEta(variables, indexSF)) {
817 if (m_verbose)
818 cerr << "Jet |eta| is outside of the boundary!" << endl;
819 return Analysis::kRange;
820 }
821
822 // retrieve the MC/MC scale factor
823 double MCMCSF = m_useMCMCSF ? getMCMCScaleFactor(variables, indexSF, indexEff) : 1; // if we don't want to switch generator, MCMCSF = 1, as it should be
824
825 if (!m_runEigenVectorMethod && (unc == SFEigen || unc == SFNamed || unc == SFGlobalEigen))
826 {
827 cerr << " ERROR. Trying to call eigenvector method but initialization not switched on in b-tagging configuration." << endl;
828 cerr << " Please correct your configuration first. Nominal uncertainties used. " << endl;
829 }
830
831 // Procede with eigenvariations methods i.e. return the SF variations
832 if (unc == SFEigen || unc == SFNamed || unc==SFGlobalEigen) {
833 std::shared_ptr<CalibrationDataEigenVariations> eigenVariation;
834 try {
835 eigenVariation=m_eigenVariationsMap.at(container);
836 } catch (const std::out_of_range&) {
837 cerr << " Could not retrieve eigenvector variation, while it should have been there." << endl;
838 return Analysis::kError;
839 }
840 TH1* up=0;
841 TH1* down=0;
842 bool extrapolate = false; // store if the numVariation is the extrapolation named uncertainty index
843 if (unc == SFEigen || unc==SFNamed){
844 unsigned int maxVariations = (unc == SFEigen) ? eigenVariation->getNumberOfEigenVariations() : eigenVariation->getNumberOfNamedVariations();
845 if (numVariation > maxVariations-1) {
846 cerr << "Asked for " << ((unc == SFEigen) ? "eigenvariation" : "named variation") << " number: " << numVariation << " but overall number of available variations is: " << maxVariations << endl;
847 return Analysis::kError;
848 }
849 bool isOK = eigenVariation->getEigenvectorVariation(numVariation,up,down);
850 if (!isOK) {
851 cerr << "Eigenvector object is there but cannot retrieve up and down uncertainty histograms." << endl;
852 return Analysis::kError;
853 }
854 // the 'extrapolation' uncertainty (always a named one) needs a somewhat special treatment
855 extrapolate = (unc == SFNamed) ? eigenVariation->isExtrapolationVariation(numVariation) : false;
856
857 } else if (unc == SFGlobalEigen) {
858 std::shared_ptr<CalibrationDataGlobalEigenVariations> GEV = std::dynamic_pointer_cast<CalibrationDataGlobalEigenVariations>(eigenVariation); //dynamic_cast<std::shared_ptr<CalibrationDataGlobalEigenVariations> >(eigenVariation);
859 if (not GEV){
860 cerr << "Analysis::CalibrationDataInterfaceROOT::getScaleFactor: dynamic cast failed\n";
861 return Analysis::kError;
862 }
863 unsigned int maxVariations = GEV->getNumberOfEigenVariations(flavour); // <----- This gets the number of variations of the flavour
864 if (maxVariations == 0){
865 cerr << "Overall number of available variations is 0!" << endl;
866 return Analysis::kError;
867 }
868 if (numVariation > maxVariations-1) {
869 cerr << "Asked for global eigenvariation number: " << numVariation << " but overall number of available variations is: " << maxVariations << endl;
870 return Analysis::kError;
871 }
872 bool isOK = GEV->getEigenvectorVariation(flavour, numVariation,up,down);
873 if (!isOK) {
874 cerr << "Eigenvector object is there but cannot retrieve up and down uncertainty histograms." << endl;
875 return Analysis::kError;
876 }
877 // the 'extrapolation' uncertainty (always a named one) needs a somewhat special treatment
878 extrapolate = GEV->isExtrapolationVariation(numVariation, flavour);
879 } else {
880 std::cerr << "ERROR: you requested " << unc << " but that isn't in the set of (SFEigen, SFGlobalEigen, SFNamed) for eigenvariations. " << std::endl;
881 return Analysis::kError;
882 }
883
884 double valueUp;
885 double valueDown;
886 Analysis::CalibrationStatus statUp = container->getResult(variables, valueUp, up, extrapolate); // This is what actually retrieves results from the container
887 Analysis::CalibrationStatus statDown = container->getResult(variables, valueDown,down, extrapolate);
888
889 if (statUp == Analysis::kError || statDown == Analysis::kError)
890 return Analysis::kError;
891 if (m_otherStrategy == GiveUp)
892 assert (statUp != Analysis::kRange); // no need to test also statDown
894 assert (statUp != Analysis::kExtrapolatedRange); // no need to test also statDown
895 else if (m_otherStrategy == Flag) {
896 if (statUp == Analysis::kRange)
897 increaseCounter(indexSF);
898 else if (statUp == Analysis::kExtrapolatedRange)
900 }
901
902 result.first = MCMCSF*valueUp;
903 result.second = MCMCSF*valueDown;
904
905 // Prevent negative return values. Should the comparison be against a strict 0?
906 result.first = std::max(Analysis::CalibZERO, result.first);
907 result.second = std::max(Analysis::CalibZERO, result.second);
908
909 return statUp; // end of getScaleFactor if SFEigen, SFGlobalEigen, or SFNamed is set
910
911
912 } // The above returns the up/down varied scale factor
913 //Proceed with no-eigenvector result
914
915 // always retrieve the result itself
916 double value;
917 Analysis::CalibrationStatus status = container->getResult(variables, value);
918 if (status == Analysis::kError) {
919 cerr << "getScaleFactor: error retrieving result in non-EV context!" << endl;
920 return status;
921 }
922 if (m_otherStrategy == GiveUp){
923 assert (status != Analysis::kRange);
924 } else if (m_otherStrategy == GiveUpExtrapolated) {
925 assert (status != Analysis::kExtrapolatedRange);
926 } else if (m_otherStrategy == Flag) {
927 if (status == Analysis::kRange){
928 increaseCounter(indexSF);
929 } else if (status == Analysis::kExtrapolatedRange) {
931 }
932 }
933
934 // retrieve the statistical uncertainty if desired
935 double stat(0);
936 if (unc == Total || unc == Statistical) {
937 if (container->getStatUncertainty(variables, stat) == Analysis::kError) {
938 cerr << "getScaleFactor: error retrieving Scale factor parameter covariance matrix!" << endl;
939 return Analysis::kError;
940 }
941 }
942
943 Analysis::UncertaintyResult resSyst(0,0);
944 if (unc == Total || unc == Systematic) {
945 if (container->getSystUncertainty(variables, resSyst) == Analysis::kError) {
946 cerr << "getScaleFactor: error retrieving Scale factor parameter systematic uncertainty!" << endl;
947 return Analysis::kError;
948 }
949 } else if (unc == Extrapolation) {
950 // this uncertainty is special, since it is not normally to be combined into the overall systematic uncertainty
951 if (container->getUncertainty("extrapolation", variables, resSyst) == Analysis::kError)
952 cerr << "getScaleFactor: error retrieving Scale factor parameter extrapolation uncertainty!" << endl;
953 } else if (unc == TauExtrapolation) {
954 // also this uncertainty is special, since it it singles out an uncertainty relevant only for tau "jets",
955 // and some care has to be taken not to duplicate or omit uncertainties
956 if (container->getUncertainty("extrapolation from charm", variables, resSyst) == Analysis::kError)
957 cerr << "getScaleFactor: error retrieving Scale factor parameter extrapolation uncertainty!" << endl;
958 }
959
960 double uncertainty = combinedUncertainty(stat, resSyst);
961 result.first = MCMCSF*value;
962 result.second = MCMCSF*uncertainty;
963
964 // Prevent negative return values. Should the comparison be against a strict 0?
965 result.first = std::max(Analysis::CalibZERO, result.first);
966 return status;
967
968}
double combinedUncertainty(double stat, const std::pair< double, double > &syst) const
utility function for combination of statistical and (a priori asymmetric) systematic uncertainty.
double getMCMCScaleFactor(const CalibrationDataVariables &variables, unsigned indexSF, unsigned int indexEff) const
MC/MC scale factor retrieval.
float extrapolate(const MuonLayerHough::Maximum &ref, const MuonLayerHough::Maximum &ex, bool doparabolic=false)

◆ getScaleFactorCovarianceMatrix()

TMatrixDSym Analysis::CalibrationDataInterfaceROOT::getScaleFactorCovarianceMatrix ( const std::string & author,
const std::string & label,
const std::string & OP,
const std::string & unc = "all" )

retrieve the named covariance matrix element corresponding to the binned calibration object.

The unc argument should correspond to a given source of statistical or systematic uncertainty, or "all" (in case the full covariance matrix is required) For 2D and 3D histograms, the bin numbering follows the "global" bin number as defined by class TH1.

Definition at line 2422 of file CalibrationDataInterfaceROOT.cxx.

2426{
2427 // Return the scale factor covariance matrix for the given calibration object.
2428 // This function is deprecated since its functionality is duplicated in the
2429 // CalibrationDataEigenVariations class.
2430 //
2431 // author: jet collection name
2432 // label: jet flavour label
2433 // OP: tagger working point
2434 // unc: source of uncertainty to consider
2435 // Catch issues with the specified input as early as possible
2436 TMatrixDSym dummy;
2437 if (unc == "comment" || unc == "result" || unc == "combined") return dummy;
2438
2439 unsigned int index;
2440 if (! retrieveCalibrationIndex (label, OP, author, true, index)) {
2441 // Return a dummy result if the object is not found
2442 cerr << "getScaleFactorCovarianceMatrix: unable to find SF calibration for object " << fullName(author, OP, label, true) << endl;
2443 return dummy;
2444 }
2445 CalibrationDataHistogramContainer* container = dynamic_cast<CalibrationDataHistogramContainer*>(m_objects[index]);
2446 if (!container) return dummy;
2447
2448 // retrieve the central calibration and its axes
2449 TH1* result = dynamic_cast<TH1*>(container->GetValue("result"));
2450 if (! result) return dummy;
2451 // "normal" case: single source of uncertainty
2452 if (unc != "all") {
2453 if (unc == "statistics") {
2454 return getStatCovarianceMatrix(result);
2455 } else {
2456 TH1* hunc = dynamic_cast<TH1*>(container->GetValue(unc.c_str()));
2457 if (! hunc) {
2458 cout << "getScaleFactorCovarianceMatrix: no uncertainty object found "
2459 << "corresponding to name " << unc << endl;
2460 return dummy;
2461 }
2462 return getSystCovarianceMatrix(result, hunc, container->isBinCorrelated(unc), unc, container->getTagWeightAxis());
2463 }
2464 }
2465
2466 // special case: complete covariance matrix. This is to be constructed
2467 // as the sum over all individual contributions.
2468 // First, treat the statistics separately (as above)
2469 TMatrixDSym cov = getStatCovarianceMatrix(result);
2470
2471 // Then loop through the list of (other) uncertainties
2472 std::vector<string> uncs = container->listUncertainties();
2473 for (unsigned int t = 0; t < uncs.size(); ++t) {
2474 if (uncs[t] == "comment" || uncs[t] == "result" || uncs[t] == "combined" ||
2475 uncs[t] == "statistics" || uncs[t]=="extrapolation" || uncs[t]=="MChadronisation" ||
2476 uncs[t]=="ReducedSets" || uncs[t]=="systematics") continue;
2477 TH1* hunc = dynamic_cast<TH1*>(container->GetValue(uncs[t].c_str()));
2478 if (not hunc) {
2479 std::cerr<<"Analysis::CalibrationDataInterfaceROOT::getScaleFactorCovarianceMatrix : dynamic cast failed\n";
2480 continue;
2481 }
2482 TMatrixDSym syst_cov = getSystCovarianceMatrix(result, hunc, container->isBinCorrelated(uncs[t]), uncs[t], container->getTagWeightAxis());
2483 cov += syst_cov;
2484 }
2485
2486 return cov;
2487}

◆ getShiftedScaleFactors()

const TH1 * Analysis::CalibrationDataInterfaceROOT::getShiftedScaleFactors ( const std::string & author,
const std::string & label,
const std::string & OP,
const std::string & unc,
double sigmas )

retrieve the binned calibration object for the given flavour label and operating point, with the result shifted by the given number of standard deviations for the given systematic uncertainty.

A null result will be returned in case of error (e.g. if the calibration object isn't binned to begin with, or if the uncertainty asked for isn't fully correlated from bin to bin).

Definition at line 2165 of file CalibrationDataInterfaceROOT.cxx.

2170{
2171 // Retrieve the actual histogrammed calibration scale factors, identifying the object by name
2172 // and with the scale factors shifted by the uncertainties due to the given source of uncertainty
2173 // (where bin-to-bin correlations are accounted for, i.e., shifts may be either positive or negative).
2174 //
2175 // author: jet collection name
2176 // label: jet flavour label
2177 // OP: tagger working point
2178 // unc: source of uncertainty to consider
2179 // sigmas: number of standard deviations by which to shift the scale factor central values
2180
2181 // quick sanity check
2182 if (unc == "comment" || unc == "result" || unc == "combined" || unc == "statistics") return 0;
2183
2184 unsigned int index;
2185 if (! retrieveCalibrationIndex (label, OP, author, true, index)) {
2186 // Return a null result if the object is not found
2187 cerr << "getShiftedScaleFactors: unable to find SF calibration for object " << fullName(author, OP, label, true) << endl;
2188 return nullptr;
2189 }
2190 CalibrationDataHistogramContainer* container = dynamic_cast<CalibrationDataHistogramContainer*>(m_objects[index]);
2191 if (! container) return nullptr;
2192
2193 TH1* result = dynamic_cast<TH1*>(container->GetValue("result"));
2194 TH1* hunc = dynamic_cast<TH1*>(container->GetValue(unc.c_str()));
2195 // another sanity check...
2196 if ((! hunc) || (! result)) return nullptr;
2197 if (hunc->GetDimension() != result->GetDimension() || hunc->GetNbinsX() != result->GetNbinsX() ||
2198 hunc->GetNbinsX() != result->GetNbinsX() || hunc->GetNbinsX() != result->GetNbinsX())
2199 return nullptr;
2200 // also check that the uncertainty is to be treated as correlated from bin to bin
2201 // (for the variation is applied coherently, which isn't appropriate for uncertainties
2202 // that aren't correlated from bin to bin)
2203 if (! container->isBinCorrelated(unc)) return 0;
2204
2205 // if everything is consistent, the actual operation simply consists of adding histograms...
2206 std::string name(container->GetName()); name += "_"; name += unc; name += "_";
2207 TH1* shifted = dynamic_cast<TH1*>(result->Clone(name.c_str()));
2208 if (not shifted) return nullptr;
2209 shifted->Add(hunc, sigmas);
2210 return shifted;
2211}

◆ getWeightScaleFactor() [1/3]

Analysis::CalibResult Analysis::CalibrationDataInterfaceROOT::getWeightScaleFactor ( const CalibrationDataVariables & variables,
const std::string & label,
Uncertainty unc,
unsigned int numVariation = 0,
unsigned int mapIndex = 0 )

efficiency scale factor retrieval by name

Definition at line 1494 of file CalibrationDataInterfaceROOT.cxx.

1497{
1498 // #1
1499 // Tag weight fraction scale factor retrieval identifying the requested calibration object by name.
1500 // The return value is either a (value, uncertainty) or (if eigenvector or named variations are specified)
1501 // an (up, down) variation pair, and will be a dummy value in case an error occurs.
1502 // Note that in contrast to the "regular" (non-continuous) case, the computation of the scale factor in
1503 // general needs the (selection- or even process-specific) MC tag weight fractions, in order to rescale
1504 // scale factors. This is used to ensure that the tag weight fractions (both in data and in MC) sum up to
1505 // unity for each given kinematic bin.
1506 //
1507 // variables: object holding kinematic (and other) information needed to compute the result
1508 // label: jet flavour label
1509 // unc: keyword indicating what uncertainties to evaluate (or whether eigenvector or
1510 // named variations are to be computed)
1511 // numVariation: variation index (in case of eigenvector or named variations)
1512 // mapIndex: index to the MC efficiency map to be used for scale factor rescaling
1513
1514 static const string cont("Continuous");
1515
1516 unsigned int indexSF, indexEff;
1517 if (! (retrieveCalibrationIndex (label, cont, variables.jetAuthor, false, indexEff, mapIndex) &&
1518 retrieveCalibrationIndex (label, cont, variables.jetAuthor, true, indexSF))) {
1519 cerr << "getWeightScaleFactor: unable to find Eff calibration for object "
1520 << fullName(variables.jetAuthor, cont, label, false, mapIndex)
1521 << " or SF calibration for object "
1522 << fullName(variables.jetAuthor, cont, label, true) << endl;
1523 return Analysis::dummyResult;
1524 }
1525
1527 return (getWeightScaleFactor(variables, indexSF, indexEff, unc, numVariation, result) == Analysis::kError) ? Analysis::dummyResult : result;
1528}
CalibResult getWeightScaleFactor(const CalibrationDataVariables &variables, const std::string &label, Uncertainty unc, unsigned int numVariation=0, unsigned int mapIndex=0)
efficiency scale factor retrieval by name

◆ getWeightScaleFactor() [2/3]

Analysis::CalibrationStatus Analysis::CalibrationDataInterfaceROOT::getWeightScaleFactor ( const CalibrationDataVariables & variables,
unsigned int indexSF,
unsigned int indexEff,
Uncertainty unc,
unsigned int numVariation,
Analysis::CalibResult & result )

efficiency scale factor retrieval by index, with different signature

Definition at line 1559 of file CalibrationDataInterfaceROOT.cxx.

1563{
1564 // #3
1565 // Tag weight fraction scale factor retrieval identifying the requested calibration object by index.
1566 // Note that in contrast to the "regular" (non-continuous) case, the computation of the scale factor in
1567 // general needs the (selection- or even process-specific) MC tag weight fractions, in order to rescale
1568 // scale factors. This is used to ensure that the tag weight fractions (both in data and in MC) sum up to
1569 // unity for each given kinematic bin.
1570 //
1571 // variables: object holding kinematic (and other) information needed to compute the result
1572 // indexSF: index to calibration object
1573 // indexEff: index to MC tag weight
1574 // unc: keyword indicating what uncertainties to evaluate (or whether eigenvector or
1575 // named variations are to be computed)
1576 // numVariation: variation index (in case of eigenvector or named variations)
1577 // result: (value, uncertainty) or (up, down) variation pair, depending on the unc value.
1578 // A dummy value will be returned in case of an error.
1579 CalibrationDataContainer* container = m_objects[indexSF];
1580 if (! container) return Analysis::kError;
1581 CalibrationDataContainer* effContainer = m_objects[indexEff];
1582 if (! effContainer) return Analysis::kError;
1583
1584 // the first time this combination of scale factor and "efficiency" objects is given, check on the
1585 // scale factors that will result from their combination (where the computations reproduce those
1586 // shown below)
1587 checkWeightScaleFactors(indexSF, indexEff);
1588
1589 // perform out-of-bound check of jet eta
1590 if (!checkAbsEta(variables, indexSF)) {
1591 if (m_verbose)
1592 cerr << "Jet |eta| is outside of the boundary!" << endl;
1593 return Analysis::kRange;
1594 }
1595
1596 // Always retrieve the result itself
1597 double value;
1598 Analysis::CalibrationStatus status = container->getResult(variables, value);
1599 if (status == Analysis::kError) return status;
1600 if (m_otherStrategy == GiveUp) assert (status != Analysis::kRange);
1601 else if (m_otherStrategy == GiveUpExtrapolated) assert (status != Analysis::kExtrapolatedRange);
1602 else if (m_otherStrategy == Flag) {
1603 if (status == Analysis::kRange)
1604 increaseCounter(indexSF);
1605 else if (status == Analysis::kExtrapolatedRange)
1606 increaseCounter(indexSF, Extrapolated);
1607 }
1608
1609 // Retrieve the reference MC tag weight fraction (corresponding to the calibration scale factors)
1610 Analysis::UncertaintyResult refMCResult(0,0);
1611 if (container->getUncertainty("MCreference", variables, refMCResult) == Analysis::kError)
1612 return Analysis::kError;
1613 double fracMCref = refMCResult.first;
1614 // Retrieve the MC reference information, if requested (the initialisation below is to make sure
1615 // that no exceptions in the code will be needed)
1616 double fracSFref = fracMCref, fracEffref = fracMCref;
1617 if (m_useMCMCSF) {
1618 int indexSFref = m_hadronisationReference[indexSF], indexEffref = m_hadronisationReference[indexEff];
1619 if (indexSFref < 0 || indexEffref < 0) {
1620 cerr << "getWeightScaleFactor: error: generator-specific corrections requested but necessary reference containers lacking " << endl;
1621 return Analysis::kError;
1622 } else {
1623 m_objects[indexSFref]->getResult(variables, fracSFref);
1624 m_objects[indexEffref]->getResult(variables, fracEffref);
1625 if (! (fracSFref > 0. && fracEffref > 0.)) {
1626 cerr << "getWeightScaleFactor: error: invalid reference tag weight fraction " <<fracSFref <<" " <<fracEffref << std::endl;
1627 return Analysis::kError;
1628 }
1629 }
1630 }
1631
1632 // Retrieve the MC tag weight fraction for the sample we need to reweight to
1633 double fracMCnew;
1634 Analysis::CalibrationStatus effStatus = effContainer->getResult(variables, fracMCnew);
1635 if (effStatus == Analysis::kError) return effStatus;
1636 if (m_otherStrategy == GiveUp) assert (effStatus != Analysis::kRange);
1637 else if (m_otherStrategy == Flag)
1638 if (effStatus == Analysis::kRange) increaseCounter(indexEff);
1639 // since we need to divide by this quantity, check that it is well-defined
1640 if (!(fracMCnew > 0.) and m_useTopologyRescaling) {// but we only care if using topology rescaling
1641 cerr << "getWeightScaleFactor: error: null fracMCnew would lead to invalid operation" << endl;
1642 return Analysis::kError;
1643 }
1644
1645 if (!m_runEigenVectorMethod && (unc == SFEigen || unc == SFNamed)) {
1646 cerr << "getWeightScaleFactor: ERROR. Trying to call eigenvector method but initialization not switched on in b-tagging .env config file." << endl;
1647 cerr << " Please correct your .env config file first. Nominal uncertainties used. " << endl;
1648 }
1649
1650 if (unc == SFEigen || unc == SFNamed) {
1651 std::shared_ptr<CalibrationDataEigenVariations> eigenVariation;
1652 try {
1653 eigenVariation = m_eigenVariationsMap.at(container);
1654 } catch (const std::out_of_range&) {
1655 cerr << "getWeightScaleFactor: could not retrieve eigenvector variation, while it should have been there." << endl;
1656 return Analysis::kError;
1657 }
1658 unsigned int maxVariations = (unc == SFEigen) ? eigenVariation->getNumberOfEigenVariations() : eigenVariation->getNumberOfNamedVariations();
1659 if (numVariation > maxVariations-1) {
1660 cerr << "getWeightScaleFactor: asked for " << ((unc == SFEigen) ? "eigenvariation" : "named variation") << " number: " << numVariation << " but overall number of available variations is: " << maxVariations << endl;
1661 return Analysis::kError;
1662 }
1663 TH1* up=0;
1664 TH1* down=0;
1665 bool isOK = (unc == SFEigen) ? eigenVariation->getEigenvectorVariation(numVariation,up,down) : eigenVariation->getNamedVariation(numVariation,up,down);
1666 if (!isOK) {
1667 cerr << "getWeightScaleFactor: Eigenvector object is there but cannot retrieve up and down uncertainty histograms." << endl;
1668 return Analysis::kError;
1669 }
1670 // the 'extrapolation' uncertainty (always a named one) needs a somewhat special treatment
1671 bool extrapolate = ( unc == SFNamed ) ? eigenVariation->isExtrapolationVariation(numVariation) : false;
1672
1673 double valueUp;
1674 double valueDown;
1675 Analysis::CalibrationStatus statusUp = container->getResult(variables, valueUp, up, extrapolate);
1676 Analysis::CalibrationStatus statusDown = container->getResult(variables, valueDown,down, extrapolate);
1677 if (statusUp == Analysis::kError || statusDown == Analysis::kError) return Analysis::kError;
1678
1679 // now carry out the rescaling. Protect against unphysical or suspiciously large scale factors
1680 double variationUp = valueUp - value;
1681 double variationDown = valueDown - value;
1682 // First step: from the calibration sample to its reference sample
1683 if (m_useTopologyRescaling) value = 1.0 + (value - 1.0) * (fracMCref / fracSFref);
1684 // Second step: from the calibration reference sample to the MC object's reference sample
1685 if (m_useMCMCSF) value *= (fracSFref / fracEffref);
1686 // Third step: from the MC object's reference sample to the MC sample itself
1687 if (m_useTopologyRescaling) value = 1.0 + (value - 1.0) * (fracEffref / fracMCnew);
1688 // Since all transformations of the scale factor itself are linear, the transformation of the variations is simpler.
1690 double f = (fracMCref / fracMCnew);
1691 variationUp *= f;
1692 variationDown *= f;
1693 } else if (m_useMCMCSF) {
1694 double f = (fracSFref / fracEffref);
1695 variationUp *= f;
1696 variationDown *= f;
1697 }
1698 valueUp = value + variationUp;
1699 valueDown = value + variationDown;
1700 if (valueUp < 0) {
1701 valueUp = 0; increaseCounter(indexSF, TagWeight);
1702 } else if (valueUp > m_maxTagWeight) {
1703 valueUp = m_maxTagWeight; increaseCounter(indexSF, TagWeight);
1704 }
1705 if (valueDown < 0) {
1706 valueDown = 0; increaseCounter(indexSF, TagWeight);
1707 } else if (valueDown > m_maxTagWeight) {
1708 valueDown = m_maxTagWeight; increaseCounter(indexSF, TagWeight);
1709 }
1710
1711 result.first = valueUp;
1712 result.second = valueDown;
1713 return statusUp;
1714 } //end eigenvector method
1715
1716 //Proceed with no-eigenvector result
1717
1718 // retrieve the statistical uncertainty if desired
1719 double stat(0);
1720 if (unc == Total || unc == Statistical) {
1721 if (container->getStatUncertainty(variables, stat) == Analysis::kError) {
1722 cerr << "getWeightScaleFactor: error retrieving Scale factor parameter covariance matrix!" << endl;
1723 return Analysis::kError;
1724 }
1725 }
1726 Analysis::UncertaintyResult uncertaintyResult(0,0);
1727 if (unc == Total || unc == Systematic) {
1728 if (container->getSystUncertainty(variables, uncertaintyResult) == Analysis::kError) {
1729 cerr << "getWeightScaleFactor: error retrieving Scale factor parameter systematic uncertainty!" << endl;
1730 return Analysis::kError;
1731 }
1732 } else if (unc == Extrapolation) {
1733 // this uncertainty is special, since it is not normally to be combined into the overall systematic uncertainty
1734 if (container->getUncertainty("extrapolation", variables, uncertaintyResult) == Analysis::kError)
1735 cerr << "getWeightScaleFactor: error retrieving Scale factor parameter extrapolation uncertainty!" << endl;
1736 } else if (unc == TauExtrapolation) {
1737 // also this uncertainty is special, since it it singles out an uncertainty relevant only for tau "jets",
1738 // and some care has to be taken not to duplicate or omit uncertainties
1739 if (container->getUncertainty("extrapolation from charm", variables, uncertaintyResult) == Analysis::kError)
1740 cerr << "getWeightScaleFactor: error retrieving Scale factor parameter extrapolation uncertainty!" << endl;
1741 }
1742
1743 double uncertainty = combinedUncertainty(stat, uncertaintyResult);
1744
1745 // Now carry out the rescaling. Again protect against unphysical or suspiciously large scale factors
1746 // First step: from the calibration sample to its reference sample
1747 if (m_useTopologyRescaling) value = 1.0 + (value - 1.0) * (fracMCref / fracSFref);
1748 // Second step: from the calibration reference sample to the MC object's reference sample
1749 if (m_useMCMCSF) value *= (fracSFref / fracEffref);
1750 // Third step: from the MC object's reference sample to the MC sample itself
1751 if (m_useTopologyRescaling) value = 1.0 + (value - 1.0) * (fracEffref / fracMCnew);
1752 if (value < 0) {
1753 value = 0; increaseCounter(indexSF, TagWeight);
1754 } else if (value > m_maxTagWeight) {
1756 }
1757 // Since all transformations of the scale factor itself are linear, the transformation of the uncertainty is simpler.
1759 uncertainty *= (fracMCref / fracMCnew);
1760 } else if (m_useMCMCSF) {
1761 uncertainty *= (fracSFref / fracEffref);
1762 }
1763
1764 result.first = std::max(0., value);
1765 result.second = uncertainty;
1766 // "Select" the status code for the actual calibration object (it is subject to more constraints)
1767 return status;
1768}
virtual CalibrationStatus getResult(const CalibrationDataVariables &x, double &result, TObject *obj=0, bool extrapolate=false)=0
retrieve the calibration result.
void checkWeightScaleFactors(unsigned int indexSF, unsigned int indexEff)

◆ getWeightScaleFactor() [3/3]

Analysis::CalibResult Analysis::CalibrationDataInterfaceROOT::getWeightScaleFactor ( const CalibrationDataVariables & variables,
unsigned int indexSF,
unsigned int indexEff,
Uncertainty unc,
unsigned int numVariation = 0 )

efficiency scale factor retrieval by index

Definition at line 1532 of file CalibrationDataInterfaceROOT.cxx.

1535{
1536 // #2
1537 // Tag weight fraction scale factor retrieval identifying the requested calibration object by index.
1538 // The return value is either a (value, uncertainty) or (if eigenvector or named variations are specified)
1539 // an (up, down) variation pair, and will be a dummy value in case an error occurs.
1540 // Note that in contrast to the "regular" (non-continuous) case, the computation of the scale factor in
1541 // general needs the (selection- or even process-specific) MC tag weight fractions, in order to rescale
1542 // scale factors. This is used to ensure that the tag weight fractions (both in data and in MC) sum up to
1543 // unity for each given kinematic bin.
1544 //
1545 // variables: object holding kinematic (and other) information needed to compute the result
1546 // indexSF: index to calibration object
1547 // indexEff: index to MC tag weight
1548 // unc: keyword indicating what uncertainties to evaluate (or whether eigenvector or
1549 // named variations are to be computed)
1550 // numVariation: variation index (in case of eigenvector or named variations)
1551
1553 return (getWeightScaleFactor(variables, indexSF, indexEff, unc, numVariation, result) == Analysis::kError) ?
1555}

◆ increaseCounter()

void Analysis::CalibrationDataInterfaceROOT::increaseCounter ( unsigned int index,
OutOfBoundsType oob = Main )
private

Definition at line 1966 of file CalibrationDataInterfaceROOT.cxx.

1968{
1969 // Internal method bumping the relevant counter out-of-bounds counter for the specified object.
1970 //
1971 // oob: further classification of out-of-bounds case
1972 // index: object index
1973
1974 // make sure the vectors are appropriately dimensioned
1975 if (index >= m_mainCounters.size()) {
1976 unsigned int minsize = (index == 0) ? 2 : 2*index;
1977 m_mainCounters.resize(minsize, 0);
1978 m_etaCounters.resize(minsize, 0);
1979 m_extrapolatedCounters.resize(minsize, 0);
1980 }
1981 switch (oob) {
1982 case Main:
1983 m_mainCounters[index]++; break;
1984 case Eta:
1985 m_etaCounters[index]++; break;
1986 case Extrapolated:
1987 default:
1989 }
1990}

◆ initialize()

void Analysis::CalibrationDataInterfaceROOT::initialize ( const std::string & jetauthor,
const std::string & OP,
Uncertainty unc )

initialization for PROOF usage

Definition at line 2491 of file CalibrationDataInterfaceROOT.cxx.

2492{
2493 // Preload objects necessary so that the input calibration file can be closed.
2494 // This functionality is only needed when using PROOF.
2495
2496 if((!m_fileEff)||(!m_fileSF)) {
2497 cerr << "initialize can only be called once per CalibrationDataInterfaceROOT object" << endl;
2498 return;
2499 } else {
2500 cout << "initializing BTagCalibrationDataInterfaceROOT for PROOF with jetAuthor = " << jetauthor << ", tagger = " << m_taggerName << ", operating point = " << OP << ", uncertainty = " << unc << endl;
2501 }
2502
2503 CalibrationDataVariables BTagVars;
2504 BTagVars.jetAuthor = jetauthor;
2505 BTagVars.jetPt = 100000.; //Irrelevant, just has to be valid to retrieve objects
2506 BTagVars.jetEta = 1.5; //Irrelevant, just has to be valid to retrieve objects
2507
2508 for(const auto& flavour : m_flavours){
2509 std::pair<double, double> BTagCalibResult;
2510 BTagCalibResult = getScaleFactor(BTagVars, flavour, OP, unc);
2511 std::cout << "CalibrationDataInterfaceROOT->initialize : BTagCalibResult " << std::endl;
2512
2513 std::pair<double, double> BTagCalibMCEff;
2514 BTagCalibMCEff = getMCEfficiency(BTagVars, flavour, OP, unc);
2515 std::cout << "CalibrationDataInterfaceROOT->initialize : BTagCalibMCEff " << std::endl;
2516 }
2517
2518 if (m_fileEff != m_fileSF) {
2519 m_fileEff->Close();
2520 delete m_fileEff;
2521 }
2522 m_fileSF->Close();
2523 delete m_fileSF;
2524 m_fileEff = 0; //prevents repeat deletion in destructor
2525 m_fileSF = 0; //prevents repeat deletion in destructor
2526}

◆ listScaleFactorUncertainties() [1/2]

std::vector< string > Analysis::CalibrationDataInterfaceROOT::listScaleFactorUncertainties ( const std::string & author,
const std::string & label,
const std::string & OP,
bool named = false )

retrieve the list of "uncertainties" relevant to the calibration object.

A few uncertainty names are predetermined: "result", "comment", "statistics", "systematics". Other sources of systematic uncertainty may be added. Note that the "systematics" source does not give access to correlations between bins. If the 'named' argument is true, the list does not include all uncertainties but only those excluded from the eigenvector construction (this option is only relevant if eigenvector use has been switched on to begin with). In this case the order of the uncertainties listed is important since it indicates the index by which the given named uncertainty is identified.

Definition at line 1994 of file CalibrationDataInterfaceROOT.cxx.

1998{
1999 // Retrieve the sources of uncertainty relevant for the given scale factor calibration object,
2000 // identifying the object by name.
2001 //
2002 // author: jet collection name
2003 // label: jet flavour label
2004 // OP: tagger working point
2005 // named: if false, an unsorted list of sources of uncertainties will be returned.
2006 // if true, only 'named' uncertainties will be returned, and the position in
2007 // the vector that is the return value determines the 'numVariation' index
2008 // that is to be used if named variations are to be retrieved.
2009
2010 unsigned int index;
2011 if (! retrieveCalibrationIndex (label, OP, author, true, index)) {
2012 // Return a dummy result if the object is not found
2013 cerr << "listScaleFactorUncertainties: unable to find SF calibration for object " << fullName(author, OP, label, true) << endl;
2014 std::vector<string> dummy;
2015 return dummy;
2016 }
2017 return listScaleFactorUncertainties(index, label, named);
2018}
std::vector< std::string > listScaleFactorUncertainties(const std::string &author, const std::string &label, const std::string &OP, bool named=false)
retrieve the list of "uncertainties" relevant to the calibration object.

◆ listScaleFactorUncertainties() [2/2]

std::vector< string > Analysis::CalibrationDataInterfaceROOT::listScaleFactorUncertainties ( unsigned int index,
const std::string & flavour,
bool named = false )

retrieve the list of "uncertainties" relevant to the calibration object.

A few uncertainty names are predetermined: "result", "comment", "statistics", "systematics". Other sources of systematic uncertainty may be added. Note that the "systematics" source does not give access to correlations between bins. If the 'named' argument is true, the list does not include all uncertainties but only those excluded from the eigenvector construction (this option is only relevant if eigenvector use has been switched on to begin with). In this case the order of the uncertainties listed is important since it indicates the index by which the given named uncertainty is identified.

Definition at line 2022 of file CalibrationDataInterfaceROOT.cxx.

2024{
2025 // Note: this method already works on a per-flavour basis, so passing flavour in is a simple addition
2026 // Method is called primarily from within the BTaggingEfficiencyTool - W.L.
2027 // Retrieve the sources of uncertainty relevant for the given scale factor calibration object,
2028 // identifying the object by index.
2029 //
2030 // index: index to scale factor calibration object
2031 // named: if false, an unsorted list of sources of uncertainties will be returned.
2032 // if true, only 'named' uncertainties will be returned, and the position in
2033 // the vector that is the return value determines the 'numVariation' index
2034 // that is to be used if named variations are to be retrieved.
2035
2036 std::vector<string> dummy;
2037 CalibrationDataContainer* container = m_objects[index];
2038
2039 if (container) {
2040 if (named) {
2041 // Find out which uncertainties are excluded from eigenvector construction
2042 if (! m_runEigenVectorMethod) return dummy;
2043 std::shared_ptr<CalibrationDataEigenVariations> eigenVariation=m_eigenVariationsMap.at(container);
2044 if (m_EVStrategy == Analysis::Uncertainty::SFEigen){
2045 std::vector<string> unordered = eigenVariation->listNamedVariations(); // this is for the regular EV
2046 std::vector<string> ordered(unordered.size());
2047 for (unsigned int i = 0; i < unordered.size(); ++i) {
2048 ordered[eigenVariation->getNamedVariationIndex(unordered[i])] = unordered[i];
2049 }
2050 return ordered;
2051 } else if (m_EVStrategy == Analysis::Uncertainty::SFGlobalEigen){
2052 // here we want to get the named uncertainties from the global eigenvariations flavour container specifically...
2053 std::shared_ptr<CalibrationDataGlobalEigenVariations> GEV = std::dynamic_pointer_cast<CalibrationDataGlobalEigenVariations>(eigenVariation);
2054 std::vector<std::string> unordered = GEV->listNamedVariations(flavour);
2055 std::vector<std::string> ordered(unordered.size()); // ordered by the NAMED VARIATION (internal) ORDERING
2056 for (unsigned int i = 0; i < unordered.size(); ++i) {
2057 ordered[GEV->getNamedVariationIndex(unordered[i], flavour)] = unordered[i];
2058 }
2059 return ordered;
2060 }
2061 }
2062 return container->listUncertainties(); // return this if not named
2063 }
2064
2065 return dummy;
2066}

◆ nameFromIndex()

std::string Analysis::CalibrationDataInterfaceROOT::nameFromIndex ( unsigned int index) const

Retrieve the name of the calibration object (container) given its index.

Definition at line 1952 of file CalibrationDataInterfaceROOT.cxx.

1953{
1954 // Return the object name corresponding to the given index.
1955
1956 for (std::map<std::string, unsigned int>::const_iterator it = m_objectIndices.begin();
1957 it != m_objectIndices.end(); ++it)
1958 if (it->second == index) return it->first;
1959
1960 // This should never happen..
1961 return string("");
1962}

◆ retrieveCalibrationIndex()

bool Analysis::CalibrationDataInterfaceROOT::retrieveCalibrationIndex ( const std::string & label,
const std::string & OP,
const std::string & author,
bool isSF,
unsigned int & index,
unsigned int mapIndex = 0 )

Retrieve the index of the calibration object (container) starting from the label and operating point.

The return value will be false if the requested object cannot be found.

Definition at line 693 of file CalibrationDataInterfaceROOT.cxx.

698{
699 // Retrieve the integer index corresponding to a given combination of
700 // flavour label / tagger / working point / jet collection name, and separately
701 // for calibration scale factors and MC efficiencies (all these ingredients are needed
702 // to specify fully the calibration object).
703 // In fact this method will also trigger the retrieval of the object itself, if not already
704 // done, and will cache it internally. The absence of the requested calibration object will
705 // be flagged by a false return value.
706 // This method is used internally but should also be called by users in order to exploit the
707 // "code speed-up" features documented above.
708 //
709 // label: jet flavour label
710 // OP: tagger working point
711 // author: jet collection name
712 // isSF: set to true (false) for scale factors (MC efficiencies)
713 // index: resulting index (meaningful only for a 'true' function return value)
714 // mapIndex: index to the MC efficiency map to be used
715
716 index = 0;
717
718 // construct the full name from the label, operating point, SF/Eff choice;
719 // then look up this full name
720 string name = fullName(author, OP, label, isSF, mapIndex);
721 std::map<string, unsigned int>::const_iterator it = m_objectIndices.find(name);
722 if (it == m_objectIndices.end()) {
723 // If no container is found, attempt to retrieve it here (this is so that users won't
724 // have to call the named scale factor etc. methods once just to retrieve the container).
725 string flavour = (label == "N/A") ? "Light" : label;
726 string cntname = getContainername(flavour, isSF, mapIndex);
727 if (m_verbose) std::cout << "CalibrationDataInterfaceROOT->retrieveCalibrationIndex : container name is " << cntname << std::endl;
728 retrieveContainer(flavour, OP, author, cntname, isSF, m_verbose); // Only call this if you want to retrieve a currently not available container
729 it = m_objectIndices.find(name);
730 if (it == m_objectIndices.end()) return false;
731 } else {
732 if (m_verbose) std::cout << "CalibrationDataInterfaceROOT->retrieveCalibrationIndex : container " << name << " already cached! " << std::endl;
733 }
734
735 index = it->second;
736 return true;
737}
CalibrationDataContainer * retrieveContainer(const std::string &label, const std::string &OP, const std::string &author, const std::string &cntname, bool isSF, bool doPrint=true)
utility function taking care of object retrieval

◆ retrieveContainer()

CalibrationDataContainer * Analysis::CalibrationDataInterfaceROOT::retrieveContainer ( const std::string & label,
const std::string & OP,
const std::string & author,
const std::string & cntname,
bool isSF,
bool doPrint = true )

utility function taking care of object retrieval

Definition at line 2530 of file CalibrationDataInterfaceROOT.cxx.

2531{
2532 // Attempt to retrieve the given container from file. Note that also the corresponding
2533 // "hadronisation" reference is retrieved (if possible and not yet done).
2534 //
2535 // dir: name of the directory containing the requested container
2536 // cntname: name of the requested container itself (not including the full path)
2537 // isSF: set to false (true) if the object is to be retrieved from the MC efficiencies
2538 // file (the calibration scale factor file). Note that it is assumed that scale
2539 // factor objects will always be retrieved from the calibration scale factor file.
2540 // doPrint: if true, print out some basic information about the successfully retrieved container
2541 // (note that this is typically steered by the m_verbose setting;
2542 // only for the retrieval of the maps used for MC/MC SF calculations, this printout is always switched off)
2543
2544 string dir = m_taggerName + "/" + getAlias(author) + "/" + OP + "/" + label;
2545 // construct the full object name
2546 string name = dir + "/" + cntname;
2547
2548 // If the object cannot be found, then each call will result in a new attempt to
2549 // retrieve the object from the ROOT file. Hopefully this will not happen too often...
2550 unsigned int idx = m_objectIndices[name] = m_objects.size();
2551 // CalibrationDataContainer* cnt =
2552 // dynamic_cast<CalibrationDataContainer*>((isSF ? m_fileSF : m_fileEff) ->Get(name.c_str()));
2553 CalibrationDataContainer* cnt;
2554 (isSF ? m_fileSF : m_fileEff)->GetObject(name.c_str(), cnt);
2555 // If the requested object is a MC efficiency container and is not found, make a second attempt
2556 // to retrieve it from the calibration scale factor file. This will avoid the need to duplicate
2557 // efficiency containers so that the MC efficiency file needs to store only those containers
2558 // not already present in the calibration scale factor file. Of course this is meaningful only
2559 // if separate files are used to begin with.
2560 if (!isSF && !cnt && m_fileSF != m_fileEff) m_fileSF->GetObject(name.c_str(), cnt);
2561 m_objects.push_back(cnt);
2562 if (!cnt) {
2563 cerr << "btag Calib: retrieveContainer: failed to retrieve container named " << name << " from file" << endl;
2564 return 0;
2565 }
2566
2567 // For successfully retrieved containers, also print some more information (implemented on user request)
2568 if (doPrint) {
2569 cout << "CalibrationDataInterface: retrieved container " << name << " (with comment: '" << cnt->getComment() << "' and hadronisation setting '" << cnt->getHadronisation() << "')" << endl;
2570 }
2571
2572
2573 // If the requested object is a MC efficiency container, make sure to retrieve the corresponding
2574 // calibration scale factor container first (a feature first thought to be necessary, erroneously,
2575 // but left in since this ordering should not hurt in any case).
2576 if (m_refMap.find(dir) == m_refMap.end()) {
2577 if (isSF) {
2578 // Retrieve the mapping objects from both files and merge their information using the 'helper' class.
2579 // The map resulting from this is used to retrieve the information required to compute MC/MC scale factors.
2580 string hadronisationRefs(dir + "/MChadronisation_ref");
2581 TMap* mapSF = 0; m_fileSF->GetObject(hadronisationRefs.c_str(), mapSF);
2582 TMap* mapEff = 0; if (m_fileEff != m_fileSF) m_fileEff->GetObject(hadronisationRefs.c_str(), mapEff);
2583 m_refMap[dir] = new HadronisationReferenceHelper(mapSF, mapEff);
2584 delete mapSF;
2585 delete mapEff;
2586 } else {
2587 string SFCalibName = getContainername(getBasename(dir), true);
2588 if (m_objectIndices.find(SFCalibName) == m_objectIndices.end()) retrieveContainer(label, OP, author, SFCalibName, true, doPrint);
2589 }
2590 }
2591
2592 // Attempt to find the corresponding hadronisation reference container needed for the application of
2593 // MC/MC scale factors.
2594 if (idx+1 > m_hadronisationReference.size()) m_hadronisationReference.resize(idx+1, -1);
2596 string spec = cnt->getHadronisation();
2597 if (spec != "") {
2598 std::map<string, HadronisationReferenceHelper*>::const_iterator mapit = m_refMap.find(dir);
2599 if (mapit != m_refMap.end()) {
2600 string ref;
2601 if (mapit->second->getReference(spec, ref)) {
2602 // Retrieve the hadronisation reference if not already done. Note that the "isSF" is left unchanged:
2603 // this allows to retrieve the reference from the same file as the scale factor object. An exception
2604 // is the reference for the calibration scale factor object, which should always be obtained from
2605 // the scale factor file.
2606 // An efficiency container can be its own hadronisation reference (this is not "protected" against).
2607 string refname(dir + "/" + ref);
2608 std::map<string, unsigned int>::const_iterator it = m_objectIndices.find(refname);
2609 // If the reference cannot be found, assume that it hasn't yet been retrieved so attempt it now.
2610 if (it == m_objectIndices.end()) {
2611 // Omit the printout of container information here (the idea being that showing MC/MC SF information would confuse rather than help)
2612 retrieveContainer(label, OP, author, ref, isSF, false);
2613 it = m_objectIndices.find(refname);
2614 }
2615 if (it != m_objectIndices.end()) {
2616 m_hadronisationReference[idx] = it->second;
2617 }
2618 }
2619 } else if (m_useMCMCSF) {
2620 cerr << "btag Calib: retrieveContainer: MC hadronisation reference map not found -- this should not happen!" << endl;
2621 }
2622 }
2624 // Not being able to construct the MC/MC scale factors will lead to a potential bias.
2625 // However, this is not considered sufficiently severe that we will flag it as an error.
2626 if (m_useMCMCSF){
2627 cerr << "btag Calib: retrieveContainer: warning: unable to apply MC/MC scale factors for container " << name << " with hadronisation reference = '" << spec << "'" << endl;
2628 }
2629 }
2630
2631 // Initialize the Eigenvector variation object corresponding to this object, if applicable. Notes:
2632 // - the dual use of "isSF" (both referring to the file and to the object, see above) requires another protection here
2633 // - the constructor's second argument is used to determine whether to exclude a pre-determined set of uncertainties from the EV decomposition
2634 //
2635 // We also want to separate behavior between SFEigen and SFGlobalEigen systematic strategies
2636 // The former requires a CalibrationDataEigenVariations object to be made per flavour.
2637 // The latter combines all corresponding flavours, so once it's been made for a single flavour, it's cached under all the corresponding "flavour containers"
2638 // simulataneously in m_eigenVariationsMap, and is checked for on each subsequent call to this method.
2639 if (m_runEigenVectorMethod && isSF && name.find("_SF") != string::npos) {
2640 CalibrationDataHistogramContainer* histoContainer=dynamic_cast<CalibrationDataHistogramContainer*>(cnt);
2641 if (histoContainer==0) {
2642 cerr << "Could not cast Container to a HistogramContainer. " << endl;
2643 return 0;
2644 }
2645 if (m_EVStrategy == Analysis::Uncertainty::SFEigen){
2647 std::shared_ptr<CalibrationDataEigenVariations> newEigenVariation(new CalibrationDataEigenVariations(m_filenameSF, m_taggerName, OP, author, histoContainer, m_useRecommendedEVExclusions));
2648 newEigenVariation->setVerbose(m_verbose);
2649
2650 // At this point we may also want to reduce the number of eigenvector variations.
2651 // The choices are stored with the container object; but first we need to know what flavour we are dealing with.
2652 string flavour = dir.substr(dir.find_last_of("/")+1);
2653
2654 for (const auto & entry : m_excludeFromCovMatrix[flavour]) {
2655 newEigenVariation->excludeNamedUncertainty(entry, cnt);
2656 }
2657 newEigenVariation->initialize();
2658 int to_retain = histoContainer->getEigenvectorReduction(m_EVReductions[flavour]); // returns the number of eigenvariations to retain as per the EV reduction strategy
2659 if (to_retain > -1) {
2660 if (m_verbose) cout << "btag Calib: reducing number of eigenvector variations for flavour " << flavour << " to " << to_retain << endl;
2661 // The merged variations will end up as the first entry in the specified list, i.e., as the last of the variations to be "retained"
2662 newEigenVariation->mergeVariationsFrom(size_t(to_retain-1)); // All variations stored with indices larger than this are merged
2663 } else if (m_EVReductions[flavour] != Loose) {
2664 cerr << "btag Calib: unable to retrieve eigenvector reduction information for flavour " << flavour << " and scheme " << m_EVReductions[flavour] << "; not applying any reduction" << endl;
2665 }
2666 m_eigenVariationsMap[cnt]=std::move(newEigenVariation);
2667
2669 } else if (m_EVStrategy == Analysis::Uncertainty::SFGlobalEigen) {
2671 std::map<const CalibrationDataContainer*, std::shared_ptr<CalibrationDataEigenVariations> >::iterator evit = m_eigenVariationsMap.find(cnt);
2672 // The global implementation internally combines all the "flavour containers" (containers that correspond to each other, only with different flavours)
2673 // But the CalibrationDataInterfaceROOT object doesn't need to know that, so we want to get all the flavour containers in one go here
2674 // and map them (with m_eigenVariationsMap) to the same CalibrationDataGlobalEigenVariations pointer.
2675 // Then, in methods like getScaleFactor, we call the virtual methods which will give the proper result e.g. if you want the SF for a b-jet, it'll call the
2676
2677 if (evit == m_eigenVariationsMap.end()){
2678 // now to see if it's completely empty or not
2679 if (m_eigenVariationsMap.empty()){
2680 std::shared_ptr<CalibrationDataGlobalEigenVariations> newEigenVariation(new CalibrationDataGlobalEigenVariations(m_filenameSF, m_taggerName, OP, author, m_flavours, histoContainer, m_useRecommendedEVExclusions));
2681 for (const auto & entry : m_excludeFromCovMatrix[label]) {
2682 newEigenVariation->excludeNamedUncertainty(entry, label); // <---- custom exclude named uncertainties method for global variations
2683 }
2684
2685 newEigenVariation->initialize();
2686
2687 // flavour loop to get the flavour reduction schemes and apply them
2688 for (std::string& flavour : m_flavours){
2689 int to_retain = histoContainer->getEigenvectorReduction(m_EVReductions[flavour]); // returns the number of eigenvariations to retain as per the EV reduction strategy
2690 if (to_retain > -1) {
2691 if (m_verbose) cout << "btag Calib: reducing number of eigenvector variations for flavour " << flavour << " to " << to_retain << endl;
2692 // The merged variations will end up as the first entry in the specified list, i.e., as the last of the variations to be "retained"
2693 newEigenVariation->mergeVariationsFrom(size_t(to_retain-1), flavour); // All variations stored with indices larger than this are merged
2694 } else if (m_EVReductions[flavour] != Loose) {
2695 cerr << "btag Calib: unable to retrieve eigenvector reduction information for flavour " << flavour << " and scheme " << m_EVReductions[flavour] << "; not applying any reduction" << endl;
2696 }
2697 }
2698
2699 m_eigenVariationsMap.insert({cnt, newEigenVariation});
2700 } else {
2701 // Need to point to the CDGEV object four times in the m_eigenVariationsMap to appease the CDIROOT backend design...
2702 // Ok, turns out I can't retrieve the containers from CDGEV and insert them directly, because I'd have to use the containers directly instead..
2703 // So the strategy is to just take the CGEV objects that are already in the map, and mpa the present container to it
2704 std::shared_ptr<CalibrationDataEigenVariations> previous_eigenvariation = m_eigenVariationsMap.begin()->second;
2705 m_eigenVariationsMap.insert({cnt, previous_eigenvariation});
2706 }
2707
2708 } else {
2709 std::cout << "CalibrationDataInterfaceROOT->retrieveContainer : the CDGEV object for " << name << " already exists! " << std::endl;
2710 }
2712 }
2713 }
2714
2715 return cnt;
2716}
const std::regex ref(r_ef)
static const std::string hadronisationRefs("MChadronisation_ref")
std::string getBasename(const std::string &name) const
auxiliary function for retrieval of name within the directory
virtual int getEigenvectorReduction(unsigned int choice) const
Retrieve the number of eigenvectors to be retained for the purpose of eigenvector variation reduction...

◆ runEigenVectorRecomposition() [1/2]

Analysis::CalibrationStatus Analysis::CalibrationDataInterfaceROOT::runEigenVectorRecomposition ( const std::string & author,
const std::string & label,
const std::string & OP,
unsigned int mapindex = 0 )

run EigenVector Recomposition method

Definition at line 2214 of file CalibrationDataInterfaceROOT.cxx.

2217 {
2218 // run eigen vector recomposition method. If success, stored the retrieved coefficient map
2219 // in m_coefficientMap and return success. Otherwise return error and keep m_coefficientMap
2220 // untouched.
2221 // author: jet collection name
2222 // label: jet flavour label
2223 // OP: tagger working point
2224 // mapIndex: index to the MC efficiency map to be used. Should be 0?
2225 // Todo: What is mapindex?
2226 // Todo: Check the way xAODBTaggingTool initialize CDI. Check if that is the as how we are initialize CDI.
2228 cerr << "runEigenVectorRecomposition: Recomposition need to be ran with CalibrationDataInterfaceRoot initialized in eigenvector mode" << endl;
2229 return Analysis::kError;
2230 }
2231
2232 unsigned int indexSF;
2233 if (! retrieveCalibrationIndex (label, OP, author, true, indexSF, mapIndex)) {
2234 cerr << "runEigenVectorRecomposition: unable to find SF calibration for object "
2235 << fullName(author, OP, label, true) << endl;
2236 return Analysis::kError;
2237 }
2238
2239 return runEigenVectorRecomposition (label, indexSF);
2240}
CalibrationStatus runEigenVectorRecomposition(const std::string &author, const std::string &label, const std::string &OP, unsigned int mapindex=0)
run EigenVector Recomposition method

◆ runEigenVectorRecomposition() [2/2]

Analysis::CalibrationStatus Analysis::CalibrationDataInterfaceROOT::runEigenVectorRecomposition ( const std::string & label,
unsigned int mapindex = 0 )

Definition at line 2243 of file CalibrationDataInterfaceROOT.cxx.

2244 {
2245 // run eigen vector recomposition method. If success, stored the retrieved coefficient map
2246 // in m_coefficientMap and return success. Otherwise return error and keep m_coefficientMap
2247 // untouched.
2248 // label: jet flavour label
2249 // indexSF: index to scale factor calibration object
2250 CalibrationDataContainer* container = m_objects[indexSF];
2251 if (! container) {
2252 cerr << "runEigenVectorRecomposition: error retrieving container!" << endl;
2253 return Analysis::kError;
2254 }
2255
2256 // Retrieve eigenvariation
2257 std::shared_ptr<CalibrationDataEigenVariations> eigenVariation;
2258 try {
2259 eigenVariation = m_eigenVariationsMap.at(container);
2260 } catch (const std::out_of_range&) {
2261 cerr << "runEigenVectorRecomposition: Could not retrieve eigenvector variation, while it should have been there." << endl;
2262 return Analysis::kError;
2263 }
2264 // Doing eigenvector recomposition
2265 std::map<std::string, std::map<std::string, float>> coefficientMap;
2266 if(!eigenVariation->EigenVectorRecomposition(label, coefficientMap))
2267 return Analysis::kError;
2268
2269 m_coefficientMap = std::move(coefficientMap);
2270 return Analysis::kSuccess;
2271}

◆ setEffCalibrationNames()

void Analysis::CalibrationDataInterfaceBase::setEffCalibrationNames ( const std::map< std::string, std::vector< std::string > > & names)
inherited

Definition at line 63 of file CalibrationDataInterfaceBase.cxx.

65{
66 // Set the MC efficiency names.
67
69}

◆ setSFCalibrationNames()

void Analysis::CalibrationDataInterfaceBase::setSFCalibrationNames ( const std::map< std::string, std::string > & names)
inherited

Definition at line 87 of file CalibrationDataInterfaceBase.cxx.

88{
89 // Set the efficiency scale factor calibration names.
90
92}

◆ SFCalibrationName()

const std::string & Analysis::CalibrationDataInterfaceBase::SFCalibrationName ( const std::string & flavour) const
inherited

Definition at line 72 of file CalibrationDataInterfaceBase.cxx.

73{
74 // Return the efficiency scale factor calibration name for the given flavour.
75 // Note that no check is performed on the validity of the flavour.
76
77 try {
78 return m_calibrationSFNames.at(flavour);
79 }
80 catch (const std::out_of_range& e) {
81 std::cerr << "SFCalibrationName: flavour '" << flavour << "' is not known." << std::endl;
82 throw e;
83 }
84}

Member Data Documentation

◆ m_absEtaStrategy

OutOfBoundsStrategy Analysis::CalibrationDataInterfaceROOT::m_absEtaStrategy {}
private

Definition at line 474 of file CalibrationDataInterfaceROOT.h.

474{};

◆ m_aliases

std::map<std::string, std::string> Analysis::CalibrationDataInterfaceROOT::m_aliases
private

Do not attempt to persistify (PROOF).

jet author aliases (there is no single CalibrationBroker object here to take care of this, so we do it in this class)

Definition at line 405 of file CalibrationDataInterfaceROOT.h.

◆ m_calibrationEffNames

std::map<std::string, std::vector<std::string> > Analysis::CalibrationDataInterfaceBase::m_calibrationEffNames
privateinherited

this simply collects the per-flavour properties.

Definition at line 72 of file CalibrationDataInterfaceBase.h.

◆ m_calibrationSFNames

std::map<std::string, std::string> Analysis::CalibrationDataInterfaceBase::m_calibrationSFNames
privateinherited

Definition at line 73 of file CalibrationDataInterfaceBase.h.

◆ m_checkedWeightScaleFactors

std::vector<std::pair<unsigned int, unsigned int> > Analysis::CalibrationDataInterfaceROOT::m_checkedWeightScaleFactors
private

Definition at line 488 of file CalibrationDataInterfaceROOT.h.

◆ m_coefficientMap

std::map<std::string, std::map<std::string, float> > Analysis::CalibrationDataInterfaceROOT::m_coefficientMap
private

Definition at line 466 of file CalibrationDataInterfaceROOT.h.

◆ m_eigenVariationsMap

std::map<const CalibrationDataContainer*, std::shared_ptr<CalibrationDataEigenVariations> > Analysis::CalibrationDataInterfaceROOT::m_eigenVariationsMap
private

store the eigenvector class and associate to its CalibrationDataContainer

Definition at line 426 of file CalibrationDataInterfaceROOT.h.

◆ m_etaCounters

std::vector<unsigned int> Analysis::CalibrationDataInterfaceROOT::m_etaCounters
private

counters for flagging out-of-bound cases

Definition at line 480 of file CalibrationDataInterfaceROOT.h.

◆ m_EVReductions

std::map<std::string, Analysis::EVReductionStrategy> Analysis::CalibrationDataInterfaceROOT::m_EVReductions
private

Eigenvector reduction strategy (per flavour).

Definition at line 433 of file CalibrationDataInterfaceROOT.h.

◆ m_EVStrategy

Uncertainty Analysis::CalibrationDataInterfaceROOT::m_EVStrategy {}
private

Definition at line 430 of file CalibrationDataInterfaceROOT.h.

430{}; // <--- In addition, specify whether to use the global eigenvariations method

◆ m_excludeFromCovMatrix

std::map<std::string, std::vector<std::string> > Analysis::CalibrationDataInterfaceROOT::m_excludeFromCovMatrix
private

store the uncertainties which should be excluded from building the full covariance matrix

Definition at line 436 of file CalibrationDataInterfaceROOT.h.

◆ m_extrapolatedCounters

std::vector<unsigned int> Analysis::CalibrationDataInterfaceROOT::m_extrapolatedCounters
private

Definition at line 482 of file CalibrationDataInterfaceROOT.h.

◆ m_fileEff

TFile* Analysis::CalibrationDataInterfaceROOT::m_fileEff {}
private

pointer to the TFile object providing access to the calibrations

Definition at line 400 of file CalibrationDataInterfaceROOT.h.

400{};

◆ m_filenameEff

std::string Analysis::CalibrationDataInterfaceROOT::m_filenameEff
private

Definition at line 418 of file CalibrationDataInterfaceROOT.h.

◆ m_filenameSF

std::string Analysis::CalibrationDataInterfaceROOT::m_filenameSF
private

in addition, store also the filenames themselves (needed for the copy constructor)

Definition at line 417 of file CalibrationDataInterfaceROOT.h.

◆ m_fileSF

TFile* Analysis::CalibrationDataInterfaceROOT::m_fileSF {}
private

Do not attempt to persistify (PROOF).

Definition at line 401 of file CalibrationDataInterfaceROOT.h.

401{};

◆ m_flavours

std::vector<std::string> Analysis::CalibrationDataInterfaceROOT::m_flavours
private

Definition at line 419 of file CalibrationDataInterfaceROOT.h.

◆ m_hadronisationReference

std::vector<int> Analysis::CalibrationDataInterfaceROOT::m_hadronisationReference
private

store the 'hadronisation' reference for each object (-1 means no reference found)

Definition at line 461 of file CalibrationDataInterfaceROOT.h.

◆ m_mainCounters

std::vector<unsigned int> Analysis::CalibrationDataInterfaceROOT::m_mainCounters
private

Definition at line 481 of file CalibrationDataInterfaceROOT.h.

◆ m_maxAbsEta

double Analysis::CalibrationDataInterfaceROOT::m_maxAbsEta {}
private

|eta| bounds and strategy for dealing with out-of-bounds conditions

Definition at line 473 of file CalibrationDataInterfaceROOT.h.

473{};

◆ m_maxTagWeight

double Analysis::CalibrationDataInterfaceROOT::m_maxTagWeight {}
private

Definition at line 489 of file CalibrationDataInterfaceROOT.h.

489{};

◆ m_objectIndices

std::map<std::string, unsigned int> Analysis::CalibrationDataInterfaceROOT::m_objectIndices
private

Definition at line 411 of file CalibrationDataInterfaceROOT.h.

◆ m_objects

std::vector<CalibrationDataContainer*> Analysis::CalibrationDataInterfaceROOT::m_objects
private

cache the objects themselves (so that the user will not have to delete them after each call etc.).

The caching is done so that objects can be retrieved by number as well as by (OP, flavour, calibration name) combination.

Definition at line 410 of file CalibrationDataInterfaceROOT.h.

◆ m_otherStrategy

OutOfBoundsStrategy Analysis::CalibrationDataInterfaceROOT::m_otherStrategy {}
private

Definition at line 475 of file CalibrationDataInterfaceROOT.h.

475{};

◆ m_refMap

std::map<std::string, HadronisationReferenceHelper*> Analysis::CalibrationDataInterfaceROOT::m_refMap
private

the following maps (one for each directory) specify the name of the container serving as the 'hadronisation' reference for each object

Definition at line 459 of file CalibrationDataInterfaceROOT.h.

◆ m_runEigenVectorMethod

bool Analysis::CalibrationDataInterfaceROOT::m_runEigenVectorMethod {}
private

decide whether to run the eigenvector method or not

Definition at line 429 of file CalibrationDataInterfaceROOT.h.

429{};

◆ m_taggerName

std::string Analysis::CalibrationDataInterfaceBase::m_taggerName
protectedinherited

tagging algorithm name

Definition at line 94 of file CalibrationDataInterfaceBase.h.

◆ m_useMCMCSF

bool Analysis::CalibrationDataInterfaceROOT::m_useMCMCSF {}
private

specify whether or not to use MC/MC (hadronisation) scale factors (the fact that this is steerable is intended to be temporary only)

Definition at line 452 of file CalibrationDataInterfaceROOT.h.

452{};

◆ m_useRecommendedEVExclusions

bool Analysis::CalibrationDataInterfaceROOT::m_useRecommendedEVExclusions {}
private

if true, exclude pre-recommended lists of uncertainties from the covariance matrix building, in addition to the above user specified lists

Definition at line 441 of file CalibrationDataInterfaceROOT.h.

441{};

◆ m_useTopologyRescaling

bool Analysis::CalibrationDataInterfaceROOT::m_useTopologyRescaling {}
private

specify whether or not to use MC/MC (topology) scale factors (also this steering option may be removed)

Definition at line 455 of file CalibrationDataInterfaceROOT.h.

455{};

◆ m_verbose

bool Analysis::CalibrationDataInterfaceROOT::m_verbose {}
private

if true, allow also for some informational (and not only error/warning) messages

Definition at line 444 of file CalibrationDataInterfaceROOT.h.

444{};

The documentation for this class was generated from the following files: