ATLAS Offline Software
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
TauAnalysisTools::TauSelectionCutJetIDWP Class Reference

#include <TauSelectionCuts.h>

Inheritance diagram for TauAnalysisTools::TauSelectionCutJetIDWP:
Collaboration diagram for TauAnalysisTools::TauSelectionCutJetIDWP:

Public Member Functions

 TauSelectionCutJetIDWP (TauSelectionTool *tTST)
 
virtual void setAcceptInfo (asg::AcceptInfo &info) const override
 
virtual bool accept (const xAOD::TauJet &xTau, asg::AcceptData &accept) override
 
void writeControlHistograms ()
 
void fillHistogramCutPre (const xAOD::TauJet &xTau)
 
void fillHistogramCut (const xAOD::TauJet &xTau)
 
TH1F * CreateControlPlot (const char *sName, const char *sTitle, int iBins, double dXLow, double dXUp)
 
const std::string & getName ()
 
void setProperty (const std::string &name, const std::string &value)
 

Protected Member Functions

void declareProperty (const std::string &name, std::string &loc)
 
std::string getProperty (const std::string &name)
 

Protected Attributes

std::string m_sName
 
TH1F * m_hHistCutPre
 
TH1F * m_hHistCut
 
TauSelectionToolm_tTST
 
std::map< std::string, std::string & > m_mProperties
 

Private Member Functions

virtual void fillHistogram (const xAOD::TauJet &xTau, TH1F &hHist) const override
 

Detailed Description

Definition at line 137 of file TauSelectionCuts.h.

Constructor & Destructor Documentation

◆ TauSelectionCutJetIDWP()

TauSelectionCutJetIDWP::TauSelectionCutJetIDWP ( TauSelectionTool tTST)

Definition at line 340 of file TauSelectionCuts.cxx.

341  : TauSelectionCut("CutJetIDWP", tTST)
342 {
343  m_hHistCutPre = CreateControlPlot("hJetIDWP_pre","JetIDWP_pre;; events",8,-.5,7.5);
344  m_hHistCut = CreateControlPlot("hJetIDWP_cut","JetIDWP_cut;; events",8,-.5,7.5);
345  // only proceed if histograms are defined
346  if (!m_hHistCutPre or !m_hHistCut)
347  return;
348 
349  m_hHistCutPre->GetXaxis()->SetBinLabel(1,"!VeryLoose");
350  m_hHistCutPre->GetXaxis()->SetBinLabel(2,"VeryLoose");
351  m_hHistCutPre->GetXaxis()->SetBinLabel(3,"!Loose");
352  m_hHistCutPre->GetXaxis()->SetBinLabel(4,"Loose");
353  m_hHistCutPre->GetXaxis()->SetBinLabel(5,"!Medium");
354  m_hHistCutPre->GetXaxis()->SetBinLabel(6,"Medium");
355  m_hHistCutPre->GetXaxis()->SetBinLabel(7,"!Tight");
356  m_hHistCutPre->GetXaxis()->SetBinLabel(8,"Tight");
357  m_hHistCut->GetXaxis()->SetBinLabel(1,"!VeryLoose");
358  m_hHistCut->GetXaxis()->SetBinLabel(2,"VeryLoose");
359  m_hHistCut->GetXaxis()->SetBinLabel(3,"!Loose");
360  m_hHistCut->GetXaxis()->SetBinLabel(4,"Loose");
361  m_hHistCut->GetXaxis()->SetBinLabel(5,"!Medium");
362  m_hHistCut->GetXaxis()->SetBinLabel(6,"Medium");
363  m_hHistCut->GetXaxis()->SetBinLabel(7,"!Tight");
364  m_hHistCut->GetXaxis()->SetBinLabel(8,"Tight");
365 }

Member Function Documentation

◆ accept()

bool TauSelectionCutJetIDWP::accept ( const xAOD::TauJet xTau,
asg::AcceptData accept 
)
overridevirtual

Implements TauAnalysisTools::TauSelectionCut.

