[Rivet-svn] rivet: Avoid #define in analyses

Rivet Mercurial rivet at projects.hepforge.org
Wed Jun 21 17:15:01 BST 2017


details:   https://rivet.hepforge.org/hg/rivet/rev/6dd2e14ca2e9
branches:  
changeset: 5863:6dd2e14ca2e9
user:      David Grellscheid <david.grellscheid at durham.ac.uk>
date:      Wed Jun 21 18:10:04 2017 +0200
description:
Avoid #define in analyses

diffs (truncated from 205 to 50 lines):

--- a/Analyses/pluginATLAS/ATLAS_2012_I1203852.cc	Wed Jun 21 14:15:59 2017 +0100
+++ b/Analyses/pluginATLAS/ATLAS_2012_I1203852.cc	Wed Jun 21 18:10:04 2017 +0200
@@ -12,8 +12,6 @@
 #include "Rivet/Projections/MissingMomentum.hh"
 #include "Rivet/Projections/InvMassFinalState.hh"
 
-const double ZMASS = 91.1876; // GeV
-
 namespace Rivet {
 
 
@@ -28,7 +26,7 @@
 
 
   /// 4l to ZZ assignment -- algorithm
-  void identifyZstates(Zstate& Z1, Zstate& Z2, const Particles& leptons_sel4l) {
+  void identifyZstates(Zstate& Z1, Zstate& Z2, const Particles& leptons_sel4l, const double ZMASS) {
 
     /////////////////////////////////////////////////////////////////////////////
     /// ZZ->4l pairing
@@ -206,7 +204,7 @@
         Zstate Z1, Z2;
 
         // Identifies Z states from 4 lepton pairs
-        identifyZstates(Z1, Z2,leptons_sel4l);
+        identifyZstates(Z1, Z2,leptons_sel4l, ZMASS);
 
         ////////////////////////////////////////////////////////////////////////////
         // Z MASS WINDOW
@@ -364,6 +362,8 @@
 
   private:
 
+    const double ZMASS = 91.1876; // GeV
+
     Histo1DPtr _h_ZZ_xsect, _h_ZZ_ZpT, _h_ZZ_phill, _h_ZZ_mZZ;
     Histo1DPtr _h_ZZs_xsect;
     Histo1DPtr _h_ZZnunu_xsect, _h_ZZnunu_ZpT, _h_ZZnunu_phill, _h_ZZnunu_mZZ;
--- a/Analyses/pluginCMS/CMS_2013_I1209721.cc	Wed Jun 21 14:15:59 2017 +0100
+++ b/Analyses/pluginCMS/CMS_2013_I1209721.cc	Wed Jun 21 18:10:04 2017 +0200
@@ -104,25 +104,21 @@
         momenta.push_back(Vector3(0.0000001,0.0000001,0.));
       }
 
-      // Define a macro to appropriately fill both unboosted and boosted histo versions
-      #define FILLx2(HNAME, VAL) do { double x = VAL; for (size_t i = 0; i < 2; ++i) { \
-        if (i == 0 || is_boosted) HNAME[i]->fill(x, weight); } } while(0)
-
       Thrust thrust; thrust.calc(momenta);
       const double T = thrust.thrust();


More information about the Rivet-svn mailing list