ATLAS Offline Software
Loading...
Searching...
No Matches
TauAnalysisTools::TauSelectionCutMuonOLR Class Reference

#include <TauSelectionCuts.h>

Inheritance diagram for TauAnalysisTools::TauSelectionCutMuonOLR:
Collaboration diagram for TauAnalysisTools::TauSelectionCutMuonOLR:

Public Member Functions

 TauSelectionCutMuonOLR (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

Private Attributes

bool m_bTauMuonOLR

Detailed Description

Definition at line 177 of file TauSelectionCuts.h.

Constructor & Destructor Documentation

◆ TauSelectionCutMuonOLR()

TauSelectionCutMuonOLR::TauSelectionCutMuonOLR ( TauSelectionTool * tTST)

Definition at line 599 of file TauSelectionCuts.cxx.

600 : TauSelectionCut("CutMuonOLR", tTST)
601 , m_bTauMuonOLR(true)
602{
603 m_hHistCutPre = CreateControlPlot("hMuonOLR_pre","MuonOLR_pre;; events",2,-.5,1.5);
604 m_hHistCut = CreateControlPlot("hMuonOLR_cut","MuonOLR_cut;; events",2,-.5,1.5);
605 // only proceed if histograms are defined
606 if (!m_hHistCutPre or !m_hHistCut)
607 return;
608 m_hHistCutPre->GetXaxis()->SetBinLabel(1,"!MuonOLR");
609 m_hHistCutPre->GetXaxis()->SetBinLabel(2,"MuonOLR");
610 m_hHistCut->GetXaxis()->SetBinLabel(1,"!MuonOLR");
611 m_hHistCut->GetXaxis()->SetBinLabel(2,"MuonOLR");
612}
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 TauSelectionCutMuonOLR::accept ( const xAOD::TauJet & xTau,
asg::AcceptData & accept )
overridevirtual

Implements TauAnalysisTools::TauSelectionCut.

Definition at line 627 of file TauSelectionCuts.cxx.

629{
630 if (!m_tTST->m_bMuonOLR)
631 {
632 acceptData.setCutResult( "MuonOLR", true );
633 return true;
634 }
635
636 // MuonOLR : removing tau overlapped with muon satisfying pt>2GeV and not calo-tagged
637 m_bTauMuonOLR = true;
638
639 static const SG::ConstAccessor<char> acc_taumuonolr ("passTATTauMuonOLR");
640 if ( acc_taumuonolr.isAvailable(xTau) ) {
641 m_bTauMuonOLR = static_cast<bool>(acc_taumuonolr(xTau));
642 } else {
643 // fallback to manual calculation
644 SG::ReadHandle<xAOD::MuonContainer> muonContainerHandle( m_tTST->m_muonContainerKey );
645 if (!muonContainerHandle.isValid()) {
646 m_tTST->msg() << MSG::ERROR << "Could not retrieve xAOD::MuonContainer with key " << muonContainerHandle.key() << endmsg;
647 return false;
648 }
649 const xAOD::MuonContainer* muonContainer = muonContainerHandle.cptr();
650
651 for( auto xMuon : *muonContainer )
652 {
653 if(xMuon->pt() < 2000.) continue; // pt > 2 GeV
654 if(xMuon->muonType() == xAOD::Muon::CaloTagged) continue; // not calo-tagged
655 if(xMuon->p4().DeltaR( xTau.p4() ) > 0.2 ) continue; // delta R < 0.2
656 m_bTauMuonOLR = false; // muon-tau overlapped
657 break;
658 }
659 }
660
661 if(m_bTauMuonOLR)
662 {
663 acceptData.setCutResult( "MuonOLR", true );
664 return true;
665 }
666
667 m_tTST->msg() << MSG::VERBOSE << "Tau failed MuonOLR requirement" << endmsg;
668 return false;
669}
#define endmsg
xAOD::MuonContainer * muonContainer
virtual FourMom_t p4() const
The full 4-momentum of the particle.
Definition TauJet_v3.cxx:96
MuonContainer_v1 MuonContainer
Definition of the current "Muon container version".

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

Implements TauAnalysisTools::TauSelectionCut.

Definition at line 615 of file TauSelectionCuts.cxx.

616{
617 hHist.Fill(m_bTauMuonOLR);
618}

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

Implements TauAnalysisTools::TauSelectionCut.

Definition at line 621 of file TauSelectionCuts.cxx.

622{
623 info.addCut( "MuonOLR",
624 "Selection of taus according to their MuonOLR" );
625}

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

bool TauAnalysisTools::TauSelectionCutMuonOLR::m_bTauMuonOLR
private

Definition at line 186 of file TauSelectionCuts.h.

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