CMS_QCD_10_024.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 #include "Rivet/Particle.hh" 00007 00008 namespace Rivet { 00009 00010 00011 class CMS_QCD_10_024 : public Analysis { 00012 public: 00013 00014 /// @name Constructors etc. 00015 //@{ 00016 00017 /// Constructor 00018 CMS_QCD_10_024() : Analysis("CMS_QCD_10_024"), 00019 _weight_pt05_eta08(0.), _weight_pt10_eta08(0.), 00020 _weight_pt05_eta24(0.), _weight_pt10_eta24(0.) { } 00021 00022 00023 void init() { 00024 addProjection(ChargedFinalState(-0.8, 0.8, 0.5*GeV), "CFS_08_05"); 00025 addProjection(ChargedFinalState(-0.8, 0.8, 1.0*GeV), "CFS_08_10"); 00026 addProjection(ChargedFinalState(-2.4, 2.4, 0.5*GeV), "CFS_24_05"); 00027 addProjection(ChargedFinalState(-2.4, 2.4, 1.0*GeV), "CFS_24_10"); 00028 00029 size_t offset = 0; 00030 if (fuzzyEquals(sqrtS()/GeV, 7000, 1E-3)) offset = 0; 00031 if (fuzzyEquals(sqrtS()/GeV, 900, 1E-3)) offset = 4; 00032 _hist_dNch_deta_pt05_eta08 = bookHisto1D(1+offset, 1, 1); 00033 _hist_dNch_deta_pt10_eta08 = bookHisto1D(2+offset, 1, 1); 00034 _hist_dNch_deta_pt05_eta24 = bookHisto1D(3+offset, 1, 1); 00035 _hist_dNch_deta_pt10_eta24 = bookHisto1D(4+offset, 1, 1); 00036 } 00037 00038 00039 void analyze(const Event& event) { 00040 const double weight = event.weight(); 00041 const ChargedFinalState& cfs_08_05 = applyProjection<ChargedFinalState>(event, "CFS_08_05"); 00042 const ChargedFinalState& cfs_08_10 = applyProjection<ChargedFinalState>(event, "CFS_08_10"); 00043 const ChargedFinalState& cfs_24_05 = applyProjection<ChargedFinalState>(event, "CFS_24_05"); 00044 const ChargedFinalState& cfs_24_10 = applyProjection<ChargedFinalState>(event, "CFS_24_10"); 00045 00046 // Plot distributions 00047 if(!cfs_08_05.particles().empty()) _weight_pt05_eta08 += weight; 00048 if(!cfs_24_05.particles().empty()) _weight_pt05_eta24 += weight; 00049 foreach (const Particle& p, cfs_24_05.particles()) { 00050 _hist_dNch_deta_pt05_eta24->fill(p.momentum().pseudorapidity(), weight); 00051 if(!cfs_08_05.particles().empty()) 00052 _hist_dNch_deta_pt05_eta08->fill(p.momentum().pseudorapidity(), weight); 00053 } 00054 if(!cfs_08_10.particles().empty()) _weight_pt10_eta08 += weight; 00055 if(!cfs_24_10.particles().empty()) _weight_pt10_eta24 += weight; 00056 foreach (const Particle& p, cfs_24_10.particles()) { 00057 _hist_dNch_deta_pt10_eta24->fill(p.momentum().pseudorapidity(), weight); 00058 if(!cfs_08_10.particles().empty()) 00059 _hist_dNch_deta_pt10_eta08->fill(p.momentum().pseudorapidity(), weight); 00060 } 00061 } 00062 00063 00064 /// Normalise histograms etc., after the run 00065 void finalize() { 00066 scale(_hist_dNch_deta_pt05_eta08,1./_weight_pt05_eta08); 00067 scale(_hist_dNch_deta_pt10_eta08,1./_weight_pt10_eta08); 00068 scale(_hist_dNch_deta_pt05_eta24,1./_weight_pt05_eta24); 00069 scale(_hist_dNch_deta_pt10_eta24,1./_weight_pt10_eta24); 00070 } 00071 00072 00073 private: 00074 00075 Histo1DPtr _hist_dNch_deta_pt05_eta08; 00076 Histo1DPtr _hist_dNch_deta_pt10_eta08; 00077 Histo1DPtr _hist_dNch_deta_pt05_eta24; 00078 Histo1DPtr _hist_dNch_deta_pt10_eta24; 00079 double _weight_pt05_eta08,_weight_pt10_eta08,_weight_pt05_eta24,_weight_pt10_eta24; 00080 }; 00081 00082 00083 // Hook for the plugin system 00084 DECLARE_RIVET_PLUGIN(CMS_QCD_10_024); 00085 00086 } Generated on Fri Dec 21 2012 15:03:40 for The Rivet MC analysis system by ![]() |