ATLAS Offline Software
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
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 592 of file TauSelectionCuts.cxx.

593  : TauSelectionCut("CutMuonOLR", tTST)
594  , m_bTauMuonOLR(true)
595 {
596  m_hHistCutPre = CreateControlPlot("hMuonOLR_pre","MuonOLR_pre;; events",2,-.5,1.5);
597  m_hHistCut = CreateControlPlot("hMuonOLR_cut","MuonOLR_cut;; events",2,-.5,1.5);
598  // only proceed if histograms are defined
599  if (!m_hHistCutPre or !m_hHistCut)
600  return;
601  m_hHistCutPre->GetXaxis()->SetBinLabel(1,"!MuonOLR");
602  m_hHistCutPre->GetXaxis()->SetBinLabel(2,"MuonOLR");
603  m_hHistCut->GetXaxis()->SetBinLabel(1,"!MuonOLR");
604  m_hHistCut->GetXaxis()->SetBinLabel(2,"MuonOLR");
605 }

Member Function Documentation

◆ accept()

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

Implements TauAnalysisTools::TauSelectionCut.

Definition at line 620 of file TauSelectionCuts.cxx.

622 {
623  if (!m_tTST->m_bMuonOLR)
624  {
625  acceptData.setCutResult( "MuonOLR", true );
626  return true;
627  }
628 
629  // MuonOLR : removing tau overlapped with muon satisfying pt>2GeV and not calo-tagged
630  m_bTauMuonOLR = true;
631 
633  if (!muonContainerHandle.isValid()) {
634  m_tTST->msg() << MSG::ERROR << "Could not retrieve xAOD::MuonContainer with key " << muonContainerHandle.key() << endmsg;
635  return false;
636  }
637  const xAOD::MuonContainer* muonContainer = muonContainerHandle.cptr();
638 
639  for( auto xMuon : *muonContainer )
640  {
641  if(xMuon->pt() < 2000.) continue; // pt > 2 GeV
642  if(xMuon->muonType() == xAOD::Muon::CaloTagged) continue; // not calo-tagged
643  if(xMuon->p4().DeltaR( xTau.p4() ) > 0.2 ) continue; // delta R < 0.2
644  m_bTauMuonOLR = false; // muon-tau overlapped
645  break;
646  }
647  if(m_bTauMuonOLR)
648  {
649  acceptData.setCutResult( "MuonOLR", true );
650  return true;
651  }
652 
653  m_tTST->msg() << MSG::VERBOSE << "Tau failed MuonOLR requirement" << endmsg;
654  return false;
655 }

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

Implements TauAnalysisTools::TauSelectionCut.

Definition at line 608 of file TauSelectionCuts.cxx.

609 {
610  hHist.Fill(m_bTauMuonOLR);
611 }

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

Implements TauAnalysisTools::TauSelectionCut.

Definition at line 614 of file TauSelectionCuts.cxx.

615 {
616  info.addCut( "MuonOLR",
617  "Selection of taus according to their MuonOLR" );
618 }

◆ 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_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:
grepfile.info
info
Definition: grepfile.py:38
muonContainer
xAOD::MuonContainer * muonContainer
Definition: TrigGlobEffCorrValidation.cxx:188
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::TauSelectionCutMuonOLR::m_bTauMuonOLR
bool m_bTauMuonOLR
Definition: TauSelectionCuts.h:184
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
skel.it
it
Definition: skel.GENtoEVGEN.py:396
athena.value
value
Definition: athena.py:124
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
TauAnalysisTools::TauSelectionCut::m_hHistCutPre
TH1F * m_hHistCutPre
Definition: TauSelectionCuts.h:52
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
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
TauAnalysisTools::TauSelectionTool::m_muonContainerKey
SG::ReadHandleKey< xAOD::MuonContainer > m_muonContainerKey
Definition: TauSelectionTool.h:162
TauAnalysisTools::TauSelectionCut::m_sName
std::string m_sName
Definition: TauSelectionCuts.h:50
xAOD::TauJet_v3::p4
virtual FourMom_t p4() const
The full 4-momentum of the particle.
Definition: TauJet_v3.cxx:97
AthCommonMsg::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
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
TauAnalysisTools::TauSelectionTool::m_bMuonOLR
bool m_bMuonOLR
Definition: TauSelectionTool.h:140