ATLAS Offline Software
Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
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 More...
 
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;
28  m_maxEta = maxEta;
29  m_maxPhi = maxPhi;
30  m_dEta = dEta;
31  m_dPhi = dPhi;
32 }

◆ ~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 }

◆ 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  }

◆ 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  return (thirdLayerEnergy / totalEnergy);
192 
193 
194 }

◆ 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 }

◆ 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 {
161  }
162 
163  return clusters;
164 
165 }

◆ 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 }

◆ 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 }

◆ 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:
xAOD::CaloCluster_v1::phi
virtual double phi() const
The azimuthal angle ( ) of the particle.
Definition: CaloCluster_v1.cxx:256
python.SystemOfUnits.second
int second
Definition: SystemOfUnits.py:120
constants.EMB1
int EMB1
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:53
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
TopoClusterMap::m_map
TopoCluster2DMap m_map
Definition: TopoClusterMap.h:79
TopoClusterMap::SortGridVectors
void SortGridVectors()
Definition: TopoClusterMap.cxx:76
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
TopoClusterMap::m_dEta
double m_dEta
Definition: TopoClusterMap.h:83
TopoClusterMap::m_minPhi
double m_minPhi
Definition: TopoClusterMap.h:82
empty
bool empty(TH1 *h)
Definition: computils.cxx:294
std::sort
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
Definition: DVL_algorithms.h:554
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
PUfitVar::maxEta
constexpr float maxEta
Definition: GepMETPufitAlg.cxx:13
TopoClusterMap::m_minEta
double m_minEta
Definition: TopoClusterMap.h:82
xAOD::CaloCluster_v1::inEndcap
bool inEndcap() const
Returns true if at least one clustered cell in the endcap.
Definition: CaloCluster_v1.h:901
constants.EMB2
int EMB2
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:54
lumiFormat.i
int i
Definition: lumiFormat.py:92
TauGNNUtils::Variables::Track::dPhi
bool dPhi(const xAOD::TauJet &tau, const xAOD::TauTrack &track, double &out)
Definition: TauGNNUtils.cxx:530
xAOD::CaloCluster_v1::inBarrel
bool inBarrel() const
Returns true if at least one clustered cell in the barrel.
Definition: CaloCluster_v1.h:896
TopoClusterMap::m_dPhi
double m_dPhi
Definition: TopoClusterMap.h:83
constants.EME1
int EME1
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:55
TopoClusterMap::SortGridVector
void SortGridVector(int eta_key, int phi_key)
Definition: TopoClusterMap.cxx:84
TopoClusterMap::GetEtaPhiKeys
std::pair< int, int > GetEtaPhiKeys(double eta, double phi) const
Definition: TopoClusterMap.h:57
CaloCell_ID_FCS::EME3
@ EME3
Definition: FastCaloSim_CaloCell_ID.h:26
xAOD::CaloCluster_v1::eSample
float eSample(const CaloSample sampling) const
Definition: CaloCluster_v1.cxx:521
DiTauMassTools::MaxHistStrategyV2::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:26
Prompt::Def::Pt
@ Pt
Definition: VarHolder.h:76
VKalVrtAthena::varHolder_detail::clear
void clear(T &var)
Definition: NtupleVars.h:48
TopoClusterMap::m_maxEta
double m_maxEta
Definition: TopoClusterMap.h:82
CaloCell_ID_FCS::PreSamplerE
@ PreSamplerE
Definition: FastCaloSim_CaloCell_ID.h:23
CaloCell_ID_FCS::PreSamplerB
@ PreSamplerB
Definition: FastCaloSim_CaloCell_ID.h:19
DeMoScan.first
bool first
Definition: DeMoScan.py:534
RunTileMonitoring.clusters
clusters
Definition: RunTileMonitoring.py:133
TopoClusterMap::RetrieveTopoClusters
std::vector< const xAOD::CaloCluster * > RetrieveTopoClusters(double eta, double phi, double Pt) const
Definition: TopoClusterMap.cxx:118
TauGNNUtils::Variables::Track::dEta
bool dEta(const xAOD::TauJet &tau, const xAOD::TauTrack &track, double &out)
Definition: TauGNNUtils.cxx:525
CaloCell_ID_FCS::EMB3
@ EMB3
Definition: FastCaloSim_CaloCell_ID.h:22
constants.EME2
int EME2
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:56
CompareClusterET
bool CompareClusterET(const xAOD::CaloCluster *c1, const xAOD::CaloCluster *c2)
Definition: TopoClusterMap.cxx:10
TopoClusterMap::m_maxPhi
double m_maxPhi
Definition: TopoClusterMap.h:82
python.handimod.cc
int cc
Definition: handimod.py:523