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 #include "Rivet/Projections/Multiplicity.hh"
00005 #include "Rivet/Tools/Logging.hh"
00006 #include "Rivet/RivetAIDA.hh"
00007 
00008 namespace Rivet {
00009 
00010 
00011   /// @brief Measurement of ALEPH LEP1 charged multiplicity
00012   /// @author Andy Buckley
00013   class ALEPH_1991_S2435284 : public Analysis {
00014   public:
00015 
00016     /// Constructor.
00017     ALEPH_1991_S2435284()
00018       : Analysis("ALEPH_1991_S2435284")
00019     {
00020       setBeams(ELECTRON, POSITRON);
00021     }
00022 
00023 
00024     /// @name Analysis methods
00025     //@{
00026  
00027     /// Book projections and histogram
00028     void init() {
00029       const ChargedFinalState cfs;
00030       addProjection(cfs, "FS");
00031       addProjection(Multiplicity(cfs), "Mult");
00032 
00033       _histChTot = bookHistogram1D(1, 1, 1);
00034     }
00035 
00036 
00037     /// Do the analysis
00038     void analyze(const Event& event) {
00039       const Multiplicity& m = applyProjection<Multiplicity>(event, "Mult");
00040       getLog() << Log::DEBUG << "Total charged multiplicity = " << m.totalMultiplicity() << endl;
00041       _histChTot->fill(m.totalMultiplicity(), event.weight());
00042     }
00043 
00044 
00045     /// Normalize the histogram
00046     void finalize() {
00047       scale(_histChTot, 2.0/sumOfWeights()); // same as in ALEPH 1996
00048     }
00049 
00050     //@}
00051 
00052 
00053   private:
00054 
00055     /// @name Histograms
00056     //@{
00057     AIDA::IHistogram1D* _histChTot;
00058     //@}
00059 
00060   };
00061 
00062  
00063   // This global object acts as a hook for the plugin system
00064   AnalysisBuilder<ALEPH_1991_S2435284> plugin_ALEPH_1991_S2435284;
00065 
00066 }