ATLAS Offline Software
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
Analysis::CalibrationDataInterfaceBase Class Referenceabstract

#include <CalibrationDataInterfaceBase.h>

Inheritance diagram for Analysis::CalibrationDataInterfaceBase:
Collaboration diagram for Analysis::CalibrationDataInterfaceBase:

Public Types

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

Public Member Functions

 CalibrationDataInterfaceBase ()
 
virtual ~CalibrationDataInterfaceBase ()=0
 default destructor More...
 
const std::string & EffCalibrationName (const std::string &flavour, unsigned int mapIndex=0) const
 Main interface methods accessing the flavour tagging performance information. More...
 
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 More...
 
std::string getBasename (const std::string &name) const
 auxiliary function for retrieval of name within the directory More...
 
double combinedUncertainty (double stat, const std::pair< double, double > &syst) const
 utility function for combination of statistical and (a priori asymmetric) systematic uncertainty. More...
 

Protected Attributes

std::string m_taggerName
 tagging algorithm name More...
 

Private Attributes

std::map< std::string, std::vector< std::string > > m_calibrationEffNames
 this simply collects the per-flavour properties. More...
 
std::map< std::string, std::string > m_calibrationSFNames
 

Detailed Description

This class provides some common functionality for other classes wishing to access Flavour Tagging performance estimates.

Author
Frank Filthaut F.Fil.nosp@m.thau.nosp@m.t@sci.nosp@m.ence.nosp@m..ru.n.nosp@m.l

Definition at line 47 of file CalibrationDataInterfaceBase.h.

Member Enumeration Documentation

◆ variableType

known variable types that can be used as function arguments

Enumerator
kEta 
kAbsEta 
kPt 

Definition at line 67 of file CalibrationDataInterfaceBase.h.

67 { kEta, kAbsEta, kPt };

Constructor & Destructor Documentation

◆ CalibrationDataInterfaceBase()

Analysis::CalibrationDataInterfaceBase::CalibrationDataInterfaceBase ( )

◆ ~CalibrationDataInterfaceBase()

Analysis::CalibrationDataInterfaceBase::~CalibrationDataInterfaceBase ( )
pure virtual

default destructor

Definition at line 41 of file CalibrationDataInterfaceBase.cxx.

42 {}

Member Function Documentation

◆ combinedUncertainty()

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

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

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 }

◆ getBasename()

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

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 }

◆ getContainername()

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

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 }

◆ setEffCalibrationNames()

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

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)

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

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_calibrationEffNames

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

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
private

Definition at line 73 of file CalibrationDataInterfaceBase.h.

◆ m_taggerName

std::string Analysis::CalibrationDataInterfaceBase::m_taggerName
protected

tagging algorithm name

Definition at line 94 of file CalibrationDataInterfaceBase.h.


The documentation for this class was generated from the following files:
Analysis::CalibrationDataInterfaceBase::m_calibrationEffNames
std::map< std::string, std::vector< std::string > > m_calibrationEffNames
this simply collects the per-flavour properties.
Definition: CalibrationDataInterfaceBase.h:72
Analysis::CalibrationDataInterfaceBase::kAbsEta
@ kAbsEta
Definition: CalibrationDataInterfaceBase.h:67
Analysis::CalibrationDataInterfaceBase::m_calibrationSFNames
std::map< std::string, std::string > m_calibrationSFNames
Definition: CalibrationDataInterfaceBase.h:73
TRT_PAI_gasdata::SF
const float SF[NF]
Cross sections for Fluor.
Definition: TRT_PAI_gasdata.h:285
MakeFileForReductions.largest
float largest
Definition: MakeFileForReductions.py:95
Analysis::CalibrationDataInterfaceBase::kEta
@ kEta
Definition: CalibrationDataInterfaceBase.h:67
python.subdetectors.mmg.names
names
Definition: mmg.py:8
beamspotman.stat
stat
Definition: beamspotman.py:266
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
DiTauMassTools::MaxHistStrategyV2::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:26
Analysis::CalibrationDataInterfaceBase::kPt
@ kPt
Definition: CalibrationDataInterfaceBase.h:67