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