// -*- C++ -*- #include "Rivet/Analysis.hh" #include "Rivet/RivetAIDA.hh" #include "Rivet/Tools/Logging.hh" #include "Rivet/Projections/ChargedFinalState.hh" namespace Rivet { class ALICE_2013_DRAFT_Mult_7 : public Analysis { public: /// @name Constructors etc. //@{ /// Constructor ALICE_2013_DRAFT_Mult_7() : Analysis("ALICE_2013_DRAFT_Mult_7") { } //@} public: /// @name Analysis methods //@{ /// Book histograms and initialise projections before the run void init() { ChargedFinalState cfs15(-0.8, 0.8, 0.15); addProjection(cfs15, "CFS15"); ChargedFinalState cfs5(-0.8, 0.8, 0.5); addProjection(cfs5, "CFS5"); ChargedFinalState cfs10(-0.8, 0.8, 1.0); addProjection(cfs10, "CFS10"); _h_dN_dNch_15 = bookHistogram1D("d01-x01-y01"); _h_dN_dNch_5 = bookHistogram1D("d02-x01-y01"); _h_dN_dNch_10 = bookHistogram1D("d03-x01-y01"); /* if (fuzzyEquals(sqrtS()/GeV, 7000, 1E-3)) { _h_dN_dNch_10 = bookHistogram1D(12, 1, 1); } else if (fuzzyEquals(sqrtS()/GeV, 2360, 1E-3)) { _h_dN_dNch_10 = bookHistogram1D(18, 1, 1); } */ } /// Perform the per-event analysis void analyze(const Event& event) { const double weight = event.weight(); const ChargedFinalState& charged15 = applyProjection(event, "CFS15"); const ChargedFinalState& charged5 = applyProjection(event, "CFS5"); const ChargedFinalState& charged10 = applyProjection(event, "CFS10"); if (charged15.size() > 0 ) { _h_dN_dNch_15->fill(charged15.size(), weight); } if (charged5.size() > 0) { _h_dN_dNch_5->fill(charged5.size(), weight); } if (charged10.size() > 0) { _h_dN_dNch_10->fill(charged10.size(), weight); } } /// Normalise histograms etc., after the run void finalize() { normalize(_h_dN_dNch_15); normalize(_h_dN_dNch_5); normalize(_h_dN_dNch_10); } //@} private: /// @name Histograms //@{ AIDA::IHistogram1D *_h_dN_dNch_15; AIDA::IHistogram1D *_h_dN_dNch_5; AIDA::IHistogram1D *_h_dN_dNch_10; //@} }; // The hook for the plugin system DECLARE_RIVET_PLUGIN(ALICE_2013_DRAFT_Mult_7); }