ATLAS Offline Software
Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Types | Private Member Functions | Private Attributes | List of all members
TauAnalysisTools::CommonDiTauEfficiencyTool Class Referenceabstract

#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. More...
 
 ~CommonDiTauEfficiencyTool ()
 
virtual StatusCode initialize () override
 Dummy implementation of the initialisation function. More...
 
virtual CP::CorrectionCode getEfficiencyScaleFactor (const xAOD::DiTauJet &xDiTau, double &dEfficiencyScaleFactor) override
 Get the Efficiency Scale Factor of ditau jet. More...
 
virtual CP::CorrectionCode applyEfficiencyScaleFactor (const xAOD::DiTauJet &xDiTau) override
 Get the Efficiency Scale Factor of ditau jet. More...
 
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. More...
 
void generateSystematicSets ()
 generate a set of relevant systematic variations to be applied More...
 
virtual CP::CorrectionCode getEfficiencyScaleFactor (const xAOD::TauJet &tau, double &dEfficiencyScaleFactor, unsigned int iRunNumber=0)
 
virtual CP::CorrectionCode applyEfficiencyScaleFactor (const xAOD::TauJet &xTau, unsigned int iRunNumber=0)
 
virtual CP::CorrectionCode getValue (const std::string &sHistName, const xAOD::TauJet &xTau, double &dEfficiencyScaleFactor) const
 
virtual CP::CorrectionCode getEfficiencyScaleFactor (const xAOD::TauJet &tau, double &dEfficiencyScaleFactor, unsigned int iRunNumber=0)
 Declare the interface that the class provides. More...
 
virtual CP::CorrectionCode applyEfficiencyScaleFactor (const xAOD::TauJet &xTau, unsigned int iRunNumber=0)
 Decorate the tau with its efficiency. More...
 
virtual bool isAffectedBySystematic (const CP::SystematicVariation &systematic) const
 returns: whether this tool is affected by the given systematics More...
 
virtual CP::SystematicSet affectingSystematics () const
 returns: the list of all systematics this tool can be affected by More...
 
virtual CP::SystematicSet recommendedSystematics () const
 returns: the list of all systematics this tool recommends to use More...
 
virtual StatusCode applySystematicVariation (const CP::SystematicSet &sSystematicSet)
 configure this tool for the given list of systematic variations. More...
 
virtual bool isSupportedRunNumber (int) const
 check if run number is supported in recommendations More...
 
virtual void print () const =0
 Print the state of the tool. More...
 
virtual void print () const
 Print the state of the tool. More...
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Public Attributes

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

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)
 
virtual CP::CorrectionCode getValue (const std::string &sHistName, const xAOD::TauJet &xTau, double &dEfficiencyScaleFactor) const
 
void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
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. More...
 

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> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
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 )
24  , m_bSFIsAvailableDiTau(false)
26 {
27 }

◆ ~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 538 of file CommonEfficiencyTool.cxx.

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

◆ 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 313 of file CommonEfficiencyTool.cxx.

314 {
316 }

◆ applyEfficiencyScaleFactor() [1/3]

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 
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  }
177  return CP::CorrectionCode::Ok;
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 }

◆ applyEfficiencyScaleFactor() [2/3]

CP::CorrectionCode CommonEfficiencyTool::applyEfficiencyScaleFactor

Definition at line 58 of file CommonEfficiencyTool.cxx.

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

◆ applyEfficiencyScaleFactor() [3/3]

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

Decorate the tau with its efficiency.

Implements TauAnalysisTools::ITauEfficiencyCorrectionsTool.

Definition at line 271 of file CommonEfficiencyTool.cxx.

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

◆ 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 338 of file CommonEfficiencyTool.cxx.

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

◆ ConvertDecayModeToString()

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

Definition at line 398 of file CommonEfficiencyTool.cxx.

399 {
400  switch(iDecayMode)
401  {
403  return "_r1p0n";
405  return "_r1p1n";
407  return "_r1pXn";
409  return "_r3p0n";
411  return "_r3pXn";
412  default:
413  return "";
414  }
415 }

◆ ConvertProngToString()

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

Definition at line 389 of file CommonEfficiencyTool.cxx.

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

◆ declareGaudiProperty() [1/4]

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

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

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

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  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

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

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

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

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

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

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  }

◆ 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.

95 { return m_detStore; }

◆ evtStore() [1/2]

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.

85 { return m_evtStore; }

◆ evtStore() [2/2]

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

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

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ 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
273  m_sAffectingSystematics.insert(CP::SystematicVariation (sSystematicString, -1));
274  // only add found uppercase systematics to the RecommendedSystematics
275  if (bIsRecommended)
276  {
279  }
280  ATH_MSG_DEBUG("connected base name " << sNP << " with systematic " <<sSystematicString);
281  m_mSystematicsHistNames.insert({sSystematicString,sNP});
282  }
283 }

◆ getEfficiencyScaleFactor() [1/3]

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
88  if (getTruthParticleType(xDiTau) != m_eCheckTruth)
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)
103  return CP::CorrectionCode::Ok;
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 
148  return CP::CorrectionCode::Ok;
149 }

◆ getEfficiencyScaleFactor() [2/3]

CP::CorrectionCode CommonEfficiencyTool::getEfficiencyScaleFactor

Definition at line 55 of file CommonEfficiencyTool.cxx.

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

◆ getEfficiencyScaleFactor() [3/3]

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

Declare the interface that the class provides.

Get the tau efficiency scale factor

Implements TauAnalysisTools::ITauEfficiencyCorrectionsTool.

Definition at line 142 of file CommonEfficiencyTool.cxx.

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

◆ 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  }

◆ 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/3]

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 }

◆ getValue() [2/3]

CP::CorrectionCode CommonEfficiencyTool::getValue

Definition at line 109 of file CommonEfficiencyTool.cxx.

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

◆ getValue() [3/3]

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

Definition at line 643 of file CommonEfficiencyTool.cxx.

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

◆ getValueTF1()

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

Definition at line 740 of file CommonEfficiencyTool.cxx.

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

◆ getValueTH1()

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

Definition at line 678 of file CommonEfficiencyTool.cxx.

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

◆ getValueTH2()

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

Definition at line 708 of file CommonEfficiencyTool.cxx.

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

◆ initialize()

StatusCode CommonDiTauEfficiencyTool::initialize ( )
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 }

◆ 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 302 of file CommonEfficiencyTool.cxx.

303 {
305  return sys.find(systematic) != sys.end();
306 }

◆ 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() [1/2]

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

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

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ 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  }

◆ 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() [1/2]

void asg::AsgTool::print ( ) const
virtualinherited

◆ print() [2/2]

virtual void asg::IAsgTool::print ( ) const
pure virtualinherited

◆ ReadInputs() [1/2]

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

Definition at line 427 of file CommonEfficiencyTool.cxx.

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

◆ ReadInputs() [2/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 }

◆ recommendedSystematics()

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

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

Implements CP::IReentrantSystematicsTool.

Definition at line 322 of file CommonEfficiencyTool.cxx.

323 {
325 }

◆ 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();
383  PBASE::renounce (h);
384  }

◆ 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  {
365  handlesArray.renounce();
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 DerivationFramework::CfAthAlgTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and asg::AsgMetadataTool.

◆ 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) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

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.

◆ m_bUseTauSubstructure

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

Definition at line 139 of file CommonEfficiencyTool.h.

◆ 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.

◆ 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.

◆ m_iJetIDLevel

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

Definition at line 137 of file CommonEfficiencyTool.h.

◆ 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.

◆ 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.

◆ m_sWP

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

Definition at line 135 of file CommonEfficiencyTool.h.

