ATLAS Offline Software
Loading...
Searching...
No Matches
MuonSpectrometer/MuonValidation/MuonVertexValidation/src/Utils.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef MSVTXVALIDATIONALGUTILS_H
6#define MSVTXVALIDATIONALGUTILS_H
7
8#include <vector>
9#include <cmath>
10#include <unordered_set>
11#include <algorithm>
12
13#include "CxxUtils/fpcompare.h"
14#include "GaudiKernel/SystemOfUnits.h"
19
25
26#include <TLorentzVector.h>
27
28
30
31 // particle properties
32 double getCTau(const xAOD::TruthVertex *decVtx);
33 // takes the fraction of energy deposited in the ECal and computes the log10 of the ratio between the energy deposited in the ECal and HCal
34 double getCalEnergyLogRatio(double EMF);
35 bool comparePt(const xAOD::TruthParticle* part1, const xAOD::TruthParticle* part2);
36
37 // decay chain utils
38 std::vector<const xAOD::TruthParticle*> getChildren(const xAOD::TruthParticle* mother);
39 std::vector<const xAOD::TruthParticle*> getStableChildren(const xAOD::TruthParticle* particle, bool findOnlyGenStable);
40 std::vector<const xAOD::TruthParticle*> getStableChildrenRecursive(const xAOD::TruthParticle* particle, bool findOnlyGenStable, std::unordered_set<const xAOD::TruthParticle*>& visited);
41 std::vector<const xAOD::TruthParticle*> getDecayProducts(const xAOD::TruthVertex* vtx);
42
43 // active vertices associated with jets
44 struct ActiveVertex {
45 const xAOD::TruthVertex* vtx{nullptr};
46 // from the four vector such of the direct decay products of the vertex
47 Double_t vtxEnergy{0.};
48 Double_t vtxMass{0.};
49 Double_t vtxPt{0.};
50 Double_t vtxScalarPtSum{0.}; // scalar pT sum of the direct decay products
51 // decay chain properties
52 size_t nChildren{0};
53 size_t decayDepth{0};
54 };
55
56 std::vector<ActiveVertex> getActiveVertices(const xAOD::Jet* jet, const xAOD::TruthParticleContainer& truthParticles);
57
58 // vertex isolation
59 struct VtxIso {
60 double track_mindR{-1.};
61 double track_pTsum{-1.};
62 double jet_mindR{-1.};
63 };
64
65 VtxIso getIso(const xAOD::Vertex *MSVtx, const xAOD::TrackParticleContainer& Tracks, const xAOD::JetContainer& Jets,
66 double trackIso_pT, double softTrackIso_R, double jetIso_pT, double jetIso_LogRatio);
67}
68
69#endif // MSVTXVALIDATIONALGUTILS_H
ATLAS-specific HepMC functions.
Workaround x86 precision issues for FP inequality comparisons.
Definition Jets.py:1
std::vector< const xAOD::TruthParticle * > getDecayProducts(const xAOD::TruthVertex *vtx)
std::vector< const xAOD::TruthParticle * > getStableChildren(const xAOD::TruthParticle *particle, bool findOnlyGenStable)
std::vector< const xAOD::TruthParticle * > getChildren(const xAOD::TruthParticle *mother)
std::vector< const xAOD::TruthParticle * > getStableChildrenRecursive(const xAOD::TruthParticle *particle, bool findOnlyGenStable, std::unordered_set< const xAOD::TruthParticle * > &visited)
VtxIso getIso(const xAOD::Vertex *vtx, const xAOD::TrackParticleContainer &Tracks, const xAOD::JetContainer &Jets, double trackIso_pT, double softTrackIso_R, double jetIso_pT, double jetIso_LogRatio)
std::vector< ActiveVertex > getActiveVertices(const xAOD::Jet *jet, const xAOD::TruthParticleContainer &truthParticles)
bool comparePt(const xAOD::TruthParticle *part1, const xAOD::TruthParticle *part2)
Jet_v1 Jet
Definition of the current "jet version".
TruthVertex_v1 TruthVertex
Typedef to implementation.
Definition TruthVertex.h:15
Vertex_v1 Vertex
Define the latest version of the vertex class.
TruthParticle_v1 TruthParticle
Typedef to implementation.
TrackParticleContainer_v1 TrackParticleContainer
Definition of the current "TrackParticle container version".
JetContainer_v1 JetContainer
Definition of the current "jet container version".
TruthParticleContainer_v1 TruthParticleContainer
Declare the latest version of the truth particle container.