rivet is hosted by Hepforge, IPPP Durham
D0_2010_S8671338.cc
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/RivetYODA.hh"
00004 #include "Rivet/Tools/Logging.hh"
00005 #include "Rivet/Projections/FinalState.hh"
00006 #include "Rivet/Projections/ZFinder.hh"
00007 
00008 namespace Rivet {
00009 
00010 
00011   /// @brief Measurement of Z(->muon muon) pT differential cross-section
00012   /// @author Flavia Dias
00013   class D0_2010_S8671338 : public Analysis {
00014   public:
00015 
00016     /// @name Construction
00017     //@{
00018 
00019     /// Constructor
00020     D0_2010_S8671338() : Analysis("D0_2010_S8671338")
00021     {    }
00022 
00023     //@}
00024 
00025 
00026     ///@name Analysis methods
00027     //@{
00028 
00029     /// Add projections and book histograms
00030     void init() {
00031       FinalState fs;
00032       ZFinder zfinder(fs, -1.7, 1.7, 15.0*GeV, MUON, 65.0*GeV, 115.0*GeV, 0.2, false, true);
00033       addProjection(zfinder, "ZFinder");
00034 
00035       _h_Z_pT_normalised = bookHisto1D(1, 1, 1);
00036       _h_Z_pT_xs = bookHisto1D(2, 1, 1);
00037     }
00038 
00039 
00040     // Do the analysis
00041     void analyze(const Event& e) {
00042       const double weight = e.weight();
00043       const ZFinder& zfinder = applyProjection<ZFinder>(e, "ZFinder");
00044       if (zfinder.bosons().size()==1) {
00045         double ZpT = zfinder.bosons()[0].momentum().pT()/GeV;
00046         _h_Z_pT_normalised->fill(ZpT, weight);
00047         _h_Z_pT_xs->fill(ZpT, weight);
00048       }
00049     }
00050 
00051 
00052     /// Finalize
00053     void finalize() {
00054       normalize(_h_Z_pT_normalised, 1.0);
00055       scale(_h_Z_pT_xs, crossSectionPerEvent());
00056     }
00057 
00058     //@}
00059 
00060 
00061   private:
00062 
00063     /// @name Histogram
00064     Histo1DPtr _h_Z_pT_normalised;
00065     Histo1DPtr _h_Z_pT_xs;
00066 
00067   };
00068 
00069 
00070 
00071   // The hook for the plugin system
00072   DECLARE_RIVET_PLUGIN(D0_2010_S8671338);
00073 
00074 }