rivet is hosted by Hepforge, IPPP Durham
MC_ZZJETS.cc
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Analyses/MC_JetAnalysis.hh"
00003 #include "Rivet/Projections/ZFinder.hh"
00004 #include "Rivet/Projections/FastJets.hh"
00005 #include "Rivet/Projections/VetoedFinalState.hh"
00006 
00007 namespace Rivet {
00008 
00009 
00010   /// @brief MC validation analysis for Z[ee]Z[mumu] + jets events
00011   class MC_ZZJETS : public MC_JetAnalysis {
00012   public:
00013 
00014     /// Default constructor
00015     MC_ZZJETS()
00016       : MC_JetAnalysis("MC_ZZJETS", 4, "Jets")
00017     {    }
00018 
00019 
00020     /// @name Analysis methods
00021     //@{
00022 
00023     /// Book histograms
00024     void init() {
00025       Cut cut = Cuts::abseta < 3.5 && Cuts::pT > 25*GeV;
00026       ZFinder zeefinder(FinalState(), cut, PID::ELECTRON, 65*GeV, 115*GeV, 0.2, ZFinder::CLUSTERNODECAY, ZFinder::TRACK);
00027       addProjection(zeefinder, "ZeeFinder");
00028 
00029       VetoedFinalState zmminput;
00030       zmminput.addVetoOnThisFinalState(zeefinder);
00031       ZFinder zmmfinder(zmminput, cut, PID::MUON, 65*GeV, 115*GeV, 0.2, ZFinder::CLUSTERNODECAY, ZFinder::TRACK);
00032       addProjection(zmmfinder, "ZmmFinder");
00033 
00034       VetoedFinalState jetinput;
00035       jetinput
00036           .addVetoOnThisFinalState(zeefinder)
00037           .addVetoOnThisFinalState(zmmfinder);
00038       FastJets jetpro(jetinput, FastJets::ANTIKT, 0.4);
00039       addProjection(jetpro, "Jets");
00040 
00041       // Correlations with jets
00042       _h_ZZ_jet1_deta = bookHisto1D("ZZ_jet1_deta", 70, -7.0, 7.0);
00043       _h_ZZ_jet1_dR = bookHisto1D("ZZ_jet1_dR", 25, 1.5, 7.0);
00044       _h_Ze_jet1_dR = bookHisto1D("Ze_jet1_dR", 25, 0.0, 7.0);
00045 
00046       // Global stuff
00047       _h_HT = bookHisto1D("HT", logspace(100, 100.0, 0.5*(sqrtS()>0.?sqrtS():14000.)/GeV));
00048 
00049       MC_JetAnalysis::init();
00050     }
00051 
00052 
00053 
00054     /// Do the analysis
00055     void analyze(const Event& e) {
00056       const double weight = e.weight();
00057 
00058       const ZFinder& zeefinder = applyProjection<ZFinder>(e, "ZeeFinder");
00059       if (zeefinder.bosons().size() != 1) vetoEvent;
00060 
00061       const ZFinder& zmmfinder = applyProjection<ZFinder>(e, "ZmmFinder");
00062       if (zmmfinder.bosons().size() != 1) vetoEvent;
00063 
00064       // Z momenta
00065       const FourMomentum& zee = zeefinder.bosons()[0].momentum();
00066       const FourMomentum& zmm = zmmfinder.bosons()[0].momentum();
00067       const FourMomentum zz = zee + zmm;
00068       // Lepton momenta
00069       const FourMomentum& ep = zeefinder.constituents()[0].momentum();
00070       const FourMomentum& em = zeefinder.constituents()[1].momentum();
00071       const FourMomentum& mp = zmmfinder.constituents()[0].momentum();
00072       const FourMomentum& mm = zmmfinder.constituents()[1].momentum();
00073 
00074       const Jets& jets = applyProjection<FastJets>(e, "Jets").jetsByPt(_jetptcut);
00075       if (jets.size() > 0) {
00076         const FourMomentum j0 = jets[0].momentum();
00077         _h_ZZ_jet1_deta->fill(zz.eta()-j0.eta(), weight);
00078         _h_ZZ_jet1_dR->fill(deltaR(zz, j0), weight);
00079         _h_Ze_jet1_dR->fill(deltaR(ep, j0), weight);
00080       }
00081 
00082       double HT = ep.pT() + em.pT() + mp.pT() + mm.pT();
00083       foreach (const Jet& jet, jets) HT += jet.pT();
00084       if (HT > 0.0) _h_HT->fill(HT/GeV, weight);
00085 
00086       MC_JetAnalysis::analyze(e);
00087     }
00088 
00089 
00090     /// Finalize
00091     void finalize() {
00092       const double s = crossSection()/picobarn/sumOfWeights();
00093       scale(_h_ZZ_jet1_deta, s);
00094       scale(_h_ZZ_jet1_dR, s);
00095       scale(_h_Ze_jet1_dR, s);
00096       scale(_h_HT, s);
00097       MC_JetAnalysis::finalize();
00098     }
00099 
00100     //@}
00101 
00102 
00103   private:
00104 
00105     /// @name Histograms
00106     //@{
00107     Histo1DPtr _h_ZZ_jet1_deta;
00108     Histo1DPtr _h_ZZ_jet1_dR;
00109     Histo1DPtr _h_Ze_jet1_dR;
00110     Histo1DPtr _h_HT;
00111     //@}
00112 
00113   };
00114 
00115 
00116 
00117   // The hook for the plugin system
00118   DECLARE_RIVET_PLUGIN(MC_ZZJETS);
00119 
00120 }