rivet is hosted by Hepforge, IPPP Durham

Rivet analyses reference

ATLAS_2011_I945498

$Z$+jets in $pp$ at 7 TeV
Experiment: ATLAS (LHC)
Inspire ID: 945498
Status: VALIDATED
Authors:
  • Evelin Meoni
  • Holger Schulz
  • Roman Lysak
References: Beams: p+ p+
Beam energies: (3500.0, 3500.0) GeV
Run details:
  • Z+jets, electronic and/or muonic Z-decays. Jets with transverse momentum $p_T > 30$ GeV and jet rapidity $|y| < 4.4$.

Production of jets in association with a $Z/\gamma^*$ boson in proton--proton collisions at $\sqrt{s} = 7$ TeV with the ATLAS detector. The analysis includes the full 2010 data set, collected with a low rate of multiple proton--proton collisions in the accelerator, corresponding to an integrated luminosity of 36 pb$^{-1}$. Inclusive jet cross sections in $Z/\gamma^*$ events, with $Z/\gamma^*$ decaying into electron or muon pairs, are measured for jets with transverse momentum $p_T > 30$ GeV and jet rapidity $|y| < 4.4$.

Source code: ATLAS_2011_I945498.cc
  1// -*- C++ -*-
  2#include "Rivet/Analysis.hh"
  3
  4#include "Rivet/Projections/ZFinder.hh"
  5#include "Rivet/Projections/FastJets.hh"
  6#include "Rivet/Projections/FinalState.hh"
  7#include "Rivet/Projections/VetoedFinalState.hh"
  8#include "Rivet/Projections/IdentifiedFinalState.hh"
  9#include "Rivet/Projections/LeadingParticlesFinalState.hh"
 10
 11
 12namespace Rivet {
 13
 14
 15  /// ATLAS Z+jets in pp at 7 TeV
 16  class ATLAS_2011_I945498 : public Analysis {
 17  public:
 18
 19    /// Constructor
 20    ATLAS_2011_I945498()
 21      : Analysis("ATLAS_2011_I945498")
 22    {    }
 23
 24
 25    /// Book histograms and initialise projections before the run
 26    void init() {
 27
 28      // Variable initialisation
 29      _isZeeSample = false;
 30      _isZmmSample = false;
 31      for (size_t chn = 0; chn < 3; ++chn) {
 32        book(weights_nj0[chn], "weights_nj0_" + to_str(chn));
 33        book(weights_nj1[chn], "weights_nj1_" + to_str(chn));
 34        book(weights_nj2[chn], "weights_nj2_" + to_str(chn));
 35        book(weights_nj3[chn], "weights_nj3_" + to_str(chn));
 36        book(weights_nj4[chn], "weights_nj4_" + to_str(chn));
 37      }
 38
 39      // Set up projections
 40	  FinalState fs;
 41      ZFinder zfinder_mu(fs, Cuts::abseta < 2.4 && Cuts::pT > 20*GeV, PID::MUON, 66*GeV, 116*GeV, 0.1, ZFinder::ClusterPhotons::NODECAY);
 42      declare(zfinder_mu, "ZFinder_mu");
 43
 44      Cut cuts = (Cuts::abseta < 1.37 || Cuts::absetaIn(1.52, 2.47)) && Cuts::pT > 20*GeV;
 45
 46      ZFinder zfinder_el(fs, cuts, PID::ELECTRON, 66*GeV, 116*GeV, 0.1, ZFinder::ClusterPhotons::NODECAY);
 47      declare(zfinder_el, "ZFinder_el");
 48
 49	  Cut cuts25_20 = Cuts::abseta < 2.5 && Cuts::pT > 20*GeV;
 50      // For combined cross-sections (combined phase space + dressed level)
 51      ZFinder zfinder_comb_mu(fs, cuts25_20, PID::MUON, 66.0*GeV, 116.0*GeV, 0.1, ZFinder::ClusterPhotons::NODECAY);
 52      declare(zfinder_comb_mu, "ZFinder_comb_mu");
 53      ZFinder zfinder_comb_el(fs, cuts25_20, PID::ELECTRON, 66.0*GeV, 116.0*GeV, 0.1, ZFinder::ClusterPhotons::NODECAY);
 54      declare(zfinder_comb_el, "ZFinder_comb_el");
 55
 56      // Define veto FS in order to prevent Z-decay products entering the jet algorithm
 57      VetoedFinalState remfs;
 58      remfs.addVetoOnThisFinalState(zfinder_el);
 59      remfs.addVetoOnThisFinalState(zfinder_mu);
 60      VetoedFinalState remfs_comb;
 61      remfs_comb.addVetoOnThisFinalState(zfinder_comb_el);
 62      remfs_comb.addVetoOnThisFinalState(zfinder_comb_mu);
 63
 64      FastJets jets(remfs, FastJets::ANTIKT, 0.4);
 65      jets.useInvisibles();
 66      declare(jets, "jets");
 67      FastJets jets_comb(remfs_comb, FastJets::ANTIKT, 0.4);
 68      jets_comb.useInvisibles();
 69      declare(jets_comb, "jets_comb");
 70
 71      // 0=el, 1=mu, 2=comb
 72      for (size_t chn = 0; chn < 3; ++chn) {
 73        book(_h_njet_incl[chn]  ,1, 1, chn+1);
 74        book(_h_njet_ratio[chn] ,2, 1, chn+1);
 75        book(_h_ptjet[chn]      ,3, 1, chn+1);
 76        book(_h_ptlead[chn]     ,4, 1, chn+1);
 77        book(_h_ptseclead[chn]  ,5, 1, chn+1);
 78        book(_h_yjet[chn]       ,6, 1, chn+1);
 79        book(_h_ylead[chn]      ,7, 1, chn+1);
 80        book(_h_yseclead[chn]   ,8, 1, chn+1);
 81        book(_h_mass[chn]       ,9, 1, chn+1);
 82        book(_h_deltay[chn]     ,10, 1, chn+1);
 83        book(_h_deltaphi[chn]   ,11, 1, chn+1);
 84        book(_h_deltaR[chn]     ,12, 1, chn+1);
 85      }
 86    }
 87
 88
 89    // Jet selection criteria universal for electron and muon channel
 90    /// @todo Replace with a Cut passed to jetsByPt
 91    Jets selectJets(const ZFinder* zf, const FastJets* allJets) {
 92      const FourMomentum l1 = zf->constituents()[0].momentum();
 93      const FourMomentum l2 = zf->constituents()[1].momentum();
 94      Jets jets;
 95      for (const Jet& jet : allJets->jetsByPt(30*GeV)) {
 96        const FourMomentum jmom = jet.momentum();
 97        if (jmom.absrap() < 4.4 &&
 98            deltaR(l1, jmom) > 0.5  && deltaR(l2, jmom) > 0.5) {
 99          jets.push_back(jet);
100        }
101      }
102      return jets;
103    }
104
105
106    /// Perform the per-event analysis
107    void analyze(const Event& event) {
108      vector<const ZFinder*> zfs;
109      zfs.push_back(& (apply<ZFinder>(event, "ZFinder_el")));
110      zfs.push_back(& (apply<ZFinder>(event, "ZFinder_mu")));
111      zfs.push_back(& (apply<ZFinder>(event, "ZFinder_comb_el")));
112      zfs.push_back(& (apply<ZFinder>(event, "ZFinder_comb_mu")));
113
114      vector<const FastJets*> fjs;
115      fjs.push_back(& (apply<FastJets>(event, "jets")));
116      fjs.push_back(& (apply<FastJets>(event, "jets_comb")));
117
118      // Determine what kind of MC sample this is
119      const bool isZee = (zfs[0]->bosons().size() == 1) || (zfs[2]->bosons().size() == 1);
120      const bool isZmm = (zfs[1]->bosons().size() == 1) || (zfs[3]->bosons().size() == 1);
121      if (isZee) _isZeeSample = true;
122      if (isZmm) _isZmmSample = true;
123
124      // Require exactly one electronic or muonic Z-decay in the event
125      bool isZeemm = ( (zfs[0]->bosons().size() == 1 && zfs[1]->bosons().size() != 1) ||
126                       (zfs[1]->bosons().size() == 1 && zfs[0]->bosons().size() != 1) );
127      bool isZcomb = ( (zfs[2]->bosons().size() == 1 && zfs[3]->bosons().size() != 1) ||
128                       (zfs[3]->bosons().size() == 1 && zfs[2]->bosons().size() != 1) );
129      if (!isZeemm && !isZcomb) vetoEvent;
130
131      vector<int> zfIDs;
132      vector<int> fjIDs;
133      if (isZeemm) {
134        int chn = zfs[0]->bosons().size() == 1 ? 0 : 1;
135        zfIDs.push_back(chn);
136        fjIDs.push_back(0);
137      }
138      if (isZcomb) {
139        int chn = zfs[2]->bosons().size() == 1 ? 2 : 3;
140        zfIDs.push_back(chn);
141        fjIDs.push_back(1);
142      }
143
144      for (size_t izf = 0; izf < zfIDs.size(); ++izf) {
145        int zfID = zfIDs[izf];
146        int fjID = fjIDs[izf];
147
148        int chn = zfID;
149        if (zfID == 2 || zfID == 3) chn = 2;
150
151        Jets jets = selectJets(zfs[zfID], fjs[fjID]);
152
153        switch (jets.size()) {
154        case 0:
155          weights_nj0[chn]->fill();
156          break;
157        case 1:
158          weights_nj0[chn]->fill();
159          weights_nj1[chn]->fill();
160          break;
161        case 2:
162          weights_nj0[chn]->fill();
163          weights_nj1[chn]->fill();
164          weights_nj2[chn]->fill();
165          break;
166        case 3:
167          weights_nj0[chn]->fill();
168          weights_nj1[chn]->fill();
169          weights_nj2[chn]->fill();
170          weights_nj3[chn]->fill();
171          break;
172        default: // >= 4
173          weights_nj0[chn]->fill();
174          weights_nj1[chn]->fill();
175          weights_nj2[chn]->fill();
176          weights_nj3[chn]->fill();
177          weights_nj4[chn]->fill();
178        }
179
180        // Require at least one jet
181        if (jets.empty()) continue;
182
183        // Fill jet multiplicities
184        for (size_t ijet = 1; ijet <= jets.size(); ++ijet) {
185          _h_njet_incl[chn]->fill(ijet);
186        }
187
188        // Loop over selected jets, fill inclusive jet distributions
189        for (size_t ijet = 0; ijet < jets.size(); ++ijet) {
190          _h_ptjet[chn]->fill(jets[ijet].pT()/GeV);
191          _h_yjet [chn]->fill(fabs(jets[ijet].rapidity()));
192        }
193
194        // Leading jet histos
195        const double ptlead   = jets[0].pT()/GeV;
196        const double yabslead = fabs(jets[0].rapidity());
197        _h_ptlead[chn]->fill(ptlead);
198        _h_ylead [chn]->fill(yabslead);
199
200        if (jets.size() >= 2) {
201          // Second jet histos
202          const double pt2ndlead   = jets[1].pT()/GeV;
203          const double yabs2ndlead = fabs(jets[1].rapidity());
204          _h_ptseclead[chn] ->fill(pt2ndlead);
205          _h_yseclead [chn] ->fill(yabs2ndlead);
206
207          // Dijet histos
208          const double deltaphi = fabs(deltaPhi(jets[1], jets[0]));
209          const double deltarap = fabs(jets[0].rapidity() - jets[1].rapidity()) ;
210          const double deltar   = fabs(deltaR(jets[0], jets[1], RAPIDITY));
211          const double mass     = (jets[0].momentum() + jets[1].momentum()).mass();
212          _h_mass    [chn] ->fill(mass/GeV);
213          _h_deltay  [chn] ->fill(deltarap);
214          _h_deltaphi[chn] ->fill(deltaphi);
215          _h_deltaR  [chn] ->fill(deltar);
216        }
217      }
218    }
219
220
221    /// @name Ratio calculator util functions
222    //@{
223
224    /// Calculate the ratio, being careful about div-by-zero
225    double ratio(double a, double b) {
226      return (b != 0) ? a/b : 0;
227    }
228
229    /// Calculate the ratio error, being careful about div-by-zero
230    double ratio_err(double a, double b) {
231      return (b != 0) ? sqrt(a/sqr(b) + sqr(a)/(b*b*b)) : 0;
232    }
233
234    //@}
235
236
237    void finalize() {
238      // Fill ratio histograms
239      for (size_t chn = 0; chn < 3; ++chn) {
240        _h_njet_ratio[chn]->addPoint(1, ratio(weights_nj1[chn]->val(), weights_nj0[chn]->val()), 0.5, ratio_err(weights_nj1[chn]->val(), weights_nj0[chn]->val()));
241        _h_njet_ratio[chn]->addPoint(2, ratio(weights_nj2[chn]->val(), weights_nj1[chn]->val()), 0.5, ratio_err(weights_nj2[chn]->val(), weights_nj1[chn]->val()));
242        _h_njet_ratio[chn]->addPoint(3, ratio(weights_nj3[chn]->val(), weights_nj2[chn]->val()), 0.5, ratio_err(weights_nj3[chn]->val(), weights_nj2[chn]->val()));
243        _h_njet_ratio[chn]->addPoint(4, ratio(weights_nj4[chn]->val(), weights_nj3[chn]->val()), 0.5, ratio_err(weights_nj4[chn]->val(), weights_nj3[chn]->val()));
244      }
245
246      // Scale other histos
247      for (size_t chn = 0; chn < 3; ++chn) {
248        // For ee and mumu channels: normalize to Njet inclusive cross-section
249        double xs = crossSectionPerEvent()/picobarn;
250        if (chn != 2 && weights_nj0[chn]->val() != 0.)  xs = 1.0 / weights_nj0[chn]->val();
251        // For inclusive MC sample(ee/mmu channels together) we want the single-lepton-flavor xsec
252        if (_isZeeSample && _isZmmSample) xs *= 0.5;
253
254        // Special case histogram: always not normalized
255        scale(_h_njet_incl[chn], (chn < 2) ? crossSectionPerEvent()/picobarn : xs);
256
257        scale(_h_ptjet[chn]    , xs);
258        scale(_h_ptlead[chn]   , xs);
259        scale(_h_ptseclead[chn], xs);
260        scale(_h_yjet[chn]     , xs);
261        scale(_h_ylead[chn]    , xs);
262        scale(_h_yseclead[chn] , xs);
263        scale(_h_deltaphi[chn] , xs);
264        scale(_h_deltay[chn]   , xs);
265        scale(_h_deltaR[chn]   , xs);
266        scale(_h_mass[chn]     , xs);
267      }
268
269    }
270
271    //@}
272
273
274  private:
275
276    bool _isZeeSample;
277    bool _isZmmSample;
278
279    CounterPtr weights_nj0[3];
280    CounterPtr weights_nj1[3];
281    CounterPtr weights_nj2[3];
282    CounterPtr weights_nj3[3];
283    CounterPtr weights_nj4[3];
284
285    Scatter2DPtr _h_njet_ratio[3];
286    Histo1DPtr _h_njet_incl[3];
287    Histo1DPtr _h_ptjet[3];
288    Histo1DPtr _h_ptlead[3];
289    Histo1DPtr _h_ptseclead[3];
290    Histo1DPtr _h_yjet[3];
291    Histo1DPtr _h_ylead[3];
292    Histo1DPtr _h_yseclead[3];
293    Histo1DPtr _h_deltaphi[3];
294    Histo1DPtr _h_deltay[3];
295    Histo1DPtr _h_deltaR[3];
296    Histo1DPtr _h_mass[3];
297
298  };
299
300
301  RIVET_DECLARE_PLUGIN(ATLAS_2011_I945498);
302
303
304}