ATLAS Offline Software
Loading...
Searching...
No Matches
LorentzHelper.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
7
9
11
12#include "Math/Vector4D.h"
14
15namespace CP {
16
17ROOT::Math::PxPyPzMVector GetPxPyPzMfromTruth(
19 ROOT::Math::PxPyPzMVector MassSafeVector(
20 TruthParticle->px(),
21 TruthParticle->py(),
22 TruthParticle->pz(),
23 TruthParticle->m());
24 return MassSafeVector;
25}
26
27ROOT::Math::PtEtaPhiMVector GetPtEtaPhiMfromTruth(
29 ROOT::Math::PtEtaPhiMVector MassSafeVector(
30 TruthParticle->pt(),
31 TruthParticle->eta(),
32 TruthParticle->phi(),
33 TruthParticle->m());
34 return MassSafeVector;
35}
36
37ROOT::Math::PtEtaPhiEVector GetPtEtaPhiEfromTruth(
39 asg::msgUserCode::ANA_MSG_WARNING(
40 "LorentzHelper WARNING: We can't guarantee the mass from this 4-vector "
41 "is correct, consider using GetPtEtaPhiMfromTruth");
42 ROOT::Math::PtEtaPhiEVector EnergySafeVector(
43 TruthParticle->pt(),
44 TruthParticle->eta(),
45 TruthParticle->phi(),
46 TruthParticle->e());
47 return EnergySafeVector;
48}
49
50ROOT::Math::PxPyPzEVector GetPxPyPzEfromTruth(
52 asg::msgUserCode::ANA_MSG_WARNING(
53 "LorentzHelper WARNING: We can't guarantee the mass from this 4-vector "
54 "is correct, consider using GetPxPyPzMfromTruth");
55 ROOT::Math::PxPyPzEVector EnergySafeVector(
56 TruthParticle->px(),
57 TruthParticle->py(),
58 TruthParticle->pz(),
59 TruthParticle->e());
60 return EnergySafeVector;
61}
62
63} // namespace CP
macros for messaging and checking status codes
Select isolated Photons, Electrons and Muons.
ROOT::Math::PtEtaPhiMVector GetPtEtaPhiMfromTruth(const xAOD::TruthParticle *TruthParticle)
Four-vector of a truth particle, built from (pt, eta, phi, m) so that the mass is preserved exactly.
ROOT::Math::PxPyPzEVector GetPxPyPzEfromTruth(const xAOD::TruthParticle *TruthParticle)
ROOT::Math::PxPyPzMVector GetPxPyPzMfromTruth(const xAOD::TruthParticle *TruthParticle)
ROOT::Math::PtEtaPhiEVector GetPtEtaPhiEfromTruth(const xAOD::TruthParticle *TruthParticle)
TruthParticle_v1 TruthParticle
Typedef to implementation.