 |
ATLAS Offline Software
|
#include <CommonDiTauEfficiencyTool.h>
|
| | 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 |
| |
|
| std::unique_ptr< tSFMAP > | m_mSF |
| |
| std::unordered_map< CP::SystematicSet, std::string > | m_mSystematicSets |
| |
| const CP::SystematicSet * | m_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 |
| |
|
| 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...
|
| |
Definition at line 38 of file CommonDiTauEfficiencyTool.h.
◆ StoreGateSvc_t
◆ tSFMAP
◆ tTupleObjectFunc
◆ CommonDiTauEfficiencyTool()
| CommonDiTauEfficiencyTool::CommonDiTauEfficiencyTool |
( |
const std::string & |
sName | ) |
|
◆ ~CommonDiTauEfficiencyTool()
| CommonDiTauEfficiencyTool::~CommonDiTauEfficiencyTool |
( |
| ) |
|
◆ addHistogramToSFMap()
| void CommonEfficiencyTool::addHistogramToSFMap |
( |
TKey * |
kKey, |
|
|
const std::string & |
sKeyName |
|
) |
| |
|
protectedinherited |
Definition at line 537 of file CommonEfficiencyTool.cxx.
541 TClass *cClass = gROOT->GetClass(kKey->GetClassName());
542 if (cClass->InheritsFrom(
"TH2"))
544 TH1* oObject = (TH1*)kKey->ReadObj();
545 oObject->SetDirectory(0);
549 else if (cClass->InheritsFrom(
"TH1"))
551 TH1* oObject = (TH1*)kKey->ReadObj();
552 oObject->SetDirectory(0);
556 else if (cClass->InheritsFrom(
"TF1"))
558 TObject* oObject = kKey->ReadObj();
◆ affectingSystematics()
◆ applyEfficiencyScaleFactor() [1/3]
◆ applyEfficiencyScaleFactor() [2/3]
Definition at line 58 of file CommonEfficiencyTool.cxx.
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.");
294 return tmpCorrectionCode;
◆ applyEfficiencyScaleFactor() [3/3]
◆ applySystematicVariation()
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.
345 return StatusCode::SUCCESS;
349 double dDirection = 0.;
351 for (
auto sSyst : sSystematicSet)
357 ATH_MSG_VERBOSE(
"unsupported systematic variation: "<< sSyst.basename()<<
"; skipping this one");
362 if (sSyst.parameter() * dDirection < 0)
364 ATH_MSG_ERROR(
"unsupported set of systematic variations, you should either use only \"UP\" or only \"DOWN\" systematics in one set!");
366 return StatusCode::FAILURE;
368 dDirection = sSyst.parameter();
372 ATH_MSG_ERROR(
"unsupported set of systematic variations, you should not combine \"TAUS_{TRUE|FAKE}_EFF_*_TOTAL\" with other systematic variations!");
374 return StatusCode::FAILURE;
378 sSystematicSetAvailable.
insert(sSyst);
384 return StatusCode::SUCCESS;
◆ ConvertDecayModeToString()
| std::string CommonEfficiencyTool::ConvertDecayModeToString |
( |
const int |
iDecayMode | ) |
const |
|
protectedinherited |
◆ ConvertProngToString()
| std::string CommonEfficiencyTool::ConvertProngToString |
( |
const int |
iProngness | ) |
const |
|
protectedinherited |
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
| name | Name of the property. |
| hndl | Object holding the property value. |
| doc | Documentation 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.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
| name | Name of the property. |
| hndl | Object holding the property value. |
| doc | Documentation 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.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
| name | Name of the property. |
| property | Object holding the property value. |
| doc | Documentation 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.
338 return PBASE::declareProperty(
name, property,
doc);
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
| name | Name of the property. |
| property | Object holding the property value. |
| doc | Documentation 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.
◆ declareProperty() [6/6]
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ extraDeps_update_handler()
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.
244 std::vector<std::string> 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+
"_";
255 for (
auto mSF : *
m_mSF)
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);
263 if (sNP ==
"sf")
continue;
265 bool bIsRecommended =
false;
266 if (isupper(sNP.at(0)))
267 bIsRecommended =
true;
269 std::transform(sNPUppercase.begin(), sNPUppercase.end(), sNPUppercase.begin(), toupper);
270 std::string sSystematicString = sSystematicBaseString+sNPUppercase;
280 ATH_MSG_DEBUG(
"connected base name " << sNP <<
" with systematic " <<sSystematicString);
◆ getEfficiencyScaleFactor() [1/3]
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.
90 dEfficiencyScaleFactor = 1.;
96 dEfficiencyScaleFactor);
99 return tmpCorrectionCode;
106 double dTotalSystematic2 = 0.;
107 double dDirection = 0.;
115 double dUncertaintySyst = 0.;
118 dDirection = syst.parameter();
121 std::string sHistName =
it->second;
122 if (dDirection>0) sHistName+=
"_up";
123 else sHistName+=
"_down";
127 tmpCorrectionCode =
getValue(sHistName,
133 return tmpCorrectionCode;
136 dUncertaintySyst *= dDirection;
139 dTotalSystematic2 += dUncertaintySyst * dUncertaintySyst;
143 dDirection = (dDirection > 0.) ? 1. : -1.;
146 dEfficiencyScaleFactor *= 1. + dDirection * std::sqrt(dTotalSystematic2);
◆ getEfficiencyScaleFactor() [2/3]
Definition at line 55 of file CommonEfficiencyTool.cxx.
147 dEfficiencyScaleFactor = 1.;
154 dEfficiencyScaleFactor = 1.;
167 ATH_MSG_WARNING(
"Found tau with unknown decay mode. Skip efficiency correction.");
174 if( xTau.nTracks() != 1 && xTau.nTracks() != 3) {
175 dEfficiencyScaleFactor = 1.;
182 std::string sHistName;
184 sHistName =
"sf_all_"+
m_sWP+sMode;
192 dEfficiencyScaleFactor);
195 return tmpCorrectionCode;
202 double dTotalSystematic2 = 0.;
203 double dDirection = 0.;
210 double dUncertaintySyst = 0.;
213 dDirection = syst.parameter();
216 sHistName =
it->second;
217 if (dDirection>0.) sHistName+=
"_up";
218 else sHistName+=
"_down";
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))
231 if( (sHistName.find(
"1520") != std::string::npos && sHistName.find(
"loose") != std::string::npos) ){
236 tmpCorrectionCode =
getValue(sHistName,
242 return tmpCorrectionCode;
245 dUncertaintySyst *= dDirection;
248 dTotalSystematic2 += dUncertaintySyst * dUncertaintySyst;
252 dDirection = (dDirection > 0.) ? 1. : -1.;
255 dEfficiencyScaleFactor *= 1. + dDirection * std::sqrt(dTotalSystematic2);
◆ getEfficiencyScaleFactor() [3/3]
Declare the interface that the class provides.
Get the tau efficiency scale factor
Implements TauAnalysisTools::ITauEfficiencyCorrectionsTool.
Definition at line 141 of file CommonEfficiencyTool.cxx.
147 dEfficiencyScaleFactor = 1.;
154 dEfficiencyScaleFactor = 1.;
167 ATH_MSG_WARNING(
"Found tau with unknown decay mode. Skip efficiency correction.");
175 dEfficiencyScaleFactor = 1.;
182 std::string sHistName;
184 sHistName =
"sf_all_"+
m_sWP+sMode;
192 dEfficiencyScaleFactor);
195 return tmpCorrectionCode;
202 double dTotalSystematic2 = 0.;
203 double dDirection = 0.;
210 double dUncertaintySyst = 0.;
213 dDirection = syst.parameter();
216 sHistName =
it->second;
217 if (dDirection>0.) sHistName+=
"_up";
218 else sHistName+=
"_down";
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))
231 if( (sHistName.find(
"1520") != std::string::npos && sHistName.find(
"loose") != std::string::npos) ){
236 tmpCorrectionCode =
getValue(sHistName,
242 return tmpCorrectionCode;
245 dUncertaintySyst *= dDirection;
248 dTotalSystematic2 += dUncertaintySyst * dUncertaintySyst;
252 dDirection = (dDirection > 0.) ? 1. : -1.;
255 dEfficiencyScaleFactor *= 1. + dDirection * std::sqrt(dTotalSystematic2);
◆ getKey()
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
-
| ptr | The 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.
121 #ifdef XAOD_STANDALONE
127 return (
proxy ==
nullptr ? 0 :
proxy->sgkey() );
128 #endif // XAOD_STANDALONE
◆ 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
-
| ptr | The 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.
108 #ifdef XAOD_STANDALONE
114 static const std::string
dummy =
"";
116 #endif // XAOD_STANDALONE
◆ 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]
Get the scale factor from a particular recommendations histogram.
- Parameters
-
| sHistName | |
| xDiTau | |
| dEfficiencyScaleFactor | |
- Returns
- CP::CorrectionCode
Definition at line 290 of file CommonDiTauEfficiencyTool.cxx.
295 auto it = mSF.find (sHistName);
298 ATH_MSG_ERROR(
"Object with name "<<sHistName<<
" was not found in input file.");
300 for (
auto eEntry : mSF)
313 double dVars[3] = {dX, dY, dZ};
316 return (std::get<1>(tTuple))(std::get<0>(tTuple), dEfficiencyScaleFactor, dVars);
◆ getValue() [2/3]
Definition at line 109 of file CommonEfficiencyTool.cxx.
647 auto it = mSF.find (sHistName);
650 ATH_MSG_ERROR(
"Object with name "<<sHistName<<
" was not found in input file.");
652 for (
auto eEntry : mSF)
661 double dPt =
m_fX(xTau);
664 double dVars[2] = {dPt,
dEta};
668 return (std::get<1>(tTuple))(std::get<0>(tTuple), dEfficiencyScaleFactor, dVars);
◆ getValue() [3/3]
|
|
protectedvirtualinherited |
Definition at line 642 of file CommonEfficiencyTool.cxx.
647 auto it = mSF.find (sHistName);
650 ATH_MSG_ERROR(
"Object with name "<<sHistName<<
" was not found in input file.");
652 for (
auto eEntry : mSF)
661 double dPt =
m_fX(xTau);
664 double dVars[2] = {dPt,
dEta};
668 return (std::get<1>(tTuple))(std::get<0>(tTuple), dEfficiencyScaleFactor, dVars);
◆ getValueTF1()
| CP::CorrectionCode CommonEfficiencyTool::getValueTF1 |
( |
const TObject * |
oObject, |
|
|
double & |
dEfficiencyScaleFactor, |
|
|
double |
dVars[] |
|
) |
| |
|
staticprotectedinherited |
Definition at line 739 of file CommonEfficiencyTool.cxx.
742 double dPt = dVars[0];
743 double dEta = dVars[1];
745 const TF1* fFunc =
static_cast<const TF1*
>(oObject);
754 dEfficiencyScaleFactor = fFunc->Eval(dPt,
dEta);
◆ getValueTH1()
| CP::CorrectionCode CommonEfficiencyTool::getValueTH1 |
( |
const TObject * |
oObject, |
|
|
double & |
dEfficiencyScaleFactor, |
|
|
double |
dVars[] |
|
) |
| |
|
staticprotectedinherited |
Definition at line 677 of file CommonEfficiencyTool.cxx.
680 double dPt = dVars[0];
682 const TH1* hHist =
dynamic_cast<const TH1*
>(oObject);
691 dPt =
std::max(dPt,hHist->GetXaxis()->GetXmin());
693 dPt =
std::min(dPt,hHist->GetXaxis()->GetXmax() * .999);
696 int iBin = hHist->FindFixBin(dPt);
697 dEfficiencyScaleFactor = hHist->GetBinContent(iBin);
◆ getValueTH2()
| CP::CorrectionCode CommonEfficiencyTool::getValueTH2 |
( |
const TObject * |
oObject, |
|
|
double & |
dEfficiencyScaleFactor, |
|
|
double |
dVars[] |
|
) |
| |
|
staticprotectedinherited |
Definition at line 707 of file CommonEfficiencyTool.cxx.
710 double dPt = dVars[0];
711 double dEta = dVars[1];
713 const TH2* hHist =
dynamic_cast<const TH2*
>(oObject);
722 dPt =
std::max(dPt,hHist->GetXaxis()->GetXmin());
725 dPt =
std::min(dPt,hHist->GetXaxis()->GetXmax() * .999);
729 int iBin = hHist->FindFixBin(dPt,
dEta);
730 dEfficiencyScaleFactor = hHist->GetBinContent(iBin);
◆ 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.
43 ATH_MSG_INFO(
"Initializing CommonDiTauEfficiencyTool" );
49 m_mSF = std::make_unique< tSFMAP >();
50 std::unique_ptr< TFile > fSF( TFile::Open( sInputFilePath.c_str(),
"READ" ) );
53 ATH_MSG_FATAL(
"Could not open file " << sInputFilePath.c_str());
54 return StatusCode::FAILURE;
61 std::vector<std::string> vInputFilePath;
72 return StatusCode::FAILURE;
74 return StatusCode::SUCCESS;
◆ inputHandles()
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()
◆ isSupportedRunNumber()
| virtual bool TauAnalysisTools::CommonEfficiencyTool::isSupportedRunNumber |
( |
int |
iRunNumber | ) |
const |
|
inlinevirtualinherited |
◆ msg() [1/2]
◆ msg() [2/2]
◆ 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.
◆ msgLvl()
◆ outputHandles()
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 the state of the tool.
Implements asg::IAsgTool.
Reimplemented in JetRecTool, JetFinder, JetModifiedMassDrop, JetFromPseudojet, JetReclusterer, JetReclusteringTool, JetTruthLabelingTool, JetPileupLabelingTool, HI::HIPileupTool, LundVariablesTool, JetDumper, JetBottomUpSoftDrop, JetRecursiveSoftDrop, JetSoftDrop, JetConstituentsRetriever, JetSubStructureMomentToolsBase, JetSplitter, JetToolRunner, JetPruner, JetPseudojetRetriever, JetTrimmer, AsgHelloTool, and KtDeltaRTool.
Definition at line 131 of file AsgTool.cxx.
◆ print() [2/2]
| virtual void asg::IAsgTool::print |
( |
| ) |
const |
|
pure virtualinherited |
Print the state of the tool.
Implemented in JetRecTool, JetFinder, JetModifiedMassDrop, JetFromPseudojet, JetReclusterer, JetReclusteringTool, JetTruthLabelingTool, JetPileupLabelingTool, HI::HIPileupTool, LundVariablesTool, asg::AsgTool, JetDumper, JetBottomUpSoftDrop, JetRecursiveSoftDrop, JetSoftDrop, JetConstituentsRetriever, JetSubStructureMomentToolsBase, JetSplitter, JetToolRunner, JetPruner, JetPseudojetRetriever, JetTrimmer, AsgHelloTool, and KtDeltaRTool.
◆ ReadInputs() [1/2]
| void CommonEfficiencyTool::ReadInputs |
( |
const TFile & |
fFile | ) |
|
|
protectedinherited |
Definition at line 426 of file CommonEfficiencyTool.cxx.
435 TIter itNext(fFile.GetListOfKeys());
436 while ((kKey = (TKey*)itNext()))
440 std::string sKeyName = kKey->GetName();
441 if (sKeyName ==
"Xaxis")
443 TNamed* tObj = (TNamed*)kKey->ReadObj();
444 std::string sTitle = tObj->GetTitle();
446 if (sTitle ==
"P" || sTitle ==
"PFinalCalib")
451 if (sTitle ==
"TruthDecayMode")
456 if (sTitle ==
"truth pt")
461 if (sTitle ==
"|eta|")
469 else if (sKeyName ==
"Yaxis")
471 TNamed* tObj = (TNamed*)kKey->ReadObj();
472 std::string sTitle = tObj->GetTitle();
474 if (sTitle ==
"track-eta")
479 else if (sTitle ==
"|eta|")
484 else if (sTitle ==
"mu")
488 if (
evtStore()->retrieve(xEventInfo,
"EventInfo").isFailure()) {
503 else if (sTitle ==
"truth |eta|")
511 std::vector<std::string> vSplitName = {};
512 split(sKeyName,
'_',vSplitName);
513 if (vSplitName[0] ==
"sf")
520 if (sKeyName.find(
"_up_") != std::string::npos or sKeyName.find(
"_down_") != std::string::npos)
524 size_t iPos = sKeyName.find(
'_');
◆ ReadInputs() [2/2]
| void CommonDiTauEfficiencyTool::ReadInputs |
( |
std::unique_ptr< TFile > & |
fFile | ) |
|
Definition at line 189 of file CommonDiTauEfficiencyTool.cxx.
199 TIter itNext(fFile->GetListOfKeys());
200 while ((kKey = (TKey*)itNext()))
204 std::string sKeyName = kKey->GetName();
206 std::vector<std::string> vSplitName = {};
207 split(sKeyName,
'_',vSplitName);
208 if (vSplitName[0] ==
"sf")
214 if (sKeyName.find(
"_up_") != std::string::npos or sKeyName.find(
"_down_") != std::string::npos)
218 size_t iPos = sKeyName.find(
'_');
◆ recommendedSystematics()
◆ renounce()
◆ renounceArray()
◆ sysInitialize()
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateVHKA()
◆ m_bNoMultiprong
| bool TauAnalysisTools::CommonEfficiencyTool::m_bNoMultiprong |
|
protectedinherited |
◆ m_bSFIsAvailable
| bool TauAnalysisTools::CommonEfficiencyTool::m_bSFIsAvailable |
|
protectedinherited |
◆ m_bSFIsAvailableChecked
| bool TauAnalysisTools::CommonEfficiencyTool::m_bSFIsAvailableChecked |
|
protectedinherited |
◆ m_bSFIsAvailableCheckedDiTau
| bool TauAnalysisTools::CommonDiTauEfficiencyTool::m_bSFIsAvailableCheckedDiTau |
◆ m_bSFIsAvailableDiTau
| bool TauAnalysisTools::CommonDiTauEfficiencyTool::m_bSFIsAvailableDiTau |
◆ m_bSkipTruthMatchCheck
| Gaudi::Property<bool> TauAnalysisTools::CommonEfficiencyTool::m_bSkipTruthMatchCheck {this, "SkipTruthMatchCheck", false} |
|
protectedinherited |
◆ m_bUseTauSubstructure
| Gaudi::Property<bool> TauAnalysisTools::CommonEfficiencyTool::m_bUseTauSubstructure {this, "UseTauSubstructure", false} |
|
protectedinherited |
◆ m_detStore
◆ m_doTauTrig
| Gaudi::Property<bool> TauAnalysisTools::CommonEfficiencyTool::m_doTauTrig {this, "DoTauTrig", false} |
|
protectedinherited |
◆ m_eCheckTruth
◆ m_evtStore
◆ m_fX
| std::function<double(const xAOD::TauJet& xTau)> TauAnalysisTools::CommonEfficiencyTool::m_fX |
|
protectedinherited |
◆ m_fXDiTau
| double(* TauAnalysisTools::CommonDiTauEfficiencyTool::m_fXDiTau) (const xAOD::DiTauJet &xDiTau) |
◆ m_fY
| std::function<double(const xAOD::TauJet& xTau)> TauAnalysisTools::CommonEfficiencyTool::m_fY |
|
protectedinherited |
◆ m_fYDiTau
| double(* TauAnalysisTools::CommonDiTauEfficiencyTool::m_fYDiTau) (const xAOD::DiTauJet &xDiTau) |
◆ m_fZDiTau
| double(* TauAnalysisTools::CommonDiTauEfficiencyTool::m_fZDiTau) (const xAOD::DiTauJet &xDiTau) |
◆ m_iEleIDLevel
| Gaudi::Property<int> TauAnalysisTools::CommonEfficiencyTool::m_iEleIDLevel {this, "EleIDLevel", static_cast<int>(ELEIDNONE)} |
|
protectedinherited |
◆ m_iJetIDLevel
| Gaudi::Property<int> TauAnalysisTools::CommonEfficiencyTool::m_iJetIDLevel {this, "JetIDLevel", static_cast<int>(JETIDNONE)} |
|
protectedinherited |
◆ m_mSF
| std::unique_ptr< tSFMAP > TauAnalysisTools::CommonEfficiencyTool::m_mSF |
|
protectedinherited |
◆ m_mSystematics
| std::map<std::string, int> TauAnalysisTools::CommonEfficiencyTool::m_mSystematics |
|
protectedinherited |
◆ m_mSystematicSets
| std::unordered_map< CP::SystematicSet, std::string > TauAnalysisTools::CommonEfficiencyTool::m_mSystematicSets |
|
protectedinherited |
◆ m_mSystematicsHistNames
| std::map<std::string, std::string> TauAnalysisTools::CommonEfficiencyTool::m_mSystematicsHistNames |
|
protectedinherited |
◆ m_sAffectingSystematics
◆ m_sInputFileName
| std::string TauAnalysisTools::CommonEfficiencyTool::m_sInputFileName |
|
protectedinherited |
◆ m_sInputFilePath
| Gaudi::Property<std::string> TauAnalysisTools::CommonEfficiencyTool::m_sInputFilePath {this, "InputFilePath", ""} |
|
protectedinherited |
◆ m_sRecommendedSystematics
◆ m_sSFHistName
| std::string TauAnalysisTools::CommonEfficiencyTool::m_sSFHistName |
|
protectedinherited |
◆ m_sSystematicSet
◆ m_sVarName
| Gaudi::Property<std::string> TauAnalysisTools::CommonEfficiencyTool::m_sVarName {this, "VarName", ""} |
|
protectedinherited |
◆ m_sWP
| Gaudi::Property<std::string> TauAnalysisTools::CommonEfficiencyTool::m_sWP {this, "WP", ""} |
|
protectedinherited |
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
size_t size() const
returns: size of the set
bool empty() const
returns: whether the set is empty
size_t nTracks(TauJetParameters::TauTrackFlag flag=TauJetParameters::TauTrackFlag::classifiedCharged) const
Class to wrap a set of SystematicVariations.
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool panTauDetail(TauJetParameters::PanTauDetails panTauDetail, int &value) const
Get and set values of pantau details variables via enum.
#define ATH_MSG_VERBOSE(x)
bool dEta(const xAOD::TauJet &tau, const xAOD::CaloVertexedTopoCluster &cluster, float &out)
uint32_t runNumber() const
The current event's run number.
virtual void setOwner(IDataHandleHolder *o)=0
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
@ OutOfValidityRange
Input object is out of validity range.
@ Error
Some error happened during the object correction.
Helper class to provide type-safe access to aux data.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Class describing a tau jet.
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
const_iterator end() const
description: const iterator to the end of the set
const std::string & name(Level lvl)
Convenience function for translating message levels to strings.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
float averageInteractionsPerCrossing() const
Average interactions per crossing for all BCIDs - for out-of-time pile-up.
void insert(const SystematicVariation &systematic)
description: insert a systematic into the set
Class describing the basic event information.
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
iterator find(const SystematicVariation &sys) const
description: find an element in the set
@ Ok
The correction was done successfully.
#define ATH_MSG_WARNING(x)
Return value from object correction CP tools.
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
float actualInteractionsPerCrossing() const
Average interactions per crossing for the current BCID - for in-time pile-up.