ATLAS Offline Software
Classes | Enumerations | Functions
TauAnalysisTools Namespace Reference

Classes

class  BuildTruthTaus
 
class  CommonDiTauEfficiencyTool
 
class  CommonDiTauSmearingTool
 
class  CommonEfficiencyTool
 
class  CommonSmearingTool
 
class  DiTauEfficiencyCorrectionsTool
 
class  DiTauSelectionCut
 
class  DiTauSelectionCutAbsEta
 
class  DiTauSelectionCutNSubjets
 
class  DiTauSelectionCutPt
 
class  DiTauSelectionTool
 
class  DiTauSmearingTool
 
class  DiTauTruthMatchingTool
 
class  IBuildTruthTaus
 
class  IDiTauEfficiencyCorrectionsTool
 
class  IDiTauSelectionTool
 Interface for tau selector tool. More...
 
class  IDiTauSmearingTool
 
class  IDiTauTruthMatchingTool
 
class  ITauEfficiencyCorrectionsTool
 
class  ITauHFVetoTool
 
class  ITauSelectionTool
 Interface for tau selector tool. More...
 
class  ITauSmearingTool
 
class  ITauTruthMatchingTool
 
class  ITauTruthTrackMatchingTool
 
struct  ROOT6_NamespaceAutoloadHook
 
class  TauAnalysisToolsExampleAthena
 
class  TauEfficiencyCorrectionsTool
 
class  TauEfficiencyTriggerTool
 
class  TauHFVetoTool
 
class  TauSelectionCut
 
class  TauSelectionCutAbsCharge
 
class  TauSelectionCutAbsEta
 
class  TauSelectionCutEleIDWP
 
class  TauSelectionCutGNTauScoreSigTrans
 
class  TauSelectionCutJetIDWP
 
class  TauSelectionCutMuonOLR
 
class  TauSelectionCutNTracks
 
class  TauSelectionCutPt
 
class  TauSelectionCutRNNEleScore
 
class  TauSelectionCutRNNJetScoreSigTrans
 
class  TauSelectionTool
 
class  TauSmearingTool
 
class  TauTruthMatchingTool
 
class  TauTruthTrackMatchingTool
 

Enumerations

enum  JetID {
  JETIDNONEUNCONFIGURED = 0, JETIDNONE = 1, JETIDBDTVERYLOOSE = 2, JETIDBDTLOOSE = 3,
  JETIDBDTMEDIUM = 4, JETIDBDTTIGHT = 5, JETIDRNNVERYLOOSE = 6, JETIDRNNLOOSE = 7,
  JETIDRNNMEDIUM = 8, JETIDRNNTIGHT = 9, JETIDGNTAUVERYLOOSE = 10, JETIDGNTAULOOSE = 11,
  JETIDGNTAUMEDIUM = 12, JETIDGNTAUTIGHT = 13
}
 
enum  EleID {
  ELEIDNONEUNCONFIGURED = 0, ELEIDNONE = 1, ELEIDRNNLOOSE = 2, ELEIDRNNMEDIUM = 3,
  ELEIDRNNTIGHT = 4
}
 
enum  SelectionCuts {
  NoCut = 0, CutPt = 1, CutAbsEta = 1<<1, CutPhi = 1<<2,
  CutNTrack = 1<<3, CutAbsCharge = 1<<4, CutJetIDWP = 1<<5, CutEleRNNScore = 1<<6,
  CutEleIDWP = 1<<7, CutMuonOLR = 1<<8, CutJetRNNScoreSigTrans = 1<<9, CutGNTauScoreSigTrans = 1<<10
}
 
enum  DiTauSelectionCuts { NoDiTauCut = 0, DiTauCutPt = 1, DiTauCutAbsEta = 1<<1, DiTauCutNSubjets = 1<<2 }
 
enum  EfficiencyCorrectionType {
  SFRecoHadTau = 0, SFJetIDHadTau = 4, SFEleIDHadTau = 8, SFEleIDElectron = 10,
  SFTriggerHadTau = 12, SFDecayModeHadTau = 16
}
 
enum  EfficiencyCorrectionSystematicType { STAT = 1, SYST = 2 }
 
enum  TruthMatchedParticleType {
  Unknown = 0, TruthHadronicTau = 1, TruthLeptonicTau = 2, TruthMuon = 3,
  TruthElectron = 4, TruthJet = 5, TruthHadronicDiTau = 6
}
 
enum  TrackType_t {
  UnclassifiedTrack = 0, TauTrack = 1, ConversionTrack = 2, UnderlyingEventTrack = 3,
  SecondaryTrack = 4, PileupTrack = 5, FakeTrack = 6
}
 

Functions

double TruthLeadPt (const xAOD::DiTauJet &xDiTau)
 return the truth vis pT of the leading pT matched particle. More...
 
double TruthSubleadPt (const xAOD::DiTauJet &xDiTau)
 return the truth vis pT of the subleading pT matched particle. More...
 
double TruthDeltaR (const xAOD::DiTauJet &xDiTau)
 return the dR of between the leading and subleading pT matched particle. More...
 
void split (const std::string &sInput, const char cDelim, std::vector< std::string > &vOut)
 
void split (TEnv &rEnv, const std::string &sIn, const char cDelim, std::vector< std::string > &vOut)
 
void split (TEnv &rEnv, const std::string &sIn, const char cDelim, std::vector< size_t > &vOut)
 
void split (TEnv &rEnv, const std::string &sIn, const char cDelim, std::vector< int > &vOut)
 
void split (TEnv &rEnv, const std::string &sIn, const char cDelim, std::vector< unsigned > &vOut)
 
void split (TEnv &rEnv, const std::string &sIn, const char cDelim, std::vector< float > &vOut)
 
void split (TEnv &rEnv, const std::string &sIn, const char cDelim, std::vector< double > &vOut)
 
double tauPt (const xAOD::TauJet &xTau)
 return tau pt in GeV More...
 
double tauP (const xAOD::TauJet &xTau)
 return tau P in GeV More...
 
double tauEta (const xAOD::TauJet &xTau)
 return tau eta More...
 
double tauAbsEta (const xAOD::TauJet &xTau)
 return absolute tau eta More...
 
double finalTauPt (const xAOD::TauJet &xTau)
 return MVA based tau pt in GeV More...
 
double finalTauEta (const xAOD::TauJet &xTau)
 return MVA based tau eta More...
 
double finalTauAbsEta (const xAOD::TauJet &xTau)
 return MVA based absolute tau eta More...
 
double finalTauP (const xAOD::TauJet &xTau)
 return MVA based tau P in GeV More...
 
double tauLeadTrackEta (const xAOD::TauJet &xTau)
 return leading charge tau track eta More...
 
double truthTauPt (const xAOD::TauJet &xTau)
 return truth match tau pt in GeV (if hadronic truth tau match) More...
 
double truthTauAbsEta (const xAOD::TauJet &xTau)
 return truth match tau eta (if hadronic truth tau match) More...
 
double truthDecayMode (const xAOD::TauJet &xTau)
 return truth decay mode (if hadronic truth tau match) More...
 
const xAOD::TruthParticlegetTruth (const xAOD::TauJet &xTau)
 
xAOD::TauJetParameters::DecayMode getTruthDecayMode (const xAOD::TruthParticle &xTruthTau)
 Get the Truth Decay Mode from TruthTau particle. More...
 
xAOD::TauJetParameters::DecayMode getTruthDecayMode (const xAOD::TauJet &xTau)
 Get the Truth Decay Mode from TruthTau particle. More...
 
int getNTauDecayParticles (const xAOD::TruthParticle &xTruthTau, int iPdgId, bool bCompareAbsoluteValues)
 Count truth matched decay particles of a particular PDGID. More...
 
