ATLAS Offline Software
Loading...
Searching...
No Matches
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)
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 139 of file TauSelectionCuts.h.

Constructor & Destructor Documentation

◆ TauSelectionCutJetIDWP()

TauSelectionCutJetIDWP::TauSelectionCutJetIDWP ( TauSelectionTool * tTST)

Definition at line 335 of file TauSelectionCuts.cxx.

336 : TauSelectionCut("CutJetIDWP", tTST)
337{
338 m_hHistCutPre = CreateControlPlot("hJetIDWP_pre","JetIDWP_pre;; events",8,-.5,7.5);
339 m_hHistCut = CreateControlPlot("hJetIDWP_cut","JetIDWP_cut;; events",8,-.5,7.5);
340 // only proceed if histograms are defined
341 if (!m_hHistCutPre or !m_hHistCut)
342 return;
343
344 m_hHistCutPre->GetXaxis()->SetBinLabel(1,"!VeryLoose");
345 m_hHistCutPre->GetXaxis()->SetBinLabel(2,"VeryLoose");
346 m_hHistCutPre->GetXaxis()->SetBinLabel(3,"!Loose");
347 m_hHistCutPre->GetXaxis()->SetBinLabel(4,"Loose");
348 m_hHistCutPre->GetXaxis()->SetBinLabel(5,"!Medium");
349 m_hHistCutPre->GetXaxis()->SetBinLabel(6,"Medium");
350 m_hHistCutPre->GetXaxis()->SetBinLabel(7,"!Tight");
351 m_hHistCutPre->GetXaxis()->SetBinLabel(8,"Tight");
352 m_hHistCut->GetXaxis()->SetBinLabel(1,"!VeryLoose");
353 m_hHistCut->GetXaxis()->SetBinLabel(2,"VeryLoose");
354 m_hHistCut->GetXaxis()->SetBinLabel(3,"!Loose");
355 m_hHistCut->GetXaxis()->SetBinLabel(4,"Loose");
356 m_hHistCut->GetXaxis()->SetBinLabel(5,"!Medium");
357 m_hHistCut->GetXaxis()->SetBinLabel(6,"Medium");
358 m_hHistCut->GetXaxis()->SetBinLabel(7,"!Tight");
359 m_hHistCut->GetXaxis()->SetBinLabel(8,"Tight");
360}
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 TauSelectionCutJetIDWP::accept ( const xAOD::TauJet & xTau,
asg::AcceptData & accept )
overridevirtual

Implements TauAnalysisTools::TauSelectionCut.

Definition at line 389 of file TauSelectionCuts.cxx.

391{
392 // check Jet ID working point, if tau passes JetID working point then return true; false otherwise
393 bool bPass = false;
394 switch (m_tTST->m_iJetIDWP)
395 {
396 case JETIDNONE:
397 bPass = true;
398 break;
401 break;
402 case JETIDRNNLOOSE:
403 if (xTau.isTau(xAOD::TauJetParameters::JetRNNSigLoose)) bPass = true;
404 break;
405 case JETIDRNNMEDIUM:
406 if (xTau.isTau(xAOD::TauJetParameters::JetRNNSigMedium)) bPass = true;
407 break;
408 case JETIDRNNTIGHT:
409 if (xTau.isTau(xAOD::TauJetParameters::JetRNNSigTight)) bPass = true;
410 break;
412 static const SG::ConstAccessor<char> acc_gnTauVeryLoose("GNTauVL_v0prune");
413 if (!acc_gnTauVeryLoose.isAvailable(xTau)) m_tTST->msg() << MSG::WARNING << "GnTau VeryLoose WP not available" << endmsg;
414 else bPass = acc_gnTauVeryLoose(xTau);
415 break;
416 case JETIDGNTAULOOSE:
417 static const SG::ConstAccessor<char> acc_gnTauLoose("GNTauL_v0prune");
418 if (!acc_gnTauLoose.isAvailable(xTau)) m_tTST->msg() << MSG::WARNING << "GnTau Loose WP not available" << endmsg;
419 else bPass = acc_gnTauLoose(xTau);
420 break;
421 case JETIDGNTAUMEDIUM:
422 static const SG::ConstAccessor<char> acc_gnTauMedium("GNTauM_v0prune");
423 if (!acc_gnTauMedium.isAvailable(xTau)) m_tTST->msg() << MSG::WARNING << "GnTau Medium WP not available" << endmsg;
424 else bPass = acc_gnTauMedium(xTau);
425 break;
426 case JETIDGNTAUTIGHT:
427 static const SG::ConstAccessor<char> acc_gnTauTight("GNTauT_v0prune");
428 if (!acc_gnTauTight.isAvailable(xTau)) m_tTST->msg() << MSG::WARNING << "GnTau Tight WP not available" << endmsg;
429 else bPass = acc_gnTauTight(xTau);
430 break;
431 default:
432 m_tTST->msg() << MSG::WARNING << "The jet ID working point with the enum " << m_tTST->m_iJetIDWP << " is not available" << endmsg;
433 break;
434 }
435 if (bPass)
436 {
437 acceptData.setCutResult( "JetIDWP", true );
438 return true;
439 }
440 m_tTST->msg() << MSG::VERBOSE << "Tau failed JetIDWP requirement, tau transformed RNN score: " << xTau.discriminant(xAOD::TauJetParameters::RNNJetScoreSigTrans) << endmsg;
441 return false;
442}
#define endmsg
double discriminant(TauJetParameters::TauID discID) const
Get value of discriminant.
bool isTau(TauJetParameters::IsTauFlag flag) const
Get Flag for tau acceptance based on predefined arbitrary criteria.
@ RNNJetScoreSigTrans
RNN score which is signal transformed/flattened.
Definition TauDefs.h:92

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

Implements TauAnalysisTools::TauSelectionCut.

Definition at line 363 of file TauSelectionCuts.cxx.

364{
365 if(m_tTST->m_useGNTau){
366 static const SG::ConstAccessor<char> acc_gnTauVeryLoose("GNTauVL_v0prune");
367 static const SG::ConstAccessor<char> acc_gnTauLoose("GNTauL_v0prune");
368 static const SG::ConstAccessor<char> acc_gnTauMedium("GNTauM_v0prune");
369 static const SG::ConstAccessor<char> acc_gnTauTight("GNTauT_v0prune");
370 hHist.Fill(acc_gnTauVeryLoose(xTau));
371 hHist.Fill(acc_gnTauLoose(xTau)+2);
372 hHist.Fill(acc_gnTauMedium(xTau)+4);
373 hHist.Fill(acc_gnTauTight(xTau)+6);
374 } else {
379 }
380}

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

Implements TauAnalysisTools::TauSelectionCut.

Definition at line 383 of file TauSelectionCuts.cxx.

384{
385 info.addCut( "JetIDWP",
386 "Selection of taus according to their JetIDScore" );
387}

◆ 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: