ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigAlgorithms
TrigEFMissingET
Root
METComponent.cxx
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
TrigEFMissingET/METComponent.h
"
6
#include <cmath>
7
8
namespace
HLT
{
namespace
MET
{
9
METComponent::METComponent
(
const
xAOD::TrigMissingET
&
met
) :
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
{}
17
18
METComponent::METComponent
(
19
std::size_t idx,
const
xAOD::TrigMissingET
&
met
) :
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
{}
27
28
float
METComponent::met
()
const
{
29
return
sqrt(
mpx
*
mpx
+
mpy
*
mpy
);
30
}
31
32
float
METComponent::magnitude
()
const
{
33
return
sqrt(
mpx
*
mpx
+
mpy
*
mpy
+
mpz
*
mpz
);
34
}
35
36
float
METComponent::phi
()
const
{
37
if
(
mpy
== 0 &&
mpx
== 0)
38
return
0;
39
return
std::atan2(
mpy
,
mpx
);
40
}
41
42
float
METComponent::eta
()
const
{
43
if
(
met
() == 0)
44
return
0;
45
return
std::asinh(
mpz
/
met
() );
46
}
47
48
METComponent
operator+
(
49
const
METComponent
& lhs,
50
const
METComponent
& rhs)
51
{
52
METComponent
ret(lhs);
53
ret += rhs;
54
return
ret;
55
}
56
57
METComponent
&
METComponent::operator+=
(
58
const
METComponent
& other)
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
}
68
69
METComponent
&
METComponent::operator+=
(
70
const
TLorentzVector& otherP4)
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
}
79
80
METComponent
&
METComponent::operator+=
(
81
const
SignedKinematics
& kin)
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
}
90
91
void
METComponent::fillMET
(
xAOD::TrigMissingET
&
met
)
const
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
}
100
101
void
METComponent::fillMETComponent
(
102
std::size_t ii,
xAOD::TrigMissingET
&
met
)
const
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
}
111
112
std::ostream&
operator<<
(std::ostream& os,
const
METComponent
& component)
113
{
114
os <<
"(mpx, mpy, mpz, met, sumEt, sumE) = ("
115
<< component.
mpx
<<
", "
116
<< component.
mpy
<<
", "
117
<< component.
mpz
<<
", "
118
<< component.
met
() <<
", "
119
<< component.
sumEt
<<
", "
120
<< component.
sumE
<<
") [MeV]"
;
121
return
os;
122
}
123
} }
//> end namespace HLT::MET
METComponent.h
HLT::MET::METComponent
Helper struct to build up MET values before moving them into the EDM.
Definition
METComponent.h:28
HLT::MET::METComponent::mpx
float mpx
Momentum components x momentum.
Definition
METComponent.h:37
HLT::MET::METComponent::sumE
float sumE
Also store the sumE.
Definition
METComponent.h:52
HLT::MET::METComponent::mpz
float mpz
z momentum
Definition
METComponent.h:41
HLT::MET::METComponent::sumEt
float sumEt
And the sumEt.
Definition
METComponent.h:54
HLT::MET::METComponent::eta
float eta() const
The (pseudo) eta.
Definition
METComponent.cxx:42
HLT::MET::METComponent::mpy
float mpy
y momentum
Definition
METComponent.h:39
HLT::MET::METComponent::operator+=
METComponent & operator+=(const METComponent &other)
Add one to us.
Definition
METComponent.cxx:57
HLT::MET::METComponent::status
int status
The status flag.
Definition
METComponent.h:56
HLT::MET::METComponent::phi
float phi() const
The direction.
Definition
METComponent.cxx:36
HLT::MET::METComponent::magnitude
float magnitude() const
The magnitude of the missing 3-vector.
Definition
METComponent.cxx:32
HLT::MET::METComponent::fillMETComponent
void fillMETComponent(std::size_t idx, xAOD::TrigMissingET &met) const
Fill a component of the MET with this.
Definition
METComponent.cxx:101
HLT::MET::METComponent::fillMET
void fillMET(xAOD::TrigMissingET &met) const
Fill the main component of the MET with this.
Definition
METComponent.cxx:91
HLT::MET::METComponent::met
float met() const
The actual met.
Definition
METComponent.cxx:28
HLT::MET::METComponent::METComponent
METComponent()
Definition
METComponent.h:30
HLT::MET::SignedKinematics
Class to describe the kinematics of an object that can have negative energies.
Definition
SignedKinematics.h:42
HLT::MET::SignedKinematics::pz
double pz() const
Definition
SignedKinematics.cxx:127
HLT::MET::SignedKinematics::px
double px() const
Definition
SignedKinematics.cxx:121
HLT::MET::SignedKinematics::py
double py() const
Definition
SignedKinematics.cxx:124
HLT::MET::SignedKinematics::energy
double energy() const
Energy values (signed) energy.
Definition
SignedKinematics.cxx:131
HLT::MET::SignedKinematics::pt
double pt() const
(signed) pt
Definition
SignedKinematics.cxx:112
HLT::MET::operator+
METComponent operator+(const METComponent &lhs, const METComponent &rhs)
Definition
METComponent.cxx:48
HLT::MET::operator<<
std::ostream & operator<<(std::ostream &os, const METComponent &component)
Definition
METComponent.cxx:112
HLT
It used to be useful piece of code for replacing actual SG with other store of similar functionality ...
Definition
HLTResultReader.h:26
MET
Definition
MET.py:1
met
Definition
IMETSignificance.h:24
xAOD::TrigMissingET
TrigMissingET_v1 TrigMissingET
Define the most recent version of the TrigMissingET class.
Definition
Event/xAOD/xAODTrigMissingET/xAODTrigMissingET/TrigMissingET.h:12
Generated on
for ATLAS Offline Software by
1.17.0