ATLAS Offline Software
Loading...
Searching...
No Matches
TauAnalysisTools::CommonDiTauEfficiencyTool Class Reference

#include <CommonDiTauEfficiencyTool.h>

Inheritance diagram for TauAnalysisTools::CommonDiTauEfficiencyTool:
Collaboration diagram for TauAnalysisTools::CommonDiTauEfficiencyTool:

Public Member Functions

 CommonDiTauEfficiencyTool (const std::string &sName)
 Create a proper constructor for Athena.
 ~CommonDiTauEfficiencyTool ()
virtual StatusCode initialize () override
 Dummy implementation of the initialisation function.
virtual CP::CorrectionCode getEfficiencyScaleFactor (const xAOD::DiTauJet &xDiTau, double &dEfficiencyScaleFactor) override
 Get the Efficiency Scale Factor of ditau jet.
virtual CP::CorrectionCode applyEfficiencyScaleFactor (const xAOD::DiTauJet &xDiTau) override
 Get the Efficiency Scale Factor of ditau jet.
void ReadInputs (std::unique_ptr< TFile > &fFile)
CP::CorrectionCode getValue (const std::string &sHistName, const xAOD::DiTauJet &xDiTau, double &dEfficiencyScaleFactor) const
 Get the scale factor from a particular recommendations histogram.
void generateSystematicSets ()
 generate a set of relevant systematic variations to be applied
virtual CP::CorrectionCode getEfficiencyScaleFactor (const xAOD::TauJet &tau, double &dEfficiencyScaleFactor, unsigned int iRunNumber=0)
 Declare the interface that the class provides.
virtual CP::CorrectionCode applyEfficiencyScaleFactor (const xAOD::TauJet &xTau, unsigned int iRunNumber=0)
 Decorate the tau with its efficiency.
virtual CP::CorrectionCode getValue (const std::string &sHistName, const xAOD::TauJet &xTau, double &dEfficiencyScaleFactor) const
virtual bool isAffectedBySystematic (const CP::SystematicVariation &systematic) const
 returns: whether this tool is affected by the given systematics
virtual CP::SystematicSet affectingSystematics () const
 returns: the list of all systematics this tool can be affected by
virtual CP::SystematicSet recommendedSystematics () const
 returns: the list of all systematics this tool recommends to use
virtual StatusCode applySystematicVariation (const CP::SystematicSet &sSystematicSet)
 configure this tool for the given list of systematic variations.
virtual bool isSupportedRunNumber (int) const
 check if run number is supported in recommendations
virtual void print () const
 Print the state of the tool.
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const
Additional helper functions, not directly mimicking Athena
template<class T>
const T * getProperty (const std::string &name) const
 Get one of the tool's properties.
const std::string & msg_level_name () const __attribute__((deprecated))
 A deprecated function for getting the message level's name.
const std::string & getName (const void *ptr) const
 Get the name of an object that is / should be in the event store.
SG::sgkey_t getKey (const void *ptr) const
 Get the (hashed) key of an object that is in the event store.

Public Attributes

