6 #ifndef TRUTHUTILS_LOOPS_H
7 #define TRUTHUTILS_LOOPS_H
12 template <
class Evt,
class Prt,
class Vtx>
37 std::map<Prt, int> incycle;
38 for (
const auto &
p: *
m_evt)
if (!
p->end_vertex()||!
p->production_vertex()) incycle[
p] = -1;
40 size_t minincycle =
m_evt->particles_size();
43 for (
const auto &
p: *
m_evt) {
44 if (incycle[
p] != 0)
continue;
46 auto ev =
p->end_vertex();
49 for (
auto& po: *
ev) goodo = goodo && (incycle[po] == -1);
50 if (goodo) incycle[
p] = -1;
52 auto pv =
p->production_vertex();
56 for (
auto&
pi:
ev->particles_in()) goodi = goodi && (incycle[
pi] == -1);
58 for (
auto ip =
ev->particles_in_const_begin();
59 ip !=
ev->particles_in_const_end();
62 goodi = goodi && (incycle[*
ip] == -1);
65 if (goodi) incycle[
p] = -1;
68 if (minincycle ==
unknown)
break;
71 for (
const auto &
p: *
m_evt)
if (incycle[
p] == 0) incycle[
p] = 1;
75 for (
auto &
v:
m_evt->vertices()) {
77 for (
auto iv =
m_evt->vertices_begin(); iv !=
m_evt->vertices_end(); ++iv) {
82 for (
auto& pin:
v->particles_in())
if (incycle[pin] == 1) {
84 for (
auto ipin =
v->particles_in_const_begin();
85 ipin !=
v->particles_in_const_end();
87 if (incycle[*ipin] == 1) {
93 for (
const auto& pou: *
v) {
94 if (incycle[pou] == 1) {