bool testFileForEOFContainsCharacters (const std::string &sFileName)
 returns true if last line in file is empty or the line starts with the number sign More...
 
void createPi0Vectors (const xAOD::TauJet *xTau, std::vector< TLorentzVector > &vPi0s)
 
void correctedPi0Vectors (const xAOD::TauJet *xTau, std::vector< TLorentzVector > &correctedPi0s, TLorentzVector &TauP4)
 
void truthHadrons (const xAOD::TruthParticle *xTruthTau, std::vector< const xAOD::TruthParticle * > &vChargedHadrons, std::vector< const xAOD::TruthParticle * > &vNeutralHadrons)
 return charged and neutral daughters of truth tau More...
 
void truthHadrons (const xAOD::TauJet *xTau, std::vector< const xAOD::TruthParticle * > &vChargedHadrons, std::vector< const xAOD::TruthParticle * > &vNeutralHadrons)
 return charged and neutral daughters of hadronic truth matched taujet More...
 
TruthMatchedParticleType getTruthParticleType (const xAOD::TauJet &xTau)
 return TauJet match type More...
 
TruthMatchedParticleType getTruthParticleType (const xAOD::DiTauJet &xDiTau)
 return DiTauJet match type More...
 
std::vector< const xAOD::TauJet * > combineTauJetsWithMuonRM (const xAOD::TauJetContainer *taus_std, const xAOD::TauJetContainer *taus_muonRM)
 combine the standard taujets container with the muon removal container More...
 

Enumeration Type Documentation

◆ DiTauSelectionCuts

Enumerator
NoDiTauCut 
DiTauCutPt 
DiTauCutAbsEta 
DiTauCutNSubjets 

Definition at line 55 of file PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h.

56  {
57  NoDiTauCut = 0, // 000000000000
58  DiTauCutPt = 1, // 000000000001
59  DiTauCutAbsEta = 1<<1, // 000000000010
60  DiTauCutNSubjets = 1<<2, // 000000000100
61  };

◆ EfficiencyCorrectionSystematicType

Enumerator
STAT 
SYST 

Definition at line 88 of file PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h.

89  {
90  STAT = 1,
91  SYST = 2
92  };

◆ EfficiencyCorrectionType

Enumerator
SFRecoHadTau 
SFJetIDHadTau 
SFEleIDHadTau 
SFEleIDElectron 
SFTriggerHadTau 
SFDecayModeHadTau 

Definition at line 63 of file PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h.

64  {
65  SFRecoHadTau = 0,
66  // SFRecoJet = 1,
67  // SFRecoElectron = 2,
68  // SFRecoMuon = 3,
69 
70  SFJetIDHadTau = 4,
71  // SFJetIDJet = 5,
72  // SFJetIDElectron = 6,
73  // SFJetIDMuon = 7,
74 
75  SFEleIDHadTau = 8,
76  // SFEleIDJet = 9,
77  SFEleIDElectron = 10,
78  // SFEleIDMuon = 11,
79 
80  SFTriggerHadTau = 12,
81  // SFEleIDJet = 13,
82  // SFEleIDElectron = 14,
83  // SFEleIDMuon = 15,
84 
85  SFDecayModeHadTau = 16,
86  };

◆ EleID

Enumerator
ELEIDNONEUNCONFIGURED 
ELEIDNONE 
ELEIDRNNLOOSE 
ELEIDRNNMEDIUM 
ELEIDRNNTIGHT 

Definition at line 29 of file PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h.

30  {
32  ELEIDNONE = 1,
33  ELEIDRNNLOOSE = 2,
34  ELEIDRNNMEDIUM = 3,
35  ELEIDRNNTIGHT = 4,
36  };

◆ JetID

Enumerator
JETIDNONEUNCONFIGURED 
JETIDNONE 
JETIDBDTVERYLOOSE 
JETIDBDTLOOSE 
JETIDBDTMEDIUM 
JETIDBDTTIGHT 
JETIDRNNVERYLOOSE 
JETIDRNNLOOSE 
JETIDRNNMEDIUM 
JETIDRNNTIGHT 
JETIDGNTAUVERYLOOSE 
JETIDGNTAULOOSE 
JETIDGNTAUMEDIUM 
JETIDGNTAUTIGHT 

Definition at line 11 of file PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h.

12  {
14  JETIDNONE = 1,
16  JETIDBDTLOOSE = 3,
17  JETIDBDTMEDIUM = 4,
18  JETIDBDTTIGHT = 5,
20  JETIDRNNLOOSE = 7,
21  JETIDRNNMEDIUM = 8,
22  JETIDRNNTIGHT = 9,
24  JETIDGNTAULOOSE = 11,
25  JETIDGNTAUMEDIUM = 12,
26  JETIDGNTAUTIGHT = 13,
27  };

◆ SelectionCuts

Enumerator
NoCut 
CutPt 
CutAbsEta 
CutPhi 
CutNTrack 
CutAbsCharge 
CutJetIDWP 
CutEleRNNScore 
CutEleIDWP 
CutMuonOLR 
CutJetRNNScoreSigTrans 
CutGNTauScoreSigTrans 

Definition at line 38 of file PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h.

39  {
40  // FIXME: harmonise names for RNN score cuts: "CutEleRNNScore" vs "CutJetRNNScoreSigTrans"
41  NoCut = 0, // 000000000000
42  CutPt = 1, // 000000000001
43  CutAbsEta = 1<<1, // 000000000010
44  CutPhi = 1<<2, // 000000000100
45  CutNTrack = 1<<3, // 000000001000
46  CutAbsCharge = 1<<4, // 000000010000
47  CutJetIDWP = 1<<5, // 000000100000
48  CutEleRNNScore = 1<<6, // 000001000000
49  CutEleIDWP = 1<<7, // 000010000000
50  CutMuonOLR = 1<<8, // 000100000000
51  CutJetRNNScoreSigTrans = 1<<9, // 001000000000
52  CutGNTauScoreSigTrans = 1<<10 // 010000000000
53  };

◆ TrackType_t

Enumerator
UnclassifiedTrack 
TauTrack 
ConversionTrack 
UnderlyingEventTrack 
SecondaryTrack 
PileupTrack 
FakeTrack 

Definition at line 27 of file TauTruthTrackMatchingTool.h.

28 {
29  UnclassifiedTrack = 0, // Track is unclassified
30  TauTrack = 1, // Track is from direct tau decay
31  ConversionTrack = 2, // Track is from conversion
32  UnderlyingEventTrack = 3, // Track is from underlying event
33  SecondaryTrack = 4, // Track is a secondary track
34  PileupTrack = 5, // Track is from pileup
35  FakeTrack = 6 // Track is a fake
36 };

◆ TruthMatchedParticleType

Enumerator
Unknown 
TruthHadronicTau 
TruthLeptonicTau 
TruthMuon 
TruthElectron 
TruthJet 
TruthHadronicDiTau 

Definition at line 94 of file PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h.

95  {
96  Unknown = 0,
97  TruthHadronicTau = 1,
98  TruthLeptonicTau = 2,
99  TruthMuon = 3,
100  TruthElectron = 4,
101  TruthJet = 5,
103  };

Function Documentation

◆ combineTauJetsWithMuonRM()

std::vector< const xAOD::TauJet * > TauAnalysisTools::combineTauJetsWithMuonRM ( const xAOD::TauJetContainer taus_std,
const xAOD::TauJetContainer taus_muonRM 
)

combine the standard taujets container with the muon removal container

Special function to combine the muon-removed taus with the standard taus. This can impact your MET calculation and OLR. You will know if you need this, otherwise please consult TauCP group.

Definition at line 620 of file PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx.

