ATLAS Offline Software
Loading...
Searching...
No Matches
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/*
6Authors: Teng Jian Khoo <teng.jian.khoo@cern.ch>
7 Russell Smith <rsmith@cern.ch>
8
9These selections are available as a courtesy for users to easily validate they are correctly using the METMaker code.
10These are the cuts used in the METRebuilder, so you can easily compare and make sure you are doing the same thing with the METMaker
11These selections are NOT optimized, especially the muon term, and as such should be optimized within physics groups
12SW note no changes required for MT mode
13*/
15
16//namespace CutsMETMaker{
17
18StatusCode CutsMETMaker::accept(const xAOD::Muon* mu)
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
100StatusCode CutsMETMaker::accept(const xAOD::TauJet* tau)
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?
112 if(tau->isTau( xAOD::TauJetParameters::IsTauFlag(xAOD::TauJetParameters::MuonVeto) )) return StatusCode::FAILURE;
113
114 return StatusCode::SUCCESS;
115}
116//}
virtual double pt() const override final
The transverse momentum ( ) of the particle.
Definition Egamma_v1.cxx:66
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
Definition Egamma_v1.cxx:71
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...
uint16_t author(uint16_t bitmask=EgammaParameters::AuthorALL) const
Get author.
virtual double pt() const
The transverse momentum ( ) of the particle.
bool isTau(TauJetParameters::IsTauFlag flag) const
Get Flag for tau acceptance based on predefined arbitrary criteria.
virtual double eta() const
The pseudorapidity ( ) of the particle.
StatusCode accept(const xAOD::Muon *mu)
IsTauFlag
Enum for IsTau flags.
Definition TauDefs.h:116
TauJet_v3 TauJet
Definition of the current "tau version".
Muon_v1 Muon
Reference the current persistent version:
Photon_v1 Photon
Definition of the current "egamma version".
@ numberOfPrecisionLayers
layers with at least 3 hits [unit8_t].
@ numberOfSCTHits
number of hits in SCT [unit8_t].
@ numberOfPixelHits
these are the pixel hits, including the b-layer [unit8_t].
Electron_v1 Electron
Definition of the current "egamma version".