304 {
308
309
311 for (
auto child :
inparts[0]->decayVtx()->particles_out()) {
312 if (child) { input_child = child; break; }
313 }
315
316 bool has_parent =
parent !=
nullptr;
318 ?
parent->getType(uid_accessor).detailedType
320
321
327 }
328
329
332 }
333
334
335 size_t truth_out_parts =
inparts[0]->nChildren();
337 std::vector<const xAOD::TruthParticle*> truth_children;
338 for (
auto child :
inparts[0]->decayVtx()->particles_out() ) {
339 if ( child ) truth_children.push_back(child);
340 }
341 TLorentzVector in4 =
inparts[0]->p4();
342 TLorentzVector out4 =
sum_4vec(
inparts[0]->decayVtx()->particles_out());
343 float deltaE = std::abs(in4.E() - out4.E());
344
345
346 if ( truth_out_parts == truth_valid_out_parts && truth_valid_out_parts > 1 ) {
348 }
349
350
351
352
353
354 if ( truth_valid_out_parts > 1 ) {
355 double children_mass_sum = 0.0;
356 for (const auto& child : truth_children) {
357 children_mass_sum += child->p4().M();
358 }
359 if ( children_mass_sum > in4.M() + 1.0 ) {
361 }
362 }
363
364
367 }
368
369
371 if (
auto t =
classifyPhotonVertex(truth_out_parts, truth_valid_out_parts, truth_children))
return *
t;
372 }
373
374
376 if (
auto t =
classifyLeptonVertex(uid_accessor, truth_out_parts, truth_valid_out_parts, truth_children))
return *
t;
377 }
378
379
380
381
382
385 }
387 bool has_muon = false, has_neutrino = false;
388 for (auto c : truth_children) {
389 if (std::abs(
c->pdgId()) == 13) has_muon =
true;
390 if (std::abs(
c->pdgId()) == 14) has_neutrino =
true;
391 }
394 }
395
396
397 if ( truth_out_parts > truth_valid_out_parts && truth_out_parts > 1 &&
400 }
401
402
403 if ( truth_out_parts == 1 && truth_valid_out_parts == 1 ) {
406 }
407
409 }
bool isChLepton(const T &p)
APID: the fourth generation leptons are leptons.
bool isStrangeHadron(const T &p)
bool isBottomHadron(const T &p)
bool isCharmHadron(const T &p)
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...
int num_valid_children(const xAOD::TruthParticle *part)
@ MaybeMaterialInteraction
TruthParticle_v1 TruthParticle
Typedef to implementation.
std::optional< DetailedVertexType > classifyPhotonVertex(size_t truth_out_parts, size_t truth_valid_out_parts, const std::vector< const xAOD::TruthParticle * > &truth_children) const
std::optional< DetailedVertexType > classifyLeptonVertex(const SG::ConstAccessor< int > &uid_accessor, size_t truth_out_parts, size_t truth_valid_out_parts, const std::vector< const xAOD::TruthParticle * > &truth_children) const
std::optional< DetailedVertexType > classifyStrangeVertex(DetailedVertexType parent_type, bool has_parent) const
std::optional< DetailedVertexType > classifyTauVertex(DetailedVertexType parent_type, bool has_parent) const