Rivet is hosted by Hepforge, IPPP Durham

Rivet analyses reference

CMS_2013_I1224539_ZJET

CMS jet mass measurement in $Z$ + jet events
Experiment: CMS (LHC)
Inspire ID: 1224539
Status: VALIDATED
Authors:
  • salvatore.rappoccio@cern.ch
  • ntran@fnal.gov
  • kalanand@fnal.gov
  • dlopes@mail.cern.ch
References: Beams: p+ p+
Beam energies: (3500.0, 3500.0) GeV
Run details:
  • 7 TeV $pp$ collisions. Events are required to have a electron channel $Z$ with $p_\perp > 120$ GeV, and at least 1 jet opposed to the $Z$ with $p_\perp > 50$ GeV and $|y| < 2.4$.

Measurements of the mass spectra of the jets in dijet and $W/Z$+jet events from proton--proton collisions at a centre-of-mass energy of 7 TeV using a data sample of integrated luminosity of 5 fb$^-1$. The jets are reconstructed using the both the anti-$k_T$ algorithm with $R=0.7$ (AK7) and the Cambridge-Aachen algorithm with $R=0.8$ (CA8) and $R=1.2$ (CA12) with several grooming techniques applied (ungroomed, filtered, pruned and trimmed). See the text of the paper for more details. For the dijet events the distributions are presented as a function of the mean Mass of the two leading jets in bins of the mean p_\perp of the two jets.

Source code: CMS_2013_I1224539_ZJET.cc
  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
// -*- C++ -*-
#include "Rivet/Analysis.hh"
#include "Rivet/Projections/FinalState.hh"
#include "Rivet/Projections/FastJets.hh"
#include "Rivet/Projections/WFinder.hh"
#include "Rivet/Projections/ZFinder.hh"
#include "fastjet/tools/Filter.hh"
#include "fastjet/tools/Pruner.hh"

namespace Rivet {




  class CMS_2013_I1224539_ZJET : public Analysis {
  public:

    /// @name Constructors etc.
    //@{

    /// Constructor
    CMS_2013_I1224539_ZJET()
      : Analysis("CMS_2013_I1224539_ZJET"),
        _filter(fastjet::Filter(fastjet::JetDefinition(fastjet::cambridge_algorithm, 0.3), fastjet::SelectorNHardest(3))),
        _trimmer(fastjet::Filter(fastjet::JetDefinition(fastjet::kt_algorithm, 0.2), fastjet::SelectorPtFractionMin(0.03))),
        _pruner(fastjet::Pruner(fastjet::cambridge_algorithm, 0.1, 0.5))
    {    }

    //@}


  public:

    /// @name Analysis methods
    //@{

    /// Book histograms and initialise projections before the run
    void init() {
      FinalState fs(Cuts::abseta < 2.4);
      declare(fs, "FS");

      // Find Zs with pT > 120 GeV
      ZFinder zfinder(fs, Cuts::abseta < 2.4 && Cuts::pT > 30*GeV, PID::ELECTRON, 80*GeV, 100*GeV,
                      0.2, ZFinder::CLUSTERNODECAY, ZFinder::TRACK);
      declare(zfinder, "ZFinder");

      // Z+jet jet collections
      declare(FastJets(zfinder.remainingFinalState(), FastJets::ANTIKT, 0.7), "JetsAK7_zj");
      declare(FastJets(zfinder.remainingFinalState(), FastJets::CAM, 0.8), "JetsCA8_zj");
      declare(FastJets(zfinder.remainingFinalState(), FastJets::CAM, 1.2), "JetsCA12_zj");

      // Histograms
      /// @note These are 2D histos rendered into slices
      const int zjetsOffset = 28;
      for (size_t i = 0; i < N_PT_BINS_vj; ++i ) {
        _h_ungroomedJetMass_AK7_zj[i] = bookHisto1D(zjetsOffset+i+1+0*N_PT_BINS_vj, 1, 1);
        _h_filteredJetMass_AK7_zj[i] = bookHisto1D(zjetsOffset+i+1+1*N_PT_BINS_vj,1,1);
        _h_trimmedJetMass_AK7_zj[i] = bookHisto1D(zjetsOffset+i+1+2*N_PT_BINS_vj,1,1);
        _h_prunedJetMass_AK7_zj[i] = bookHisto1D(zjetsOffset+i+1+3*N_PT_BINS_vj,1,1);
        _h_prunedJetMass_CA8_zj[i] = bookHisto1D(zjetsOffset+i+1+4*N_PT_BINS_vj,1,1);
        if (i > 0) _h_filteredJetMass_CA12_zj[i] = bookHisto1D(zjetsOffset+i+5*N_PT_BINS_vj,1,1);
      }
    }


    bool isBackToBack_zj(const ZFinder& zf, const fastjet::PseudoJet& psjet) {
      const FourMomentum& z = zf.bosons()[0].momentum();
      const FourMomentum& l1 = zf.constituents()[0].momentum();
      const FourMomentum& l2 = zf.constituents()[1].momentum();
      /// @todo We should make FourMomentum know how to construct itself from a PseudoJet
      const FourMomentum jmom(psjet.e(), psjet.px(), psjet.py(), psjet.pz());
      return (deltaPhi(z, jmom) > 2.0 && deltaR(l1, jmom) > 1.0 && deltaR(l2, jmom) > 1.0);
    }


    // Find the pT histogram bin index for value pt (in GeV), to hack a 2D histogram equivalent
    /// @todo Use a YODA axis/finder alg when available
    size_t findPtBin(double ptJ) {
      const double ptBins_vj[N_PT_BINS_vj+1] = { 125.0, 150.0, 220.0, 300.0, 450.0 };
      for (size_t ibin = 0; ibin < N_PT_BINS_vj; ++ibin) {
        if (inRange(ptJ, ptBins_vj[ibin], ptBins_vj[ibin+1])) return ibin;
      }
      return N_PT_BINS_vj;
    }


