|
[Rivet-svn] r3301 - in trunk: data/anainfo data/plotinfo src/Analysesblackhole at projects.hepforge.org blackhole at projects.hepforge.orgSun Aug 21 12:26:16 BST 2011
Author: fsiegert Date: Sun Aug 21 12:26:16 2011 New Revision: 3301 Log: Add a couple more bookkeeping numbers to MC_XS. Modified: trunk/data/anainfo/MC_XS.info trunk/data/plotinfo/MC_XS.plot trunk/src/Analyses/MC_XS.cc Modified: trunk/data/anainfo/MC_XS.info ============================================================================== --- trunk/data/anainfo/MC_XS.info Sat Aug 20 12:21:01 2011 (r3300) +++ trunk/data/anainfo/MC_XS.info Sun Aug 21 12:26:16 2011 (r3301) @@ -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: trunk/data/plotinfo/MC_XS.plot ============================================================================== --- trunk/data/plotinfo/MC_XS.plot Sat Aug 20 12:21:01 2011 (r3300) +++ trunk/data/plotinfo/MC_XS.plot Sun Aug 21 12:26:16 2011 (r3301) @@ -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: trunk/src/Analyses/MC_XS.cc ============================================================================== --- trunk/src/Analyses/MC_XS.cc Sat Aug 20 12:21:01 2011 (r3300) +++ trunk/src/Analyses/MC_XS.cc Sun Aug 21 12:26:16 2011 (r3301) @@ -32,12 +32,18 @@ /// Book histograms and initialise projections before the run void init() { _h_XS = bookDataPointSet("XS", 1, 0.0, 1.0); + _h_N = bookHistogram1D("N", 1, 0.0, 1.0); + _h_pmXS = bookHistogram1D("pmXS", 2, -1.0, 1.0); + _h_pmN = bookHistogram1D("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; @@ -65,6 +72,9 @@ /// @name Histograms //@{ AIDA::IDataPointSet * _h_XS; + AIDA::IHistogram1D * _h_N; + AIDA::IHistogram1D * _h_pmXS; + AIDA::IHistogram1D * _h_pmN; double _mc_xs, _mc_error; //@}
More information about the Rivet-svn mailing list |