620  {
624  // std::string message = "found " + std::to_string(taus_muonRM->size()) + " muon-removal taus";
625  // Info("TauAnalysisTools::getTauJetsWithMuonRM", message.c_str());
626  std::vector<const xAOD::TauJet*> taus_murm_vec(taus_muonRM->begin(), taus_muonRM->end());
627  std::vector<const xAOD::TauJet*> taus_combined;
629  originalTauJetAcc ("originalTauJet");
630  for(const xAOD::TauJet* tau_std : *taus_std){
631  auto replacement_itr = std::find_if(taus_murm_vec.begin(), taus_murm_vec.end(),
632  [&](const xAOD::TauJet* tau_murm){
633  auto link_to_ori_tau = originalTauJetAcc (*tau_murm);
634  if (!link_to_ori_tau.isValid()) { return false; }
635  if (*link_to_ori_tau == tau_std){ return true; }
636  return false;
637  }
638  );
639  if (replacement_itr == taus_murm_vec.end()) { taus_combined.push_back(tau_std); }
640  else {
641  // message = "replacement found at TauJets_MuonRM index " + std::to_string((*replacement_itr)->index()) + " for TauJets index " + std::to_string(tau_std->index());
642  // Info("TauAnalysisTools::getTauJetsWithMuonRM", message.c_str());
643  taus_combined.push_back(*replacement_itr);
644  taus_murm_vec.erase(replacement_itr);
645  // message = std::to_string(taus_murm_vec.size()) + " muon-removal taus left";
646  // Info("TauAnalysisTools::getTauJetsWithMuonRM", message.c_str());
647  }
648  }
649  // Every muon-removal tau should have been used, otherwise there is a problem.
650  assert(taus_murm_vec.empty());
651  return taus_combined;
652 }

◆ correctedPi0Vectors()

void TauAnalysisTools::correctedPi0Vectors ( const xAOD::TauJet xTau,
std::vector< TLorentzVector > &  correctedPi0s,
TLorentzVector &  TauP4 
)

Definition at line 379 of file PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx.

379  {
380  //reset the pi0s
381  correctedPi0s.clear();
382 
383  int iDecayMode = -1;
384 
386  {
387  Error("TauAnalysisTools::correctedPi0Vectors", "Failed to retrieve panTauDetail decay mode.");
388  return;
389  }
390 
391  //Reading in the pi0 vector from createPi0Vectors
392  std::vector<TLorentzVector> vPi0s;
393  createPi0Vectors(xTau,vPi0s);
394 
396  //Adding up Pi0 P4s from createPi0Vectors
397  TLorentzVector Sum_vPi0s;
398  for(unsigned int i = 0; i < vPi0s.size() ; i++){
399  Sum_vPi0s += vPi0s[i];
400  }
401 
402  //Get sum of the chargedPFO (i.e. tau track) p4
403  TLorentzVector Sum_ChrgPFOP4;
404  for(const xAOD::TauTrack* track : xTau->tracks()) {
405  Sum_ChrgPFOP4 += track->p4();
406  }
407 
408  //Get tau FinalCalib P4 (explicitly requiring p4(xAOD::TauJetParameters::TauCalibType::FinalCalib) should be superfluous, as FinalCalib is the default p4)
409  TLorentzVector FinalCalibP4 = xTau->p4();
410 
411  //Calculate the difference 3-vector between FinalCalib and Sum of chargedPFOP4
412  double px = FinalCalibP4.Px() - Sum_ChrgPFOP4.Px();
413  double py = FinalCalibP4.Py() - Sum_ChrgPFOP4.Py();
414  double pz = FinalCalibP4.Pz() - Sum_ChrgPFOP4.Pz();
415 
416  double p_correctedPi0s = std::sqrt( std::pow(px,2.) + std::pow(py,2.) + std::pow(pz,2.) );
417  double p_vPi0s = Sum_vPi0s.P();
418 
419  //Calucate scale factor for the pi0 3-vector momentum
420  double X = p_correctedPi0s/p_vPi0s;
421 
422  //Scale the pi0s with X and recalculate the new pi0 energy
423  double px_scaled, py_scaled, pz_scaled, e;
424  double mPi0 = 134.977;
425  for(unsigned int i = 0; i < vPi0s.size() ; i++){
426  px_scaled = vPi0s[i].Px() * X;
427  py_scaled = vPi0s[i].Py() * X;
428  pz_scaled = vPi0s[i].Pz() * X;
429  e = std::sqrt( std::pow(px_scaled,2.) + std::pow(py_scaled,2.) + std::pow(pz_scaled,2.) + std::pow(mPi0,2.) );
430 
431  //Append the corrected pi0P4 to correctedPi0s
432  TLorentzVector P4_correctedPi0s;
433  P4_correctedPi0s.SetPxPyPzE(px_scaled,py_scaled,pz_scaled,e);
434  correctedPi0s.push_back(P4_correctedPi0s);
435  }
436  }else{
437  correctedPi0s = vPi0s;
438  }
439 
440  //Correct angles between pi0s for 1pXn decays with 1 cluster
441  if(iDecayMode == xAOD::TauJetParameters::DecayMode::Mode_1pXn && xTau->nPi0PFOs() == 1){
442 
443  //Get Function of Delta R between the two Pi0s
444  TF1 DeltaRdist("DeltaRdist", "pol3", 0, 67500);
445  DeltaRdist.SetParameter(0, 0.07924);
446  DeltaRdist.SetParameter(1, -2.078/1000000.);
447  DeltaRdist.SetParameter(2, 2.619/100000000000.);
448  DeltaRdist.SetParameter(3, -1.238/10000000000000000.);
449 
450  //Get Sum of pi0 P4.Pt()
451  TLorentzVector SumPi0_P4;
452  for( unsigned int i = 0 ; i < correctedPi0s.size() ; i++){
453  SumPi0_P4 += correctedPi0s[i];
454  }
455 
456  float SumPi0_pt = SumPi0_P4.Pt();
457 
458  //Get delta R value (mean of true DeltaR distribution)
459  float deltaR;
460  if(SumPi0_pt >= 67500){
461  deltaR = 0.020; // = DeltaRdist.Eval(67500);
462  } else{
463  deltaR = DeltaRdist.Eval(SumPi0_pt);
464  }
465 
466  TLorentzVector correctedPi0_0, correctedPi0_1;
467  correctedPi0_0.SetPtEtaPhiM( correctedPi0s[0].Pt()/cos(0.5*deltaR/std::sqrt(2.0)), correctedPi0s[0].Eta()+0.5*deltaR/std::sqrt(2.0), correctedPi0s[0].Phi()+0.5*deltaR/std::sqrt(2.0), correctedPi0s[0].M() );
468  correctedPi0_1.SetPtEtaPhiM( correctedPi0s[1].Pt()/cos(0.5*deltaR/std::sqrt(2.0)), correctedPi0s[1].Eta()-0.5*deltaR/std::sqrt(2.0), correctedPi0s[1].Phi()-0.5*deltaR/std::sqrt(2.0), correctedPi0s[1].M() );
469 
470  std::vector<TLorentzVector> AngleCorrectedPi0s;
471  AngleCorrectedPi0s.push_back(correctedPi0_0);
472  AngleCorrectedPi0s.push_back(correctedPi0_1);
473 
474  //Reparametrise: Delta R -> mass of pi0 Cluster
475  TLorentzVector PionCluster_angleCorrected = AngleCorrectedPi0s[0]+AngleCorrectedPi0s[1];
476 
477  double dNewMomentum = std::sqrt(PionCluster_angleCorrected.E()/2. * PionCluster_angleCorrected.E()/2. - PionCluster_angleCorrected.M() / 2. * PionCluster_angleCorrected.M() / 2.);
478  correctedPi0s[0].SetVectM(PionCluster_angleCorrected.Vect() * (dNewMomentum / PionCluster_angleCorrected.P()), PionCluster_angleCorrected.M() / 2.);
479  correctedPi0s[1] = correctedPi0s[0];
480  }
481 
482  //Calculate the new tau P4
483  for(const xAOD::TauTrack* track : xTau->tracks()) {
484  TauP4 += track->p4();
485  }
486 
487  for(unsigned int iPi0=0; iPi0 < correctedPi0s.size(); iPi0++) {
488  TauP4 += correctedPi0s[iPi0];
489  }
490 
491 }

