ALICE_2010_S8624100.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/RivetAIDA.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       /// @todo Set whether your finalize method needs the generator cross section
00021       setNeedsCrossSection(false);
00022       setBeams(PROTON, PROTON);
00023     }
00024 
00025     //@}
00026 
00027 
00028   public:
00029 
00030     /// @name Analysis methods
00031     //@{
00032 
00033     /// Book histograms and initialise projections before the run
00034     void init() {
00035 
00036       ChargedFinalState cfs05(-0.5, 0.5);
00037       ChargedFinalState cfs10(-1.0, 1.0);
00038       ChargedFinalState cfs13(-1.3, 1.3);
00039       addProjection(cfs05, "CFS05");
00040       addProjection(cfs10, "CFS10");
00041       addProjection(cfs13, "CFS13");
00042 
00043       if (fuzzyEquals(sqrtS()/GeV, 900, 1E-3)) {
00044         _h_dN_dNch_05    = bookHistogram1D(11, 1, 1);
00045         _h_dN_dNch_10    = bookHistogram1D(12, 1, 1);
00046         _h_dN_dNch_13    = bookHistogram1D(13, 1, 1);
00047       } else if (fuzzyEquals(sqrtS()/GeV, 2360, 1E-3)) {
00048         _h_dN_dNch_05    = bookHistogram1D(17, 1, 1);
00049         _h_dN_dNch_10    = bookHistogram1D(18, 1, 1);
00050         _h_dN_dNch_13    = bookHistogram1D(19, 1, 1);
00051       }
00052 
00053     }
00054 
00055 
00056     /// Perform the per-event analysis
00057     void analyze(const Event& event) {
00058       const double weight = event.weight();
00059 
00060       const ChargedFinalState& charged_05 = applyProjection<ChargedFinalState>(event, "CFS05");
00061       const ChargedFinalState& charged_10 = applyProjection<ChargedFinalState>(event, "CFS10");
00062       const ChargedFinalState& charged_13 = applyProjection<ChargedFinalState>(event, "CFS13");
00063       
00064       _h_dN_dNch_05->fill(charged_05.size(), weight);
00065       _h_dN_dNch_10->fill(charged_10.size(), weight);
00066       _h_dN_dNch_13->fill(charged_13.size(), weight);
00067     }
00068 
00069 
00070     /// Normalise histograms etc., after the run
00071     void finalize() {
00072 
00073       normalize(_h_dN_dNch_05);
00074       normalize(_h_dN_dNch_10);
00075       normalize(_h_dN_dNch_13);
00076 
00077     }
00078 
00079     //@}
00080 
00081 
00082   private:
00083 
00084     /// @name Histograms
00085     //@{
00086 
00087     AIDA::IHistogram1D *_h_dN_dNch_05;
00088     AIDA::IHistogram1D *_h_dN_dNch_10;
00089     AIDA::IHistogram1D *_h_dN_dNch_13;
00090     //@}
00091 
00092 
00093   };
00094 
00095 
00096 
00097   // This global object acts as a hook for the plugin system
00098   AnalysisBuilder<ALICE_2010_S8624100> plugin_ALICE_2010_S8624100;
00099 
00100 
00101 }