ATLAS Offline Software
Loading...
Searching...
No Matches
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)
std::unique_ptr< 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
std::unique_ptr< TH1F > m_hHistCutPre
std::unique_ptr< 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 163 of file TauSelectionCuts.h.

Constructor & Destructor Documentation

◆ TauSelectionCutEleIDWP()

TauSelectionCutEleIDWP::TauSelectionCutEleIDWP ( TauSelectionTool * tTST)

Definition at line 496 of file TauSelectionCuts.cxx.

497 : TauSelectionCut("CutEleIDWP", tTST)
498{
499 m_hHistCutPre = CreateControlPlot("hEleIDWP_pre","EleIDWP_pre;; events",6,-.5,5.5);
500 m_hHistCut = CreateControlPlot("hEleIDWP_cut","EleIDWP_cut;; events",6,-.5,5.5);
501 // only proceed if histograms are defined
502 if (!m_hHistCutPre or !m_hHistCut)
503 return;
504 m_hHistCutPre->GetXaxis()->SetBinLabel(1,"!Loose");
505 m_hHistCutPre->GetXaxis()->SetBinLabel(2,"Loose");
506 m_hHistCutPre->GetXaxis()->SetBinLabel(3,"!Medium");
507 m_hHistCutPre->GetXaxis()->SetBinLabel(4,"Medium");
508 m_hHistCutPre->GetXaxis()->SetBinLabel(5,"!Tight");
509 m_hHistCutPre->GetXaxis()->SetBinLabel(6,"Tight");
510 m_hHistCut->GetXaxis()->SetBinLabel(1,"!Loose");
511 m_hHistCut->GetXaxis()->SetBinLabel(2,"Loose");
512 m_hHistCut->GetXaxis()->SetBinLabel(3,"!Medium");
513 m_hHistCut->GetXaxis()->SetBinLabel(4,"Medium");
514 m_hHistCut->GetXaxis()->SetBinLabel(5,"!Tight");
515 m_hHistCut->GetXaxis()->SetBinLabel(6,"Tight");
516}
std::unique_ptr< TH1F > CreateControlPlot(const char *sName, const char *sTitle, int iBins, double dXLow, double dXUp)
TauSelectionCut(const std::string &sName, TauAnalysisTools::TauSelectionTool *tTST)
std::unique_ptr< TH1F > m_hHistCut
std::unique_ptr< TH1F > m_hHistCutPre

Member Function Documentation

◆ accept()

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

Implements TauAnalysisTools::TauSelectionCut.

Definition at line 543 of file TauSelectionCuts.cxx.

545{
546 // check EleID WP, if tau passes EleID working point then return true; false otherwise
547 bool bPass = false;
548 switch (m_tTST->m_iEleIDWP)
549 {
550 case ELEIDNONE:
551 bPass = true;
552 break;
554 bPass = true;
555 break;
556 case ELEIDRNNLOOSE:
557 if (m_tTST->m_iEleIDVersion!=0){
558 SG::ConstAccessor<char> accLoose ("EleRNNLoose_v"+std::to_string(m_tTST->m_iEleIDVersion));
559 if (accLoose(xTau) == 1)bPass = true;
560 }
561 else if (xTau.isTau(xAOD::TauJetParameters::EleRNNLoose)) bPass = true;
562 break;
563 case ELEIDRNNMEDIUM:
564 if (m_tTST->m_iEleIDVersion!=0){
565 SG::ConstAccessor<char> accMedium ("EleRNNMedium_v"+std::to_string(m_tTST->m_iEleIDVersion));
566 if (accMedium(xTau) == 1)bPass = true;
567 }
568 else if (xTau.isTau(xAOD::TauJetParameters::EleRNNMedium)) bPass = true;
569 break;
570 case ELEIDRNNTIGHT:
571 if (m_tTST->m_iEleIDVersion!=0){
572 SG::ConstAccessor<char> accTight ("EleRNNTight_v"+std::to_string(m_tTST->m_iEleIDVersion));
573 if (accTight(xTau) == 1)bPass = true;
574 }
575 else if (xTau.isTau(xAOD::TauJetParameters::EleRNNTight)) bPass = true;
576 break;
577 default:
578 m_tTST->msg() << MSG::WARNING << "The electron ID working point with the enum " << m_tTST->m_iEleIDWP << " is not available" << endmsg;
579 break;
580 }
581
582 // apply eVeto cut only for 1 prong tau
583 if( xTau.nTracks() != 1){
584 bPass = true;
585 }
586
587 if (bPass)
588 {
589 acceptData.setCutResult( "EleIDWP", true );
590 return true;
591 }
592 m_tTST->msg() << MSG::VERBOSE << "Tau failed EleID WP requirement" << endmsg;
593 return false;
594}
#define endmsg
bool isTau(TauJetParameters::IsTauFlag flag) const
Get Flag for tau acceptance based on predefined arbitrary criteria.
size_t nTracks(TauJetParameters::TauTrackFlag flag=TauJetParameters::TauTrackFlag::classifiedCharged) const

