ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
eflowRec
src
eflowCellList.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: eflowCellList.cxx
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 "
eflowCellList.h
"
17
#include "
eflowCaloRegions.h
"
18
#include "
eflowCellPosition.h
"
19
#include "
eflowTrackCaloPoints.h
"
20
21
#include "
CaloEvent/CaloCell.h
"
22
23
#include "
FourMomUtils/xAODP4Helpers.h
"
24
25
// C++ Headers
26
27
#include <cmath>
28
29
eflowCellList::eflowCellList
()
30
:
m_etaFF
(
eflowCalo
::nRegions)
31
,
m_phiFF
(
eflowCalo
::nRegions)
32
{}
33
34
void
35
eflowCellList::setNewExtrapolatedTrack
(
const
eflowTrackCaloPoints
* trackCalo)
36
{
37
setNewExtrapolatedTrack
(*trackCalo);
38
}
39
40
void
41
eflowCellList::setNewExtrapolatedTrack
(
const
eflowTrackCaloPoints
& trackCalo)
42
{
43
for
(
int
i = 0; i <
eflowCalo::nRegions
; i++) {
44
eflowCaloENUM
layer = (
eflowCaloENUM
)i;
45
m_etaFF
[layer] = trackCalo.
getEta
(layer);
46
m_phiFF
[layer] = trackCalo.
getPhi
(layer);
47
}
48
49
m_cellPositionToCellMap
.clear();
50
}
51
52
void
53
eflowCellList::addCell
(
const
std::pair<const CaloCell*, int>& cell)
54
{
55
eflowCellPosition
myPos(
this
, cell.first);
56
57
CellIt
inmap =
m_cellPositionToCellMap
.find(myPos);
58
59
if
(inmap !=
m_cellPositionToCellMap
.end())
60
inmap->second.push_back(cell);
61
else
{
62
std::vector<std::pair<const CaloCell*, int>> myVec;
63
myVec.push_back(cell);
64
m_cellPositionToCellMap
.insert(
65
std::map<
eflowCellPosition
,
66
std::vector<std::pair<const CaloCell*, int>>>::value_type(myPos,
67
myVec));
68
}
69
}
70
71
void
72
eflowCellList::reorderWithoutLayers
()
73
{
74
/* Collect all cells in layer EMB2 and higher, i.e. start with dR = 0 to the
75
* track in EMB2 */
76
CellIt
it =
m_cellPositionToCellMap
.lower_bound(
77
eflowCellPosition
(
this
,
eflowCalo::EMB2
, 0.0));
78
CellIt
end
=
m_cellPositionToCellMap
.end();
79
while
(it !=
end
) {
80
/* Create a CellPosition in EMB1 that has the same dR to the track as in its
81
* original layer */
82
eflowCellPosition
tempPos(
this
,
eflowCalo::EMB1
, it->first.dR());
83
84
/* (Try to) insert the new CellPosition into the map. The resulting iterator
85
* either points to the inserted or to the already existing element (but we
86
* don't care). */
87
std::map<
eflowCellPosition
,
88
std::vector<std::pair<const CaloCell*, int>>>
::iterator
itInserted =
89
m_cellPositionToCellMap
90
.insert(
91
std::make_pair(tempPos, std::vector<std::pair<const CaloCell*, int>>(0)))
92
.first;
93
94
/* Append the cell/index pairs of the original CellPosition to the (either
95
* newly inserted or already existing) element */
96
std::vector<std::pair<const CaloCell*, int>>& pairVector(it->second);
97
itInserted->second.insert(
98
itInserted->second.end(), pairVector.begin(), pairVector.end());
99
100
/* Remove the original CellPosition from the map */
101
m_cellPositionToCellMap
.erase(it++);
102
}
103
}
104
105
double
106
eflowCellList::dR2
(
double
eta
,
double
phi
,
eflowCaloENUM
layer)
const
107
{
108
if
(
eflowCalo::Unknown
!= layer) {
109
double
dEta =
eta
-
m_etaFF
[layer];
110
double
dPhi =
xAOD::P4Helpers::deltaPhi
(
phi
,
m_phiFF
[layer]);
111
return
dEta * dEta + dPhi * dPhi;
112
}
else
{
113
return
-999.0;
114
}
115
}
116
117
double
118
eflowCellList::dR
(
double
eta
,
double
phi
,
eflowCaloENUM
layer)
const
119
{
120
return
(
eflowCalo::Unknown
!= layer) ? std::sqrt(
dR2
(
eta
,
phi
, layer)) : -999.0;
121
}
eta
Scalar eta() const
pseudorapidity method
Definition
AmgMatrixBasePlugin.h:83
phi
Scalar phi() const
phi method
Definition
AmgMatrixBasePlugin.h:67
CaloCell.h
iterator
eflowCalo
This defines the eflowCalo enum, which is used to label calorimeter layers in a simplified scheme whi...
Definition
eflowCaloRegions.h:25
eflowCalo::EMB1
@ EMB1
Definition
eflowCaloRegions.h:29
eflowCalo::EMB2
@ EMB2
Definition
eflowCaloRegions.h:29
eflowCalo::Unknown
@ Unknown
Definition
eflowCaloRegions.h:34
eflowCalo::nRegions
static const int nRegions
Definition
eflowCaloRegions.h:37
eflowCellList::dR
double dR(double eta, double phi, eflowCaloENUM layer) const
Definition
eflowCellList.cxx:118
eflowCellList::end
CellIt end()
Definition
eflowCellList.h:57
eflowCellList::m_etaFF
std::vector< double > m_etaFF
Definition
eflowCellList.h:85
eflowCellList::m_cellPositionToCellMap
std::map< eflowCellPosition, std::vector< std::pair< const CaloCell *, int > > > m_cellPositionToCellMap
Definition
eflowCellList.h:88
eflowCellList::eflowCellList
eflowCellList()
Definition
eflowCellList.cxx:29
eflowCellList::dR2
double dR2(double eta, double phi, eflowCaloENUM layer) const
Definition
eflowCellList.cxx:106
eflowCellList::reorderWithoutLayers
void reorderWithoutLayers()
Definition
eflowCellList.cxx:72
eflowCellList::setNewExtrapolatedTrack
void setNewExtrapolatedTrack(const eflowTrackCaloPoints *trackCalo)
Definition
eflowCellList.cxx:35
eflowCellList::addCell
void addCell(const std::pair< const CaloCell *, int > &cell)
Definition
eflowCellList.cxx:53
eflowCellList::m_phiFF
std::vector< double > m_phiFF
Definition
eflowCellList.h:86
eflowCellPosition
This class stores the eta,phi and layer of the calorimeter cell and defines a "<" operator which can ...
Definition
eflowCellPosition.h:36
eflowTrackCaloPoints
This class stores a map of calorimeter layers and track parameters (the result of the track extrapola...
Definition
eflowTrackCaloPoints.h:30
eflowTrackCaloPoints::getPhi
double getPhi(eflowCalo::LAYER layer) const
Definition
eflowTrackCaloPoints.h:44
eflowTrackCaloPoints::getEta
double getEta(eflowCalo::LAYER layer) const
Definition
eflowTrackCaloPoints.h:43
eflowCaloRegions.h
eflowCaloENUM
eflowCalo::LAYER eflowCaloENUM
Definition
eflowCaloRegions.h:49
eflowCellList.h
CellIt
std::map< eflowCellPosition, std::vector< std::pair< constCaloCell *, int > > >::iterator CellIt
Definition
eflowCellList.h:30
eflowCellPosition.h
eflowTrackCaloPoints.h
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