◆ createPi0Vectors()

void TauAnalysisTools::createPi0Vectors ( const xAOD::TauJet xTau,
std::vector< TLorentzVector > &  vPi0s 
)

Definition at line 316 of file PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx.

317 {
318  // reset the pi0s
319  vPi0s.clear();
320 
321  // Since the PFO links as they come out of reconstruction, only correspond to
322  // calorimeter clusters, whereas we want the consts_pi0 vectors to correspond
323  // to real pi0s, we need to be careful to collect the PFOs correctly to pi0s
324  // for the cases where number of pi0s does not match to the decay mode:
325  size_t iNumPi0PFO = xTau->nPi0PFOs();
326 
327  int iDecayMode = -1;
328 
330  {
331  Error("TauAnalysisTools::createPi0Vectors", "Failed to retrieve panTauDetail decay mode.");
332  return;
333  }
334 
335  if (iDecayMode == xAOD::TauJetParameters::DecayMode::Mode_1p1n && iNumPi0PFO > 1)
336  {
337  // TODO: find out if the pi0 mass is defined elsewhere in atlas code!
338  // float fMassPi0 = 134.98;
339  float fMassPi0Squared = 18219.6004;
340 
341  // combine both photons (with 0 mass from Pantau) to one pi0 vector:
342  const xAOD::PFO* xPfo1 = xTau->pi0PFO(0);
343  const xAOD::PFO* xPfo2 = xTau->pi0PFO(1);
344  vPi0s.push_back(xPfo1->p4() + xPfo2->p4());
345 
346  // re-set the mass to one pi0:
347  double dNewMomentum = std::sqrt(vPi0s[0].E() * vPi0s[0].E() - fMassPi0Squared);
348  vPi0s[0].SetPxPyPzE(vPi0s[0].Vect().Unit().Px() * dNewMomentum,
349  vPi0s[0].Vect().Unit().Py() * dNewMomentum,
350  vPi0s[0].Vect().Unit().Pz() * dNewMomentum,
351  vPi0s[0].E());
352  }
353  else if (iDecayMode == xAOD::TauJetParameters::DecayMode::Mode_1pXn && iNumPi0PFO == 1)
354  {
355  // make a single pi0 from a PFO that contains two pi0s:
356  const xAOD::PFO* xPfo = xTau->pi0PFO(0);
357  // add the 2-pi0 vector preliminarily to the pi0vector:
358  vPi0s.push_back(xPfo->p4());
359 
360  // re-set the mass back to one pi0:
361  double dNewMomentum = std::sqrt(vPi0s[0].E() / 2 * vPi0s[0].E() / 2 - vPi0s[0].M() / 2. * vPi0s[0].M() / 2.);
362  vPi0s[0].SetVectM(vPi0s[0].Vect() * (dNewMomentum / vPi0s[0].P()), vPi0s[0].M() / 2.);
363 
364  // create another pi0 from the same vector:
365  vPi0s.push_back(vPi0s[0]);
366  }
367  else
368  {
369  // if it's not any of the special cases above then just collect the PFOs:
370  for (size_t iPFO = 0; iPFO < iNumPi0PFO; iPFO++)
371  {
372  vPi0s.push_back(xTau->pi0PFO(iPFO)->p4());
373  }
374  }
375 }

◆ finalTauAbsEta()

double TauAnalysisTools::finalTauAbsEta ( const xAOD::TauJet xTau)

return MVA based absolute tau eta

Definition at line 127 of file PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx.

128 {
129  // return MVA based absolute tau eta
130  return std::abs(xTau.etaFinalCalib());
131 }

◆ finalTauEta()

double TauAnalysisTools::finalTauEta ( const xAOD::TauJet xTau)

return MVA based tau eta

Definition at line 120 of file PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx.

121 {
122  // return MVA based tau eta
123  return xTau.etaFinalCalib();
124 }

◆ finalTauP()

double TauAnalysisTools::finalTauP ( const xAOD::TauJet xTau)

return MVA based tau P in GeV

Definition at line 134 of file PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx.

135 {
136  // return tau P in GeV
137  return xTau.p4(xAOD::TauJetParameters::FinalCalib).P()/GeV;
138 }

◆ finalTauPt()

double TauAnalysisTools::finalTauPt ( const xAOD::TauJet xTau)

return MVA based tau pt in GeV

Definition at line 113 of file PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx.

114 {
115  // return MVA based tau pt in GeV
116  return xTau.ptFinalCalib()/GeV;
117 }

◆ getNTauDecayParticles()

int TauAnalysisTools::getNTauDecayParticles ( const xAOD::TruthParticle xTruthTau,
int  iPdgId,
bool  bCompareAbsoluteValues 
)

Count truth matched decay particles of a particular PDGID.

Parameters
xTruthTauTruthTau
iPdgIdPDGID to count over
bCompareAbsoluteValuestrue to ignore pdgid charge
Returns
int

Definition at line 256 of file PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx.

257 {
258  int iNum = 0;
259  static const SG::ConstAccessor<std::vector<int> > accDecayModeVector("DecayModeVector");
260  if (!accDecayModeVector.isAvailable(xTruthTau))
261  {
262  Warning("TauAnalysisTools::getNTauDecayParticles", "passed truth particle is not a truth tau, return 0");
263  return 0;
264  }
265 
266  for(auto iPdgId2 : accDecayModeVector(xTruthTau))
267  if (!bCompareAbsoluteValues)
268  {
269  if (iPdgId2 == iPdgId) iNum++;
270  }
271  else
272  {
273  if (std::abs(iPdgId2) == std::abs(iPdgId)) iNum++;
274  }
275  return iNum;
276 }

◆ getTruth()

const xAOD::TruthParticle * TauAnalysisTools::getTruth ( const xAOD::TauJet xTau)

Definition at line 194 of file PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx.

195 {
197  static const SG::ConstAccessor<Link_t> accTruthParticleLink("truthParticleLink");
198  if (!accTruthParticleLink(xTau))
199  {
200  Error("TauAnalysisTools::getTruth", "No truth match information available. Please run TauTruthMatchingTool first");
201  }
202 
203  const Link_t xTruthTauLink = accTruthParticleLink(xTau);
204  const xAOD::TruthParticle* xTruthTau = xTruthTauLink.cachedElement();
205 
206  return xTruthTau;
207 }

◆ getTruthDecayMode() [1/2]

xAOD::TauJetParameters::DecayMode TauAnalysisTools::getTruthDecayMode ( const xAOD::TauJet xTau)

Get the Truth Decay Mode from TruthTau particle.

check hadronic truth match and get getTruthDecayMode from truth particle

Definition at line 211 of file PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx.

212 {
213  const xAOD::TruthParticle* xTruthTau = getTruth(xTau);
214 
215  static const SG::ConstAccessor<char> accIsHadronicTau ("IsHadronicTau");
216  if (xTruthTau!=nullptr && accIsHadronicTau(*xTruthTau))
217  return getTruthDecayMode(*xTruthTau);
218  else
220 }

◆ getTruthDecayMode() [2/2]

xAOD::TauJetParameters::DecayMode TauAnalysisTools::getTruthDecayMode ( const xAOD::TruthParticle xTruthTau)

