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