ATLAS Offline Software
Public Member Functions | Public Attributes | Friends | List of all members
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. More...
 
 METComponent (std::size_t idx, const xAOD::TrigMissingET &met)
 Initialize from a component of an xAOD::TrigMissingET object. More...
 
float met () const
 The actual met. More...
 
float magnitude () const
 The magnitude of the missing 3-vector. More...
 
float phi () const
 The direction. More...
 
float eta () const
 The (pseudo) eta. More...
 
METComponentoperator+= (const METComponent &other)
 Add one to us. More...
 
METComponentoperator+= (const TLorentzVector &otherP4)
 Add a four momentum. More...
 
METComponentoperator+= (const SignedKinematics &kin)
 Add a signed object. More...
 
void fillMET (xAOD::TrigMissingET &met) const
 Fill the main component of the MET with this. More...
 
void fillMETComponent (std::size_t idx, xAOD::TrigMissingET &met) const
 Fill a component of the MET with this. More...
 

Public Attributes

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

Friends

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

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 40 of file METComponent.h.

Constructor & Destructor Documentation

◆ METComponent() [1/3]

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

Definition at line 48 of file METComponent.h.

52 {0.};

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

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

Friends And Related Function Documentation

◆ 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 55 of file METComponent.h.

◆ mpy

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

y momentum

Definition at line 57 of file METComponent.h.

◆ mpz

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

z momentum

Definition at line 59 of file METComponent.h.

◆ status

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

The status flag.

Definition at line 74 of file METComponent.h.

◆ sumE

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

Also store the sumE.

Definition at line 70 of file METComponent.h.

◆ sumEt

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

And the sumEt.

Definition at line 72 of file METComponent.h.


The documentation for this class was generated from the following files:
HLT::MET::METComponent::mpx
float mpx
Momentum components x momentum.
Definition: METComponent.h:55
HLT::MET::METComponent::sumEt
float sumEt
And the sumEt.
Definition: METComponent.h:72
HLT::MET::METComponent::status
int status
The status flag.
Definition: METComponent.h:74
HLT::MET::METComponent::sumE
float sumE
Also store the sumE.
Definition: METComponent.h:70
met
Definition: IMETSignificance.h:24
ret
T ret(T t)
Definition: rootspy.cxx:260
HLT::MET::METComponent::METComponent
METComponent()
Definition: METComponent.h:48
python.Dumpers.asinh
def asinh(x)
helper methods ---------------------------------------------------------—
Definition: Dumpers.py:89
HLT::MET::METComponent::mpy
float mpy
y momentum
Definition: METComponent.h:57
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
HLT::MET::METComponent::met
float met() const
The actual met.
Definition: METComponent.cxx:28
LArNewCalib_DelayDump_OFC_Cali.idx
idx
Definition: LArNewCalib_DelayDump_OFC_Cali.py:69
HLT::MET::METComponent::mpz
float mpz
z momentum
Definition: METComponent.h:59