Get the Truth Decay Mode from TruthTau particle.

Counts p0 and charged Kaons and pions

Parameters
xTruthTauTruthParticle
Returns
xAOD::TauJetParameters::DecayMode
Note
Method returns Mode_Error if TruthParticle is not decorated as hadronic TruthTau

Definition at line 223 of file PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx.

224 {
225  static const SG::ConstAccessor<size_t> accNumCharged ("numCharged");
226  if (!(accNumCharged.isAvailable(xTruthTau)))
227  {
228  // passed truth particle is not a truth tau
230  }
231 
232  int iCharged = getNTauDecayParticles(xTruthTau,MC::PIPLUS, true) + getNTauDecayParticles(xTruthTau,MC::KPLUS, true);
233  int iNeutral = getNTauDecayParticles(xTruthTau,MC::PI0, true);
234  if (iCharged == 1)
235  {
236  if (iNeutral == 0) return xAOD::TauJetParameters::DecayMode::Mode_1p0n;
237  if (iNeutral == 1) return xAOD::TauJetParameters::DecayMode::Mode_1p1n;
238  if (iNeutral >= 2) return xAOD::TauJetParameters::DecayMode::Mode_1pXn;
239  }
240  else if (iCharged == 3)
241  {
242  if (iNeutral == 0) return xAOD::TauJetParameters::DecayMode::Mode_3p0n;
243  if (iNeutral >= 1) return xAOD::TauJetParameters::DecayMode::Mode_3pXn;
244  }
245 
246  if (iCharged == 2 or iCharged == 4 or iCharged == 5)
248  if (iCharged == 0 or iCharged >=6)
250 
251  // if you got here, something should have gone wrong
253 }

◆ getTruthParticleType() [1/2]

TruthMatchedParticleType TauAnalysisTools::getTruthParticleType ( const xAOD::DiTauJet xDiTau)

return DiTauJet match type

Definition at line 606 of file PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx.

607 {
608  static const SG::ConstAccessor<char> accIsTruthHadronic("IsTruthHadronic");
609  if (!accIsTruthHadronic.isAvailable(xDiTau))
610  Error("TauAnalysisTools::getTruthParticleType", "No truth match information available. Please run DiTauTruthMatchingTool first");
611 
612  TruthMatchedParticleType eTruthMatchedParticleType = Unknown;
613 
614  if (accIsTruthHadronic(xDiTau))
615  eTruthMatchedParticleType = TruthHadronicDiTau;
616 
617  return eTruthMatchedParticleType;
618 }

◆ getTruthParticleType() [2/2]

TruthMatchedParticleType TauAnalysisTools::getTruthParticleType ( const xAOD::TauJet xTau)

return TauJet match type

Definition at line 572 of file PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx.

573 {
575  static const SG::ConstAccessor< Link_t > accTruthParticleLink("truthParticleLink");
576  if (!accTruthParticleLink.isAvailable(xTau))
577  Error("TauAnalysisTools::getTruthParticleType", "No truth match information available. Please run TauTruthMatchingTool first.");
578 
579  const xAOD::TruthParticle* xTruthParticle = xAOD::TauHelpers::getTruthParticle(&xTau);
580  if (xTruthParticle)
581  {
582  if (xTruthParticle->isTau())
583  {
584  static const SG::ConstAccessor<char> accIsHadronicTau("IsHadronicTau");
585  if ((bool)accIsHadronicTau(*xTruthParticle))
586  return TruthHadronicTau;
587  else
588  return TruthLeptonicTau;
589  }
590  if (xTruthParticle->isMuon())
591  return TruthMuon;
592  if (xTruthParticle->isElectron())
593  return TruthElectron;
594  }
595 
596  // TODO: use const xAOD::Jet* xTruthJet = xAOD::TauHelpers::getLink<xAOD::Jet>(&xTau, "truthJetLink");
597  // currently it is unavailable as templated class is not in icc file
598  static const SG::ConstAccessor< ElementLink< xAOD::JetContainer > > accTruthJetLink("truthJetLink");
599  const ElementLink< xAOD::JetContainer > lTruthParticleLink = accTruthJetLink(xTau);
600  if (lTruthParticleLink.isValid())
601  return TruthJet;
602 
603  return Unknown;
604 }

◆ split() [1/7]

void TauAnalysisTools::split ( const std::string &  sInput,
const char  cDelim,
std::vector< std::string > &  vOut 
)

Definition at line 23 of file PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx.

24 {
25  std::stringstream sSS(sInput);
26  std::string sItem;
27  while (std::getline(sSS, sItem, cDelim))
28  vOut.push_back(sItem);
29 }

◆ split() [2/7]

void TauAnalysisTools::split ( TEnv &  rEnv,
const std::string &  sIn,
const char  cDelim,
std::vector< double > &  vOut 
)

Definition at line 77 of file PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx.

78 {
79  std::stringstream sSS(rEnv.GetValue(sKey.c_str(),""));
80  std::string sItem;
81  while (std::getline(sSS, sItem, cDelim))
82  vOut.push_back(stod(sItem));
83 }

◆ split() [3/7]

void TauAnalysisTools::split ( TEnv &  rEnv,
const std::string &  sIn,
const char  cDelim,
std::vector< float > &  vOut 
)

Definition at line 68 of file PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx.

69 {
70  std::stringstream sSS(rEnv.GetValue(sKey.c_str(),""));
71  std::string sItem;
72  while (std::getline(sSS, sItem, cDelim))
73  vOut.push_back(stof(sItem));
74 }

◆ split() [4/7]

void TauAnalysisTools::split ( TEnv &  rEnv,
const std::string &  sIn,
const char  cDelim,
std::vector< int > &  vOut 
)

Definition at line 50 of file PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx.

51 {
52  std::stringstream sSS(rEnv.GetValue(sKey.c_str(),""));
53  std::string sItem;
54  while (std::getline(sSS, sItem, cDelim))
55  vOut.push_back(stoi(sItem));
56 }

◆ split() [5/7]

void TauAnalysisTools::split ( TEnv &  rEnv,
const std::string &  sIn,
const char  cDelim,
std::vector< size_t > &  vOut 
)

Definition at line 41 of file PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx.

42 {
43  std::stringstream sSS(rEnv.GetValue(sKey.c_str(),""));
44  std::string sItem;
45  while (std::getline(sSS, sItem, cDelim))
46  vOut.push_back(size_t(stoi(sItem)));
47 }

◆ split() [6/7]

void TauAnalysisTools::split ( TEnv &  rEnv,
const std::string &  sIn,
const char  cDelim,
std::vector< std::string > &  vOut 
)

Definition at line 32 of file PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx.

33 {
34  std::stringstream sSS(rEnv.GetValue(sKey.c_str(),""));
35  std::string sItem;
36  while (std::getline(sSS, sItem, cDelim))
37  vOut.push_back(sItem);
38 }

◆ split() [7/7]

void TauAnalysisTools::split ( TEnv &  rEnv,
const std::string &  sIn,
const char  cDelim,
std::vector< unsigned > &  vOut 
)

Definition at line 59 of file PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx.

60 {
61  std::stringstream sSS(rEnv.GetValue(sKey.c_str(),""));
62  std::string sItem;
63  while (std::getline(sSS, sItem, cDelim))
64  vOut.push_back(stoi(sItem));
65 }

◆ tauAbsEta()

double TauAnalysisTools::tauAbsEta ( const xAOD::TauJet xTau)

return absolute tau eta

Definition at line 106 of file PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx.

107 {
108  // return absolute tau eta
109  return std::abs(xTau.eta());
110 }

◆ tauEta()

double TauAnalysisTools::tauEta ( const xAOD::TauJet xTau)

return tau eta

Definition at line 99 of file PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx.

