Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
DerivationFramework::SkimmingToolHIGG5VBF Class Reference

#include <SkimmingToolHIGG5VBF.h>

Inheritance diagram for DerivationFramework::SkimmingToolHIGG5VBF:
Collaboration diagram for DerivationFramework::SkimmingToolHIGG5VBF:

Public Member Functions

 SkimmingToolHIGG5VBF (const std::string &t, const std::string &n, const IInterface *p)
 Constructor with parameters. More...
 
 ~SkimmingToolHIGG5VBF ()
 Destructor. More...
 
virtual StatusCode initialize () override
 
virtual StatusCode finalize () override
 
virtual bool eventPassesFilter () const override
 Check that the current event passes this filter. More...
 

Private Member Functions

bool checkAllJetQuality (const TLorentzVector &jet) const
 
bool checkCentralJetQuality (const TLorentzVector &jet) const
 
TLorentzVector getCalibedJets (const xAOD::Jet *jet) const
 

Private Attributes

bool m_debug
 
ToolHandle< Trig::TrigDecisionToolm_trigDecisionTool
 
std::atomic< unsigned int > m_ntot
 
std::atomic< unsigned int > m_npass
 
std::string m_jetSGKey
 
std::string m_calibedJetMomKey
 
bool m_reqNAllJets
 
unsigned int m_nAllJets
 
double m_allJetPtCut
 
double m_allJetEtaCut
 
bool m_reqNCentralJets
 
unsigned int m_nCentralJets
 
double m_centralJetPtCut
 
double m_centralJetEtaCut
 
bool m_reqTrigger
 
std::vector< std::string > m_triggers
 
bool m_reqVbfMjj
 
double m_vbfMjjCut
 
std::string m_phSGKey
 
bool m_reqPh
 
double m_phPtCut
 
double m_centralPhEtaCut
 

Detailed Description

Author
Yasuy.nosp@m.uki..nosp@m.Okumu.nosp@m.ra@c.nosp@m.ern.c.nosp@m.h

Definition at line 34 of file SkimmingToolHIGG5VBF.h.

Constructor & Destructor Documentation

◆ SkimmingToolHIGG5VBF()

DerivationFramework::SkimmingToolHIGG5VBF::SkimmingToolHIGG5VBF ( const std::string &  t,
const std::string &  n,
const IInterface *  p 
)

Constructor with parameters.

Definition at line 19 of file SkimmingToolHIGG5VBF.cxx.

21  :
22  base_class(t, n, p),
23  m_trigDecisionTool("Trig::TrigDecisionTool/TrigDecisionTool"),
24  m_ntot(0),
25  m_npass(0)
26 {
27 
28  // for jet multiplicity requirement
29  declareProperty("JetContainerKey", m_jetSGKey="AntiKt4EMTopoJets");
30  declareProperty("CalibedJetMomentKey", m_calibedJetMomKey="DFCommonJets_Calib");
31 
32  // for jet multiplicity
33  declareProperty("ReqNAllJets", m_reqNAllJets=false);
34  declareProperty("NumberOfAllJets", m_nAllJets=4);
35  declareProperty("AllJetPtCut", m_allJetPtCut=40.*CLHEP::GeV);
36  declareProperty("AllJetEtaCut", m_allJetEtaCut=4.9);
37 
38  declareProperty("ReqNCentralJets", m_reqNCentralJets=false);
39  declareProperty("NumberOfCentralJets", m_nCentralJets=2);
40  declareProperty("CentralJetPtCut", m_centralJetPtCut=40.*CLHEP::GeV);
41  declareProperty("CentralJetEtaCut", m_centralJetEtaCut=2.6);
42 
43  // for trigger requirement
44  declareProperty("ReqTrigger", m_reqTrigger=false);
45  declareProperty("Triggers", m_triggers=std::vector<std::string>());
46 
47  // for Mjj requirement ()
48  declareProperty("ReqVBFMjj", m_reqVbfMjj=false); // logical "ORed" with ReqPhoton
49  declareProperty("MjjCut", m_vbfMjjCut=0.*CLHEP::GeV);
50 
51  declareProperty("DoDebug", m_debug=false);
52 
53  // photon requirement (p. rose)
54  declareProperty("PhotonContainerKey", m_phSGKey="Photons");
55  declareProperty("ReqPhoton", m_reqPh=false); // logical "ORed" with ReqVBFMjj
56  declareProperty("PhotonPtCut", m_phPtCut=0.*CLHEP::GeV);
57  declareProperty("CentralPhotonEtaCut", m_centralPhEtaCut=2.6);
58 
59 }

