6 #ifndef ATLASHEPMC_FLOW_H
7 #define ATLASHEPMC_FLOW_H
9 #include "HepMC3/Attribute.h"
10 #include "HepMC3/GenParticle.h"
12 typedef std::shared_ptr<HepMC3::VectorIntAttribute> Flow;
14 std::shared_ptr<HepMC3::IntAttribute>
f=
p->attribute<HepMC3::IntAttribute>(
"flow"+
std::to_string(
i));
if (
f)
return f->value();
15 std::shared_ptr<HepMC3::VectorIntAttribute> vf=
p->attribute<HepMC3::VectorIntAttribute>(
"flow");
if (vf)
if (0<
i&&
i<(
int)(vf->value().size()))
return vf->value().at(
i);
19 std::shared_ptr<HepMC3::IntAttribute>
f=
p->attribute<HepMC3::IntAttribute>(
"flow"+
std::to_string(
i));
if (
f)
return f->value();
20 std::shared_ptr<HepMC3::VectorIntAttribute> vf=
p->attribute<HepMC3::VectorIntAttribute>(
"flow");
if (vf)
if (0<
i&&
i<(
int)(vf->value().size()))
return vf->value().at(
i);
24 std::shared_ptr<HepMC3::VectorIntAttribute> vf=
p->attribute<HepMC3::VectorIntAttribute>(
"flow");
28 for (
int i=1;
i<=10;
i++) {
29 std::shared_ptr<HepMC3::IntAttribute>
f=
p->attribute<HepMC3::IntAttribute>(
"flow"+
std::to_string(
i));
if (
f) fl.push_back(
i);
else break;
31 return std::make_shared<HepMC3::VectorIntAttribute>(fl);
34 std::shared_ptr<HepMC3::VectorIntAttribute> vf=
p->attribute<HepMC3::VectorIntAttribute>(
"flow");
38 for (
int i=1;
i<=10;
i++) {
39 std::shared_ptr<HepMC3::IntAttribute>
f=
p->attribute<HepMC3::IntAttribute>(
"flow"+
std::to_string(
i));
if (
f) fl.push_back(
i);
else break;
41 return std::make_shared<HepMC3::VectorIntAttribute>(fl);
43 template<
class T>
void set_flow( T&
a, Flow fl) {
44 if(fl)
a->add_attribute(
"flow",std::make_shared<HepMC3::VectorIntAttribute>(*fl));
51 template <
class T>
int flow(
const T&
a,
int i) {
return a->flow(
i);}
52 template <
class T> Flow
flow(
const T&
a) {
return a->flow();}