ATLAS Offline Software
Loading...
Searching...
No Matches
CommonDiTauEfficiencyTool.h File Reference
Include dependency graph for CommonDiTauEfficiencyTool.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

namespace ADD_CMODE (TauAnalysisTools)

Detailed Description

Author
David Kirchmeier
Guillermo Hamity (ghami.nosp@m.ty@c.nosp@m.ern.c.nosp@m.h)
Date
2021-02-18

Definition in file CommonDiTauEfficiencyTool.h.

Function Documentation

◆ ADD_CMODE()

namespace ADD_CMODE ( TauAnalysisTools )

return the truth vis pT of the leading pT matched particle.

return the truth vis pT of the subleading pT matched particle.

return the dR of between the leading and subleading pT matched particle.

Create a proper constructor for Athena

Get the Efficiency Scale Factor of ditau jet

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

Get the Efficiency Scale Factor of ditau jet

Parameters
xDiTau
Returns
CP::CorrectionCode

returns: whether this tool is affected by the given systematics

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

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

configure this tool for the given list of systematic variations. any requested systematics that are not affecting this tool will be silently ignored

Get the scale factor from a particular recommendations histogram.

Parameters
sHistName
xDiTau
dEfficiencyScaleFactor
Returns
CP::CorrectionCode

generate a set of relevant systematic variations to be applied

true if scale factor name is already decorated

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

Definition at line 1 of file CommonDiTauEfficiencyTool.h.

36{
38double TruthLeadPt(const xAOD::DiTauJet& xDiTau);
40double TruthSubleadPt(const xAOD::DiTauJet& xDiTau);
42double TruthDeltaR(const xAOD::DiTauJet& xDiTau);
43
44class CommonDiTauEfficiencyTool
45 : public virtual IDiTauEfficiencyCorrectionsTool
46 , public asg::AsgTool
47{
49 ASG_TOOL_CLASS( CommonDiTauEfficiencyTool, TauAnalysisTools::IDiTauEfficiencyCorrectionsTool )
50
51public:
52
53 CommonDiTauEfficiencyTool(const std::string& sName);
54
55 ~CommonDiTauEfficiencyTool();
56
57 virtual StatusCode initialize();
58
66 virtual CP::CorrectionCode getEfficiencyScaleFactor(const xAOD::DiTauJet& xDiTau, double& dEfficiencyScaleFactor);
67
74 virtual CP::CorrectionCode applyEfficiencyScaleFactor(const xAOD::DiTauJet& xDiTau);
75
77 virtual bool isAffectedBySystematic( const CP::SystematicVariation& systematic ) const;
78
80 virtual CP::SystematicSet affectingSystematics() const;
81
83 virtual CP::SystematicSet recommendedSystematics() const;
84
87 virtual StatusCode applySystematicVariation ( const CP::SystematicSet& sSystematicSet);
88
89 std::function<double(const xAOD::DiTauJet& xDiTau)> m_fXDiTau;
90 std::function<double(const xAOD::DiTauJet& xDiTau)> m_fYDiTau;
91 std::function<double(const xAOD::DiTauJet& xDiTau)> m_fZDiTau;
92
93protected:
94
95 void ReadInputs(std::unique_ptr<TFile> &fFile);
96 void addHistogramToSFMap(TKey* kKey, const std::string& sKeyName);
97
98 typedef std::tuple<TObject*,
99 CP::CorrectionCode (*)(const TObject* oObject,
100 double& dEfficiencyScaleFactor,
101 double dVars[] ) > tTupleObjectFunc;
102 typedef std::map<std::string, tTupleObjectFunc > tSFMAP;
103 // In gcc10 builds, cling gets confused by the type of m_mSF and produces
104 // an ugly warning message. Hide this from cling to suppress that
105 // (substitute another unique_ptr so that the class layout remains the same).
106#ifdef __CLING__
107 std::unique_ptr<int> m_dummy;
108#else
109 std::unique_ptr< tSFMAP > m_mSF;
110#endif
111
112 std::unordered_map < CP::SystematicSet, std::string > m_mSystematicSets;
113 const CP::SystematicSet* m_sSystematicSet;
114 std::map<std::string, std::string> m_mSystematicsHistNames;
115
124 virtual CP::CorrectionCode getValue(const std::string& sHistName,
125 const xAOD::DiTauJet& xDiTau,
126 double& dEfficiencyScaleFactor) const;
127
128 static CP::CorrectionCode getValueTH1(const TObject* oObject,
129 double& dEfficiencyScaleFactor,
130 double dVars[]
131 );
132 static CP::CorrectionCode getValueTH2(const TObject* oObject,
133 double& dEfficiencyScaleFactor,
134 double dVars[]
135 );
136
138 void generateSystematicSets();
140 bool m_bSFIsAvailableDiTau;
142 bool m_bSFIsAvailableCheckedDiTau;
143
144 CP::SystematicSet m_sAffectingSystematics;
145 CP::SystematicSet m_sRecommendedSystematics;
146
147 Gaudi::Property<bool> m_bSkipTruthMatchCheck{this, "SkipTruthMatchCheck", false};
148 Gaudi::Property<std::string> m_sInputFilePath{this, "InputFilePath", ""};
149 Gaudi::Property<std::string> m_sWP{this, "WP", ""};
150 Gaudi::Property<std::string> m_sVarName{this, "VarName", ""};
151
152 std::string m_sInputFileName;
153 std::string m_sSFHistName;
154
156
157};
158} // namespace ADD_CMODE(TauAnalysisTools)
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
Base class for the dual-use tool implementation classes.
Definition AsgTool.h:47
virtual StatusCode initialize()
Dummy implementation of the initialisation function.
Definition AsgTool.h:133
::StatusCode StatusCode
StatusCode definition for legacy code.
DiTauJet_v1 DiTauJet
Definition of the current version.
Definition DiTauJet.h:17