ATLAS Offline Software
CutsMETMaker.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 /*
6 Authors: Teng Jian Khoo <teng.jian.khoo@cern.ch>
7  Russell Smith <rsmith@cern.ch>
8 
9 These selections are available as a courtesy for users to easily validate they are correctly using the METMaker code.
10 These are the cuts used in the METRebuilder, so you can easily compare and make sure you are doing the same thing with the METMaker
11 These selections are NOT optimized, especially the muon term, and as such should be optimized within physics groups
12 SW note no changes required for MT mode
13 */
15 
16 //namespace CutsMETMaker{
17 
19 {
20 
21  if(mu->pt()<2.5e3 || mu->pt()/cosh(mu->eta())<4e3) return StatusCode::FAILURE;
22  if(mu->muonType()==xAOD::Muon::MuonStandAlone) {
23  // only take forward SA -- need a max eta cut?
24  if(fabs(mu->eta())<2.5) return StatusCode::FAILURE;
25  uint8_t nPrecision=0;
26  if(!mu->primaryTrackParticleLink().isValid()) return StatusCode::FAILURE;
27  mu->primaryTrackParticle()->summaryValue(nPrecision,xAOD::numberOfPrecisionLayers);
28  if(nPrecision<3) return StatusCode::FAILURE;
29  } // selection for StandAlone muons
30  else if(mu->muonType()==xAOD::Muon::Combined || mu->muonType()==xAOD::Muon::SegmentTagged) {
31  if(fabs(mu->eta())>2.5) return StatusCode::FAILURE;
32 
33  // could add some error checking to make sure we successfully read the details
34  uint8_t nPixHits(0), nSctHits(0);
35  if(!mu->primaryTrackParticleLink().isValid()) return StatusCode::FAILURE;
36  mu->primaryTrackParticle()->summaryValue(nPixHits,xAOD::numberOfPixelHits);
37  mu->primaryTrackParticle()->summaryValue(nSctHits,xAOD::numberOfSCTHits);
38 
39  if(nPixHits<3) return StatusCode::FAILURE;
40  if(nPixHits+nSctHits<5) return StatusCode::FAILURE;
41  } // selection for SegmentTagged and Combined muons
42  else {return StatusCode::FAILURE;} // don't CutMETMaker::accept forward muons or calo tagged
43 
44  return StatusCode::SUCCESS;
45 }
46 
48 {
49 
50  //ATH_MSG_VERBOSE("Test electron quality."
51  // << " pT = " << el->pt()
52  // << " eta = " << el->eta()
53  // << " phi = " << el->phi());
54 
55  bool testPID = 0;
56  el->passSelection(testPID,"Medium");
57  //ATH_MSG_VERBOSE("Electron PID \"Medium\" tests " << (testPID ? " GOOD" : "BAD") );
58  if( !testPID ) return StatusCode::FAILURE;
59 
60  //ATH_MSG_VERBOSE("Electron author = " << el->author() << " test " << (el->author()&17));
61  if( !(el->author()&17) ) return StatusCode::FAILURE;
62 
63  if( el->pt()<10e3 ) return StatusCode::FAILURE;
64  if( fabs(el->eta())>2.47 ) return StatusCode::FAILURE;
65 
66  // if( m_el_rejectCrack ) {
67  // if( fabs(el->eta())>1.37 &&
68  // fabs(el->eta())<1.52 ) return StatusCode::FAILURE;
69  // }
70 
71  //ATH_MSG_VERBOSE("CutMETMaker::Accepted this electron");
72 
73  return StatusCode::SUCCESS;
74 }
75 
77 {
78 
79  //ATH_MSG_VERBOSE("Test photon quality."
80  // << " pT = " << ph->pt()
81  // << " eta = " << ph->eta()
82  // << " phi = " << ph->phi());
83 
84  bool testPID = 0;
85  ph->passSelection(testPID,"Tight");
86  //ATH_MSG_VERBOSE("Photon PID \"Tight\" tests " << (testPID ? " GOOD" : "BAD") );
87  if( !testPID ) return StatusCode::FAILURE;
88 
89  //ATH_MSG_VERBOSE("Photon author = " << ph->author() << " test " << (ph->author()&20));
90  if( !(ph->author()&20) ) return StatusCode::FAILURE;
91 
92  if( ph->pt()<10e3 ) return StatusCode::FAILURE;
93  if( fabs(ph->eta())>2.47 ) return StatusCode::FAILURE;
94 
95  //ATH_MSG_VERBOSE("CutMETMaker::Accepted this photon");
96 
97  return StatusCode::SUCCESS;
98 }
99 
101 {
102  //ATH_MSG_VERBOSE("Testing tau with pt " << tau->pt() << ", eta " << tau->eta());
103  //ATH_MSG_VERBOSE("Tau ID discriminants:"
104  // << " jet " << tau->discriminant(xAOD::TauJetParameters::BDTJetScore)
105  // << " el " << tau->discriminant(xAOD::TauJetParameters::BDTEleScore)
106  // << " mu " << tau->flag(xAOD::TauJetParameters::MuonFlag));
107 
108  if(tau->pt()<20e3 || fabs(tau->eta())>2.5) return StatusCode::FAILURE;
109  // need to accommodate more than one of these?
111  if(tau->isTau( xAOD::TauJetParameters::IsTauFlag(xAOD::TauJetParameters::EleRNNMedium) )) return StatusCode::FAILURE;
112  if(tau->isTau( xAOD::TauJetParameters::IsTauFlag(xAOD::TauJetParameters::MuonVeto) )) return StatusCode::FAILURE;
113 
114  return StatusCode::SUCCESS;
115 }
116 //}
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:557
xAOD::TauJet_v3::eta
virtual double eta() const
The pseudorapidity ( ) of the particle.
CutsMETMaker::accept
StatusCode accept(const xAOD::Muon *mu)
Definition: CutsMETMaker.cxx:18
xAOD::Egamma_v1::author
uint16_t author(uint16_t bitmask=EgammaParameters::AuthorALL) const
Get author.
Definition: Egamma_v1.cxx:166
xAOD::numberOfPixelHits
@ numberOfPixelHits
these are the pixel hits, including the b-layer [unit8_t].
Definition: TrackingPrimitives.h:259
xAOD::Muon_v1
Class describing a Muon.
Definition: Muon_v1.h:38
xAOD::TauJet_v3::pt
virtual double pt() const
The transverse momentum ( ) of the particle.
CheckAppliedSFs.e3
e3
Definition: CheckAppliedSFs.py:264
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
xAOD::TauJet_v3
Class describing a tau jet.
Definition: TauJet_v3.h:41
plotIsoValidation.el
el
Definition: plotIsoValidation.py:197
xAOD::TauJetParameters::EleRNNMedium
@ EleRNNMedium
Definition: TauDefs.h:133
Trk::Combined
@ Combined
Definition: TrackSummaryTool.h:32
CutsMETMaker.h
xAOD::Electron_v1
Definition: Electron_v1.h:34
xAOD::TauJetParameters::JetRNNSigMedium
@ JetRNNSigMedium
Definition: TauDefs.h:147
xAOD::TauJet_v3::isTau
bool isTau(TauJetParameters::IsTauFlag flag) const
Get Flag for tau acceptance based on predefined arbitrary criteria.
Definition: TauJet_v3.cxx:273
xAOD::TauJetParameters::MuonVeto
@ MuonVeto
Definition: TauDefs.h:121
xAOD::Photon_v1
Definition: Photon_v1.h:37
xAOD::TauJetParameters::IsTauFlag
IsTauFlag
Enum for IsTau flags.
Definition: TauDefs.h:116
xAOD::Egamma_v1::pt
virtual double pt() const override final
The transverse momentum ( ) of the particle.
Definition: Egamma_v1.cxx:65
xAOD::numberOfSCTHits
@ numberOfSCTHits
number of hits in SCT [unit8_t].
Definition: TrackingPrimitives.h:268
xAOD::Egamma_v1::eta
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
Definition: Egamma_v1.cxx:70
CaloNoise_fillDB.mu
mu
Definition: CaloNoise_fillDB.py:53
xAOD::Egamma_v1::passSelection
bool passSelection(bool &value, const std::string &menu) const
Check if the egamma object pass a selection menu (using the name) If the menu decision is stored in t...
xAOD::numberOfPrecisionLayers
@ numberOfPrecisionLayers
layers with at least 3 hits [unit8_t].
Definition: TrackingPrimitives.h:288