rivet is hosted by Hepforge, IPPP Durham
ALEPH_1991_S2435284.cc
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/Projections/ChargedFinalState.hh"
00004 
00005 namespace Rivet {
00006 
00007 
00008   /// @brief ALEPH LEP1 charged multiplicity in hadronic Z decay
00009   /// @author Andy Buckley
00010   class ALEPH_1991_S2435284 : public Analysis {
00011   public:
00012 
00013     /// Constructor.
00014     ALEPH_1991_S2435284()
00015       : Analysis("ALEPH_1991_S2435284")
00016     {
00017     }
00018 
00019 
00020     /// @name Analysis methods
00021     //@{
00022 
00023     /// Book projections and histogram
00024     void init() {
00025       const ChargedFinalState cfs;
00026       addProjection(cfs, "CFS");
00027 
00028       _histChTot = bookHisto1D(1, 1, 1);
00029     }
00030 
00031 
00032     /// Do the analysis
00033     void analyze(const Event& event) {
00034       const FinalState& cfs = applyProjection<FinalState>(event, "CFS");
00035       MSG_DEBUG("Total charged multiplicity = " << cfs.size());
00036       _histChTot->fill(cfs.size(), event.weight());
00037     }
00038 
00039 
00040     /// Normalize the histogram
00041     void finalize() {
00042       scale(_histChTot, 2.0/sumOfWeights()); // same as in ALEPH 1996
00043     }
00044 
00045     //@}
00046 
00047 
00048   private:
00049 
00050     /// @name Histograms
00051     //@{
00052     Histo1DPtr _histChTot;
00053     //@}
00054 
00055   };
00056 
00057 
00058 
00059   // The hook for the plugin system
00060   DECLARE_RIVET_PLUGIN(ALEPH_1991_S2435284);
00061 
00062 }