|
[Rivet-svn] r3590 - trunk/src/Analysesblackhole at projects.hepforge.org blackhole at projects.hepforge.orgWed Feb 29 17:31:51 GMT 2012
Author: richardn Date: Wed Feb 29 17:31:51 2012 New Revision: 3590 Log: fixed normalisation and plotted full eta range. Did anyone look at these plots as part of their validation? Modified: trunk/src/Analyses/CMS_2011_S9215166.cc trunk/src/Analyses/CMS_QCD_10_024.cc Modified: trunk/src/Analyses/CMS_2011_S9215166.cc ============================================================================== --- trunk/src/Analyses/CMS_2011_S9215166.cc Wed Feb 29 13:47:27 2012 (r3589) +++ trunk/src/Analyses/CMS_2011_S9215166.cc Wed Feb 29 17:31:51 2012 (r3590) @@ -14,7 +14,7 @@ public: /// Constructor - CMS_2011_S9215166() : Analysis("CMS_2011_S9215166") { } + CMS_2011_S9215166() : Analysis("CMS_2011_S9215166"), _weightMB(0.), _weightDiJet(0.) { } void init() { @@ -64,6 +64,7 @@ // MINIMUM BIAS EVENTS + _weightMB += weight; foreach (const Particle& p, fsv.particles()) { _hist_mb->fill(fabs(p.momentum().eta()), weight*p.momentum().E()/GeV); } @@ -81,6 +82,7 @@ // Back to back condition of the jets const double diffphi = deltaPhi(jets[1].momentum().phi(), jets[0].momentum().phi()); if (diffphi-PI < 1.0) { + _weightDiJet += weight; foreach (const Particle& p, fsv.particles()) { _hist_dijet->fill(fabs(p.momentum().eta()), weight*p.momentum().E()/GeV); } @@ -92,14 +94,15 @@ void finalize() { - normalize(_hist_mb, 0.5); - normalize(_hist_dijet, 0.5); + scale(_hist_mb , 0.5/_weightMB ); + scale(_hist_dijet, 0.5/_weightDiJet); } private: AIDA::IHistogram1D *_hist_mb, *_hist_dijet; + double _weightMB,_weightDiJet; }; Modified: trunk/src/Analyses/CMS_QCD_10_024.cc ============================================================================== --- trunk/src/Analyses/CMS_QCD_10_024.cc Wed Feb 29 13:47:27 2012 (r3589) +++ trunk/src/Analyses/CMS_QCD_10_024.cc Wed Feb 29 17:31:51 2012 (r3590) @@ -15,7 +15,9 @@ //@{ /// Constructor - CMS_QCD_10_024() : Analysis("CMS_QCD_10_024") { } + CMS_QCD_10_024() : Analysis("CMS_QCD_10_024"), + _weight_pt05_eta08(0.), _weight_pt10_eta08(0.), + _weight_pt05_eta24(0.), _weight_pt10_eta24(0.) { } void init() { @@ -42,27 +44,29 @@ const ChargedFinalState& cfs_24_10 = applyProjection<ChargedFinalState>(event, "CFS_24_10"); // Plot distributions - foreach (const Particle& p, cfs_08_05.particles()) { - _hist_dNch_deta_pt05_eta08->fill(p.momentum().pseudorapidity(), weight); - } - foreach (const Particle& p, cfs_08_10.particles()) { - _hist_dNch_deta_pt10_eta08->fill(p.momentum().pseudorapidity(), weight); - } + if(!cfs_08_05.particles().empty()) _weight_pt05_eta08 += weight; + if(!cfs_24_05.particles().empty()) _weight_pt05_eta24 += weight; foreach (const Particle& p, cfs_24_05.particles()) { _hist_dNch_deta_pt05_eta24->fill(p.momentum().pseudorapidity(), weight); + if(!cfs_08_05.particles().empty()) + _hist_dNch_deta_pt05_eta08->fill(p.momentum().pseudorapidity(), weight); } + if(!cfs_08_10.particles().empty()) _weight_pt10_eta08 += weight; + if(!cfs_24_10.particles().empty()) _weight_pt10_eta24 += weight; foreach (const Particle& p, cfs_24_10.particles()) { _hist_dNch_deta_pt10_eta24->fill(p.momentum().pseudorapidity(), weight); + if(!cfs_08_10.particles().empty()) + _hist_dNch_deta_pt10_eta08->fill(p.momentum().pseudorapidity(), weight); } } /// Normalise histograms etc., after the run void finalize() { - normalize(_hist_dNch_deta_pt05_eta08); - normalize(_hist_dNch_deta_pt10_eta08); - normalize(_hist_dNch_deta_pt05_eta24); - normalize(_hist_dNch_deta_pt10_eta24); + scale(_hist_dNch_deta_pt05_eta08,1./_weight_pt05_eta08); + scale(_hist_dNch_deta_pt10_eta08,1./_weight_pt10_eta08); + scale(_hist_dNch_deta_pt05_eta24,1./_weight_pt05_eta24); + scale(_hist_dNch_deta_pt10_eta24,1./_weight_pt10_eta24); } @@ -72,7 +76,7 @@ AIDA::IHistogram1D *_hist_dNch_deta_pt10_eta08; AIDA::IHistogram1D *_hist_dNch_deta_pt05_eta24; AIDA::IHistogram1D *_hist_dNch_deta_pt10_eta24; - + double _weight_pt05_eta08,_weight_pt10_eta08,_weight_pt05_eta24,_weight_pt10_eta24; };
More information about the Rivet-svn mailing list |