rivet is hosted by Hepforge, IPPP Durham
ALICE_2010_S8624100.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/ChargedFinalState.hh"
00006 
00007 namespace Rivet {
00008 
00009 
00010   class ALICE_2010_S8624100 : public Analysis {
00011   public:
00012 
00013     /// @name Constructors etc.
00014     //@{
00015 
00016     /// Constructor
00017     ALICE_2010_S8624100()
00018       : Analysis("ALICE_2010_S8624100")
00019     {    }
00020 
00021     //@}
00022 
00023 
00024   public:
00025 
00026     /// @name Analysis methods
00027     //@{
00028 
00029     /// Book histograms and initialise projections before the run
00030     void init() {
00031 
00032       ChargedFinalState cfs05(-0.5, 0.5);
00033       ChargedFinalState cfs10(-1.0, 1.0);
00034       ChargedFinalState cfs13(-1.3, 1.3);
00035       addProjection(cfs05, "CFS05");
00036       addProjection(cfs10, "CFS10");
00037       addProjection(cfs13, "CFS13");
00038 
00039       if (fuzzyEquals(sqrtS()/GeV, 900, 1E-3)) {
00040         _h_dN_dNch_05    = bookHisto1D(11, 1, 1);
00041         _h_dN_dNch_10    = bookHisto1D(12, 1, 1);
00042         _h_dN_dNch_13    = bookHisto1D(13, 1, 1);
00043       } else if (fuzzyEquals(sqrtS()/GeV, 2360, 1E-3)) {
00044         _h_dN_dNch_05    = bookHisto1D(17, 1, 1);
00045         _h_dN_dNch_10    = bookHisto1D(18, 1, 1);
00046         _h_dN_dNch_13    = bookHisto1D(19, 1, 1);
00047       }
00048 
00049     }
00050 
00051 
00052     /// Perform the per-event analysis
00053     void analyze(const Event& event) {
00054       const double weight = event.weight();
00055 
00056       const ChargedFinalState& charged_05 = applyProjection<ChargedFinalState>(event, "CFS05");
00057       const ChargedFinalState& charged_10 = applyProjection<ChargedFinalState>(event, "CFS10");
00058       const ChargedFinalState& charged_13 = applyProjection<ChargedFinalState>(event, "CFS13");
00059 
00060       _h_dN_dNch_05->fill(charged_05.size(), weight);
00061       _h_dN_dNch_10->fill(charged_10.size(), weight);
00062       _h_dN_dNch_13->fill(charged_13.size(), weight);
00063     }
00064 
00065 
00066     /// Normalise histograms etc., after the run
00067     void finalize() {
00068 
00069       normalize(_h_dN_dNch_05);
00070       normalize(_h_dN_dNch_10);
00071       normalize(_h_dN_dNch_13);
00072 
00073     }
00074 
00075     //@}
00076 
00077 
00078   private:
00079 
00080     /// @name Histograms
00081     //@{
00082 
00083     Histo1DPtr _h_dN_dNch_05;
00084     Histo1DPtr _h_dN_dNch_10;
00085     Histo1DPtr _h_dN_dNch_13;
00086     //@}
00087 
00088 
00089   };
00090 
00091 
00092 
00093   // The hook for the plugin system
00094   DECLARE_RIVET_PLUGIN(ALICE_2010_S8624100);
00095 
00096 }