Index: external/HepMC3/include/HepMC3/Attribute.h
===================================================================
--- external/HepMC3/include/HepMC3/Attribute.h	(revision b30245b0657b11c14403abbcf01ed63b738a06b8)
+++ external/HepMC3/include/HepMC3/Attribute.h	(revision b30245b0657b11c14403abbcf01ed63b738a06b8)
@@ -0,0 +1,1182 @@
+// -*- C++ -*-
+//
+// This file is part of HepMC
+// Copyright (C) 2014-2020 The HepMC collaboration (see AUTHORS for details)
+//
+#ifndef HEPMC3_ATTRIBUTE_H
+#define HEPMC3_ATTRIBUTE_H
+/**
+ *  @file Attribute.h
+ *  @brief Definition of \b class Attribute, \b class IntAttribute and \b class StringAttribute
+ *
+ *  @class HepMC3::Attribute
+ *  @brief Base class for all attributes
+ *
+ *  Contains virtual functions to_string and from_string that
+ *  each attribute must implement, as well as init function that
+ *  attributes should overload to initialize parsed attribute
+ *
+ *  @ingroup attributes
+ *
+ */
+#include <cstdio> // sprintf
+#include <string>
+#include <limits>
+#include <sstream>
+#include <iomanip>
+#include <map>
+
+#include "HepMC3/GenParticle_fwd.h"
+#include "HepMC3/GenVertex_fwd.h"
+
+/** Deprecated */
+using std::string;
+
+namespace HepMC3 {
+
+/** @brief Forward declaration of GenEvent. */
+class GenEvent;
+
+/** @brief Forward declaration of GenRunInfo. */
+class GenRunInfo;
+
+/** @brief Forward declaration of GenParticle. */
+// class GenParticle;
+class Attribute {
+//
+// Constructors
+//
+public:
+    /** @brief Default constructor */
+    //Note: m_event should be set to nullptr in case event is deleted!
+    Attribute():m_is_parsed(true) {    m_event=nullptr; }
+
+    /** @brief Virtual destructor */
+    virtual ~Attribute() {}
+
+protected:
+    /** @brief Protected constructor that allows to set string
+     *
+     *  Used when parsing attributes from file. An StringAttribute class
+     *  object is made, which uses this constructor to signify that
+     *  it just holds string without parsing it.
+     *
+     *  @note There should be no need for user class to ever use this constructor
+     */
+    //Note: m_event should be set to nullptr n case event is deleted!
+    explicit Attribute(const std::string &st):m_is_parsed(false),m_string(st) { m_event=nullptr; }
+
+    /** @brief GenEvent is a friend */
+    friend class GenEvent;
+
+//
+// Virtual Functions
+//
+public:
+    /** @brief Fill class content from string.
+     */
+    virtual bool from_string(const std::string & att) = 0;
+
+    /** @brief Optionally initialize the attribute after from_string.
+     */
+    virtual bool init() {
+        return true;
+    }
+
+    /** @brief Optionally initialize the attribute after from_string
+     *
+     * Is passed a reference to the GenRunInfo object to which the
+     * Attribute belongs.
+     */
+    virtual bool init(const GenRunInfo & ) {
+        return true;
+    }
+
+    /** @brief Fill string from class content */
+    virtual bool to_string(std::string &att) const = 0;
+
+//
+// Accessors
+//
+public:
+    /** @brief Check if this attribute is parsed */
+    bool is_parsed() const { return m_is_parsed; }
+
+    /** @brief Get unparsed string */
+    const std::string& unparsed_string() const { return m_string; }
+
+    /** return the GenEvent to which this Attribute belongs, if at all. */
+    const GenEvent * event() const {
+        return m_event;
+    }
+
+    /** return the GenParticle to which this Attribute belongs, if at all. */
+    GenParticlePtr particle() {
+        return m_particle;
+    }
+
+    /** return the GenParticle to which this Attribute belongs, if at all. */
+    ConstGenParticlePtr particle() const {
+        return std::const_pointer_cast<GenParticle>(m_particle);
+    }
+
+    /** return the GenVertex to which this Attribute belongs, if at all. */
+    GenVertexPtr vertex() {
+        return m_vertex;
+    }
+
+    /** return the GenVertex to which this Attribute belongs, if at all. */
+    ConstGenVertexPtr vertex() const {
+        return std::const_pointer_cast<GenVertex>(m_vertex);
+    }
+
+protected:
+    /** @brief Set is_parsed flag */
+    void set_is_parsed(bool flag) { m_is_parsed = flag; }
+
+    /** @brief Set unparsed string */
+    void set_unparsed_string(const std::string &st) { m_string = st; }
+
+//
+// Fields
+//
+private:
+    bool   m_is_parsed;             //!< Is this attribute parsed?
+    std::string m_string;                //!< Raw (unparsed) string
+    const GenEvent * m_event;       //!< Possibility to be aware of the
+    //!  controlling GenEvent object.
+    GenParticlePtr m_particle; //!< Particle to which assigned.
+    GenVertexPtr m_vertex;      //!< Vertex to which assigned.
+};
+
+/**
+ *  @class HepMC3::IntAttribute
+ *  @brief Attribute that holds an Integer implemented as an int
+ *
+ *  @ingroup attributes
+ */
+class IntAttribute : public Attribute {
+public:
+
+    /** @brief Default constructor */
+    IntAttribute():Attribute(),m_val(0) {}
+
+    /** @brief Constructor initializing attribute value */
+    IntAttribute(int val):Attribute(),m_val(val) {}
+
+    /** @brief Implementation of Attribute::from_string */
+    bool from_string(const std::string &att) override {
+        m_val = atoi( att.c_str() );
+        return true;
+    }
+
+    /** @brief Implementation of Attribute::to_string */
+    bool to_string(std::string &att) const  override{
+        att = std::to_string(m_val);
+        return true;
+    }
+
+    /** @brief get the value associated to this Attribute. */
+    int value() const {
+        return m_val;
+    }
+
+    /** @brief set the value associated to this Attribute. */
+    void set_value(const int& i) {
+        m_val = i;
+    }
+
+private:
+    int m_val; ///< Attribute value
+};
+
+/**
+ *  @class HepMC3::LongAttribute
+ *  @brief Attribute that holds an Integer implemented as an int
+ *
+ *  @ingroup attributes
+ */
+class LongAttribute : public Attribute {
+public:
+
+    /** @brief Default constructor */
+    LongAttribute(): Attribute(), m_val(0) {}
+
+    /** @brief Constructor initializing attribute value */
+    LongAttribute(long val): Attribute(), m_val(val) {}
+
+    /** @brief Implementation of Attribute::from_string */
+    bool from_string(const std::string &att)  override{
+        m_val = atol( att.c_str() );
+        return true;
+    }
+
+    /** @brief Implementation of Attribute::to_string */
+    bool to_string(std::string &att) const  override{
+        att = std::to_string(m_val);
+        return true;
+    }
+
+    /** @brief get the value associated to this Attribute. */
+    long value() const {
+        return m_val;
+    }
+
+    /** @brief set the value associated to this Attribute. */
+    void set_value(const long& l) {
+        m_val = l;
+    }
+
+private:
+
+    long m_val; ///< Attribute value
+
+};
+
+/**
+ *  @class HepMC3::DoubleAttribute
+ *  @brief Attribute that holds a real number as a double.
+ *
+ *  @ingroup attributes
+ */
+class DoubleAttribute : public Attribute {
+public:
+
+    /** @brief Default constructor */
+    DoubleAttribute(): Attribute(), m_val(0.0) {}
+
+    /** @brief Constructor initializing attribute value */
+    DoubleAttribute(double val): Attribute(), m_val(val) {}
+
+    /** @brief Implementation of Attribute::from_string */
+    bool from_string(const std::string &att)  override{
+        m_val = atof( att.c_str() );
+        return true;
+    }
+
+    /** @brief Implementation of Attribute::to_string */
+    bool to_string(std::string &att) const  override{
+        std::ostringstream oss;
+        oss << std::setprecision(std::numeric_limits<double>::digits10)
+            << m_val;
+        att = oss.str();
+        return true;
+    }
+
+    /** @brief get the value associated to this Attribute. */
+    double value() const {
+        return m_val;
+    }
+
+    /** @brief set the value associated to this Attribute. */
+    void set_value(const double& d) {
+        m_val = d;
+    }
+
+private:
+
+    double m_val; ///< Attribute value
+};
+
+/**
+ *  @class HepMC3::FloatAttribute
+ *  @brief Attribute that holds a real number as a float.
+ *
+ *  @ingroup attributes
+ */
+class FloatAttribute : public Attribute {
+public:
+
+    /** @brief Default constructor */
+    FloatAttribute(): Attribute(), m_val(0.0) {}
+
+    /** @brief Constructor initializing attribute value */
+    FloatAttribute(float val): Attribute(), m_val(val) {}
+
+    /** @brief Implementation of Attribute::from_string */
+    bool from_string(const std::string &att)  override{
+        m_val = float(atof( att.c_str() ));
+        return true;
+    }
+
+    /** @brief Implementation of Attribute::to_string */
+    bool to_string(std::string &att) const  override{
+        std::ostringstream oss;
+        oss << std::setprecision(std::numeric_limits<float>::digits10)
+            << m_val;
+        att = oss.str();
+        return true;
+    }
+
+    /** @brief get the value associated to this Attribute. */
+    float value() const {
+        return m_val;
+    }
+
+    /** @brief set the value associated to this Attribute. */
+    void set_value(const float& f) {
+        m_val = f;
+    }
+
+private:
+
+    float m_val; ///< Attribute value
+};
+
+/**
+ *  @class HepMC3::StringAttribute
+ *  @brief Attribute that holds a string
+ *
+ *  Default attribute constructed when reading input files.
+ *  It can be then parsed by other attributes or left as a string.
+ *
+ *  @ingroup attributes
+ *
+ */
+class StringAttribute : public Attribute {
+public:
+
+    /** @brief Default constructor - empty string */
+    StringAttribute():Attribute() {}
+
+    /** @brief String-based constructor
+     *
+     *  The Attribute constructor used here marks that this is an unparsed
+     *  string that can be (but does not have to be) parsed
+     *
+     */
+    StringAttribute(const std::string &st):Attribute(st) {}
+
+    /** @brief Implementation of Attribute::from_string */
+    bool from_string(const std::string &att)  override{
+        set_unparsed_string(att);
+        return true;
+    }
+
+    /** @brief Implementation of Attribute::to_string */
+    bool to_string(std::string &att) const  override{
+        att = unparsed_string();
+        return true;
+    }
+
+    /** @brief get the value associated to this Attribute. */
+    std::string value() const {
+        return unparsed_string();
+    }
+
+    /** @brief set the value associated to this Attribute. */
+    void set_value(const std::string& s) {
+        set_unparsed_string(s);
+    }
+
+};
+
+/**
+ *  @class HepMC3::CharAttribute
+ *  @brief Attribute that holds an Chareger implemented as an int
+ *
+ *  @ingroup attributes
+ */
+class CharAttribute : public Attribute {
+public:
+
+    /** @brief Default constructor */
+    CharAttribute():Attribute(),m_val(0) {}
+
+    /** @brief Constructor initializing attribute value */
+    CharAttribute(char val):Attribute(),m_val(val) {}
+
+    /** @brief Implementation of Attribute::from_string */
+    bool from_string(const std::string &att) override {
+        if (att.size())
+        {
+            m_val = att.at(0);
+            return true;
+        }
+        return false;
+    }
+
+    /** @brief Implementation of Attribute::to_string */
+    bool to_string(std::string &att) const override {
+        att = std::to_string(m_val);
+        return true;
+    }
+
+    /** @brief get the value associated to this Attribute. */
+    char value() const {
+        return m_val;
+    }
+
+    /** @brief set the value associated to this Attribute. */
+    void set_value(const char& i) {
+        m_val = i;
+    }
+
+private:
+    char m_val; ///< Attribute value
+};
+
+/**
+ *  @class HepMC3::LongLongAttribute
+ *  @brief Attribute that holds an Integer implemented as an int
+ *
+ *  @ingroup attributes
+ */
+class LongLongAttribute : public Attribute {
+public:
+
+    /** @brief Default constructor */
+    LongLongAttribute(): Attribute(), m_val(0) {}
+
+    /** @brief Constructor initializing attribute value */
+    LongLongAttribute(long long val): Attribute(), m_val(val) {}
+
+    /** @brief Implementation of Attribute::from_string */
+    bool from_string(const std::string &att)  override{
+        m_val = atoll( att.c_str() );
+        return true;
+    }
+
+    /** @brief Implementation of Attribute::to_string */
+    bool to_string(std::string &att) const  override{
+        att = std::to_string(m_val);
+        return true;
+    }
+
+    /** @brief get the value associated to this Attribute. */
+    long long value() const {
+        return m_val;
+    }
+
+    /** @brief set the value associated to this Attribute. */
+    void set_value(const long long& l) {
+        m_val = l;
+    }
+
+private:
+
+    long  long m_val; ///< Attribute value
+
+};
+
+/**
+ *  @class HepMC3::LongDoubleAttribute
+ *  @brief Attribute that holds a real number as a double.
+ *
+ *  @ingroup attributes
+ */
+class LongDoubleAttribute : public Attribute {
+public:
+
+    /** @brief Default constructor */
+    LongDoubleAttribute(): Attribute(), m_val(0.0) {}
+
+    /** @brief Constructor initializing attribute value */
+    LongDoubleAttribute(long double val): Attribute(), m_val(val) {}
+
+    /** @brief Implementation of Attribute::from_string */
+    bool from_string(const std::string &att) override {
+        m_val = strtold( att.c_str(),NULL);
+        return true;
+    }
+
+    /** @brief Implementation of Attribute::to_string */
+    bool to_string(std::string &att) const  override{
+        std::ostringstream oss;
+        oss << std::setprecision(std::numeric_limits<long double>::digits10)
+            << m_val;
+        att = oss.str();
+        return true;
+    }
+
+    /** @brief get the value associated to this Attribute. */
+    long double value() const {
+        return m_val;
+    }
+
+    /** @brief set the value associated to this Attribute. */
+    void set_value(const long double& d) {
+        m_val = d;
+    }
+
+private:
+
+    long double m_val; ///< Attribute value
+};
+
+
+
+/**
+ *  @class HepMC3::UIntAttribute
+ *  @brief Attribute that holds an unsigned int
+ *
+ *  @ingroup attributes
+ */
+class UIntAttribute : public Attribute {
+public:
+
+    /** @brief Default constructor */
+    UIntAttribute():Attribute(),m_val(0) {}
+
+    /** @brief Constructor initializing attribute value */
+    UIntAttribute(unsigned int val):Attribute(),m_val(val) {}
+
+    /** @brief Implementation of Attribute::from_string */
+    bool from_string(const std::string &att)  override{
+        m_val = strtoul(att.c_str(), NULL, 0);
+        return true;
+    }
+
+    /** @brief Implementation of Attribute::to_string */
+    bool to_string(std::string &att) const  override{
+        att = std::to_string(m_val);
+        return true;
+    }
+
+    /** @brief get the value associated to this Attribute. */
+    unsigned int value() const {
+        return m_val;
+    }
+
+    /** @brief set the value associated to this Attribute. */
+    void set_value(const unsigned int& i) {
+        m_val = i;
+    }
+
+private:
+    unsigned int m_val; ///< Attribute value
+};
+
+
+
+/**
+ *  @class HepMC3::ULongAttribute
+ *  @brief Attribute that holds an unsigned long
+ *
+ *  @ingroup attributes
+ */
+class ULongAttribute : public Attribute {
+public:
+
+    /** @brief Default constructor */
+    ULongAttribute():Attribute(),m_val(0) {}
+
+    /** @brief Constructor initializing attribute value */
+    ULongAttribute(unsigned long val):Attribute(),m_val(val) {}
+
+    /** @brief Implementation of Attribute::from_string */
+    bool from_string(const std::string &att)  override{
+        m_val = strtoul(att.c_str(), NULL, 0);
+        return true;
+    }
+
+    /** @brief Implementation of Attribute::to_string */
+    bool to_string(std::string &att) const  override{
+        att = std::to_string(m_val);
+        return true;
+    }
+
+    /** @brief get the value associated to this Attribute. */
+    unsigned long value() const {
+        return m_val;
+    }
+
+    /** @brief set the value associated to this Attribute. */
+    void set_value(const unsigned long& i) {
+        m_val = i;
+    }
+
+private:
+    unsigned long m_val; ///< Attribute value
+};
+
+
+/**
+ *  @class HepMC3::ULongLongAttribute
+ *  @brief Attribute that holds an unsigned long long
+ *
+ *  @ingroup attributes
+ */
+class ULongLongAttribute : public Attribute {
+public:
+
+    /** @brief Default constructor */
+    ULongLongAttribute():Attribute(),m_val(0) {}
+
+    /** @brief Constructor initializing attribute value */
+    ULongLongAttribute(unsigned long long val):Attribute(),m_val(val) {}
+
+    /** @brief Implementation of Attribute::from_string */
+    bool from_string(const std::string &att)  override{
+        m_val = strtoull(att.c_str(), NULL, 0);
+        return true;
+    }
+
+    /** @brief Implementation of Attribute::to_string */
+    bool to_string(std::string &att) const  override{
+        att = std::to_string(m_val);
+        return true;
+    }
+
+    /** @brief get the value associated to this Attribute. */
+    unsigned long long value() const {
+        return m_val;
+    }
+
+    /** @brief set the value associated to this Attribute. */
+    void set_value(const unsigned long long& i) {
+        m_val = i;
+    }
+
+private:
+    unsigned long long m_val; ///< Attribute value
+};
+/**
+ *  @class HepMC3::BoolAttribute
+ *  @brief Attribute that holds an Booleger implemented as an int
+ *
+ *  @ingroup attributes
+ */
+class BoolAttribute : public Attribute {
+public:
+
+    /** @brief Default constructor */
+    BoolAttribute():Attribute(),m_val(false) {}
+
+    /** @brief Constructor initializing attribute value */
+    BoolAttribute(bool val):Attribute(),m_val(val) {}
+
+    /** @brief Implementation of Attribute::from_string */
+    bool from_string(const std::string &att)  override{
+        if (att.size()!=1) return false;
+        if(att==std::string("1")) {m_val = true;  return true;}
+        if(att==std::string("0")) {m_val = false; return true;}
+        return false;
+    }
+
+    /** @brief Implementation of Attribute::to_string */
+    bool to_string(std::string &att) const override{
+        att = std::to_string(m_val);
+        return true;
+    }
+
+    /** @brief get the value associated to this Attribute. */
+    bool value() const {
+        return m_val;
+    }
+
+    /** @brief set the value associated to this Attribute. */
+    void set_value(const bool& i) {
+        m_val = i;
+    }
+
+private:
+    bool m_val; ///< Attribute value
+};
+
+/**
+ *  @class HepMC3::VectorCharAttribute
+ *  @brief Attribute that holds a vector of charegers of type  char
+ *
+ *  @ingroup attributes
+ */
+class VectorCharAttribute : public Attribute {
+public:
+
+    /** @brief Default constructor */
+    VectorCharAttribute():Attribute(),m_val() {}
+
+    /** @brief Constructor initializing attribute value */
+    VectorCharAttribute(std::vector<char> val):Attribute(),m_val(val) {}
+
+    /** @brief Implementation of Attribute::from_string */
+    bool from_string(const std::string &att) override {
+        char  datafoo;
+        m_val.clear();
+        std::stringstream datastream(att);
+        while (datastream >> datafoo) m_val.push_back(datafoo);
+        return true;
+    }
+
+    /** @brief Implementation of Attribute::to_string */
+    bool to_string(std::string &att) const  override{
+        att.clear();
+        for (auto a:  m_val) {if (att.length()) att+=" ";  att+=std::to_string(a);}
+        return true;
+    }
+
+    /** @brief get the value associated to this Attribute. */
+    std::vector<char> value() const {
+        return m_val;
+    }
+
+    /** @brief set the value associated to this Attribute. */
+    void set_value(const std::vector<char>& i) {
+        m_val = i;
+    }
+
+private:
+    std::vector<char> m_val; ///< Attribute value
+};
+
+/**
+ *  @class HepMC3::VectorFloatAttribute
+ *  @brief Attribute that holds a vector of floategers of type  float
+ *
+ *  @ingroup attributes
+ */
+class VectorFloatAttribute : public Attribute {
+public:
+
+    /** @brief Default constructor */
+    VectorFloatAttribute():Attribute(),m_val() {}
+
+    /** @brief Constructor initializing attribute value */
+    VectorFloatAttribute(std::vector<float> val):Attribute(),m_val(val) {}
+
+    /** @brief Implementation of Attribute::from_string */
+    bool from_string(const std::string &att) override {
+        float  datafoo;
+        m_val.clear();
+        std::stringstream datastream(att);
+        while (datastream >> datafoo) m_val.push_back(datafoo);
+        return true;
+    }
+
+    /** @brief Implementation of Attribute::to_string */
+    bool to_string(std::string &att) const  override{
+        att.clear();
+        for (auto a:  m_val) {if (att.length()) att+=" ";  att+=std::to_string(a);}
+        return true;
+    }
+
+    /** @brief get the value associated to this Attribute. */
+    std::vector<float> value() const {
+        return m_val;
+    }
+
+    /** @brief set the value associated to this Attribute. */
+    void set_value(const std::vector<float>& i) {
+        m_val = i;
+    }
+
+private:
+    std::vector<float> m_val; ///< Attribute value
+};
+
+
+/**
+ *  @class HepMC3::VectorLongDoubleAttribute
+ *  @brief Attribute that holds a vector of long doubleegers of type  long double
+ *
+ *  @ingroup attributes
+ */
+class VectorLongDoubleAttribute : public Attribute {
+public:
+
+    /** @brief Default constructor */
+    VectorLongDoubleAttribute():Attribute(),m_val() {}
+
+    /** @brief Constructor initializing attribute value */
+    VectorLongDoubleAttribute(std::vector<long double> val):Attribute(),m_val(val) {}
+
+    /** @brief Implementation of Attribute::from_string */
+    bool from_string(const std::string &att) override {
+        long double  datafoo;
+        m_val.clear();
+        std::stringstream datastream(att);
+        while (datastream >> datafoo) m_val.push_back(datafoo);
+        return true;
+    }
+
+    /** @brief Implementation of Attribute::to_string */
+    bool to_string(std::string &att) const  override{
+        att.clear();
+        for (auto a:  m_val) {if (att.length()) att+=" ";  att+=std::to_string(a);}
+        return true;
+    }
+
+    /** @brief get the value associated to this Attribute. */
+    std::vector<long double> value() const {
+        return m_val;
+    }
+
+    /** @brief set the value associated to this Attribute. */
+    void set_value(const std::vector<long double>& i) {
+        m_val = i;
+    }
+
+private:
+    std::vector<long double> m_val; ///< Attribute value
+};
+
+
+
+/**
+ *  @class HepMC3::VectorLongLongAttribute
+ *  @brief Attribute that holds a vector of long longegers of type  long long
+ *
+ *  @ingroup attributes
+ */
+class VectorLongLongAttribute : public Attribute {
+public:
+
+    /** @brief Default constructor */
+    VectorLongLongAttribute():Attribute(),m_val() {}
+
+    /** @brief Constructor initializing attribute value */
+    VectorLongLongAttribute(std::vector<long long> val):Attribute(),m_val(val) {}
+
+    /** @brief Implementation of Attribute::from_string */
+    bool from_string(const std::string &att) override {
+        long long  datafoo;
+        m_val.clear();
+        std::stringstream datastream(att);
+        while (datastream >> datafoo) m_val.push_back(datafoo);
+        return true;
+    }
+
+    /** @brief Implementation of Attribute::to_string */
+    bool to_string(std::string &att) const  override{
+        att.clear();
+        for (auto a:  m_val) {if (att.length()) att+=" ";  att+=std::to_string(a);}
+        return true;
+    }
+
+    /** @brief get the value associated to this Attribute. */
+    std::vector<long long> value() const {
+        return m_val;
+    }
+
+    /** @brief set the value associated to this Attribute. */
+    void set_value(const std::vector<long long>& i) {
+        m_val = i;
+    }
+
+private:
+    std::vector<long long> m_val; ///< Attribute value
+};
+
+/**
+ *  @class HepMC3::VectorUIntAttribute
+ *  @brief Attribute that holds a vector of unsigned integers of type  unsigned int
+ *
+ *  @ingroup attributes
+ */
+class VectorUIntAttribute : public Attribute {
+public:
+
+    /** @brief Default constructor */
+    VectorUIntAttribute():Attribute(),m_val() {}
+
+    /** @brief Constructor initializing attribute value */
+    VectorUIntAttribute(std::vector<unsigned int> val):Attribute(),m_val(val) {}
+
+    /** @brief Implementation of Attribute::from_string */
+    bool from_string(const std::string &att) override {
+        unsigned int  datafoo;
+        m_val.clear();
+        std::stringstream datastream(att);
+        while (datastream >> datafoo) m_val.push_back(datafoo);
+        return true;
+    }
+
+    /** @brief Implementation of Attribute::to_string */
+    bool to_string(std::string &att) const  override{
+        att.clear();
+        for (auto a:  m_val) {if (att.length()) att+=" ";  att+=std::to_string(a);}
+        return true;
+    }
+
+    /** @brief get the value associated to this Attribute. */
+    std::vector<unsigned int> value() const {
+        return m_val;
+    }
+
+    /** @brief set the value associated to this Attribute. */
+    void set_value(const std::vector<unsigned int>& i) {
+        m_val = i;
+    }
+
+private:
+    std::vector<unsigned int> m_val; ///< Attribute value
+};
+
+/**
+ *  @class HepMC3::VectorULongAttribute
+ *  @brief Attribute that holds a vector of unsigned longegers of type  unsigned long
+ *
+ *  @ingroup attributes
+ */
+class VectorULongAttribute : public Attribute {
+public:
+
+    /** @brief Default constructor */
+    VectorULongAttribute():Attribute(),m_val() {}
+
+    /** @brief Constructor initializing attribute value */
+    VectorULongAttribute(std::vector<unsigned long> val):Attribute(),m_val(val) {}
+
+    /** @brief Implementation of Attribute::from_string */
+    bool from_string(const std::string &att) override {
+        unsigned long  datafoo;
+        m_val.clear();
+        std::stringstream datastream(att);
+        while (datastream >> datafoo) m_val.push_back(datafoo);
+        return true;
+    }
+
+    /** @brief Implementation of Attribute::to_string */
+    bool to_string(std::string &att) const  override{
+        att.clear();
+        for (auto a:  m_val) {if (att.length()) att+=" ";  att+=std::to_string(a);}
+        return true;
+    }
+
+    /** @brief get the value associated to this Attribute. */
+    std::vector<unsigned long> value() const {
+        return m_val;
+    }
+
+    /** @brief set the value associated to this Attribute. */
+    void set_value(const std::vector<unsigned long>& i) {
+        m_val = i;
+    }
+
+private:
+    std::vector<unsigned long> m_val; ///< Attribute value
+};
+
+
+/**
+ *  @class HepMC3::VectorULongLongAttribute
+ *  @brief Attribute that holds a vector of unsigned long longegers of type  unsigned long long
+ *
+ *  @ingroup attributes
+ */
+class VectorULongLongAttribute : public Attribute {
+public:
+
+    /** @brief Default constructor */
+    VectorULongLongAttribute():Attribute(),m_val() {}
+
+    /** @brief Constructor initializing attribute value */
+    VectorULongLongAttribute(std::vector<unsigned long long> val):Attribute(),m_val(val) {}
+
+    /** @brief Implementation of Attribute::from_string */
+    bool from_string(const std::string &att) override {
+        unsigned long long  datafoo;
+        m_val.clear();
+        std::stringstream datastream(att);
+        while (datastream >> datafoo) m_val.push_back(datafoo);
+        return true;
+    }
+
+    /** @brief Implementation of Attribute::to_string */
+    bool to_string(std::string &att) const  override{
+        att.clear();
+        for (auto a:  m_val) {if (att.length()) att+=" ";  att+=std::to_string(a);}
+        return true;
+    }
+
+    /** @brief get the value associated to this Attribute. */
+    std::vector<unsigned long long> value() const {
+        return m_val;
+    }
+
+    /** @brief set the value associated to this Attribute. */
+    void set_value(const std::vector<unsigned long long>& i) {
+        m_val = i;
+    }
+
+private:
+    std::vector<unsigned long long> m_val; ///< Attribute value
+};
+
+/**
+ *  @class HepMC3::VectorIntAttribute
+ *  @brief Attribute that holds a vector of integers of type  int
+ *
+ *  @ingroup attributes
+ */
+class VectorIntAttribute : public Attribute {
+public:
+
+    /** @brief Default constructor */
+    VectorIntAttribute():Attribute(),m_val() {}
+
+    /** @brief Constructor initializing attribute value */
+    VectorIntAttribute(std::vector<int> val):Attribute(),m_val(val) {}
+
+    /** @brief Implementation of Attribute::from_string */
+    bool from_string(const std::string &att) override {
+        int  datafoo;
+        m_val.clear();
+        std::stringstream datastream(att);
+        while (datastream >> datafoo) m_val.push_back(datafoo);
+        return true;
+    }
+
+    /** @brief Implementation of Attribute::to_string */
+    bool to_string(std::string &att) const  override{
+        att.clear();
+        for (auto a:  m_val) {if (att.length()) att+=" ";  att+=std::to_string(a);}
+        return true;
+    }
+
+    /** @brief get the value associated to this Attribute. */
+    std::vector<int> value() const {
+        return m_val;
+    }
+
+    /** @brief set the value associated to this Attribute. */
+    void set_value(const std::vector<int>& i) {
+        m_val = i;
+    }
+
+private:
+    std::vector<int> m_val; ///< Attribute value
+};
+
+/**
+ *  @class HepMC3::VectorIntAttribute
+ *  @brief Attribute that holds a vector of integers of type  int
+ *
+ *  @ingroup attributes
+ */
+class VectorLongIntAttribute : public Attribute {
+public:
+
+    /** @brief Default constructor */
+    VectorLongIntAttribute():Attribute(),m_val() {}
+
+    /** @brief Constructor initializing attribute value */
+    VectorLongIntAttribute(std::vector<long int> val):Attribute(),m_val(val) {}
+
+    /** @brief Implementation of Attribute::from_string */
+    bool from_string(const std::string &att) override {
+        long int  datafoo;
+        m_val.clear();
+        std::stringstream datastream(att);
+        while (datastream >> datafoo) m_val.push_back(datafoo);
+        return true;
+    }
+
+    /** @brief Implementation of Attribute::to_string */
+    bool to_string(std::string &att) const  override{
+        att.clear();
+        for (auto a:  m_val) {if (att.length()) att+=" ";  att+=std::to_string(a);}
+        return true;
+    }
+
+    /** @brief get the value associated to this Attribute. */
+    std::vector<long int> value() const {
+        return m_val;
+    }
+
+    /** @brief set the value associated to this Attribute. */
+    void set_value(const std::vector<long int>& i) {
+        m_val = i;
+    }
+
+private:
+    std::vector<long int> m_val; ///< Attribute value
+};
+
+/**
+ *  @class HepMC3::VectorIntAttribute
+ *  @brief Attribute that holds a vector of FPs of type  double
+ *
+ *  @ingroup attributes
+ */
+class VectorDoubleAttribute : public Attribute {
+public:
+
+    /** @brief Default constructor */
+    VectorDoubleAttribute():Attribute(),m_val() {}
+
+    /** @brief Constructor initializing attribute value */
+    VectorDoubleAttribute(std::vector<double> val):Attribute(),m_val(val) {}
+
+    /** @brief Implementation of Attribute::from_string */
+    bool from_string(const std::string &att) override {
+        double  datafoo;
+        m_val.clear();
+        std::stringstream datastream(att);
+        while (datastream >> datafoo) m_val.push_back(datafoo);
+        return true;
+    }
+
+    /** @brief Implementation of Attribute::to_string */
+    bool to_string(std::string &att) const  override{
+        att.clear();
+        for (auto a:  m_val) {if (att.length()) att+=" ";  att+=std::to_string(a);}
+        return true;
+    }
+
+    /** @brief get the value associated to this Attribute. */
+    std::vector<double> value() const {
+        return m_val;
+    }
+
+    /** @brief set the value associated to this Attribute. */
+    void set_value(const std::vector<double>& i) {
+        m_val = i;
+    }
+
+private:
+    std::vector<double> m_val; ///< Attribute value
+};
+
+
+/**
+ *  @class HepMC3::VectorIntAttribute
+ *  @brief Attribute that holds a vector of FPs of type  string
+ *
+ *  @ingroup attributes
+ */
+class VectorStringAttribute : public Attribute {
+public:
+
+    /** @brief Default constructor */
+    VectorStringAttribute():Attribute(),m_val() {}
+
+    /** @brief Constructor initializing attribute value */
+    VectorStringAttribute(std::vector<std::string> val):Attribute(),m_val(val) {}
+
+    /** @brief Implementation of Attribute::from_string */
+    bool from_string(const string &att) override {
+        size_t posb = att.find_first_not_of(' ');
+        do {
+           size_t pose = att.find_first_of(' ', posb);
+           m_val.push_back(att.substr(posb, pose - posb));
+           posb = att.find_first_not_of(' ', pose);
+        } while (posb != std::string::npos);
+        return true;
+    }
+
+    /** @brief Implementation of Attribute::to_string */
+    bool to_string(std::string &att) const  override{
+        att.clear();
+        for (auto a:  m_val) {if (att.length()) att+=" ";  att+=a;}
+        return true;
+    }
+
+    /** @brief get the value associated to this Attribute. */
+    std::vector<std::string> value() const {
+        return m_val;
+    }
+
+    /** @brief set the value associated to this Attribute. */
+    void set_value(const std::vector<std::string>& i) {
+        m_val = i;
+    }
+
+private:
+    std::vector<std::string> m_val; ///< Attribute value
+};
+
+
+} // namespace HepMC3
+
+#endif
Index: external/HepMC3/include/HepMC3/Data/GenEventData.h
===================================================================
--- external/HepMC3/include/HepMC3/Data/GenEventData.h	(revision b30245b0657b11c14403abbcf01ed63b738a06b8)
+++ external/HepMC3/include/HepMC3/Data/GenEventData.h	(revision b30245b0657b11c14403abbcf01ed63b738a06b8)
@@ -0,0 +1,61 @@
+// -*- C++ -*-
+//
+// This file is part of HepMC
+// Copyright (C) 2014-2019 The HepMC collaboration (see AUTHORS for details)
+//
+#ifndef HEPMC3_DATA_GENEVENTDATA_H
+#define HEPMC3_DATA_GENEVENTDATA_H
+/**
+ *  @file GenEventData.h
+ *  @brief Definition of \b struct GenEventData
+ *
+ *  @struct HepMC3::GenEventData
+ *  @brief Stores serializable event information
+ *
+ *  @ingroup data
+ *
+ */
+#include <vector>
+#include <string>
+#include "HepMC3/Data/GenParticleData.h"
+#include "HepMC3/Data/GenVertexData.h"
+#include "HepMC3/Units.h"
+
+namespace HepMC3 {
+
+struct GenEventData {
+    int                 event_number;  ///< Event number
+    Units::MomentumUnit momentum_unit; ///< Momentum unit
+    Units::LengthUnit   length_unit;   ///< Length unit
+
+    std::vector<GenParticleData> particles; ///< Particles
+    std::vector<GenVertexData>   vertices;  ///< Vertices
+    std::vector<double>          weights;   ///< Weights
+
+    FourVector event_pos;                   ///< Event position
+
+    /** @brief First id of the vertex links
+     *
+     *  If this id is positive - it is the incoming particle id
+     *  of a vertex which id is written in GenEventData::links2
+     *
+     *  If this id is negative - it's the id of a vertex which
+     *  outgoing particle id is written in GenEventData::links2
+     *
+     *  The links1[i] points to links2[i].
+     *  In case links1[i] is particle, links2[i] is end vertex.
+     *  In case links2[i] is vertex, links2[i] is outgoing particle.
+     *  An example of usage is given in documentation.
+     *
+     */
+    std::vector<int> links1;
+    std::vector<int> links2; ///< Second id of the vertex links
+
+    std::vector<int>         attribute_id;     ///< Attribute owner id
+    std::vector<std::string> attribute_name;   ///< Attribute name
+    std::vector<std::string> attribute_string; ///< Attribute serialized as string
+};
+
+} // namespace HepMC
+
+#endif
Index: external/HepMC3/include/HepMC3/Data/GenParticleData.h
===================================================================
--- external/HepMC3/include/HepMC3/Data/GenParticleData.h	(revision b30245b0657b11c14403abbcf01ed63b738a06b8)
+++ external/HepMC3/include/HepMC3/Data/GenParticleData.h	(revision b30245b0657b11c14403abbcf01ed63b738a06b8)
@@ -0,0 +1,34 @@
+// -*- C++ -*-
+//
+// This file is part of HepMC
+// Copyright (C) 2014-2019 The HepMC collaboration (see AUTHORS for details)
+//
+#ifndef HEPMC3_DATA_GENPARTICLEDATA_H
+#define HEPMC3_DATA_GENPARTICLEDATA_H
+/**
+ *  @file GenParticleData.h
+ *  @brief Definition of \b class GenParticleData
+ *
+ *  @struct HepMC3::GenParticleData
+ *  @brief Stores serializable particle information
+ *
+ *  @ingroup data
+ *
+ */
+#include "HepMC3/FourVector.h"
+
+namespace HepMC3 {
+
+// NOTE: Keep in mind the data alignment
+//       Currently it's 8b alignment = 56b total
+struct GenParticleData {
+    int        pid;               ///< PDG ID
+    int        status;            ///< Status
+    bool       is_mass_set;       ///< Check if generated mass is set
+    double     mass;              ///< Generated mass (if set)
+    FourVector momentum;          ///< Momentum
+};
+
+} // namespace HepMC
+
+#endif
Index: external/HepMC3/include/HepMC3/Data/GenRunInfoData.h
===================================================================
--- external/HepMC3/include/HepMC3/Data/GenRunInfoData.h	(revision b30245b0657b11c14403abbcf01ed63b738a06b8)
+++ external/HepMC3/include/HepMC3/Data/GenRunInfoData.h	(revision b30245b0657b11c14403abbcf01ed63b738a06b8)
@@ -0,0 +1,36 @@
+// -*- C++ -*-
+//
+// This file is part of HepMC
+// Copyright (C) 2014-2019 The HepMC collaboration (see AUTHORS for details)
+//
+#ifndef HEPMC3_DATA_GENRUNINFODATA_H
+#define HEPMC3_DATA_GENRUNINFODATA_H
+/**
+ *  @file GenRunInfoData.h
+ *  @brief Definition of \b struct GenRunInfoData
+ *
+ *  @struct HepMC3::GenRunInfoData
+ *  @brief Stores serializable run information
+ *
+ *  @ingroup data
+ *
+ */
+#include <vector>
+#include <string>
+
+namespace HepMC3 {
+
+struct GenRunInfoData {
+    std::vector<std::string> weight_names;     ///< Weight names
+
+    std::vector<std::string> tool_name;        ///< Tool names
+    std::vector<std::string> tool_version;     ///< Tool versions
+    std::vector<std::string> tool_description; ///< Tool descriptions
+
+    std::vector<std::string> attribute_name;   ///< Attribute name
+    std::vector<std::string> attribute_string; ///< Attribute serialized as string
+};
+
+} // namespace HepMC
+
+#endif
Index: external/HepMC3/include/HepMC3/Data/GenVertexData.h
===================================================================
--- external/HepMC3/include/HepMC3/Data/GenVertexData.h	(revision b30245b0657b11c14403abbcf01ed63b738a06b8)
+++ external/HepMC3/include/HepMC3/Data/GenVertexData.h	(revision b30245b0657b11c14403abbcf01ed63b738a06b8)
@@ -0,0 +1,36 @@
+// -*- C++ -*-
+//
+// This file is part of HepMC
+// Copyright (C) 2014-2019 The HepMC collaboration (see AUTHORS for details)
+//
+#ifndef HEPMC3_DATA_GENVERTEXDATA_H
+#define HEPMC3_DATA_GENVERTEXDATA_H
+/**
+ *  @file GenVertexData.h
+ *  @brief Definition of \b class GenVertexData
+ *
+ *  @struct HepMC3::GenVertexData
+ *  @brief Stores serializable vertex information
+ *
+ *  @ingroup data
+ *
+ */
+#include "HepMC3/FourVector.h"
+
+namespace HepMC3 {
+
+struct GenVertexData {
+    int        status;   ///< Vertex status
+    FourVector position; ///< Position in time-space
+    
+    /// @brief Check if this struct fields are zero
+    bool is_zero() const {
+        if( status ) return false;
+        
+        return position.is_zero();
+    }
+};
+
+} // namespace HepMC
+
+#endif
Index: external/HepMC3/include/HepMC3/Errors.h
===================================================================
--- external/HepMC3/include/HepMC3/Errors.h	(revision b30245b0657b11c14403abbcf01ed63b738a06b8)
+++ external/HepMC3/include/HepMC3/Errors.h	(revision b30245b0657b11c14403abbcf01ed63b738a06b8)
@@ -0,0 +1,50 @@
+// -*- C++ -*-
+//
+// This file is part of HepMC
+// Copyright (C) 2014-2020 The HepMC collaboration (see AUTHORS for details)
+/**
+ *  @file Errors.h
+ *  @brief Implementation of  error and HEPMC3_HEPMC3_WARNING macros
+ *
+ */
+#ifndef HEPMC3_ERRORS_H
+#define HEPMC3_ERRORS_H
+
+#include <iostream>
+#include <stdexcept>
+
+namespace HepMC3 {
+
+
+/// @name Printing macros
+//@{
+
+/** @brief Macro for printing error messages */
+#define HEPMC3_ERROR(MESSAGE)   if ( Setup::print_errors() )   { std::cerr << "ERROR::" << MESSAGE << std::endl; }
+
+/** @brief Macro for printing HEPMC3_HEPMC3_WARNING messages */
+#define HEPMC3_WARNING(MESSAGE) if ( Setup::print_warnings() ) { std::cout << "WARNING::" << MESSAGE << std::endl; }
+
+// Debug messages and code that will not go to the release version
+#ifndef HEPMC3_RELEASE_VERSION
+
+/** @brief Macro for printing debug messages with appropriate debug level */
+#define HEPMC3_DEBUG(LEVEL,MESSAGE) if( Setup::debug_level()>=(LEVEL) ) { std::cout << "DEBUG(" << LEVEL <<")::" << MESSAGE << std::endl; }
+/** @brief Macro for storing code useful for debugging */
+#define HEPMC3_DEBUG_CODE_BLOCK( x ) x
+
+#else
+
+#define HEPMC3_DEBUG( x,y )
+#define HEPMC3_DEBUG_CODE_BLOCK( x )
+
+#endif
+
+//@}
+
+
+
+
+} // namespace HepMC3
+
+#endif
Index: external/HepMC3/include/HepMC3/FourVector.h
===================================================================
--- external/HepMC3/include/HepMC3/FourVector.h	(revision b30245b0657b11c14403abbcf01ed63b738a06b8)
+++ external/HepMC3/include/HepMC3/FourVector.h	(revision b30245b0657b11c14403abbcf01ed63b738a06b8)
@@ -0,0 +1,338 @@
+// -*- C++ -*-
+//
+// This file is part of HepMC
+// Copyright (C) 2014-2020 The HepMC collaboration (see AUTHORS for details)
+//
+#ifndef HEPMC3_FOURVECTOR_H
+#define HEPMC3_FOURVECTOR_H
+/**
+ *  @file FourVector.h
+ *  @brief Definition of \b class FourVector
+ */
+#include <cmath>
+#ifndef M_PI
+/** @brief Definition of PI. Needed on some platforms */
+#define M_PI 3.14159265358979323846264338327950288
+#endif
+namespace HepMC3 {
+
+
+/**
+ *  @brief Generic 4-vector
+ *
+ *  Interpretation of its content depends on accessors used: it's much simpler to do this
+ *  than to distinguish between space and momentum vectors via the type system (especially
+ *  given the need for backward compatibility with HepMC2). Be sensible and don't call
+ *  energy functions on spatial vectors! To avoid duplication, most definitions are only
+ *  implemented on the spatial function names, with the energy-momentum functions as aliases.
+ *
+ *  This is @a not intended to be a fully featured 4-vector, but does contain the majority
+ *  of common non-boosting functionality, as well as a few support operations on
+ *  4-vectors.
+ *
+ *  The implementations in this class are fully inlined.
+ */
+class FourVector {
+public:
+
+    /** @brief Default constructor */
+    FourVector()
+        : m_v1(0.0),   m_v2(0.0), m_v3(0.0),    m_v4(0.0)  {}
+    /** @brief Sets all FourVector fields */
+    FourVector(double xx, double yy, double zz, double ee)
+        : m_v1(xx),     m_v2(yy),   m_v3(zz),      m_v4(ee)    {}
+    /** @brief Copy constructor */
+    FourVector(const FourVector & v)
+        : m_v1(v.m_v1), m_v2(v.m_v2), m_v3(v.m_v3), m_v4(v.m_v4) {}
+
+
+    /// @name Component accessors
+    //@{
+
+    /** @brief Set all FourVector fields, in order x,y,z,t */
+    void set(double x1, double x2, double x3, double x4) {
+        m_v1 = x1;
+        m_v2 = x2;
+        m_v3 = x3;
+        m_v4 = x4;
+    }
+
+    /// set component of position/displacement
+    void set_component(const int i, const double x)   
+    {
+    if (i==0) {m_v1=x; return; }
+    if (i==1) {m_v2=x; return; }
+    if (i==2) {m_v3=x; return; }
+    if (i==3) {m_v4=x; return; }
+    }
+    /// get component of position/displacement
+    double get_component(const int i)   const
+    {
+    if (i==0) return m_v1;
+    if (i==1) return m_v2;
+    if (i==2) return m_v3;
+    if (i==3) return m_v4;
+    return 0.0;
+    }
+
+
+    /// x-component of position/displacement
+    double x()        const { return m_v1; }
+    /// Set x-component of position/displacement
+    void set_x(double xx)   { m_v1 = xx;    }
+    /// @deprecated Prefer the HepMC-style set_x() function
+    void setX(double xx)   { set_x(xx);    }
+
+    /// y-component of position/displacement
+    double y()        const { return m_v2; }
+    /// Set y-component of position/displacement
+    void   set_y(double yy)   { m_v2 = yy;    }
+    /// @deprecated Prefer the HepMC-style set_y() function
+    void setY(double yy)   { set_y(yy);    }
+
+    /// z-component of position/displacement
+    double z()        const { return m_v3; }
+    /// Set z-component of position/displacement
+    void set_z(double zz)   { m_v3 = zz;    }
+    /// @deprecated Prefer the HepMC-style set_z() function
+    void setZ(double zz)   { set_z(zz);    }
+
+    /// Time component of position/displacement
+    double t()        const { return m_v4; }
+    /// Set time component of position/displacement
+    void set_t(double tt)   { m_v4 = tt;    }
+    /// @deprecated Prefer the HepMC-style set_t() function
+    void setT(double tt)   { set_t(tt);    }
+
+
+    /// x-component of momentum
+    double px() const { return x(); }
+    /// Set x-component of momentum
+    void set_px(double pxx) { set_x(pxx);   }
+    /// @deprecated Prefer the HepMC-style set_px() function
+    void setPx(double pxx) { set_px(pxx);    }
+
+    /// y-component of momentum
+    double py() const { return y(); }
+    /// Set y-component of momentum
+    void set_py(double pyy) { set_y(pyy);   }
+    /// @deprecated Prefer the HepMC-style set_py() function
+    void setPy(double pyy) { set_py(pyy);    }
+
+    /// z-component of momentum
+    double pz() const { return z(); }
+    /// Set z-component of momentum
+    void set_pz(double pzz) { set_z(pzz);   }
+    /// @deprecated Prefer the HepMC-style set_pz() function
+    void setPz(double pzz) { set_pz(pzz);    }
+
+    /// Energy component of momentum
+    double e() const { return t(); }
+    /// Set energy component of momentum
+    void set_e(double ee ) { this->set_t(ee);    }
+    /// @deprecated Prefer the HepMC-style set_y() function
+    void setE(double ee) { set_e(ee);    }
+
+    //@}
+
+
+    /// @name Computed properties
+    //@{
+
+    /// Squared magnitude of (x, y, z) 3-vector
+    double length2()  const { return x()*x() + y()*y() + z()*z(); }
+    /// Magnitude of spatial (x, y, z) 3-vector
+    double length()  const { return sqrt(length2()); }
+    /// Squared magnitude of (x, y) vector
+    double perp2()      const { return  x()*x() + y()*y(); }
+    /// Magnitude of (x, y) vector
+    double perp()      const { return sqrt(perp2()); }
+    /// Spacetime invariant interval s^2 = t^2 - x^2 - y^2 - z^2
+    double interval() const { return t()*t() - length2(); }
+
+    /// Squared magnitude of p3 = (px, py, pz) vector
+    double p3mod2()       const { return length2(); }
+    /// Magnitude of p3 = (px, py, pz) vector
+    double p3mod()       const { return length(); }
+    /// Squared transverse momentum px^2 + py^2
+    double pt2()      const { return perp2(); }
+    /// Transverse momentum
+    double pt()      const { return perp(); }
+    /// Squared invariant mass m^2 = E^2 - px^2 - py^2 - pz^2
+    double m2()       const { return interval(); }
+    /// Invariant mass. Returns -sqrt(-m) if e^2 - P^2 is negative
+    double m() const { return (m2() > 0.0) ? std::sqrt(m2()) : -std::sqrt(-m2()); }
+
+    /// Azimuthal angle
+    double phi() const { return atan2( y(), x() ); }
+    /// Polar angle w.r.t. z direction
+    double theta() const {  return atan2( perp(), z() ); }
+    // /// Cosine of polar angle w.r.t. z direction
+    // double costheta() const {  return z() / p3mod(); }
+    /// Pseudorapidity
+    double eta() const  { return 0.5*std::log( (p3mod() + pz()) / (p3mod() - pz()) ); }
+    /// Rapidity
+    double rap() const {   return 0.5*std::log( (e() + pz()) / (e() - pz()) ); }
+    /// Absolute pseudorapidity
+    double abs_eta() const { return std::abs( eta() ); }
+    /// Absolute rapidity
+    double abs_rap() const { return std::abs( rap() ); }
+
+    /// Same as eta()
+    /// @deprecated Prefer 'only one way to do it', and we don't have equivalent long names for e.g. pid, phi or eta
+    double pseudoRapidity() const { return eta(); }
+
+    //@}
+
+
+    /// @name Comparisons to another FourVector
+    //@{
+
+    /// Check if the length of this vertex is zero
+    bool is_zero() const { return x() == 0 && y() == 0 && z() == 0 && t() == 0; }
+
+    /// Signed azimuthal angle separation in [-pi, pi]
+    double delta_phi(const FourVector &v) const {
+        double dphi = phi() - v.phi();
+        if (dphi != dphi) return dphi;
+        while (dphi >=  M_PI) dphi -= 2.*M_PI;
+        while (dphi <  -M_PI) dphi += 2.*M_PI;
+        return dphi;
+    }
+
+    /// Pseudorapidity separation
+    double delta_eta(const FourVector &v) const { return eta() - v.eta(); }
+
+    /// Rapidity separation
+    double delta_rap(const FourVector &v) const { return rap() - v.rap(); }
+
+    /// R_eta^2-distance separation dR^2 = dphi^2 + deta^2
+    double delta_r2_eta(const FourVector &v) const {
+        return delta_phi(v)*delta_phi(v) + delta_eta(v)*delta_eta(v);
+    }
+
+    /// R_eta-distance separation dR = sqrt(dphi^2 + deta^2)
+    double delta_r_eta(const FourVector &v) const {
+        return sqrt( delta_r2_eta(v) );
+    }
+
+    /// R_rap^2-distance separation dR^2 = dphi^2 + drap^2
+    double delta_r2_rap(const FourVector &v) const {
+        return delta_phi(v)*delta_phi(v) + delta_rap(v)*delta_rap(v);
+    }
+
+    /// R-rap-distance separation dR = sqrt(dphi^2 + drap^2)
+    double delta_r_rap(const FourVector &v) const {
+        return sqrt( delta_r2_rap(v) );
+    }
+
+    //@}
+
+
+    /// @name Operators
+    //@{
+
+    /// Equality
+    bool operator==(const FourVector& rhs) const {
+        return x() == rhs.x() && y() == rhs.y() && z() == rhs.z() && t() == rhs.t();
+    }
+    /// Inequality
+    bool operator!=(const FourVector& rhs) const { return !(*this == rhs); }
+
+    /// Arithmetic operator +
+    FourVector  operator+ (const FourVector& rhs) const {
+        return FourVector( x() + rhs.x(), y() + rhs.y(), z() + rhs.z(), t() + rhs.t() );
+    }
+    /// Arithmetic operator -
+    FourVector  operator- (const FourVector& rhs) const {
+        return FourVector( x() - rhs.x(), y() - rhs.y(), z() - rhs.z(), t() - rhs.t() );
+    }
+    /// Arithmetic operator * by scalar
+    FourVector  operator* (const double rhs) const {
+        return FourVector( x()*rhs, y()*rhs, z()*rhs, t()*rhs );
+    }
+    /// Arithmetic operator / by scalar
+    FourVector  operator/ (const double rhs) const {
+        return FourVector( x()/rhs, y()/rhs, z()/rhs, t()/rhs );
+    }
+
+    /// Arithmetic operator +=
+    void operator += (const FourVector& rhs) {
+        setX(x() + rhs.x());
+        setY(y() + rhs.y());
+        setZ(z() + rhs.z());
+        setT(t() + rhs.t());
+    }
+    /// Arithmetic operator -=
+    void operator -= (const FourVector& rhs) {
+        setX(x() - rhs.x());
+        setY(y() - rhs.y());
+        setZ(z() - rhs.z());
+        setT(t() - rhs.t());
+    }
+    /// Arithmetic operator *= by scalar
+    void operator *= (const double rhs) {
+        setX(x()*rhs);
+        setY(y()*rhs);
+        setZ(z()*rhs);
+        setT(t()*rhs);
+    }
+    /// Arithmetic operator /= by scalar
+    void operator /= (const double rhs) {
+        setX(x()/rhs);
+        setY(y()/rhs);
+        setZ(z()/rhs);
+        setT(t()/rhs);
+    }
+
+    //@}
+
+
+    /// Static null FourVector = (0,0,0,0)
+    static const FourVector& ZERO_VECTOR() {
+        static const FourVector v;
+        return v;
+    }
+
+
+private:
+
+    double m_v1; ///< px or x. Interpretation depends on accessors used
+    double m_v2; ///< py or y. Interpretation depends on accessors used
+    double m_v3; ///< pz or z. Interpretation depends on accessors used
+    double m_v4; ///< e  or t. Interpretation depends on accessors used
+
+};
+
+
+/// @name Unbound vector comparison functions
+//@{
+
+/// Signed azimuthal angle separation in [-pi, pi] between vecs @c a and @c b
+inline double delta_phi(const FourVector &a, const FourVector &b) { return b.delta_phi(a); }
+
+/// Pseudorapidity separation between vecs @c a and @c b
+inline double delta_eta(const FourVector &a, const FourVector &b) { return b.delta_eta(a); }
+
+/// Rapidity separation between vecs @c a and @c b
+inline double delta_rap(const FourVector &a, const FourVector &b) { return b.delta_rap(a); }
+
+/// R_eta^2-distance separation dR^2 = dphi^2 + deta^2 between vecs @c a and @c b
+inline double delta_r2_eta(const FourVector &a, const FourVector &b) { return b.delta_r2_eta(a); }
+
+/// R_eta-distance separation dR = sqrt(dphi^2 + deta^2) between vecs @c a and @c b
+inline double delta_r_eta(const FourVector &a, const FourVector &b) { return b.delta_r_eta(a); }
+
+/// R_rap^2-distance separation dR^2 = dphi^2 + drap^2 between vecs @c a and @c b
+inline double delta_r2_rap(const FourVector &a, const FourVector &b) { return b.delta_r2_rap(a); }
+
+/// R_rap-distance separation dR = sqrt(dphi^2 + drap^2) between vecs @c a and @c b
+inline double delta_r_rap(const FourVector &a, const FourVector &b) { return b.delta_r_rap(a); }
+
+//@}
+
+
+} // namespace HepMC3
+
+
+#endif
Index: external/HepMC3/include/HepMC3/GenCrossSection.h
===================================================================
--- external/HepMC3/include/HepMC3/GenCrossSection.h	(revision b30245b0657b11c14403abbcf01ed63b738a06b8)
+++ external/HepMC3/include/HepMC3/GenCrossSection.h	(revision b30245b0657b11c14403abbcf01ed63b738a06b8)
@@ -0,0 +1,161 @@
+// -*- C++ -*-
+//
+// This file is part of HepMC
+// Copyright (C) 2014-2020 The HepMC collaboration (see AUTHORS for details)
+//
+#ifndef HEPMC3_CROSS_SECTION_H
+#define HEPMC3_CROSS_SECTION_H
+/**
+ *  @file GenCrossSection.h
+ *  @brief Definition of attribute \b class GenCrossSection
+ *
+ *  @class HepMC3::GenCrossSection
+ *  @brief Stores additional information about cross-section
+ *
+ *  This is an example of event attribute used to store cross-section information
+ *
+ *  This class is meant to be used to pass, on an event by event basis,
+ *  the current best guess of the total cross section.
+ *  It is expected that the final cross section will be stored elsewhere.
+ *
+ *    - double cross_section;       // cross section in pb.
+ *    - double cross_section_error; // error associated with this cross section.
+ *    - long accepted_events;       ///< The number of events generated so far.
+ *    - long attempted_events;      ///< The number of events attempted so far.
+ *
+ *  In addition, several cross sections and related info can be
+ *  included in case of runs with mulltiple weights.
+ *
+ *  The units of cross_section and cross_section_error are expected to be pb.
+ *
+ *  @ingroup attributes
+ *
+ */
+#include <iostream>
+#include <algorithm>
+#include "HepMC3/Attribute.h"
+
+namespace HepMC3 {
+/** Deprecated */
+using namespace std;
+
+class GenCrossSection : public Attribute {
+
+//
+// Fields
+//
+private:
+
+    long accepted_events;       ///< The number of events generated so far.
+    long attempted_events;      ///< The number of events attempted so far.
+
+    std::vector<double> cross_sections;       ///< Per-weight cross-section.
+    std::vector<double> cross_section_errors; ///< Per-weight errors.
+//
+// Functions
+//
+public:
+    /** @brief Implementation of Attribute::from_string */
+    bool from_string(const std::string &att)  override;
+
+    /** @brief Implementation of Attribute::to_string */
+    bool to_string(std::string &att) const override;
+
+    /** @brief Set all fields */
+    void set_cross_section(const double& xs, const double& xs_err,const long& n_acc = -1, const long& n_att = -1);
+
+    /** @brief Set the number of accepted events
+     */
+    void set_accepted_events(const long& n_acc ) {
+        accepted_events=n_acc;
+    }
+
+    /** @brief Set the number of attempted events
+     */
+    void set_attempted_events(const long& n_att ) {
+        attempted_events=n_att;
+    }
+
+    /** @brief Get the number of accepted events
+     */
+    long get_accepted_events() const {
+        return accepted_events;
+    }
+
+    /** @brief Get the number of attempted events
+     */
+    long get_attempted_events() const {
+        return  attempted_events;
+    }
+
+    /** @brief Set the cross section  corresponding to the weight
+        named \a wName.
+     */
+    void set_xsec(const std::string& wName,const double& xs) {
+        set_xsec(windx(wName), xs);
+    }
+
+    /** @brief Set the cross section corresponding to the weight with
+        index \a indx.
+     */
+    void set_xsec(const int& indx, const double& xs) {
+        cross_sections[indx] = xs;
+    }
+
+    /** @brief Set the cross section error corresponding to the weight
+        named \a wName.
+     */
+    void set_xsec_err(const std::string& wName, const double& xs_err) {
+        set_xsec_err(windx(wName), xs_err);
+    }
+
+    /** @brief Set the cross section error corresponding to the weight
+        with index \a indx.
+     */
+    void set_xsec_err(const int& indx, const double& xs_err) {
+        cross_section_errors[indx] = xs_err;
+    }
+
+    /** @brief Get the cross section corresponding to the weight named
+        \a wName.
+     */
+    double xsec(const std::string& wName) const {
+        return xsec(windx(wName));
+    }
+
+    /** @brief Get the cross section corresponding to the weight with index
+        \a indx.
+     */
+    double xsec(const int& indx = 0) const {
+        return cross_sections[indx];
+    }
+
+    /** @brief Get the cross section error corresponding to the weight
+        named \a wName.
+     */
+    double xsec_err(const std::string& wName) const {
+        return xsec_err(windx(wName));
+    }
+
+    /** @brief Get the cross section error corresponding to the weight
+        with index \a indx.
+     */
+    double xsec_err(const int& indx = 0) const {
+        return cross_section_errors[indx];
+    }
+
+    bool operator==( const GenCrossSection& ) const; ///< Operator ==
+    bool operator!=( const GenCrossSection& ) const; ///< Operator !=
+    bool is_valid()                           const; ///< Verify that the instance contains non-zero information
+
+private:
+
+    /** @brief get the weight index given a weight name. */
+    int windx(std::string wName) const;
+
+};
+
+
+} // namespace HepMC3
+
+#endif
Index: external/HepMC3/include/HepMC3/GenCrossSection_fwd.h
===================================================================
--- external/HepMC3/include/HepMC3/GenCrossSection_fwd.h	(revision b30245b0657b11c14403abbcf01ed63b738a06b8)
+++ external/HepMC3/include/HepMC3/GenCrossSection_fwd.h	(revision b30245b0657b11c14403abbcf01ed63b738a06b8)
@@ -0,0 +1,25 @@
+// -*- C++ -*-
+//
+// This file is part of HepMC
+// Copyright (C) 2014-2020 The HepMC collaboration (see AUTHORS for details)
+//
+///
+/// @file GenCrossSection_fwd.h
+/// @brief Minimal forward declarations for GenCrossSection
+///
+
+#ifndef HEPMC3_GENCROSSSECTION_FWD_H
+#define HEPMC3_GENCROSSSECTION_FWD_H
+
+#include <memory>
+
+namespace HepMC3 {
+
+class GenCrossSection;
+
+using GenCrossSectionPtr = std::shared_ptr<GenCrossSection>;
+using ConstGenCrossSectionPtr = std::shared_ptr<const GenCrossSection>;
+
+}
+
+#endif
Index: external/HepMC3/include/HepMC3/GenEvent.h
===================================================================
--- external/HepMC3/include/HepMC3/GenEvent.h	(revision b30245b0657b11c14403abbcf01ed63b738a06b8)
+++ external/HepMC3/include/HepMC3/GenEvent.h	(revision b30245b0657b11c14403abbcf01ed63b738a06b8)
@@ -0,0 +1,426 @@
+// -*- C++ -*-
+//
+// This file is part of HepMC
+// Copyright (C) 2014-2020 The HepMC collaboration (see AUTHORS for details)
+//
+///
+/// @file GenEvent.h
+/// @brief Definition of \b class GenEvent
+///
+#ifndef HEPMC3_GENEVENT_H
+#define HEPMC3_GENEVENT_H
+
+#include "HepMC3/Units.h"
+#include "HepMC3/GenParticle_fwd.h"
+#include "HepMC3/GenVertex_fwd.h"
+#include "HepMC3/GenPdfInfo_fwd.h"
+#include "HepMC3/GenHeavyIon_fwd.h"
+#include "HepMC3/GenCrossSection_fwd.h"
+
+#if !defined(__CINT__)
+#include "HepMC3/GenHeavyIon.h"
+#include "HepMC3/GenPdfInfo.h"
+#include "HepMC3/GenCrossSection.h"
+#include "HepMC3/GenRunInfo.h"
+#include <mutex>
+#endif // __CINT__
+
+#ifdef HEPMC3_ROOTIO
+class TBuffer;
+#endif
+
+
+namespace HepMC3 {
+
+struct GenEventData;
+
+/// @brief Stores event-related information
+///
+/// Manages event-related information.
+/// Contains lists of GenParticle and GenVertex objects
+class GenEvent {
+
+public:
+
+    /// @brief Event constructor without a run
+    GenEvent(Units::MomentumUnit momentum_unit = Units::GEV,
+             Units::LengthUnit length_unit = Units::MM);
+
+#if !defined(__CINT__)
+
+    /// @brief Constructor with associated run
+    GenEvent(std::shared_ptr<GenRunInfo> run,
+             Units::MomentumUnit momentum_unit = Units::GEV,
+             Units::LengthUnit length_unit = Units::MM);
+
+    /// @brief Copy constructor
+    GenEvent(const GenEvent&);
+
+    /// @brief Destructor
+    ~GenEvent();
+
+    /// @brief Assignment operator
+    GenEvent& operator=(const GenEvent&);
+
+    /// @name Particle and vertex access
+    //@{
+
+    /// @brief Get list of particles (const)
+    const std::vector<ConstGenParticlePtr>& particles() const;
+    /// @brief Get list of vertices (const)
+    const std::vector<ConstGenVertexPtr>& vertices() const;
+
+
+    /// @brief Get/set list of particles (non-const)
+    const std::vector<GenParticlePtr>& particles() { return m_particles; }
+    /// @brief Get/set list of vertices (non-const)
+    const std::vector<GenVertexPtr>& vertices() { return m_vertices; }
+
+    //@}
+
+
+    /// @name Event weights
+    //@{
+
+    /// Get event weight values as a vector
+    const std::vector<double>& weights() const { return m_weights; }
+    /// Get event weights as a vector (non-const)
+    std::vector<double>& weights() { return m_weights; }
+    /// Get event weight accessed by index (or the canonical/first one if there is no argument)
+    /// @note It's the user's responsibility to ensure that the given index exists!
+    double weight(const unsigned long& index=0) const { return weights().at(index); }
+    /// Get event weight accessed by weight name
+    /// @note Requires there to be an attached GenRunInfo, otherwise will throw an exception
+    /// @note It's the user's responsibility to ensure that the given name exists!
+    double weight(const std::string& name) const {
+        if (!run_info()) throw std::runtime_error("GenEvent::weight(str): named access to event weights requires the event to have a GenRunInfo");
+        return weight(run_info()->weight_index(name));
+    }
+    /// Get event weight accessed by weight name
+    /// @note Requires there to be an attached GenRunInfo, otherwise will throw an exception
+    /// @note It's the user's responsibility to ensure that the given name exists!
+    double& weight(const std::string& name) {
+        if (!run_info()) throw std::runtime_error("GenEvent::weight(str): named access to event weights requires the event to have a GenRunInfo");
+        int pos=run_info()->weight_index(name);
+        if (pos<0) throw std::runtime_error("GenEvent::weight(str): no weight with given name in this run");
+        return m_weights[pos];
+    }
+    /// Get event weight names, if there are some
+    /// @note Requires there to be an attached GenRunInfo with registered weight names, otherwise will throw an exception
+    const std::vector<std::string>& weight_names() const {
+        if (!run_info()) throw std::runtime_error("GenEvent::weight_names(): access to event weight names requires the event to have a GenRunInfo");
+        const std::vector<std::string>& weightnames = run_info()->weight_names();
+        if (weightnames.empty()) throw std::runtime_error("GenEvent::weight_names(): no event weight names are registered for this run");
+        return weightnames;
+    }
+
+    //@}
+
+
+    /// @name Auxiliary info and event metadata
+    //@{
+
+    /// @brief Get a pointer to the the GenRunInfo object.
+    std::shared_ptr<GenRunInfo> run_info() const {
+        return m_run_info;
+    }
+    /// @brief Set the GenRunInfo object by smart pointer.
+    void set_run_info(std::shared_ptr<GenRunInfo> run) {
+        m_run_info = run;
+        if ( run && !run->weight_names().empty() )
+            m_weights.resize(run->weight_names().size(), 1.0);
+    }
+
+    /// @brief Get event number
+    int  event_number() const { return m_event_number; }
+    /// @brief Set event number
+    void set_event_number(const int& num) { m_event_number = num; }
+
+    /// @brief Get momentum unit
+    const Units::MomentumUnit& momentum_unit() const { return m_momentum_unit; }
+    /// @brief Get length unit
+    const Units::LengthUnit& length_unit() const { return m_length_unit; }
+    /// @brief Change event units
+    /// Converts event from current units to new ones
+    void set_units( Units::MomentumUnit new_momentum_unit, Units::LengthUnit new_length_unit);
+
+    /// @brief Get heavy ion generator additional information
+    GenHeavyIonPtr heavy_ion() { return attribute<GenHeavyIon>("GenHeavyIon"); }
+    /// @brief Get heavy ion generator additional information (const version)
+    ConstGenHeavyIonPtr heavy_ion() const { return attribute<GenHeavyIon>("GenHeavyIon"); }
+    /// @brief Set heavy ion generator additional information
+    void set_heavy_ion(GenHeavyIonPtr hi) { add_attribute("GenHeavyIon",hi); }
+
+    /// @brief Get PDF information
+    GenPdfInfoPtr pdf_info() { return attribute<GenPdfInfo>("GenPdfInfo"); }
+    /// @brief Get PDF information (const version)
+    ConstGenPdfInfoPtr pdf_info() const { return attribute<GenPdfInfo>("GenPdfInfo"); }
+    /// @brief Set PDF information
+    void set_pdf_info(GenPdfInfoPtr pi) { add_attribute("GenPdfInfo",pi); }
+
+    /// @brief Get cross-section information
+    GenCrossSectionPtr cross_section() { return attribute<GenCrossSection>("GenCrossSection"); }
+    /// @brief Get cross-section information (const version)
+    ConstGenCrossSectionPtr cross_section() const { return attribute<GenCrossSection>("GenCrossSection"); }
+    /// @brief Set cross-section information
+    void set_cross_section(GenCrossSectionPtr cs) { add_attribute("GenCrossSection",cs); }
+
+    //@}
+
+
+    /// @name Event position
+    //@{
+
+    /// Vertex representing the overall event position
+    const FourVector& event_pos() const;
+
+    /// @brief Vector of beam particles
+    std::vector<ConstGenParticlePtr> beams() const;
+
+    /// @brief Vector of beam particles
+    const std::vector<GenParticlePtr> & beams();
+
+    /// @brief Shift position of all vertices in the event by @a delta
+    void shift_position_by( const FourVector & delta );
+
+    /// @brief Shift position of all vertices in the event to @a op
+    void shift_position_to( const FourVector & newpos ) {
+        const FourVector delta = newpos - event_pos();
+        shift_position_by(delta);
+    }
+
+    /// @brief Boost event using x,y,z components of @a v as velocities
+    bool boost( const FourVector&  v );
+    /// @brief Rotate event using x,y,z components of @a v as rotation angles
+    bool rotate( const FourVector&  v );
+    /// @brief Change sign of @a axis
+    bool reflect(const int axis);
+
+    //@}
+
+
+    /// @name Additional attributes
+    //@{
+    /// @brief Add event attribute to event
+    ///
+    /// This will overwrite existing attribute if an attribute
+    /// with the same name is present
+    void add_attribute(const std::string &name, const std::shared_ptr<Attribute> &att,  const int& id = 0) {
+        ///Disallow empty strings
+        if (name.length()==0) return;     
+        if (!att)  return;
+        std::lock_guard<std::recursive_mutex> lock(m_lock_attributes);
+        if (m_attributes.count(name)==0) m_attributes[name]=std::map<int, std::shared_ptr<Attribute> >();
+        m_attributes[name][id] = att;
+        att->m_event = this;
+        if ( id > 0 && id <= int(particles().size()) )
+            att->m_particle = particles()[id - 1];
+        if ( id < 0 && -id <= int(vertices().size()) )
+            att->m_vertex = vertices()[-id - 1];
+    }
+
+    /// @brief Remove attribute
+    void remove_attribute(const std::string &name,  const int& id = 0);
+
+    /// @brief Get attribute of type T
+    template<class T>
+    std::shared_ptr<T> attribute(const std::string &name,  const int& id = 0) const;
+
+    /// @brief Get attribute of any type as string
+    std::string attribute_as_string(const std::string &name,  const int& id = 0) const;
+
+    /// @brief Get list of attribute names
+    std::vector<std::string> attribute_names( const int& id = 0) const;
+
+    /// @brief Get a copy of the list of attributes
+    /// @note To avoid thread issues, this is returns a copy. Better solution may be needed.
+    std::map< std::string, std::map<int, std::shared_ptr<Attribute> > > attributes() const {
+        std::lock_guard<std::recursive_mutex> lock(m_lock_attributes);
+        return m_attributes;
+    }
+
+    //@}
+
+
+    /// @name Particle and vertex modification
+    //@{
+
+    /// @brief Add particle
+    void add_particle( GenParticlePtr p );
+
+    /// @brief Add vertex
+    void add_vertex( GenVertexPtr v );
+
+    /// @brief Remove particle from the event
+    ///
+    /// This function  will remove whole sub-tree starting from this particle
+    /// if it is the only incoming particle of this vertex.
+    /// It will also production vertex of this particle if this vertex
+    /// has no more outgoing particles
+    void remove_particle( GenParticlePtr v );
+
+    /// @brief Remove a set of particles
+    ///
+    /// This function follows rules of GenEvent::remove_particle to remove
+    /// a list of particles from the event.
+    void remove_particles( std::vector<GenParticlePtr> v );
+
+    /// @brief Remove vertex from the event
+    ///
+    /// This will remove all sub-trees of all outgoing particles of this vertex
+    void remove_vertex( GenVertexPtr v );
+
+    /// @brief Add whole tree in topological order
+    ///
+    /// This function will find the beam particles (particles
+    /// that have no production vertices or their production vertices
+    /// have no particles) and will add the whole decay tree starting from
+    /// these particles.
+    ///
+    /// @note Any particles on this list that do not belong to the tree
+    ///       will be ignored.
+    void add_tree( const std::vector<GenParticlePtr> &particles );
+
+    /// @brief Reserve memory for particles and vertices
+    ///
+    /// Helps optimize event creation when size of the event is known beforehand
+    void reserve(const size_t& particles, const size_t& vertices = 0);
+
+    /// @brief Remove contents of this event
+    void clear();
+
+    //@}
+
+    /// @name Deprecated functionality
+    //@{
+
+    /// @brief Add particle by raw pointer
+    /// @deprecated Use GenEvent::add_particle( const GenParticlePtr& ) instead
+    void add_particle( GenParticle *p );
+
+    /// @brief Add vertex by raw pointer
+    /// @deprecated Use GenEvent::add_vertex( const GenVertexPtr& ) instead
+    void add_vertex  ( GenVertex *v );
+
+
+    /// @brief Set incoming beam particles
+    /// @deprecated Backward compatibility
+    void set_beam_particles(GenParticlePtr p1, GenParticlePtr p2);
+
+
+    /// @brief Add  particle to root vertex
+
+    void add_beam_particle(GenParticlePtr p1);
+
+
+    //@}
+
+#endif // __CINT__
+
+
+    /// @name Methods to fill GenEventData and to read it back
+    //@{
+
+    /// @brief Fill GenEventData object
+    void write_data(GenEventData &data) const;
+
+    /// @brief Fill GenEvent based on GenEventData
+    void read_data(const GenEventData &data);
+
+#ifdef HEPMC3_ROOTIO
+    /// @brief ROOT I/O streamer
+    void Streamer(TBuffer &b);
+    //@}
+#endif
+
+private:
+
+    /// @name Fields
+    //@{
+
+#if !defined(__CINT__)
+
+    /// List of particles
+    std::vector<GenParticlePtr> m_particles;
+    /// List of vertices
+    std::vector<GenVertexPtr> m_vertices;
+
+    /// Event number
+    int m_event_number;
+
+    /// Event weights
+    std::vector<double> m_weights;
+
+    /// Momentum unit
+    Units::MomentumUnit m_momentum_unit;
+    /// Length unit
+    Units::LengthUnit m_length_unit;
+
+    /// The root vertex is stored outside the normal vertices list to block user access to it
+    GenVertexPtr m_rootvertex;
+
+    /// Global run information.
+    std::shared_ptr<GenRunInfo> m_run_info;
+
+    /// @brief Map of event, particle and vertex attributes
+    ///
+    /// Keys are name and ID (0 = event, <0 = vertex, >0 = particle)
+    mutable std::map< std::string, std::map<int, std::shared_ptr<Attribute> > > m_attributes;
+
+    /// @brief Attribute map key type
+    typedef std::map< std::string, std::map<int, std::shared_ptr<Attribute> > >::value_type att_key_t;
+
+    /// @brief Attribute map value type
+    typedef std::map<int, std::shared_ptr<Attribute> >::value_type att_val_t;
+
+    /// @brief Mutex lock for the m_attibutes map.
+    mutable std::recursive_mutex m_lock_attributes;
+#endif // __CINT__
+
+    //@}
+
+};
+
+#if !defined(__CINT__)
+//
+// Template methods
+//
+template<class T>
+std::shared_ptr<T> GenEvent::attribute(const std::string &name,  const int& id) const {
+    std::lock_guard<std::recursive_mutex> lock(m_lock_attributes);
+    std::map< std::string, std::map<int, std::shared_ptr<Attribute> > >::iterator i1 =
+        m_attributes.find(name);
+    if( i1 == m_attributes.end() ) {
+        if ( id == 0 && run_info() ) {
+            return run_info()->attribute<T>(name);
+        }
+        return std::shared_ptr<T>();
+    }
+
+    std::map<int, std::shared_ptr<Attribute> >::iterator i2 = i1->second.find(id);
+    if (i2 == i1->second.end() ) return std::shared_ptr<T>();
+
+    if (!i2->second->is_parsed() ) {
+
+        std::shared_ptr<T> att = std::make_shared<T>();
+        att->m_event = this;
+
+        if ( id > 0 && id <= int(particles().size()) )
+            att->m_particle = m_particles[id - 1];
+        if ( id < 0 && -id <= int(vertices().size()) )
+            att->m_vertex = m_vertices[-id - 1];
+        if ( att->from_string(i2->second->unparsed_string()) &&
+                att->init() ) {
+            // update map with new pointer
+            i2->second = att;
+            return att;
+        } else {
+            return std::shared_ptr<T>();
+        }
+    }
+    else return std::dynamic_pointer_cast<T>(i2->second);
+}
+#endif // __CINT__
+
+} // namespace HepMC3
+#endif
Index: external/HepMC3/include/HepMC3/GenHeavyIon.h
===================================================================
--- external/HepMC3/include/HepMC3/GenHeavyIon.h	(revision b30245b0657b11c14403abbcf01ed63b738a06b8)
+++ external/HepMC3/include/HepMC3/GenHeavyIon.h	(revision b30245b0657b11c14403abbcf01ed63b738a06b8)
@@ -0,0 +1,254 @@
+// -*- C++ -*-
+//
+// This file is part of HepMC
+// Copyright (C) 2014-2020 The HepMC collaboration (see AUTHORS for details)
+//
+#ifndef HEPMC3_HEAVYION_H
+#define HEPMC3_HEAVYION_H
+/**
+ *  @file GenHeavyIon.h
+ *  @brief Definition of attribute \b class GenHeavyIon
+ *
+ *  @class HepMC3::GenHeavyIon
+ *  @brief Stores additional information about Heavy Ion generator
+ *
+ *  This is an example of event attribute used to store Heavy Ion information
+ *
+ *  @ingroup attributes
+ *
+ */
+#include <iostream>
+#include <map>
+#include "HepMC3/Attribute.h"
+
+namespace HepMC3 {
+/** Deprecated */
+using namespace std;
+
+class GenHeavyIon : public Attribute {
+
+public:
+
+    /// Empty default constructor.
+    GenHeavyIon()
+        : Ncoll_hard(-1), Npart_proj(-1), Npart_targ(-1), Ncoll(-1),
+#ifndef HEPMC3_NO_DEPRECATED
+          spectator_neutrons(-1), spectator_protons(-1),
+#endif
+          N_Nwounded_collisions(-1), Nwounded_N_collisions(-1),
+          Nwounded_Nwounded_collisions(-1), impact_parameter(-1.0),
+          event_plane_angle(-1.0),
+#ifndef HEPMC3_NO_DEPRECATED
+          eccentricity(-1.0),
+#endif
+          sigma_inel_NN(-1.0), centrality(-1.0), user_cent_estimate(-1.0),
+          Nspec_proj_n(-1), Nspec_targ_n(-1),
+          Nspec_proj_p(-1), Nspec_targ_p(-1), forceoldformat(false) {}
+
+//
+// Fields
+//
+public:
+
+    ///
+    /// @brief the number of hard nucleon-nucleon collisions.
+    ///
+    /// Model-dependent. Usually the number of nucleon-nucleon
+    /// collisions containing a special signal process. A negative
+    /// value means that the information is not available.
+    int    Ncoll_hard;
+
+    /// @brief the number of participating nucleons in the projectile.
+    ///
+    /// The number of nucleons in the projectile participating in an
+    /// inelastic collision (see Ncoll). A negative value means that
+    /// the information is not available.
+    int    Npart_proj;
+
+    /// @brief the number of participating nucleons in the target.
+    ///
+    /// The number of nucleons in the target participating in an
+    /// inelastic collision (see Ncoll). A negative value means that
+    /// the information is not available.
+    int    Npart_targ;
+
+    /// @brief the number of inelastic nucleon-nucleon collisions.
+    ///
+    /// Note that a one participating nucleon can be involved in many
+    /// inelastic collisions, and that inelastic also includes
+    /// diffractive excitation. A negative value means that the
+    /// information is not available.
+    ///
+    int    Ncoll;
+
+#ifndef HEPMC3_NO_DEPRECATED
+    /// @brief Total number of spectator neutrons.
+    ///
+    /// HEPMC3_DEPRECATED("Use Nspec_proj_n and Nspec_targ_n instead.")
+    int    spectator_neutrons;
+
+    /// @brief Total number of spectator protons.
+    ///
+    /// HEPMC3_DEPRECATED("Use Nspec_proj_p and Nspec_targ_p instead.")
+    int    spectator_protons;
+#endif
+
+    /// @brief Collisions with a diffractively excited target nucleon.
+    ///
+    /// The number of single diffractive nucleon-nucleon collisions
+    /// where the target nucleon is excited. A negative value means
+    /// that the information is not available.
+    int    N_Nwounded_collisions;
+
+    /// @brief Collisions with a diffractively excited projectile nucleon.
+    ///
+    /// The number of single diffractive nucleon-nucleon collisions
+    /// where the projectile nucleon is excited. A negative value
+    /// means that the information is not available.
+    int    Nwounded_N_collisions;
+
+    /// @brief Non-diffractive or doubly diffractive collisions.
+    ///
+    /// The number of nucleon-nucleon collisions where both projectile
+    /// and target nucleons are wounded. A negative value means that
+    /// the information is not available.
+    int    Nwounded_Nwounded_collisions;
+
+    /// @brief The impact parameter.
+    ///
+    /// The impact parameter given in units of femtometer. A negative
+    /// value means that the information is not available.
+    double impact_parameter;
+
+    /// @brief The event plane angle.
+    ///
+    /// The angle wrt. the x-axix of the impact parameter vector
+    /// (pointing frm the target to the projectile). A positive number
+    /// between 0 and two pi. A negative value means that the
+    /// information is not available.
+    double event_plane_angle;
+
+#ifndef HEPMC3_NO_DEPRECATED
+    /// @brief The eccentricity.
+    ///
+    /// HEPMC3_DEPRECATED("Use eccentricities insted.")
+    double eccentricity;
+#endif
+
+    /// @brief The assumed inelastic nucleon-nucleon cross section
+    ///
+    /// in units of millibarn. As used in a Glauber calculation to
+    /// simulate the distribution in Ncoll. A negative value means
+    /// that the information is not available.
+    double sigma_inel_NN;
+
+    /// @brief The centrality.
+    ///
+    /// The generated centrality in percentiles, where 0 is the
+    /// maximally central and 100 is the minimally central. A negative
+    /// value means that the information is not available.
+    double centrality;
+
+    /// @brief A user defined centrality estimator.
+    ///
+    /// This variable may contain anything a generator feels is
+    /// reasonable for estimating centrality. The value should be
+    /// non-negative, and a low value corresponds to a low
+    /// centrality. A negative value indicatess that the information
+    /// is not available.
+    double user_cent_estimate;
+
+
+    /// @brief The number of spectator neutrons in the projectile
+    ///
+    /// ie. those that thave not participated in any inelastic
+    /// nucleon-nucleon collision. A negative value indicatess that
+    /// the information is not available.
+    int Nspec_proj_n;
+
+    /// @brief The number of spectator neutrons in the target
+    ///
+    /// ie. those that thave not participated in any inelastic
+    /// nucleon-nucleon collision. A negative value indicatess that
+    /// the information is not available.
+    int Nspec_targ_n;
+
+    /// @brief The number of spectator protons in the projectile
+    ///
+    /// ie. those that thave not participated in any inelastic
+    /// nucleon-nucleon collision. A negative value indicatess that
+    /// the information is not available.
+    int Nspec_proj_p;
+
+    /// @brief The number of spectator protons in the target
+    ///
+    /// ie. those that thave not participated in any inelastic
+    /// nucleon-nucleon collision. A negative value indicatess that
+    /// the information is not available.
+    int Nspec_targ_p;
+
+    /// @brief Participant plane angles
+    ///
+    /// calculated to different orders. The key of the map specifies
+    /// the order, and the value gives to the angle wrt. the
+    /// event plane.
+    std::map<int,double> participant_plane_angles;
+
+    /// @brief Eccentricities
+    ///
+    /// Calculated to different orders. The key of the map specifies
+    /// the order, and the value gives the corresponding eccentricity.
+    std::map<int,double> eccentricities;
+
+//
+// Functions
+//
+public:
+
+    /// @brief Implementation of Attribute::from_string.
+    bool from_string(const std::string &att) override;
+
+    /// @brief Implementation of Attribute::to_string.
+    bool to_string(std::string &att) const  override;
+
+#ifndef HEPMC3_NO_DEPRECATED
+
+    /// @brief Operator ==
+    ///
+    bool operator==( const GenHeavyIon& ) const;
+    /// @brief Operator !=
+    ///
+    bool operator!=( const GenHeavyIon& ) const;
+
+    /// @brief Set all fields.
+    ///
+    /// HEPMC3_DEPRECATED("Set individual fields directly instead.")
+    /** @brief Set all fields */
+    void set( const int&nh, const int&np, const int&nt, const int&nc, const int&ns, const int&nsp,
+              const int&nnw=0, const int&nwn=0, const int&nwnw=0,
+              const double& im=0., const double& pl=0., const double& ec=0., const double& s=0., const double& cent=0., const double& ucent=0. );
+
+    /// @brief Verify that the instance contains non-zero information.
+    ///
+    /// HEPMC3_DEPRECATED("Each filed now have default values meaning
+    /// that they have not been set")
+    bool is_valid() const;
+
+    /// @brief force writing in old format for compatibility purposes.
+    ///
+    /// HEPMC3_DEPRECATED("This should really not be needed");
+    bool forceoldformat;
+
+#endif
+
+};
+
+
+#ifndef HEPMC3_NO_DEPRECATED
+typedef GenHeavyIon HeavyIon; ///< Backward compatibility typedef
+#endif
+
+
+} // namespace HepMC3
+
+#endif
Index: external/HepMC3/include/HepMC3/GenHeavyIon_fwd.h
===================================================================
--- external/HepMC3/include/HepMC3/GenHeavyIon_fwd.h	(revision b30245b0657b11c14403abbcf01ed63b738a06b8)
+++ external/HepMC3/include/HepMC3/GenHeavyIon_fwd.h	(revision b30245b0657b11c14403abbcf01ed63b738a06b8)
@@ -0,0 +1,25 @@
+// -*- C++ -*-
+//
+// This file is part of HepMC
+// Copyright (C) 2014-2020 The HepMC collaboration (see AUTHORS for details)
+//
+///
+/// @file GenHeavyIon_fwd.h
+/// @brief Minimal forward declarations for GenHeavyIon
+///
+
+#ifndef HEPMC3_GENHEAVYION_FWD_H
+#define HEPMC3_GENHEAVYION_FWD_H
+
+#include <memory>
+
+namespace HepMC3 {
+
+class GenHeavyIon;
+
+using GenHeavyIonPtr = std::shared_ptr<GenHeavyIon>;
+using ConstGenHeavyIonPtr = std::shared_ptr<const GenHeavyIon>;
+
+}
+
+#endif
Index: external/HepMC3/include/HepMC3/GenParticle.h
===================================================================
--- external/HepMC3/include/HepMC3/GenParticle.h	(revision b30245b0657b11c14403abbcf01ed63b738a06b8)
+++ external/HepMC3/include/HepMC3/GenParticle.h	(revision b30245b0657b11c14403abbcf01ed63b738a06b8)
@@ -0,0 +1,163 @@
+// -*- C++ -*-
+//
+// This file is part of HepMC
+// Copyright (C) 2014-2020 The HepMC collaboration (see AUTHORS for details)
+//
+#ifndef HEPMC3_GENPARTICLE_H
+#define HEPMC3_GENPARTICLE_H
+/**
+ *  @file GenParticle.h
+ *  @brief Definition of \b class GenParticle
+ *
+ *  @class HepMC3::GenParticle
+ *  @brief Stores particle-related information
+ *
+ */
+#include <string>
+#include "HepMC3/Data/GenParticleData.h"
+#include "HepMC3/FourVector.h"
+
+#include "HepMC3/GenParticle_fwd.h"
+#include "HepMC3/GenVertex_fwd.h"
+
+namespace HepMC3 {
+
+/** Deprecated */
+using namespace std;
+
+class GenEvent;
+class Attribute;
+
+class GenParticle : public std::enable_shared_from_this<GenParticle> {
+
+    friend class GenVertex;
+    friend class GenEvent;
+
+//
+// Constructors
+//
+public:
+    /** @brief Default constructor */
+    GenParticle( const FourVector &momentum = FourVector::ZERO_VECTOR(), int pid = 0, int status = 0 );
+
+    /** @brief Constructor based on particle data */
+    GenParticle( const GenParticleData &data );
+
+//
+// Functions
+//
+public:
+    /** @brief Check if this particle belongs to an event */
+    bool in_event() const { return (bool)(m_event); }
+
+//
+// Accessors
+//
+public:
+
+    GenEvent*              parent_event() { return m_event; } //!< Get parent event
+    const GenEvent*              parent_event() const { return m_event; } //!< Get parent event
+    int                    id()           const { return m_id;    } //!< Get particle id
+    const GenParticleData& data()         const { return m_data;  } //!< Get particle data
+
+
+    ConstGenVertexPtr production_vertex() const;        //!< Get production vertex (const version)
+    ConstGenVertexPtr end_vertex() const;               //!< Get end vertex (const version)
+
+    GenVertexPtr production_vertex();        //!< Get production vertex
+    GenVertexPtr end_vertex();               //!< Get end vertex
+
+    /// @brief Convenience access to immediate incoming particles via production vertex
+    /// @note Less efficient than via the vertex since return must be by value (in case there is no vertex)
+    std::vector<GenParticlePtr> parents();
+
+    /// @brief Convenience access to immediate incoming particles via production vertex (const version)
+    /// @note Less efficient than via the vertex since return must be by value (in case there is no vertex)
+    std::vector<ConstGenParticlePtr> parents() const;
+
+    /// @brief Convenience access to immediate outgoing particles via end vertex
+    /// @note Less efficient than via the vertex since return must be by value (in case there is no vertex)
+    std::vector<GenParticlePtr> children();
+
+    /// @brief Convenience access to immediate outgoing particles via end vertex
+    /// @note Less efficient than via the vertex since return must be by value (in case there is no vertex)
+    std::vector<ConstGenParticlePtr> children() const;
+
+    int   pid()                   const { return m_data.pid;            } //!< Get PDG ID
+    int   abs_pid()               const { return abs(pid());            } //!< Get absolute value of PDG ID
+    int   status()                const { return m_data.status;         } //!< Get status code
+    const FourVector& momentum()  const { return m_data.momentum;       } //!< Get momentum
+    bool  is_generated_mass_set() const { return m_data.is_mass_set;    } //!< Check if generated mass is set
+
+    /// @brief Get generated mass
+    ///
+    /// This function will return mass as set by a generator/tool.
+    /// If not set, it will return momentum().m()
+    double generated_mass() const;
+
+
+    void set_pid(int pid);                         //!< Set PDG ID
+    void set_status(int status);                   //!< Set status code
+    void set_momentum(const FourVector& momentum); //!< Set momentum
+    void set_generated_mass(double m);             //!< Set generated mass
+    void unset_generated_mass();                   //!< Declare that generated mass is not set
+
+    /** @brief Add an attribute to this particle
+     *
+     *  This will overwrite existing attribute if an attribute with
+     *  the same name is present. The attribute will be stored in the
+     *  parent_event(). @return false if there is no parent_event();
+     */
+    bool add_attribute(const std::string& name, std::shared_ptr<Attribute> att);
+
+    /// @brief Get list of names of attributes assigned to this particle
+    std::vector<std::string> attribute_names() const;
+
+    /// @brief Remove attribute
+    void remove_attribute(const std::string& name);
+
+    /// @brief Get attribute of type T
+    template<class T>
+    std::shared_ptr<T> attribute(const std::string& name) const;
+
+    /// @brief Get attribute of any type as string
+    std::string attribute_as_string(const std::string& name) const;
+
+
+    /// @name Deprecated functionality
+    //@{
+
+    /// @brief Get PDG ID
+    /// @deprecated Use pid() instead
+    int pdg_id() const { return pid(); }
+
+    /// @brief Set PDG ID
+    /// @deprecated Use set_pid() instead
+    void set_pdg_id(const int& pidin) { set_pid(pidin); }
+
+
+    //@}
+//
+// Fields
+//
+private:
+    GenEvent        *m_event; //!< Parent event
+    int              m_id;    //!< Index
+    GenParticleData  m_data;  //!< Particle data
+
+    std::weak_ptr<GenVertex>    m_production_vertex; //!< Production vertex
+    std::weak_ptr<GenVertex>    m_end_vertex;        //!< End vertex
+//    weak_ptr<GenParticle>  m_this;              //!< Pointer to shared pointer managing this particle
+};
+
+} // namespace HepMC3
+
+#include "HepMC3/GenEvent.h"
+namespace HepMC3 {
+/// @brief Get attribute of type T
+template<class T> std::shared_ptr<T> GenParticle::attribute(const std::string& name) const {
+    return parent_event()?
+           parent_event()->attribute<T>(name, id()): std::shared_ptr<T>();
+}
+}
+#endif
Index: external/HepMC3/include/HepMC3/GenParticle_fwd.h
===================================================================
--- external/HepMC3/include/HepMC3/GenParticle_fwd.h	(revision b30245b0657b11c14403abbcf01ed63b738a06b8)
+++ external/HepMC3/include/HepMC3/GenParticle_fwd.h	(revision b30245b0657b11c14403abbcf01ed63b738a06b8)
@@ -0,0 +1,35 @@
+// -*- C++ -*-
+//
+// This file is part of HepMC
+// Copyright (C) 2014-2020 The HepMC collaboration (see AUTHORS for details)
+//
+///
+/// @file GenParticle_fwd.h
+/// @brief Minimal forward declarations for GenParticle
+///
+
+#ifndef HEPMC3_GENPARTICLE_FWD_H
+#define HEPMC3_GENPARTICLE_FWD_H
+
+#include <memory>
+#include <vector>
+
+namespace HepMC3 {
+
+class GenParticle;
+
+using GenParticlePtr = std::shared_ptr<GenParticle>;
+using ConstGenParticlePtr = std::shared_ptr<const GenParticle>;
+
+using GenParticles = std::vector<GenParticlePtr>;
+using ConstGenParticles = std::vector<ConstGenParticlePtr>;
+
+/// An alias to a vector of GenParticle pointers whose constness depends on the
+/// constness of the template shared_ptr param
+/// This is convenient for declaring the return types based on the input type
+template<typename T>
+using GenParticles_type = typename std::conditional<std::is_const<typename T::element_type>::value, ConstGenParticles, GenParticles>::type;
+
+}
+
+#endif
Index: external/HepMC3/include/HepMC3/GenPdfInfo.h
===================================================================
--- external/HepMC3/include/HepMC3/GenPdfInfo.h	(revision b30245b0657b11c14403abbcf01ed63b738a06b8)
+++ external/HepMC3/include/HepMC3/GenPdfInfo.h	(revision b30245b0657b11c14403abbcf01ed63b738a06b8)
@@ -0,0 +1,66 @@
+// -*- C++ -*-
+//
+// This file is part of HepMC
+// Copyright (C) 2014-2020 The HepMC collaboration (see AUTHORS for details)
+//
+#ifndef HEPMC3_GENPDFINFO_H
+#define HEPMC3_GENPDFINFO_H
+/**
+ *  @file GenPdfInfo.h
+ *  @brief Definition of event attribute \b class GenPdfInfo
+ *
+ *  @class HepMC3::GenPdfInfo
+ *  @brief Stores additional information about PDFs
+ *
+ *  This is an example of event attribute used to store PDF-related information
+ *
+ *  @note Input parton flavour codes id1 & id2 are expected to obey the
+ *        PDG code conventions, especially g = 21.
+ *
+ *  @note The contents of pdf1 and pdf2 are expected to be x*f(x).
+ *        The LHAPDF set ids are the entries in the first column of
+ *        http:///projects.hepforge.org/lhapdf/PDFsets.index
+ *
+ *  @ingroup attributes
+ *
+ */
+#include <iostream>
+#include "HepMC3/Attribute.h"
+
+namespace HepMC3 {
+
+class GenPdfInfo : public Attribute {
+
+//
+// Fields
+//
+public:
+    int    parton_id[2]; ///< Parton PDG ID
+    int    pdf_id[2];    ///< LHAPDF ID code
+    double scale;        ///< Factorisation scale (in GEV)
+    double x[2];         ///< Parton momentum fraction
+    double xf[2];        ///< PDF value
+
+//
+// Functions
+//
+public:
+    /** @brief Implementation of Attribute::from_string */
+    bool from_string(const std::string &att)  override;
+
+    /** @brief Implementation of Attribute::to_string */
+    bool to_string(std::string &att) const  override;
+
+    /** @brief Set all fields */
+    void set( const int& parton_id1, const int& parton_id2, const double& x1, const double& x2,
+              const double& scale_in, const double& xf1, const double& xf2,
+              const int& pdf_id1 = 0, const int& pdf_id2 = 0 );
+
+    bool operator==( const GenPdfInfo& ) const; ///< Operator ==
+    bool operator!=( const GenPdfInfo& ) const; ///< Operator !=
+    bool is_valid()                      const; ///< Verify that the instance contains non-zero information
+};
+
+} // namespace HepMC3
+
+#endif
Index: external/HepMC3/include/HepMC3/GenPdfInfo_fwd.h
===================================================================
--- external/HepMC3/include/HepMC3/GenPdfInfo_fwd.h	(revision b30245b0657b11c14403abbcf01ed63b738a06b8)
+++ external/HepMC3/include/HepMC3/GenPdfInfo_fwd.h	(revision b30245b0657b11c14403abbcf01ed63b738a06b8)
@@ -0,0 +1,25 @@
+// -*- C++ -*-
+//
+// This file is part of HepMC
+// Copyright (C) 2014-2020 The HepMC collaboration (see AUTHORS for details)
+//
+///
+/// @file GenPdfInfo_fwd.h
+/// @brief Minimal forward declarations for GenPdfInfo
+///
+
+#ifndef HEPMC3_GENPDFINFO_FWD_H
+#define HEPMC3_GENPDFINFO_FWD_H
+
+#include <memory>
+
+namespace HepMC3 {
+
+class GenPdfInfo;
+
+using GenPdfInfoPtr = std::shared_ptr<GenPdfInfo>;
+using ConstGenPdfInfoPtr = std::shared_ptr<const GenPdfInfo>;
+
+}
+
+#endif
Index: external/HepMC3/include/HepMC3/GenRunInfo.h
===================================================================
--- external/HepMC3/include/HepMC3/GenRunInfo.h	(revision b30245b0657b11c14403abbcf01ed63b738a06b8)
+++ external/HepMC3/include/HepMC3/GenRunInfo.h	(revision b30245b0657b11c14403abbcf01ed63b738a06b8)
@@ -0,0 +1,202 @@
+// -*- C++ -*-
+//
+// This file is part of HepMC
+// Copyright (C) 2014-2020 The HepMC collaboration (see AUTHORS for details)
+//
+///
+/// @file GenRunInfo.h
+/// @brief Definition of \b class GenRunInfo
+///
+#ifndef HEPMC3_GENRUNINFO_H
+#define HEPMC3_GENRUNINFO_H
+
+#if !defined(__CINT__)
+#include "HepMC3/Units.h"
+#include "HepMC3/Attribute.h"
+#include <mutex>
+#endif // __CINT__
+
+#ifdef HEPMC3_ROOTIO
+class TBuffer;
+#endif
+
+namespace HepMC3 {
+/** Deprecated */
+using namespace std;
+
+struct GenRunInfoData;
+
+/// @brief Stores run-related information
+///
+/// Manages run-related information.
+/// Contains run-wide attributes
+class GenRunInfo {
+
+public:
+
+    /// @brief Interrnal struct for keeping track of tools.
+    struct ToolInfo {
+
+        /// @brief The name of the tool.
+        std::string name;
+
+        /// @brief The version of the tool.
+        std::string version;
+
+        /// @brief Other information about how the tool was used in
+        /// the run.
+        std::string description;
+    };
+
+public:
+
+    /// @brief Default constructor
+    GenRunInfo() {}
+    /// @brief Copy constructor
+    GenRunInfo(const GenRunInfo& r);
+    /// @brief Assignmet
+    GenRunInfo& operator=(const GenRunInfo& r);
+
+#if !defined(__CINT__)
+
+    /// @brief The vector of tools used to produce this run.
+    const std::vector<ToolInfo> & tools() const {
+        return m_tools;
+    }
+    /// @brief The vector of tools used to produce this run.
+    std::vector<ToolInfo> & tools() {
+        return m_tools;
+    }
+
+    /// @brief Check if a weight name is present.
+    bool has_weight(const std::string& name) const {
+        return m_weight_indices.find(name) !=  m_weight_indices.end();
+    }
+
+    /// @brief Return the index corresponding to a weight name.
+    /// @return -1 if name was not found
+    int weight_index(const std::string& name) const {
+        std::map<std::string, int>::const_iterator it = m_weight_indices.find(name);
+        return it == m_weight_indices.end()? -1: it->second;
+    }
+
+    /// @brief Get the vector of weight names.
+    const std::vector<std::string> & weight_names() const {
+        return m_weight_names;
+    }
+
+    /// @brief Set the names of the weights in this run.
+    ///
+    /// For consistency, the length of the vector should be the same as
+    /// the number of weights in the events in the run.
+    void set_weight_names(const std::vector<std::string> & names);
+
+    /// @brief add an attribute
+    /// This will overwrite existing attribute if an attribute
+    /// with the same name is present
+    void add_attribute(const std::string &name,
+                       const std::shared_ptr<Attribute> &att) {
+        std::lock_guard<std::recursive_mutex> lock(m_lock_attributes);
+        if ( att ) m_attributes[name] = att;
+    }
+
+    /// @brief Remove attribute
+    void remove_attribute(const std::string &name) {
+        std::lock_guard<std::recursive_mutex> lock(m_lock_attributes);
+        m_attributes.erase(name);
+    }
+
+    /// @brief Get attribute of type T
+    template<class T>
+    std::shared_ptr<T> attribute(const std::string &name) const;
+
+    /// @brief Get attribute of any type as string
+    std::string attribute_as_string(const std::string &name) const;
+
+    /// @brief Get list of attribute names
+    std::vector<std::string> attribute_names() const;
+
+    /// @brief Get a copy of the list of attributes
+    /// @note To avoid thread issues, this is returns a copy. Better solution may be needed.
+    std::map< std::string, std::shared_ptr<Attribute> > attributes() const {
+        return m_attributes;
+    }
+
+
+#endif // __CINT__
+
+    /// @name Methods to fill GenRunInfoData and to read it back
+    //@{
+
+    /// @brief Fill GenRunInfoData object
+    void write_data(GenRunInfoData &data) const;
+
+    /// @brief Fill GenRunInfo based on GenRunInfoData
+    void read_data(const GenRunInfoData &data);
+
+#ifdef HEPMC3_ROOTIO
+    /// @brief ROOT I/O streamer
+    void Streamer(TBuffer &b);
+    //@}
+#endif
+
+private:
+
+    /// @name Fields
+    //@{
+
+#if !defined(__CINT__)
+
+    /// @brief The vector of tools used to produce this run.
+    std::vector<ToolInfo> m_tools;
+
+    /// @brief A map of weight names mapping to indices.
+    std::map<std::string, int> m_weight_indices;
+
+    /// @brief A vector of weight names.
+    std::vector<std::string> m_weight_names;
+
+    /// @brief Map of attributes
+    mutable std::map< std::string, std::shared_ptr<Attribute> > m_attributes;
+
+    /// @brief Mutex lock for the m_attibutes map.
+    mutable std::recursive_mutex m_lock_attributes;
+    //@}
+
+#endif // __CINT__
+};
+
+#if !defined(__CINT__)
+
+//
+// Template methods
+//
+
+template<class T>
+std::shared_ptr<T> GenRunInfo::attribute(const std::string &name) const {
+    std::lock_guard<std::recursive_mutex> lock(m_lock_attributes);
+    std::map< std::string, std::shared_ptr<Attribute> >::iterator i =
+        m_attributes.find(name);
+    if( i == m_attributes.end() ) return std::shared_ptr<T>();
+
+    if( !i->second->is_parsed() ) {
+
+        std::shared_ptr<T> att = std::make_shared<T>();
+        if ( att->from_string(i->second->unparsed_string()) &&
+                att->init(*this) ) {
+            // update map with new pointer
+            i->second = att;
+
+            return att;
+        }
+        else
+            return std::shared_ptr<T>();
+    }
+    else return std::dynamic_pointer_cast<T>(i->second);
+}
+
+#endif // __CINT__
+
+} // namespace HepMC3
+
+#endif
Index: external/HepMC3/include/HepMC3/GenVertex.h
===================================================================
--- external/HepMC3/include/HepMC3/GenVertex.h	(revision b30245b0657b11c14403abbcf01ed63b738a06b8)
+++ external/HepMC3/include/HepMC3/GenVertex.h	(revision b30245b0657b11c14403abbcf01ed63b738a06b8)
@@ -0,0 +1,167 @@
+// -*- C++ -*-
+//
+// This file is part of HepMC
+// Copyright (C) 2014-2020 The HepMC collaboration (see AUTHORS for details)
+//
+/// @file GenVertex.h
+/// @brief Definition of \b class GenVertex
+//
+#ifndef HEPMC3_GENVERTEX_H
+#define HEPMC3_GENVERTEX_H
+#include <string>
+#include "HepMC3/GenParticle_fwd.h"
+#include "HepMC3/GenVertex_fwd.h"
+#include "HepMC3/Data/GenVertexData.h"
+#include "HepMC3/FourVector.h"
+
+namespace HepMC3 {
+
+/** Deprecated */
+using namespace std;
+
+class Attribute;
+class GenEvent;
+
+/// Stores vertex-related information
+class GenVertex : public std::enable_shared_from_this<GenVertex> {
+
+    friend class GenEvent;
+
+public:
+
+    /// @name Constructors
+    //@{
+
+    /// Default constructor
+    GenVertex( const FourVector& position = FourVector::ZERO_VECTOR() );
+
+    /// Constructor based on vertex data
+    GenVertex( const GenVertexData& data );
+
+    //@}
+
+public:
+
+    /// @name Accessors
+    //@{
+
+    /// Get parent event
+    GenEvent* parent_event() { return m_event; }
+
+    /// Get parent event
+    const GenEvent* parent_event() const { return m_event; }
+
+    /// Check if this vertex belongs to an event
+    bool in_event() const { return parent_event() != nullptr; }
+
+    /// Get the vertex unique identifier
+    ///
+    /// @note This is not the same as id() in HepMC v2, which is now @c status()
+    int id() const { return m_id; }
+
+    /// @brief set the vertex identifier
+    void set_id(int id);
+
+    /// Get vertex status code
+    int status() const { return m_data.status; }
+    /// Set vertex status code
+    void set_status(int stat) { m_data.status = stat; }
+
+    /// Get vertex data
+    const GenVertexData& data() const { return m_data; }
+
+    /// Add incoming particle
+    void add_particle_in ( GenParticlePtr p);
+    /// Add outgoing particle
+    void add_particle_out( GenParticlePtr p);
+    /// Remove incoming particle
+    void remove_particle_in ( GenParticlePtr p);
+    /// Remove outgoing particle
+    void remove_particle_out( GenParticlePtr p);
+
+    /// Get list of incoming particles
+    const std::vector<GenParticlePtr>& particles_in() { return m_particles_in; }
+    /// Get list of incoming particles (for const access)
+    const std::vector<ConstGenParticlePtr>& particles_in() const;
+    /// Get list of outgoing particles
+    const std::vector<GenParticlePtr>& particles_out() { return m_particles_out; }
+    /// Get list of outgoing particles (for const access)
+    const std::vector<ConstGenParticlePtr>& particles_out() const;
+
+    /// @brief Get vertex position
+    ///
+    /// Returns the position of this vertex. If a position is not set on _this_ vertex,
+    /// the production vertices of ancestors are searched to find the inherited position.
+    /// FourVector(0,0,0,0) is returned if no position information is found.
+    ///
+    const FourVector& position() const;
+    /// @brief Check if position of this vertex is set
+    bool has_set_position() const { return !(m_data.position.is_zero()); }
+
+    /// Set vertex position
+    void set_position(const FourVector& new_pos); //!<
+
+    /// @brief Add event attribute to this vertex
+    ///
+    /// This will overwrite existing attribute if an attribute with
+    /// the same name is present. The attribute will be stored in the
+    /// parent_event(). @return false if there is no parent_event();
+    bool add_attribute(const std::string& name, std::shared_ptr<Attribute> att);
+
+    /// @brief Get list of names of attributes assigned to this particle
+    std::vector<std::string> attribute_names() const;
+
+    /// @brief Remove attribute
+    void remove_attribute(const std::string& name);
+
+    /// @brief Get attribute of type T
+    template<class T>
+    std::shared_ptr<T> attribute(const std::string& name) const;
+
+    /// @brief Get attribute of any type as string
+    std::string attribute_as_string(const std::string& name) const;
+
+    /// @name Deprecated functionality
+    //@{
+
+
+    /// Add incoming particle by raw pointer
+    /// @deprecated Use GenVertex::add_particle_in( const GenParticlePtr &p ) instead
+    void add_particle_in ( GenParticle *p ) { add_particle_in( GenParticlePtr(p) ); }
+
+    /// Add outgoing particle by raw pointer
+    /// @deprecated Use GenVertex::add_particle_out( const GenParticlePtr &p ) instead
+    void add_particle_out( GenParticle *p ) { add_particle_out( GenParticlePtr(p) ); }
+
+
+    //@}
+
+
+private:
+
+    /// @name Fields
+    //@{
+    GenEvent       *m_event;  //!< Parent event
+    int             m_id;     //!< Vertex id
+    GenVertexData   m_data;   //!< Vertex data
+
+    std::vector<GenParticlePtr>  m_particles_in;  //!< Incoming particle list
+
+    std::vector<GenParticlePtr>  m_particles_out; //!< Outgoing particle list
+    //@}
+
+};
+
+
+} // namespace HepMC3
+
+#include "HepMC3/GenEvent.h"
+namespace HepMC3 {
+/// @brief Get attribute of type T
+template<class T> std::shared_ptr<T> GenVertex::attribute(const std::string& name) const {
+    return parent_event()?
+           parent_event()->attribute<T>(name, id()): std::shared_ptr<T>();
+}
+}
+
+#endif
Index: external/HepMC3/include/HepMC3/GenVertex_fwd.h
===================================================================
--- external/HepMC3/include/HepMC3/GenVertex_fwd.h	(revision b30245b0657b11c14403abbcf01ed63b738a06b8)
+++ external/HepMC3/include/HepMC3/GenVertex_fwd.h	(revision b30245b0657b11c14403abbcf01ed63b738a06b8)
@@ -0,0 +1,28 @@
+// -*- C++ -*-
+//
+// This file is part of HepMC
+// Copyright (C) 2014-2020 The HepMC collaboration (see AUTHORS for details)
+//
+///
+/// @file GenVertex_fwd.h
+/// @brief Minimal forward declarations for GenVertex
+///
+
+#ifndef HEPMC3_GENVERTEX_FWD_H
+#define HEPMC3_GENVERTEX_FWD_H
+
+#include <memory>
+
+namespace HepMC3 {
+
+class GenVertex;
+
+using GenVertexPtr = std::shared_ptr<GenVertex>;
+using ConstGenVertexPtr = std::shared_ptr<const GenVertex>;
+
+template<typename T>
+using GenVertex_type = typename std::conditional<std::is_const<typename T::element_type>::value, ConstGenVertexPtr, GenVertexPtr>::type;
+
+}
+
+#endif
Index: external/HepMC3/include/HepMC3/Reader.h
===================================================================
--- external/HepMC3/include/HepMC3/Reader.h	(revision b30245b0657b11c14403abbcf01ed63b738a06b8)
+++ external/HepMC3/include/HepMC3/Reader.h	(revision b30245b0657b11c14403abbcf01ed63b738a06b8)
@@ -0,0 +1,77 @@
+// -*- C++ -*-
+//
+// This file is part of HepMC
+// Copyright (C) 2014-2020 The HepMC collaboration (see AUTHORS for details)
+//
+#ifndef HEPMC3_READER_H
+#define HEPMC3_READER_H
+///
+/// @file  Reader.h
+/// @brief Definition of interface \b Reader
+///
+/// @class HepMC3::Reader
+/// @brief Base class for all I/O readers
+///
+/// @ingroup IO
+///
+
+#include "HepMC3/GenRunInfo.h"
+
+namespace HepMC3 {
+
+// Forward declaration
+class GenEvent;
+
+class Reader {
+public:
+    ///Constructor
+    Reader() {}
+
+    /// Virtual destructor
+    virtual ~Reader() {}
+
+    /// skip or fast forward reading of some events
+    virtual bool skip(const int) { return !failed();}
+
+    /// Fill next event from input into @a evt
+    virtual bool read_event(GenEvent& evt) = 0;
+    /** @brief Get file and/or stream error state */
+    virtual bool failed()=0;
+    /** @brief Close file and/or stream */
+    virtual void close()=0;
+
+    /// Get the global GenRunInfo object.
+    std::shared_ptr<GenRunInfo> run_info() const {
+        return m_run_info;
+    }
+
+///deleted copy constructor
+    Reader(const Reader&) = delete; 
+///deleted copy assignment operator
+    Reader& operator = (const Reader &) = delete;            
+    /// Set options
+    void set_options(const std::map<std::string, std::string>& options)
+    {
+    m_options=options;
+    }
+    /// Set options
+    std::map<std::string, std::string> get_options() const
+    {
+    return m_options;
+    }
+protected:
+    /// Set the global GenRunInfo object.
+    void set_run_info(std::shared_ptr<GenRunInfo> run) {
+        m_run_info = run;
+    }
+        /// options
+    std::map<std::string, std::string> m_options;
+private:
+    /// The global GenRunInfo object.
+    std::shared_ptr<GenRunInfo> m_run_info;
+};
+
+
+} // namespace HepMC3
+
+#endif
Index: external/HepMC3/include/HepMC3/ReaderAscii.h
===================================================================
--- external/HepMC3/include/HepMC3/ReaderAscii.h	(revision b30245b0657b11c14403abbcf01ed63b738a06b8)
+++ external/HepMC3/include/HepMC3/ReaderAscii.h	(revision b30245b0657b11c14403abbcf01ed63b738a06b8)
@@ -0,0 +1,174 @@
+// -*- C++ -*-
+//
+// This file is part of HepMC
+// Copyright (C) 2014-2020 The HepMC collaboration (see AUTHORS for details)
+//
+#ifndef HEPMC3_READERASCII_H
+#define HEPMC3_READERASCII_H
+///
+/// @file  ReaderAscii.h
+/// @brief Definition of class \b ReaderAscii
+///
+/// @class HepMC3::ReaderAscii
+/// @brief GenEvent I/O parsing for structured text files
+///
+/// @ingroup IO
+///
+#include <set>
+#include <string>
+#include <fstream>
+#include <istream>
+#include <iterator>
+#include "HepMC3/Reader.h"
+#include "HepMC3/GenEvent.h"
+
+
+namespace HepMC3 {
+
+
+class ReaderAscii : public Reader {
+public:
+
+    /// @brief Constructor
+    ReaderAscii(const std::string& filename);
+    /// The ctor to read from stdin
+    ReaderAscii(std::istream &);
+    /// @brief Destructor
+    ~ReaderAscii();
+
+    /// @brief skip events
+    bool skip(const int)  override;
+    
+    /// @brief Load event from file
+    ///
+    /// @param[out] evt Event to be filled
+    bool read_event(GenEvent& evt)  override;
+
+    /// @todo No-arg version returning GenEvent?
+
+    /// @brief Return status of the stream
+    bool failed()  override;
+
+    /// @todo Implicit cast to bool = !failed()?
+
+    /// @brief Close file stream
+    void close()  override;
+
+private:
+
+    /// @brief Unsecape '\' and '\n' characters in string
+    std::string unescape(const std::string& s);
+
+    /// @name Read helpers
+    //@{
+
+    /// @brief Parse event
+    ///
+    /// Helper routine for parsing event information
+    /// @param[out] evt Event that will be filled with new data
+    /// @param[in]  buf Line of text that needs to be parsed
+    /// @return vertices count and particles count for verification
+    std::pair<int,int> parse_event_information(GenEvent &evt, const char *buf);
+
+    /// @brief Parse weight value lines
+    ///
+    /// Helper routine for parsing weight value information
+    /// @param[out] evt Event whose GenWeights will be filled with weight values
+    /// @param[in]  buf Line of text that needs to be parsed
+    ///
+    bool parse_weight_values(GenEvent &evt, const char *buf);
+
+    /// @brief Parse units
+    ///
+    /// Helper routine for parsing units information
+    /// @param[out] evt Event that will be filled with unit information
+    /// @param[in]  buf Line of text that needs to be parsed
+    ///
+    bool parse_units(GenEvent &evt, const char *buf);
+
+    /// @brief Parse struct GenPdfInfo information
+    ///
+    /// Helper routine for parsing PDF information
+    /// @param[out] evt Event that will be filled with unit information
+    /// @param[in]  buf Line of text that needs to be parsed
+    bool parse_pdf_info(GenEvent &evt, const char *buf);
+
+    /// @brief Parse struct GenHeavyIon information
+    ///
+    /// Helper routine for parsing heavy ion information
+    /// @param[out] evt Event that will be filled with unit information
+    /// @param[in]  buf Line of text that needs to be parsed
+    bool parse_heavy_ion(GenEvent &evt, const char *buf);
+
+    /// @brief Parse struct GenCrossSection information
+    ///
+    /// Helper routine for parsing cross-section information
+    /// @param[out] evt Event that will be filled with unit information
+    /// @param[in]  buf Line of text that needs to be parsed
+    bool parse_cross_section(GenEvent &evt, const char *buf);
+
+    /// @brief Parse vertex
+    ///
+    /// Helper routine for parsing single event information
+    /// @param[out] evt Event that will contain parsed vertex
+    /// @param[in] buf Line of text that needs to be parsed
+    ///
+    bool parse_vertex_information(GenEvent &evt, const char *buf);
+
+    /// @brief Parse particle
+    ///
+    /// Helper routine for parsing single particle information
+    /// @param[out] evt Event that will contain parsed particle
+    /// @param[in] buf Line of text that needs to be parsed
+    bool parse_particle_information(GenEvent &evt, const char *buf);
+
+    /// @brief Parse attribute
+    ///
+    /// Helper routine for parsing single attribute information
+    /// @param[out] evt Event that will contain parsed attribute
+    /// @param[in] buf Line of text that needs to be parsed
+    bool parse_attribute(GenEvent &evt, const char *buf);
+
+    /// @brief Parse run-level attribute.
+    ///
+    /// Helper routine for parsing single attribute information
+    /// @param[in] buf Line of text that needs to be parsed
+    bool parse_run_attribute(const char *buf);
+
+    /// @brief Parse run-level weight names.
+    ///
+    /// Helper routine for parsing a line with information about
+    /// weight names.
+    /// @param[in] buf Line of text that needs to be parsed
+    bool parse_weight_names(const char *buf);
+
+    /// @brief Parse run-level tool information.
+    ///
+    /// Helper routine for parsing a line with information about
+    /// tools being used.
+    /// @param[in] buf Line of text that needs to be parsed
+    bool parse_tool(const char *buf);
+    //@}
+
+
+private:
+
+    std::ifstream m_file; //!< Input file
+    std::istream* m_stream; ///< For ctor when reading from stdin
+    bool m_isstream; ///< toggles usage of m_file or m_stream
+
+
+    /** @brief Store attributes global to the run being written/read. */
+    std::map< std::string, std::shared_ptr<Attribute> > m_global_attributes;
+
+    /** @brief Temp storage for  outgoing particle ids */
+    std::map<GenVertexPtr, std::set<int> >  m_forward_mothers;
+    /** @brief Temp storage for  prod vertex ids */
+    std::map<GenParticlePtr, int >  m_forward_daughters;
+
+};
+
+
+} // namespace HepMC3
+
+#endif
Index: external/HepMC3/include/HepMC3/ReaderAsciiHepMC2.h
===================================================================
--- external/HepMC3/include/HepMC3/ReaderAsciiHepMC2.h	(revision b30245b0657b11c14403abbcf01ed63b738a06b8)
+++ external/HepMC3/include/HepMC3/ReaderAsciiHepMC2.h	(revision b30245b0657b11c14403abbcf01ed63b738a06b8)
@@ -0,0 +1,145 @@
+// -*- C++ -*-
+//
+// This file is part of HepMC
+// Copyright (C) 2014-2020 The HepMC collaboration (see AUTHORS for details)
+//
+#ifndef HEPMC3_READER_ASCII_HEPMC2_H
+#define HEPMC3_READER_ASCII_HEPMC2_H
+/**
+ *  @file  ReaderAsciiHepMC2.h
+ *  @brief Definition of \b class ReaderAsciiHepMC2
+ *
+ *  @class HepMC3::ReaderAsciiHepMC2
+ *  @brief Parser for HepMC2 I/O files
+ *
+ *  @ingroup IO
+ *
+ */
+#include "HepMC3/Reader.h"
+
+#include "HepMC3/GenEvent.h"
+
+#include <string>
+#include <fstream>
+#include <istream>
+
+namespace HepMC3 {
+
+
+
+class ReaderAsciiHepMC2 : public Reader {
+//
+// Constructors
+//
+public:
+    /** @brief Default constructor */
+    ReaderAsciiHepMC2(const std::string& filename);
+
+    /// The ctor to read from stdin
+    ReaderAsciiHepMC2(std::istream &);
+
+    /// @brief Destructor
+    ~ReaderAsciiHepMC2();
+//
+// Functions
+//
+public:
+    /// @brief skip events
+    bool skip(const int)  override;
+
+    /** @brief Implementation of Reader::read_event */
+    bool read_event(GenEvent &evt)  override;
+
+    /// @brief Return status of the stream
+    bool failed()  override;
+
+    /// @brief Close file stream
+    void close()  override;
+
+private:
+    /** @brief Parse event
+     *
+     *  Helper routine for parsing event information
+     *  @param[out] evt Event that will be filled with new data
+     *  @param[in]  buf Line of text that needs to be parsed
+     */
+    int parse_event_information(GenEvent &evt, const char *buf);
+
+    /** @brief Parse units
+     *
+     *  Helper routine for parsing unit information
+     *  @param[out] evt Event that will be filled with unit information
+     *  @param[in]  buf Line of text that needs to be parsed
+     */
+    bool parse_units(GenEvent &evt, const char *buf);
+
+    /** @brief Parse vertex
+     *
+     *  Helper routine for parsing single event information
+     *  @param[in] buf Line of text that needs to be parsed
+     */
+    int parse_vertex_information(const char *buf);
+
+    /** @brief Parse particle
+     *
+     *  Helper routine for parsing single particle information
+     *  @param[in] buf Line of text that needs to be parsed
+     */
+    int parse_particle_information(const char *buf);
+
+    /** @brief Parse weight names
+     *
+     *  Helper routine for parsing weight names
+     *  @param[in] buf Line of text that needs to be parsed
+     */
+    bool parse_weight_names(const char *buf);
+
+    /** @brief Parse heavy ion information
+     *
+     *  Helper routine for parsing heavy ion information
+     *  @param[out] evt Event that will be filled with new data
+     *  @param[in]  buf Line of text that needs to be parsed
+     */
+    bool parse_heavy_ion(GenEvent &evt, const char *buf);
+
+    /** @brief Parse pdf information
+     *
+     *  Helper routine for parsing pdf information
+     *  @param[out] evt Event that will be filled with new data
+     *  @param[in]  buf Line of text that needs to be parsed
+     */
+    bool parse_pdf_info(GenEvent &evt, const char *buf);
+
+
+    /** @brief Parse pdf information
+    *
+    *  Helper routine for parsing cross-section information
+    *  @param[out] evt Event that will be filled with new data
+    *  @param[in]  buf Line of text that needs to be parsed
+    */
+    bool parse_xs_info(GenEvent &evt, const char *buf);
+
+
+
+//
+// Fields
+//
+private:
+    std::ifstream m_file; //!< Input file
+    std::istream* m_stream; ///< For ctor when reading from stdin
+    bool m_isstream; ///< toggles usage of m_file or m_stream
+
+    std::vector<GenVertexPtr>   m_vertex_cache;        //!< Vertex cache
+    std::vector<int>            m_vertex_barcodes;     //!< Old vertex barcodes
+
+    std::vector<GenParticlePtr> m_particle_cache;      //!< Particle cache
+    std::vector<int>            m_end_vertex_barcodes; //!< Old end vertex barcodes
+
+    GenEvent*              m_event_ghost;                      //!< To save particle and verstex attributes.
+    std::vector<GenParticlePtr> m_particle_cache_ghost;//!< Particle cache for attributes
+    std::vector<GenVertexPtr>   m_vertex_cache_ghost;        //!< Vertex cache for attributes
+};
+
+} // namespace HepMC3
+
+#endif
Index: external/HepMC3/include/HepMC3/Setup.h
===================================================================
--- external/HepMC3/include/HepMC3/Setup.h	(revision b30245b0657b11c14403abbcf01ed63b738a06b8)
+++ external/HepMC3/include/HepMC3/Setup.h	(revision b30245b0657b11c14403abbcf01ed63b738a06b8)
@@ -0,0 +1,72 @@
+// -*- C++ -*-
+//
+// This file is part of HepMC
+// Copyright (C) 2014-2020 The HepMC collaboration (see AUTHORS for details)
+//
+/// @file Setup.h
+/// @brief Definition of \b class Setup
+
+#ifndef HEPMC3_SETUP_H
+#define HEPMC3_SETUP_H
+
+
+
+namespace HepMC3 {
+
+/// @brief Configuration for HepMC
+///
+/// Contains macro definitions for printing debug output, feature deprecation, etc.
+/// Static class - configuration is shared among all HepMC events
+/// and program threads
+///
+class Setup {
+
+    /// Private constructor
+    Setup() {}
+    /// Private destructor
+    ~Setup() {}
+
+
+public:
+
+    /// @name Accessors
+    //@{
+
+    /// Get error messages printing flag
+    static bool print_errors();
+    /// set error messages printing flag
+    static void set_print_errors(const bool flag);
+
+    /// Get warning messages printing flag
+    static bool print_warnings();
+    /// Set warning messages printing flag
+    static void set_print_warnings(const bool flag);
+
+    /// Get debug level
+    static int  debug_level();
+    /// Set debug level
+    static void set_debug_level(const int level);
+    //@}
+
+    /// @name Static constants
+    //@{
+    /// Default maxUlps for AlmostEqual2sComplement function (double precision)
+    static const unsigned int DEFAULT_DOUBLE_ALMOST_EQUAL_MAXULPS;
+
+    /// Default threshold for comparing double variables
+    static const double DOUBLE_EPSILON;
+
+    //@}
+
+
+private:
+
+    static bool m_is_printing_errors;   //!< Flag for printing error messages
+    static bool m_is_printing_warnings; //!< Flag for printing warning messages
+    static int  m_debug_level;          //!< Level of debug messages printed out
+};
+
+
+} // namespace HepMC3
+
+#endif
Index: external/HepMC3/include/HepMC3/Units.h
===================================================================
--- external/HepMC3/include/HepMC3/Units.h	(revision b30245b0657b11c14403abbcf01ed63b738a06b8)
+++ external/HepMC3/include/HepMC3/Units.h	(revision b30245b0657b11c14403abbcf01ed63b738a06b8)
@@ -0,0 +1,113 @@
+// -*- C++ -*-
+//
+// This file is part of HepMC
+// Copyright (C) 2014-2020 The HepMC collaboration (see AUTHORS for details)
+//
+#ifndef HEPMC3_UNITS_H
+#define HEPMC3_UNITS_H
+/**
+ *  @file Units.h
+ *  @brief Definition of \b class Units
+ *
+ *  @class HepMC3::Units
+ *  @brief Stores units-related enums and conversion functions
+ *
+ *  Manages units used by HepMC::GenEvent
+ *
+ */
+#include <string>
+#include "HepMC3/Errors.h"
+#include "HepMC3/Setup.h"
+#include "HepMC3/FourVector.h"
+
+namespace HepMC3 {
+
+
+class Units {
+public:
+    /** @brief Momentum units */
+    enum MomentumUnit { MEV, GEV };
+
+    /** @brief Position units */
+    enum LengthUnit   { MM,  CM  };
+
+public:
+    /** @brief Get momentum unit based on its name*/
+    static MomentumUnit momentum_unit( const std::string& name ) {
+        if( name.compare(0,3,"GEV") == 0 ) return GEV;
+        if( name.compare(0,3,"MEV") == 0 ) return MEV;
+
+        HEPMC3_ERROR("Units::momentum_unit: unrecognised unit name: '" << name <<"', setting to GEV" )
+
+        return GEV;
+    }
+
+    /** @brief Get length unit based on its name*/
+    static LengthUnit length_unit( const std::string& name ) {
+        if( name.compare(0,2,"CM") == 0 ) return CM;
+        if( name.compare(0,2,"MM") == 0 ) return MM;
+
+        HEPMC3_ERROR("Units::length_unit: unrecognised unit name: '" << name <<"', setting to CM" )
+
+        return CM;
+    }
+
+    /** @brief Get name of momentum unit */
+    static std::string name( MomentumUnit u ) {
+        switch(u) {
+        case MEV:
+            return "MEV";
+        case GEV:
+            return "GEV";
+        }
+
+        return "<UNDEFINED>";
+    }
+
+    /** @brief Get name of length unit */
+    static std::string name( LengthUnit u ) {
+        switch(u) {
+        case MM:
+            return "MM";
+        case CM:
+            return "CM";
+        }
+
+        return "<UNDEFINED>";
+    }
+
+    /** @brief Convert FourVector to different momentum unit */
+    template <typename T>
+    static void convert( T &m, MomentumUnit from, MomentumUnit to ) {
+        if( from == to ) return;
+
+        if( from == GEV ) {
+            // GEV -> MEV
+            m *= 1000.;
+        }
+        else if( from == MEV ) {
+            // MEV -> GEV
+            m *= 0.001;
+        }
+    }
+
+    /** @brief Convert FourVector to different length unit */
+    template <typename T>
+    static void convert( T &m, LengthUnit from, LengthUnit to ) {
+        if( from == to ) return;
+
+        if( from == CM ) {
+            // CM -> MM
+            m *= 10.0;
+        }
+        else if( from == MM ) {
+            // MM -> CM
+            m *= 0.1;
+        }
+    }
+
+};
+
+} // namespace HepMC3
+
+#endif
