ATLAS Offline Software
Loading...
Searching...
No Matches
LorentzHelper.h File Reference
#include "Math/Vector4D.h"
#include "Math/VectorUtil.h"
#include "xAODTruth/TruthParticle.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 34 of file LorentzHelper.h.

34 {
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}

◆ 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 24 of file LorentzHelper.h.

24 {
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}

◆ 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 53 of file LorentzHelper.h.

53 {
54 return PxPyPzEVector(obj->px(), // float
55 obj->py(), // float
56 obj->pz(), // float
57 obj->e()); // double
58}

◆ 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 44 of file LorentzHelper.h.

44 {
45 return PxPyPzMVector(obj->px(), // float
46 obj->py(), // float
47 obj->pz(), // float
48 obj->m()); // double
49}

◆ 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}