ATLAS Offline Software
Loading...
Searching...
No Matches
TopoClusterMap Class Reference

#include <TopoClusterMap.h>

Collaboration diagram for TopoClusterMap:

Public Member Functions

 TopoClusterMap (float minEta=-6., float minPhi=-3.2, float maxEta=6., float maxPhi=3.2, float dEta=0.3, float dPhi=0.1)
 ~TopoClusterMap ()
void InsertTopoCluster (xAOD::CaloCluster *)
 interface methods
TopoClusterMapDuplicateMap ()
void ClearMap ()
StatusCode SetTopoClusters (const xAOD::CaloClusterContainer *)
TopoCluster2DMapRetrieveMap ()
std::vector< const xAOD::CaloCluster * > RetrieveTopoClusters (double eta, double phi, double Pt) const
std::vector< const xAOD::CaloCluster * > RetrieveTopoClusters (double eta, double phi, double dEta, double dPhi) const
std::vector< const xAOD::CaloCluster * > RetrieveTopoClusters (int eta_key, int phi_key) const
std::pair< int, int > GetEtaPhiKeys (double eta, double phi) const

Private Types

typedef std::map< int, std::map< int, std::vector< const xAOD::CaloCluster * > > > TopoCluster2DMap

Private Member Functions

void SortGridVectors ()
void SortGridVector (int eta_key, int phi_key)

Static Private Member Functions

static double GetLArThirdLayerRatio (const xAOD::CaloCluster *)

Private Attributes

TopoCluster2DMap m_map
double m_minEta
double m_minPhi
double m_maxEta
double m_maxPhi
double m_dEta
double m_dPhi

Detailed Description

Definition at line 11 of file TopoClusterMap.h.

Member Typedef Documentation

◆ TopoCluster2DMap

typedef std::map<int, std::map< int, std::vector<const xAOD::CaloCluster* > > > TopoClusterMap::TopoCluster2DMap
private

Definition at line 13 of file TopoClusterMap.h.

Constructor & Destructor Documentation

◆ 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 at line 23 of file TopoClusterMap.cxx.

25{
26 m_minEta = minEta;
27 m_minPhi = minPhi;
29 m_maxPhi = maxPhi;
30 m_dEta = dEta;
31 m_dPhi = dPhi;
32}
constexpr float maxEta
bool dPhi(const xAOD::TauJet &tau, const xAOD::CaloVertexedTopoCluster &cluster, float &out)
bool dEta(const xAOD::TauJet &tau, const xAOD::CaloVertexedTopoCluster &cluster, float &out)

◆ ~TopoClusterMap()

TopoClusterMap::~TopoClusterMap ( )
default

Member Function Documentation

◆ ClearMap()

void TopoClusterMap::ClearMap ( )

Definition at line 90 of file TopoClusterMap.cxx.

90 {
91
92 for (int i = 0; i <= (GetEtaPhiKeys(m_maxEta, m_maxPhi).first); i++)
93 for (int j = 0; j <= (GetEtaPhiKeys(m_maxEta, m_maxPhi).second); j++)
94 m_map[i][j].clear();
95}
std::pair< int, int > GetEtaPhiKeys(double eta, double phi) const
TopoCluster2DMap m_map

◆ DuplicateMap()

TopoClusterMap & TopoClusterMap::DuplicateMap ( )
inline

Definition at line 29 of file TopoClusterMap.h.

29 {
30 return (*this);
31 }

◆ GetEtaPhiKeys()

std::pair< int, int > TopoClusterMap::GetEtaPhiKeys ( double eta,
double phi ) const
inline

Definition at line 57 of file TopoClusterMap.h.

57 {
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 }
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method

◆ GetLArThirdLayerRatio()

double TopoClusterMap::GetLArThirdLayerRatio ( const xAOD::CaloCluster * clus)
staticprivate

Definition at line 167 of file TopoClusterMap.cxx.

168{
169
170 double totalEnergy(0.), thirdLayerEnergy(0.);
171
172 if (clus->inBarrel()) {
173 totalEnergy += clus->eSample(CaloSampling::PreSamplerB);
174 totalEnergy += clus->eSample(CaloSampling::EMB1);
175 totalEnergy += clus->eSample(CaloSampling::EMB2);
176 totalEnergy += clus->eSample(CaloSampling::EMB3);
177
178 thirdLayerEnergy += clus->eSample(CaloSampling::EMB3);
179 }
180
181 if (clus->inEndcap()) {
182 totalEnergy += clus->eSample(CaloSampling::PreSamplerE);
183 totalEnergy += clus->eSample(CaloSampling::EME1);
184 totalEnergy += clus->eSample(CaloSampling::EME2);
185 totalEnergy += clus->eSample(CaloSampling::EME3);
186
187 thirdLayerEnergy += clus->eSample(CaloSampling::EME3);
188
189 }
190
191 if (totalEnergy == 0) return 0;
192 return (thirdLayerEnergy / totalEnergy);
193
194
195}
bool inBarrel() const
Returns true if at least one clustered cell in the barrel.
float eSample(const CaloSample sampling) const
bool inEndcap() const
Returns true if at least one clustered cell in the endcap.

◆ InsertTopoCluster()

void TopoClusterMap::InsertTopoCluster ( xAOD::CaloCluster * topo)

interface methods

Definition at line 62 of file TopoClusterMap.cxx.

62 {
63
64 //Retrieve eta, phi from ith topocluster.
65 double eta(topo->phi()), phi(topo->phi());
66
67 //Put it in appropriate vector.
68 m_map.at(GetEtaPhiKeys(eta,phi).first).at(GetEtaPhiKeys(eta,phi).second).push_back(topo);
69
70 //Re-sort the vector according to Et.
72
73}
void SortGridVector(int eta_key, int phi_key)