◆ ~SkimmingToolHIGG5VBF()

DerivationFramework::SkimmingToolHIGG5VBF::~SkimmingToolHIGG5VBF ( )

Destructor.

Definition at line 62 of file SkimmingToolHIGG5VBF.cxx.

62  {
63 }

Member Function Documentation

◆ checkAllJetQuality()

bool DerivationFramework::SkimmingToolHIGG5VBF::checkAllJetQuality ( const TLorentzVector &  jet) const
private

Definition at line 176 of file SkimmingToolHIGG5VBF.cxx.

177 {
178  if(jet.Pt()<m_allJetPtCut) return false;
179  if(fabs(jet.Eta())>m_allJetEtaCut) return false;
180 
181  return true;
182 }

◆ checkCentralJetQuality()

bool DerivationFramework::SkimmingToolHIGG5VBF::checkCentralJetQuality ( const TLorentzVector &  jet) const
private

Definition at line 184 of file SkimmingToolHIGG5VBF.cxx.

185 {
186  if(jet.Pt()<m_centralJetPtCut) return false;
187  if(fabs(jet.Eta())>m_centralJetEtaCut) return false;
188 
189  return true;
190 }

◆ eventPassesFilter()

bool DerivationFramework::SkimmingToolHIGG5VBF::eventPassesFilter ( ) const
overridevirtual

Check that the current event passes this filter.

Definition at line 88 of file SkimmingToolHIGG5VBF.cxx.

89 {
90  m_ntot++;
91  bool acceptEvent(true);
92 
93  StatusCode sc(StatusCode::SUCCESS);
94 
95  bool isTriggerFired(m_triggers.empty());
96  for(unsigned int i(0); i<m_triggers.size(); i++) {
97  if(m_trigDecisionTool->isPassed(m_triggers.at(i))) {
98  isTriggerFired = true;
99  break;
100  }
101  }
102 
103  // (1) Count Jet Multiplicity
104  std::vector<TLorentzVector> goodAllJets;
105  std::vector<TLorentzVector> goodCentralJets;
106 
107  const xAOD::JetContainer *jets(nullptr);
108  ATH_CHECK(evtStore()->retrieve(jets, m_jetSGKey), false);
109  xAOD::JetContainer::const_iterator jet_itr(jets->begin());
111  for(; jet_itr != jet_end; ++jet_itr) {
112  TLorentzVector jetP4 = getCalibedJets( (*jet_itr) );
113  if(this->checkAllJetQuality(jetP4)) { goodAllJets.push_back(jetP4); }
114  if(this->checkCentralJetQuality(jetP4)) { goodCentralJets.push_back(jetP4); }
115  }
116 
117  // (2) evaluate maximum Mjj in the event
118  double maxM = 0.;
119  for(unsigned int jet_i = 0; jet_i<goodAllJets.size(); jet_i++) {
120  const TLorentzVector& iP4 = goodAllJets.at(jet_i);
121 
122  for(unsigned int jet_k=jet_i+1; jet_k<goodAllJets.size(); jet_k++) {
123  const TLorentzVector& kP4 = goodAllJets.at(jet_k);
124 
125  const TLorentzVector jjP4 = iP4 + kP4;
126  const double jjM = jjP4.M();
127 
128  if (maxM<jjM) {maxM=jjM;}
129  }
130  }
131 
132  //get max pt of any photon in the event (p. rose)
133  double maxPhPt=0.;
134  if(m_reqPh){
135  const xAOD::PhotonContainer *phots(nullptr);
136  ATH_CHECK(evtStore()->retrieve(phots, m_phSGKey), false);
137  for (const auto* ph : *phots){
138  if(abs(ph->eta())<m_centralPhEtaCut)
139  if(ph->pt()>maxPhPt) maxPhPt = ph->pt();
140  }//for
141  }//if
142 
143 
144 
145  const bool passNAllJet = (goodAllJets.size()>=m_nAllJets);
146  const bool passNCentralJet = (goodCentralJets.size()>=m_nCentralJets);
147  const bool passMjjCut = (maxM>m_vbfMjjCut);
148  const bool passPhPtCut = (maxPhPt>m_phPtCut);
149 
150  if (m_reqNAllJets) { if (not passNAllJet) {acceptEvent=false;} }
151  if (m_reqNCentralJets) { if (not passNCentralJet) {acceptEvent=false;} }
152  //if (m_reqVbfMjj) { if (not passMjjCut) {acceptEvent=false;} }
153  if (m_reqTrigger) { if (not isTriggerFired) {acceptEvent=false;} }
154  //vbf+gamma addition -- logical OR of mjj and phpt cut
155  if(m_reqVbfMjj and not m_reqPh) { if (not passMjjCut) {acceptEvent=false;} }
156  if(m_reqPh and not m_reqVbfMjj) { if (not passPhPtCut) {acceptEvent=false;} }
157  if(m_reqPh and m_reqVbfMjj) { if (not (passMjjCut or passPhPtCut) ) {acceptEvent=false;} }
158 
159  if (acceptEvent) {m_npass++;}
160 
161  if (m_debug) {
162  printf("dbg> L%3d : event accepted [%s] "
163  "(NJets=%2d [%6s], NCentralJets=%2d [%6s] Mjj=%10.1f [%6s], Trigger [%6s]) \n",
164  __LINE__,
165  acceptEvent? "Y" : "N",
166  (int)goodAllJets.size(), passNAllJet ? "PASSED" : "FAILED",
167  (int)goodCentralJets.size(), passNCentralJet ? "PASSED" : "FAILED",
168  maxM, passMjjCut ? "PASSED" : "FAILED",
169  isTriggerFired ? "PASSED" : "FAILED"
170  );
171  }
172 
173  return acceptEvent;
174 }

◆ finalize()

StatusCode DerivationFramework::SkimmingToolHIGG5VBF::finalize ( )
overridevirtual

Definition at line 80 of file SkimmingToolHIGG5VBF.cxx.

81 {
82  ATH_MSG_VERBOSE("finalize() ...");
83  ATH_MSG_INFO("Processed " << m_ntot << " events, " << m_npass << " events passed filter ");
84  return StatusCode::SUCCESS;
85 }

◆ getCalibedJets()

TLorentzVector DerivationFramework::SkimmingToolHIGG5VBF::getCalibedJets ( const xAOD::Jet jet) const
private

Definition at line 193 of file SkimmingToolHIGG5VBF.cxx.

194 {
195  TLorentzVector rc;
196 
197  if(!jet) return rc;
198 
203  const float& pt =ptAcc(*jet);
204  const float& eta=etaAcc(*jet);
205  const float& phi=phiAcc(*jet);
206  const float& m =mAcc(*jet);
207 
208  rc.SetPtEtaPhiM(pt, eta, phi, m);
209 
210  return rc;
211 }

◆ initialize()

StatusCode DerivationFramework::SkimmingToolHIGG5VBF::initialize ( )
overridevirtual

Definition at line 66 of file SkimmingToolHIGG5VBF.cxx.

67 {
68  ATH_MSG_VERBOSE("initialize() ...");
69 
70  // trigger decision tool
71  if(m_trigDecisionTool.retrieve(DisableTool{!m_reqTrigger}).isFailure()) {
72  ATH_MSG_FATAL("Failed to retrieve tool: " << m_trigDecisionTool);
73  return StatusCode::FAILURE;
74  }
75  ATH_MSG_INFO("Retrieved tool: " << m_trigDecisionTool);
76 
77  return StatusCode::SUCCESS;
78 }

Member Data Documentation

◆ m_allJetEtaCut

double DerivationFramework::SkimmingToolHIGG5VBF::m_allJetEtaCut
private

Definition at line 65 of file SkimmingToolHIGG5VBF.h.

◆ m_allJetPtCut

double DerivationFramework::SkimmingToolHIGG5VBF::m_allJetPtCut
private

Definition at line 64 of file SkimmingToolHIGG5VBF.h.

◆ m_calibedJetMomKey

std::string DerivationFramework::SkimmingToolHIGG5VBF::m_calibedJetMomKey
private

Definition at line 59 of file SkimmingToolHIGG5VBF.h.

◆ m_centralJetEtaCut

double DerivationFramework::SkimmingToolHIGG5VBF::m_centralJetEtaCut
private

Definition at line 70 of file SkimmingToolHIGG5VBF.h.

◆ m_centralJetPtCut

double DerivationFramework::SkimmingToolHIGG5VBF::m_centralJetPtCut
private

Definition at line 69 of file SkimmingToolHIGG5VBF.h.

◆ m_centralPhEtaCut

double DerivationFramework::SkimmingToolHIGG5VBF::m_centralPhEtaCut
private

Definition at line 88 of file SkimmingToolHIGG5VBF.h.

◆ m_debug

bool DerivationFramework::SkimmingToolHIGG5VBF::m_debug
private

Definition at line 51 of file SkimmingToolHIGG5VBF.h.

◆ m_jetSGKey

std::string DerivationFramework::SkimmingToolHIGG5VBF::m_jetSGKey
private

Definition at line 58 of file SkimmingToolHIGG5VBF.h.

◆ m_nAllJets

unsigned int DerivationFramework::SkimmingToolHIGG5VBF::m_nAllJets
private

Definition at line 63 of file SkimmingToolHIGG5VBF.h.

◆ m_nCentralJets

unsigned int DerivationFramework::SkimmingToolHIGG5VBF::m_nCentralJets
private

Definition at line 68 of file SkimmingToolHIGG5VBF.h.

◆ m_npass

std::atomic<unsigned int> DerivationFramework::SkimmingToolHIGG5VBF::m_npass
mutableprivate

Definition at line 56 of file SkimmingToolHIGG5VBF.h.

◆ m_ntot

std::atomic<unsigned int> DerivationFramework::SkimmingToolHIGG5VBF::m_ntot
mutableprivate

Definition at line 55 of file SkimmingToolHIGG5VBF.h.

◆ m_phPtCut

double DerivationFramework::SkimmingToolHIGG5VBF::m_phPtCut
private

Definition at line 87 of file SkimmingToolHIGG5VBF.h.

◆ m_phSGKey

std::string DerivationFramework::SkimmingToolHIGG5VBF::m_phSGKey
private

Definition at line 85 of file SkimmingToolHIGG5VBF.h.

◆ m_reqNAllJets

bool DerivationFramework::SkimmingToolHIGG5VBF::m_reqNAllJets
private

Definition at line 62 of file SkimmingToolHIGG5VBF.h.

◆ m_reqNCentralJets

bool DerivationFramework::SkimmingToolHIGG5VBF::m_reqNCentralJets
private

Definition at line 67 of file SkimmingToolHIGG5VBF.h.

◆ m_reqPh

bool DerivationFramework::SkimmingToolHIGG5VBF::m_reqPh
private

Definition at line 86 of file SkimmingToolHIGG5VBF.h.

◆ m_reqTrigger

bool DerivationFramework::SkimmingToolHIGG5VBF::m_reqTrigger
private

Definition at line 73 of file SkimmingToolHIGG5VBF.h.

◆ m_reqVbfMjj

bool DerivationFramework::SkimmingToolHIGG5VBF::m_reqVbfMjj
private

Definition at line 77 of file SkimmingToolHIGG5VBF.h.

◆ m_trigDecisionTool

ToolHandle<Trig::TrigDecisionTool> DerivationFramework::SkimmingToolHIGG5VBF::m_trigDecisionTool
private

Definition at line 53 of file SkimmingToolHIGG5VBF.h.

◆ m_triggers

std::vector<std::string> DerivationFramework::SkimmingToolHIGG5VBF::m_triggers
private

Definition at line 74 of file SkimmingToolHIGG5VBF.h.

◆ m_vbfMjjCut

double DerivationFramework::SkimmingToolHIGG5VBF::m_vbfMjjCut
private

Definition at line 78 of file SkimmingToolHIGG5VBF.h.


The documentation for this class was generated from the following files:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
DerivationFramework::SkimmingToolHIGG5VBF::m_ntot
std::atomic< unsigned int > m_ntot
Definition: SkimmingToolHIGG5VBF.h:55
GeV
#define GeV
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx:17
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
DerivationFramework::SkimmingToolHIGG5VBF::m_reqNCentralJets
bool m_reqNCentralJets
Definition: SkimmingToolHIGG5VBF.h:67
DerivationFramework::SkimmingToolHIGG5VBF::m_triggers
std::vector< std::string > m_triggers
Definition: SkimmingToolHIGG5VBF.h:74
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
DerivationFramework::SkimmingToolHIGG5VBF::checkCentralJetQuality
bool checkCentralJetQuality(const TLorentzVector &jet) const
Definition: SkimmingToolHIGG5VBF.cxx:184
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
test_pyathena.pt
pt
Definition: test_pyathena.py:11
defineDB.jets
jets
Definition: JetTagCalibration/share/defineDB.py:24
DerivationFramework::SkimmingToolHIGG5VBF::m_reqPh
bool m_reqPh
Definition: SkimmingToolHIGG5VBF.h:86
SG::ConstAccessor< float >
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
DerivationFramework::SkimmingToolHIGG5VBF::m_calibedJetMomKey
std::string m_calibedJetMomKey
Definition: SkimmingToolHIGG5VBF.h:59
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
DerivationFramework::SkimmingToolHIGG5VBF::m_debug
bool m_debug
Definition: SkimmingToolHIGG5VBF.h:51
DerivationFramework::SkimmingToolHIGG5VBF::m_centralJetPtCut
double m_centralJetPtCut
Definition: SkimmingToolHIGG5VBF.h:69
DerivationFramework::SkimmingToolHIGG5VBF::m_nCentralJets
unsigned int m_nCentralJets
Definition: SkimmingToolHIGG5VBF.h:68
DerivationFramework::SkimmingToolHIGG5VBF::getCalibedJets
TLorentzVector getCalibedJets(const xAOD::Jet *jet) const
Definition: SkimmingToolHIGG5VBF.cxx:193
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
DerivationFramework::SkimmingToolHIGG5VBF::m_npass
std::atomic< unsigned int > m_npass
Definition: SkimmingToolHIGG5VBF.h:56
DerivationFramework::SkimmingToolHIGG5VBF::m_allJetEtaCut
double m_allJetEtaCut
Definition: SkimmingToolHIGG5VBF.h:65
lumiFormat.i
int i
Definition: lumiFormat.py:85
beamspotman.n
n
Definition: beamspotman.py:731
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
DerivationFramework::SkimmingToolHIGG5VBF::m_centralPhEtaCut
double m_centralPhEtaCut
Definition: SkimmingToolHIGG5VBF.h:88
DerivationFramework::SkimmingToolHIGG5VBF::m_reqVbfMjj
bool m_reqVbfMjj
Definition: SkimmingToolHIGG5VBF.h:77
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
DerivationFramework::SkimmingToolHIGG5VBF::m_centralJetEtaCut
double m_centralJetEtaCut
Definition: SkimmingToolHIGG5VBF.h:70
DerivationFramework::SkimmingToolHIGG5VBF::m_phPtCut
double m_phPtCut
Definition: SkimmingToolHIGG5VBF.h:87
DerivationFramework::SkimmingToolHIGG5VBF::m_phSGKey
std::string m_phSGKey
Definition: SkimmingToolHIGG5VBF.h:85
DerivationFramework::SkimmingToolHIGG5VBF::m_allJetPtCut
double m_allJetPtCut
Definition: SkimmingToolHIGG5VBF.h:64
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
DerivationFramework::SkimmingToolHIGG5VBF::m_vbfMjjCut
double m_vbfMjjCut
Definition: SkimmingToolHIGG5VBF.h:78
DerivationFramework::SkimmingToolHIGG5VBF::m_trigDecisionTool
ToolHandle< Trig::TrigDecisionTool > m_trigDecisionTool
Definition: SkimmingToolHIGG5VBF.h:53
DerivationFramework::SkimmingToolHIGG5VBF::m_nAllJets
unsigned int m_nAllJets
Definition: SkimmingToolHIGG5VBF.h:63
DerivationFramework::SkimmingToolHIGG5VBF::m_jetSGKey
std::string m_jetSGKey
Definition: SkimmingToolHIGG5VBF.h:58
DerivationFramework::SkimmingToolHIGG5VBF::checkAllJetQuality
bool checkAllJetQuality(const TLorentzVector &jet) const
Definition: SkimmingToolHIGG5VBF.cxx:176
DerivationFramework::SkimmingToolHIGG5VBF::m_reqNAllJets
bool m_reqNAllJets
Definition: SkimmingToolHIGG5VBF.h:62
python.trfValidateRootFile.rc
rc
Definition: trfValidateRootFile.py:375
DerivationFramework::SkimmingToolHIGG5VBF::m_reqTrigger
bool m_reqTrigger
Definition: SkimmingToolHIGG5VBF.h:73