[Rivet-svn] rivet: Added --preload-file in the rivet script to test reading ...

Rivet Mercurial rivet at projects.hepforge.org
Wed Nov 1 07:15:01 GMT 2017


details:   https://rivet.hepforge.org/hg/rivet/rev/8c35ba3986f3
branches:  
changeset: 6124:8c35ba3986f3
user:      Leif Lönnblad <leif.lonnblad at thep.lu.se>
date:      Mon Oct 30 08:16:22 2017 +0100
description:
Added --preload-file in the rivet script to test reading in of a pre-existing yoda file to be able to produce eg. ratios of plots for different energies/beams using AnalysisHandler::readData. Introduced MC_REENTRANT to test.

diffs (truncated from 173 to 50 lines):

--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/analyses/pluginMC/MC_REENTRANT.cc	Mon Oct 30 08:16:22 2017 +0100
@@ -0,0 +1,87 @@
+// -*- C++ -*-
+#include "Rivet/Analysis.hh"
+#include "Rivet/Projections/FinalState.hh"
+#include "Rivet/Projections/ChargedFinalState.hh"
+
+namespace Rivet {
+
+
+  /// Generic analysis looking att pp pseudorepidity distributions at
+  /// two collision energies. It usess the possibility to read in a
+  /// pre-exixsting yoda file, and if histograms for both energies are
+  /// filled when finalize() is called, a ratio plot is produced.
+  class MC_REENTRANT : public Analysis {
+  public:
+
+    /// Constructor
+    DEFAULT_RIVET_ANALYSIS_CTOR(MC_REENTRANT);
+
+
+    /// @name Analysis methods
+    //@{
+
+    /// Book histograms and initialise projections before the run
+    void init() {
+
+      // Projections
+      const FinalState fs(Cuts::abseta < 5 && Cuts::pT > 500*MeV);
+      declare(fs, "FS");
+      declare(ChargedFinalState(fs), "CFS");
+
+      // Histograms
+      /// @todo Choose E/pT ranged based on input energies... can't do anything about kin. cuts, though
+      _histEta70    = bookHisto1D("Eta70", 50, -5, 5);
+      _histEta09    = bookHisto1D("Eta09", 50, -5, 5);
+      _histEtaR     = bookScatter2D("EtaR", 50, -5, 5);
+      fill70 = fill09 = false;
+    }
+
+
+    /// Perform the per-event analysis
+    void analyze(const Event& event) {
+      const double weight = event.weight();
+
+      if (fuzzyEquals(sqrtS()/GeV, 900))
+        fill09 = true;
+      else if (fuzzyEquals(sqrtS()/GeV, 7000))
+        fill70 = true;


More information about the Rivet-svn mailing list