◆ RetrieveMap()

TopoCluster2DMap & TopoClusterMap::RetrieveMap ( )
inline

Definition at line 39 of file TopoClusterMap.h.

39{return m_map;}

◆ RetrieveTopoClusters() [1/3]

std::vector< const xAOD::CaloCluster * > TopoClusterMap::RetrieveTopoClusters ( double eta,
double phi,
double dEta,
double dPhi ) const

Definition at line 137 of file TopoClusterMap.cxx.

140{
141
142 std::vector<const xAOD::CaloCluster*> clusters;
143
144 //Need to be able to search within a broad window, then merge all vectors
145 //within that window together.
146 if (dEta > 0. && dPhi > 0.) {
147
148 std::pair<double,double> lower_keys = GetEtaPhiKeys(eta-(dEta/2.), phi-(dPhi/2.));
149 std::pair<double,double> upper_keys = GetEtaPhiKeys(eta+(dEta/2.), phi+(dPhi/2.));
150
151 for (int ieta = lower_keys.first; ieta <= upper_keys.first; ieta++)
152 for (int iphi = lower_keys.second; iphi <= upper_keys.second; iphi++)
153 clusters.insert(clusters.end(), m_map.at(ieta).at(iphi).begin(), m_map.at(ieta).at(iphi).end());
154
155
156 //Re-sort vector according to Et and return it.
157 sort( clusters.begin(), clusters.end(), CompareClusterET );
158
159 } else {
160 clusters = m_map.at(GetEtaPhiKeys(eta,phi).first).at(GetEtaPhiKeys(eta,phi).second);
161 }
162
163 return clusters;
164
165}
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
bool CompareClusterET(const xAOD::CaloCluster *c1, const xAOD::CaloCluster *c2)

◆ RetrieveTopoClusters() [2/3]

std::vector< const xAOD::CaloCluster * > TopoClusterMap::RetrieveTopoClusters ( double eta,
double phi,
double Pt ) const

Definition at line 118 of file TopoClusterMap.cxx.

121{
122
123 if ((Pt * 1e-3) < 15) {
124 return RetrieveTopoClusters(eta, phi, 0.2, 0.2);
125 }
126 else if ((Pt * 1e-3) < 50) {
127 return RetrieveTopoClusters(eta, phi, 0.2, 0.4);
128 }
129 else {
130 return RetrieveTopoClusters(eta, phi, 0.2, 0.6);
131 }
132
133}
std::vector< const xAOD::CaloCluster * > RetrieveTopoClusters(double eta, double phi, double Pt) const

◆ RetrieveTopoClusters() [3/3]

std::vector< const xAOD::CaloCluster * > TopoClusterMap::RetrieveTopoClusters ( int eta_key,
int phi_key ) const
inline

Definition at line 51 of file TopoClusterMap.h.

52 {
53 return m_map.at(eta_key).at(phi_key);
54 }

◆ SetTopoClusters()

StatusCode TopoClusterMap::SetTopoClusters ( const xAOD::CaloClusterContainer * inputTopoClusterContainer)

Definition at line 41 of file TopoClusterMap.cxx.

43{
44
45 double eta, phi;
46
47 for(const auto *const cc : *inputTopoClusterContainer)
48 {
49 //Retrieve eta, phi from ith topocluster.
50 eta = cc->eta();
51 phi = cc->phi();
52
53 //Put it in appropriate vector.
54 m_map[GetEtaPhiKeys(eta,phi).first][GetEtaPhiKeys(eta,phi).second].push_back(cc);
55 }
56
58
59 return StatusCode::SUCCESS;
60}

◆ SortGridVector()

void TopoClusterMap::SortGridVector ( int eta_key,
int phi_key )
private

Definition at line 84 of file TopoClusterMap.cxx.

84 {
85
86 if (!m_map[eta_key][phi_key].empty())
87 sort( m_map[eta_key][phi_key].begin(), m_map[eta_key][phi_key].end(), CompareClusterET );
88}
static const Attributes_t empty

◆ SortGridVectors()

void TopoClusterMap::SortGridVectors ( )
private

Definition at line 76 of file TopoClusterMap.cxx.

76 {
77
78 for (int i = 0; i <= (GetEtaPhiKeys(m_maxEta, m_maxPhi).first); i++)
79 for (int j = 0; j <= (GetEtaPhiKeys(m_maxEta, m_maxPhi).second); j++)
80 SortGridVector(i,j);
81
82}

Member Data Documentation

◆ m_dEta

double TopoClusterMap::m_dEta
private

Definition at line 83 of file TopoClusterMap.h.

◆ m_dPhi

double TopoClusterMap::m_dPhi
private

Definition at line 83 of file TopoClusterMap.h.

◆ m_map

TopoCluster2DMap TopoClusterMap::m_map
private

Definition at line 79 of file TopoClusterMap.h.

◆ m_maxEta

double TopoClusterMap::m_maxEta
private

Definition at line 82 of file TopoClusterMap.h.

◆ m_maxPhi

double TopoClusterMap::m_maxPhi
private

Definition at line 82 of file TopoClusterMap.h.

◆ m_minEta

double TopoClusterMap::m_minEta
private

Definition at line 82 of file TopoClusterMap.h.

◆ m_minPhi

double TopoClusterMap::m_minPhi
private

Definition at line 82 of file TopoClusterMap.h.


The documentation for this class was generated from the following files: