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 #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 Z[ee]Z[mumu] + jets events
00013   class MC_ZZJETS : public MC_JetAnalysis {
00014   public:
00015 
00016     /// Default constructor
00017     MC_ZZJETS()
00018       : MC_JetAnalysis("MC_ZZJETS", 4, "Jets")
00019     {    }
00020 
00021 
00022     /// @name Analysis methods
00023     //@{
00024 
00025     /// Book histograms
00026     void init() {
00027       ZFinder zeefinder(-3.5, 3.5, 25.0*GeV, ELECTRON, 65.0*GeV, 115.0*GeV, 0.2, true, true);
00028       addProjection(zeefinder, "ZeeFinder");
00029       ZFinder zmmfinder(-3.5, 3.5, 25.0*GeV, MUON, 65.0*GeV, 115.0*GeV, 0.2, true, true);
00030       addProjection(zmmfinder, "ZmmFinder");
00031       VetoedFinalState jetinput;
00032       jetinput
00033           .addVetoOnThisFinalState(zeefinder)
00034           .addVetoOnThisFinalState(zmmfinder);
00035       FastJets jetpro(jetinput, FastJets::KT, 0.7);
00036       addProjection(jetpro, "Jets");
00037 
00038       // properties of the pair momentum
00039       _h_ZZ_pT = bookHistogram1D("ZZ_pT", logBinEdges(100, 1.0, 0.5*sqrtS()));
00040       _h_ZZ_pT_peak = bookHistogram1D("ZZ_pT_peak", 25, 0.0, 25.0);
00041       _h_ZZ_eta = bookHistogram1D("ZZ_eta", 40, -7.0, 7.0);
00042       _h_ZZ_phi = bookHistogram1D("ZZ_phi", 25, 0.0, TWOPI);
00043       _h_ZZ_m = bookHistogram1D("ZZ_m", logBinEdges(100, 150.0, 180.0+0.25*sqrtS()));
00044 
00045       // correlations between the ZZ
00046       _h_ZZ_dphi = bookHistogram1D("ZZ_dphi", 25, 0.0, PI);  /// @todo non-linear?
00047       _h_ZZ_deta = bookHistogram1D("ZZ_deta", 25, -7.0, 7.0);
00048       _h_ZZ_dR = bookHistogram1D("ZZ_dR", 25, 0.5, 7.0);
00049       _h_ZZ_dpT = bookHistogram1D("ZZ_dpT", logBinEdges(100, 1.0, 0.5*sqrtS()));
00050       _h_ZZ_costheta_planes = bookHistogram1D("ZZ_costheta_planes", 25, -1.0, 1.0);
00051 
00052       /// @todo fuer WW: missing ET
00053 
00054       // properties of the Z bosons
00055       _h_Z_pT = bookHistogram1D("Z_pT", logBinEdges(100, 10.0, 0.25*sqrtS()));
00056       _h_Z_eta = bookHistogram1D("Z_eta", 70, -7.0, 7.0);
00057 
00058       // properties of the leptons
00059       _h_Zl_pT = bookHistogram1D("Zl_pT", logBinEdges(100, 30.0, 0.1
00060                                                       *sqrtS()));
00061       _h_Zl_eta = bookHistogram1D("Zl_eta", 40, -3.5, 3.5);
00062 
00063       // correlations between the opposite charge leptons
00064       _h_ZeZm_dphi = bookHistogram1D("ZeZm_dphi", 25, 0.0, PI);
00065       _h_ZeZm_deta = bookHistogram1D("ZeZm_deta", 25, -5.0, 5.0);
00066       _h_ZeZm_dR = bookHistogram1D("ZeZm_dR", 25, 0.5, 5.0);
00067       _h_ZeZm_m = bookHistogram1D("ZeZm_m", 100, 0.0, 300.0);
00068 
00069       // correlations with jets
00070       _h_ZZ_jet1_deta = bookHistogram1D("ZZ_jet1_deta", 70, -7.0, 7.0);
00071       _h_ZZ_jet1_dR = bookHistogram1D("ZZ_jet1_dR", 25, 1.5, 7.0);
00072       _h_Ze_jet1_dR = bookHistogram1D("Ze_jet1_dR", 25, 0.0, 7.0);
00073 
00074       // global stuff
00075       _h_HT = bookHistogram1D("HT", logBinEdges(100, 100.0, 0.5*sqrtS()));
00076 
00077       MC_JetAnalysis::init();
00078     }
00079 
00080 
00081 
00082     /// Do the analysis
00083     void analyze(const Event & e) {
00084       const double weight = e.weight();
00085 
00086       const ZFinder& zeefinder = applyProjection<ZFinder>(e, "ZeeFinder");
00087       if (zeefinder.bosons().size()!=1) {
00088         vetoEvent;
00089       }
00090 
00091       const ZFinder& zmmfinder = applyProjection<ZFinder>(e, "ZmmFinder");
00092       if (zmmfinder.bosons().size()!=1) {
00093         vetoEvent;
00094       }
00095 
00096       FourMomentum zee(zeefinder.bosons()[0].momentum());
00097       FourMomentum zmm(zmmfinder.bosons()[0].momentum());
00098       FourMomentum zz(zee+zmm);
00099       // find leptons
00100       FourMomentum ep(0.0,0.0,0.0,0.0), em(0.0,0.0,0.0,0.0);
00101       if (PID::threeCharge(zeefinder.constituents()[0])>0.0) {
00102         ep=zeefinder.constituents()[0].momentum();
00103         em=zeefinder.constituents()[1].momentum();
00104       }
00105       else {
00106         ep=zeefinder.constituents()[1].momentum();
00107         em=zeefinder.constituents()[0].momentum();
00108       }
00109       FourMomentum mp(0.0,0.0,0.0,0.0), mm(0.0,0.0,0.0,0.0);
00110       if (PID::threeCharge(zmmfinder.constituents()[0])>0.0) {
00111         mp=zmmfinder.constituents()[0].momentum();
00112         mm=zmmfinder.constituents()[1].momentum();
00113       }
00114       else {
00115         mp=zmmfinder.constituents()[1].momentum();
00116         mm=zmmfinder.constituents()[0].momentum();
00117       }
00118 
00119       _h_ZZ_pT->fill(zz.pT(),weight);
00120       _h_ZZ_pT_peak->fill(zz.pT(),weight);
00121       _h_ZZ_eta->fill(zz.eta(),weight);
00122       _h_ZZ_phi->fill(zz.azimuthalAngle(),weight);
00123       double mzz2=zz.mass2();
00124       if (mzz2>0.0) _h_ZZ_m->fill(sqrt(mzz2), weight);
00125 
00126       _h_ZZ_dphi->fill(mapAngle0ToPi(zee.phi()-zmm.phi()), weight);
00127       _h_ZZ_deta->fill(zee.eta()-zmm.eta(), weight);
00128       _h_ZZ_dR->fill(deltaR(zee,zmm), weight);
00129       _h_ZZ_dpT->fill(fabs(zee.pT()-zmm.pT()), weight);
00130 
00131       Vector3 crossZee = ep.vector3().cross(em.vector3());
00132       Vector3 crossZmm = mp.vector3().cross(mm.vector3());
00133       double costheta = crossZee.dot(crossZmm)/crossZee.mod()/crossZmm.mod();
00134       _h_ZZ_costheta_planes->fill(costheta, weight);
00135 
00136       _h_Z_pT->fill(zee.pT(),weight);
00137       _h_Z_pT->fill(zmm.pT(),weight);
00138       _h_Z_eta->fill(zee.eta(),weight);
00139       _h_Z_eta->fill(zmm.eta(),weight);
00140 
00141       _h_Zl_pT->fill(ep.pT(), weight);
00142       _h_Zl_pT->fill(em.pT(), weight);
00143       _h_Zl_pT->fill(mp.pT(), weight);
00144       _h_Zl_pT->fill(mm.pT(), weight);
00145       _h_Zl_eta->fill(ep.eta(), weight);
00146       _h_Zl_eta->fill(em.eta(), weight);
00147       _h_Zl_eta->fill(mp.eta(), weight);
00148       _h_Zl_eta->fill(mm.eta(), weight);
00149 
00150       _h_ZeZm_dphi->fill(mapAngle0ToPi(ep.phi()-mm.phi()), weight);
00151       _h_ZeZm_deta->fill(ep.eta()-mm.eta(), weight);
00152       _h_ZeZm_dR->fill(deltaR(ep,mm), weight);
00153       double m2=FourMomentum(ep+mm).mass2();
00154       if (m2 < 0) m2 = 0.0;
00155       _h_ZeZm_m->fill(sqrt(m2), weight);
00156 
00157       const FastJets& jetpro = applyProjection<FastJets>(e, "Jets");
00158       const Jets& jets = jetpro.jetsByPt(20.0*GeV);
00159       if (jets.size() > 0) {
00160         _h_ZZ_jet1_deta->fill(zz.eta()-jets[0].momentum().eta(), weight);
00161         _h_ZZ_jet1_dR->fill(deltaR(zz, jets[0].momentum()), weight);
00162         _h_Ze_jet1_dR->fill(deltaR(ep, jets[0].momentum()), weight);
00163       }
00164 
00165       double HT=ep.pT()+em.pT()+mp.pT()+mm.pT();
00166       foreach (const Jet& jet, jets) {
00167         HT+=jet.momentum().pT();
00168       }
00169       if (HT>0.0) _h_HT->fill(HT, weight);
00170 
00171       MC_JetAnalysis::analyze(e);
00172     }
00173 
00174 
00175     /// Finalize
00176     void finalize() {
00177       double norm=crossSection()/sumOfWeights();
00178       scale(_h_ZZ_pT, norm);
00179       scale(_h_ZZ_pT_peak, norm);
00180       scale(_h_ZZ_eta, norm);
00181       scale(_h_ZZ_phi, norm);
00182       scale(_h_ZZ_m, norm);
00183       scale(_h_ZZ_dphi, norm);
00184       scale(_h_ZZ_deta, norm);
00185       scale(_h_ZZ_dR, norm);
00186       scale(_h_ZZ_dpT, norm);
00187       scale(_h_ZZ_costheta_planes, norm);
00188       scale(_h_Z_pT, norm);
00189       scale(_h_Z_eta, norm);
00190       scale(_h_Zl_pT, norm);
00191       scale(_h_Zl_eta, norm);
00192       scale(_h_ZeZm_dphi, norm);
00193       scale(_h_ZeZm_deta, norm);
00194       scale(_h_ZeZm_dR, norm);
00195       scale(_h_ZeZm_m, norm);
00196       scale(_h_ZZ_jet1_deta, norm);
00197       scale(_h_ZZ_jet1_dR, norm);
00198       scale(_h_Ze_jet1_dR, norm);
00199       scale(_h_HT, norm);
00200 
00201       MC_JetAnalysis::finalize();
00202     }
00203 
00204     //@}
00205 
00206 
00207   private:
00208 
00209     /// @name Histograms
00210     //@{
00211     AIDA::IHistogram1D * _h_ZZ_pT;
00212     AIDA::IHistogram1D * _h_ZZ_pT_peak;
00213     AIDA::IHistogram1D * _h_ZZ_eta;
00214     AIDA::IHistogram1D * _h_ZZ_phi;
00215     AIDA::IHistogram1D * _h_ZZ_m;
00216     AIDA::IHistogram1D * _h_ZZ_dphi;
00217     AIDA::IHistogram1D * _h_ZZ_deta;
00218     AIDA::IHistogram1D * _h_ZZ_dR;
00219     AIDA::IHistogram1D * _h_ZZ_dpT;
00220     AIDA::IHistogram1D * _h_ZZ_costheta_planes;
00221     AIDA::IHistogram1D * _h_Z_pT;
00222     AIDA::IHistogram1D * _h_Z_eta;
00223     AIDA::IHistogram1D * _h_Zl_pT;
00224     AIDA::IHistogram1D * _h_Zl_eta;
00225     AIDA::IHistogram1D * _h_ZeZm_dphi;
00226     AIDA::IHistogram1D * _h_ZeZm_deta;
00227     AIDA::IHistogram1D * _h_ZeZm_dR;
00228     AIDA::IHistogram1D * _h_ZeZm_m;
00229     AIDA::IHistogram1D * _h_ZZ_jet1_deta;
00230     AIDA::IHistogram1D * _h_ZZ_jet1_dR;
00231     AIDA::IHistogram1D * _h_Ze_jet1_dR;
00232     AIDA::IHistogram1D * _h_HT;
00233     //@}
00234 
00235   };
00236 
00237 
00238 
00239   // The hook for the plugin system
00240   DECLARE_RIVET_PLUGIN(MC_ZZJETS);
00241 
00242 }