double(* m_fXDiTau )(const xAOD::DiTauJet &xDiTau)
 scale factor bin x (e.g.
double(* m_fYDiTau )(const xAOD::DiTauJet &xDiTau)
 scale factor bin y (e.g.
double(* m_fZDiTau )(const xAOD::DiTauJet &xDiTau)
 scale factor bin z (e.g.
bool m_bSFIsAvailableDiTau
 true if scale factor name is already decorated
bool m_bSFIsAvailableCheckedDiTau
 true if cale factor name is already decorated has already been checked

Protected Types

typedef std::tuple< TObject *, CP::CorrectionCode(*)(const TObject *oObject, double &dEfficiencyScaleFactor, double dVars[]) > tTupleObjectFunc
typedef std::map< std::string, tTupleObjectFunctSFMAP

Protected Member Functions

std::string ConvertProngToString (const int iProngness) const
std::string ConvertDecayModeToString (const int iDecayMode) const
void ReadInputs (const TFile &fFile)
void addHistogramToSFMap (TKey *kKey, const std::string &sKeyName)
void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Static Protected Member Functions

static CP::CorrectionCode getValueTH1 (const TObject *oObject, double &dEfficiencyScaleFactor, double dVars[])
static CP::CorrectionCode getValueTH2 (const TObject *oObject, double &dEfficiencyScaleFactor, double dVars[])
static CP::CorrectionCode getValueTF1 (const TObject *oObject, double &dEfficiencyScaleFactor, double dVars[])

Protected Attributes

std::unique_ptr< tSFMAPm_mSF
std::unordered_map< CP::SystematicSet, std::string > m_mSystematicSets
const CP::SystematicSetm_sSystematicSet
std::map< std::string, int > m_mSystematics
std::map< std::string, std::string > m_mSystematicsHistNames
std::function< double(const xAOD::TauJet &xTau)> m_fX
std::function< double(const xAOD::TauJet &xTau)> m_fY
CP::SystematicSet m_sAffectingSystematics
CP::SystematicSet m_sRecommendedSystematics
Gaudi::Property< std::string > m_sInputFilePath {this, "InputFilePath", ""}
Gaudi::Property< std::string > m_sVarName {this, "VarName", ""}
Gaudi::Property< std::string > m_sWP {this, "WP", ""}
Gaudi::Property< bool > m_bSkipTruthMatchCheck {this, "SkipTruthMatchCheck", false}
Gaudi::Property< int > m_iJetIDLevel {this, "JetIDLevel", static_cast<int>(JETIDNONE)}
Gaudi::Property< int > m_iEleIDLevel {this, "EleIDLevel", static_cast<int>(ELEIDNONE)}
Gaudi::Property< bool > m_bUseTauSubstructure {this, "UseTauSubstructure", false}
Gaudi::Property< bool > m_doTauTrig {this, "DoTauTrig", false}
std::string m_sInputFileName
std::string m_sSFHistName
bool m_bNoMultiprong
TruthMatchedParticleType m_eCheckTruth
bool m_bSFIsAvailable
bool m_bSFIsAvailableChecked

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Definition at line 38 of file CommonDiTauEfficiencyTool.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

◆ tSFMAP

typedef std::map<std::string, tTupleObjectFunc > TauAnalysisTools::CommonEfficiencyTool::tSFMAP
protectedinherited

Definition at line 88 of file CommonEfficiencyTool.h.

◆ tTupleObjectFunc

typedef std::tuple<TObject*, CP::CorrectionCode (*)(const TObject* oObject, double& dEfficiencyScaleFactor, double dVars[] ) > TauAnalysisTools::CommonEfficiencyTool::tTupleObjectFunc
protectedinherited

Definition at line 87 of file CommonEfficiencyTool.h.

Constructor & Destructor Documentation

◆ CommonDiTauEfficiencyTool()

CommonDiTauEfficiencyTool::CommonDiTauEfficiencyTool ( const std::string & sName)

Create a proper constructor for Athena.

Definition at line 19 of file CommonDiTauEfficiencyTool.cxx.

20 : CommonEfficiencyTool( sName )
26{
27}
double(* m_fXDiTau)(const xAOD::DiTauJet &xDiTau)
scale factor bin x (e.g.
bool m_bSFIsAvailableDiTau
true if scale factor name is already decorated
double(* m_fZDiTau)(const xAOD::DiTauJet &xDiTau)
scale factor bin z (e.g.
bool m_bSFIsAvailableCheckedDiTau
true if cale factor name is already decorated has already been checked
double(* m_fYDiTau)(const xAOD::DiTauJet &xDiTau)
scale factor bin y (e.g.
CommonEfficiencyTool(const std::string &sName)
Create a proper constructor for Athena.
double TruthSubleadPt(const xAOD::DiTauJet &xDiTau)
return the truth vis pT of the subleading pT matched particle.
double TruthDeltaR(const xAOD::DiTauJet &xDiTau)
return the dR of between the leading and subleading pT matched particle.
double TruthLeadPt(const xAOD::DiTauJet &xDiTau)
return the truth vis pT of the leading pT matched particle.

◆ ~CommonDiTauEfficiencyTool()

CommonDiTauEfficiencyTool::~CommonDiTauEfficiencyTool ( )

Definition at line 29 of file CommonDiTauEfficiencyTool.cxx.

30{
31}

Member Function Documentation

◆ addHistogramToSFMap()

void CommonEfficiencyTool::addHistogramToSFMap ( TKey * kKey,
const std::string & sKeyName )
protectedinherited

Definition at line 537 of file CommonEfficiencyTool.cxx.

538{
539 // handling for the 3 different input types TH1F/TH1D/TF1, function pointer
540 // handle the access methods for the final scale factor retrieval
541 TClass *cClass = gROOT->GetClass(kKey->GetClassName());
542 if (cClass->InheritsFrom("TH2"))
543 {
544 TH1* oObject = (TH1*)kKey->ReadObj();
545 oObject->SetDirectory(0);
546 (*m_mSF)[sKeyName] = tTupleObjectFunc(oObject,&getValueTH2);
547 ATH_MSG_DEBUG("added histogram with name "<<sKeyName);
548 }
549 else if (cClass->InheritsFrom("TH1"))
550 {
551 TH1* oObject = (TH1*)kKey->ReadObj();
552 oObject->SetDirectory(0);
553 (*m_mSF)[sKeyName] = tTupleObjectFunc(oObject,&getValueTH1);
554 ATH_MSG_DEBUG("added histogram with name "<<sKeyName);
555 }
556 else if (cClass->InheritsFrom("TF1"))
557 {
558 TObject* oObject = kKey->ReadObj();
559 (*m_mSF)[sKeyName] = tTupleObjectFunc(oObject,&getValueTF1);
560 ATH_MSG_DEBUG("added function with name "<<sKeyName);
561 }
562 else
563 {
564 ATH_MSG_DEBUG("ignored object with name "<<sKeyName);
565 }
566}
#define ATH_MSG_DEBUG(x)
static CP::CorrectionCode getValueTH1(const TObject *oObject, double &dEfficiencyScaleFactor, double dVars[])
std::tuple< TObject *, CP::CorrectionCode(*)(const TObject *oObject, double &dEfficiencyScaleFactor, double dVars[]) > tTupleObjectFunc
static CP::CorrectionCode getValueTH2(const TObject *oObject, double &dEfficiencyScaleFactor, double dVars[])
static CP::CorrectionCode getValueTF1(const TObject *oObject, double &dEfficiencyScaleFactor, double dVars[])

◆ affectingSystematics()

CP::SystematicSet CommonEfficiencyTool::affectingSystematics ( ) const
virtualinherited

returns: the list of all systematics this tool can be affected by

Implements CP::IReentrantSystematicsTool.

Definition at line 312 of file CommonEfficiencyTool.cxx.

313{
315}

◆ applyEfficiencyScaleFactor() [1/2]

CP::CorrectionCode CommonDiTauEfficiencyTool::applyEfficiencyScaleFactor ( const xAOD::DiTauJet & xDiTau)
overridevirtual

Get the Efficiency Scale Factor of ditau jet.

Parameters
xDiTau
Returns
CP::CorrectionCode

Implements TauAnalysisTools::IDiTauEfficiencyCorrectionsTool.

Definition at line 161 of file CommonDiTauEfficiencyTool.cxx.

162{
163 double dSf = 0.;
164
165 SG::Decorator< double > decor (m_sVarName);
167 {
168 m_bSFIsAvailableDiTau = decor.isAvailable(xDiTau);
171 {
172 ATH_MSG_DEBUG(m_sVarName << " decoration is available on first ditau processed, switched of applyEfficiencyScaleFactor for further ditaus.");
173 ATH_MSG_DEBUG("If an application of efficiency scale factors needs to be redone, please pass a shallow copy of the original ditau.");
174 }
175 }
178
179 // retrieve scale factor
180 CP::CorrectionCode tmpCorrectionCode = getEfficiencyScaleFactor(xDiTau, dSf);
181 // adding scale factor to tau as decoration
182 decor(xDiTau) = dSf;
183
184 return tmpCorrectionCode;
185}
@ Ok
The correction was done successfully.
virtual CP::CorrectionCode getEfficiencyScaleFactor(const xAOD::DiTauJet &xDiTau, double &dEfficiencyScaleFactor) override
Get the Efficiency Scale Factor of ditau jet.
Gaudi::Property< std::string > m_sVarName

◆ applyEfficiencyScaleFactor() [2/2]

CP::CorrectionCode CommonEfficiencyTool::applyEfficiencyScaleFactor ( const xAOD::TauJet & xTau,
unsigned int iRunNumber = 0 )
virtual

Decorate the tau with its efficiency.

Reimplemented from TauAnalysisTools::CommonEfficiencyTool.

Definition at line 58 of file CommonEfficiencyTool.cxx.

272{
273 double dSf = 0.;
274
275 SG::Decorator< double > decor (m_sVarName);
277 {
278 m_bSFIsAvailable = decor.isAvailable(xTau);
281 {
282 ATH_MSG_DEBUG(m_sVarName << " decoration is available on first tau processed, switched off applyEfficiencyScaleFactor for further taus.");
283 ATH_MSG_DEBUG("If an application of efficiency scale factors needs to be redone, please pass a shallow copy of the original tau.");
284 }
285 }
288
289 // retrieve scale factor
290 CP::CorrectionCode tmpCorrectionCode = getEfficiencyScaleFactor(xTau, dSf, iRunNumber);
291 // adding scale factor to tau as decoration
292 decor(xTau) = dSf;
293
294 return tmpCorrectionCode;
295}

◆ applySystematicVariation()

StatusCode CommonEfficiencyTool::applySystematicVariation ( const CP::SystematicSet & sSystematicSet)
virtualinherited

configure this tool for the given list of systematic variations.

any requested systematics that are not affecting this tool will be silently ignored

Implements CP::ISystematicsTool.

Definition at line 337 of file CommonEfficiencyTool.cxx.

338{
339
340 // first check if we already know this systematic configuration
341 auto itSystematicSet = m_mSystematicSets.find(sSystematicSet);
342 if (itSystematicSet != m_mSystematicSets.end())
343 {
344 m_sSystematicSet = &itSystematicSet->first;
345 return StatusCode::SUCCESS;
346 }
347
348 // sanity checks if systematic set is supported
349 double dDirection = 0.;
350 CP::SystematicSet sSystematicSetAvailable;
351 for (auto sSyst : sSystematicSet)
352 {
353 // check if systematic is available
354 auto it = m_mSystematicsHistNames.find(sSyst.basename());
355 if (it == m_mSystematicsHistNames.end())
356 {
357 ATH_MSG_VERBOSE("unsupported systematic variation: "<< sSyst.basename()<<"; skipping this one");
358 continue;
359 }
360
361
362 if (sSyst.parameter() * dDirection < 0)
363 {
364 ATH_MSG_ERROR("unsupported set of systematic variations, you should either use only \"UP\" or only \"DOWN\" systematics in one set!");
365 ATH_MSG_ERROR("systematic set will not be applied");
366 return StatusCode::FAILURE;
367 }
368 dDirection = sSyst.parameter();
369
370 if ((m_sRecommendedSystematics.find(sSyst.basename()) != m_sRecommendedSystematics.end()) and sSystematicSet.size() > 1)
371 {
372 ATH_MSG_ERROR("unsupported set of systematic variations, you should not combine \"TAUS_{TRUE|FAKE}_EFF_*_TOTAL\" with other systematic variations!");
373 ATH_MSG_ERROR("systematic set will not be applied");
374 return StatusCode::FAILURE;
375 }
376
377 // finally add the systematic to the set of systematics to process
378 sSystematicSetAvailable.insert(sSyst);
379 }
380
381 // store this calibration for future use, and make it current
382 m_sSystematicSet = &m_mSystematicSets.insert(std::pair<CP::SystematicSet,std::string>(sSystematicSetAvailable, sSystematicSet.name())).first->first;
383
384 return StatusCode::SUCCESS;
385}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_VERBOSE(x)
void insert(const SystematicVariation &systematic)
description: insert a systematic into the set
std::unordered_map< CP::SystematicSet, std::string > m_mSystematicSets
std::map< std::string, std::string > m_mSystematicsHistNames

◆ ConvertDecayModeToString()

std::string CommonEfficiencyTool::ConvertDecayModeToString ( const int iDecayMode) const
protectedinherited

Definition at line 397 of file CommonEfficiencyTool.cxx.

398{
399 switch(iDecayMode)
400 {
402 return "_r1p0n";
404 return "_r1p1n";
406 return "_r1pXn";
408 return "_r3p0n";
410 return "_r3pXn";
411 default:
412 return "";
413 }
414}

◆ ConvertProngToString()

std::string CommonEfficiencyTool::ConvertProngToString ( const int iProngness) const
protectedinherited

Definition at line 388 of file CommonEfficiencyTool.cxx.

389{
390 return fProngness == 1 ? "_1p" : "_3p";
391}

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ generateSystematicSets()

void CommonDiTauEfficiencyTool::generateSystematicSets ( )

generate a set of relevant systematic variations to be applied

Definition at line 241 of file CommonDiTauEfficiencyTool.cxx.

242{
243 // creation of basic string for all NPs, e.g. "TAUS_TRUEHADTAU_EFF_RECO_"
244 std::vector<std::string> vSplitInputFilePath = {};
245 split(m_sInputFileName,'_',vSplitInputFilePath);
246 std::string sEfficiencyType = vSplitInputFilePath.at(0);
247 std::string sTruthType = vSplitInputFilePath.at(1);
248 std::transform(sEfficiencyType.begin(), sEfficiencyType.end(), sEfficiencyType.begin(), toupper);
249 std::transform(sTruthType.begin(), sTruthType.end(), sTruthType.begin(), toupper);
250 std::string sSystematicBaseString = "TAUS_"+sTruthType+"_EFF_"+sEfficiencyType+"_";
251 // set truth type to check for in truth matching
252 if (sTruthType=="TRUEHADTAU") m_eCheckTruth = TauAnalysisTools::TruthHadronicTau;
253 if (sTruthType=="TRUEHADDITAU") m_eCheckTruth = TauAnalysisTools::TruthHadronicDiTau;
254
255 for (auto mSF : *m_mSF)
256 {
257 // parse for nuisance parameter in histogram name
258 std::vector<std::string> vSplitNP = {};
259 split(mSF.first,'_',vSplitNP);
260 std::string sNP = vSplitNP.at(0);
261 std::string sNPUppercase = vSplitNP.at(0);
262 // skip nominal scale factors
263 if (sNP == "sf") continue;
264 // test if NP starts with a capital letter indicating that this should be recommended
265 bool bIsRecommended = false;
266 if (isupper(sNP.at(0)))
267 bIsRecommended = true;
268 // make sNP uppercase and build final NP entry name
269 std::transform(sNPUppercase.begin(), sNPUppercase.end(), sNPUppercase.begin(), toupper);
270 std::string sSystematicString = sSystematicBaseString+sNPUppercase;
271 // add all found systematics to the AffectingSystematics
272 m_sAffectingSystematics.insert(CP::SystematicVariation (sSystematicString, 1));
273 m_sAffectingSystematics.insert(CP::SystematicVariation (sSystematicString, -1));
274 // only add found uppercase systematics to the RecommendedSystematics
275 if (bIsRecommended)
276 {
277 m_sRecommendedSystematics.insert(CP::SystematicVariation (sSystematicString, 1));
278 m_sRecommendedSystematics.insert(CP::SystematicVariation (sSystematicString, -1));
279 }
280 ATH_MSG_DEBUG("connected base name " << sNP << " with systematic " <<sSystematicString);
281 m_mSystematicsHistNames.insert({sSystematicString,sNP});
282 }
283}
void split(const std::string &sInput, const char cDelim, std::vector< std::string > &vOut)

◆ getEfficiencyScaleFactor() [1/2]

CP::CorrectionCode CommonDiTauEfficiencyTool::getEfficiencyScaleFactor ( const xAOD::DiTauJet & xDiTau,
double & dEfficiencyScaleFactor )
overridevirtual

Get the Efficiency Scale Factor of ditau jet.

Parameters
xDiTau: reco DiTauJet
dEfficiencyScaleFactor: reference to output variable where efficiency is returned
Returns
CP::CorrectionCode

Implements TauAnalysisTools::IDiTauEfficiencyCorrectionsTool.

Definition at line 84 of file CommonDiTauEfficiencyTool.cxx.

86{
87 // check which true state is requestet
89 {
90 dEfficiencyScaleFactor = 1.;
92 }
93
94 CP::CorrectionCode tmpCorrectionCode = getValue(m_sSFHistName,
95 xDiTau,
96 dEfficiencyScaleFactor);
97 // return correction code if histogram is not available
98 if (tmpCorrectionCode != CP::CorrectionCode::Ok)
99 return tmpCorrectionCode;
100
101 // skip further process if systematic set is empty
102 if (m_sSystematicSet->size() == 0)
104
105 // get uncertainties summed in quadrature
106 double dTotalSystematic2 = 0.;
107 double dDirection = 0.;
108 for (auto syst : *m_sSystematicSet)
109 {
110
111 // check if systematic is available
112 auto it = m_mSystematicsHistNames.find(syst.basename());
113
114 // get uncertainty value
115 double dUncertaintySyst = 0.;
116
117 // needed for up/down decision
118 dDirection = syst.parameter();
119
120 // build up histogram name
121 std::string sHistName = it->second;
122 if (dDirection>0) sHistName+="_up";
123 else sHistName+="_down";
124 if (!m_sWP.empty()) sHistName+="_"+m_sWP;
125
126 // get the uncertainty from the histogram
127 tmpCorrectionCode = getValue(sHistName,
128 xDiTau,
129 dUncertaintySyst);
130
131 // return correction code if histogram is not available
132 if (tmpCorrectionCode != CP::CorrectionCode::Ok)
133 return tmpCorrectionCode;
134
135 // scale uncertainty with direction, i.e. +/- n*sigma
136 dUncertaintySyst *= dDirection;
137
138 // square uncertainty and add to total uncertainty
139 dTotalSystematic2 += dUncertaintySyst * dUncertaintySyst;
140 }
141
142 // now use dDirection to use up/down uncertainty
143 dDirection = (dDirection > 0.) ? 1. : -1.;
144
145 // finally apply uncertainty (eff * ( 1 +/- \sum )
146 dEfficiencyScaleFactor *= 1. + dDirection * std::sqrt(dTotalSystematic2);
147
149}
CP::CorrectionCode getValue(const std::string &sHistName, const xAOD::DiTauJet &xDiTau, double &dEfficiencyScaleFactor) const
Get the scale factor from a particular recommendations histogram.
TruthMatchedParticleType getTruthParticleType(const xAOD::TauJet &xTau)
return TauJet match type

◆ getEfficiencyScaleFactor() [2/2]

CP::CorrectionCode CommonEfficiencyTool::getEfficiencyScaleFactor ( const xAOD::TauJet & xTau,
double & eff,
unsigned int iRunNumber = 0 )
virtual

Declare the interface that the class provides.

Get the tau efficiency scale factor

Reimplemented from TauAnalysisTools::CommonEfficiencyTool.

Definition at line 55 of file CommonEfficiencyTool.cxx.

143{
144 // check which true state is requested
146 {
147 dEfficiencyScaleFactor = 1.;
149 }
150
151 // check if 1 prong
152 if (m_bNoMultiprong && xTau.nTracks() != 1)
153 {
154 dEfficiencyScaleFactor = 1.;
156 }
157
158 // get decay mode or prong extension for histogram name
159 std::string sMode;
161 {
162 int iDecayMode = -1;
164 sMode = ConvertDecayModeToString(iDecayMode);
165 if (sMode.empty())
166 {
167 ATH_MSG_WARNING("Found tau with unknown decay mode. Skip efficiency correction.");
169 }
170 }
171 else
172 {
173 // skip taus which are not 1 or 3 prong
174 if( xTau.nTracks() != 1 && xTau.nTracks() != 3) {
175 dEfficiencyScaleFactor = 1.;
177 }
178
179 sMode = ConvertProngToString(xTau.nTracks());
180 }
181
182 std::string sHistName;
183 if(m_doTauTrig){
184 sHistName = "sf_all_"+m_sWP+sMode;
185 } else {
186 sHistName = m_sSFHistName + sMode;
187 }
188
189 // get standard scale factor
190 CP::CorrectionCode tmpCorrectionCode = getValue(sHistName,
191 xTau,
192 dEfficiencyScaleFactor);
193 // return correction code if histogram is not available
194 if (tmpCorrectionCode != CP::CorrectionCode::Ok)
195 return tmpCorrectionCode;
196
197 // skip further process if systematic set is empty
198 if (m_sSystematicSet->empty())
200
201 // get uncertainties summed in quadrature
202 double dTotalSystematic2 = 0.;
203 double dDirection = 0.;
204 for (auto syst : *m_sSystematicSet)
205 {
206 // check if systematic is available
207 auto it = m_mSystematicsHistNames.find(syst.basename());
208
209 // get uncertainty value
210 double dUncertaintySyst = 0.;
211
212 // needed for up/down decision
213 dDirection = syst.parameter();
214
215 // build up histogram name
216 sHistName = it->second;
217 if (dDirection>0.) sHistName+="_up";
218 else sHistName+="_down";
219
220 if(m_doTauTrig){ sHistName+="_all"; }
221
222 if (!m_sWP.empty()) sHistName+="_"+m_sWP;
223 sHistName += sMode;
224
225
226 // filter unwanted combinations
227 if( (sHistName.find("3P") != std::string::npos && sHistName.find("1p") != std::string::npos) ||
228 (sHistName.find("1P") != std::string::npos && sHistName.find("3p") != std::string::npos))
229 continue;
230
231 if( (sHistName.find("1520") != std::string::npos && sHistName.find("loose") != std::string::npos) ){
232 continue;
233 }
234
235 // get the uncertainty from the histogram
236 tmpCorrectionCode = getValue(sHistName,
237 xTau,
238 dUncertaintySyst);
239
240 // return correction code if histogram is not available
241 if (tmpCorrectionCode != CP::CorrectionCode::Ok)
242 return tmpCorrectionCode;
243
244 // scale uncertainty with direction, i.e. +/- n*sigma
245 dUncertaintySyst *= dDirection;
246
247 // square uncertainty and add to total uncertainty
248 dTotalSystematic2 += dUncertaintySyst * dUncertaintySyst;
249 }
250
251 // now use dDirection to use up/down uncertainty
252 dDirection = (dDirection > 0.) ? 1. : -1.;
253
254 // finally apply uncertainty (eff * ( 1 +/- \sum )
255 dEfficiencyScaleFactor *= 1. + dDirection * std::sqrt(dTotalSystematic2);
256
258}
#define ATH_MSG_WARNING(x)
@ OutOfValidityRange
Input object is out of validity range.
std::string ConvertDecayModeToString(const int iDecayMode) const
std::string ConvertProngToString(const int iProngness) const
bool panTauDetail(TauJetParameters::PanTauDetails panTauDetail, int &value) const
Get and set values of pantau details variables via enum.
size_t nTracks(TauJetParameters::TauTrackFlag flag=TauJetParameters::TauTrackFlag::classifiedCharged) const

◆ getKey()

SG::sgkey_t asg::AsgTool::getKey ( const void * ptr) const
inherited

Get the (hashed) key of an object that is in the event store.

This is a bit of a special one. StoreGateSvc and xAOD::TEvent both provide ways for getting the SG::sgkey_t key for an object that is in the store, based on a bare pointer. But they provide different interfaces for doing so.

In order to allow tools to efficiently perform this operation, they can use this helper function.

See also
asg::AsgTool::getName
Parameters
ptrThe bare pointer to the object that the event store should know about
Returns
The hashed key of the object in the store. If not found, an invalid (zero) key.

Definition at line 119 of file AsgTool.cxx.

119 {
120
121#ifdef XAOD_STANDALONE
122 // In case we use @c xAOD::TEvent, we have a direct function call
123 // for this.
124 return evtStore()->event()->getKey( ptr );
125#else
126 const SG::DataProxy* proxy = evtStore()->proxy( ptr );
127 return ( proxy == nullptr ? 0 : proxy->sgkey() );
128#endif // XAOD_STANDALONE
129 }
ServiceHandle< StoreGateSvc > & evtStore()

◆ getName()

const std::string & asg::AsgTool::getName ( const void * ptr) const
inherited

Get the name of an object that is / should be in the event store.

This is a bit of a special one. StoreGateSvc and xAOD::TEvent both provide ways for getting the std::string name for an object that is in the store, based on a bare pointer. But they provide different interfaces for doing so.

In order to allow tools to efficiently perform this operation, they can use this helper function.

See also
asg::AsgTool::getKey
Parameters
ptrThe bare pointer to the object that the event store should know about
Returns
The string name of the object in the store. If not found, an empty string.

Definition at line 106 of file AsgTool.cxx.

106 {
107
108#ifdef XAOD_STANDALONE
109 // In case we use @c xAOD::TEvent, we have a direct function call
110 // for this.
111 return evtStore()->event()->getName( ptr );
112#else
113 const SG::DataProxy* proxy = evtStore()->proxy( ptr );
114 static const std::string dummy = "";
115 return ( proxy == nullptr ? dummy : proxy->name() );
116#endif // XAOD_STANDALONE
117 }

◆ getProperty()

template<class T>
const T * asg::AsgTool::getProperty ( const std::string & name) const
inherited

Get one of the tool's properties.

◆ getValue() [1/2]

CP::CorrectionCode CommonDiTauEfficiencyTool::getValue ( const std::string & sHistName,
const xAOD::DiTauJet & xDiTau,
double & dEfficiencyScaleFactor ) const

Get the scale factor from a particular recommendations histogram.

Parameters
sHistName
xDiTau
dEfficiencyScaleFactor
Returns
CP::CorrectionCode

Definition at line 290 of file CommonDiTauEfficiencyTool.cxx.

293{
294 const tSFMAP& mSF = *m_mSF;
295 auto it = mSF.find (sHistName);
296 if (it == mSF.end())
297 {
298 ATH_MSG_ERROR("Object with name "<<sHistName<<" was not found in input file.");
299 ATH_MSG_DEBUG("Content of input file");
300 for (auto eEntry : mSF)
301 ATH_MSG_DEBUG(" Entry: "<<eEntry.first);
303 }
304
305 // get a tuple (TObject*,functionPointer) from the scale factor map
306 tTupleObjectFunc tTuple = it->second;
307
308 // get pt and eta (for x and y axis respectively)
309 double dX = m_fXDiTau(xDiTau);
310 double dY = m_fYDiTau(xDiTau);
311 double dZ = m_fZDiTau(xDiTau);
312
313 double dVars[3] = {dX, dY, dZ};
314 // finally obtain efficiency scale factor from TH1F/TH1D/TF1, by calling the
315 // function pointer stored in the tuple from the scale factor map
316 return (std::get<1>(tTuple))(std::get<0>(tTuple), dEfficiencyScaleFactor, dVars);
317}
@ Error
Some error happened during the object correction.
std::map< std::string, tTupleObjectFunc > tSFMAP

◆ getValue() [2/2]

CP::CorrectionCode CommonEfficiencyTool::getValue ( const std::string & sHistName,
const xAOD::TauJet & xTau,
double & dEfficiencyScaleFactor ) const
virtual

Reimplemented from TauAnalysisTools::CommonEfficiencyTool.

Definition at line 109 of file CommonEfficiencyTool.cxx.

645{
646 const tSFMAP& mSF = *m_mSF;
647 auto it = mSF.find (sHistName);
648 if (it == mSF.end())
649 {
650 ATH_MSG_ERROR("Object with name "<<sHistName<<" was not found in input file.");
651 ATH_MSG_DEBUG("Content of input file");
652 for (auto eEntry : mSF)
653 ATH_MSG_DEBUG(" Entry: "<<eEntry.first);
655 }
656
657 // get a tuple (TObject*,functionPointer) from the scale factor map
658 tTupleObjectFunc tTuple = it->second;
659
660 // get pt and eta (for x and y axis respectively)
661 double dPt = m_fX(xTau);
662 double dEta = m_fY(xTau);
663
664 double dVars[2] = {dPt, dEta};
665
666 // finally obtain efficiency scale factor from TH1F/TH1D/TF1, by calling the
667 // function pointer stored in the tuple from the scale factor map
668 return (std::get<1>(tTuple))(std::get<0>(tTuple), dEfficiencyScaleFactor, dVars);
669}
std::function< double(const xAOD::TauJet &xTau)> m_fY
std::function< double(const xAOD::TauJet &xTau)> m_fX
bool dEta(const xAOD::TauJet &tau, const xAOD::CaloVertexedTopoCluster &cluster, float &out)

◆ getValueTF1()

CP::CorrectionCode CommonEfficiencyTool::getValueTF1 ( const TObject * oObject,
double & dEfficiencyScaleFactor,
double dVars[] )
staticprotectedinherited

Definition at line 739 of file CommonEfficiencyTool.cxx.

741{
742 double dPt = dVars[0];
743 double dEta = dVars[1];
744
745 const TF1* fFunc = static_cast<const TF1*>(oObject);
746
747 if (!fFunc)
748 {
749 // ATH_MSG_ERROR("Problem with casting TObject of type "<<oObject->ClassName()<<" to TF1");
751 }
752
753 // evaluate TFunction and set scale factor
754 dEfficiencyScaleFactor = fFunc->Eval(dPt, dEta);
756}

◆ getValueTH1()

CP::CorrectionCode CommonEfficiencyTool::getValueTH1 ( const TObject * oObject,
double & dEfficiencyScaleFactor,
double dVars[] )
staticprotectedinherited

Definition at line 677 of file CommonEfficiencyTool.cxx.

679{
680 double dPt = dVars[0];
681
682 const TH1* hHist = dynamic_cast<const TH1*>(oObject);
683
684 if (!hHist)
685 {
686 // ATH_MSG_ERROR("Problem with casting TObject of type "<<oObject->ClassName()<<" to TH2F");
688 }
689
690 // protect values from underflow bins
691 dPt = std::max(dPt,hHist->GetXaxis()->GetXmin());
692 // protect values from overflow bins (times .999 to keep it inside last bin)
693 dPt = std::min(dPt,hHist->GetXaxis()->GetXmax() * .999);
694
695 // get bin from TH2 depending on x and y values; finally set the scale factor
696 int iBin = hHist->FindFixBin(dPt);
697 dEfficiencyScaleFactor = hHist->GetBinContent(iBin);
699}

◆ getValueTH2()

CP::CorrectionCode CommonEfficiencyTool::getValueTH2 ( const TObject * oObject,
double & dEfficiencyScaleFactor,
double dVars[] )
staticprotectedinherited

Definition at line 707 of file CommonEfficiencyTool.cxx.

709{
710 double dPt = dVars[0];
711 double dEta = dVars[1];
712
713 const TH2* hHist = dynamic_cast<const TH2*>(oObject);
714
715 if (!hHist)
716 {
717 // ATH_MSG_ERROR("Problem with casting TObject of type "<<oObject->ClassName()<<" to TH2F");
719 }
720
721 // protect values from underflow bins
722 dPt = std::max(dPt,hHist->GetXaxis()->GetXmin());
723 dEta = std::max(dEta,hHist->GetYaxis()->GetXmin());
724 // protect values from overflow bins (times .999 to keep it inside last bin)
725 dPt = std::min(dPt,hHist->GetXaxis()->GetXmax() * .999);
726 dEta = std::min(dEta,hHist->GetYaxis()->GetXmax() * .999);
727
728 // get bin from TH2 depending on x and y values; finally set the scale factor
729 int iBin = hHist->FindFixBin(dPt,dEta);
730 dEfficiencyScaleFactor = hHist->GetBinContent(iBin);
732}

◆ initialize()

StatusCode CommonDiTauEfficiencyTool::initialize ( void )
overridevirtual

Dummy implementation of the initialisation function.

It's here to allow the dual-use tools to skip defining an initialisation function. Since many are doing so...

Reimplemented from TauAnalysisTools::CommonEfficiencyTool.

Definition at line 41 of file CommonDiTauEfficiencyTool.cxx.

42{
43 ATH_MSG_INFO( "Initializing CommonDiTauEfficiencyTool" );
44 // only read in histograms once
45 if (m_mSF==nullptr)
46 {
47 std::string sInputFilePath = PathResolverFindCalibFile(m_sInputFilePath);
48
49 m_mSF = std::make_unique< tSFMAP >();
50 std::unique_ptr< TFile > fSF( TFile::Open( sInputFilePath.c_str(), "READ" ) );
51 if(!fSF)
52 {
53 ATH_MSG_FATAL("Could not open file " << sInputFilePath.c_str());
54 return StatusCode::FAILURE;
55 }
56 ReadInputs(fSF);
57 fSF->Close();
58 }
59
60 // needed later on in generateSystematicSets(), maybe move it there
61 std::vector<std::string> vInputFilePath;
62 split(m_sInputFilePath,'/',vInputFilePath);
63 m_sInputFileName = vInputFilePath.back();
64
66
67 if (m_sWP.size()>0)
68 m_sSFHistName = "sf_"+m_sWP;
69
70 // load empty systematic variation by default
71 if (applySystematicVariation(CP::SystematicSet()) != StatusCode::SUCCESS )
72 return StatusCode::FAILURE;
73
74 return StatusCode::SUCCESS;
75}
#define ATH_MSG_FATAL(x)
#define ATH_MSG_INFO(x)
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
void generateSystematicSets()
generate a set of relevant systematic variations to be applied
void ReadInputs(std::unique_ptr< TFile > &fFile)
virtual StatusCode applySystematicVariation(const CP::SystematicSet &sSystematicSet)
configure this tool for the given list of systematic variations.
Gaudi::Property< std::string > m_sInputFilePath

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ isAffectedBySystematic()

bool CommonEfficiencyTool::isAffectedBySystematic ( const CP::SystematicVariation & systematic) const
virtualinherited

returns: whether this tool is affected by the given systematics

Implements CP::ISystematicsTool.

Definition at line 301 of file CommonEfficiencyTool.cxx.

302{
303 CP::SystematicSet sys = affectingSystematics();
304 return sys.find(systematic) != sys.end();
305}
virtual CP::SystematicSet affectingSystematics() const
returns: the list of all systematics this tool can be affected by

◆ isSupportedRunNumber()

virtual bool TauAnalysisTools::CommonEfficiencyTool::isSupportedRunNumber ( int iRunNumber) const
inlinevirtualinherited

check if run number is supported in recommendations

Implements TauAnalysisTools::ITauEfficiencyCorrectionsTool.

Definition at line 74 of file CommonEfficiencyTool.h.

75 {
76 return true;
77 };

◆ msg()

MsgStream & AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msg_level_name()

const std::string & asg::AsgTool::msg_level_name ( ) const
inherited

A deprecated function for getting the message level's name.

Instead of using this, weirdly named function, user code should get the string name of the current minimum message level (in case they really need it...), with:

MSG::name( msg().level() )

This function's name doesn't follow the ATLAS coding rules, and as such will be removed in the not too distant future.

Returns
The string name of the current minimum message level that's printed

Definition at line 101 of file AsgTool.cxx.

101 {
102
103 return MSG::name( msg().level() );
104 }
MsgStream & msg() const
const std::string & name(Level lvl)
Convenience function for translating message levels to strings.
Definition MsgLevel.cxx:19

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ print()

◆ ReadInputs() [1/2]

void CommonDiTauEfficiencyTool::ReadInputs ( std::unique_ptr< TFile > & fFile)

Definition at line 189 of file CommonDiTauEfficiencyTool.cxx.

190{
191 m_mSF->clear();
192
193 // initialize function pointer
197
198 TKey *kKey;
199 TIter itNext(fFile->GetListOfKeys());
200 while ((kKey = (TKey*)itNext()))
201 {
202 // parse file content for objects of type TNamed, check their title for
203 // known strings and reset funtion pointer
204 std::string sKeyName = kKey->GetName();
205
206 std::vector<std::string> vSplitName = {};
207 split(sKeyName,'_',vSplitName);
208 if (vSplitName[0] == "sf")
209 {
210 addHistogramToSFMap(kKey, sKeyName);
211 }
212 else
213 {
214 if (sKeyName.find("_up_") != std::string::npos or sKeyName.find("_down_") != std::string::npos)
215 addHistogramToSFMap(kKey, sKeyName);
216 else
217 {
218 size_t iPos = sKeyName.find('_');
219 addHistogramToSFMap(kKey, sKeyName.substr(0,iPos)+"_up"+sKeyName.substr(iPos));
220 addHistogramToSFMap(kKey, sKeyName.substr(0,iPos)+"_down"+sKeyName.substr(iPos));
221 }
222 }
223 }
224 ATH_MSG_INFO("data loaded from " << fFile->GetName());
225}
void addHistogramToSFMap(TKey *kKey, const std::string &sKeyName)

◆ ReadInputs() [2/2]

void CommonEfficiencyTool::ReadInputs ( const TFile & fFile)
protectedinherited

Definition at line 426 of file CommonEfficiencyTool.cxx.

427{
428 m_mSF->clear();
429
430 // initialize function pointer
431 m_fX = &finalTauPt;
432 m_fY = &finalTauEta;
433
434 TKey *kKey;
435 TIter itNext(fFile.GetListOfKeys());
436 while ((kKey = (TKey*)itNext()))
437 {
438 // parse file content for objects of type TNamed, check their title for
439 // known strings and reset funtion pointer
440 std::string sKeyName = kKey->GetName();
441 if (sKeyName == "Xaxis")
442 {
443 TNamed* tObj = (TNamed*)kKey->ReadObj();
444 std::string sTitle = tObj->GetTitle();
445 delete tObj;
446 if (sTitle == "P" || sTitle == "PFinalCalib")
447 {
448 m_fX = &finalTauP;
449 ATH_MSG_DEBUG("using full momentum for x-axis");
450 }
451 if (sTitle == "TruthDecayMode")
452 {
454 ATH_MSG_DEBUG("using truth decay mode for x-axis");
455 }
456 if (sTitle == "truth pt")
457 {
458 m_fX = &truthTauPt;
459 ATH_MSG_DEBUG("using truth pT for x-axis");
460 }
461 if (sTitle == "|eta|")
462 {
464 ATH_MSG_DEBUG("using absolute tau eta for x-axis");
465 }
466
467 continue;
468 }
469 else if (sKeyName == "Yaxis")
470 {
471 TNamed* tObj = (TNamed*)kKey->ReadObj();
472 std::string sTitle = tObj->GetTitle();
473 delete tObj;
474 if (sTitle == "track-eta")
475 {
477 ATH_MSG_DEBUG("using leading track eta for y-axis");
478 }
479 else if (sTitle == "|eta|")
480 {
482 ATH_MSG_DEBUG("using absolute tau eta for y-axis");
483 }
484 else if (sTitle == "mu")
485 {
486 m_fY = [this](const xAOD::TauJet&) -> double {
487 const xAOD::EventInfo* xEventInfo = nullptr;
488 if (evtStore()->retrieve(xEventInfo,"EventInfo").isFailure()) {
489 return 0;
490 }
491 if (xEventInfo->runNumber()==284500)
492 {
493 return xEventInfo->averageInteractionsPerCrossing();
494 }
495 else if (xEventInfo->runNumber()==300000 || xEventInfo->runNumber()==310000)
496 {
497 return xEventInfo->actualInteractionsPerCrossing();
498 }
499 return 0;
500 };
501 ATH_MSG_DEBUG("using average mu for y-axis");
502 }
503 else if (sTitle == "truth |eta|")
504 {
506 ATH_MSG_DEBUG("using absolute truth tau eta for y-axis");
507 }
508 continue;
509 }
510
511 std::vector<std::string> vSplitName = {};
512 split(sKeyName,'_',vSplitName);
513 if (vSplitName[0] == "sf")
514 {
515 addHistogramToSFMap(kKey, sKeyName);
516 }
517 else
518 {
519 // std::string sDirection = vSplitName[1];
520 if (sKeyName.find("_up_") != std::string::npos or sKeyName.find("_down_") != std::string::npos)
521 addHistogramToSFMap(kKey, sKeyName);
522 else
523 {
524 size_t iPos = sKeyName.find('_');
525 addHistogramToSFMap(kKey, sKeyName.substr(0,iPos)+"_up"+sKeyName.substr(iPos));
526 addHistogramToSFMap(kKey, sKeyName.substr(0,iPos)+"_down"+sKeyName.substr(iPos));
527 }
528 }
529 }
530 ATH_MSG_INFO("data loaded from " << fFile.GetName());
531}
float averageInteractionsPerCrossing() const
Average interactions per crossing for all BCIDs - for out-of-time pile-up.
float actualInteractionsPerCrossing() const
Average interactions per crossing for the current BCID - for in-time pile-up.
uint32_t runNumber() const
The current event's run number.
double finalTauEta(const xAOD::TauJet &xTau)
return MVA based tau eta
double finalTauPt(const xAOD::TauJet &xTau)
return MVA based tau pt in GeV
double finalTauAbsEta(const xAOD::TauJet &xTau)
return MVA based absolute tau eta
double tauLeadTrackEta(const xAOD::TauJet &xTau)
return leading charge tau track eta
double truthTauAbsEta(const xAOD::TauJet &xTau)
return truth match tau eta (if hadronic truth tau match)
double finalTauP(const xAOD::TauJet &xTau)
return MVA based tau P in GeV
double truthTauPt(const xAOD::TauJet &xTau)
return truth match tau pt in GeV (if hadronic truth tau match)
double truthDecayMode(const xAOD::TauJet &xTau)
return truth decay mode (if hadronic truth tau match)
retrieve(aClass, aKey=None)
Definition PyKernel.py:110
EventInfo_v1 EventInfo
Definition of the latest event info version.
TauJet_v3 TauJet
Definition of the current "tau version".

◆ recommendedSystematics()

CP::SystematicSet CommonEfficiencyTool::recommendedSystematics ( ) const
virtualinherited

returns: the list of all systematics this tool recommends to use

Implements CP::IReentrantSystematicsTool.

Definition at line 321 of file CommonEfficiencyTool.cxx.

322{
324}

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and DerivationFramework::CfAthAlgTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_bNoMultiprong

bool TauAnalysisTools::CommonEfficiencyTool::m_bNoMultiprong
protectedinherited

Definition at line 144 of file CommonEfficiencyTool.h.

◆ m_bSFIsAvailable

bool TauAnalysisTools::CommonEfficiencyTool::m_bSFIsAvailable
protectedinherited

Definition at line 148 of file CommonEfficiencyTool.h.

◆ m_bSFIsAvailableChecked

bool TauAnalysisTools::CommonEfficiencyTool::m_bSFIsAvailableChecked
protectedinherited

Definition at line 149 of file CommonEfficiencyTool.h.

◆ m_bSFIsAvailableCheckedDiTau

bool TauAnalysisTools::CommonDiTauEfficiencyTool::m_bSFIsAvailableCheckedDiTau

true if cale factor name is already decorated has already been checked

Definition at line 101 of file CommonDiTauEfficiencyTool.h.

◆ m_bSFIsAvailableDiTau

bool TauAnalysisTools::CommonDiTauEfficiencyTool::m_bSFIsAvailableDiTau

true if scale factor name is already decorated

Definition at line 99 of file CommonDiTauEfficiencyTool.h.

◆ m_bSkipTruthMatchCheck

Gaudi::Property<bool> TauAnalysisTools::CommonEfficiencyTool::m_bSkipTruthMatchCheck {this, "SkipTruthMatchCheck", false}
protectedinherited

Definition at line 136 of file CommonEfficiencyTool.h.

136{this, "SkipTruthMatchCheck", false};

◆ m_bUseTauSubstructure

Gaudi::Property<bool> TauAnalysisTools::CommonEfficiencyTool::m_bUseTauSubstructure {this, "UseTauSubstructure", false}
protectedinherited

Definition at line 139 of file CommonEfficiencyTool.h.

139{this, "UseTauSubstructure", false};

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_doTauTrig

Gaudi::Property<bool> TauAnalysisTools::CommonEfficiencyTool::m_doTauTrig {this, "DoTauTrig", false}
protectedinherited

Definition at line 140 of file CommonEfficiencyTool.h.

140{this, "DoTauTrig", false};

◆ m_eCheckTruth

TruthMatchedParticleType TauAnalysisTools::CommonEfficiencyTool::m_eCheckTruth
protectedinherited

Definition at line 146 of file CommonEfficiencyTool.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_fX

std::function<double(const xAOD::TauJet& xTau)> TauAnalysisTools::CommonEfficiencyTool::m_fX
protectedinherited

Definition at line 103 of file CommonEfficiencyTool.h.

◆ m_fXDiTau

double(* TauAnalysisTools::CommonDiTauEfficiencyTool::m_fXDiTau) (const xAOD::DiTauJet &xDiTau)

scale factor bin x (e.g.

lead match pT)

Definition at line 75 of file CommonDiTauEfficiencyTool.h.

◆ m_fY

std::function<double(const xAOD::TauJet& xTau)> TauAnalysisTools::CommonEfficiencyTool::m_fY
protectedinherited

Definition at line 104 of file CommonEfficiencyTool.h.

◆ m_fYDiTau

double(* TauAnalysisTools::CommonDiTauEfficiencyTool::m_fYDiTau) (const xAOD::DiTauJet &xDiTau)

scale factor bin y (e.g.

sublead match pT)

Definition at line 77 of file CommonDiTauEfficiencyTool.h.

◆ m_fZDiTau

double(* TauAnalysisTools::CommonDiTauEfficiencyTool::m_fZDiTau) (const xAOD::DiTauJet &xDiTau)

scale factor bin z (e.g.

dR match particles)

Definition at line 79 of file CommonDiTauEfficiencyTool.h.

◆ m_iEleIDLevel

Gaudi::Property<int> TauAnalysisTools::CommonEfficiencyTool::m_iEleIDLevel {this, "EleIDLevel", static_cast<int>(ELEIDNONE)}
protectedinherited

Definition at line 138 of file CommonEfficiencyTool.h.

138{this, "EleIDLevel", static_cast<int>(ELEIDNONE)};

◆ m_iJetIDLevel

Gaudi::Property<int> TauAnalysisTools::CommonEfficiencyTool::m_iJetIDLevel {this, "JetIDLevel", static_cast<int>(JETIDNONE)}
protectedinherited

Definition at line 137 of file CommonEfficiencyTool.h.

137{this, "JetIDLevel", static_cast<int>(JETIDNONE)};

◆ m_mSF

std::unique_ptr< tSFMAP > TauAnalysisTools::CommonEfficiencyTool::m_mSF
protectedinherited

Definition at line 95 of file CommonEfficiencyTool.h.

◆ m_mSystematics

std::map<std::string, int> TauAnalysisTools::CommonEfficiencyTool::m_mSystematics
protectedinherited

Definition at line 100 of file CommonEfficiencyTool.h.

◆ m_mSystematicSets

std::unordered_map< CP::SystematicSet, std::string > TauAnalysisTools::CommonEfficiencyTool::m_mSystematicSets
protectedinherited

Definition at line 98 of file CommonEfficiencyTool.h.

◆ m_mSystematicsHistNames

std::map<std::string, std::string> TauAnalysisTools::CommonEfficiencyTool::m_mSystematicsHistNames
protectedinherited

Definition at line 101 of file CommonEfficiencyTool.h.

◆ m_sAffectingSystematics

CP::SystematicSet TauAnalysisTools::CommonEfficiencyTool::m_sAffectingSystematics
protectedinherited

Definition at line 130 of file CommonEfficiencyTool.h.

◆ m_sInputFileName

std::string TauAnalysisTools::CommonEfficiencyTool::m_sInputFileName
protectedinherited

Definition at line 142 of file CommonEfficiencyTool.h.

◆ m_sInputFilePath

Gaudi::Property<std::string> TauAnalysisTools::CommonEfficiencyTool::m_sInputFilePath {this, "InputFilePath", ""}
protectedinherited

Definition at line 133 of file CommonEfficiencyTool.h.

133{this, "InputFilePath", ""};

◆ m_sRecommendedSystematics

CP::SystematicSet TauAnalysisTools::CommonEfficiencyTool::m_sRecommendedSystematics
protectedinherited

Definition at line 131 of file CommonEfficiencyTool.h.

◆ m_sSFHistName

std::string TauAnalysisTools::CommonEfficiencyTool::m_sSFHistName
protectedinherited

Definition at line 143 of file CommonEfficiencyTool.h.

◆ m_sSystematicSet

const CP::SystematicSet* TauAnalysisTools::CommonEfficiencyTool::m_sSystematicSet
protectedinherited

Definition at line 99 of file CommonEfficiencyTool.h.

◆ m_sVarName

Gaudi::Property<std::string> TauAnalysisTools::CommonEfficiencyTool::m_sVarName {this, "VarName", ""}
protectedinherited

Definition at line 134 of file CommonEfficiencyTool.h.

134{this, "VarName", ""};

◆ m_sWP

Gaudi::Property<std::string> TauAnalysisTools::CommonEfficiencyTool::m_sWP {this, "WP", ""}
protectedinherited

Definition at line 135 of file CommonEfficiencyTool.h.

135{this, "WP", ""};

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


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