107 {
108
109
110
111 std::set<const xAOD::TruthVertex*> seenVertices;
112 std::vector<ActiveVertex> actVertices;
113 std::vector<const xAOD::TruthParticle*> children;
114 size_t nChildren{0};
115
117 if (!tp || !tp->isStable() ||
jet->p4().DeltaR(tp->p4()) > 0.4)
continue;
119
120 size_t decayDepth{0};
122 while (current) {
123 if (decayDepth > 200) break;
124
125
128 if (!prodVtx || seenVertices.count(prodVtx)) break;
129 if (prodVtx->
v4().Mag2() < 0)
break;
130 seenVertices.insert(prodVtx);
131 decayDepth++;
132
135
136 if (nChildren >= 2) {
137 TLorentzVector vtx4Vec;
138 float scalarPtSum{0.};
140 vtx4Vec += child->p4();
141 scalarPtSum += child->p4().Pt();
142 }
143 actVertices.push_back({prodVtx, vtx4Vec.E(), vtx4Vec.M(), vtx4Vec.Pt(), scalarPtSum, nChildren, decayDepth});
144 }
146 }
147 }
148
149 return actVertices;
150}
FourVec_t v4() const
The full 4-vector of the vertex.
const TruthParticle_v1 * incomingParticle(size_t index) const
Get one of the incoming particles.
bool is_simulation_particle(const T &p)
Method to establish if a particle (or barcode) was created during the simulation (TODO update to be s...
bool isPhysical(const T &p)
Identify if the particle is physical, i.e. is stable or decayed.
std::vector< const xAOD::TruthParticle * > getDecayProducts(const xAOD::TruthVertex *vtx)
TruthVertex_v1 TruthVertex
Typedef to implementation.
TruthParticle_v1 TruthParticle
Typedef to implementation.