ATLAS Offline Software
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
TauAnalysisTools::DiTauSelectionCutPt Class Reference

#include <DiTauSelectionCuts.h>

Inheritance diagram for TauAnalysisTools::DiTauSelectionCutPt:
Collaboration diagram for TauAnalysisTools::DiTauSelectionCutPt:

Public Member Functions

 DiTauSelectionCutPt (DiTauSelectionTool *tDTST)
 
virtual void setAcceptInfo (asg::AcceptInfo &info) const override
 
virtual bool accept (const xAOD::DiTauJet &xTau, asg::AcceptData &accept) override
 
void writeControlHistograms ()
 
void fillHistogramCutPre (const xAOD::DiTauJet &xTau)
 
void fillHistogramCut (const xAOD::DiTauJet &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
 
DiTauSelectionToolm_tDTST
 
std::map< std::string, std::string & > m_mProperties
 

Private Member Functions

virtual void fillHistogram (const xAOD::DiTauJet &xTau, TH1F &hHist) const override
 

Detailed Description

Definition at line 66 of file DiTauSelectionCuts.h.

Constructor & Destructor Documentation

◆ DiTauSelectionCutPt()

DiTauSelectionCutPt::DiTauSelectionCutPt ( DiTauSelectionTool tDTST)

Definition at line 94 of file DiTauSelectionCuts.cxx.

95  : DiTauSelectionCut("CutPt", tDTST)
96 {
97  m_hHistCutPre = CreateControlPlot("hPt_pre","Pt_pre;di-#tau-p_{T} [GeV]; events",1000,0,1000);
98  m_hHistCut = CreateControlPlot("hPt_cut","Pt_cut;di-#tau-p_{T} [GeV]; events",1000,0,1000);
99 }

Member Function Documentation

◆ accept()

bool DiTauSelectionCutPt::accept ( const xAOD::DiTauJet xTau,
asg::AcceptData accept 
)
overridevirtual

Implements TauAnalysisTools::DiTauSelectionCut.

Definition at line 114 of file DiTauSelectionCuts.cxx.

116 {
117  // save ditau pt in GeV
118  double pt = xDiTau.pt() / 1000.;
119  // in case of only one entry in vector, run for lower limits
120  if (m_tDTST->m_vPtRegion.size() == 1)
121  {
122  if ( pt >= m_tDTST->m_vPtRegion.at(0) )
123  {
124  acceptData.setCutResult( "Pt", true );
125  return true;
126  }
127  }
128  unsigned int iNumPtRegion = m_tDTST->m_vPtRegion.size()/2;
129  for( unsigned int iPtRegion = 0; iPtRegion < iNumPtRegion; iPtRegion++ )
130  {
131  if ( pt >= m_tDTST->m_vPtRegion.at(iPtRegion*2) and pt <= m_tDTST->m_vPtRegion.at(iPtRegion*2+1))
132  {
133  acceptData.setCutResult( "Pt", true );
134  return true;
135  }
136  }
137  m_tDTST->msg() << MSG::VERBOSE << "DiTau failed pt requirement, ditau pt [GeV]: " << pt << endmsg;
138  return false;
139 }

◆ CreateControlPlot()

TH1F * DiTauSelectionCut::CreateControlPlot ( const char *  sName,
const char *  sTitle,
int  iBins,
double  dXLow,
double  dXUp 
)
inherited

Definition at line 40 of file DiTauSelectionCuts.cxx.

41 {
43  {
44  TH1F* hHist = new TH1F(sName, sTitle, iBins, dXLow, dXUp);
45  hHist->SetDirectory(0);
46  return hHist;
47  }
48 
49  return nullptr;
50 }

◆ declareProperty()

void DiTauSelectionCut::declareProperty ( const std::string &  name,
std::string &  loc 
)
protectedinherited

Definition at line 75 of file DiTauSelectionCuts.cxx.

76 {
77  std::pair<std::string, std::string&> p(name, loc);
78  m_mProperties.insert(p);
79 }

◆ fillHistogram()

void DiTauSelectionCutPt::fillHistogram ( const xAOD::DiTauJet xTau,
TH1F &  hHist 
) const
overrideprivatevirtual

Implements TauAnalysisTools::DiTauSelectionCut.

Definition at line 102 of file DiTauSelectionCuts.cxx.

103 {
104  hHist.Fill(xDiTau.pt()/1000.);
105 }

◆ fillHistogramCut()

void DiTauSelectionCut::fillHistogramCut ( const xAOD::DiTauJet xTau)
inherited

Definition at line 59 of file DiTauSelectionCuts.cxx.

60 {
61  fillHistogram(xDiTau, *m_hHistCut);
62 }

◆ fillHistogramCutPre()

void DiTauSelectionCut::fillHistogramCutPre ( const xAOD::DiTauJet xTau)
inherited

Definition at line 53 of file DiTauSelectionCuts.cxx.

54 {
55  fillHistogram(xDiTau, *m_hHistCutPre);
56 }

◆ getName()

const std::string& TauAnalysisTools::DiTauSelectionCut::getName ( )
inlineinherited

Definition at line 43 of file DiTauSelectionCuts.h.

44  {
45  return m_sName;
46  };

◆ getProperty()

std::string DiTauSelectionCut::getProperty ( const std::string &  name)
protectedinherited

Definition at line 82 of file DiTauSelectionCuts.cxx.

83 {
85  if(it == m_mProperties.end() )
86  throw std::runtime_error (("Undeclared property: " + name + "\n").c_str());
87 
88  return it->second;
89 }

◆ setAcceptInfo()

void DiTauSelectionCutPt::setAcceptInfo ( asg::AcceptInfo info) const
overridevirtual

Implements TauAnalysisTools::DiTauSelectionCut.

Definition at line 108 of file DiTauSelectionCuts.cxx.

109 {
110  info.addCut( "Pt",
111  "Selection of ditaus according to their transverse momentum" );
112 }

◆ setProperty()

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

Definition at line 66 of file DiTauSelectionCuts.cxx.

67 {
69  if(it == m_mProperties.end() )
70  throw std::runtime_error (("Undeclared property: " + name + "\n").c_str());
71  it->second = value;
72 }

◆ writeControlHistograms()

void DiTauSelectionCut::writeControlHistograms ( )
inherited

Definition at line 33 of file DiTauSelectionCuts.cxx.

34 {
35  m_hHistCutPre->Write();
36  m_hHistCut->Write();
37 }

Member Data Documentation

◆ m_hHistCut

TH1F* TauAnalysisTools::DiTauSelectionCut::m_hHistCut
protectedinherited

Definition at line 54 of file DiTauSelectionCuts.h.

◆ m_hHistCutPre

TH1F* TauAnalysisTools::DiTauSelectionCut::m_hHistCutPre
protectedinherited

Definition at line 53 of file DiTauSelectionCuts.h.

◆ m_mProperties

std::map<std::string, std::string&> TauAnalysisTools::DiTauSelectionCut::m_mProperties
protectedinherited

Definition at line 59 of file DiTauSelectionCuts.h.

◆ m_sName

std::string TauAnalysisTools::DiTauSelectionCut::m_sName
protectedinherited

Definition at line 51 of file DiTauSelectionCuts.h.

◆ m_tDTST

DiTauSelectionTool* TauAnalysisTools::DiTauSelectionCut::m_tDTST
protectedinherited

Definition at line 56 of file DiTauSelectionCuts.h.


The documentation for this class was generated from the following files:
grepfile.info
info
Definition: grepfile.py:38
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
TauAnalysisTools::DiTauSelectionTool::m_bCreateControlPlots
bool m_bCreateControlPlots
Definition: DiTauSelectionTool.h:122
skel.it
it
Definition: skel.GENtoEVGEN.py:396
test_pyathena.pt
pt
Definition: test_pyathena.py:11
athena.value
value
Definition: athena.py:124
TauAnalysisTools::DiTauSelectionCut::CreateControlPlot
TH1F * CreateControlPlot(const char *sName, const char *sTitle, int iBins, double dXLow, double dXUp)
Definition: DiTauSelectionCuts.cxx:40
TauAnalysisTools::DiTauSelectionCut::m_sName
std::string m_sName
Definition: DiTauSelectionCuts.h:51
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
TauAnalysisTools::DiTauSelectionCut::m_hHistCut
TH1F * m_hHistCut
Definition: DiTauSelectionCuts.h:54
TauAnalysisTools::DiTauSelectionCut::DiTauSelectionCut
DiTauSelectionCut(const std::string &sName, TauAnalysisTools::DiTauSelectionTool *tDTST)
Definition: DiTauSelectionCuts.cxx:16
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
TauAnalysisTools::DiTauSelectionCut::m_mProperties
std::map< std::string, std::string & > m_mProperties
Definition: DiTauSelectionCuts.h:59
TauAnalysisTools::DiTauSelectionCut::m_hHistCutPre
TH1F * m_hHistCutPre
Definition: DiTauSelectionCuts.h:53
TauAnalysisTools::DiTauSelectionTool::m_vPtRegion
std::vector< float > m_vPtRegion
Definition: DiTauSelectionTool.h:97
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
TauAnalysisTools::DiTauSelectionCut::m_tDTST
DiTauSelectionTool * m_tDTST
Definition: DiTauSelectionCuts.h:56
TauAnalysisTools::DiTauSelectionCut::fillHistogram
virtual void fillHistogram(const xAOD::DiTauJet &xTau, TH1F &hHist) const =0
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