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 #include "Rivet/Tools/Logging.hh"
00007 #include "Rivet/Tools/ParticleIdUtils.hh"
00008 #include "Rivet/RivetAIDA.hh"
00009 
00010 namespace Rivet {
00011 
00012 
00013   /// @brief MC validation analysis for W^+[enu]W^-[munu] + jets events
00014   class MC_WWJETS : public MC_JetAnalysis {
00015   public:
00016 
00017     /// Default constructor
00018     MC_WWJETS()
00019       : MC_JetAnalysis("MC_WWJETS", 4, "Jets")
00020     {    }
00021 
00022 
00023     /// @name Analysis methods
00024     //@{
00025 
00026     /// Book histograms
00027     void init() {
00028       WFinder wenufinder(-3.5, 3.5, 25.0*GeV, ELECTRON, 60.0*GeV, 100.0*GeV, 25.0*GeV, 0.2);
00029       addProjection(wenufinder, "WenuFinder");
00030       WFinder wmnufinder(-3.5, 3.5, 25.0*GeV, MUON, 60.0*GeV, 100.0*GeV, 25.0*GeV, 0.2);
00031       addProjection(wmnufinder, "WmnuFinder");
00032       VetoedFinalState jetinput;
00033       jetinput
00034           .addVetoOnThisFinalState(wenufinder)
00035           .addVetoOnThisFinalState(wmnufinder);
00036       FastJets jetpro(jetinput, FastJets::KT, 0.7);
00037       addProjection(jetpro, "Jets");
00038 
00039       // properties of the pair momentum
00040       _h_WW_pT = bookHistogram1D("WW_pT", logBinEdges(100, 1.0, 0.5*sqrtS()));
00041       _h_WW_pT_peak = bookHistogram1D("WW_pT_peak", 25, 0.0, 25.0);
00042       _h_WW_eta = bookHistogram1D("WW_eta", 40, -7.0, 7.0);
00043       _h_WW_phi = bookHistogram1D("WW_phi", 25, 0.0, TWOPI);
00044       _h_WW_m = bookHistogram1D("WW_m", logBinEdges(100, 150.0, 180.0+0.25*sqrtS()));
00045 
00046       // correlations between the WW
00047       _h_WW_dphi = bookHistogram1D("WW_dphi", 25, 0.0, PI);  /// @todo non-linear?
00048       _h_WW_deta = bookHistogram1D("WW_deta", 25, -7.0, 7.0);
00049       _h_WW_dR = bookHistogram1D("WW_dR", 25, 0.5, 7.0);
00050       _h_WW_dpT = bookHistogram1D("WW_dpT", logBinEdges(100, 1.0, 0.5*sqrtS()));
00051       _h_WW_costheta_planes = bookHistogram1D("WW_costheta_planes", 25, -1.0, 1.0);
00052 
00053       /// @todo fuer WW: missing ET
00054 
00055       // properties of the W bosons
00056       _h_W_pT = bookHistogram1D("W_pT", logBinEdges(100, 10.0, 0.25*sqrtS()));
00057       _h_W_eta = bookHistogram1D("W_eta", 70, -7.0, 7.0);
00058 
00059       // properties of the leptons
00060       _h_Wl_pT = bookHistogram1D("Wl_pT", logBinEdges(100, 30.0, 0.1
00061                                                       *sqrtS()));
00062       _h_Wl_eta = bookHistogram1D("Wl_eta", 40, -3.5, 3.5);
00063 
00064       // correlations between the opposite charge leptons
00065       _h_WeWm_dphi = bookHistogram1D("WeWm_dphi", 25, 0.0, PI);
00066       _h_WeWm_deta = bookHistogram1D("WeWm_deta", 25, -5.0, 5.0);
00067       _h_WeWm_dR = bookHistogram1D("WeWm_dR", 25, 0.5, 5.0);
00068       _h_WeWm_m = bookHistogram1D("WeWm_m", 100, 0.0, 300.0);
00069 
00070       // correlations with jets
00071       _h_WW_jet1_deta = bookHistogram1D("WW_jet1_deta", 70, -7.0, 7.0);
00072       _h_WW_jet1_dR = bookHistogram1D("WW_jet1_dR", 25, 1.5, 7.0);
00073       _h_We_jet1_dR = bookHistogram1D("We_jet1_dR", 25, 0.0, 7.0);
00074 
00075       // global stuff
00076       _h_HT = bookHistogram1D("HT", logBinEdges(100, 100.0, 0.5*sqrtS()));
00077       _h_jets_m_12 = bookHistogram1D("jets_m_12", logBinEdges(100, 1.0, 0.25*sqrtS()));
00078 
00079       MC_JetAnalysis::init();
00080     }
00081 
00082 
00083 
00084     /// Do the analysis
00085     void analyze(const Event & e) {
00086       const double weight = e.weight();
00087 
00088       const WFinder& wenufinder = applyProjection<WFinder>(e, "WenuFinder");
00089       if (wenufinder.bosons().size()!=1) {
00090         vetoEvent;
00091       }
00092 
00093       const WFinder& wmnufinder = applyProjection<WFinder>(e, "WmnuFinder");
00094       if (wmnufinder.bosons().size()!=1) {
00095         vetoEvent;
00096       }
00097 
00098       FourMomentum wenu(wenufinder.bosons()[0].momentum());
00099       FourMomentum wmnu(wmnufinder.bosons()[0].momentum());
00100       FourMomentum ww(wenu+wmnu);
00101       // find leptons
00102       FourMomentum ep=wenufinder.constituentLeptons()[0].momentum();
00103       FourMomentum enu=wenufinder.constituentNeutrinos()[0].momentum();
00104       FourMomentum mm=wmnufinder.constituentLeptons()[0].momentum();
00105       FourMomentum mnu=wmnufinder.constituentNeutrinos()[0].momentum();
00106 
00107       _h_WW_pT->fill(ww.pT(),weight);
00108       _h_WW_pT_peak->fill(ww.pT(),weight);
00109       _h_WW_eta->fill(ww.eta(),weight);
00110       _h_WW_phi->fill(ww.azimuthalAngle(),weight);
00111       double mww2=ww.mass2();
00112       if (mww2>0.0) _h_WW_m->fill(sqrt(mww2), weight);
00113 
00114       _h_WW_dphi->fill(mapAngle0ToPi(wenu.phi()-wmnu.phi()), weight);
00115       _h_WW_deta->fill(wenu.eta()-wmnu.eta(), weight);
00116       _h_WW_dR->fill(deltaR(wenu,wmnu), weight);
00117       _h_WW_dpT->fill(fabs(wenu.pT()-wmnu.pT()), weight);
00118 
00119       Vector3 crossWenu = ep.vector3().cross(enu.vector3());
00120       Vector3 crossWmnu = mm.vector3().cross(mnu.vector3());
00121       double costheta = crossWenu.dot(crossWmnu)/crossWenu.mod()/crossWmnu.mod();
00122       _h_WW_costheta_planes->fill(costheta, weight);
00123 
00124       _h_W_pT->fill(wenu.pT(),weight);
00125       _h_W_pT->fill(wmnu.pT(),weight);
00126       _h_W_eta->fill(wenu.eta(),weight);
00127       _h_W_eta->fill(wmnu.eta(),weight);
00128 
00129       _h_Wl_pT->fill(ep.pT(), weight);
00130       _h_Wl_pT->fill(mm.pT(), weight);
00131       _h_Wl_eta->fill(ep.eta(), weight);
00132       _h_Wl_eta->fill(mm.eta(), weight);
00133 
00134       _h_WeWm_dphi->fill(mapAngle0ToPi(ep.phi()-mm.phi()), weight);
00135       _h_WeWm_deta->fill(ep.eta()-mm.eta(), weight);
00136       _h_WeWm_dR->fill(deltaR(ep,mm), weight);
00137       double m2=FourMomentum(ep+mm).mass2();
00138       if (m2 < 0) m2 = 0.0;
00139       _h_WeWm_m->fill(sqrt(m2), weight);
00140 
00141       const FastJets& jetpro = applyProjection<FastJets>(e, "Jets");
00142       const Jets& jets = jetpro.jetsByPt(20.0*GeV);
00143       if (jets.size() > 0) {
00144         _h_WW_jet1_deta->fill(ww.eta()-jets[0].momentum().eta(), weight);
00145         _h_WW_jet1_dR->fill(deltaR(ww, jets[0].momentum()), weight);
00146         _h_We_jet1_dR->fill(deltaR(ep, jets[0].momentum()), weight);
00147       }
00148 
00149       double HT=ep.pT()+mm.pT()+FourMomentum(enu+mnu).pT();
00150       foreach (const Jet& jet, jets) {
00151         HT+=jet.momentum().pT();
00152       }
00153       if (HT>0.0) _h_HT->fill(HT, weight);
00154 
00155       if (jets.size()>1) {
00156         FourMomentum jet1(jets[0].momentum());
00157         FourMomentum jet2(jets[1].momentum());
00158         _h_jets_m_12->fill(FourMomentum(jet1+jet2).mass(), weight);
00159       }
00160 
00161       MC_JetAnalysis::analyze(e);
00162     }
00163 
00164 
00165     /// Finalize
00166     void finalize() {
00167       double norm=crossSection()/sumOfWeights();
00168       scale(_h_WW_pT, norm);
00169       scale(_h_WW_pT_peak, norm);
00170       scale(_h_WW_eta, norm);
00171       scale(_h_WW_phi, norm);
00172       scale(_h_WW_m, norm);
00173       scale(_h_WW_dphi, norm);
00174       scale(_h_WW_deta, norm);
00175       scale(_h_WW_dR, norm);
00176       scale(_h_WW_dpT, norm);
00177       scale(_h_WW_costheta_planes, norm);
00178       scale(_h_W_pT, norm);
00179       scale(_h_W_eta, norm);
00180       scale(_h_Wl_pT, norm);
00181       scale(_h_Wl_eta, norm);
00182       scale(_h_WeWm_dphi, norm);
00183       scale(_h_WeWm_deta, norm);
00184       scale(_h_WeWm_dR, norm);
00185       scale(_h_WeWm_m, norm);
00186       scale(_h_WW_jet1_deta, norm);
00187       scale(_h_WW_jet1_dR, norm);
00188       scale(_h_We_jet1_dR, norm);
00189       scale(_h_jets_m_12, norm);
00190       scale(_h_HT, norm);
00191 
00192       MC_JetAnalysis::finalize();
00193     }
00194 
00195     //@}
00196 
00197 
00198   private:
00199 
00200     /// @name Histograms
00201     //@{
00202     AIDA::IHistogram1D * _h_WW_pT;
00203     AIDA::IHistogram1D * _h_WW_pT_peak;
00204     AIDA::IHistogram1D * _h_WW_eta;
00205     AIDA::IHistogram1D * _h_WW_phi;
00206     AIDA::IHistogram1D * _h_WW_m;
00207     AIDA::IHistogram1D * _h_WW_dphi;
00208     AIDA::IHistogram1D * _h_WW_deta;
00209     AIDA::IHistogram1D * _h_WW_dR;
00210     AIDA::IHistogram1D * _h_WW_dpT;
00211     AIDA::IHistogram1D * _h_WW_costheta_planes;
00212     AIDA::IHistogram1D * _h_W_pT;
00213     AIDA::IHistogram1D * _h_W_eta;
00214     AIDA::IHistogram1D * _h_Wl_pT;
00215     AIDA::IHistogram1D * _h_Wl_eta;
00216     AIDA::IHistogram1D * _h_WeWm_dphi;
00217     AIDA::IHistogram1D * _h_WeWm_deta;
00218     AIDA::IHistogram1D * _h_WeWm_dR;
00219     AIDA::IHistogram1D * _h_WeWm_m;
00220     AIDA::IHistogram1D * _h_WW_jet1_deta;
00221     AIDA::IHistogram1D * _h_WW_jet1_dR;
00222     AIDA::IHistogram1D * _h_We_jet1_dR;
00223     AIDA::IHistogram1D * _h_jets_m_12;
00224     AIDA::IHistogram1D * _h_HT;
00225     //@}
00226 
00227   };
00228 
00229 
00230 
00231   // The hook for the plugin system
00232   DECLARE_RIVET_PLUGIN(MC_WWJETS);
00233 
00234 }