ATLAS_2010_S8591806.cc
Go to the documentation of this file.00001
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
00011
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
00020
00021 void init() {
00022 ChargedFinalState cfs(-2.5, 2.5, 0.5*GeV);
00023 addProjection(cfs, "CFS");
00024
00025 _h_dNch_deta = bookHistogram1D(2, 1, 1);
00026 _h_dNch_dpT = bookHistogram1D(3, 1, 1);
00027 _h_dNevt_dNch = bookHistogram1D(4, 1, 1);
00028 _p_meanpT_Nch = bookProfile1D(5, 1, 1);
00029 }
00030
00031
00032 void analyze(const Event& event) {
00033 const double weight = event.weight();
00034
00035 const ChargedFinalState& charged = applyProjection<ChargedFinalState>(event, "CFS");
00036 if (charged.size() < 1) {
00037 vetoEvent;
00038 }
00039 _Nevt_after_cuts += weight;
00040
00041 _h_dNevt_dNch->fill(charged.size(), weight);
00042 foreach (const Particle& p, charged.particles()) {
00043 double pT = p.momentum().pT()/GeV;
00044 _h_dNch_deta->fill(p.momentum().eta(), weight);
00045 _h_dNch_dpT->fill(pT, weight/pT);
00046 _p_meanpT_Nch->fill(charged.size(), pT, weight);
00047 }
00048 }
00049
00050
00051 void finalize() {
00052 double deta = 5.0;
00053 scale(_h_dNch_deta, 1.0/_Nevt_after_cuts);
00054 scale(_h_dNch_dpT, 1.0/_Nevt_after_cuts/TWOPI/deta);
00055 scale(_h_dNevt_dNch, 1.0/_Nevt_after_cuts);
00056 }
00057
00058
00059 private:
00060
00061 AIDA::IHistogram1D* _h_dNch_deta;
00062 AIDA::IHistogram1D* _h_dNch_dpT;
00063 AIDA::IHistogram1D* _h_dNevt_dNch;
00064 AIDA::IProfile1D* _p_meanpT_Nch;
00065
00066 double _Nevt_after_cuts;
00067
00068 };
00069
00070
00071
00072
00073 DECLARE_RIVET_PLUGIN(ATLAS_2010_S8591806);
00074
00075 }