ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
Algorithms
TruthPartonLevelAnalysisAlgorithms
Root
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
8
#include "
VectorHelpers/LorentzHelper.h
"
9
10
#include <
AsgMessaging/MessageCheck.h
>
11
12
#include "Math/Vector4D.h"
13
#include "
xAODTruth/TruthParticle.h
"
14
15
namespace
CP
{
16
17
ROOT::Math::PxPyPzMVector
GetPxPyPzMfromTruth
(
18
const
xAOD::TruthParticle
*
TruthParticle
) {
19
ROOT::Math::PxPyPzMVector MassSafeVector(
20
TruthParticle
->px(),
21
TruthParticle
->py(),
22
TruthParticle
->pz(),
23
TruthParticle
->m());
24
return
MassSafeVector;
25
}
26
27
ROOT::Math::PtEtaPhiMVector
GetPtEtaPhiMfromTruth
(
28
const
xAOD::TruthParticle
*
TruthParticle
) {
29
ROOT::Math::PtEtaPhiMVector MassSafeVector(
30
TruthParticle
->pt(),
31
TruthParticle
->eta(),
32
TruthParticle
->phi(),
33
TruthParticle
->m());
34
return
MassSafeVector;
35
}
36
37
ROOT::Math::PtEtaPhiEVector
GetPtEtaPhiEfromTruth
(
38
const
xAOD::TruthParticle
*
TruthParticle
) {
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
50
ROOT::Math::PxPyPzEVector
GetPxPyPzEfromTruth
(
51
const
xAOD::TruthParticle
*
TruthParticle
) {
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
MessageCheck.h
macros for messaging and checking status codes
TruthParticle.h
LorentzHelper.h
CP
Select isolated Photons, Electrons and Muons.
Definition
Control/xAODRootAccess/xAODRootAccess/TEvent.h:27
CP::GetPtEtaPhiMfromTruth
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.
Definition
LorentzHelper.cxx:27
CP::GetPxPyPzEfromTruth
ROOT::Math::PxPyPzEVector GetPxPyPzEfromTruth(const xAOD::TruthParticle *TruthParticle)
Definition
LorentzHelper.cxx:50
CP::GetPxPyPzMfromTruth
ROOT::Math::PxPyPzMVector GetPxPyPzMfromTruth(const xAOD::TruthParticle *TruthParticle)
Definition
LorentzHelper.cxx:17
CP::GetPtEtaPhiEfromTruth
ROOT::Math::PtEtaPhiEVector GetPtEtaPhiEfromTruth(const xAOD::TruthParticle *TruthParticle)
Definition
LorentzHelper.cxx:37
xAOD::TruthParticle
TruthParticle_v1 TruthParticle
Typedef to implementation.
Definition
Event/xAOD/xAODTruth/xAODTruth/TruthParticle.h:15
Generated on
for ATLAS Offline Software by
1.17.0