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)
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

Private Attributes

bool m_bTauMuonOLR

Detailed Description

Definition at line 175 of file TauSelectionCuts.h.

Constructor & Destructor Documentation

◆ TauSelectionCutMuonOLR()

TauSelectionCutMuonOLR::TauSelectionCutMuonOLR ( TauSelectionTool * tTST)

Definition at line 604 of file TauSelectionCuts.cxx.

605 : TauSelectionCut("CutMuonOLR", tTST)
606 , m_bTauMuonOLR(true)
607{
608 m_hHistCutPre = CreateControlPlot("hMuonOLR_pre","MuonOLR_pre;; events",2,-.5,1.5);
609 m_hHistCut = CreateControlPlot("hMuonOLR_cut","MuonOLR_cut;; events",2,-.5,1.5);
610 // only proceed if histograms are defined
611 if (!m_hHistCutPre or !m_hHistCut)
612 return;
613 m_hHistCutPre->GetXaxis()->SetBinLabel(1,"!MuonOLR");
614 m_hHistCutPre->GetXaxis()->SetBinLabel(2,"MuonOLR");
615 m_hHistCut->GetXaxis()->SetBinLabel(1,"!MuonOLR");
616 m_hHistCut->GetXaxis()->SetBinLabel(2,"MuonOLR");
617}
TauSelectionCut(const std::string &sName, TauAnalysisTools::TauSelectionTool *tTST)
TH1F * CreateControlPlot(const char *sName, const char *sTitle, int iBins, double dXLow, double dXUp)

Member Function Documentation

◆ accept()

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

Implements TauAnalysisTools::TauSelectionCut.

Definition at line 632 of file TauSelectionCuts.cxx.

634{
635 if (!m_tTST->m_bMuonOLR)
636 {
637 acceptData.setCutResult( "MuonOLR", true );
638 return true;
639 }
640
641 // MuonOLR : removing tau overlapped with muon satisfying pt>2GeV and not calo-tagged
642 m_bTauMuonOLR = true;
643
644 static const SG::ConstAccessor<char> acc_taumuonolr ("passTATTauMuonOLR");
645 if ( acc_taumuonolr.isAvailable(xTau) ) {
646 m_bTauMuonOLR = static_cast<bool>(acc_taumuonolr(xTau));
647 } else {
648 // fallback to manual calculation
649 SG::ReadHandle<xAOD::MuonContainer> muonContainerHandle( m_tTST->m_muonContainerKey );
650 if (!muonContainerHandle.isValid()) {
651 m_tTST->msg() << MSG::ERROR << "Could not retrieve xAOD::MuonContainer with key " << muonContainerHandle.key() << endmsg;
652 return false;
653 }
654 const xAOD::MuonContainer* muonContainer = muonContainerHandle.cptr();
655
656 for( auto xMuon : *muonContainer )
657 {
658 if(xMuon->pt() < 2000.) continue; // pt > 2 GeV
659 if(xMuon->muonType() == xAOD::Muon::CaloTagged) continue; // not calo-tagged
660 if(xMuon->p4().DeltaR( xTau.p4() ) > 0.2 ) continue; // delta R < 0.2
661 m_bTauMuonOLR = false; // muon-tau overlapped
662 break;
663 }
664 }
665
666 if(m_bTauMuonOLR)
667 {
668 acceptData.setCutResult( "MuonOLR", true );
669 return true;
670 }
671
672 m_tTST->msg() << MSG::VERBOSE << "Tau failed MuonOLR requirement" << endmsg;
673 return false;
674}
#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()

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{
46 if (m_tTST->m_bCreateControlPlots)
47 {
48 TH1F* hHist = new TH1F(sName, sTitle, iBins, dXLow, dXUp);
49 hHist->SetDirectory(0);
50 return hHist;
51 }
52
53 return nullptr;
54}
TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)

◆ 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}
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 620 of file TauSelectionCuts.cxx.

621{
622 hHist.Fill(m_bTauMuonOLR);
623}

◆ fillHistogramCut()

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

Definition at line 63 of file TauSelectionCuts.cxx.

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

◆ 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{
88 std::map<std::string, std::string&>::iterator it = m_mProperties.find(name);
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 TauSelectionCutMuonOLR::setAcceptInfo ( asg::AcceptInfo & info) const
overridevirtual

Implements TauAnalysisTools::TauSelectionCut.

Definition at line 626 of file TauSelectionCuts.cxx.

627{
628 info.addCut( "MuonOLR",
629 "Selection of taus according to their MuonOLR" );
630}

◆ setProperty()

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

Definition at line 70 of file TauSelectionCuts.cxx.

71{
72 std::map<std::string, std::string&>::iterator it = m_mProperties.find(name);
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_bTauMuonOLR

bool TauAnalysisTools::TauSelectionCutMuonOLR::m_bTauMuonOLR
private

Definition at line 184 of file TauSelectionCuts.h.

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