ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
MissingETEvent
src
MissingEtTruth.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
/********************************************************************
6
7
NAME: MissingEtTruth.cxx
8
PACKAGE: offline/Reconstruction/MissingETEvent
9
10
AUTHORS: P. Loch, S. Resconi
11
CREATED: Oct 2004
12
13
PURPOSE:
14
********************************************************************/
15
#include "
MissingETEvent/MissingET.h
"
16
#include "
MissingETEvent/MissingEtTruth.h
"
17
#include "
MissingETEvent/MissingEtRegions.h
"
18
19
#include "CLHEP/Vector/LorentzVector.h"
20
#include "CLHEP/Units/SystemOfUnits.h"
21
#include "
TruthUtils/HepMCHelpers.h
"
22
23
24
MissingEtTruth::MissingEtTruth
() :
MissingET
(
MissingET
::
Truth
)
25
{
26
this->
setup
();
27
}
28
29
MissingEtTruth::MissingEtTruth
(
MissingEtRegions
* aRegion)
30
:
MissingET
(
MissingET
::
Truth
,aRegion)
31
{
32
this->
setup
();
33
}
34
35
MissingEtTruth::MissingEtTruth
(
MissingET::Source
aSource,
36
MissingEtRegions
* aRegion)
37
:
MissingET
(aSource,aRegion)
38
{
39
this->
setup
();
40
}
41
42
MissingEtTruth::~MissingEtTruth
()
43
{
44
this->
setup
();
45
}
46
47
void
MissingEtTruth::addPart
(
HepMC::ConstGenParticlePtr
Part,
double
etaFull)
48
{
49
50
double
weight = 1.;
51
double
exp = (Part)->momentum().px();
52
double
eyp = (Part)->momentum().py();
53
double
etp = (Part)->momentum().perp();
54
double
etap = (Part)->momentum().pseudoRapidity();
55
int
idp = (Part)->pdg_id();
56
57
TruthIndex
thePart =
NotValid
;
58
59
if
( !
MC::isSimInteracting
(Part) )
// if IsGenNonInteracting returns true
60
{
61
thePart =
NonInt
;
// all NON interacting particles (neutrinos + SUSY particles)
62
m_exTruth
[
NonInt
] += exp;
63
m_eyTruth
[
NonInt
] += eyp;
64
m_etSumTruth
[
NonInt
] += etp;
65
66
}
else
{
67
if
(abs(idp) != 13)
// all interacting particles and NO muons
68
{
69
if
( fabs(etap) <= 5.) {
70
// update the global sums and eta regions in eta <= 5
71
this->
add
(exp, eyp, etp, etap, weight);
72
m_exTruth
[
Int
] -= exp;
73
m_eyTruth
[
Int
] -= eyp;
74
m_etSumTruth
[
Int
] += etp;
75
//thePart = Int;
76
}
77
if
( fabs(etap) <= etaFull) thePart =
IntCentral
;
78
if
( fabs(etap) > etaFull && fabs(etap) <= 5.) thePart =
IntFwd
;
79
if
( fabs(etap) > 5.) thePart =
IntOutCover
;
80
}
else
{
81
//if (etp > 6000. && fabs(etap) <= 2.5) // select "measurable" muons
82
//{
83
thePart =
Muons
;
// all muons
84
//}
85
}
86
87
if
(thePart !=
NotValid
) {
// Can be == if etap is a nan !! Fixed by Scott Snyder
88
m_exTruth
[(size_t)thePart] -= exp;
89
m_eyTruth
[(size_t)thePart] -= eyp;
90
m_etSumTruth
[(size_t)thePart] += etp;
91
}
92
93
}
94
95
96
97
}
98
99
100
//set methods
101
102
void
MissingEtTruth::setExTruth
(
MissingEtTruth::TruthIndex
theTruth,
103
double
theEx)
104
{
105
if
( theTruth <
Size
)
m_exTruth
[(size_t)theTruth] = theEx;
106
}
107
108
109
void
MissingEtTruth::setEyTruth
(
MissingEtTruth::TruthIndex
theTruth,
110
double
theEy)
111
{
112
if
( theTruth <
Size
)
m_eyTruth
[(size_t)theTruth] = theEy;
113
}
114
115
116
void
MissingEtTruth::setEtSumTruth
(
MissingEtTruth::TruthIndex
theTruth,
117
double
theEtSum)
118
{
119
if
( theTruth <
Size
)
m_etSumTruth
[(size_t)theTruth] = theEtSum;
120
121
}
122
123
124
void
MissingEtTruth::setExTruthVec
(std::vector<double>&&
exTruthVec
)
125
{
126
assert (
exTruthVec
.size() ==
Size
);
127
m_exTruth
= std::move (
exTruthVec
);
128
}
129
130
131
void
MissingEtTruth::setEyTruthVec
(std::vector<double>&&
eyTruthVec
)
132
{
133
assert (
eyTruthVec
.size() ==
Size
);
134
m_eyTruth
= std::move (
eyTruthVec
);
135
}
136
137
138
void
MissingEtTruth::setEtSumTruthVec
(std::vector<double>&&
etSumTruthVec
)
139
{
140
assert (
etSumTruthVec
.size() ==
Size
);
141
m_etSumTruth
= std::move (
etSumTruthVec
);
142
}
143
144
145
// get methods
146
147
double
MissingEtTruth::exTruth
(
MissingEtTruth::TruthIndex
theTruth)
const
148
{
149
return
m_exTruth
[theTruth] ;
150
}
151
152
double
MissingEtTruth::eyTruth
(
MissingEtTruth::TruthIndex
theTruth)
const
153
{
154
return
m_eyTruth
[theTruth] ;
155
}
156
157
double
MissingEtTruth::etSumTruth
(
MissingEtTruth::TruthIndex
theTruth)
const
158
{
159
return
m_etSumTruth
[theTruth] ;
160
}
161
162
163
const
std::vector<double>&
MissingEtTruth::exTruthVec
()
const
164
{
165
return
m_exTruth
;
166
}
167
168
169
const
std::vector<double>&
MissingEtTruth::eyTruthVec
()
const
170
{
171
return
m_eyTruth
;
172
}
173
174
175
const
std::vector<double>&
MissingEtTruth::etSumTruthVec
()
const
176
{
177
return
m_etSumTruth
;
178
}
179
180
181
void
MissingEtTruth::setup
()
182
{
183
// initialize data members
184
185
m_exTruth
.resize(
MissingEtTruth::Size
,0.);
186
m_eyTruth
.resize(
MissingEtTruth::Size
,0.);
187
m_etSumTruth
.resize(
MissingEtTruth::Size
,0.);
188
}
189
HepMCHelpers.h
ATLAS-specific HepMC functions.
MissingEtRegions.h
MissingEtTruth.h
MissingET.h
MissingET::MissingET
MissingET()
Definition
MissingET.cxx:41
MissingET::Source
Source
Definition
Reconstruction/MissingETEvent/MissingETEvent/MissingET.h:29
MissingET::add
virtual void add(double theEx, double theEy, double theEt, double theEta, double weight)
Definition
MissingET.cxx:127
MissingEtRegions
Definition
MissingEtRegions.h:22
MissingEtTruth::m_exTruth
std::vector< double > m_exTruth
Definition
MissingEtTruth.h:77
MissingEtTruth::setExTruthVec
void setExTruthVec(std::vector< double > &&exCaloVec)
Definition
MissingEtTruth.cxx:124
MissingEtTruth::~MissingEtTruth
virtual ~MissingEtTruth()
Definition
MissingEtTruth.cxx:42
MissingEtTruth::setEtSumTruthVec
void setEtSumTruthVec(std::vector< double > &&etSumCaloVec)
Definition
MissingEtTruth.cxx:138
MissingEtTruth::m_eyTruth
std::vector< double > m_eyTruth
Definition
MissingEtTruth.h:78
MissingEtTruth::exTruth
double exTruth(TruthIndex aTruth) const
Definition
MissingEtTruth.cxx:147
MissingEtTruth::addPart
void addPart(HepMC::ConstGenParticlePtr aPart, double etaFull)
Definition
MissingEtTruth.cxx:47
MissingEtTruth::TruthIndex
TruthIndex
Definition
MissingEtTruth.h:32
MissingEtTruth::Int
@ Int
Definition
MissingEtTruth.h:33
MissingEtTruth::IntFwd
@ IntFwd
Definition
MissingEtTruth.h:37
MissingEtTruth::NotValid
@ NotValid
Definition
MissingEtTruth.h:42
MissingEtTruth::NonInt
@ NonInt
Definition
MissingEtTruth.h:34
MissingEtTruth::IntOutCover
@ IntOutCover
Definition
MissingEtTruth.h:39
MissingEtTruth::IntCentral
@ IntCentral
Definition
MissingEtTruth.h:35
MissingEtTruth::Size
@ Size
Definition
MissingEtTruth.h:41
MissingEtTruth::setEyTruth
void setEyTruth(TruthIndex aTruth, double theEy)
Definition
MissingEtTruth.cxx:109
MissingEtTruth::m_etSumTruth
std::vector< double > m_etSumTruth
Definition
MissingEtTruth.h:79
MissingEtTruth::MissingEtTruth
MissingEtTruth()
Definition
MissingEtTruth.cxx:24
MissingEtTruth::etSumTruth
double etSumTruth(TruthIndex aTruth) const
Definition
MissingEtTruth.cxx:157
MissingEtTruth::setEtSumTruth
void setEtSumTruth(TruthIndex aTruth, double theEtSum)
Definition
MissingEtTruth.cxx:116
MissingEtTruth::eyTruthVec
const std::vector< double > & eyTruthVec() const
Definition
MissingEtTruth.cxx:169
MissingEtTruth::setEyTruthVec
void setEyTruthVec(std::vector< double > &&exCaloVec)
Definition
MissingEtTruth.cxx:131
MissingEtTruth::setup
void setup()
Definition
MissingEtTruth.cxx:181
MissingEtTruth::exTruthVec
const std::vector< double > & exTruthVec() const
Definition
MissingEtTruth.cxx:163
MissingEtTruth::eyTruth
double eyTruth(TruthIndex aTruth) const
Definition
MissingEtTruth.cxx:152
MissingEtTruth::setExTruth
void setExTruth(TruthIndex aTruth, double theEx)
Definition
MissingEtTruth.cxx:102
MissingEtTruth::etSumTruthVec
const std::vector< double > & etSumTruthVec() const
Definition
MissingEtTruth.cxx:175
HepMC::ConstGenParticlePtr
HepMC3::ConstGenParticlePtr ConstGenParticlePtr
Definition
GenParticle.h:20
MC::isSimInteracting
bool isSimInteracting(const T &p)
Identify if the particle could interact with the detector during the simulation, e....
Definition
HepMCHelpers.h:61
Muons
Definition
Muons.py:1
Truth
Definition
ITruthClassificationTool.h:16
Generated on
for ATLAS Offline Software by
1.17.0