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

#include <TauSelectionCuts.h>

Inheritance diagram for TauAnalysisTools::TauSelectionCutEleIDWP:
Collaboration diagram for TauAnalysisTools::TauSelectionCutEleIDWP:

Public Member Functions

 TauSelectionCutEleIDWP (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 161 of file TauSelectionCuts.h.

Constructor & Destructor Documentation

◆ TauSelectionCutEleIDWP()

TauSelectionCutEleIDWP::TauSelectionCutEleIDWP ( TauSelectionTool tTST)

Definition at line 494 of file TauSelectionCuts.cxx.

495  : TauSelectionCut("CutEleIDWP", tTST)
496 {
497  m_hHistCutPre = CreateControlPlot("hEleIDWP_pre","EleIDWP_pre;; events",6,-.5,5.5);
498  m_hHistCut = CreateControlPlot("hEleIDWP_cut","EleIDWP_cut;; events",6,-.5,5.5);
499  // only proceed if histograms are defined
500  if (!m_hHistCutPre or !m_hHistCut)
501  return;
502  m_hHistCutPre->GetXaxis()->SetBinLabel(1,"!Loose");
503  m_hHistCutPre->GetXaxis()->SetBinLabel(2,"Loose");
504  m_hHistCutPre->GetXaxis()->SetBinLabel(3,"!Medium");
505  m_hHistCutPre->GetXaxis()->SetBinLabel(4,"Medium");
506  m_hHistCutPre->GetXaxis()->SetBinLabel(5,"!Tight");
507  m_hHistCutPre->GetXaxis()->SetBinLabel(6,"Tight");
508  m_hHistCut->GetXaxis()->SetBinLabel(1,"!Loose");
509  m_hHistCut->GetXaxis()->SetBinLabel(2,"Loose");
510  m_hHistCut->GetXaxis()->SetBinLabel(3,"!Medium");
511  m_hHistCut->GetXaxis()->SetBinLabel(4,"Medium");
512  m_hHistCut->GetXaxis()->SetBinLabel(5,"!Tight");
513  m_hHistCut->GetXaxis()->SetBinLabel(6,"Tight");
514 }

Member Function Documentation

◆ accept()

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

Implements TauAnalysisTools::TauSelectionCut.

Definition at line 541 of file TauSelectionCuts.cxx.

543 {
544  // check EleID WP, if tau passes EleID working point then return true; false otherwise
545  bool bPass = false;
546  switch (m_tTST->m_iEleIDWP)
547  {
548  case ELEIDNONE:
549  bPass = true;
550  break;
552  bPass = true;
553  break;
554  case ELEIDRNNLOOSE:
555  if (m_tTST->m_iEleIDVersion!=0){
556  SG::ConstAccessor<char> accLoose ("EleRNNLoose_v"+std::to_string(m_tTST->m_iEleIDVersion));
557  if (accLoose(xTau) == 1)bPass = true;
558  }
559  else if (xTau.isTau(xAOD::TauJetParameters::EleRNNLoose)) bPass = true;
560  break;
561  case ELEIDRNNMEDIUM:
562  if (m_tTST->m_iEleIDVersion!=0){
563  SG::ConstAccessor<char> accMedium ("EleRNNMedium_v"+std::to_string(m_tTST->m_iEleIDVersion));
564  if (accMedium(xTau) == 1)bPass = true;
565  }
566  else if (xTau.isTau(xAOD::TauJetParameters::EleRNNMedium)) bPass = true;
567  break;
568  case ELEIDRNNTIGHT:
569  if (m_tTST->m_iEleIDVersion!=0){
570  SG::ConstAccessor<char> accTight ("EleRNNTight_v"+std::to_string(m_tTST->m_iEleIDVersion));
571  if (accTight(xTau) == 1)bPass = true;
572  }
573  else if (xTau.isTau(xAOD::TauJetParameters::EleRNNTight)) bPass = true;
574  break;
575  default:
576  m_tTST->msg() << MSG::WARNING << "The electron ID working point with the enum " << m_tTST->m_iEleIDWP << " is not available" << endmsg;
577  break;
578  }
579 
580  if (bPass)
581  {
582  acceptData.setCutResult( "EleIDWP", true );
583  return true;
584  }
585  m_tTST->msg() << MSG::VERBOSE << "Tau failed EleID WP requirement" << endmsg;
586  return false;
587 }

◆ 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 TauSelectionCutEleIDWP::fillHistogram ( const xAOD::TauJet xTau,
TH1F &  hHist 
) const
overrideprivatevirtual

Implements TauAnalysisTools::TauSelectionCut.

Definition at line 517 of file TauSelectionCuts.cxx.

518 {
519  if (m_tTST->m_iEleIDVersion!=0){
520  SG::ConstAccessor<char> accLoose ("EleRNNLoose_v"+std::to_string(m_tTST->m_iEleIDVersion));
521  SG::ConstAccessor<char> accMedium ("EleRNNMedium_v"+std::to_string(m_tTST->m_iEleIDVersion));
522  SG::ConstAccessor<char> accTight ("EleRNNTight_v"+std::to_string(m_tTST->m_iEleIDVersion));
523  hHist.Fill((accLoose(xTau) == 1));
524  hHist.Fill((accMedium(xTau) == 1)+2);
525  hHist.Fill((accTight(xTau) == 1)+4);
526  }
527  else{
528  hHist.Fill(xTau.isTau(xAOD::TauJetParameters::EleRNNLoose));
529  hHist.Fill(xTau.isTau(xAOD::TauJetParameters::EleRNNMedium)+2);
530  hHist.Fill(xTau.isTau(xAOD::TauJetParameters::EleRNNTight)+4);
531  }
532 }

◆ 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 TauSelectionCutEleIDWP::setAcceptInfo ( asg::AcceptInfo info) const
overridevirtual

Implements TauAnalysisTools::TauSelectionCut.

Definition at line 535 of file TauSelectionCuts.cxx.

536 {
537  info.addCut( "EleIDWP",
538  "Selection of taus according to their EleID working point" );
539 }

◆ 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
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
TauAnalysisTools::ELEIDNONEUNCONFIGURED
@ ELEIDNONEUNCONFIGURED
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:31
skel.it
it
Definition: skel.GENtoEVGEN.py:396
athena.value
value
Definition: athena.py:124
SG::ConstAccessor< char >
TauAnalysisTools::ELEIDRNNLOOSE
@ ELEIDRNNLOOSE
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:33
xAOD::TauJetParameters::EleRNNTight
@ EleRNNTight
Definition: TauDefs.h:134
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
TauAnalysisTools::TauSelectionTool::m_iEleIDWP
int m_iEleIDWP
Definition: TauSelectionTool.h:137
TauAnalysisTools::ELEIDNONE
@ ELEIDNONE
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:32
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
TauAnalysisTools::TauSelectionCut::m_hHistCutPre
TH1F * m_hHistCutPre
Definition: TauSelectionCuts.h:52
xAOD::TauJetParameters::EleRNNMedium
@ EleRNNMedium
Definition: TauDefs.h:133
TauAnalysisTools::ELEIDRNNMEDIUM
@ ELEIDRNNMEDIUM
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:34
TauAnalysisTools::ELEIDRNNTIGHT
@ ELEIDRNNTIGHT
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:35
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
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::TauJet_v3::isTau
bool isTau(TauJetParameters::IsTauFlag flag) const
Get Flag for tau acceptance based on predefined arbitrary criteria.
Definition: TauJet_v3.cxx:273
xAOD::TauJetParameters::EleRNNLoose
@ EleRNNLoose
Definition: TauDefs.h:132
TauAnalysisTools::TauSelectionCut::m_sName
std::string m_sName
Definition: TauSelectionCuts.h:50
AthCommonMsg::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
TauAnalysisTools::TauSelectionTool::m_iEleIDVersion
int m_iEleIDVersion
Definition: TauSelectionTool.h:138
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::TauSelectionCut::fillHistogram
virtual void fillHistogram(const xAOD::TauJet &xTau, TH1F &hHist) const =0
TauAnalysisTools::TauSelectionCut::m_tTST
TauSelectionTool * m_tTST
Definition: TauSelectionCuts.h:55