 |
ATLAS Offline Software
|
Go to the documentation of this file.
6 #ifndef TRUTHUTILS_LOOPS_H
7 #define TRUTHUTILS_LOOPS_H
13 template <
class Evt,
class Prt,
class Vtx>
61 std::map<Prt, int> incycle;
64 for (
const auto &
p: *
m_evt){
65 if (!
p->end_vertex()||!
p->production_vertex()){
73 size_t minincycle =
m_evt->particles_size();
77 for (
const auto &
p: *
m_evt) {
80 if (incycle[
p] != 0)
continue;
85 auto ev =
p->end_vertex();
90 for (
auto& po: *
ev) goodo = goodo && (incycle[po] == -1);
91 if (goodo) incycle[
p] = -1;
95 auto pv =
p->production_vertex();
101 for (
auto&
pi:
ev->particles_in()) goodi = goodi && (incycle[
pi] == -1);
103 for (
auto ip =
ev->particles_in_const_begin();
104 ip !=
ev->particles_in_const_end();
107 goodi = goodi && (incycle[*
ip] == -1);
110 if (goodi) incycle[
p] = -1;
114 if (minincycle ==
unknown)
break;
121 for (
const auto &
p: *
m_evt){
122 if (incycle[
p] == 0) incycle[
p] = 1;
128 for (
auto &
v:
m_evt->vertices()) {
130 for (
auto iv =
m_evt->vertices_begin(); iv !=
m_evt->vertices_end(); ++iv) {
137 for (
auto& pin:
v->particles_in()){
138 if (incycle[pin] == 1) {
140 for (
auto ipin =
v->particles_in_const_begin();
141 ipin !=
v->particles_in_const_end();
143 if (incycle[*ipin] == 1) {
153 for (
const auto& pou: *
v) {
154 if (incycle[pou] == 1) {
bool isLoop(const Vtx &v) const
Is this vertex in a loop?
std::string find(const std::string &s)
return a remapped string
std::vector< Vtx > m_loop_vertices
List of all vertices in m_evt that are in loops.
Loops()
Default constructor.
std::vector< Prt > m_loop_particles
List of all particles in m_evt that are in loops.
const Evt * m_evt
Local pointer to the event passed in the constructor or most recent call to findLoops.
const std::vector< Prt > & loop_particles() const
Accessor: return the full list of particles in loops.
bool isLoop(const Prt &p) const
Is this particle in a loop?
const std::vector< Vtx > & loop_vertices() const
Accessor: return the full list of vertices in loops.
int findLoops(const Evt *evt, bool force)
Function that does the work to identify loops Pass the event of interest.
Loops(const Evt *evt)
Constructor passing the event; immediately index the event that is passed.