[Rivet-svn] rivet: 2 new changesets

Rivet Mercurial rivet at projects.hepforge.org
Thu Jan 11 13:15:01 GMT 2018


details:   https://rivet.hepforge.org/hg/rivet/rev/8f1ee155b697
branches:  release-2-6-x
changeset: 6214:8f1ee155b697
user:      Andy Buckley <andy at insectnation.org>
date:      Thu Jan 11 13:01:03 2018 +0000
description:
Add a mkAxisCode canonical alias for makeAxisCode (following usual naming convention)

details:   https://rivet.hepforge.org/hg/rivet/rev/3a64737d1434
branches:  release-2-6-x
changeset: 6215:3a64737d1434
user:      Andy Buckley <andy at insectnation.org>
date:      Thu Jan 11 13:01:25 2018 +0000
description:
Reinstate old ATLAS two-particle correlations analysis, with types converted to YODA (etc.)

diffs (truncated from 364 to 50 lines):

--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/analyses/pluginATLAS/ATLAS_2012_I1094061.cc	Thu Jan 11 13:01:25 2018 +0000
@@ -0,0 +1,275 @@
+// -*- C++ -*-
+#include "Rivet/Analysis.hh"
+#include "Rivet/Projections/ChargedFinalState.hh"
+
+namespace Rivet {
+
+
+  /// Two-particle correlation functions in pp collisions at 900 GeV and 7 TeV
+  class ATLAS_2012_I1094061 : public Analysis {
+
+
+    /// Container for a pair of foreground and background histos, divided at the end of the analysis
+    struct HistoPair{
+      enum HistoType { FOREGROUND, BACKGROUND };
+
+      HistoPair() : _ana(nullptr)
+      {  }
+
+      void init(int ds, int xaxis, int yaxis, ATLAS_2012_I1094061* ana) {
+        _ana = ana;
+        const string hcode = ana->makeAxisCode(ds, xaxis, yaxis);
+        _h_foreground = ana->bookHisto1D("tmpForeground_" + hcode, ana->refData(ds, xaxis, yaxis));
+        _h_background = ana->bookHisto1D("tmpBackground_" + hcode, ana->refData(ds, xaxis, yaxis));
+        _s_final = ana->bookScatter2D(ds, xaxis, yaxis, true);
+      }
+
+      void fillForeground(double value, double weight) {
+        _h_foreground->fill(value, weight);
+        _h_foreground->fill(-value, weight);
+      }
+
+      void fillBackground(double value, double weight) {
+        _h_background->fill(value, weight);
+        _h_background->fill(-value, weight);
+      }
+
+      void fill(double value, double weight, HistoType type) {
+        if (type == FOREGROUND) {
+          fillForeground(value, weight);
+        } else { // type == BACKGROUND
+          fillBackground(value, weight);
+        }
+      }
+
+      void finalize(double wgtSum, double bgWeight, double avNTracks) {
+        _h_foreground->scaleW(1/wgtSum);
+        _h_background->scaleW(1/bgWeight);


More information about the Rivet-svn mailing list