100 {
101  // return tau eta
102  return xTau.eta();
103 }

◆ tauLeadTrackEta()

double TauAnalysisTools::tauLeadTrackEta ( const xAOD::TauJet xTau)

return leading charge tau track eta

Definition at line 141 of file PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx.

142 {
143  // return leading charge tau track eta
144  double dTrackEta = 0.;
145  double dTrackMaxPt = 0.;
146  for( unsigned int iNumTrack = 0; iNumTrack < xTau.nTracks(); iNumTrack++)
147  {
148  if (xTau.track(iNumTrack)->pt() > dTrackMaxPt)
149  {
150  dTrackMaxPt = xTau.track(iNumTrack)->pt();
151  dTrackEta = xTau.track(iNumTrack)->eta();
152  }
153  }
154  return dTrackEta;
155 }

◆ tauP()

double TauAnalysisTools::tauP ( const xAOD::TauJet xTau)

return tau P in GeV

Definition at line 92 of file PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx.

93 {
94  // return tau P in GeV
95  return xTau.p4().P()/1000.;
96 }

◆ tauPt()

double TauAnalysisTools::tauPt ( const xAOD::TauJet xTau)

return tau pt in GeV

Definition at line 85 of file PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx.

86 {
87  // return tau pt in GeV
88  return xTau.pt()/1000.;
89 }

◆ testFileForEOFContainsCharacters()

bool TauAnalysisTools::testFileForEOFContainsCharacters ( const std::string &  sFileName)

returns true if last line in file is empty or the line starts with the number sign

Definition at line 279 of file PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx.

280 {
281  // returns true if last line in file is empty or the line starts with the
282  // number sign #
283 
284  std::ifstream fInputFile;
285  fInputFile.open(sFileName);
286  if(!fInputFile.is_open())
287  return true;
288 
289  fInputFile.seekg(-1,fInputFile.end);
290 
291  bool bKeepLooping = true;
292  while(bKeepLooping)
293  {
294  char ch;
295  fInputFile.get(ch);
296 
297  if((int)fInputFile.tellg() <= 1)
298  {
299  fInputFile.seekg(0);
300  bKeepLooping = false;
301  }
302  else if(ch == '\n')
303  bKeepLooping = false;
304  else
305  fInputFile.seekg(-2,fInputFile.cur);
306  }
307 
308  std::string sLastLine;
309  getline(fInputFile,sLastLine);
310  fInputFile.close();
311 
312  return (sLastLine.size() == 0 or sLastLine[0] == '#');
313 }

◆ truthDecayMode()

double TauAnalysisTools::truthDecayMode ( const xAOD::TauJet xTau)

return truth decay mode (if hadronic truth tau match)

Definition at line 186 of file PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx.

187 {
188  // return truth tau decay mode.
189  int iDecayMode = getTruthDecayMode(xTau);
190  return static_cast<double>(iDecayMode);
191 }

◆ TruthDeltaR()

double TauAnalysisTools::TruthDeltaR ( const xAOD::DiTauJet xDiTau)

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

Definition at line 342 of file CommonDiTauEfficiencyTool.cxx.

343 {
344  // return truth taus distance delta R
345  static const SG::ConstAccessor< float > acc( "TruthVisDeltaR" );
346  return acc( xDiTau );
347 }

◆ truthHadrons() [1/2]

void TauAnalysisTools::truthHadrons ( const xAOD::TauJet xTau,
std::vector< const xAOD::TruthParticle * > &  vChargedHadrons,
std::vector< const xAOD::TruthParticle * > &  vNeutralHadrons 
)

return charged and neutral daughters of hadronic truth matched taujet

Definition at line 546 of file PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx.

547 {
548  vChargedHadrons.clear();
549  vNeutralHadrons.clear();
550 
551  // check if reco tau is a truth hadronic tau
553  static const SG::ConstAccessor<Link_t> accTruthParticleLink("truthParticleLink");
554  if (!accTruthParticleLink.isAvailable(*xTau))
555  {
556  Error("TauAnalysisTools::truthHadrons", "No truth match information available. Please run TauTruthMatchingTool first");
557  }
558 
559  const Link_t xTruthTauLink = accTruthParticleLink(*xTau);
560  const xAOD::TruthParticle* xTruthTau = xTruthTauLink.cachedElement();
561 
562  static const SG::ConstAccessor<char> accIsHadronicTau("IsHadronicTau");
563  if (xTruthTau!=nullptr && accIsHadronicTau(*xTruthTau))
564  {
565  truthHadrons(xTruthTau, vChargedHadrons, vNeutralHadrons);
566  }
567 
568  return;
569 }

◆ truthHadrons() [2/2]

void TauAnalysisTools::truthHadrons ( const xAOD::TruthParticle xTruthTau,
std::vector< const xAOD::TruthParticle * > &  vChargedHadrons,
std::vector< const xAOD::TruthParticle * > &  vNeutralHadrons 
)

return charged and neutral daughters of truth tau

Definition at line 494 of file PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx.

495 {
496  vChargedHadrons.clear();
497  vNeutralHadrons.clear();
498 
499  // skip this tau if it has no decay vertex
500  if ( !xTruthTau->hasDecayVtx() )
501  {
502  Warning("TauAnalysisTools::truthHadrons", "Passed truth particle has no decay vertex.");
503  return;
504  }
505 
506  // get vertex and check if it is valid
507  const xAOD::TruthVertex* xDecayVertex = xTruthTau->decayVtx();
508  if (!xDecayVertex)
509  {
510  Warning("TauAnalysisTools::truthHadrons", "Passed truth particle has no valid decay vertex.");
511  return;
512  }
513 
514  // loop over outgoing particles
515  for ( size_t iOutgoingParticle = 0; iOutgoingParticle < xDecayVertex->nOutgoingParticles(); ++iOutgoingParticle )
516  {
517  const xAOD::TruthParticle* xTruthDaughter = xDecayVertex->outgoingParticle(iOutgoingParticle);
518  if (!xTruthDaughter)
519  {
520  Warning("TauAnalysisTools::truthHadrons", "Truth daughter of tau decay was not found. Please ensure that this container has the full tau decay information or produce the TruthTaus container in AtlasDerivation.\nInformation on how to do this can be found here:\nhttps://twiki.cern.ch/twiki/bin/viewauth/AtlasProtected/TauPreRecommendations2015#Accessing_Tau_Truth_Information");
521  return;
522  }
523 
524  // if tau decays into tau this is not a proper tau decay
525  if ( xTruthDaughter->isTau() )
526  {
527  Warning("TauAnalysisTools::truthHadrons", "Tau decays into a tau itself. Skip this decay");
528  return;
529  }
530 
531  // ignore electrons, muons and neutrinos
532  if (xTruthDaughter->isElectron() or xTruthDaughter->isMuon() or xTruthDaughter->isNeutrino())
533  continue;
534 
535  if (xTruthDaughter->isCharged())
536  vChargedHadrons.push_back(xTruthDaughter);
537  else
538  vNeutralHadrons.push_back(xTruthDaughter);
539  }
540 
541  return;
542 
543 }

◆ TruthLeadPt()

double TauAnalysisTools::TruthLeadPt ( const xAOD::DiTauJet xDiTau)

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

Definition at line 326 of file CommonDiTauEfficiencyTool.cxx.

327 {
328  // return leading truth tau pt in GeV
329  static const SG::ConstAccessor< float > acc( "TruthVisLeadPt" );
330  return acc( xDiTau ) * 0.001;
331 }

◆ TruthSubleadPt()

double TauAnalysisTools::TruthSubleadPt ( const xAOD::DiTauJet xDiTau)

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

Definition at line 334 of file CommonDiTauEfficiencyTool.cxx.

