ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
Algorithms
TruthPartonLevelAnalysisAlgorithms
VectorHelpers
LorentzHelper.h
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
#ifndef LORENTZHELPER_H
9
#define LORENTZHELPER_H
10
11
// Include necessary header files
12
#include "Math/Vector4D.h"
13
#include "Math/VectorUtil.h"
14
#include "
xAODTruth/TruthParticle.h
"
15
16
// Using directives for convenience with ROOT::Math vector types
17
using
ROOT::Math::PtEtaPhiEVector;
18
using
ROOT::Math::PtEtaPhiMVector;
19
using
ROOT::Math::PxPyPzEVector;
20
using
ROOT::Math::PxPyPzMVector;
21
22
// Template function to create a PtEtaPhiMVector
23
template
<
typename
object
>
24
PtEtaPhiMVector
GetPtEtaPhiM
(
const
object
* obj) {
25
return
PtEtaPhiMVector(
26
obj->pt(),
// float px and py cast to double to build pT
27
obj->eta(),
// double
28
obj->phi(),
// double
29
obj->m());
// double
30
}
31
32
// Template function to create a PtEtaPhiEVector
33
template
<
typename
object
>
34
PtEtaPhiEVector
GetPtEtaPhiE
(
const
object
* obj) {
35
return
PtEtaPhiEVector(
36
obj->pt(),
// float px and py cast to double to build pT
37
obj->eta(),
// double
38
obj->phi(),
// double
39
obj->e());
// double
40
}
41
42
// Template function to create a PxPyPzMVector
43
template
<
typename
object
>
44
PxPyPzMVector
GetPxPyPzM
(
const
object
* obj) {
45
return
PxPyPzMVector(obj->px(),
// float
46
obj->py(),
// float
47
obj->pz(),
// float
48
obj->m());
// double
49
}
50
51
// Template function to create a PxPyPzEVector
52
template
<
typename
object
>
53
PxPyPzEVector
GetPxPyPzE
(
const
object
* obj) {
54
return
PxPyPzEVector(obj->px(),
// float
55
obj->py(),
// float
56
obj->pz(),
// float
57
obj->e());
// double
58
}
59
60
// We don't template these as some will include warnings and differ slightly!
61
// This shall highlight the difference w.r.t. truth particle information
62
PtEtaPhiMVector
GetPtEtaPhiMfromTruth
(
const
xAOD::TruthParticle
*
TruthParticle
);
63
PxPyPzMVector
GetPxPyPzMfromTruth
(
const
xAOD::TruthParticle
*
TruthParticle
);
64
PtEtaPhiEVector
GetPtEtaPhiEfromTruth
(
const
xAOD::TruthParticle
*
TruthParticle
);
65
PxPyPzEVector
GetPxPyPzEfromTruth
(
const
xAOD::TruthParticle
*
TruthParticle
);
66
67
#endif
TruthParticle.h
GetPxPyPzEfromTruth
PxPyPzEVector GetPxPyPzEfromTruth(const xAOD::TruthParticle *TruthParticle)
Definition
LorentzHelper.cxx:52
GetPxPyPzM
PxPyPzMVector GetPxPyPzM(const object *obj)
Definition
LorentzHelper.h:44
GetPtEtaPhiM
PtEtaPhiMVector GetPtEtaPhiM(const object *obj)
Definition
LorentzHelper.h:24
GetPtEtaPhiEfromTruth
PtEtaPhiEVector GetPtEtaPhiEfromTruth(const xAOD::TruthParticle *TruthParticle)
Definition
LorentzHelper.cxx:39
GetPxPyPzE
PxPyPzEVector GetPxPyPzE(const object *obj)
Definition
LorentzHelper.h:53
GetPtEtaPhiMfromTruth
PtEtaPhiMVector GetPtEtaPhiMfromTruth(const xAOD::TruthParticle *TruthParticle)
Definition
LorentzHelper.cxx:29
GetPtEtaPhiE
PtEtaPhiEVector GetPtEtaPhiE(const object *obj)
Definition
LorentzHelper.h:34
GetPxPyPzMfromTruth
PxPyPzMVector GetPxPyPzMfromTruth(const xAOD::TruthParticle *TruthParticle)
Definition
LorentzHelper.cxx:19
TruthParticle
(HepMC) Monte Carlo particle.
Definition
PhysicsAnalysis/TruthParticleID/McParticleEvent/McParticleEvent/TruthParticle.h:58
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