ATLAS Offline Software
Loading...
Searching...
No Matches
EMErrorDetail.cxx File Reference
#include "egammaEvent/EMErrorDetail.h"
#include "GaudiKernel/GaudiException.h"
#include "egammaEvent/EMShower.h"
#include "AthenaKernel/ClassName.h"
#include "AthLinks/ElementLink.h"
#include "TrkTrack/Track.h"
#include "TrkParametersBase/ParametersBase.h"
#include "TrkParticleBase/TrackParticleBase.h"
#include "TrkParameters/TrackParameters.h"
#include "TrkNeutralParameters/NeutralParameters.h"
#include "VxVertex/VxTrackAtVertex.h"
#include "VxVertex/VxCandidate.h"
#include "AthenaKernel/BaseInfo.h"
#include <cmath>

Go to the source code of this file.

Functions

 AmgSymMatrix (3) EMErrorDetail
 AmgSymMatrix (5) EMErrorDetail
 AmgSymMatrix (4) EMErrorDetail
 SG_ADD_BASE (EMErrorDetail, egDetail)

Function Documentation

◆ AmgSymMatrix() [1/3]

AmgSymMatrix ( 3 )

Definition at line 145 of file EMErrorDetail.cxx.

145 {
146
147 // Make a 3x3 matrix that is filled with zero's alternatively we could fill it with the identity matrix;
148 // Chosen the identity matrix option (second argument = 1)
149 AmgSymMatrix(3) hepSymMatrix;
150 hepSymMatrix.setZero();
151 // Fill the matrix E,eta,phi,M
152 hepSymMatrix(1,1) = EMphoton_CovEclusEclus();
153 hepSymMatrix(2,2) = EMphoton_Covetaeta();
154 hepSymMatrix(3,3) = EMphoton_Covphiphi();
155
156 hepSymMatrix.fillSymmetric(1,2,EMphoton_CovetaEclus());
157 hepSymMatrix.fillSymmetric(1,3,EMphoton_CovphiEclus());
158 hepSymMatrix.fillSymmetric(2,3, EMphoton_Covetaphi());
159
160 return hepSymMatrix;
161
162}
163
164// ====================================================================
165Amg::MatrixX EMErrorDetail::getCombinedErrorMatrix() const
166{
167 // see if combined matrix exists, if so, return it, otherwise,
168 // it's an unconverted photon, so just return the photon error
169 // matrix.
170 if (EMtrack_comb_CovPP() == egammaParameters::EgParamUndefined) {
171 return getEMPhotonErrorMatrix();
172 }
173 return getEMTrackCombinedErrorMatrix();
174
175}
176
177// ====================================================================
179{
180 // this still looks for combined matrix to make the decision
182 return getEMPhotonErrorMatrix();
183 }
184 return getEMTrackUncombinedErrorMatrix();
185
186}
187
188// ====================================================================
189AmgSymMatrix(4) EMErrorDetail::get4x4CombinedErrorMatrix() const
190{
191 // see if combined matrix exists, if so, return it, otherwise,
192 // it's an unconverted photon, so just return the photon error
193 // matrix.
194 if (EMtrack_comb_CovPP() == egammaParameters::EgParamUndefined) {
195 return get4x4EMPhotonErrorMatrix();
196 }
197 return get4x4EMTrackCombinedErrorMatrix();
198
199}
200
201// ====================================================================
202AmgSymMatrix(4) EMErrorDetail::get4x4UncombinedErrorMatrix() const
203{
204 // this still looks for combined matrix to make the decision
205 if (EMtrack_comb_CovPP() == egammaParameters::EgParamUndefined) {
206 return get4x4EMPhotonErrorMatrix();
207 }
208 return get4x4EMTrackUncombinedErrorMatrix();
209
210}
211
212// ====================================================================
213AmgSymMatrix(5) EMErrorDetail::getEMTrackCombinedErrorMatrix() const {
214
215 // Make a 5x5 matrix that is filled with zero's alternatively we could fill it with the identity matrix;
216 // Chosen the identity matrix option
217 AmgSymMatrix(5) hepSymMatrix;
218 hepSymMatrix.setZero();
219 // Fill the matrix
220 hepSymMatrix(0,0) = EMtrack_comb_Covd0d0();
221 hepSymMatrix(1,1) = EMtrack_comb_Covz0z0();
222 hepSymMatrix(2,2) = EMtrack_comb_Covphiphi();
223 hepSymMatrix(3,3) = EMtrack_comb_Covetaeta();
224 hepSymMatrix(4,4) = EMtrack_comb_CovPP();
225
226
227 hepSymMatrix.fillSymmetric(0,1, EMtrack_comb_Covd0z0());
228 hepSymMatrix.fillSymmetric(0,2 ,EMtrack_comb_Covd0phi());
229 hepSymMatrix.fillSymmetric(0,3, EMtrack_comb_Covd0eta());
230 hepSymMatrix.fillSymmetric(0,4, EMtrack_comb_Covd0P());
231 hepSymMatrix.fillSymmetric(1,2, EMtrack_comb_Covz0phi());
232 hepSymMatrix.fillSymmetric(1,3, EMtrack_comb_Covz0eta());
233 hepSymMatrix.fillSymmetric(1,4, EMtrack_comb_Covz0P());
234 hepSymMatrix.fillSymmetric(2,3, EMtrack_comb_Covphieta());
235 hepSymMatrix.fillSymmetric(2,4, EMtrack_comb_CovphiP());
236 hepSymMatrix.fillSymmetric(3,4, EMtrack_comb_CovetaP());
237
238 return hepSymMatrix;
239}
240
241// ====================================================================
242AmgSymMatrix(5) EMErrorDetail::getEMTrackUncombinedErrorMatrix() const {
243
244 // Make a 5x5 matrix that is filled with zero's alternatively we could fill it with the identity matrix;
245 // Chosen the identity matrix option
246 // Fill the matrix
247 if (hasSiliconHits()) {
248 AmgSymMatrix(5) hepSymMatrix;
249 hepSymMatrix.setZero();
250 // use tracks for everything but energy
251 hepSymMatrix(0,0) = EMtrack_perigee_Covd0d0();
252 hepSymMatrix(1,1) = EMtrack_perigee_Covz0z0();
253 hepSymMatrix(2,2) = EMtrack_perigee_Covphiphi();
254 hepSymMatrix(3,3) = EMtrack_perigee_Covthetatheta();
255 hepSymMatrix(4,4) = EMphoton_CovEclusEclus();
256 //Symmetric fill
257 hepSymMatrix.fillSymmetric(0,1,EMtrack_perigee_Covd0z0());
258 hepSymMatrix.fillSymmetric(0,2,EMtrack_perigee_Covd0phi());
259 hepSymMatrix.fillSymmetric(0,3,EMtrack_perigee_Covd0theta()); // note theta
260 hepSymMatrix.fillSymmetric(0,4,0.0);
261 hepSymMatrix.fillSymmetric(1,2,EMtrack_perigee_Covz0phi());
262 hepSymMatrix.fillSymmetric(1,3,EMtrack_perigee_Covz0theta());
263 hepSymMatrix.fillSymmetric(1,4,0.0);
264 hepSymMatrix.fillSymmetric(2,3,EMtrack_perigee_Covphitheta());
265 hepSymMatrix.fillSymmetric(2,4,0.0);
266 hepSymMatrix.fillSymmetric(3,4,0.0);
267
268 //jacob
269 AmgSymMatrix(5) jacob;
270 jacob.setIdentity();
271 jacob(3,3) = (-1./sin(EMtrack_perigee_theta())); // deta/dtheta
272 //similarity
273 return jacob*hepSymMatrix*jacob.transpose();
274
275 }
276 AmgSymMatrix(5) hepSymMatrix;
277 hepSymMatrix.setIdentity();
278 // use cluster for energy and eta
279 hepSymMatrix(0,0) = EMtrack_perigee_Covd0d0();
280 hepSymMatrix(1,1) = EMtrack_perigee_Covz0z0();
281 hepSymMatrix(2,2) = EMtrack_perigee_Covphiphi();
282 hepSymMatrix(3,3) = EMphoton_Covetaeta();
283 hepSymMatrix(4,4) = EMphoton_CovEclusEclus();
284
285 hepSymMatrix.fillSymmetric(0,1,EMtrack_perigee_Covd0z0());
286 hepSymMatrix.fillSymmetric(0,2,EMtrack_perigee_Covd0phi());
287 hepSymMatrix.fillSymmetric(0,3,0.0);
288 hepSymMatrix.fillSymmetric(0,4,0.0);
289 hepSymMatrix.fillSymmetric(1,2,EMtrack_perigee_Covz0phi());
290 hepSymMatrix.fillSymmetric(1,3,0.0);
291 hepSymMatrix.fillSymmetric(1,4,0.0);
292 hepSymMatrix.fillSymmetric(2,3,0.0);
293 hepSymMatrix.fillSymmetric(2,4,0.0);
294 hepSymMatrix.fillSymmetric(3,4,EMphoton_CovetaEclus());
295
296 return hepSymMatrix;
297
298
299}
300
301// ====================================================================
302AmgSymMatrix(4) EMErrorDetail::get4x4EMTrackCombinedErrorMatrix() const {
303
304 // E,eta,phi,M representation.
305 AmgSymMatrix(4) hepSymMatrix;
306 hepSymMatrix.setZero();
307 // Fill the matrix
308 hepSymMatrix(0,0) = EMtrack_comb_CovPP();
309 hepSymMatrix(1,1) = EMtrack_comb_Covetaeta();
310 hepSymMatrix(2,2) = EMtrack_comb_Covphiphi();
311
312 hepSymMatrix.fillSymmetric(0,1,EMtrack_comb_CovetaP());
313 hepSymMatrix.fillSymmetric(0,2,EMtrack_comb_CovphiP());
314 hepSymMatrix.fillSymmetric(1,2,EMtrack_comb_Covphieta());
315
316 return hepSymMatrix;
317}
318
319// ====================================================================
320AmgSymMatrix(4) EMErrorDetail::get4x4EMTrackUncombinedErrorMatrix() const {
321
322 // E,eta,phi,M representation.
323 if (hasSiliconHits()) {
324 AmgSymMatrix(4) hepSymMatrix;
325 hepSymMatrix.setZero();
326 // use tracks for everything but energy
327 hepSymMatrix(0,0) = EMphoton_CovEclusEclus();
328 hepSymMatrix(1,1) = EMtrack_perigee_Covthetatheta();
329 hepSymMatrix(2,2) = EMtrack_perigee_Covphiphi();
330 //fill symmetric
331 hepSymMatrix.fillSymmetric(1,2, EMtrack_perigee_Covphitheta());
332
333 //jacobian
334 AmgSymMatrix(4) jacob;
335 jacob.setIdentity();
336 jacob(1,1) = (-1./sin(EMtrack_perigee_theta())); // deta/dtheta
337 //similarity
338 return jacob*hepSymMatrix*jacob.transpose();
339 }
340
341 AmgSymMatrix(4) hepSymMatrix;
342 hepSymMatrix.setZero();
343 // use cluster for energy and eta
344 hepSymMatrix(0,0) = EMphoton_CovEclusEclus();
345 hepSymMatrix(1,1) = EMphoton_Covetaeta();
346 hepSymMatrix(2,2) = EMtrack_perigee_Covphiphi();
347
348 hepSymMatrix.fillSymmetric(0,1, EMphoton_CovetaEclus());
349
350 return hepSymMatrix;
351
352
353}
354
355// ====================================================================
356AmgSymMatrix(4) EMErrorDetail::get4x4EMPhotonErrorMatrix() const {
357
358 // E,eta,phi,M representation.
359 AmgSymMatrix(4) hepSymMatrix;
360 hepSymMatrix.setZero();
361
362 // Fill the matrix
363 hepSymMatrix(0,0) = EMphoton_CovEclusEclus();
364 hepSymMatrix(1,1) = EMphoton_Covetaeta();
365 hepSymMatrix(1,2) = EMphoton_Covetaphi();
366 hepSymMatrix(2,2) = EMphoton_Covphiphi();
367
368 hepSymMatrix.fillSymmetric(0,1, EMphoton_CovetaEclus());
369 hepSymMatrix.fillSymmetric(0,3, EMphoton_CovphiEclus());
370
371 return hepSymMatrix;
372
373}
374// ======================================================================
375bool EMErrorDetail::hasIntParameter(egammaParameters::ParamDef key) const {
376 switch(key) {
379 return true;
380 default:
381 return false;
382 }
383}
384
385// =======================================================================
387 if(hasIntParameter(key)) return true;
388 switch (key) {
405
422
438
442
449 return true;
450 // the following are depricated
463 return true;
464 default:
465 return false;
466 }
467}
468
469
470/* Get parameters of unconverted photon */
473// double EMErrorDetail::EMconvertedphoton_perigee_Eclus() const {return parameter(egammaParameters::EMConvertedPhoton_Eclus) ;}
478
483// double EMErrorDetail::EMconvertedphoton_perigee_Covd0Eclus () const {return parameter(egammaParameters::EMConvertedPhoton_Covd0Eclus) ;}
487// double EMErrorDetail::EMconvertedphoton_perigee_Covz0Eclus () const {return parameter(egammaParameters::EMConvertedPhoton_Covz0Eclus) ;}
490// double EMErrorDetail::EMconvertedphoton_perigee_CovphiEclus () const {return parameter(egammaParameters::EMConvertedPhoton_CovphiEclus) ;}
492// double EMErrorDetail::EMconvertedphoton_perigee_CovthetaEclus () const {return parameter(egammaParameters::EMConvertedPhoton_CovthetaEclus) ;}
493// double EMErrorDetail::EMconvertedphoton_perigee_CovEclusEclus () const {return parameter(egammaParameters::EMConvertedPhoton_CovEclusEclus) ;}
494
495/* Set parameters of unconverted photons */
void fillSymmetric(size_t i, size_t j, Scalar value)
method to fill elements for a symmetric matrix
#define AmgSymMatrix(dim)
#define x
double EMconvertedphoton_perigee_Covphiphi() const
double EMconvertedphoton_perigee_Covz0theta() const
virtual double parameter(egammaParameters::ParamDef) const
Amg::MatrixX getUncombinedErrorMatrix() const
E/P combined error matrix, natural size.
double EMconvertedphoton_perigee_eta() const
double EMconvertedphoton_perigee_Covphitheta() const
virtual bool hasParameter(egammaParameters::ParamDef) const
double EMconvertedphoton_perigee_Covd0z0() const
void set_parameter(egammaParameters::ParamDef, double, bool overwrite=false)
general set method for parameters
double EMconvertedphoton_perigee_d0() const
virtual bool hasIntParameter(egammaParameters::ParamDef) const
double EMconvertedphoton_perigee_Covd0phi() const
double EMconvertedphoton_perigee_Covthetatheta() const
double EMconvertedphoton_perigee_Covz0phi() const
double EMconvertedphoton_perigee_Covz0z0() const
double EMconvertedphoton_perigee_Covd0theta() const
double EMconvertedphoton_perigee_z0() const
double EMtrack_comb_CovPP() const
double EMconvertedphoton_perigee_theta() const
double EMconvertedphoton_perigee_momentum() const
double EMconvertedphoton_perigee_Covd0d0() const
double EMconvertedphoton_perigee_phi0() const
Definition of ATLAS Math & Geometry primitives (Amg)
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
@ EMConvertedPhoton_Covd0z0
converted photon covariance matrix item ( )
@ EMPhoton_CovEclusEclus
covariance matrix photon (E, E)
@ EMTrack_Combined_Covd0d0
track combined covariance matrix item (do,d0)
@ EMConvertedPhoton_eta
the eta of the converted photon
@ EMTrack_Covphitheta
track perigee covariance matrix item (phi,theta)
@ EMConvertedPhoton_Covthetatheta
converted photon covariance matrix item (theta,theta)
@ EMPhoton_phi0
photon phi
@ EMTrack_Covd0Eclus
fitted track perigee covariance matrix item (d0,E)
@ EMTrack_CovEclusEclus
track perigee covariance matrix item (E,E)
@ EMPhoton_CovetaEclus
covariance matrix photon (eta, E)
@ EMPhoton_Covetaphi
covariance matrix photon (eta, phi)
@ EMTrack_Covz0Eclus
track perigee covariance matrix item (z0,E)
@ EMConvertedPhoton_momentum
momentum of the converted photon
@ EMConvertedPhoton_Covd0phi
converted photon covariance matrix item ( )
@ EMConvertedPhoton_Covz0z0
converted photon covariance matrix item (z0,z0)
@ EMTrack_Combined_Covz0phi
track combined covariance matrix item (z0,phi)
@ EMTrack_Covd0theta
track perigee covariance matrix item (d0,theta)
@ EMConvertedPhoton_Eclus
E estimate.
@ EMTrack_Combined_CovetaP
track combined covariance matrix item (eta,P)
@ EMTrack_Combined_Covz0P
track combined covariance matrix item (z0,P)
@ EMConvertedPhoton_Covphitheta
converted photon covariance matrix item (phi,theta)
@ EMTrack_Covphiphi
track perigee covariance matrix item (phi,phi)
@ EMTrack_Combined_Covd0phi
track combined covariance matrix item (d0,phi)
@ EMTrack_Combined_Covz0eta
track combined covariance matrix item (z0,eta)
@ EMTrack_CovthetaEclus
track perigee covariance matrix item (theta,E)
@ EMConvertedPhoton_z0
the z value of the converted photon
@ EMTrack_Eclus
Cluster energy.
@ EMTrack_Combined_CovphiP
track combined covariance matrix item (phi,P)
@ EMTrack_theta
theta of the track
@ EMConvertedPhoton_theta
theta of the converted photon
@ EMTrack_Combined_Covd0eta
track combined covariance matrix item (d0,eta)
@ EMTrack_Combined_Covphieta
track combined covariance matrix item (phi,eta)
@ EMPhoton_CovphiEclus
covariance matrix photon (phi, E)
@ EMPhoton_Covphiphi
covariance matrix photon (phi, phi)
@ EMTrack_d0
transverse impact parameter (distance of closest approach)
@ EMTrack_Covz0theta
track perigee covariance matrix item (z0,theta)
@ EMTrack_momentum
track momentum
@ EMTrack_Combined_Covphiphi
track combined covariance matrix item (phi,phi)
@ EMConvertedPhoton_Covphiphi
converted photon covariance matrix item (phi,phi)
@ EMPhoton_eta
photon eta
@ EMTrack_Combined_Covetaeta
track combined covariance matrix item (eta,eta)
@ EMPhoton_Covetaeta
covariance matrix photon (eta, eta)
@ EMTrack_phi0
azimuth angle of the momentum at the point of closest approach
@ EMConvertedPhoton_CovthetaEclus
converted photon covariance matrix item (theta,E)
@ EMConvertedPhoton_phi0
azimuth angle of the momentum at the point of closest approach
@ EMTrack_Covz0phi
track perigee covariance matrix item (z0,phi)
@ EMConvertedPhoton_Covz0theta
converted photon covariance matrix item (z0,theta)
@ EMPhoton_Eclus
photon energy
@ EMTrack_z0
the z value at the point of closest approach
@ EMTrack_Combined_Covz0z0
track combined covariance matrix item (z0,z0)
@ EMConvertedPhoton_Covd0d0
converted photon covariance matrix item ( )
@ linkIndex
link index for multiple track and vertex matches
@ EMConvertedPhoton_CovphiEclus
converted photon covariance matrix item (phi,E)
@ EMTrack_Covd0phi
track perigee covariance matrix item ( )
@ EMTrack_Combined_Covd0z0
track combined covariance matrix item (d0,z0)
@ EMTrack_Combined_CovPP
track combined covariance matrix item (P,P)
@ EMTrack_Covd0z0
track perigee covariance matrix item ( )
@ EMConvertedPhoton_d0
From EMErrorDetail.
@ EMConvertedPhoton_CovEclusEclus
converted photon covariance matrix item (E,E)
@ EMTrack_Covz0z0
track perigee covariance matrix item (z0,z0)
@ EMTrack_eta
the eta of the track
@ EMConvertedPhoton_Covd0Eclus
converted photon covariance matrix item (d0,E)
@ EMTrack_CovphiEclus
track perigee covariance matrix item (phi,E)
@ EMConvertedPhoton_Covz0phi
converted photon covariance matrix item (z0,phi)
@ EMConvertedPhoton_Covd0theta
converted photon covariance matrix item (d0,theta)
@ EMConvertedPhoton_Covz0Eclus
converted photon covariance matrix item (z0,E)
@ EMTrack_Combined_Covd0P
fitted track combined covariance matrix item (d0,P)
@ EMTrack_Covthetatheta
track perigee covariance matrix item (theta,theta)
@ EMTrack_Covd0d0
track perigee covariance matrix item ( )
const double EgParamUndefined

◆ AmgSymMatrix() [2/3]

AmgSymMatrix ( 4 )

Definition at line 646 of file EMErrorDetail.cxx.

647{
648 AmgSymMatrix(4) m;
649 m.setIdentity();
650 m(1,1) = (-1./sin(theta)); // deta/dtheta
651 return m;
652}
Scalar theta() const
theta method

◆ AmgSymMatrix() [3/3]

AmgSymMatrix ( 5 )

Definition at line 638 of file EMErrorDetail.cxx.

639{
640 AmgSymMatrix(5) m;
641 m.setIdentity();
642 m(3,3) = (-1./sin(theta)); // deta/dtheta
643 return m;
644}

◆ SG_ADD_BASE()

SG_ADD_BASE ( EMErrorDetail ,
egDetail  )