rivet is hosted by Hepforge, IPPP Durham
MC_WWJETS.cc
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Analyses/MC_JetAnalysis.hh"
00003 #include "Rivet/Projections/WFinder.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 W^+[enu]W^-[munu] + jets events
00011   class MC_WWJETS : public MC_JetAnalysis {
00012   public:
00013 
00014     /// Default constructor
00015     MC_WWJETS()
00016       : MC_JetAnalysis("MC_WWJETS", 4, "Jets")
00017     {    }
00018 
00019 
00020     /// @name Analysis methods
00021     //@{
00022 
00023     /// Book histograms
00024     void init() {
00025       FinalState fs;
00026       WFinder wenufinder(fs, EtaIn(-3.5, 3.5) & (Cuts::pT >= 25.0*GeV), PID::ELECTRON, 60.0*GeV, 100.0*GeV, 25.0*GeV, 0.2);
00027       addProjection(wenufinder, "WenuFinder");
00028 
00029       VetoedFinalState wmnuinput;
00030       wmnuinput.addVetoOnThisFinalState(wenufinder);
00031       WFinder wmnufinder(wmnuinput, EtaIn(-3.5, 3.5) & (Cuts::pT >= 25.0*GeV), PID::MUON, 60.0*GeV, 100.0*GeV, 25.0*GeV, 0.2);
00032       addProjection(wmnufinder, "WmnuFinder");
00033 
00034       VetoedFinalState jetinput;
00035       jetinput
00036           .addVetoOnThisFinalState(wenufinder)
00037           .addVetoOnThisFinalState(wmnufinder);
00038       FastJets jetpro(jetinput, FastJets::ANTIKT, 0.4);
00039       addProjection(jetpro, "Jets");
00040 
00041       // correlations with jets
00042       _h_WW_jet1_deta = bookHisto1D("WW_jet1_deta", 70, -7.0, 7.0);
00043       _h_WW_jet1_dR = bookHisto1D("WW_jet1_dR", 25, 1.5, 7.0);
00044       _h_We_jet1_dR = bookHisto1D("We_jet1_dR", 25, 0.0, 7.0);
00045 
00046       // global stuff
00047       _h_HT = bookHisto1D("HT", logspace(100, 100.0, 0.5*sqrtS()));
00048       _h_jets_m_12 = bookHisto1D("jets_m_12", logspace(100, 1.0, 0.25*sqrtS()));
00049 
00050       MC_JetAnalysis::init();
00051     }
00052 
00053 
00054 
00055     /// Do the analysis
00056     void analyze(const Event& e) {
00057       const double weight = e.weight();
00058 
00059       const WFinder& wenufinder = applyProjection<WFinder>(e, "WenuFinder");
00060       if (wenufinder.bosons().size() !=1 ) vetoEvent;
00061 
00062       const WFinder& wmnufinder = applyProjection<WFinder>(e, "WmnuFinder");
00063       if (wmnufinder.bosons().size() !=1 ) vetoEvent;
00064 
00065       FourMomentum wenu = wenufinder.bosons()[0].momentum();
00066       FourMomentum wmnu = wmnufinder.bosons()[0].momentum();
00067       FourMomentum ww = wenu + wmnu;
00068       // find leptons
00069       FourMomentum ep = wenufinder.constituentLeptons()[0].momentum();
00070       FourMomentum enu = wenufinder.constituentNeutrinos()[0].momentum();
00071       FourMomentum mm = wmnufinder.constituentLeptons()[0].momentum();
00072       FourMomentum mnu = wmnufinder.constituentNeutrinos()[0].momentum();
00073 
00074       const Jets& jets = applyProjection<FastJets>(e, "Jets").jetsByPt(m_jetptcut);
00075       if (jets.size() > 0) {
00076         _h_WW_jet1_deta->fill(ww.eta()-jets[0].eta(), weight);
00077         _h_WW_jet1_dR->fill(deltaR(ww, jets[0].momentum()), weight);
00078         _h_We_jet1_dR->fill(deltaR(ep, jets[0].momentum()), weight);
00079       }
00080 
00081       double HT = ep.pT() + mm.pT() + FourMomentum(enu+mnu).pT();
00082       foreach (const Jet& jet, jets) HT += jet.pT();
00083       if (HT > 0.0) _h_HT->fill(HT/GeV, weight);
00084 
00085       if (jets.size() > 1) {
00086         const FourMomentum jet1 = jets[0].momentum();
00087         const FourMomentum jet2 = jets[1].momentum();
00088         _h_jets_m_12->fill((jet1+jet2).mass()/GeV, weight);
00089       }
00090 
00091       MC_JetAnalysis::analyze(e);
00092     }
00093 
00094 
00095     /// Finalize
00096     void finalize() {
00097       const double norm = crossSection()/sumOfWeights();
00098       scale(_h_WW_jet1_deta, norm);
00099       scale(_h_WW_jet1_dR, norm);
00100       scale(_h_We_jet1_dR, norm);
00101       scale(_h_jets_m_12, norm);
00102       scale(_h_HT, norm);
00103       MC_JetAnalysis::finalize();
00104     }
00105 
00106     //@}
00107 
00108 
00109   private:
00110 
00111     /// @name Histograms
00112     //@{
00113     Histo1DPtr _h_WW_jet1_deta;
00114     Histo1DPtr _h_WW_jet1_dR;
00115     Histo1DPtr _h_We_jet1_dR;
00116     Histo1DPtr _h_jets_m_12;
00117     Histo1DPtr _h_HT;
00118     //@}
00119 
00120   };
00121 
00122 
00123 
00124   // The hook for the plugin system
00125   DECLARE_RIVET_PLUGIN(MC_WWJETS);
00126 
00127 }