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