ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
RecoTools
CaloClusterMatching
CaloClusterMatching
TopoClusterMap.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#ifndef CALOCLUSTERMATCHING_TOPOCLUSTERMAP_H
6
#define CALOCLUSTERMATCHING_TOPOCLUSTERMAP_H
7
8
//xAOD includes:
9
#include "
xAODCaloEvent/CaloClusterContainer.h
"
10
11
class
TopoClusterMap
{
12
13
typedef
std::map<int, std::map< int, std::vector<const xAOD::CaloCluster* > > >
TopoCluster2DMap
;
14
15
public
:
16
17
//Constructor/destructor.
18
// TopoClusterMap();
19
20
TopoClusterMap
(
float
minEta=-6.,
float
minPhi=-3.2,
float
maxEta=6.,
float
maxPhi=3.2,
21
float
dEta=0.3,
float
dPhi=0.1);
22
~TopoClusterMap
();
23
25
26
//Function to insert a topocluster, then re-sort the vector it belongs to.
27
void
InsertTopoCluster
(
xAOD::CaloCluster
*);
28
29
inline
TopoClusterMap
&
DuplicateMap
() {
30
return
(*
this
);
31
}
32
33
//Clear the map.
34
void
ClearMap
();
35
36
//Function to set TopoClusters.
37
StatusCode
SetTopoClusters
(
const
xAOD::CaloClusterContainer
*);
38
39
TopoCluster2DMap
&
RetrieveMap
() {
return
m_map
;}
40
41
//Routine to retrieve vector of TopoClusters for a given Pt region.
42
std::vector<const xAOD::CaloCluster*>
RetrieveTopoClusters
(
double
eta
,
double
phi
,
43
double
Pt)
const
;
44
45
//Routine to retrieve vector of TopoClusters for a given (eta, phi) region.
46
std::vector<const xAOD::CaloCluster*>
RetrieveTopoClusters
(
double
eta
,
double
phi
,
47
double
dEta,
48
double
dPhi)
const
;
49
50
//Routine to retrieve vector of TopoClusters for a given (eta, phi) region.
51
inline
std::vector<const xAOD::CaloCluster*>
RetrieveTopoClusters
(
int
eta_key,
int
phi_key)
const
52
{
53
return
m_map
.at(eta_key).at(phi_key);
54
}
55
56
//Private routine to translate an input eta, phi into integer keys for map.
57
inline
std::pair<int,int>
GetEtaPhiKeys
(
double
eta
,
double
phi
)
const
{
58
59
//Some checks on eta, phi values.
60
if
(
eta
>
m_maxEta
)
eta
=
m_maxEta
;
61
if
(
eta
<
m_minEta
)
eta
=
m_minEta
;
62
if
(
phi
>
m_maxPhi
)
phi
=
m_maxPhi
;
63
if
(
phi
<
m_minPhi
)
phi
=
m_minPhi
;
64
65
//Need some warnings against max/min eta, phi here, I think.
66
int
eta_key = (int)((
eta
-
m_minEta
)/
m_dEta
);
67
68
//NOTE: May have to account for phi wraparound here.
69
int
phi_key = (int)((
phi
-
m_minPhi
)/
m_dPhi
);
70
71
return
std::pair<int,int>(eta_key,phi_key);
72
73
}
74
75
/* void DumpMapContents(); */
76
77
private
:
78
79
TopoCluster2DMap
m_map
;
80
81
//Map granularity and range.
82
double
m_minEta
,
m_minPhi
,
m_maxEta
,
m_maxPhi
;
83
double
m_dEta
,
m_dPhi
;
84
85
//Routine to sort topocluster grid elements by Pt.
86
void
SortGridVectors
();
87
void
SortGridVector
(
int
eta_key,
int
phi_key);
88
89
//Used for removing clusters from map - reducing size, access time.
90
static
double
GetLArThirdLayerRatio
(
const
xAOD::CaloCluster
*);
91
92
};
93
94
#include "
xAODCore/CLASS_DEF.h
"
95
CLASS_DEF
(
TopoClusterMap
,179090094,1)
96
97
#endif
eta
Scalar eta() const
pseudorapidity method
Definition
AmgMatrixBasePlugin.h:83
phi
Scalar phi() const
phi method
Definition
AmgMatrixBasePlugin.h:67
CLASS_DEF
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
Definition
Control/AthenaKernel/AthenaKernel/CLASS_DEF.h:67
CaloClusterContainer.h
CLASS_DEF.h
File providing the different SG_BASE macros.
TopoClusterMap
Definition
TopoClusterMap.h:11
TopoClusterMap::DuplicateMap
TopoClusterMap & DuplicateMap()
Definition
TopoClusterMap.h:29
TopoClusterMap::GetLArThirdLayerRatio
static double GetLArThirdLayerRatio(const xAOD::CaloCluster *)
Definition
TopoClusterMap.cxx:167
TopoClusterMap::TopoClusterMap
TopoClusterMap(float minEta=-6., float minPhi=-3.2, float maxEta=6., float maxPhi=3.2, float dEta=0.3, float dPhi=0.1)
Definition
TopoClusterMap.cxx:23
TopoClusterMap::m_dPhi
double m_dPhi
Definition
TopoClusterMap.h:83
TopoClusterMap::GetEtaPhiKeys
std::pair< int, int > GetEtaPhiKeys(double eta, double phi) const
Definition
TopoClusterMap.h:57
TopoClusterMap::m_maxPhi
double m_maxPhi
Definition
TopoClusterMap.h:82
TopoClusterMap::RetrieveMap
TopoCluster2DMap & RetrieveMap()
Definition
TopoClusterMap.h:39
TopoClusterMap::m_minPhi
double m_minPhi
Definition
TopoClusterMap.h:82
TopoClusterMap::RetrieveTopoClusters
std::vector< const xAOD::CaloCluster * > RetrieveTopoClusters(int eta_key, int phi_key) const
Definition
TopoClusterMap.h:51
TopoClusterMap::m_dEta
double m_dEta
Definition
TopoClusterMap.h:83
TopoClusterMap::SetTopoClusters
StatusCode SetTopoClusters(const xAOD::CaloClusterContainer *)
Definition
TopoClusterMap.cxx:41
TopoClusterMap::SortGridVectors
void SortGridVectors()
Definition
TopoClusterMap.cxx:76
TopoClusterMap::m_minEta
double m_minEta
Definition
TopoClusterMap.h:82
TopoClusterMap::ClearMap
void ClearMap()
Definition
TopoClusterMap.cxx:90
TopoClusterMap::InsertTopoCluster
void InsertTopoCluster(xAOD::CaloCluster *)
interface methods
Definition
TopoClusterMap.cxx:62
TopoClusterMap::m_maxEta
double m_maxEta
Definition
TopoClusterMap.h:82
TopoClusterMap::m_map
TopoCluster2DMap m_map
Definition
TopoClusterMap.h:79
TopoClusterMap::~TopoClusterMap
~TopoClusterMap()
TopoClusterMap::SortGridVector
void SortGridVector(int eta_key, int phi_key)
Definition
TopoClusterMap.cxx:84
TopoClusterMap::TopoCluster2DMap
std::map< int, std::map< int, std::vector< const xAOD::CaloCluster * > > > TopoCluster2DMap
Definition
TopoClusterMap.h:13
TopoClusterMap::RetrieveTopoClusters
std::vector< const xAOD::CaloCluster * > RetrieveTopoClusters(double eta, double phi, double Pt) const
Definition
TopoClusterMap.cxx:118
xAOD::CaloCluster
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
Definition
Event/xAOD/xAODCaloEvent/xAODCaloEvent/CaloCluster.h:19
xAOD::CaloClusterContainer
CaloClusterContainer_v1 CaloClusterContainer
Define the latest version of the calorimeter cluster container.
Definition
Event/xAOD/xAODCaloEvent/xAODCaloEvent/CaloClusterContainer.h:17
Generated on
for ATLAS Offline Software by
1.17.0