D0_2010_S8671338.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/RivetAIDA.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       ZFinder zfinder(-1.7, 1.7, 15.0*GeV, MUON, 65.0*GeV, 115.0*GeV, 0.2, false, true);
00032       addProjection(zfinder, "ZFinder");
00033 
00034       _h_Z_pT_normalised = bookHistogram1D(1, 1, 1);
00035       _h_Z_pT_xs = bookHistogram1D(2, 1, 1);
00036     }
00037 
00038 
00039     // Do the analysis
00040     void analyze(const Event& e) {
00041       const double weight = e.weight();
00042       const ZFinder& zfinder = applyProjection<ZFinder>(e, "ZFinder");
00043       if (zfinder.bosons().size()==1) {
00044         double ZpT = zfinder.bosons()[0].momentum().pT()/GeV;
00045         _h_Z_pT_normalised->fill(ZpT, weight);
00046         _h_Z_pT_xs->fill(ZpT, weight);
00047       }
00048     }
00049 
00050 
00051     /// Finalize
00052     void finalize() {
00053       normalize(_h_Z_pT_normalised, 1.0);
00054       scale(_h_Z_pT_xs, crossSectionPerEvent());
00055     }
00056 
00057     //@}
00058 
00059 
00060   private:
00061 
00062     /// @name Histogram
00063     AIDA::IHistogram1D * _h_Z_pT_normalised;
00064     AIDA::IHistogram1D * _h_Z_pT_xs;
00065 
00066   };
00067 
00068 
00069 
00070   // The hook for the plugin system
00071   DECLARE_RIVET_PLUGIN(D0_2010_S8671338);
00072 
00073 }