ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
eflowRec
src
eflowCellPosition.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
/********************************************************************
6
7
NAME: eflowCellPosition.h
8
PACKAGE: offline/Reconstruction/eflowRec
9
10
AUTHORS: M.Hodgkinson, R Duxfield (based on R.Duxfields Root package)
11
CREATED: 18th Aug, 2005
12
13
********************************************************************/
14
15
//Athena Headers
16
#include "
eflowCellPosition.h
"
17
#include "
eflowAbstractCellList.h
"
18
#include "
eflowDatabase.h
"
19
20
#include "
CaloEvent/CaloCell.h
"
21
22
#include "
FourMomUtils/xAODP4Helpers.h
"
23
24
//C++ Headers
25
#include <cmath>
26
27
eflowCellPosition::eflowCellPosition
(
const
eflowAbstractCellList
* deposit,
eflowCaloENUM
layer,
double
dR
) :
28
m_layer
(layer),
m_deposit
(deposit) {
29
m_eta
= deposit->
etaFF
(layer) +
dR
;
30
m_phi
= deposit->
phiFF
(layer);
31
}
32
33
eflowCellPosition::eflowCellPosition
(
const
eflowAbstractCellList
* deposit,
const
CaloCell
* cell) :
34
m_eta
(cell->
eta
()),
m_phi
(cell->
phi
()),
m_deposit
(deposit) {
35
const
CaloDetDescrElement
* caloDDE = cell->caloDDE();
36
37
if
(caloDDE) {
38
CaloCell_ID::CaloSample
caloSampl = caloDDE->
getSampling
();
39
m_layer
=
eflowCalo::translateSampl
(caloSampl);
40
}
else
{
41
m_layer
=
eflowCalo::Unknown
;
42
}
43
}
44
45
bool
eflowCellPosition::operator<
(
const
eflowCellPosition
& rhs)
const
{
46
if
(
m_layer
!= rhs.
m_layer
) {
47
return
m_layer
< rhs.
m_layer
;
48
}
else
{
49
double
r1 =
m_deposit
->dR2(
m_eta
,
m_phi
,
m_layer
);
50
double
r2 =
m_deposit
->dR2(rhs.
m_eta
, rhs.
m_phi
,
m_layer
);
51
52
if
(std::fabs(r1 - r2) < 1.0e-12) {
53
if
(std::fabs(
m_eta
- rhs.
m_eta
) < 1.0e-6) {
54
return
CxxUtils::fpcompare::greater
(
xAOD::P4Helpers::deltaPhi
(
m_phi
,rhs.
m_phi
),0);
55
}
else
{
56
return
(
m_eta
< rhs.
m_eta
);
57
}
58
}
else
{
59
return
(r1 < r2);
60
}
61
}
62
}
63
64
double
eflowCellPosition::dR
()
const
{
65
return
m_deposit
->dR(
m_eta
,
m_phi
,
m_layer
);
66
}
eta
Scalar eta() const
pseudorapidity method
Definition
AmgMatrixBasePlugin.h:83
phi
Scalar phi() const
phi method
Definition
AmgMatrixBasePlugin.h:67
CaloCell.h
CaloCell_ID::CaloSample
CaloSampling::CaloSample CaloSample
Definition
CaloCell_ID.h:53
CaloCell
Data object for each calorimeter readout cell.
Definition
CaloCell.h:57
CaloDetDescrElement
This class groups all DetDescr information related to a CaloCell.
Definition
Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:66
CaloDetDescrElement::getSampling
CaloCell_ID::CaloSample getSampling() const
cell sampling
Definition
Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:395
eflowAbstractCellList
Definition
eflowAbstractCellList.h:31
eflowAbstractCellList::etaFF
virtual double etaFF(eflowCaloENUM layer) const =0
eflowAbstractCellList::phiFF
virtual double phiFF(eflowCaloENUM layer) const =0
eflowCalo::translateSampl
static LAYER translateSampl(CaloCell_ID::CaloSample sampl)
Definition
eflowCaloRegions.cxx:45
eflowCalo::Unknown
@ Unknown
Definition
eflowCaloRegions.h:34
eflowCellPosition::eflowCellPosition
eflowCellPosition(const eflowAbstractCellList *deposit, eflowCaloENUM layer, double dR)
Definition
eflowCellPosition.cxx:27
eflowCellPosition::dR
double dR() const
Definition
eflowCellPosition.cxx:64
eflowCellPosition::m_layer
eflowCaloENUM m_layer
Definition
eflowCellPosition.h:50
eflowCellPosition::m_deposit
const eflowAbstractCellList * m_deposit
Definition
eflowCellPosition.h:52
eflowCellPosition::m_eta
double m_eta
Definition
eflowCellPosition.h:51
eflowCellPosition::operator<
bool operator<(const eflowCellPosition &rhs) const
Definition
eflowCellPosition.cxx:45
eflowCellPosition::m_phi
double m_phi
Definition
eflowCellPosition.h:51
eflowAbstractCellList.h
eflowCaloENUM
eflowCalo::LAYER eflowCaloENUM
Definition
eflowCaloRegions.h:49
eflowCellPosition.h
eflowDatabase.h
CxxUtils::fpcompare::greater
bool greater(double a, double b)
Compare two FP numbers, working around x87 precision issues.
Definition
fpcompare.h:140
xAOD::P4Helpers::deltaPhi
double deltaPhi(double phiA, double phiB)
delta Phi in range [-pi,pi[
Definition
xAODP4Helpers.h:69
xAODP4Helpers.h
Generated on
for ATLAS Offline Software by
1.17.0