◆ 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:
TauAnalysisTools::CommonEfficiencyTool::getEfficiencyScaleFactor
virtual CP::CorrectionCode getEfficiencyScaleFactor(const xAOD::TauJet &tau, double &dEfficiencyScaleFactor, unsigned int iRunNumber=0)
Declare the interface that the class provides.
Definition: CommonEfficiencyTool.cxx:142
xAOD::TauJetParameters::Mode_1p0n
@ Mode_1p0n
Definition: TauDefs.h:386
xAOD::TauJetParameters::PanTau_DecayMode
@ PanTau_DecayMode
Definition: TauDefs.h:360
TauAnalysisTools::CommonEfficiencyTool::m_eCheckTruth
TruthMatchedParticleType m_eCheckTruth
Definition: CommonEfficiencyTool.h:146
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
xAOD::TauJetParameters::Mode_1p1n
@ Mode_1p1n
Definition: TauDefs.h:387
StateLessPT_NewConfig.proxy
proxy
Definition: StateLessPT_NewConfig.py:407
TauAnalysisTools::truthTauAbsEta
double truthTauAbsEta(const xAOD::TauJet &xTau)
return truth match tau eta (if hadronic truth tau match)
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx:172
TauAnalysisTools::CommonEfficiencyTool::m_sInputFilePath
Gaudi::Property< std::string > m_sInputFilePath
Definition: CommonEfficiencyTool.h:133
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
TauAnalysisTools::CommonDiTauEfficiencyTool::m_fXDiTau
double(* m_fXDiTau)(const xAOD::DiTauJet &xDiTau)
scale factor bin x (e.g.
Definition: CommonDiTauEfficiencyTool.h:75
TauAnalysisTools::TruthSubleadPt
double TruthSubleadPt(const xAOD::DiTauJet &xDiTau)
return the truth vis pT of the subleading pT matched particle.
Definition: CommonDiTauEfficiencyTool.cxx:328
TauAnalysisTools::CommonDiTauEfficiencyTool::generateSystematicSets
void generateSystematicSets()
generate a set of relevant systematic variations to be applied
Definition: CommonDiTauEfficiencyTool.cxx:241
TauAnalysisTools::TruthHadronicTau
@ TruthHadronicTau
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:99
CP::SystematicSet::size
size_t size() const
returns: size of the set
Definition: SystematicSet.h:71
TauAnalysisTools::truthTauPt
double truthTauPt(const xAOD::TauJet &xTau)
return truth match tau pt in GeV (if hadronic truth tau match)
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx:158
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
TauAnalysisTools::CommonEfficiencyTool::m_sSystematicSet
const CP::SystematicSet * m_sSystematicSet
Definition: CommonEfficiencyTool.h:99
min
constexpr double min()
Definition: ap_fixedTest.cxx:26
CP::SystematicSet::empty
bool empty() const
returns: whether the set is empty
Definition: SystematicSet.h:67
xAOD::TauJet_v3::nTracks
size_t nTracks(TauJetParameters::TauTrackFlag flag=TauJetParameters::TauTrackFlag::classifiedCharged) const
Definition: TauJet_v3.cxx:488
TauAnalysisTools::CommonDiTauEfficiencyTool::getEfficiencyScaleFactor
virtual CP::CorrectionCode getEfficiencyScaleFactor(const xAOD::DiTauJet &xDiTau, double &dEfficiencyScaleFactor) override
Get the Efficiency Scale Factor of ditau jet.
Definition: CommonDiTauEfficiencyTool.cxx:84
skel.it
it
Definition: skel.GENtoEVGEN.py:407
TauAnalysisTools::CommonEfficiencyTool::ConvertProngToString
std::string ConvertProngToString(const int iProngness) const
Definition: CommonEfficiencyTool.cxx:389
CP::SystematicSet
Class to wrap a set of SystematicVariations.
Definition: SystematicSet.h:31
TauAnalysisTools::CommonEfficiencyTool::tSFMAP
std::map< std::string, tTupleObjectFunc > tSFMAP
Definition: CommonEfficiencyTool.h:88
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
TauAnalysisTools::CommonEfficiencyTool::applySystematicVariation
virtual StatusCode applySystematicVariation(const CP::SystematicSet &sSystematicSet)
configure this tool for the given list of systematic variations.
Definition: CommonEfficiencyTool.cxx:338
TauAnalysisTools::CommonDiTauEfficiencyTool::m_fYDiTau
double(* m_fYDiTau)(const xAOD::DiTauJet &xDiTau)
scale factor bin y (e.g.
Definition: CommonDiTauEfficiencyTool.h:77
xAOD::TauJet_v3::panTauDetail
bool panTauDetail(TauJetParameters::PanTauDetails panTauDetail, int &value) const
Get and set values of pantau details variables via enum.
Definition: TauJet_v3.cxx:339
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
TauAnalysisTools::finalTauPt
double finalTauPt(const xAOD::TauJet &xTau)
return MVA based tau pt in GeV
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx:113
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
dbg::ptr
void * ptr(T *p)
Definition: SGImplSvc.cxx:74
CP::SystematicVariation
Definition: SystematicVariation.h:47
TauAnalysisTools::CommonEfficiencyTool::tTupleObjectFunc
std::tuple< TObject *, CP::CorrectionCode(*)(const TObject *oObject, double &dEfficiencyScaleFactor, double dVars[]) > tTupleObjectFunc
Definition: CommonEfficiencyTool.h:87
TauAnalysisTools::TruthLeadPt
double TruthLeadPt(const xAOD::DiTauJet &xDiTau)
return the truth vis pT of the leading pT matched particle.
Definition: CommonDiTauEfficiencyTool.cxx:320
mapkey::sys
@ sys
Definition: TElectronEfficiencyCorrectionTool.cxx:42
TauClusterVars::dEta
bool dEta(const xAOD::TauJet &tau, const xAOD::CaloVertexedTopoCluster &cluster, float &out)
Definition: ConstituentLoaderTauCluster.cxx:114
xAOD::EventInfo_v1::runNumber
uint32_t runNumber() const
The current event's run number.
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
xAOD::TauJetParameters::Mode_1pXn
@ Mode_1pXn
Definition: TauDefs.h:388
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
TauAnalysisTools::CommonEfficiencyTool::m_mSystematicSets
std::unordered_map< CP::SystematicSet, std::string > m_mSystematicSets
Definition: CommonEfficiencyTool.h:98
TauAnalysisTools::finalTauP
double finalTauP(const xAOD::TauJet &xTau)
return MVA based tau P in GeV
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx:134
TauAnalysisTools::CommonEfficiencyTool::getValue
virtual CP::CorrectionCode getValue(const std::string &sHistName, const xAOD::TauJet &xTau, double &dEfficiencyScaleFactor) const
Definition: CommonEfficiencyTool.cxx:643
CP::CorrectionCode::OutOfValidityRange
@ OutOfValidityRange
Input object is out of validity range.
Definition: CorrectionCode.h:37
TauAnalysisTools::truthDecayMode
double truthDecayMode(const xAOD::TauJet &xTau)
return truth decay mode (if hadronic truth tau match)
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx:186
CP::CorrectionCode::Error
@ Error
Some error happened during the object correction.
Definition: CorrectionCode.h:36
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:209
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
SG::Decorator
Helper class to provide type-safe access to aux data.
Definition: Decorator.h:59
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition: AthCommonDataStore.h:145
TauAnalysisTools::CommonEfficiencyTool::m_mSF
std::unique_ptr< tSFMAP > m_mSF
Definition: CommonEfficiencyTool.h:95
xAOD::TauJet_v3
Class describing a tau jet.
Definition: TauJet_v3.h:41
Amg::transform
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
Definition: GeoPrimitivesHelpers.h:156
CalibDbCompareRT.dummy
dummy
Definition: CalibDbCompareRT.py:59
TauAnalysisTools::CommonDiTauEfficiencyTool::ReadInputs
void ReadInputs(std::unique_ptr< TFile > &fFile)
Definition: CommonDiTauEfficiencyTool.cxx:189
CP::SystematicSet::end
const_iterator end() const
description: const iterator to the end of the set
Definition: SystematicSet.h:59
MSG::name
const std::string & name(Level lvl)
Convenience function for translating message levels to strings.
Definition: MsgLevel.cxx:19
TauAnalysisTools::CommonEfficiencyTool::m_sVarName
Gaudi::Property< std::string > m_sVarName
Definition: CommonEfficiencyTool.h:134
TauAnalysisTools::CommonEfficiencyTool::m_fX
std::function< double(const xAOD::TauJet &xTau)> m_fX
Definition: CommonEfficiencyTool.h:103
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
TauAnalysisTools::CommonEfficiencyTool::m_bSFIsAvailable
bool m_bSFIsAvailable
Definition: CommonEfficiencyTool.h:148
TauAnalysisTools::CommonEfficiencyTool::getValueTH2
static CP::CorrectionCode getValueTH2(const TObject *oObject, double &dEfficiencyScaleFactor, double dVars[])
Definition: CommonEfficiencyTool.cxx:708
xAOD::TauJetParameters::Mode_3p0n
@ Mode_3p0n
Definition: TauDefs.h:389
TauAnalysisTools::CommonEfficiencyTool::m_sSFHistName
std::string m_sSFHistName
Definition: CommonEfficiencyTool.h:143
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
xAOD::EventInfo_v1::averageInteractionsPerCrossing
float averageInteractionsPerCrossing() const
Average interactions per crossing for all BCIDs - for out-of-time pile-up.
Definition: EventInfo_v1.cxx:397
TauAnalysisTools::TruthDeltaR
double TruthDeltaR(const xAOD::DiTauJet &xDiTau)
return the dR of between the leading and subleading pT matched particle.
Definition: CommonDiTauEfficiencyTool.cxx:336
TauAnalysisTools::CommonEfficiencyTool::m_sAffectingSystematics
CP::SystematicSet m_sAffectingSystematics
Definition: CommonEfficiencyTool.h:130
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
CP::SystematicSet::insert
void insert(const SystematicVariation &systematic)
description: insert a systematic into the set
Definition: SystematicSet.cxx:87
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
TauAnalysisTools::CommonEfficiencyTool::m_fY
std::function< double(const xAOD::TauJet &xTau)> m_fY
Definition: CommonEfficiencyTool.h:104
xAOD::EventInfo_v1
Class describing the basic event information.
Definition: EventInfo_v1.h:43
TauAnalysisTools::CommonDiTauEfficiencyTool::m_bSFIsAvailableDiTau
bool m_bSFIsAvailableDiTau
true if scale factor name is already decorated
Definition: CommonDiTauEfficiencyTool.h:99
TauAnalysisTools::CommonEfficiencyTool::addHistogramToSFMap
void addHistogramToSFMap(TKey *kKey, const std::string &sKeyName)
Definition: CommonEfficiencyTool.cxx:538
PathResolverFindCalibFile
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
Definition: PathResolver.cxx:321
CP::SystematicSet::find
iterator find(const SystematicVariation &sys) const
description: find an element in the set
Definition: SystematicSet.h:63
TauAnalysisTools::CommonDiTauEfficiencyTool::m_fZDiTau
double(* m_fZDiTau)(const xAOD::DiTauJet &xDiTau)
scale factor bin z (e.g.
Definition: CommonDiTauEfficiencyTool.h:79
CP::CorrectionCode::Ok
@ Ok
The correction was done successfully.
Definition: CorrectionCode.h:38
a
TList * a
Definition: liststreamerinfos.cxx:10
TauAnalysisTools::CommonEfficiencyTool::m_sWP
Gaudi::Property< std::string > m_sWP
Definition: CommonEfficiencyTool.h:135
h
TauAnalysisTools::finalTauAbsEta
double finalTauAbsEta(const xAOD::TauJet &xTau)
return MVA based absolute tau eta
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx:127
TauAnalysisTools::CommonEfficiencyTool::m_bSFIsAvailableChecked
bool m_bSFIsAvailableChecked
Definition: CommonEfficiencyTool.h:149
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
TauAnalysisTools::CommonEfficiencyTool::CommonEfficiencyTool
CommonEfficiencyTool(const std::string &sName)
Create a proper constructor for Athena.
Definition: CommonEfficiencyTool.cxx:69
TauAnalysisTools::CommonEfficiencyTool::m_bUseTauSubstructure
Gaudi::Property< bool > m_bUseTauSubstructure
Definition: CommonEfficiencyTool.h:139
TauAnalysisTools::tauLeadTrackEta
double tauLeadTrackEta(const xAOD::TauJet &xTau)
return leading charge tau track eta
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx:141
TauAnalysisTools::CommonEfficiencyTool::ConvertDecayModeToString
std::string ConvertDecayModeToString(const int iDecayMode) const
Definition: CommonEfficiencyTool.cxx:398
TauAnalysisTools::getTruthParticleType
TruthMatchedParticleType getTruthParticleType(const xAOD::TauJet &xTau)
return TauJet match type
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx:493
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
CP::CorrectionCode
Return value from object correction CP tools.
Definition: CorrectionCode.h:31
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:629
xAOD::TauJetParameters::Mode_3pXn
@ Mode_3pXn
Definition: TauDefs.h:390
TauAnalysisTools::CommonEfficiencyTool::m_doTauTrig
Gaudi::Property< bool > m_doTauTrig
Definition: CommonEfficiencyTool.h:140
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:801
TauAnalysisTools::CommonDiTauEfficiencyTool::m_bSFIsAvailableCheckedDiTau
bool m_bSFIsAvailableCheckedDiTau
true if cale factor name is already decorated has already been checked
Definition: CommonDiTauEfficiencyTool.h:101
TauAnalysisTools::CommonEfficiencyTool::m_bNoMultiprong
bool m_bNoMultiprong
Definition: CommonEfficiencyTool.h:144
TauAnalysisTools::CommonEfficiencyTool::m_sInputFileName
std::string m_sInputFileName
Definition: CommonEfficiencyTool.h:142
SG::DataProxy
Definition: DataProxy.h:45
TauAnalysisTools::CommonEfficiencyTool::affectingSystematics
virtual CP::SystematicSet affectingSystematics() const
returns: the list of all systematics this tool can be affected by
Definition: CommonEfficiencyTool.cxx:313
TauAnalysisTools::CommonEfficiencyTool::m_mSystematicsHistNames
std::map< std::string, std::string > m_mSystematicsHistNames
Definition: CommonEfficiencyTool.h:101
TauAnalysisTools::CommonEfficiencyTool::getValueTH1
static CP::CorrectionCode getValueTH1(const TObject *oObject, double &dEfficiencyScaleFactor, double dVars[])
Definition: CommonEfficiencyTool.cxx:678
TauAnalysisTools::TruthHadronicDiTau
@ TruthHadronicDiTau
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:104
TauAnalysisTools::CommonEfficiencyTool::getValueTF1
static CP::CorrectionCode getValueTF1(const TObject *oObject, double &dEfficiencyScaleFactor, double dVars[])
Definition: CommonEfficiencyTool.cxx:740
TauAnalysisTools::CommonEfficiencyTool::m_sRecommendedSystematics
CP::SystematicSet m_sRecommendedSystematics
Definition: CommonEfficiencyTool.h:131
TauAnalysisTools::finalTauEta
double finalTauEta(const xAOD::TauJet &xTau)
return MVA based tau eta
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx:120
fitman.k
k
Definition: fitman.py:528
xAOD::EventInfo_v1::actualInteractionsPerCrossing
float actualInteractionsPerCrossing() const
Average interactions per crossing for the current BCID - for in-time pile-up.
Definition: EventInfo_v1.cxx:380
TauAnalysisTools::CommonDiTauEfficiencyTool::getValue
CP::CorrectionCode getValue(const std::string &sHistName, const xAOD::DiTauJet &xDiTau, double &dEfficiencyScaleFactor) const
Get the scale factor from a particular recommendations histogram.
Definition: CommonDiTauEfficiencyTool.cxx:290
TauAnalysisTools::CommonEfficiencyTool::m_bSkipTruthMatchCheck
Gaudi::Property< bool > m_bSkipTruthMatchCheck
Definition: CommonEfficiencyTool.h:136
TauAnalysisTools::split
void split(const std::string &sInput, const char cDelim, std::vector< std::string > &vOut)
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx:23