[Rivet-svn] r3791 - trunk/src/Analyses

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Tue Jul 3 17:58:46 BST 2012


Author: hoeth
Date: Tue Jul  3 17:58:46 2012
New Revision: 3791

Log:
test to avoid YODA::LowStatsError

Modified:
   trunk/src/Analyses/ATLAS_2010_S8894728.cc

Modified: trunk/src/Analyses/ATLAS_2010_S8894728.cc
==============================================================================
--- trunk/src/Analyses/ATLAS_2010_S8894728.cc	Tue Jul  3 14:46:02 2012	(r3790)
+++ trunk/src/Analyses/ATLAS_2010_S8894728.cc	Tue Jul  3 17:58:46 2012	(r3791)
@@ -193,19 +193,23 @@
       assert(ptcut.size() == 4);
       for (size_t i = 0; i < nbins; ++i) {
         // First Nch
-        const double binmean_num = hist_num_dphi_500.bin(i).xMean();
-        const double binvalue_num = hist_num_dphi_500.bin(i).area()/hist_num_dphi_500.bin(i).width()/10.0;
-        if (pTlead/GeV >= ptcut[0]) _hist_N_vs_dPhi_1_500->fill(binmean_num, binvalue_num, weight);
-        if (pTlead/GeV >= ptcut[1]) _hist_N_vs_dPhi_2_500->fill(binmean_num, binvalue_num, weight);
-        if (pTlead/GeV >= ptcut[2]) _hist_N_vs_dPhi_3_500->fill(binmean_num, binvalue_num, weight);
-        if (pTlead/GeV >= ptcut[3]) _hist_N_vs_dPhi_5_500->fill(binmean_num, binvalue_num, weight);
+        if (hist_num_dphi_500.bin(i).numEntries() > 0) {
+          const double binmean_num = hist_num_dphi_500.bin(i).xMean();
+          const double binvalue_num = hist_num_dphi_500.bin(i).area()/hist_num_dphi_500.bin(i).width()/10.0;
+          if (pTlead/GeV >= ptcut[0]) _hist_N_vs_dPhi_1_500->fill(binmean_num, binvalue_num, weight);
+          if (pTlead/GeV >= ptcut[1]) _hist_N_vs_dPhi_2_500->fill(binmean_num, binvalue_num, weight);
+          if (pTlead/GeV >= ptcut[2]) _hist_N_vs_dPhi_3_500->fill(binmean_num, binvalue_num, weight);
+          if (pTlead/GeV >= ptcut[3]) _hist_N_vs_dPhi_5_500->fill(binmean_num, binvalue_num, weight);
+        }
         // Then pT
-        const double binmean_pt = hist_pt_dphi_500.bin(i).xMean();
-        const double binvalue_pt = hist_pt_dphi_500.bin(i).area()/hist_pt_dphi_500.bin(i).width()/10.0;
-        if (pTlead/GeV >= ptcut[0]) _hist_pT_vs_dPhi_1_500->fill(binmean_pt, binvalue_pt, weight);
-        if (pTlead/GeV >= ptcut[1]) _hist_pT_vs_dPhi_2_500->fill(binmean_pt, binvalue_pt, weight);
-        if (pTlead/GeV >= ptcut[2]) _hist_pT_vs_dPhi_3_500->fill(binmean_pt, binvalue_pt, weight);
-        if (pTlead/GeV >= ptcut[3]) _hist_pT_vs_dPhi_5_500->fill(binmean_pt, binvalue_pt, weight);
+        if (hist_pt_dphi_500.bin(i).numEntries() > 0) {
+          const double binmean_pt = hist_pt_dphi_500.bin(i).xMean();
+          const double binvalue_pt = hist_pt_dphi_500.bin(i).area()/hist_pt_dphi_500.bin(i).width()/10.0;
+          if (pTlead/GeV >= ptcut[0]) _hist_pT_vs_dPhi_1_500->fill(binmean_pt, binvalue_pt, weight);
+          if (pTlead/GeV >= ptcut[1]) _hist_pT_vs_dPhi_2_500->fill(binmean_pt, binvalue_pt, weight);
+          if (pTlead/GeV >= ptcut[2]) _hist_pT_vs_dPhi_3_500->fill(binmean_pt, binvalue_pt, weight);
+          if (pTlead/GeV >= ptcut[3]) _hist_pT_vs_dPhi_5_500->fill(binmean_pt, binvalue_pt, weight);
+        }
       }
 
 


More information about the Rivet-svn mailing list