[Rivet-svn] rivet: 2 new changesets

Rivet Mercurial rivet at projects.hepforge.org
Fri Oct 27 11:30:02 BST 2017


details:   https://rivet.hepforge.org/hg/rivet/rev/42e0fe40dfe1
branches:  multiweight
changeset: 6115:42e0fe40dfe1
user:      David Grellscheid <david.grellscheid at durham.ac.uk>
date:      Fri Oct 27 12:25:54 2017 +0200
description:
Add constructor from nullptr

details:   https://rivet.hepforge.org/hg/rivet/rev/448b010f3477
branches:  multiweight
changeset: 6116:448b010f3477
user:      Chris Pollard <cspollard at gmail.com>
date:      Fri Oct 27 12:26:54 2017 +0200
description:
making AnalysisHandler::nominalCrossSection() available through python interface

diffs (truncated from 166 to 50 lines):

--- a/analyses/pluginMC/MC_ZJETS.cc	Fri Oct 27 11:33:22 2017 +0200
+++ b/analyses/pluginMC/MC_ZJETS.cc	Fri Oct 27 12:26:54 2017 +0200
@@ -41,12 +41,15 @@
 
     /// Do the analysis
     void analyze(const Event & e) {
+      MSG_TRACE("MC_ZJETS: running ZFinder");
       const ZFinder& zfinder = apply<ZFinder>(e, "ZFinder");
       if (zfinder.bosons().size() != 1) vetoEvent;
       const FourMomentum& zmom = zfinder.bosons()[0].momentum();
+      MSG_TRACE("MC_ZJETS: have exactly one Z boson candidate");
 
       const Jets& jets = apply<FastJets>(e, "Jets").jetsByPt(_jetptcut);
       if (jets.size() > 0) {
+        MSG_TRACE("MC_ZJETS: have at least one valid jet");
         const double weight = 1.0;
         _h_Z_jet1_deta->fill(zmom.eta()-jets[0].eta(), weight);
         _h_Z_jet1_dR->fill(deltaR(zmom, jets[0].momentum()), weight);
--- a/bin/rivet	Fri Oct 27 11:33:22 2017 +0200
+++ b/bin/rivet	Fri Oct 27 12:26:54 2017 +0200
@@ -646,7 +646,7 @@
 ## Print end-of-loop messages
 loopendtime = datetime.datetime.now().replace(microsecond=0)
 logging.info("Finished event loop at %s" % str(loopendtime))
-logging.info("Cross-section = %e pb" % ah.crossSection())
+logging.info("Cross-section = %e pb" % ah.nominalCrossSection())
 print()
 
 
--- a/include/Rivet/AnalysisHandler.hh	Fri Oct 27 11:33:22 2017 +0200
+++ b/include/Rivet/AnalysisHandler.hh	Fri Oct 27 12:26:54 2017 +0200
@@ -72,9 +72,6 @@
         return _weightNames.size();
     }
 
-    /// Is cross-section information required by at least one child analysis?
-    bool needCrossSection() const;
-
     /// Set the cross-section for the process being generated.
     AnalysisHandler& setCrossSection(double xs, double xserr);
 
@@ -83,8 +80,17 @@
       return _xs;
     }
 
-    /// Whether the handler knows about a cross-section.
-    bool hasCrossSection() const;
+    double nominalCrossSection() const {
+      _xs.get()->setActiveWeightIdx(_defaultWeightIdx);
+      const YODA::Scatter1D::Points& ps = _xs->points();


More information about the Rivet-svn mailing list