Definition at line 384 of file TauSelectionCuts.cxx.

386 {
387  // check Jet ID working point, if tau passes JetID working point then return true; false otherwise
388  bool bPass = false;
389  switch (m_tTST->m_iJetIDWP)
390  {
391  case JETIDNONE:
392  bPass = true;
393  break;
395  bPass = true;
396  break;
397  case JETIDRNNVERYLOOSE:
398  if (xTau.isTau(xAOD::TauJetParameters::JetRNNSigVeryLoose)) bPass = true;
399  break;
400  case JETIDRNNLOOSE:
401  if (xTau.isTau(xAOD::TauJetParameters::JetRNNSigLoose)) bPass = true;
402  break;
403  case JETIDRNNMEDIUM:
404  if (xTau.isTau(xAOD::TauJetParameters::JetRNNSigMedium)) bPass = true;
405  break;
406  case JETIDRNNTIGHT:
407  if (xTau.isTau(xAOD::TauJetParameters::JetRNNSigTight)) bPass = true;
408  break;
409  case JETIDGNTAUVERYLOOSE:
410  static const SG::ConstAccessor<char> acc_gnTauVeryLoose("GNTauVL_v0prune");
411  if (!acc_gnTauVeryLoose.isAvailable(xTau)) m_tTST->msg() << MSG::WARNING << "GnTau VeryLoose WP not available" << endmsg;
412  else bPass = acc_gnTauVeryLoose(xTau);
413  break;
414  case JETIDGNTAULOOSE:
415  static const SG::ConstAccessor<char> acc_gnTauLoose("GNTauL_v0prune");
416  if (!acc_gnTauLoose.isAvailable(xTau)) m_tTST->msg() << MSG::WARNING << "GnTau Loose WP not available" << endmsg;
417  else bPass = acc_gnTauLoose(xTau);
418  break;
419  case JETIDGNTAUMEDIUM:
420  static const SG::ConstAccessor<char> acc_gnTauMedium("GNTauM_v0prune");
421  if (!acc_gnTauMedium.isAvailable(xTau)) m_tTST->msg() << MSG::WARNING << "GnTau Medium WP not available" << endmsg;
422  else bPass = acc_gnTauMedium(xTau);
423  break;
424  case JETIDGNTAUTIGHT:
425  static const SG::ConstAccessor<char> acc_gnTauTight("GNTauT_v0prune");
426  if (!acc_gnTauTight.isAvailable(xTau)) m_tTST->msg() << MSG::WARNING << "GnTau Tight WP not available" << endmsg;
427  else bPass = acc_gnTauTight(xTau);
428  break;
429  default:
430  m_tTST->msg() << MSG::WARNING << "The jet ID working point with the enum " << m_tTST->m_iJetIDWP << " is not available" << endmsg;
431  break;
432  }
433  if (bPass)
434  {
435  acceptData.setCutResult( "JetIDWP", true );
436  return true;
437  }
438  m_tTST->msg() << MSG::VERBOSE << "Tau failed JetIDWP requirement, tau transformed RNN score: " << xTau.discriminant(xAOD::TauJetParameters::RNNJetScoreSigTrans) << endmsg;
439  return false;
440 }

◆ CreateControlPlot()

TH1F * TauSelectionCut::CreateControlPlot ( const char *  sName,
const char *  sTitle,
int  iBins,
double  dXLow,
double  dXUp 
)
inherited

Definition at line 44 of file TauSelectionCuts.cxx.

45 {
47  {
48  TH1F* hHist = new TH1F(sName, sTitle, iBins, dXLow, dXUp);
49  hHist->SetDirectory(0);
50  return hHist;
51  }
52 
53  return nullptr;
54 }

◆ declareProperty()

void TauSelectionCut::declareProperty ( const std::string &  name,
std::string &  loc 
)
protectedinherited

Definition at line 79 of file TauSelectionCuts.cxx.

80 {
81  std::pair<std::string, std::string&> p(name, loc);
82  m_mProperties.insert(p);
83 }

