rivet is hosted by Hepforge, IPPP Durham
D0_2008_S7554427.cc
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/Projections/FinalState.hh"
00004 #include "Rivet/Projections/ZFinder.hh"
00005 
00006 namespace Rivet {
00007 
00008 
00009   /// @brief D0 Run II Z \f$ p_\perp \f$ differential cross-section shape
00010   /// @author Andy Buckley
00011   /// @author Gavin Hesketh
00012   /// @author Frank Siegert
00013   class D0_2008_S7554427 : public Analysis {
00014   public:
00015 
00016     /// Default constructor.
00017     D0_2008_S7554427()
00018       : Analysis("D0_2008_S7554427")
00019     {    }
00020 
00021 
00022     /// @name Analysis methods
00023     //@{
00024 
00025     /// Book histograms
00026     void init() {
00027       FinalState fs;
00028       ZFinder zfinder(fs, Cuts::open(), PID::ELECTRON,
00029                       40*GeV, 200*GeV, 0.2, ZFinder::CLUSTERNODECAY, ZFinder::TRACK);
00030       declare(zfinder, "ZFinder");
00031 
00032       _h_ZpT         = bookHisto1D(1, 1, 1);
00033       _h_forward_ZpT = bookHisto1D(3, 1, 1);
00034     }
00035 
00036 
00037     /// Do the analysis
00038     void analyze(const Event& e) {
00039       const ZFinder& zfinder = apply<ZFinder>(e, "ZFinder");
00040       if (zfinder.bosons().size() != 1) {
00041         MSG_DEBUG("No unique lepton pair found.");
00042         vetoEvent;
00043       }
00044       const double yZ = fabs(zfinder.bosons()[0].rapidity());
00045       const double pTZ = zfinder.bosons()[0].pT();
00046       _h_ZpT->fill(pTZ, e.weight());
00047       if (yZ > 2) _h_forward_ZpT->fill(pTZ, e.weight());
00048     }
00049 
00050 
00051     // Finalize
00052     void finalize() {
00053       normalize(_h_ZpT);
00054       normalize(_h_forward_ZpT);
00055     }
00056 
00057     //@}
00058 
00059 
00060   private:
00061 
00062     /// @name Histograms
00063     //@{
00064     Histo1DPtr _h_ZpT, _h_forward_ZpT;
00065     //@}
00066 
00067   };
00068 
00069 
00070   // The hook for the plugin system
00071   DECLARE_RIVET_PLUGIN(D0_2008_S7554427);
00072 
00073 }