    /// Perform the per-event analysis
    void analyze(const Event& event) {
      const double weight = event.weight();

      // Get the Z
      const ZFinder& zfinder = apply<ZFinder>(event, "ZFinder");
      if (zfinder.bosons().size() != 1) vetoEvent;
      const Particle& z = zfinder.bosons()[0];
      if (z.constituents().size() < 2) {
        MSG_WARNING("Found a Z with less than 2 constituents.");
        vetoEvent;
      }
      const Particle& l1 = z.constituents()[0];
      const Particle& l2 = z.constituents()[1];
      MSG_DEBUG(l1.pT() << " " << l2.pT());
      assert(&l1 != &l2);

      // Require a high-pT Z (and constituents)
      if (l1.pT() < 30*GeV ) vetoEvent;
      if (l2.pT() < 30*GeV ) vetoEvent;
      if (z.pT() < 120*GeV) vetoEvent;

      // AK7 jets
      const PseudoJets& psjetsAK7_zj = apply<FastJets>(event, "JetsAK7_zj").pseudoJetsByPt(50.0*GeV);
      if (!psjetsAK7_zj.empty()) {
        // Get the leading jet and make sure it's back-to-back with the Z
        const fastjet::PseudoJet& j0 = psjetsAK7_zj[0];
        if (isBackToBack_zj(zfinder, j0)) {
          const size_t njetBin = findPtBin(j0.pt()/GeV);
          if (njetBin < N_PT_BINS_vj) {
            fastjet::PseudoJet filtered0 = _filter(j0);
            fastjet::PseudoJet trimmed0 = _trimmer(j0);
            fastjet::PseudoJet pruned0 = _pruner(j0);
            _h_ungroomedJetMass_AK7_zj[njetBin]->fill(j0.m()/GeV, weight);
            _h_filteredJetMass_AK7_zj[njetBin]->fill(filtered0.m()/GeV, weight);
            _h_trimmedJetMass_AK7_zj[njetBin]->fill(trimmed0.m()/GeV, weight);
            _h_prunedJetMass_AK7_zj[njetBin]->fill(pruned0.m()/GeV, weight);
          }
        }
      }

      // CA8 jets
      const PseudoJets& psjetsCA8_zj = apply<FastJets>(event, "JetsCA8_zj").pseudoJetsByPt(50.0*GeV);
      if (!psjetsCA8_zj.empty()) {
        // Get the leading jet and make sure it's back-to-back with the Z
        const fastjet::PseudoJet& j0 = psjetsCA8_zj[0];
        if (isBackToBack_zj(zfinder, j0)) {
          const size_t njetBin = findPtBin(j0.pt()/GeV);
          if (njetBin < N_PT_BINS_vj) {
            fastjet::PseudoJet pruned0 = _pruner(j0);
            _h_prunedJetMass_CA8_zj[njetBin]->fill(pruned0.m()/GeV, weight);
          }
        }
      }

      // CA12 jets
      const PseudoJets& psjetsCA12_zj = apply<FastJets>(event, "JetsCA12_zj").pseudoJetsByPt(50.0*GeV);
      if (!psjetsCA12_zj.empty()) {
        // Get the leading jet and make sure it's back-to-back with the Z
        const fastjet::PseudoJet& j0 = psjetsCA12_zj[0];
        if (isBackToBack_zj(zfinder, j0)) {
          const size_t njetBin = findPtBin(j0.pt()/GeV);
          if (njetBin>0 && njetBin < N_PT_BINS_vj) {
            fastjet::PseudoJet filtered0 = _filter(j0);
            _h_filteredJetMass_CA12_zj[njetBin]->fill( filtered0.m() / GeV, weight);
          }
        }
      }

    }


    /// Normalise histograms etc., after the run
    void finalize() {
      const double normalizationVal = 1000;
      for (size_t i = 0; i < N_PT_BINS_vj; ++i ) {
        normalize( _h_ungroomedJetMass_AK7_zj[i], normalizationVal);
        normalize( _h_filteredJetMass_AK7_zj[i], normalizationVal);
        normalize( _h_trimmedJetMass_AK7_zj[i], normalizationVal);
        normalize( _h_prunedJetMass_AK7_zj[i], normalizationVal);
        normalize( _h_prunedJetMass_CA8_zj[i], normalizationVal);
        if (i > 0) normalize( _h_filteredJetMass_CA12_zj[i], normalizationVal);
      }
    }

    //@}


  private:

    /// @name FastJet grooming tools (configured in constructor init list)
    //@{
    const fastjet::Filter _filter;
    const fastjet::Filter _trimmer;
    const fastjet::Pruner _pruner;
    //@}


    /// @name Histograms
    //@{
    enum BINS_vj { PT_125_150_vj=0, PT_150_220_vj, PT_220_300_vj, PT_300_450_vj, N_PT_BINS_vj };
    Histo1DPtr _h_ungroomedJetMass_AK7_zj[N_PT_BINS_vj];
    Histo1DPtr _h_filteredJetMass_AK7_zj[N_PT_BINS_vj];
    Histo1DPtr _h_trimmedJetMass_AK7_zj[N_PT_BINS_vj];
    Histo1DPtr _h_prunedJetMass_AK7_zj[N_PT_BINS_vj];
    Histo1DPtr _h_prunedJetMass_CA8_zj[N_PT_BINS_vj];
    Histo1DPtr _h_filteredJetMass_CA12_zj[N_PT_BINS_vj];
    //@}

  };


  // The hook for the plugin system
  DECLARE_RIVET_PLUGIN(CMS_2013_I1224539_ZJET);

}