◆ fillHistogram()

void TauSelectionCutJetIDWP::fillHistogram ( const xAOD::TauJet xTau,
TH1F &  hHist 
) const
overrideprivatevirtual

Implements TauAnalysisTools::TauSelectionCut.

Definition at line 368 of file TauSelectionCuts.cxx.

369 {
370  // FIXME: should this be extended to gntau ID?
372  hHist.Fill(xTau.isTau(xAOD::TauJetParameters::JetRNNSigLoose)+2);
374  hHist.Fill(xTau.isTau(xAOD::TauJetParameters::JetRNNSigTight)+6);
375 }

◆ fillHistogramCut()

void TauSelectionCut::fillHistogramCut ( const xAOD::TauJet xTau)
inherited

Definition at line 63 of file TauSelectionCuts.cxx.

64 {
65  fillHistogram(xTau, *m_hHistCut);
66 }

◆ fillHistogramCutPre()

void TauSelectionCut::fillHistogramCutPre ( const xAOD::TauJet xTau)
inherited

Definition at line 57 of file TauSelectionCuts.cxx.

58 {
60 }

◆ getName()

const std::string& TauAnalysisTools::TauSelectionCut::getName ( )
inlineinherited

Definition at line 42 of file TauSelectionCuts.h.

43  {
44  return m_sName;
45  };

◆ getProperty()

std::string TauSelectionCut::getProperty ( const std::string &  name)
protectedinherited

Definition at line 86 of file TauSelectionCuts.cxx.

87 {
89  if(it == m_mProperties.end() )
90  throw std::runtime_error (("Undeclared property: " + name + "\n").c_str());
91 
92  return it->second;
93 }

◆ setAcceptInfo()

void TauSelectionCutJetIDWP::setAcceptInfo ( asg::AcceptInfo info) const
overridevirtual

Implements TauAnalysisTools::TauSelectionCut.

Definition at line 378 of file TauSelectionCuts.cxx.

379 {
380  info.addCut( "JetIDWP",
381  "Selection of taus according to their JetIDScore" );
382 }

◆ setProperty()

void TauSelectionCut::setProperty ( const std::string &  name,
const std::string &  value 
)
inherited

Definition at line 70 of file TauSelectionCuts.cxx.

71 {
73  if(it == m_mProperties.end() )
74  throw std::runtime_error (("Undeclared property: " + name + "\n").c_str());
75  it->second = value;
76 }

◆ writeControlHistograms()

void TauSelectionCut::writeControlHistograms ( )
inherited

Definition at line 37 of file TauSelectionCuts.cxx.

38 {
39  m_hHistCutPre->Write();
40  m_hHistCut->Write();
41 }

Member Data Documentation

◆ m_hHistCut

TH1F* TauAnalysisTools::TauSelectionCut::m_hHistCut
protectedinherited

Definition at line 53 of file TauSelectionCuts.h.

◆ m_hHistCutPre

TH1F* TauAnalysisTools::TauSelectionCut::m_hHistCutPre
protectedinherited

Definition at line 52 of file TauSelectionCuts.h.

◆ m_mProperties

std::map<std::string, std::string&> TauAnalysisTools::TauSelectionCut::m_mProperties
protectedinherited

Definition at line 58 of file TauSelectionCuts.h.

◆ m_sName

std::string TauAnalysisTools::TauSelectionCut::m_sName
protectedinherited

Definition at line 50 of file TauSelectionCuts.h.

◆ m_tTST

TauSelectionTool* TauAnalysisTools::TauSelectionCut::m_tTST
protectedinherited

Definition at line 55 of file TauSelectionCuts.h.


