ATLAS Offline Software
Loading...
Searching...
No Matches
HLT::MET::METComponent Class Reference

Helper struct to build up MET values before moving them into the EDM. More...

#include <METComponent.h>

Collaboration diagram for HLT::MET::METComponent:

Public Member Functions

 METComponent ()
 METComponent (const xAOD::TrigMissingET &met)
 Initialize from an xAOD::TrigMissingET object.
 METComponent (std::size_t idx, const xAOD::TrigMissingET &met)
 Initialize from a component of an xAOD::TrigMissingET object.
float met () const
 The actual met.
float magnitude () const
 The magnitude of the missing 3-vector.
float phi () const
 The direction.
float eta () const
 The (pseudo) eta.
METComponentoperator+= (const METComponent &other)
 Add one to us.
METComponentoperator+= (const TLorentzVector &otherP4)
 Add a four momentum.
METComponentoperator+= (const SignedKinematics &kin)
 Add a signed object.
void fillMET (xAOD::TrigMissingET &met) const
 Fill the main component of the MET with this.
void fillMETComponent (std::size_t idx, xAOD::TrigMissingET &met) const
 Fill a component of the MET with this.

Public Attributes

float mpx {0.}
 Momentum components x momentum.
float mpy {0.}
 y momentum
float mpz {0.}
 z momentum
float sumE {0.}
 Also store the sumE.
float sumEt {0.}
 And the sumEt.
int status {0}
 The status flag.

Friends

METComponent operator+ (const METComponent &lhs, const METComponent &rhs)
 Add two of these things together.

Detailed Description

Helper struct to build up MET values before moving them into the EDM.

The reason for doing this is that the EDM doesn't allow += operators etc which makes interacting with it rather painful and (maybe?) slow.

Definition at line 28 of file METComponent.h.

Constructor & Destructor Documentation

◆ METComponent() [1/3]

HLT::MET::METComponent::METComponent ( )
inline

Definition at line 30 of file METComponent.h.

30{}

◆ METComponent() [2/3]

HLT::MET::METComponent::METComponent ( const xAOD::TrigMissingET & met)

Initialize from an xAOD::TrigMissingET object.

Definition at line 9 of file METComponent.cxx.

9 :
10 mpx(met.ex() ),
11 mpy(met.ey() ),
12 mpz(met.ez() ),
13 sumE(met.sumE() ),
14 sumEt(met.sumEt() ),
15 status(met.flag() )
16 {}
float mpx
Momentum components x momentum.
float sumE
Also store the sumE.
float mpz
z momentum
float sumEt
And the sumEt.
float mpy
y momentum
int status
The status flag.
float met() const
The actual met.

◆ METComponent() [3/3]

HLT::MET::METComponent::METComponent ( std::size_t idx,
const xAOD::TrigMissingET & met )

Initialize from a component of an xAOD::TrigMissingET object.

Definition at line 18 of file METComponent.cxx.

19 :
20 mpx(met.exComponent(idx) ),
21 mpy(met.eyComponent(idx) ),
22 mpz(met.ezComponent(idx) ),
23 sumE(met.sumEComponent(idx) ),
24 sumEt(met.sumEtComponent(idx) ),
25 status(met.statusComponent(idx) )
26 {}

Member Function Documentation

◆ eta()

float HLT::MET::METComponent::eta ( ) const

The (pseudo) eta.

Definition at line 42 of file METComponent.cxx.

42 {
43 if (met() == 0)
44 return 0;
45 return std::asinh(mpz/met() );
46 }

◆ fillMET()

void HLT::MET::METComponent::fillMET ( xAOD::TrigMissingET & met) const

Fill the main component of the MET with this.

Definition at line 91 of file METComponent.cxx.

92 {
93 met.setEx(mpx);
94 met.setEy(mpy);
95 met.setEz(mpz);
96 met.setSumE(sumE);
97 met.setSumEt(sumEt);
98 met.setFlag(status);
99 }

◆ fillMETComponent()

