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 
00009 namespace Rivet {
00010 
00011 
00012   /// @brief Measurement of Z(->muon muon) pT differential cross-section
00013   /// @author Flavia Dias
00014   class D0_2010_S8671338 : public Analysis {
00015   public:
00016 
00017     /// @name Construction
00018     //@{
00019 
00020     /// Constructor
00021     D0_2010_S8671338() : Analysis("D0_2010_S8671338")
00022     {
00023       setBeams(PROTON, ANTIPROTON);
00024       setNeedsCrossSection(true);
00025     }
00026 
00027     //@}
00028 
00029 
00030     ///@name Analysis methods
00031     //@{
00032 
00033     /// Add projections and book histograms
00034     void init() {
00035       ZFinder zfinder(-1.7, 1.7, 15.0*GeV, MUON, 65.0*GeV, 115.0*GeV, 0.2, false, true);
00036       addProjection(zfinder, "ZFinder");
00037 
00038       _h_Z_pT_normalised = bookHistogram1D(1, 1, 1);
00039       _h_Z_pT_xs = bookHistogram1D(2, 1, 1);
00040     }
00041 
00042 
00043     // Do the analysis
00044     void analyze(const Event& e) {
00045       const double weight = e.weight();
00046       const ZFinder& zfinder = applyProjection<ZFinder>(e, "ZFinder");
00047       if (zfinder.bosons().size()==1) {
00048         double ZpT = zfinder.bosons()[0].momentum().pT()/GeV;
00049         _h_Z_pT_normalised->fill(ZpT, weight);
00050         _h_Z_pT_xs->fill(ZpT, weight);
00051       }
00052     }
00053 
00054 
00055     /// Finalize
00056     void finalize() {
00057       normalize(_h_Z_pT_normalised, 1.0);
00058       scale(_h_Z_pT_xs, crossSectionPerEvent());
00059     }
00060 
00061     //@}
00062 
00063 
00064   private:
00065 
00066     /// @name Histogram
00067     AIDA::IHistogram1D * _h_Z_pT_normalised;
00068     AIDA::IHistogram1D * _h_Z_pT_xs;
00069 
00070   };
00071 
00072 
00073   // This global object acts as a hook for the plugin system
00074   AnalysisBuilder<D0_2010_S8671338> plugin_D0_2010_S8671338;
00075 
00076 
00077 }