The documentation for this class was generated from the following files:
grepfile.info
info
Definition: grepfile.py:38
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
xAOD::TauJetParameters::RNNJetScoreSigTrans
@ RNNJetScoreSigTrans
RNN score which is signal transformed/flattened.
Definition: TauDefs.h:92
TauAnalysisTools::TauSelectionCut::CreateControlPlot
TH1F * CreateControlPlot(const char *sName, const char *sTitle, int iBins, double dXLow, double dXUp)
Definition: TauSelectionCuts.cxx:44
TauAnalysisTools::TauSelectionCut::m_mProperties
std::map< std::string, std::string & > m_mProperties
Definition: TauSelectionCuts.h:58
xAOD::TauJet_v3::discriminant
double discriminant(TauJetParameters::TauID discID) const
Get value of discriminant.
Definition: TauJet_v3.cxx:253
TauAnalysisTools::JETIDRNNTIGHT
@ JETIDRNNTIGHT
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:22
TauAnalysisTools::JETIDRNNMEDIUM
@ JETIDRNNMEDIUM
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:21
TauAnalysisTools::JETIDGNTAULOOSE
@ JETIDGNTAULOOSE
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:24
skel.it
it
Definition: skel.GENtoEVGEN.py:396
TauAnalysisTools::JETIDRNNLOOSE
@ JETIDRNNLOOSE
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:20
athena.value
value
Definition: athena.py:124
SG::ConstAccessor< char >
TauAnalysisTools::JETIDNONE
@ JETIDNONE
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:14
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
TauAnalysisTools::JETIDGNTAUVERYLOOSE
@ JETIDGNTAUVERYLOOSE
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:23
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
TauAnalysisTools::TauSelectionCut::m_hHistCutPre
TH1F * m_hHistCutPre
Definition: TauSelectionCuts.h:52
xAOD::TauJetParameters::JetRNNSigVeryLoose
@ JetRNNSigVeryLoose
Definition: TauDefs.h:145
xAOD::TauJetParameters::JetRNNSigTight
@ JetRNNSigTight
Definition: TauDefs.h:148
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
TauAnalysisTools::TauSelectionTool::m_bCreateControlPlots
bool m_bCreateControlPlots
Definition: TauSelectionTool.h:176
TauAnalysisTools::TauSelectionCut::TauSelectionCut
TauSelectionCut(const std::string &sName, TauAnalysisTools::TauSelectionTool *tTST)
Definition: TauSelectionCuts.cxx:20
xAOD::TauJetParameters::JetRNNSigMedium
@ JetRNNSigMedium
Definition: TauDefs.h:147
xAOD::TauJet_v3::isTau
bool isTau(TauJetParameters::IsTauFlag flag) const
Get Flag for tau acceptance based on predefined arbitrary criteria.
Definition: TauJet_v3.cxx:273
TauAnalysisTools::TauSelectionCut::m_sName
std::string m_sName
Definition: TauSelectionCuts.h:50
AthCommonMsg::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
TauAnalysisTools::TauSelectionTool::m_iJetIDWP
int m_iJetIDWP
Definition: TauSelectionTool.h:132
TauAnalysisTools::JETIDGNTAUTIGHT
@ JETIDGNTAUTIGHT
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:26
TauAnalysisTools::JETIDGNTAUMEDIUM
@ JETIDGNTAUMEDIUM
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:25
TauAnalysisTools::JETIDRNNVERYLOOSE
@ JETIDRNNVERYLOOSE
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:19
python.TrigEgammaMonitorHelper.TH1F
def TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)
Definition: TrigEgammaMonitorHelper.py:24
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:14
TauAnalysisTools::TauSelectionCut::m_hHistCut
TH1F * m_hHistCut
Definition: TauSelectionCuts.h:53
TauAnalysisTools::JETIDNONEUNCONFIGURED
@ JETIDNONEUNCONFIGURED
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:13
TauAnalysisTools::TauSelectionCut::fillHistogram
virtual void fillHistogram(const xAOD::TauJet &xTau, TH1F &hHist) const =0
xAOD::TauJetParameters::JetRNNSigLoose
@ JetRNNSigLoose
Definition: TauDefs.h:146
TauAnalysisTools::TauSelectionCut::m_tTST
TauSelectionTool * m_tTST
Definition: TauSelectionCuts.h:55