◆ CreateControlPlot()

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

Definition at line 39 of file TauSelectionCuts.cxx.

40{
41 if (m_tTST->m_bCreateControlPlots)
42 {
43 auto hHist = std::make_unique<TH1F>(sName, sTitle, iBins, dXLow, dXUp);
44 hHist->SetDirectory(0);
45 return hHist;
46 }
47
48 return nullptr;
49}

◆ declareProperty()

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

Definition at line 74 of file TauSelectionCuts.cxx.

75{
76 std::pair<std::string, std::string&> p(name, loc);
77 m_mProperties.insert(p);
78}
std::map< std::string, std::string & > m_mProperties

◆ fillHistogram()

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

Implements TauAnalysisTools::TauSelectionCut.

Definition at line 519 of file TauSelectionCuts.cxx.

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

◆ fillHistogramCut()

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

Definition at line 58 of file TauSelectionCuts.cxx.

59{
61}
virtual void fillHistogram(const xAOD::TauJet &xTau, TH1F &hHist) const =0

◆ fillHistogramCutPre()

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

Definition at line 52 of file TauSelectionCuts.cxx.

53{
55}

◆ getName()

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

Definition at line 44 of file TauSelectionCuts.h.

45 {
46 return m_sName;
47 };

◆ getProperty()

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

Definition at line 81 of file TauSelectionCuts.cxx.

82{
83 std::map<std::string, std::string&>::iterator it = m_mProperties.find(name);
84 if(it == m_mProperties.end() )
85 throw std::runtime_error (("Undeclared property: " + name + "\n").c_str());
86
87 return it->second;
88}

◆ setAcceptInfo()

void TauSelectionCutEleIDWP::setAcceptInfo ( asg::AcceptInfo & info) const
overridevirtual

Implements TauAnalysisTools::TauSelectionCut.

Definition at line 537 of file TauSelectionCuts.cxx.

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

◆ setProperty()

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

Definition at line 65 of file TauSelectionCuts.cxx.

66{
67 std::map<std::string, std::string&>::iterator it = m_mProperties.find(name);
68 if(it == m_mProperties.end() )
69 throw std::runtime_error (("Undeclared property: " + name + "\n").c_str());
70 it->second = value;
71}

◆ writeControlHistograms()

void TauSelectionCut::writeControlHistograms ( )
inherited

Definition at line 32 of file TauSelectionCuts.cxx.

33{
34 m_hHistCutPre->Write();
35 m_hHistCut->Write();
36}

Member Data Documentation

◆ m_hHistCut

std::unique_ptr<TH1F> TauAnalysisTools::TauSelectionCut::m_hHistCut
protectedinherited

Definition at line 55 of file TauSelectionCuts.h.

◆ m_hHistCutPre

std::unique_ptr<TH1F> TauAnalysisTools::TauSelectionCut::m_hHistCutPre
protectedinherited

Definition at line 54 of file TauSelectionCuts.h.

◆ m_mProperties

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

Definition at line 60 of file TauSelectionCuts.h.

◆ m_sName

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

Definition at line 52 of file TauSelectionCuts.h.

◆ m_tTST

TauSelectionTool* TauAnalysisTools::TauSelectionCut::m_tTST
protectedinherited

Definition at line 57 of file TauSelectionCuts.h.


The documentation for this class was generated from the following files: