rivet is hosted by Hepforge, IPPP Durham
D0_2000_S4480767.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/WFinder.hh"
00005 
00006 namespace Rivet {
00007 
00008 
00009   class D0_2000_S4480767 : public Analysis {
00010   public:
00011 
00012     /// Constructor
00013     D0_2000_S4480767()
00014       : Analysis("D0_2000_S4480767")
00015     {    }
00016 
00017 
00018     /// @name Analysis methods
00019     //@{
00020 
00021     /// Book histograms and initialise projections before the run
00022     void init() {
00023       FinalState fs;
00024       WFinder wf(fs, Cuts::abseta < 5, PID::ELECTRON, 0.0*GeV, 200.0*GeV, 0.0*GeV, 0.2);
00025       addProjection(wf, "WFinder");
00026 
00027       _h_W_pT = bookHisto1D(1, 1, 1);
00028     }
00029 
00030 
00031     /// Perform the per-event analysis
00032     void analyze(const Event& event) {
00033       const double weight = event.weight();
00034 
00035       const WFinder& wf = applyProjection<WFinder>(event, "WFinder");
00036       if (wf.bosons().size() == 0) vetoEvent;
00037 
00038       _h_W_pT->fill(wf.bosons()[0].pT()/GeV, weight);
00039     }
00040 
00041 
00042     /// Normalise histograms etc., after the run
00043     void finalize() {
00044       scale(_h_W_pT, crossSection()/sumOfWeights());
00045     }
00046 
00047     //@}
00048 
00049 
00050   private:
00051 
00052     /// @name Histograms
00053     //@{
00054 
00055     Histo1DPtr _h_W_pT;
00056     //@}
00057 
00058 
00059   };
00060 
00061 
00062 
00063   // The hook for the plugin system
00064   DECLARE_RIVET_PLUGIN(D0_2000_S4480767);
00065 
00066 }