1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
| // -*- C++ -*-
#include "Rivet/Analysis.hh"
#include "Rivet/Projections/FinalState.hh"
#include "Rivet/Projections/FastJets.hh"
#include "Rivet/Projections/VetoedFinalState.hh"
#include "Rivet/Projections/IdentifiedFinalState.hh"
#include "Rivet/Projections/DressedLeptons.hh"
#include "Rivet/Projections/PromptFinalState.hh"
#include "Rivet/Projections/VisibleFinalState.hh"
namespace Rivet {
/// @brief Z/gamma cross section measurement at 8 TeV
class ATLAS_2016_I1448301 : public Analysis {
public:
/// Constructor
RIVET_DEFAULT_ANALYSIS_CTOR(ATLAS_2016_I1448301);
/// @name Analysis methods
//@{
/// Book histograms and initialise projections before the run
void init() {
// Get options from the new option system
// Default tries to fill everything
// NU fills only the MET plots
// EL fills only the Electron plots and combined plots assuming lepton univerality
// MU fills only the Muon plots and combined plots assuming lepton univerality
// LL fills electron and Muon plots and combined plots from correct average
_mode = 0;
if ( getOption("LMODE") == "NU" ) _mode = 1;
if ( getOption("LMODE") == "EL" ) _mode = 2;
if ( getOption("LMODE") == "MU" ) _mode = 3;
if ( getOption("LMODE") == "LL" ) _mode = 4;
// Prompt photons
const Cut photoncut = Cuts::abspid == PID::PHOTON && Cuts::pT > 15*GeV && Cuts::abseta < 2.37;
PromptFinalState photon_fs(photoncut);
declare(photon_fs, "Photons");
// Prompt leptons
const PromptFinalState bareelectron_fs = Cuts::abspid == PID::ELECTRON;
const PromptFinalState baremuon_fs = Cuts::abspid == PID::MUON;
// Dressed leptons
const IdentifiedFinalState allphoton_fs(PID::PHOTON); // photons used for lepton dressing
const Cut leptoncut = Cuts::pT > 25*GeV && Cuts::abseta < 2.47;
const DressedLeptons dressedelectron_fs(allphoton_fs, bareelectron_fs, 0.1, leptoncut, true); // use *all* photons for lepton dressing
const DressedLeptons dressedmuon_fs(allphoton_fs, baremuon_fs, 0.1, leptoncut, true); // use *all* photons for lepton dressing
declare(dressedelectron_fs, "Electrons");
declare(dressedmuon_fs, "Muons");
// MET (prompt neutrinos)
VetoedFinalState ivfs;
ivfs.addVetoOnThisFinalState(VisibleFinalState());
declare(PromptFinalState(ivfs), "MET");
// Jets
VetoedFinalState jet_fs;
jet_fs.vetoNeutrinos();
jet_fs.addVetoPairId(PID::MUON);
const FastJets fastjets(jet_fs, FastJets::ANTIKT, 0.4);
declare(fastjets, "Jets");
// Histograms
// MET
if (_mode == 0 || _mode == 1){
book(_h["vvg"], 2, 1, 1);
book(_h["vvgg"], 4, 1, 1);
book(_h["pT"], 7, 1, 1);
book(_h["pT_0jet"], 8, 1, 1);
}
// always book e and mu in charged lepton modes; there are sometimes 4 leptons.
if (_mode != 1){
// electron
book(_h["eeg"], 1, 1, 1);
book(_h["eegg"], 3, 1, 1);
// muon
book(_h["mmg"], 1, 1, 2);
book(_h["mmgg"], 3, 1, 2);
// combined
book(_h["llgg"], 3, 1, 3);
book(_h["llg"], 1, 1, 3);
book(_h["pT"], 5, 1, 1);
book(_h["pT_0jet"], 6, 1, 1);
book(_h["M"], 9, 1, 1);
book(_h["M_0jet"], 10, 1, 1);
book(_h["Njets"], 11, 1, 1);
}
}
/// Perform the per-event analysis
void analyze(const Event& event) {
// Get objects
vector<DressedLepton> electrons = apply<DressedLeptons>(event, "Electrons").dressedLeptons();
vector<DressedLepton> muons = apply<DressedLeptons>(event, "Muons").dressedLeptons();
const Particles& photons = apply<PromptFinalState>(event, "Photons").particlesByPt();
const Jets jets = apply<FastJets>(event, "Jets").jetsByPt();
const FinalState& metfs = apply<PromptFinalState>(event, "MET");
Vector3 met_vec;
for (const Particle& p : metfs.particles()) met_vec += p.mom().perpVec();
if (met_vec.mod() >= 100*GeV && !photons.empty() && _mode < 2){
if (photons.size() > 1) { // nu nu y y
bool yy_veto = false;
yy_veto |= photons[0].pT() < 22*GeV;
yy_veto |= photons[1].pT() < 22*GeV;
yy_veto |= met_vec.mod() < 110*GeV;
const double yyPhi = (photons[0].momentum() + photons[1].momentum()).phi();
yy_veto |= fabs(yyPhi - met_vec.phi()) < 2.62 || fabs(yyPhi - met_vec.phi()) > 3.66;
yy_veto |= deltaR(photons[0], photons[1]) < 0.4;
// Photon isolation calculated by jets, count jets
Jet ph0_jet, ph1_jet;
double min_dR_ph0_jet = 999., min_dR_ph1_jet = 999.;
size_t njets = 0;
for (const Jet& j : jets) {
if (j.pT() > 30*GeV && j.abseta() < 4.5) {
if (deltaR(j, photons[0]) > 0.3 && deltaR(j, photons[1]) > 0.3) ++njets;
}
if (deltaR(j, photons[0]) < min_dR_ph0_jet) {
min_dR_ph0_jet = deltaR(j, photons[0]);
ph0_jet = j;
}
if (deltaR(j, photons[1]) < min_dR_ph1_jet) {
min_dR_ph1_jet = deltaR(j, photons[1]);
ph1_jet = j;
}
}
double photon0iso = 0., photon1iso = 0.;
if (min_dR_ph0_jet < 0.4) photon0iso = ph0_jet.pT() - photons[0].pT();
if (min_dR_ph1_jet < 0.4) photon1iso = ph1_jet.pT() - photons[1].pT();
yy_veto |= photon0iso/photons[0].pT() > 0.5;
yy_veto |= photon1iso/photons[1].pT() > 0.5;
if (!yy_veto) {
_h["vvgg"]->fill(0.5);
if (!njets) _h["vvgg"]->fill(1.5);
}
} // end of nu nu y y section
if ((photons[0].pT() >= 130*GeV) &&
(fabs(fabs(deltaPhi(photons[0], met_vec)) - 3.14) <= 1.57)) {
// Photon isolation calculated by jets, count jets
Jet ph_jet;
double min_dR_ph_jet = 999.;
size_t njets = 0;
for (const Jet& j : jets) {
if (j.pT() > 30*GeV && j.abseta() < 4.5) {
if (deltaR(j, photons[0]) > 0.3) ++njets;
}
if (deltaR(j, photons[0]) < min_dR_ph_jet) {
min_dR_ph_jet = deltaR(j, photons[0]);
ph_jet = j;
}
}
double photoniso = 0;
if (min_dR_ph_jet < 0.4) photoniso = ph_jet.pT() - photons[0].pT();
if (photoniso/photons[0].pT() > 0.5) vetoEvent;
const double pTgamma = photons[0].pT()/GeV;
_h["pT"]->fill(pTgamma);
_h["vvg"]->fill(0.5);
if (!njets) {
_h["vvg"]->fill(1.5);
_h["pT_0jet"]->fill(pTgamma);
}
}
} // end of nu nu y (y) section
// Dilepton candidate
bool el = false;
if ( (_mode != 1) &&
(( electrons.size() >= 2 && _mode != 3 ) ||
( muons.size() >= 2 && _mode != 2 ) )) {
vector<DressedLepton> lep_p, lep_m;
// Sort the dressed leptons by pt
if (electrons.size() >= 2) {
el = true;
sortByPt(electrons);
for (const DressedLepton& lep : electrons) {
if (lep.charge() > 0.) lep_p.push_back(lep);
if (lep.charge() < 0.) lep_m.push_back(lep);
}
} else {
sortByPt(muons);
for (const DressedLepton& lep : muons) {
if (lep.charge() > 0.) lep_p.push_back(lep);
if (lep.charge() < 0.) lep_m.push_back(lep);
}
}
if (!lep_p.empty() && !lep_m.empty() &&
(lep_p[0].abspid() == lep_m[0].abspid()) &&
((lep_p[0].momentum() + lep_m[0].momentum()).mass() >= 40*GeV)){
// Photon lepton overlap removal
if (photons.empty()) vetoEvent;
if (photons.size() > 1) {
bool veto = false;
veto |= deltaR(photons[0], lep_p[0]) < 0.4;
veto |= deltaR(photons[0], lep_m[0]) < 0.4;
veto |= deltaR(photons[1], lep_p[0]) < 0.4;
veto |= deltaR(photons[1], lep_m[0]) < 0.4;
veto |= deltaR(photons[0], photons[1]) < 0.4;
Jet ph0_jet, ph1_jet;
double min_dR_ph0_jet = 999., min_dR_ph1_jet=999.;
int njets = 0;
for (const Jet& j : jets){
if (j.pT() > 30*GeV && j.abseta() < 4.5) {
if (deltaR(j, lep_p[0]) > 0.3 && deltaR(j, lep_m[0]) > 0.3) {
if (deltaR(j, photons[0]) > 0.3 && deltaR(j, photons[1]) > 0.3 ) ++njets;
}
}
if (deltaR(j, photons[0]) < min_dR_ph0_jet) {
min_dR_ph0_jet = deltaR(j, photons[0]);
ph0_jet = j;
}
if (deltaR(j, photons[1]) < min_dR_ph1_jet) {
min_dR_ph1_jet = deltaR(j, photons[1]);
ph1_jet = j;
}
}
double photon0iso = 0, photon1iso = 0;
if (min_dR_ph0_jet < 0.4) photon0iso = ph0_jet.pT() - photons[0].pT();
if (min_dR_ph1_jet < 0.4) photon1iso = ph1_jet.pT() - photons[1].pT();
veto |= photon0iso/photons[0].pT() > 0.5;
veto |= photon1iso/photons[1].pT() > 0.5;
// Fill plots
// ee and mm need doing.
if (!veto) {
_h["llgg"]->fill(0.5);
if (el) {
_h["eegg"]->fill(0.5);
} else {
_h["mmgg"]->fill(0.5);
}
if (!njets) {
_h["llgg"]->fill(1.5);
if (el) {
_h["eegg"]->fill(1.5);
} else {
_h["mmgg"]->fill(1.5);
}
}
}
}
if (deltaR(photons[0], lep_p[0]) < 0.7) vetoEvent;
if (deltaR(photons[0], lep_m[0]) < 0.7) vetoEvent;
// Photon isolation calculated by jets, count jets
Jet ph_jet;
double min_dR_ph_jet = 999.;
size_t njets = 0;
for (const Jet& j : jets) {
if (j.pT() > 30*GeV && j.abseta() < 4.5) {
if (deltaR(j, lep_p[0]) > 0.3 && deltaR(j, lep_m[0]) > 0.3 && deltaR(j, photons[0]) > 0.3) ++njets;
}
if (deltaR(j, photons[0]) < min_dR_ph_jet) {
min_dR_ph_jet = deltaR(j, photons[0]);
ph_jet = j;
}
}
double photoniso = 0;
if (min_dR_ph_jet < 0.4) photoniso = ph_jet.pT() - photons[0].pT();
if (photoniso/photons[0].pT() > 0.5) vetoEvent;
// Fill plots
const double pTgamma = photons[0].pT()/GeV;
const double mllgamma = (lep_p[0].momentum() + lep_m[0].momentum() + photons[0].momentum()).mass()/GeV;
_h["pT"]->fill(pTgamma);
_h["M"]->fill(mllgamma);
_h["Njets"]->fill(njets < 3? njets : 3);
_h["llg"]->fill(0.5);
if (el) {
_h["eeg"]->fill(0.5);
} else {
_h["eeg"]->fill(0.5);
}
if (!njets) {
_h["pT_0jet"]->fill(pTgamma);
_h["M_0jet"]->fill(mllgamma);
_h["llg"]->fill(1.5);
if (el) {
_h["eeg"]->fill(1.5);
} else {
_h["mmg"]->fill(1.5);
}
}
}
}
} // end of analysis
/// Normalise histograms etc., after the run
void finalize() {
const double sf = crossSection()/femtobarn/sumOfWeights();
for (const auto& kv : _h) scale(kv.second, sf);
// if we are running both e and mu, the combined lepton histos
// need to be divided by two to get the average
if (_mode == 0 || _mode == 4){
scale(_h["llgg"], 0.5);
scale(_h["llg"], 0.5);
scale(_h["pT"], 0.5);
scale(_h["pT_0jet"], 0.5);
scale(_h["M"], 0.5);
scale(_h["M_0jet"], 0.5);
scale(_h["Njets"], 0.5);
}
}
//@}
protected:
// Data members like post-cuts event weight counters go here
size_t _mode;
private:
/// Histograms
map<string, Histo1DPtr> _h;
};
// The hook for the plugin system
RIVET_DECLARE_PLUGIN(ATLAS_2016_I1448301);
}
|