ATLAS Offline Software
Loading...
Searching...
No Matches
LorentzHelper.h File Reference
#include "Math/Vector4D.h"
#include "Math/VectorUtil.h"
#include "xAODEgamma/ElectronContainer.h"
#include "xAODJet/JetContainer.h"
#include "xAODMuon/MuonContainer.h"
#include "xAODTruth/TruthParticle.h"
#include "xAODTruth/xAODTruthHelpers.h"
Include dependency graph for LorentzHelper.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

template<typename object>
PtEtaPhiMVector GetPtEtaPhiM (const object *obj)
template<typename object>
PtEtaPhiEVector GetPtEtaPhiE (const object *obj)
template<typename object>
PxPyPzMVector GetPxPyPzM (const object *obj)
template<typename object>
PxPyPzEVector GetPxPyPzE (const object *obj)
PtEtaPhiMVector GetPtEtaPhiMfromTruth (const xAOD::TruthParticle *TruthParticle)
PxPyPzMVector GetPxPyPzMfromTruth (const xAOD::TruthParticle *TruthParticle)
PtEtaPhiEVector GetPtEtaPhiEfromTruth (const xAOD::TruthParticle *TruthParticle)
PxPyPzEVector GetPxPyPzEfromTruth (const xAOD::TruthParticle *TruthParticle)

Function Documentation

◆ GetPtEtaPhiE()

template<typename object>
PtEtaPhiEVector GetPtEtaPhiE ( const object * obj)

Definition at line 38 of file LorentzHelper.h.

38 {
39 return PtEtaPhiEVector(
40 obj->pt(), // float px and py cast to double to build pT
41 obj->eta(), // double
42 obj->phi(), // double
43 obj->e()); // double
44}

◆ GetPtEtaPhiEfromTruth()

PtEtaPhiEVector GetPtEtaPhiEfromTruth ( const xAOD::TruthParticle * TruthParticle)

Definition at line 39 of file LorentzHelper.cxx.

40 {
41 asg::msgUserCode::ANA_MSG_WARNING(
42 "LorentzHelper WARNING: We can't guarantee the mass from this 4-vector "
43 "is correct, consider using GetPtEtaPhiMfromTruth");
44 ROOT::Math::PtEtaPhiEVector EnergySafeVector(
48 TruthParticle->e());
49 return EnergySafeVector;
50}
virtual double e() const
energy
virtual double pt() const
transverse momentum
virtual double phi() const
phi in [-pi,pi[
virtual double eta() const
pseudo rapidity

◆ GetPtEtaPhiM()

template<typename object>
PtEtaPhiMVector GetPtEtaPhiM ( const object * obj)

Definition at line 28 of file LorentzHelper.h.

28 {
29 return PtEtaPhiMVector(
30 obj->pt(), // float px and py cast to double to build pT
31 obj->eta(), // double
32 obj->phi(), // double
33 obj->m()); // double
34}

◆ GetPtEtaPhiMfromTruth()

PtEtaPhiMVector GetPtEtaPhiMfromTruth ( const xAOD::TruthParticle * TruthParticle)

Definition at line 29 of file LorentzHelper.cxx.

30 {
31 ROOT::Math::PtEtaPhiMVector MassSafeVector(
35 TruthParticle->m());
36 return MassSafeVector;
37}
virtual double m() const
mass

◆ GetPxPyPzE()

template<typename object>
PxPyPzEVector GetPxPyPzE ( const object * obj)

Definition at line 57 of file LorentzHelper.h.

57 {
58 return PxPyPzEVector(obj->px(), // float
59 obj->py(), // float
60 obj->pz(), // float
61 obj->e()); // double
62}

◆ GetPxPyPzEfromTruth()

PxPyPzEVector GetPxPyPzEfromTruth ( const xAOD::TruthParticle * TruthParticle)

Definition at line 52 of file LorentzHelper.cxx.

53 {
54 asg::msgUserCode::ANA_MSG_WARNING(
55 "LorentzHelper WARNING: We can't guarantee the mass from this 4-vector "
56 "is correct, consider using GetPxPyPzMfromTruth");
57 ROOT::Math::PxPyPzEVector EnergySafeVector(
61 TruthParticle->e());
62 return EnergySafeVector;
63}
virtual double pz() const
z component of momentum
virtual double px() const
x component of momentum
virtual double py() const
y component of momentum

◆ GetPxPyPzM()

template<typename object>
PxPyPzMVector GetPxPyPzM ( const object * obj)

Definition at line 48 of file LorentzHelper.h.

48 {
49 return PxPyPzMVector(obj->px(), // float
50 obj->py(), // float
51 obj->pz(), // float
52 obj->m()); // double
53}

◆ GetPxPyPzMfromTruth()

PxPyPzMVector GetPxPyPzMfromTruth ( const xAOD::TruthParticle * TruthParticle)
Author
Baptiste Ravina bapti.nosp@m.ste..nosp@m.ravin.nosp@m.a@ce.nosp@m.rn.ch
Steffen Korn steff.nosp@m.en.k.nosp@m.orn@c.nosp@m.ern..nosp@m.ch

Definition at line 19 of file LorentzHelper.cxx.

20 {
21 ROOT::Math::PxPyPzMVector MassSafeVector(
25 TruthParticle->m());
26 return MassSafeVector;
27}