Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
TauCombinedTES.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 #include "TFile.h"
8 
9 #include <cmath>
10 
11 
12 
13 TauCombinedTES::TauCombinedTES(const std::string& name) :
15 }
16 
17 
18 
20 
21  std::string calFilePath = find_file(m_calFileName);
22  std::unique_ptr<TFile> calFile(TFile::Open(calFilePath.c_str(), "READ"));
23  ATH_MSG_INFO("Using calibration file: " << calFilePath);
24 
25  // 1D array with decay mode as index
26  TH1F* hist = nullptr;
27  TF1* tf1 = nullptr;
28  std::string histName = "";
29  for (size_t decayModeIndex = 0; decayModeIndex < DecayModeBinning; ++ decayModeIndex) {
30  histName = "CorrelationCoeff_tauRec_" + m_decayModeNames[decayModeIndex];
31  hist = dynamic_cast<TH1F*> (calFile->Get(histName.c_str()));
32  if(hist) {
33  hist->SetDirectory(nullptr);
34  m_correlationHists[decayModeIndex] = std::unique_ptr<TH1F>(hist);
35  ATH_MSG_DEBUG("Adding corr hist: " << histName);
36  }
37  else {
38  ATH_MSG_FATAL("Failed to get an object with name " << histName);
39  return StatusCode::FAILURE;
40  }
41 
42  histName = "nSigmaCompatibility_" + m_decayModeNames[decayModeIndex];
43  tf1 = dynamic_cast<TF1*> (calFile->Get(histName.c_str()));
44  if(tf1) {
45  m_nSigmaCompatibility[decayModeIndex] = std::unique_ptr<TF1>(tf1);
46  ATH_MSG_DEBUG("Adding compatibility TF1: " << histName);
47  }
48  else {
49  ATH_MSG_FATAL("Failed to get an object with name " << histName);
50  return StatusCode::FAILURE;
51  }
52  }
53 
54  // 2D array with (eta, decay mode) as index
55  TGraph* graph = nullptr;
56  std::string graphName="";
57  for (size_t decayModeIndex = 0; decayModeIndex < DecayModeBinning; ++decayModeIndex) {
58  for (size_t etaIndex = 0; etaIndex < EtaBinning; ++etaIndex) {
59  // Calo TES: relative bias
60  graphName = "tauRec/Graph_from_MeanEt_tauRec_" + m_decayModeNames[decayModeIndex] + "_" + m_etaBinNames[etaIndex];
61  graph = dynamic_cast<TGraph*> (calFile->Get(graphName.c_str()));
62  if(graph) {
63  m_caloRelBiasMaxEt[decayModeIndex][etaIndex] = TMath::MaxElement(graph->GetN(), graph->GetX());
64  m_caloRelBias[decayModeIndex][etaIndex] = std::unique_ptr<TGraph>(graph);
65  ATH_MSG_DEBUG("Adding graph: " << graphName);
66  }
67  else {
68  ATH_MSG_FATAL("Failed to get an object with name " << graphName);
69  return StatusCode::FAILURE;
70  }
71 
72  // Calo TES: resolution
73  graphName = "tauRec/Graph_from_ResolutionEt_tauRec_" + m_decayModeNames[decayModeIndex] + "_" + m_etaBinNames[etaIndex];
74  graph = dynamic_cast<TGraph*> (calFile->Get(graphName.c_str()));
75  if(graph){
76  m_caloResMaxEt[decayModeIndex][etaIndex] = TMath::MaxElement(graph->GetN(), graph->GetX());
77  m_caloRes[decayModeIndex][etaIndex] = std::unique_ptr<TGraph>(graph);
78  ATH_MSG_DEBUG("Adding graph: " << graphName);
79  }
80  else {
81  ATH_MSG_FATAL("Failed to get an object with name " << graphName);
82  return StatusCode::FAILURE;
83  }
84 
85  // PanTau: relative bias
86  graphName = "ConstituentEt/Graph_from_MeanEt_ConstituentEt_" + m_decayModeNames[decayModeIndex] + "_" + m_etaBinNames[etaIndex];
87  graph = dynamic_cast<TGraph*> (calFile->Get(graphName.c_str()));
88  if(graph){
89  m_panTauRelBiasMaxEt[decayModeIndex][etaIndex] = TMath::MaxElement(graph->GetN(), graph->GetX());
90  m_panTauRelBias[decayModeIndex][etaIndex] = std::unique_ptr<TGraph>(graph);
91  ATH_MSG_DEBUG("Adding graph: " << graphName);
92  }
93  else {
94  ATH_MSG_FATAL("Failed to get an object with name " << graphName);
95  return StatusCode::FAILURE;
96  }
97 
98  // PanTau: resolution
99  graphName = "ConstituentEt/Graph_from_ResolutionEt_ConstituentEt_" + m_decayModeNames[decayModeIndex] + "_" + m_etaBinNames[etaIndex];
100  graph = dynamic_cast<TGraph*> (calFile->Get(graphName.c_str()));
101  if(graph){
102  m_panTauResMaxEt[decayModeIndex][etaIndex] = TMath::MaxElement(graph->GetN(), graph->GetX());
103  m_panTauRes[decayModeIndex][etaIndex] = std::unique_ptr<TGraph>(graph);
104  ATH_MSG_DEBUG("Adding graph: " << graphName);
105  }
106  else {
107  ATH_MSG_FATAL("Failed to get an object with name " << graphName);
108  return StatusCode::FAILURE;
109  }
110 
111  // MVA resolution, optional
112  if(m_useMvaResolution) {
113  graphName = "FinalCalib/Graph_from_ResolutionEt_FinalCalib_" + m_decayModeNames[decayModeIndex] + "_" + m_etaBinNames[etaIndex];
114  graph = dynamic_cast<TGraph*> (calFile->Get(graphName.c_str()));
115  if(graph){
116  m_mvaResMaxEt[decayModeIndex][etaIndex] = TMath::MaxElement(graph->GetN(), graph->GetX());
117  m_mvaRes[decayModeIndex][etaIndex] = std::unique_ptr<TGraph>(graph);
118  ATH_MSG_DEBUG("Adding graph: " << graphName);
119  }
120  else {
121  ATH_MSG_FATAL("Failed to get an object with name " << graphName);
122  return StatusCode::FAILURE;
123  }
124  }
125  }
126  }
127  calFile->Close();
128 
129  return StatusCode::SUCCESS;
130 }
131 
132 
133 
135  TLorentzVector combinedP4(tau.p4(xAOD::TauJetParameters::TauEnergyScale));
136 
137  // used to store immediate results
139 
140  // Parameterization is only valid for |eta| < 2.5, and decay modes of 1p0n, 1p1n, 1pXn, 3p0n, 3pXn
141  // If these variables of the given tau candidate are outside the range, we just use calo TES
142  if(isValid(tau)) {
143  combinedP4 = getCombinedP4(tau, variables);
144  }
145 
146  static const SG::Accessor<float> decPtCombined("ptCombined");
147  static const SG::Accessor<float> decEtaCombined("etaCombined");
148  static const SG::Accessor<float> decPhiCombined("phiCombined");
149  static const SG::Accessor<float> decMCombined("mCombined");
150 
151  decPtCombined(tau) = combinedP4.Pt();
152  decEtaCombined(tau) = combinedP4.Eta();
153  decPhiCombined(tau) = combinedP4.Phi();
154  decMCombined(tau) = combinedP4.M();
155 
157  static const SG::Accessor<float> decPtConstituent("pt_constituent");
158  static const SG::Accessor<float> decPtTauRecCalibrated("pt_tauRecCalibrated");
159  static const SG::Accessor<float> decPtWeighted("pt_weighted");
160  static const SG::Accessor<float> decWeightWeighted("weight_weighted");
161  static const SG::Accessor<float> decSigmaCompatibility("sigma_compatibility");
162  static const SG::Accessor<float> decSigmaTaurec("sigma_tauRec");
163  static const SG::Accessor<float> decSigmaConstituent("sigma_constituent");
164  static const SG::Accessor<float> decCorrelationCoefficient("correlation_coefficient");
165 
166  decPtConstituent(tau) = variables.pt_constituent;
167  decPtTauRecCalibrated(tau) = variables.pt_tauRecCalibrated;
168  decPtWeighted(tau) = variables.pt_weighted;
169  decWeightWeighted(tau) = variables.weight;
170  decSigmaCompatibility(tau) = variables.sigma_compatibility;
171  decSigmaTaurec(tau) = variables.sigma_tauRec;
172  decSigmaConstituent(tau) = variables.sigma_constituent;
173  decCorrelationCoefficient(tau) = variables.corrcoeff;
174  }
175 
176  return StatusCode::SUCCESS;
177 }
178 
179 
180 
182  if (! isValid(tau)) return false;
183 
185  int decayModeIndex = getDecayModeIndex(decayMode);
186 
187  int etaIndex = getEtaIndex(tau.etaTauEnergyScale());
188 
189  double caloSigma = tau.ptTauEnergyScale() * getCaloResolution(tau.ptTauEnergyScale(), decayModeIndex, etaIndex);
190  double deltaEt = tau.ptFinalCalib() - tau.ptTauEnergyScale();
191 
192  bool compatibility = true;
193 
194  // FIXME: should we use combinedSigma here ??
195  if (std::abs(deltaEt) > 5 * caloSigma) {
196  compatibility = false;
197  }
198 
199  return compatibility;
200 }
201 
202 
203 
205  // It would be better to retrieve eta bins from the calibration file, e.g. for upgrade studies!
206  if (std::abs(eta) < 0.3) {
207  return 0;
208  }
209  if (std::abs(eta) < 0.8) {
210  return 1;
211  }
212  if (std::abs(eta) < 1.3) {
213  return 2;
214  }
215  if (std::abs(eta) < 1.6) {
216  return 3;
217  }
218  // slightly extend the tau eta range, as |eta|<2.5 applies to the seed jet
219  if (std::abs(eta) < 2.6) {
220  return 4;
221  }
222 
223  return 99;
224 }
225 
226 
227 
231 
232  return static_cast<xAOD::TauJetParameters::DecayMode>(decayMode);
233 }
234 
235 
236 
238  return static_cast<int>(decayMode);
239 }
240 
241 
242 
243 bool TauCombinedTES::isValid(const xAOD::TauJet& tau) const {
245  if (decayMode < xAOD::TauJetParameters::Mode_1p0n || decayMode > xAOD::TauJetParameters::Mode_3pXn) {
246  ATH_MSG_DEBUG("Decay mode is not supported !");
247  return false;
248  }
249 
250  int etaIndex = getEtaIndex(tau.etaTauEnergyScale());
251  if (etaIndex > 4) {
252  ATH_MSG_DEBUG("Eta is out of the supported range !");
253  return false;
254  }
255 
256  return true;
257 }
258 
259 
260 
261 double TauCombinedTES::getCorrelation(int decayModeIndex, int etaIndex) const {
262  return m_correlationHists[decayModeIndex]->GetBinContent(etaIndex);
263 }
264 
265 
266 
267 double TauCombinedTES::getCaloCalEt(double caloEt,
268  int decayModeIndex,
269  int etaIndex) const {
270  // ratio stored in the calibration graph equals (caloEt-truthEt)/caloEt
271  double ratio = 0.0;
272 
273  // FIXME: If caloEt is larger than max et, could we use the ratio at
274  // max et, instead of setting it to zero
275  if (caloEt <= m_caloRelBiasMaxEt[decayModeIndex][etaIndex]) {
276  ratio = m_caloRelBias[decayModeIndex][etaIndex]->Eval(caloEt);
277  }
278 
279  double caloCalEt = caloEt - ratio * caloEt;
280 
281  return caloCalEt;
282 }
283 
284 
285 
286 double TauCombinedTES::getPanTauCalEt(double panTauEt,
287  int decayModeIndex,
288  int etaIndex) const {
289  // ratio stored in the calibration graph equals (panTauEt-truthEt)/panTauEt
290  double ratio = 0.0;
291 
292  // Substructure is badly determined at high pt, as track momentum is pooryly measured
293  if (panTauEt <= m_panTauRelBiasMaxEt[decayModeIndex][etaIndex]) {
294  ratio = m_panTauRelBias[decayModeIndex][etaIndex]->Eval(panTauEt);
295  }
296 
297  double panTauCalEt = panTauEt - ratio * panTauEt;
298 
299  return panTauCalEt;
300 }
301 
302 
303 
305  // Assume the resolution to be 100% when no parametrisation is available
306  // "validity" criteria might have to be revised if such "invalid taus" end up in analyses
307  if (!isValid(tau) || !m_useMvaResolution) return 1.0;
308 
310  int decayModeIndex = getDecayModeIndex(decayMode);
311 
312  int etaIndex = getEtaIndex(tau.etaFinalCalib());
313 
314  double pt = std::min(tau.ptFinalCalib(), m_mvaResMaxEt[decayModeIndex][etaIndex]);
315  double resolution = m_mvaRes[decayModeIndex][etaIndex]->Eval(pt);
316 
317  return resolution;
318 }
319 
320 
321 
322 double TauCombinedTES::getCaloResolution(double et, int decayModeIndex, int etaIndex) const {
323  double x = std::min(et, m_caloResMaxEt[decayModeIndex][etaIndex]);
324  double resolution = m_caloRes[decayModeIndex][etaIndex]->Eval(x);
325 
326  return resolution;
327 }
328 
329 
330 
331 double TauCombinedTES::getPanTauResolution(double et, int decayModeIndex, int etaIndex) const {
332  double x = std::min(et, m_panTauResMaxEt[decayModeIndex][etaIndex]);
333  double resolution = m_panTauRes[decayModeIndex][etaIndex]->Eval(x);
334 
335  return resolution;
336 }
337 
338 
339 
340 double TauCombinedTES::getWeight(double caloSigma,
341  double panTauSigma,
342  double correlation) const {
343  double cov = correlation * caloSigma * panTauSigma;
344  double caloWeight = std::pow(panTauSigma, 2) - cov;
345  double panTauWeight = std::pow(caloSigma, 2) - cov;
346 
347  double weight = (caloWeight + panTauWeight !=0.) ? caloWeight/(caloWeight + panTauWeight) : 0.;
348  // enforce that the weight is within [0,1]
349  return std::clamp(weight, 0., 1.);
350 }
351 
353  double panTauSigma,
354  double correlation) const {
355  double compatibilitySigma2 = std::pow(caloSigma, 2) + std::pow(panTauSigma, 2) - 2 * correlation * caloSigma * panTauSigma;
356 
357  return std::sqrt(compatibilitySigma2);
358 }
359 
360 
361 
362 double TauCombinedTES::getNsigmaCompatibility(double et, int decayModeIndex) const {
363  double nsigma = m_nSigmaCompatibility.at(decayModeIndex)->Eval(et);
364 
365  if (nsigma < 0.) return 0.;
366 
367  return nsigma;
368 }
369 
370 
371 
372 double TauCombinedTES::getCombinedEt(double caloEt,
373  double panTauEt,
375  float eta,
376  Variables& variables) const {
377  // Obtain the index of calibration graph
378  int decayModeIndex = getDecayModeIndex(decayMode);
379  int etaIndex = getEtaIndex(eta);
380 
381  // Obtain the calibration parameter based on the index
382  // -- Correlation between calo TES and PanTau
383  double correlation = getCorrelation(decayModeIndex, etaIndex);
384 
385  // -- Sigma of the difference between reconstruted et and truth et at calo TES
386  double caloSigma = caloEt * getCaloResolution(caloEt, decayModeIndex, etaIndex);
387  if (0. == caloSigma) {
388  ATH_MSG_WARNING("Calo TES: Et resolution at " << caloEt << " is 0");
389  m_caloRes[decayModeIndex][etaIndex]->Print("all");
390  return 0.;
391  }
392 
393  // -- Sigma of the difference between reconstruted et and truth et at PanTau
394  double panTauSigma = panTauEt * getPanTauResolution(panTauEt, decayModeIndex, etaIndex);
395  if (0. == panTauSigma) {
396  ATH_MSG_WARNING("PanTau: Et resolution at " << panTauEt << " is 0");
397  m_panTauRes[decayModeIndex][etaIndex]->Print("all");
398  return 0.;
399  }
400 
401  // -- Et at calo TES with bias corrected
402  double caloCalEt = getCaloCalEt(caloEt, decayModeIndex, etaIndex);
403 
404  // -- Et at PanTau with bias corrected
405  double panTauCalEt = getPanTauCalEt(panTauEt, decayModeIndex, etaIndex);
406 
407  // Combination of calo TES and PanTau
408  // FIXME: A more consistent way would be calculating the weight use bias corrected Et as input
409  double weight = getWeight(caloSigma, panTauSigma, correlation);
410  double weightedEt = weight * caloCalEt + (1 - weight) * panTauCalEt;
411  double compatibilitySigma = getCompatibilitySigma(caloSigma, panTauSigma, correlation);
412 
413  // FIXME: weighteEt will be updated in case the difference of calo TES and PanTau is too large
414  variables.pt_weighted = weightedEt;
415 
416  // If the difference of calo TES and PanTau is too large, the combined result
417  // may not be reliable
418  // FIXME: A more consistent way would be calculating the NsigmaCompatibility use caloCalEt
419  double deltaEt = caloCalEt - panTauCalEt;
420  if (std::abs(deltaEt) > getNsigmaCompatibility(caloEt, decayModeIndex) * compatibilitySigma) {
421  // FIXME: Why not use caloCalEt here ?
422  weightedEt = caloEt;
423  }
424 
425  // Store the results
426  variables.corrcoeff = correlation;
427  variables.sigma_tauRec = caloSigma;
428  variables.sigma_constituent = panTauSigma;
429  variables.pt_tauRecCalibrated = caloCalEt;
430  variables.pt_constituent = panTauCalEt;
431  variables.weight = weight;
432  variables.sigma_compatibility = compatibilitySigma;
433 
434  ATH_MSG_DEBUG("Intermediate results\n" <<
435  "coff: " << correlation << " sigma(calo): " << caloSigma << " sigma(constituent): " << panTauSigma <<
436  "\ncalibrated et(calo): " << caloCalEt << " calibrated et(constituent): " << panTauCalEt <<
437  "\nweight:" << weight << " combined et: " << weightedEt << " compatibility sigma: " << compatibilitySigma);
438 
439  return weightedEt;
440 }
441 
442 
443 
444 TLorentzVector TauCombinedTES::getCombinedP4(const xAOD::TauJet& tau, Variables& variables) const {
445  TLorentzVector caloP4 = tau.p4(xAOD::TauJetParameters::TauEnergyScale);
446  TLorentzVector panTauP4 = tau.p4(xAOD::TauJetParameters::PanTauCellBased);
447 
448  ATH_MSG_DEBUG("Four momentum at calo TES, pt: " << caloP4.Pt() << " eta: " << caloP4.Eta() <<
449  " phi: " << caloP4.Phi() << " mass: " << caloP4.M());
450  ATH_MSG_DEBUG("Four momentum at PanTau, pt: " << panTauP4.Pt() << " eta: " << panTauP4.Eta() <<
451  " phi: " << panTauP4.Phi() << " mass: " << panTauP4.M());
452 
454 
455  double combinedEt = getCombinedEt(caloP4.Et(), panTauP4.Et(), decayMode, caloP4.Eta(), variables);
456 
457  // Et is the combination of calo TES and PanTau, but eta and phi is from PanTau
458  TLorentzVector combinedP4;
459  combinedP4.SetPtEtaPhiM(combinedEt, panTauP4.Eta(), panTauP4.Phi(), 0.);
460 
461  ATH_MSG_DEBUG("Combined four momentum, pt: " << combinedP4.Pt() << " eta: " << combinedP4.Eta() <<
462  " phi: " << combinedP4.Phi() << " mass: " << combinedP4.M());
463 
464  return combinedP4;
465 }
TauCombinedTES::getCaloCalEt
double getCaloCalEt(double et, int decayModeIndex, int etaIndex) const
Get the Et at the calo TES after calibration correction.
Definition: TauCombinedTES.cxx:267
xAOD::TauJetParameters::PanTau_DecayMode
@ PanTau_DecayMode
Definition: TauDefs.h:360
TauCombinedTES::getMvaEnergyResolution
double getMvaEnergyResolution(const xAOD::TauJet &tau) const
Get MVA Et resolution, invoked by METSignificance.
Definition: TauCombinedTES.cxx:304
TauCombinedTES::m_mvaResMaxEt
std::array< std::array< double, EtaBinning >, DecayModeBinning > m_mvaResMaxEt
Maximum Et of m_mvaRes.
Definition: TauCombinedTES.h:136
TauCombinedTES::getTESCompatibility
bool getTESCompatibility(const xAOD::TauJet &tau) const
Check if MVA TES and CaloTES are compatible, invoked by TauSmearing tool.
Definition: TauCombinedTES.cxx:181
et
Extra patterns decribing particle interation process.
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
xAOD::TauJet_v3::etaTauEnergyScale
double etaTauEnergyScale() const
checkCoolLatestUpdate.variables
variables
Definition: checkCoolLatestUpdate.py:13
AddEmptyComponent.histName
string histName
Definition: AddEmptyComponent.py:64
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
SG::Accessor< float >
TauCombinedTES::getDecayModeIndex
int getDecayModeIndex(xAOD::TauJetParameters::DecayMode decayMode) const
Get the index of decay mode in the calibration histogram.
Definition: TauCombinedTES.cxx:237
TauCombinedTES::m_useMvaResolution
Gaudi::Property< bool > m_useMvaResolution
Definition: TauCombinedTES.h:41
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
TauCombinedTES::EtaBinning
@ EtaBinning
Definition: TauCombinedTES.h:100
plotmaker.hist
hist
Definition: plotmaker.py:148
min
constexpr double min()
Definition: ap_fixedTest.cxx:26
TauCombinedTES::isValid
bool isValid(const xAOD::TauJet &tau) const
Whether the tau candidate is valid for the calculation.
Definition: TauCombinedTES.cxx:243
TauCombinedTES::m_caloRelBiasMaxEt
std::array< std::array< double, EtaBinning >, DecayModeBinning > m_caloRelBiasMaxEt
Maximum Et of m_caloRelBias.
Definition: TauCombinedTES.h:112
xAOD::TauJet_v3::etaFinalCalib
double etaFinalCalib() const
TauRecToolBase
The base class for all tau tools.
Definition: TauRecToolBase.h:21
plotBeamSpotVxVal.cov
cov
Definition: plotBeamSpotVxVal.py:201
TauCombinedTES::getEtaIndex
int getEtaIndex(float eta) const
Get the index of eta in the calibration histogram.
Definition: TauCombinedTES.cxx:204
test_pyathena.pt
pt
Definition: test_pyathena.py:11
TauCombinedTES::initialize
virtual StatusCode initialize() override
Tool initializer.
Definition: TauCombinedTES.cxx:19
TauCombinedTES::DecayModeBinning
@ DecayModeBinning
Definition: TauCombinedTES.h:100
TauCombinedTES::m_calFileName
Gaudi::Property< std::string > m_calFileName
Definition: TauCombinedTES.h:40
TauCombinedTES::m_nSigmaCompatibility
std::array< std::unique_ptr< TF1 >, DecayModeBinning > m_nSigmaCompatibility
Maximum tolerence in unit of combined sigma, as a function of calo Et.
Definition: TauCombinedTES.h:142
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:367
x
#define x
TauCombinedTES::m_addCalibrationResultVariables
Gaudi::Property< bool > m_addCalibrationResultVariables
Definition: TauCombinedTES.h:39
Dedxcorrection::resolution
double resolution[nGasTypes][nParametersResolution]
Definition: TRT_ToT_Corrections.h:46
TauCombinedTES::getCorrelation
double getCorrelation(int decayModeIndex, int etaIndex) const
Get correlation coefficient between the calo TES and PanTau.
Definition: TauCombinedTES.cxx:261
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:189
xAOD::TauJetParameters::DecayMode
DecayMode
Definition: TauDefs.h:385
xAOD::TauJet_v3::ptTauEnergyScale
double ptTauEnergyScale() const
TauCombinedTES::Variables
Definition: TauCombinedTES.h:44
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
TauCombinedTES::m_decayModeNames
const std::array< std::string, DecayModeBinning > m_decayModeNames
Decay mode binning in the calibration graph/hist.
Definition: TauCombinedTES.h:103
TauCombinedTES::getCaloResolution
double getCaloResolution(double et, int decayModeIndex, int etaIndex) const
Get the resolution of Et at the calo TES.
Definition: TauCombinedTES.cxx:322
xAOD::TauJet_v3
Class describing a tau jet.
Definition: TauJet_v3.h:41
TauCombinedTES::getCompatibilitySigma
double getCompatibilitySigma(double caloSigma, double panTauSigma, double correlation) const
Get the compatibility sigma of calo TES and PanTau.
Definition: TauCombinedTES.cxx:352
TauCombinedTES::m_correlationHists
std::array< std::unique_ptr< TH1F >, DecayModeBinning > m_correlationHists
Calibration histogram: correlation coefficient of calo TES and PanTau.
Definition: TauCombinedTES.h:139
TauCombinedTES::m_panTauRelBias
std::array< std::array< std::unique_ptr< TGraph >, EtaBinning >, DecayModeBinning > m_panTauRelBias
Calibration graph: mean of bias/panTauEt as a funtion of panTauEt.
Definition: TauCombinedTES.h:121
TauCombinedTES::m_etaBinNames
const std::array< std::string, EtaBinning > m_etaBinNames
Eta binning in the calibration graph.
Definition: TauCombinedTES.h:106
xAOD::TauJetParameters::PanTauCellBased
@ PanTauCellBased
Definition: TauDefs.h:344
TauCombinedTES::getWeight
double getWeight(double caloSigma, double panTauSigma, double correlatioon) const
Get the weight of calo TES.
Definition: TauCombinedTES.cxx:340
TauCombinedTES::getDecayMode
xAOD::TauJetParameters::DecayMode getDecayMode(const xAOD::TauJet &tau) const
Get the decay mode of the tau candidate.
Definition: TauCombinedTES.cxx:228
TauCombinedTES.h
xAOD::TauJetParameters::TauEnergyScale
@ TauEnergyScale
Definition: TauDefs.h:339
TauCombinedTES::execute
virtual StatusCode execute(xAOD::TauJet &xTau) const override
Execute - called for each tau candidate.
Definition: TauCombinedTES.cxx:134
TauCombinedTES::getPanTauResolution
double getPanTauResolution(double et, int decayModeIndex, int etaIndex) const
Get the resolution of Et at PanTau.
Definition: TauCombinedTES.cxx:331
TauCombinedTES::m_panTauRelBiasMaxEt
std::array< std::array< double, EtaBinning >, DecayModeBinning > m_panTauRelBiasMaxEt
Maximum Et of m_panTauRelBias.
Definition: TauCombinedTES.h:124
TauCombinedTES::getPanTauCalEt
double getPanTauCalEt(double panTauEt, int decayModeIndex, int etaIndex) const
Get the Et at PanTau after calibration correction.
Definition: TauCombinedTES.cxx:286
TauCombinedTES::getNsigmaCompatibility
double getNsigmaCompatibility(double caloEt, int decayModeIndex) const
Get the allowed difference between calo TES and PanTau.
Definition: TauCombinedTES.cxx:362
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
TauRecToolBase::find_file
std::string find_file(const std::string &fname) const
Definition: TauRecToolBase.cxx:19
TauCombinedTES::TauCombinedTES
TauCombinedTES(const std::string &name="TauCombinedTES")
Definition: TauCombinedTES.cxx:13
TauCombinedTES::m_caloRelBias
std::array< std::array< std::unique_ptr< TGraph >, EtaBinning >, DecayModeBinning > m_caloRelBias
Calibration graph: mean of bias/caloEt as a function of caloEt.
Definition: TauCombinedTES.h:109
TauCombinedTES::m_caloResMaxEt
std::array< std::array< double, EtaBinning >, DecayModeBinning > m_caloResMaxEt
Maximum Et of m_caloRes.
Definition: TauCombinedTES.h:118
python.compareTCTs.ratio
ratio
Definition: compareTCTs.py:295
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
xAOD::TauJet_v3::p4
virtual FourMom_t p4() const
The full 4-momentum of the particle.
Definition: TauJet_v3.cxx:97
xAOD::TauJetParameters::Mode_3pXn
@ Mode_3pXn
Definition: TauDefs.h:390
TauCombinedTES::m_caloRes
std::array< std::array< std::unique_ptr< TGraph >, EtaBinning >, DecayModeBinning > m_caloRes
Calibration graph: resolution at Calo TES as a function of caloEt.
Definition: TauCombinedTES.h:115
TauCombinedTES::m_panTauResMaxEt
std::array< std::array< double, EtaBinning >, DecayModeBinning > m_panTauResMaxEt
Maximum Et of m_panTauRes.
Definition: TauCombinedTES.h:130
xAOD::TauJetParameters::Mode_Error
@ Mode_Error
Definition: TauDefs.h:393
python.TrigEgammaMonitorHelper.TH1F
def TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)
Definition: TrigEgammaMonitorHelper.py:24
TauCombinedTES::getCombinedEt
double getCombinedEt(double caloEt, double et_substructure, xAOD::TauJetParameters::DecayMode decayMode, float eta, Variables &variables) const
Get the combined Et of calo TES and PanTau.
Definition: TauCombinedTES.cxx:372
TauCombinedTES::m_mvaRes
std::array< std::array< std::unique_ptr< TGraph >, EtaBinning >, DecayModeBinning > m_mvaRes
Calibration graph: MVA TES resolution as a function of MVA pt.
Definition: TauCombinedTES.h:133
TauCombinedTES::getCombinedP4
TLorentzVector getCombinedP4(const xAOD::TauJet &tau, Variables &variables) const
Get the weighted four momentum of calo TES and PanTau.
Definition: TauCombinedTES.cxx:444
pow
constexpr int pow(int base, int exp) noexcept
Definition: ap_fixedTest.cxx:15
xAOD::TauJet_v3::ptFinalCalib
double ptFinalCalib() const
TauCombinedTES::m_panTauRes
std::array< std::array< std::unique_ptr< TGraph >, EtaBinning >, DecayModeBinning > m_panTauRes
Calibration graph: resolution at PanTau as a function of panTauEt.
Definition: TauCombinedTES.h:127