CDF_2009_S8383952.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 CDF Z boson rapidity measurement
00012   class CDF_2009_S8383952 : public Analysis {
00013   public:
00014 
00015     /// @name Constructors etc.
00016     //@{
00017 
00018     /// Constructor
00019     CDF_2009_S8383952()
00020       : Analysis("CDF_2009_S8383952")
00021     {    }
00022 
00023     //@}
00024 
00025 
00026   public:
00027 
00028     /// @name Analysis methods
00029     //@{
00030 
00031     /// Book histograms and initialise projections before the run
00032     void init() {
00033 
00034       /// Initialise and register projections here
00035       // this seems to have been corrected completely for all selection cuts,
00036       // i.e. eta cuts and pT cuts on leptons.
00037       ZFinder zfinder(-MAXRAPIDITY, MAXRAPIDITY, 0.0*GeV, ELECTRON,
00038                       66.0*GeV, 116.0*GeV, 0.2, true, true);
00039       addProjection(zfinder, "ZFinder");
00040 
00041 
00042       /// Book histograms here
00043       _h_xs = bookHistogram1D(1, 1, 1);
00044       _h_yZ = bookHistogram1D(2, 1, 1);
00045 
00046     }
00047 
00048 
00049     /// Perform the per-event analysis
00050     void analyze(const Event& event) {
00051       const double weight = event.weight();
00052 
00053       const ZFinder& zfinder = applyProjection<ZFinder>(event, "ZFinder");
00054       if (zfinder.bosons().size() == 1) {
00055         double yZ = fabs(zfinder.bosons()[0].momentum().rapidity());
00056         _h_yZ->fill(yZ, weight);
00057         _h_xs->fill(1960.0, weight);
00058       }
00059       else {
00060         MSG_DEBUG("no unique lepton pair found.");
00061       }
00062 
00063     }
00064 
00065 
00066     /// Normalise histograms etc., after the run
00067     void finalize() {
00068       scale(_h_xs, crossSection()/sumOfWeights());
00069       // Data seems to have been normalized for the avg of the two sides
00070       // (+ve & -ve rapidity) rather than the sum, hence the 0.5:
00071       scale(_h_yZ, 0.5*crossSection()/sumOfWeights());
00072     }
00073 
00074     //@}
00075 
00076 
00077   private:
00078 
00079     /// @name Histograms
00080     //@{
00081     AIDA::IHistogram1D *_h_yZ;
00082     AIDA::IHistogram1D *_h_xs;
00083     //@}
00084 
00085   };
00086 
00087 
00088 
00089   // The hook for the plugin system
00090   DECLARE_RIVET_PLUGIN(CDF_2009_S8383952);
00091 
00092 }