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

#include <TauSelectionCuts.h>

Inheritance diagram for TauAnalysisTools::TauSelectionCutAbsCharge:
Collaboration diagram for TauAnalysisTools::TauSelectionCutAbsCharge:

Public Member Functions

 TauSelectionCutAbsCharge (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 91 of file TauSelectionCuts.h.

Constructor & Destructor Documentation

◆ TauSelectionCutAbsCharge()

TauSelectionCutAbsCharge::TauSelectionCutAbsCharge ( TauSelectionTool * tTST)

Definition at line 181 of file TauSelectionCuts.cxx.

182 : TauSelectionCut("CutAbsCharge", tTST)
183{
184 m_hHistCutPre = CreateControlPlot("hCharge_pre","Charge_pre;charge; events",7,-3.5,3.5);
185 m_hHistCut = CreateControlPlot("hCharge_cut","Charge_cut;charge; events",7,-3.5,3.5);
186}
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 TauSelectionCutAbsCharge::accept ( const xAOD::TauJet & xTau,
asg::AcceptData & accept )
overridevirtual

Implements TauAnalysisTools::TauSelectionCut.

Definition at line 201 of file TauSelectionCuts.cxx.

203{
204 // check charge, if tau has one of the charges requiered then return true; false otherwise
205 for( unsigned int iCharge = 0; iCharge < m_tTST->m_vAbsCharges.size(); iCharge++ )
206 {
207 if ( std::abs( xTau.charge() ) == m_tTST->m_vAbsCharges.at(iCharge) )
208 {
209 acceptData.setCutResult( "AbsCharge", true );
210 return true;
211 }
212 }
213 m_tTST->msg() << MSG::VERBOSE << "Tau failed charge requirement, tau charge: " << xTau.charge() << endmsg;
214 return false;
215}
#define endmsg
float charge() 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 TauSelectionCutAbsCharge::fillHistogram ( const xAOD::TauJet & xTau,
TH1F & hHist ) const
overrideprivatevirtual

Implements TauAnalysisTools::TauSelectionCut.

Definition at line 189 of file TauSelectionCuts.cxx.

190{
191 hHist.Fill(xTau.charge());
192}

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

Implements TauAnalysisTools::TauSelectionCut.

Definition at line 195 of file TauSelectionCuts.cxx.

196{
197 info.addCut( "AbsCharge",
198 "Selection of taus according to their absolute charge" );
199}

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