rivet is hosted by Hepforge, IPPP Durham
MC_ZJETS.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 
00006 namespace Rivet {
00007 
00008   using namespace Cuts;
00009 
00010 
00011   /// @brief MC validation analysis for Z + jets events
00012   class MC_ZJETS : public MC_JetAnalysis {
00013   public:
00014 
00015     /// Default constructor
00016     MC_ZJETS()
00017       : MC_JetAnalysis("MC_ZJETS", 4, "Jets")
00018     {    }
00019 
00020 
00021     /// @name Analysis methods
00022     //@{
00023 
00024     /// Initialize
00025     void init() {
00026       FinalState fs;
00027       Cut cut = etaIn(-3.5,3.5) & (pT >= 25.0*GeV);
00028       ZFinder zfinder(fs, cut, PID::ELECTRON, 65*GeV, 115*GeV, 0.2, ZFinder::CLUSTERNODECAY, ZFinder::TRACK);
00029       addProjection(zfinder, "ZFinder");
00030       FastJets jetpro(zfinder.remainingFinalState(), FastJets::ANTIKT, 0.4);
00031       addProjection(jetpro, "Jets");
00032 
00033       _h_Z_jet1_deta = bookHisto1D("Z_jet1_deta", 50, -5, 5);
00034       _h_Z_jet1_dR = bookHisto1D("Z_jet1_dR", 25, 0.5, 7.0);
00035 
00036       MC_JetAnalysis::init();
00037     }
00038 
00039 
00040 
00041     /// Do the analysis
00042     void analyze(const Event & e) {
00043       const ZFinder& zfinder = applyProjection<ZFinder>(e, "ZFinder");
00044       if (zfinder.bosons().size() != 1) vetoEvent;
00045       const FourMomentum& zmom = zfinder.bosons()[0].momentum();
00046 
00047       const Jets& jets = applyProjection<FastJets>(e, "Jets").jetsByPt(_jetptcut);
00048       if (jets.size() > 0) {
00049         const double weight = e.weight();
00050         _h_Z_jet1_deta->fill(zmom.eta()-jets[0].eta(), weight);
00051         _h_Z_jet1_dR->fill(deltaR(zmom, jets[0].momentum()), weight);
00052       }
00053 
00054       MC_JetAnalysis::analyze(e);
00055     }
00056 
00057 
00058     /// Finalize
00059     void finalize() {
00060       normalize(_h_Z_jet1_deta, crossSection()/picobarn);
00061       normalize(_h_Z_jet1_dR, crossSection()/picobarn);
00062       MC_JetAnalysis::finalize();
00063     }
00064 
00065     //@}
00066 
00067 
00068   private:
00069 
00070     /// @name Histograms
00071     //@{
00072     Histo1DPtr _h_Z_jet1_deta;
00073     Histo1DPtr _h_Z_jet1_dR;
00074     //@}
00075 
00076   };
00077 
00078 
00079 
00080   // The hook for the plugin system
00081   DECLARE_RIVET_PLUGIN(MC_ZJETS);
00082 
00083 }