void HLT::MET::METComponent::fillMETComponent ( std::size_t idx,
xAOD::TrigMissingET & met ) const

Fill a component of the MET with this.

Definition at line 101 of file METComponent.cxx.

103 {
104 met.setExComponent(ii, mpx);
105 met.setEyComponent(ii, mpy);
106 met.setEzComponent(ii, mpy);
107 met.setSumEComponent(ii, sumE);
108 met.setSumEtComponent(ii, sumEt);
109 met.setStatusComponent(ii, status);
110 }

◆ magnitude()

float HLT::MET::METComponent::magnitude ( ) const

The magnitude of the missing 3-vector.

Definition at line 32 of file METComponent.cxx.

32 {
33 return sqrt(mpx*mpx+mpy*mpy+mpz*mpz);
34 }

◆ met()

float HLT::MET::METComponent::met ( ) const

The actual met.

Definition at line 28 of file METComponent.cxx.

28 {
29 return sqrt(mpx*mpx+mpy*mpy);
30 }

◆ operator+=() [1/3]

METComponent & HLT::MET::METComponent::operator+= ( const METComponent & other)

Add one to us.

Definition at line 57 of file METComponent.cxx.

59 {
60 mpx += other.mpx;
61 mpy += other.mpy;
62 mpz += other.mpz;
63 sumE += other.sumE;
64 sumEt += other.sumEt;
65 status |= other.status;
66 return *this;
67 }

◆ operator+=() [2/3]

METComponent & HLT::MET::METComponent::operator+= ( const SignedKinematics & kin)

Add a signed object.

This uses the same convention as above (so a negative energy object increases the object

Definition at line 80 of file METComponent.cxx.

82 {
83 mpx -= kin.px();
84 mpy -= kin.py();
85 mpz -= kin.pz();
86 sumE += kin.energy();
87 sumEt += kin.pt();
88 return *this;
89 }

◆ operator+=() [3/3]

METComponent & HLT::MET::METComponent::operator+= ( const TLorentzVector & otherP4)

Add a four momentum.

Use the convention used in xAOD::MissingET where adding particle subtracts its four momentum. So 'adding' a particle to the MET works as you'd expect.

Definition at line 69 of file METComponent.cxx.

71 {
72 mpx -= otherP4.Px();
73 mpy -= otherP4.Py();
74 mpz -= otherP4.Pz();
75 sumE += otherP4.E();
76 sumEt += otherP4.Pt();
77 return *this;
78 }

◆ phi()

float HLT::MET::METComponent::phi ( ) const

The direction.

Definition at line 36 of file METComponent.cxx.

36 {
37 if (mpy == 0 && mpx == 0)
38 return 0;
39 return std::atan2(mpy, mpx);
40 }

◆ operator+

METComponent operator+ ( const METComponent & lhs,
const METComponent & rhs )
friend

Add two of these things together.

Definition at line 48 of file METComponent.cxx.

51 {
52 METComponent ret(lhs);
53 ret += rhs;
54 return ret;
55 }

Member Data Documentation

◆ mpx

float HLT::MET::METComponent::mpx {0.}

Momentum components x momentum.

Definition at line 37 of file METComponent.h.

37{0.};

◆ mpy

float HLT::MET::METComponent::mpy {0.}

y momentum

Definition at line 39 of file METComponent.h.

39{0.};

◆ mpz

float HLT::MET::METComponent::mpz {0.}

z momentum

Definition at line 41 of file METComponent.h.

41{0.};

◆ status

int HLT::MET::METComponent::status {0}

The status flag.

Definition at line 56 of file METComponent.h.

56{0};

◆ sumE

float HLT::MET::METComponent::sumE {0.}

Also store the sumE.

Definition at line 52 of file METComponent.h.

52{0.};

◆ sumEt

float HLT::MET::METComponent::sumEt {0.}

And the sumEt.

Definition at line 54 of file METComponent.h.

54{0.};

The documentation for this class was generated from the following files: