[Rivet-svn] r3049 - in trunk: data/anainfo data/plotinfo src/Analyses

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Fri Apr 8 09:04:21 BST 2011


Author: fsiegert
Date: Fri Apr  8 09:04:20 2011
New Revision: 3049

Log:
Add simple MC analysis for the total generated cross section.

Added:
   trunk/data/anainfo/MC_XS.info
   trunk/data/plotinfo/MC_XS.plot
   trunk/src/Analyses/MC_XS.cc
Modified:
   trunk/data/anainfo/Makefile.am
   trunk/data/plotinfo/Makefile.am
   trunk/src/Analyses/Makefile.am

Added: trunk/data/anainfo/MC_XS.info
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ trunk/data/anainfo/MC_XS.info	Fri Apr  8 09:04:20 2011	(r3049)
@@ -0,0 +1,11 @@
+Name: MC_XS
+Summary: MC analysis for total cross section
+Status: VALIDATED
+Authors:
+ - Marek Schoenherr <marek.schoenherr at tu-dresden.de>
+RunInfo:
+  "For any process."
+NumEvents: any
+PtCuts: [0]
+Description:
+  Analysis for bookkeeping of the total cross section.

Modified: trunk/data/anainfo/Makefile.am
==============================================================================
--- trunk/data/anainfo/Makefile.am	Thu Apr  7 16:32:00 2011	(r3048)
+++ trunk/data/anainfo/Makefile.am	Fri Apr  8 09:04:20 2011	(r3049)
@@ -101,6 +101,7 @@
   MC_WJETS.info \
   MC_WPOL.info \
   MC_WWJETS.info \
+  MC_XS.info \
   MC_ZJETS.info \
   MC_ZZJETS.info \
   OPAL_1993_S2692198.info \

Added: trunk/data/plotinfo/MC_XS.plot
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ trunk/data/plotinfo/MC_XS.plot	Fri Apr  8 09:04:20 2011	(r3049)
@@ -0,0 +1,9 @@
+# BEGIN PLOT /MC_XS/XS
+Title=Total generated cross section
+XLabel=
+YLabel=$\sigma_\text{total}$ [pb]
+LogY=0
+ShowZero=0
+XMajorTickMarks=20
+XMinorTickMarks=0
+# END PLOT

Modified: trunk/data/plotinfo/Makefile.am
==============================================================================
--- trunk/data/plotinfo/Makefile.am	Thu Apr  7 16:32:00 2011	(r3048)
+++ trunk/data/plotinfo/Makefile.am	Fri Apr  8 09:04:20 2011	(r3049)
@@ -99,6 +99,7 @@
   MC_WJETS.plot \
   MC_WPOL.plot \
   MC_WWJETS.plot \
+  MC_XS.plot \
   MC_ZJETS.plot \
   MC_ZZJETS.plot \
   OPAL_1993_S2692198.plot \

Added: trunk/src/Analyses/MC_XS.cc
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ trunk/src/Analyses/MC_XS.cc	Fri Apr  8 09:04:20 2011	(r3049)
@@ -0,0 +1,80 @@
+// -*- C++ -*-
+#include "Rivet/Analysis.hh"
+#include "Rivet/RivetAIDA.hh"
+#include "Rivet/Tools/Logging.hh"
+#include "HepMC/HepMCDefs.h"
+
+namespace Rivet {
+
+
+  /// @brief Analysis for the generated cross section
+  class MC_XS : public Analysis {
+  public:
+
+    /// @name Constructors etc.
+    //@{
+
+    /// Constructor
+    MC_XS()
+      : Analysis("MC_XS")
+    {
+      setNeedsCrossSection(true);
+    }
+
+    //@}
+
+
+  public:
+
+    /// @name Analysis methods
+    //@{
+
+    /// Book histograms and initialise projections before the run
+    void init() {
+      _h_XS = bookDataPointSet("XS", 1, 0.0, 1.0);
+      _mc_xs=_mc_error=0.;
+    }
+
+
+    /// Perform the per-event analysis
+    void analyze(const Event& event) {
+#ifdef HEPMC_HAS_CROSS_SECTION
+      _mc_xs    = event.genEvent().cross_section()->cross_section();
+      _mc_error = event.genEvent().cross_section()->cross_section_error();
+#endif
+    }
+
+
+    /// Normalise histograms etc., after the run
+    void finalize() {
+#ifndef HEPMC_HAS_CROSS_SECTION
+      _mc_xs=crossSection();
+      _mc_error=0.0;
+#endif
+      std::vector<double> xs,err;
+      xs.push_back(_mc_xs);
+      err.push_back(_mc_error);
+      _h_XS->setCoordinate(1,xs,err);
+    }
+
+    //@}
+
+
+  private:
+
+    /// @name Histograms
+    //@{
+    AIDA::IDataPointSet * _h_XS;
+    double _mc_xs, _mc_error;
+    //@}
+
+
+  };
+
+
+
+  // This global object acts as a hook for the plugin system
+  AnalysisBuilder<MC_XS> plugin_MC_XS;
+
+
+}

Modified: trunk/src/Analyses/Makefile.am
==============================================================================
--- trunk/src/Analyses/Makefile.am	Thu Apr  7 16:32:00 2011	(r3048)
+++ trunk/src/Analyses/Makefile.am	Fri Apr  8 09:04:20 2011	(r3049)
@@ -243,5 +243,6 @@
 RivetMCAnalyses_la_SOURCES += \
     MC_DIJET.cc \
     MC_PHOTONJETUE.cc \
-    MC_TTBAR.cc
+    MC_TTBAR.cc \
+    MC_XS.cc
 endif


More information about the Rivet-svn mailing list