335 {
336  // return subleading truth tau pt in GeV
337  static const SG::ConstAccessor< float > acc( "TruthVisSubleadPt" );
338  return acc( xDiTau ) * 0.001;
339 }

◆ truthTauAbsEta()

double TauAnalysisTools::truthTauAbsEta ( const xAOD::TauJet xTau)

return truth match tau eta (if hadronic truth tau match)

Definition at line 172 of file PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx.

173 {
174  // return truth tau absolute eta
175  const xAOD::TruthParticle* xTruthTau = getTruth(xTau);
176 
177  // if there is a truth tau return absolute eta, otherwise return -5 (getTruth will print an error)
178  static const SG::ConstAccessor<char> accIsHadronicTau ("IsHadronicTau");
179  if (xTruthTau!=nullptr && accIsHadronicTau (*xTruthTau))
180  return std::abs(xTruthTau->eta());
181  else
182  return -5.;
183 }

◆ truthTauPt()

double TauAnalysisTools::truthTauPt ( const xAOD::TauJet xTau)

return truth match tau pt in GeV (if hadronic truth tau match)

Definition at line 158 of file PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx.

159 {
160  // return truth tau Pt in GeV
161  const xAOD::TruthParticle* xTruthTau = getTruth(xTau);
162 
163  // if there is a truth tau return pT, otherwise return 0 (getTruth will print an error)
164  static const SG::ConstAccessor<char> accIsHadronicTau ("IsHadronicTau");
165  if (xTruthTau!=nullptr && accIsHadronicTau (*xTruthTau))
166  return xTruthTau->pt()/GeV;
167  else
168  return 0.;
169 }
TauAnalysisTools::JETIDBDTLOOSE
@ JETIDBDTLOOSE
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:16
xAOD::TruthVertex_v1::nOutgoingParticles
size_t nOutgoingParticles() const
Get the number of outgoing particles.
xAOD::TauJetParameters::Mode_1p0n
@ Mode_1p0n
Definition: TauDefs.h:386
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
xAOD::TauJetParameters::PanTau_DecayMode
@ PanTau_DecayMode
Definition: TauDefs.h:360
TauAnalysisTools::CutAbsEta
@ CutAbsEta
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:43
GetLCDefs::Unknown
@ Unknown
Definition: GetLCDefs.h:21
TauAnalysisTools::TruthElectron
@ TruthElectron
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:100
TauAnalysisTools::SFTriggerHadTau
@ SFTriggerHadTau
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:80
GeV
#define GeV
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx:17
sendEI_SPB.ch
ch
Definition: sendEI_SPB.py:35
xAOD::TauJetParameters::Mode_1p1n
@ Mode_1p1n
Definition: TauDefs.h:387
TauAnalysisTools::getTruthDecayMode
xAOD::TauJetParameters::DecayMode getTruthDecayMode(const xAOD::TruthParticle &xTruthTau)
Get the Truth Decay Mode from TruthTau particle.
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx:223
TauAnalysisTools::ELEIDNONEUNCONFIGURED
@ ELEIDNONEUNCONFIGURED
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:31
TauAnalysisTools::getTruth
const xAOD::TruthParticle * getTruth(const xAOD::TauJet &xTau)
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx:194
test_pyathena.px
px
Definition: test_pyathena.py:18
xAOD::TruthParticle_v1::isElectron
bool isElectron() const
Whether the particle is an electron (or positron)
TauAnalysisTools::createPi0Vectors
void createPi0Vectors(const xAOD::TauJet *xTau, std::vector< TLorentzVector > &vPi0s)
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx:316
TauAnalysisTools::CutMuonOLR
@ CutMuonOLR
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:50
xAOD::TauJet_v3::eta
virtual double eta() const
The pseudorapidity ( ) of the particle.
TauAnalysisTools::JETIDRNNTIGHT
@ JETIDRNNTIGHT
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:22
TauAnalysisTools::TruthHadronicTau
@ TruthHadronicTau
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:97
TauAnalysisTools::CutPhi
@ CutPhi
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:44
TauAnalysisTools::JETIDRNNMEDIUM
@ JETIDRNNMEDIUM
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:21
DMTest::P
P_v1 P
Definition: P.h:23
TauAnalysisTools::JETIDBDTMEDIUM
@ JETIDBDTMEDIUM
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:17
xAOD::TauTrack_v1::eta
virtual double eta() const
The pseudorapidity ( ) of the particle.
xAOD::TauJet_v3::etaFinalCalib
double etaFinalCalib() const
xAOD::TauJet_v3::nTracks
size_t nTracks(TauJetParameters::TauTrackFlag flag=TauJetParameters::TauTrackFlag::classifiedCharged) const
Definition: TauJet_v3.cxx:526
TauAnalysisTools::JETIDGNTAULOOSE
@ JETIDGNTAULOOSE
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:24
TauAnalysisTools::SFDecayModeHadTau
@ SFDecayModeHadTau
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:85
TauAnalysisTools::getNTauDecayParticles
int getNTauDecayParticles(const xAOD::TruthParticle &xTruthTau, int iPdgId, bool bCompareAbsoluteValues)
Count truth matched decay particles of a particular PDGID.
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx:256
TauAnalysisTools::DiTauCutPt
@ DiTauCutPt
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:58
TauAnalysisTools::JETIDRNNLOOSE
@ JETIDRNNLOOSE
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:20
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
Phi
@ Phi
Definition: RPCdef.h:8
SG::ConstAccessor
Helper class to provide constant type-safe access to aux data.
Definition: ConstAccessor.h:55
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
TauAnalysisTools::TruthJet
@ TruthJet
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:101
TauAnalysisTools::Unknown
@ Unknown
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:96
TauAnalysisTools::JETIDNONE
@ JETIDNONE
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:14
TauAnalysisTools::CutJetIDWP
@ CutJetIDWP
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:47
TauAnalysisTools::SFEleIDElectron
@ SFEleIDElectron
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:77
xAOD::TauJet_v3::nPi0PFOs
size_t nPi0PFOs() const
Get the number of pi0 PFO particles associated with this tau.
Definition: TauJet_v3.cxx:880
TauAnalysisTools::TruthLeptonicTau
@ TruthLeptonicTau
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:98
TauAnalysisTools::NoDiTauCut
@ NoDiTauCut
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:57
TauAnalysisTools::UnderlyingEventTrack
@ UnderlyingEventTrack
Definition: TauTruthTrackMatchingTool.h:32
Monitored::X
@ X
Definition: HistogramFillerUtils.h:24
xAOD::TauJetParameters::Mode_1pXn
@ Mode_1pXn
Definition: TauDefs.h:388
TauAnalysisTools::ELEIDRNNLOOSE
@ ELEIDRNNLOOSE
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:33
xAOD::TauJet_v3::pi0PFO
const PFO * pi0PFO(size_t i) const
Get the pointer to a given pi0 PFO associated with this tau.
xAOD::TauJet_v3::pt
virtual double pt() const
The transverse momentum ( ) of the particle.
xAOD::TruthParticle_v1::hasDecayVtx
bool hasDecayVtx() const
Check for a decay vertex on this particle.
TauAnalysisTools::JETIDBDTTIGHT
@ JETIDBDTTIGHT
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:18
TauAnalysisTools::JETIDGNTAUVERYLOOSE
@ JETIDGNTAUVERYLOOSE
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:23
xAOD::TauHelpers::getTruthParticle
const xAOD::TruthParticle * getTruthParticle(const xAOD::IParticle *, bool debug=false)
return the truthParticle associated to the given IParticle (if any)
Definition: TauxAODHelpers.cxx:10
TauAnalysisTools::ELEIDNONE
@ ELEIDNONE
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:32
lumiFormat.i
int i
Definition: lumiFormat.py:85
xAOD::TruthParticle_v1
Class describing a truth particle in the MC record.
Definition: TruthParticle_v1.h:37
xAOD::TauJet_v3
Class describing a tau jet.
Definition: TauJet_v3.h:41
TauAnalysisTools::CutGNTauScoreSigTrans
@ CutGNTauScoreSigTrans
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:52
Amg::pz
@ pz
Definition: GeoPrimitives.h:40
xAOD::TauJet_v3::track
const TauTrack * track(size_t i, TauJetParameters::TauTrackFlag flag=TauJetParameters::TauTrackFlag::classifiedCharged, int *container_index=0) const
Get the pointer to a given tauTrack associated with this tau /*container index needed by trackNonCons...
Definition: TauJet_v3.cxx:450
xAOD::PFO_v1::p4
virtual FourMom_t p4() const
The full 4-momentum of the particle.
Definition: PFO_v1.cxx:95
AthenaPoolTestRead.acc
acc
Definition: AthenaPoolTestRead.py:16
TauAnalysisTools::truthHadrons
void truthHadrons(const xAOD::TruthParticle *xTruthTau, std::vector< const xAOD::TruthParticle * > &vChargedHadrons, std::vector< const xAOD::TruthParticle * > &vNeutralHadrons)
return charged and neutral daughters of truth tau
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx:494
TauAnalysisTools::UnclassifiedTrack
@ UnclassifiedTrack
Definition: TauTruthTrackMatchingTool.h:29
xAOD::TruthParticle_v1::isTau
bool isTau() const
Whether the particle is a tau (or antitau)
TauAnalysisTools::DiTauCutNSubjets
@ DiTauCutNSubjets
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:60
TauAnalysisTools::ELEIDRNNMEDIUM
@ ELEIDRNNMEDIUM
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:34
xAOD::TruthParticle_v1::isCharged
bool isCharged() const
Whether the particle is electrically charged.
xAOD::TauJetParameters::Mode_3p0n
@ Mode_3p0n
Definition: TauDefs.h:389
TauAnalysisTools::TruthMuon
@ TruthMuon
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:99
xAOD::TruthParticle_v1::decayVtx
const TruthVertex_v1 * decayVtx() const
The decay vertex of this particle.
xAOD::TruthVertex_v1
Class describing a truth vertex in the MC record.
Definition: TruthVertex_v1.h:37
Amg::py
@ py
Definition: GeoPrimitives.h:39
xAOD::PFO_v1
Class describing a particle flow object.
Definition: PFO_v1.h:35
TauAnalysisTools::CutNTrack
@ CutNTrack
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:45
TauAnalysisTools::ELEIDRNNTIGHT
@ ELEIDRNNTIGHT
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:35
TauAnalysisTools::TruthMatchedParticleType
TruthMatchedParticleType
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:95
xAOD::TauTrack_v1::pt
virtual double pt() const
The transverse momentum ( ) of the particle.
TauAnalysisTools::CutEleRNNScore
@ CutEleRNNScore
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:48
VP1PartSpect::E
@ E
Definition: VP1PartSpectFlags.h:21
TauAnalysisTools::SFJetIDHadTau
@ SFJetIDHadTau
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:70
TauAnalysisTools::CutJetRNNScoreSigTrans
@ CutJetRNNScoreSigTrans
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:51
TauAnalysisTools::SFRecoHadTau
@ SFRecoHadTau
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:65
xAOD::TruthParticle_v1::eta
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
Definition: TruthParticle_v1.cxx:174
TauAnalysisTools::SecondaryTrack
@ SecondaryTrack
Definition: TauTruthTrackMatchingTool.h:33
TauAnalysisTools::PileupTrack
@ PileupTrack
Definition: TauTruthTrackMatchingTool.h:34
TauAnalysisTools::CutEleIDWP
@ CutEleIDWP
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:49
TauAnalysisTools::CutAbsCharge
@ CutAbsCharge
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:46
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
Prompt::Def::Pt
@ Pt
Definition: VarHolder.h:76
TauAnalysisTools::SFEleIDHadTau
@ SFEleIDHadTau
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:75
TauAnalysisTools::FakeTrack
@ FakeTrack
Definition: TauTruthTrackMatchingTool.h:35
xAOD::TauTrack_v1
Definition: TauTrack_v1.h:27
xAOD::TauJet_v3::p4
virtual FourMom_t p4() const
The full 4-momentum of the particle.
Definition: TauJet_v3.cxx:97
xAOD::TruthParticle_v1::isMuon
bool isMuon() const
Whether the particle is a muon (or antimuon)
if
if(febId1==febId2)
Definition: LArRodBlockPhysicsV0.cxx:567
xAOD::TauJetParameters::Mode_3pXn
@ Mode_3pXn
Definition: TauDefs.h:390
xAOD::TruthParticle_v1::pt
virtual double pt() const override final
The transverse momentum ( ) of the particle.
Definition: TruthParticle_v1.cxx:166
TauAnalysisTools::JETIDGNTAUTIGHT
@ JETIDGNTAUTIGHT
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:26
L1Topo::Error
Error
The different types of error that can be flagged in the L1TopoRDO.
Definition: Error.h:16
TauAnalysisTools::DiTauCutAbsEta
@ DiTauCutAbsEta
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:59
xAOD::TruthParticle_v1::isNeutrino
bool isNeutrino() const
Whether the particle is a neutrino (or antineutrino)
xAOD::TauJetParameters::Mode_Error
@ Mode_Error
Definition: TauDefs.h:393
TauAnalysisTools::JETIDGNTAUMEDIUM
@ JETIDGNTAUMEDIUM
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:25
TauAnalysisTools::NoCut
@ NoCut
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:41
TauAnalysisTools::JETIDRNNVERYLOOSE
@ JETIDRNNVERYLOOSE
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:19
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
TauAnalysisTools::CutPt
@ CutPt
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:42
TauAnalysisTools::STAT
@ STAT
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:90
TauAnalysisTools::JETIDNONEUNCONFIGURED
@ JETIDNONEUNCONFIGURED
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:13
TauAnalysisTools::JETIDBDTVERYLOOSE
@ JETIDBDTVERYLOOSE
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:15
xAOD::TauJetParameters::Mode_NotSet
@ Mode_NotSet
Definition: TauDefs.h:392
pow
constexpr int pow(int base, int exp) noexcept
Definition: ap_fixedTest.cxx:15
xAOD::TauJetParameters::FinalCalib
@ FinalCalib
Definition: TauDefs.h:346
xAOD::TauJet_v3::ptFinalCalib
double ptFinalCalib() const
makeComparison.deltaR
float deltaR
Definition: makeComparison.py:36
xAOD::TruthVertex_v1::outgoingParticle
const TruthParticle_v1 * outgoingParticle(size_t index) const
Get one of the outgoing particles.
Definition: TruthVertex_v1.cxx:119
xAOD::TauJet_v3::tracks
std::vector< const TauTrack * > tracks(TauJetParameters::TauTrackFlag flag=TauJetParameters::TauTrackFlag::classifiedCharged) const
Get the v<const pointer> to a given tauTrack collection associated with this tau.
Definition: TauJet_v3.cxx:493
TauAnalysisTools::ConversionTrack
@ ConversionTrack
Definition: TauTruthTrackMatchingTool.h:31
Eta
@ Eta
Definition: RPCdef.h:8
TauAnalysisTools::SYST
@ SYST
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:91
TauAnalysisTools::TruthHadronicDiTau
@ TruthHadronicDiTau
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:102
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
xAOD::TauJetParameters::Mode_Other
@ Mode_Other
Definition: TauDefs.h:391
TauAnalysisTools::TauTrack
@ TauTrack
Definition: TauTruthTrackMatchingTool.h:30