[Rivet-svn] rivet: fix -Wbraced-scalar-init warning for CLANG and make Dress...

Rivet Mercurial rivet at projects.hepforge.org
Tue May 22 15:00:02 BST 2018


details:   https://rivet.hepforge.org/hg/rivet/rev/88f848c5f35b
branches:  release-2-6-x
changeset: 6294:88f848c5f35b
user:      Christian Gutschow <chris.g at cern.ch>
date:      Tue May 22 14:32:57 2018 +0100
description:
fix -Wbraced-scalar-init warning for CLANG and make DressedLeptons sortable

diffs (40 lines):

--- a/include/Rivet/Projections/DressedLeptons.hh	Tue May 22 13:52:30 2018 +0100
+++ b/include/Rivet/Projections/DressedLeptons.hh	Tue May 22 14:32:57 2018 +0100
@@ -94,7 +94,16 @@
     /// @note Like particles() but with helper functions
     vector<DressedLepton> dressedLeptons() const {
       vector<DressedLepton> rtn;
-      for (const Particle& p : particles())
+      for (const Particle& p : particles(cmpMomByPt))
+        rtn += DressedLepton(p);  //static_cast<const DressedLepton>(p);
+      return rtn;
+    }
+
+    /// @brief Retrieve the dressed leptons ordered by supplied sorting functor
+    /// @note Like particles() but with helper functions
+    vector<DressedLepton> dressedLeptons(const ParticleSorter& sorter) const {
+      vector<DressedLepton> rtn;
+      for (const Particle& p : particles(sorter))
         rtn += DressedLepton(p);  //static_cast<const DressedLepton>(p);
       return rtn;
     }
--- a/include/Rivet/Tools/ParticleUtils.hh	Tue May 22 13:52:30 2018 +0100
+++ b/include/Rivet/Tools/ParticleUtils.hh	Tue May 22 14:32:57 2018 +0100
@@ -535,7 +535,7 @@
 
   /// PID matching functor
   struct HasPID : public BoolParticleFunctor {
-    HasPID(PdgId pid) : targetpids{ {pid} } { }
+    HasPID(PdgId pid) : targetpids{ pid } { }
     HasPID(vector<PdgId> pids) : targetpids{pids} { }
     HasPID(initializer_list<PdgId> pids) : targetpids{pids} { }
     bool operator()(const Particle& p) const { return contains(targetpids, p.pid()); }
@@ -545,7 +545,7 @@
 
   /// |PID| matching functor
   struct HasAbsPID : public BoolParticleFunctor {
-    HasAbsPID(PdgId pid) : targetapids{ {abs(pid)} } { }
+    HasAbsPID(PdgId pid) : targetapids{ abs(pid) } { }
     HasAbsPID(vector<PdgId> pids) { for (PdgId pid : pids) targetapids.push_back(abs(pid)); }
     HasAbsPID(initializer_list<PdgId> pids) { for (PdgId pid : pids) targetapids.push_back(abs(pid)); }
     bool operator()(const Particle& p) const { return contains(targetapids, p.abspid()); }


More information about the Rivet-svn mailing list