ATLAS_2010_S8591806.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/RivetAIDA.hh"
00004 #include "Rivet/Projections/ChargedFinalState.hh"
00005 #include "Rivet/Tools/Logging.hh"
00006 
00007 namespace Rivet {
00008 
00009 
00010   /// @brief ATLAS minimum bias analysis at 900 GeV
00011   /// @author Frank Siegert
00012   class ATLAS_2010_S8591806 : public Analysis {
00013   public:
00014 
00015     ATLAS_2010_S8591806()
00016       : Analysis("ATLAS_2010_S8591806"),
00017         _Nevt_after_cuts(0.0)
00018     {
00019       setNeedsCrossSection(false);
00020     }
00021 
00022 
00023     void init() {
00024       ChargedFinalState cfs(-2.5, 2.5, 0.5*GeV);
00025       addProjection(cfs, "CFS");
00026 
00027       _h_dNch_deta = bookHistogram1D(2, 1, 1);
00028       _h_dNch_dpT = bookHistogram1D(3, 1, 1);
00029       _h_dNevt_dNch = bookHistogram1D(4, 1, 1);
00030       _p_meanpT_Nch = bookProfile1D(5, 1, 1);
00031     }
00032 
00033 
00034     void analyze(const Event& event) {
00035       const double weight = event.weight();
00036 
00037       const ChargedFinalState& charged = applyProjection<ChargedFinalState>(event, "CFS");
00038       if (charged.size() < 1) {
00039         vetoEvent;
00040       }
00041       _Nevt_after_cuts += weight;
00042 
00043       _h_dNevt_dNch->fill(charged.size(), weight);
00044       foreach (const Particle& p, charged.particles()) {
00045         double pT = p.momentum().pT()/GeV;
00046         _h_dNch_deta->fill(p.momentum().eta(), weight);
00047         _h_dNch_dpT->fill(pT, weight/pT);
00048         _p_meanpT_Nch->fill(charged.size(), pT, weight);
00049       }
00050     }
00051 
00052 
00053     void finalize() {
00054       double deta = 5.0;
00055       scale(_h_dNch_deta, 1.0/_Nevt_after_cuts);
00056       scale(_h_dNch_dpT, 1.0/_Nevt_after_cuts/TWOPI/deta);
00057       scale(_h_dNevt_dNch, 1.0/_Nevt_after_cuts);
00058     }
00059 
00060 
00061   private:
00062 
00063     AIDA::IHistogram1D* _h_dNch_deta;
00064     AIDA::IHistogram1D* _h_dNch_dpT;
00065     AIDA::IHistogram1D* _h_dNevt_dNch;
00066     AIDA::IProfile1D*   _p_meanpT_Nch;
00067 
00068     double _Nevt_after_cuts;
00069 
00070   };
00071 
00072 
00073 
00074   // This global object acts as a hook for the plugin system
00075   AnalysisBuilder<ATLAS_2010_S8591806> plugin_ATLAS_2010_S8591806;
00076 
00077 }
00078