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