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