[Rivet-svn] r3305 - in branches/2011-07-aida2yoda: data/anainfo data/plotinfo src/Analyses

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Mon Aug 22 12:02:28 BST 2011


Author: hoeth
Date: Mon Aug 22 12:02:28 2011
New Revision: 3305

Log:
merge r3301 from trunk

Modified:
   branches/2011-07-aida2yoda/data/anainfo/MC_XS.info
   branches/2011-07-aida2yoda/data/plotinfo/MC_XS.plot
   branches/2011-07-aida2yoda/src/Analyses/MC_XS.cc

Modified: branches/2011-07-aida2yoda/data/anainfo/MC_XS.info
==============================================================================
--- branches/2011-07-aida2yoda/data/anainfo/MC_XS.info	Mon Aug 22 11:58:29 2011	(r3304)
+++ branches/2011-07-aida2yoda/data/anainfo/MC_XS.info	Mon Aug 22 12:02:28 2011	(r3305)
@@ -8,4 +8,5 @@
 NumEvents: any
 PtCuts: [0]
 Description:
-  Analysis for bookkeeping of the total cross section.
+  Analysis for bookkeeping of the total cross section, number of generated 
+  events and the ratio of events with positive and negeative weights.

Modified: branches/2011-07-aida2yoda/data/plotinfo/MC_XS.plot
==============================================================================
--- branches/2011-07-aida2yoda/data/plotinfo/MC_XS.plot	Mon Aug 22 11:58:29 2011	(r3304)
+++ branches/2011-07-aida2yoda/data/plotinfo/MC_XS.plot	Mon Aug 22 12:02:28 2011	(r3305)
@@ -7,3 +7,36 @@
 XMajorTickMarks=20
 XMinorTickMarks=0
 # END PLOT
+
+# BEGIN PLOT /MC_XS/N
+Title=Number of generated events
+XLabel=
+YLabel=$N$
+LogY=0
+XMajorTickMarks=20
+XMinorTickMarks=0
+# END PLOT
+
+# BEGIN PLOT /MC_XS/pmXS
+Title=Fraction of positive and negative weighted events
+XLabel=$\text{sgn}(w)$
+YLabel=$\text{d}\sigma/\text{d sgn}(w)$ [pb]
+LogY=0
+ShowZero=0
+XMajorTickMarks=20
+XMinorTickMarks=0
+XMin=-1
+XMax=1
+# END PLOT
+
+# BEGIN PLOT /MC_XS/pmN
+Title=Number of positive and negative weighted events
+XLabel=$\pm$
+YLabel=$N_\pm$
+LogY=0
+ShowZero=0
+XMajorTickMarks=20
+XMinorTickMarks=0
+XMin=-1
+XMax=1
+# END PLOT

Modified: branches/2011-07-aida2yoda/src/Analyses/MC_XS.cc
==============================================================================
--- branches/2011-07-aida2yoda/src/Analyses/MC_XS.cc	Mon Aug 22 11:58:29 2011	(r3304)
+++ branches/2011-07-aida2yoda/src/Analyses/MC_XS.cc	Mon Aug 22 12:02:28 2011	(r3305)
@@ -31,13 +31,19 @@
 
     /// Book histograms and initialise projections before the run
     void init() {
-      _h_XS = bookScatter2D("XS", 1, 0.0, 1.0);
-      _mc_xs=_mc_error=0.;
+      _h_XS   = bookScatter2D("XS", 1, 0.0, 1.0);
+      _h_N    = bookHisto1D("N", 1, 0.0, 1.0);
+      _h_pmXS = bookHisto1D("pmXS", 2, -1.0, 1.0);
+      _h_pmN  = bookHisto1D("pmN", 2, -1.0, 1.0);
+      _mc_xs = _mc_error = 0.;
     }
 
 
     /// Perform the per-event analysis
     void analyze(const Event& event) {
+      _h_N->fill(0.5,1.);
+      _h_pmXS->fill(0.5*(event.weight()>0?1.:-1),abs(event.weight()));
+      _h_pmN->fill(0.5*(event.weight()>0?1.:-1),1.);
 #ifdef HEPMC_HAS_CROSS_SECTION
       _mc_xs    = event.genEvent().cross_section()->cross_section();
       _mc_error = event.genEvent().cross_section()->cross_section_error();
@@ -47,6 +53,7 @@
 
     /// Normalise histograms etc., after the run
     void finalize() {
+      scale(_h_pmXS, crossSection()/sumOfWeights());
 #ifndef HEPMC_HAS_CROSS_SECTION
       _mc_xs=crossSection();
       _mc_error=0.0;
@@ -62,7 +69,10 @@
 
     /// @name Histograms
     //@{
-    Scatter2DPtr  _h_XS;
+    Scatter2DPtr _h_XS;
+    Histo1DPtr _h_N;
+    Histo1DPtr _h_pmXS;
+    Histo1DPtr _h_pmN;
     double _mc_xs, _mc_error;
     //@}
 


More information about the Rivet-svn mailing list