6#ifndef ATLASHEPMC_FLOW_H
7#define ATLASHEPMC_FLOW_H
9#include "HepMC3/Attribute.h"
10#include "HepMC3/GenParticle.h"
13typedef std::shared_ptr<HepMC3::VectorIntAttribute>
Flow;
14template <class T, std::enable_if_t<std::is_same<T, HepMC3::GenParticlePtr>::value || std::is_same<T, HepMC3::ConstGenParticlePtr>::value,
bool > =
true>
15inline int flow(
const T& p,
int i) {
16 std::shared_ptr<HepMC3::IntAttribute> f = p->template attribute<HepMC3::IntAttribute>(
"flow" + std::to_string(i));
if (f)
return f->value();
17 std::shared_ptr<HepMC3::VectorIntAttribute> vf = p->template attribute<HepMC3::VectorIntAttribute>(HepMCStr::flow);
if (vf)
if (0 < i && i < (
int)(vf->value().size()))
return vf->value().at(i);
20template <class T, std::enable_if_t<std::is_same<T, HepMC3::GenParticlePtr>::value || std::is_same<T, HepMC3::ConstGenParticlePtr>::value,
bool > =
true>
22 std::shared_ptr<HepMC3::VectorIntAttribute> vf = p->template attribute<HepMC3::VectorIntAttribute>(HepMCStr::flow);
26 for (
int i = 1; i <= 10; i++) {
27 std::shared_ptr<HepMC3::IntAttribute> f = p->template attribute<HepMC3::IntAttribute>(
"flow" + std::to_string(i));
if (f) fl.push_back(i);
else break;
29 return std::make_shared<HepMC3::VectorIntAttribute>(fl);
32 if (fl)
a->add_attribute(HepMCStr::flow, std::make_shared<HepMC3::VectorIntAttribute>(*fl));
int flow(const T &p, int i)
void set_flow(T &a, Flow fl)
std::shared_ptr< HepMC3::VectorIntAttribute > Flow