rivet is hosted by Hepforge, IPPP Durham
MC_ZZINC.cc
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/Projections/ZFinder.hh"
00004 #include "Rivet/Projections/VetoedFinalState.hh"
00005 
00006 namespace Rivet {
00007 
00008   /// @brief MC validation analysis for Z[ee]Z[mumu] events
00009   class MC_ZZINC : public Analysis {
00010   public:
00011 
00012     /// Default constructor
00013     MC_ZZINC()
00014       : Analysis("MC_ZZINC")
00015     {    }
00016 
00017 
00018     /// @name Analysis methods
00019     //@{
00020 
00021     /// Book histograms
00022     void init() {
00023       Cut cut = EtaIn(-3.5,3.5) & (Cuts::pT >= 25.0*GeV);
00024       ZFinder zeefinder(FinalState(), cut, PID::ELECTRON, 65*GeV, 115*GeV,
00025                         0.2, ZFinder::CLUSTERNODECAY, ZFinder::TRACK);
00026       addProjection(zeefinder, "ZeeFinder");
00027 
00028       VetoedFinalState zmminput;
00029       zmminput.addVetoOnThisFinalState(zeefinder);
00030       ZFinder zmmfinder(zmminput, cut, PID::MUON, 65*GeV, 115*GeV,
00031                         0.2, ZFinder::CLUSTERNODECAY, ZFinder::TRACK);
00032       addProjection(zmmfinder, "ZmmFinder");
00033 
00034       // Properties of the pair momentum
00035       _h_ZZ_pT = bookHisto1D("ZZ_pT", logspace(100, 1.0, 0.5*sqrtS()/GeV));
00036       _h_ZZ_pT_peak = bookHisto1D("ZZ_pT_peak", 25, 0.0, 25.0);
00037       _h_ZZ_eta = bookHisto1D("ZZ_eta", 40, -7.0, 7.0);
00038       _h_ZZ_phi = bookHisto1D("ZZ_phi", 25, 0.0, TWOPI);
00039       _h_ZZ_m = bookHisto1D("ZZ_m", logspace(100, 150.0, 180.0 + 0.25*sqrtS()/GeV));
00040 
00041       // Correlations between the ZZ
00042       _h_ZZ_dphi = bookHisto1D("ZZ_dphi", 25, 0.0, PI);  /// @todo non-linear?
00043       _h_ZZ_deta = bookHisto1D("ZZ_deta", 25, -7.0, 7.0);
00044       _h_ZZ_dR = bookHisto1D("ZZ_dR", 25, 0.5, 7.0);
00045       _h_ZZ_dpT = bookHisto1D("ZZ_dpT", logspace(100, 1.0, 0.5*sqrtS()/GeV));
00046       _h_ZZ_costheta_planes = bookHisto1D("ZZ_costheta_planes", 25, -1.0, 1.0);
00047 
00048       // Properties of the Z bosons
00049       _h_Z_pT = bookHisto1D("Z_pT", logspace(100, 10.0, 0.25*sqrtS()/GeV));
00050       _h_Z_eta = bookHisto1D("Z_eta", 70, -7.0, 7.0);
00051 
00052       // Properties of the leptons
00053       _h_Zl_pT = bookHisto1D("Zl_pT", logspace(100, 30.0, 0.1*sqrtS()/GeV));
00054       _h_Zl_eta = bookHisto1D("Zl_eta", 40, -3.5, 3.5);
00055 
00056       // Correlations between the opposite charge leptons
00057       _h_ZeZm_dphi = bookHisto1D("ZeZm_dphi", 25, 0.0, PI);
00058       _h_ZeZm_deta = bookHisto1D("ZeZm_deta", 25, -5.0, 5.0);
00059       _h_ZeZm_dR = bookHisto1D("ZeZm_dR", 25, 0.5, 5.0);
00060       _h_ZeZm_m = bookHisto1D("ZeZm_m", 100, 0.0, 300.0);
00061 
00062     }
00063 
00064 
00065 
00066     /// Do the analysis
00067     void analyze(const Event& e) {
00068       const ZFinder& zeefinder = applyProjection<ZFinder>(e, "ZeeFinder");
00069       if (zeefinder.bosons().size() != 1) vetoEvent;
00070       const ZFinder& zmmfinder = applyProjection<ZFinder>(e, "ZmmFinder");
00071       if (zmmfinder.bosons().size() != 1) vetoEvent;
00072 
00073       // Z momenta
00074       const FourMomentum& zee = zeefinder.bosons()[0].momentum();
00075       const FourMomentum& zmm = zmmfinder.bosons()[0].momentum();
00076       const FourMomentum zz = zee + zmm;
00077       // Lepton momenta
00078       const FourMomentum& ep = zeefinder.constituents()[0].momentum();
00079       const FourMomentum& em = zeefinder.constituents()[1].momentum();
00080       const FourMomentum& mp = zmmfinder.constituents()[0].momentum();
00081       const FourMomentum& mm = zmmfinder.constituents()[1].momentum();
00082 
00083       const double weight = e.weight();
00084       _h_ZZ_pT->fill(zz.pT()/GeV, weight);
00085       _h_ZZ_pT_peak->fill(zz.pT()/GeV, weight);
00086       _h_ZZ_eta->fill(zz.eta(), weight);
00087       _h_ZZ_phi->fill(zz.azimuthalAngle(), weight);
00088       if (zz.mass2() > 0.0) //< @todo Protection still needed?
00089         _h_ZZ_m->fill(zz.mass()/GeV, weight);
00090 
00091       _h_ZZ_dphi->fill(deltaPhi(zee, zmm), weight);
00092       _h_ZZ_deta->fill(zee.eta()-zmm.eta(), weight);
00093       _h_ZZ_dR->fill(deltaR(zee,zmm), weight);
00094       _h_ZZ_dpT->fill(fabs(zee.pT()-zmm.pT()), weight);
00095 
00096       const Vector3 crossZee = ep.vector3().cross(em.vector3());
00097       const Vector3 crossZmm = mp.vector3().cross(mm.vector3());
00098       const double costheta = crossZee.dot(crossZmm)/crossZee.mod()/crossZmm.mod();
00099       _h_ZZ_costheta_planes->fill(costheta, weight);
00100 
00101       _h_Z_pT->fill(zee.pT()/GeV, weight);
00102       _h_Z_pT->fill(zmm.pT()/GeV, weight);
00103       _h_Z_eta->fill(zee.eta(), weight);
00104       _h_Z_eta->fill(zmm.eta(), weight);
00105 
00106       _h_Zl_pT->fill(ep.pT()/GeV, weight);
00107       _h_Zl_pT->fill(em.pT()/GeV, weight);
00108       _h_Zl_pT->fill(mp.pT()/GeV, weight);
00109       _h_Zl_pT->fill(mm.pT()/GeV, weight);
00110       _h_Zl_eta->fill(ep.eta(), weight);
00111       _h_Zl_eta->fill(em.eta(), weight);
00112       _h_Zl_eta->fill(mp.eta(), weight);
00113       _h_Zl_eta->fill(mm.eta(), weight);
00114 
00115       _h_ZeZm_dphi->fill(deltaPhi(ep, mm), weight);
00116       _h_ZeZm_deta->fill(ep.eta()-mm.eta(), weight);
00117       _h_ZeZm_dR->fill(deltaR(ep, mm), weight);
00118       const FourMomentum epmm = ep + mm;
00119       const double m_epmm = (epmm.mass2() > 0) ? epmm.mass() : 0; //< @todo Protection still needed?
00120       _h_ZeZm_m->fill(m_epmm/GeV, weight);
00121     }
00122 
00123 
00124     /// Finalize
00125     void finalize() {
00126       const double norm = crossSection()/picobarn;
00127       normalize(_h_ZZ_pT, norm);
00128       normalize(_h_ZZ_pT_peak, norm);
00129       normalize(_h_ZZ_eta, norm);
00130       normalize(_h_ZZ_phi, norm);
00131       normalize(_h_ZZ_m, norm);
00132       normalize(_h_ZZ_dphi, norm);
00133       normalize(_h_ZZ_deta, norm);
00134       normalize(_h_ZZ_dR, norm);
00135       normalize(_h_ZZ_dpT, norm);
00136       normalize(_h_ZZ_costheta_planes, norm);
00137       normalize(_h_Z_pT, norm);
00138       normalize(_h_Z_eta, norm);
00139       normalize(_h_Zl_pT, norm);
00140       normalize(_h_Zl_eta, norm);
00141       normalize(_h_ZeZm_dphi, norm);
00142       normalize(_h_ZeZm_deta, norm);
00143       normalize(_h_ZeZm_dR, norm);
00144       normalize(_h_ZeZm_m, norm);
00145     }
00146 
00147     //@}
00148 
00149 
00150   private:
00151 
00152     /// @name Histograms
00153     //@{
00154     Histo1DPtr _h_ZZ_pT;
00155     Histo1DPtr _h_ZZ_pT_peak;
00156     Histo1DPtr _h_ZZ_eta;
00157     Histo1DPtr _h_ZZ_phi;
00158     Histo1DPtr _h_ZZ_m;
00159     Histo1DPtr _h_ZZ_dphi;
00160     Histo1DPtr _h_ZZ_deta;
00161     Histo1DPtr _h_ZZ_dR;
00162     Histo1DPtr _h_ZZ_dpT;
00163     Histo1DPtr _h_ZZ_costheta_planes;
00164     Histo1DPtr _h_Z_pT;
00165     Histo1DPtr _h_Z_eta;
00166     Histo1DPtr _h_Zl_pT;
00167     Histo1DPtr _h_Zl_eta;
00168     Histo1DPtr _h_ZeZm_dphi;
00169     Histo1DPtr _h_ZeZm_deta;
00170     Histo1DPtr _h_ZeZm_dR;
00171     Histo1DPtr _h_ZeZm_m;
00172     //@}
00173 
00174   };
00175 
00176 
00177 
00178   // The hook for the plugin system
00179   DECLARE_RIVET_PLUGIN(MC_ZZINC);
00180 
00181 }