ATLAS Offline Software
Loading...
Searching...
No Matches
MissingET.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
7NAME: MissingEt.cxx
8PACKAGE: offline/Reconstruction/MissingETEvent
9
10AUTHORS: P. Loch, S. Resconi
11CREATED: Oct 2004
12
13PURPOSE: Base Class for MissingETEvent package, it owns the region object
14********************************************************************/
17
18//fix by Andrei Gaponenko
20: m_regions(b.m_regions ? std::make_unique<MissingEtRegions>(*b.m_regions) : 0)
22, m_ex(b.m_ex)
23, m_ey(b.m_ey)
25{}
26
27//fix by Andrei Gaponenko
29 if(this != &b) {
30 m_regions = (b.m_regions ? std::make_unique<MissingEtRegions>(*b.m_regions) : 0);
31 m_source = b.m_source;
32 m_ex = b.m_ex;
33 m_ey = b.m_ey;
34 m_etSum = b.m_etSum;
35 }
36 return *this;
37}
38
39
40// default contructor
43 m_ex(0.),
44 m_ey(0.),
45 m_etSum(0.)
46{ }
47
48//contructor with source specifier
50 m_source(aSource),
51 m_ex(0.),
52 m_ey(0.),
53 m_etSum(0.)
54{ }
55
56
57//contructor with regions
59 m_regions(theRegions),
61 m_ex(0.),
62 m_ey(0.),
63 m_etSum(0.)
64{ }
65
66//contructor with regions and source
68 m_regions(theRegions),
69 m_source(aSource),
70 m_ex(0.),
71 m_ey(0.),
72 m_etSum(0.)
73{ }
74
75
78 std::unique_ptr<MissingEtRegions> theRegions,
79 double ex,
80 double ey,
81 double etSum) :
82 m_regions(std::move(theRegions)),
83 m_source(aSource),
84 m_ex(ex),
85 m_ey(ey),
86 m_etSum(etSum)
87{ }
88
89
90// destructor
94
95// set methods
96void MissingET::setEx(double theEx)
97{
98 m_ex = theEx;
99}
100void MissingET::setEy(double theEy)
101{
102 m_ey = theEy;
103}
104void MissingET::setEtSum(double theEtSum)
105{
106 m_etSum = theEtSum;
107}
108
109// add method
110/*void MissingET::add(const CaloCell* aCell, double &weight)
111{
112 double exc=0.;
113 double eyc=0.;
114 double eta = aCell->eta();
115
116 Calc_Ecellxy(aCell, exc, eyc);
117
118 // Note the minus sign! We want to calculate missing ET
119 m_ex -= exc * weight;
120 m_ey -= eyc * weight;
121 m_etSum += aCell->et() * weight;
122
123 // regions
124 if ( m_regions != 0 ) m_regions->addReg(aCell, weight);
125} */
126
127void MissingET::add(double theEx, double theEy, double theEt,
128 double theEta, double weight)
129{
130 // Note the minus sign! We want to calculate missing ET
131 m_ex -= theEx * weight;
132 m_ey -= theEy * weight;
133 m_etSum += theEt * weight;
134
135 // regions
136 if ( m_regions != 0 ) m_regions->addReg(theEx, theEy, theEt, theEta, weight);
137}
138
139
140// retrieve kinematics
141double MissingET::etx() const
142{
143 return m_ex;
144}
145double MissingET::ety() const
146{
147 return m_ey;
148}
149double MissingET::sumet() const
150{
151 return m_etSum;
152}
153double MissingET::et() const
154{
155 return sqrt(m_ex*m_ex + m_ey*m_ey);
156}
157double MissingET::phi() const
158{
159
160 return atan2(m_ey,m_ex);
161}
162
163// retrieve the regions
165{
166 return m_regions.get();
167}
168
169// return the source information
170
172{
173 return m_source;
174}
175
176/*
177void MissingET::Calc_Ecellxy(const CaloCell* cObj, double &ex, double &ey)
178{
179 //function to calculate x and y component of cell energy
180
181 // get object kinematics
182 double et_cell = cObj->et();
183 double phi_cell = cObj->phi();
184
185 // directly get et (optimised)
186 ex = et_cell * cos(phi_cell);
187 ey = et_cell * sin(phi_cell);
188
189}; */
virtual double et() const
virtual const MissingEtRegions * getRegions() const
std::unique_ptr< MissingEtRegions > m_regions
virtual double sumet() const
virtual void setEtSum(double theSum)
virtual void setEx(double theEx)
Definition MissingET.cxx:96
virtual void add(double theEx, double theEy, double theEt, double theEta, double weight)
virtual double etx() const
virtual double phi() const
virtual double ety() const
virtual void setEy(double theEy)
virtual ~MissingET()
Definition MissingET.cxx:91
MissingET & operator=(const MissingET &b)
Definition MissingET.cxx:28
virtual Source getSource() const
STL namespace.