rivet is hosted by Hepforge, IPPP Durham
ALICE_2010_S8706239.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_S8706239 : public Analysis {
00011   public:
00012 
00013     /// @name Constructors etc.
00014     //@{
00015 
00016     /// Constructor
00017     ALICE_2010_S8706239()
00018       : Analysis("ALICE_2010_S8706239"),
00019         _Nevt_after_cuts(0.0)
00020     {    }
00021 
00022     //@}
00023 
00024 
00025   public:
00026 
00027     /// @name Analysis methods
00028     //@{
00029 
00030     /// Book histograms and initialise projections before the run
00031     void init() {
00032 
00033       ChargedFinalState cfs(-0.8, 0.8, 0.15);
00034       addProjection(cfs, "CFS");
00035 
00036       _h_pT = bookHisto1D(4, 1, 1);
00037 
00038       _h_pT_Nch_015 = bookProfile1D(11, 1, 1);
00039       _h_pT_Nch_05  = bookProfile1D(12, 1, 1);
00040 
00041     }
00042 
00043 
00044     /// Perform the per-event analysis
00045     void analyze(const Event& event) {
00046       const double weight = event.weight();
00047 
00048       const ChargedFinalState& charged = applyProjection<ChargedFinalState>(event, "CFS");
00049 
00050       _Nevt_after_cuts += weight;
00051 
00052       // Get number of particles that fulfill certain pT requirements
00053       int Nch_015 = 0;
00054       int Nch_05  = 0;
00055       foreach (const Particle& p, charged.particles()) {
00056         double pT = p.momentum().pT()/GeV;
00057         if (pT < 4.0) Nch_015++;
00058         if (pT > 0.5  && pT < 4.0) Nch_05++;
00059       }
00060 
00061       // Now we can fill histograms
00062       foreach (const Particle& p, charged.particles()) {
00063         double pT = p.momentum().pT()/GeV;
00064         if (pT < 4.0) _h_pT_Nch_015 ->fill(Nch_015, pT, weight);
00065         if (pT > 0.5  && pT < 4.0) _h_pT_Nch_05  ->fill(Nch_05,  pT, weight);
00066 
00067       // To get the Yield, fill appropriate weight 1/(2PI * pT * d eta)
00068         _h_pT->fill(pT, weight /(TWOPI*pT*1.6) );
00069       }
00070 
00071     }
00072 
00073 
00074     /// Normalise histograms etc., after the run
00075     void finalize() {
00076       scale(_h_pT, 1.0/_Nevt_after_cuts);
00077     }
00078 
00079     //@}
00080 
00081 
00082   private:
00083 
00084     /// @name Histograms
00085     //@{
00086 
00087     Histo1DPtr _h_pT;
00088 
00089     Profile1DPtr _h_pT_Nch_015 ;
00090     Profile1DPtr _h_pT_Nch_05  ;
00091 
00092     double _Nevt_after_cuts;
00093     //@}
00094 
00095 
00096   };
00097 
00098 
00099 
00100   // The hook for the plugin system
00101   DECLARE_RIVET_PLUGIN(ALICE_2010_S8706239);
00102 
00103 }