ATLAS Offline Software
PeriodicGridBase.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3  */
4 
5 #ifndef TRIGEFMISSINGET_PERIODICGRIDBASE_H
6 #define TRIGEFMISSINGET_PERIODICGRIDBASE_H
7 
8 #include <cstddef>
9 #include <utility>
10 
17 namespace HLT
18 {
19  namespace MET
20  {
23  {
31  EtaPhiDisplaced = 3
32  }; //> end enum GridDisplacement
33 
43  {
45  double maxEta{0.};
47  std::size_t nEtaTowers{0};
49  std::size_t nPhiTowers{0};
51  bool displaceEta{false};
53  bool displacePhi{false};
55  bool operator!=(const GridParameters &other) const;
56  bool operator==(const GridParameters &other) const;
59  }; //> end struct GridParameters
60 
76  {
77  public:
81  class Tower
82  {
83  public:
84  Tower(std::size_t index);
85  virtual ~Tower() = default;
86 
88  virtual const PeriodicGridBase *grid() const = 0;
89 
91  double towerPhi() const;
92 
94  double towerEta() const;
95 
97  std::size_t index() const;
98 
100  std::size_t etaIndex() const;
101 
103  std::size_t phiIndex() const;
104 
106  std::pair<std::size_t, std::size_t> etaPhiIndex() const;
107 
108  private:
109  std::size_t m_index;
110  }; //> end class Tower
111 
114 
117  double maxEta,
118  std::size_t nEtaTowers,
119  std::size_t nPhiTowers,
120  bool displaceEta = false,
121  bool displacePhi = false);
122 
131  std::size_t getIndex(
132  double eta,
133  double phi,
134  bool &outOfRange) const;
135 
143  std::size_t getEtaIndex(double eta, bool &outOfRange) const;
144 
146  std::size_t getPhiIndex(double phi) const;
147 
149  std::size_t globalIndex(std::size_t iEta, std::size_t iPhi) const;
150 
152  std::pair<std::size_t, std::size_t> etaPhiIndex(std::size_t index) const;
153 
155  double centralEta(std::size_t iEta) const;
157  double centralPhi(std::size_t iPhi) const;
158 
160  const GridParameters &parameters() const;
161 
163  double maxEta() const;
164 
166  std::size_t nEtaTowers() const;
167 
169  std::size_t nPhiTowers() const;
170 
172  std::size_t nTowers() const;
173 
175  bool displaceEta() const;
176 
178  bool displacePhi() const;
179 
182 
184  double etaWidth() const;
185 
187  double phiWidth() const;
188 
189  private:
192  }; //> end class PeriodicGridBase
193  } // namespace MET
194 } // namespace HLT
195 
196 #endif //> !PUFITUTILS_PERIODICGRIDBASE_H
HLT::MET::PeriodicGridBase::displacePhi
bool displacePhi() const
Whether or not this is displaced in phi.
Definition: PeriodicGridBase.cxx:144
HLT::MET::PeriodicGridBase::Tower::etaPhiIndex
std::pair< std::size_t, std::size_t > etaPhiIndex() const
The eta/phi indices of the tower together.
Definition: PeriodicGridBase.cxx:59
HLT::MET::PeriodicGridBase::Tower::towerPhi
double towerPhi() const
The central phi coordinate of this tower.
Definition: PeriodicGridBase.cxx:34
HLT::MET::PeriodicGridBase::Tower::etaIndex
std::size_t etaIndex() const
The eta index of this tower.
Definition: PeriodicGridBase.cxx:49
HLT::MET::PeriodicGridBase::nPhiTowers
std::size_t nPhiTowers() const
The number of phi bins.
Definition: PeriodicGridBase.cxx:141
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
HLT::MET::PeriodicGridBase::Tower
Base class for towers belonging to the grids.
Definition: PeriodicGridBase.h:82
HLT::MET::EtaDisplaced
@ EtaDisplaced
The grid is shifted by half a tower width in eta.
Definition: PeriodicGridBase.h:27
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
index
Definition: index.py:1
HLT::MET::GridParameters::nEtaTowers
std::size_t nEtaTowers
The number of divisions along the eta axis.
Definition: PeriodicGridBase.h:47
HLT::MET::GridParameters::operator==
bool operator==(const GridParameters &other) const
Definition: PeriodicGridBase.cxx:20
HLT::MET::GridParameters::displacePhi
bool displacePhi
Whether the grid is displaced in phi.
Definition: PeriodicGridBase.h:53
HLT::MET::PhiDisplaced
@ PhiDisplaced
The grid is shifted by half a tower width in phi.
Definition: PeriodicGridBase.h:29
HLT::MET::PeriodicGridBase::m_params
const GridParameters m_params
The grid's parameters.
Definition: PeriodicGridBase.h:191
HLT::MET::PeriodicGridBase::Tower::Tower
Tower(std::size_t index)
Definition: PeriodicGridBase.cxx:32
HLT::MET::PeriodicGridBase::etaPhiIndex
std::pair< std::size_t, std::size_t > etaPhiIndex(std::size_t index) const
Convert a global index to an eta/phi index pair.
Definition: PeriodicGridBase.cxx:124
HLT::MET::PeriodicGridBase::getIndex
std::size_t getIndex(double eta, double phi, bool &outOfRange) const
Get the index for the given eta, phi values.
Definition: PeriodicGridBase.cxx:79
HLT::MET::PeriodicGridBase::displacement
GridDisplacement displacement() const
The grid displacement.
Definition: PeriodicGridBase.cxx:145
HLT::MET::PeriodicGridBase::Tower::phiIndex
std::size_t phiIndex() const
The phi index of this tower.
Definition: PeriodicGridBase.cxx:54
HLT::MET::PeriodicGridBase::Tower::index
std::size_t index() const
The global index of this tower.
Definition: PeriodicGridBase.cxx:44
HLT::MET::PeriodicGridBase::displaceEta
bool displaceEta() const
Whether or not this is displaced in eta.
Definition: PeriodicGridBase.cxx:143
HLT::MET::NoDisplacement
@ NoDisplacement
The grid is not shifted.
Definition: PeriodicGridBase.h:25
HLT::MET::EtaPhiDisplaced
@ EtaPhiDisplaced
The grid is shifted by half a tower width in both eta and phi.
Definition: PeriodicGridBase.h:31
HLT::MET::GridDisplacement
GridDisplacement
Enum to describe the positioning of the grid.
Definition: PeriodicGridBase.h:23
HLT::MET::PeriodicGridBase::phiWidth
double phiWidth() const
The bin width in phi.
Definition: PeriodicGridBase.cxx:150
HLT::MET::PeriodicGridBase::parameters
const GridParameters & parameters() const
The grid parameters.
Definition: PeriodicGridBase.cxx:138
HLT
It used to be useful piece of code for replacing actual SG with other store of similar functionality ...
Definition: HLTResultReader.h:26
HLT::MET::GridParameters::displacement
GridDisplacement displacement() const
The.
Definition: PeriodicGridBase.cxx:25
HLT::MET::PeriodicGridBase::getEtaIndex
std::size_t getEtaIndex(double eta, bool &outOfRange) const
Get the eta index for the given value.
Definition: PeriodicGridBase.cxx:87
HLT::MET::GridParameters::nPhiTowers
std::size_t nPhiTowers
The number of divisions along the phi axis.
Definition: PeriodicGridBase.h:49
HLT::MET::PeriodicGridBase::PeriodicGridBase
PeriodicGridBase(const GridParameters &parameters)
Construct the grid from its parameters.
Definition: PeriodicGridBase.cxx:64
TCS::MET
@ MET
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/Types.h:16
HLT::MET::PeriodicGridBase::Tower::grid
virtual const PeriodicGridBase * grid() const =0
The grid which owns this tower.
HLT::MET::GridParameters::displaceEta
bool displaceEta
Whether the grid is displaced in eta.
Definition: PeriodicGridBase.h:51
HLT::MET::PeriodicGridBase::maxEta
double maxEta() const
The maximum eta range for the grid.
Definition: PeriodicGridBase.cxx:139
HLT::MET::PeriodicGridBase::getPhiIndex
std::size_t getPhiIndex(double phi) const
Get the phi index for the given value.
Definition: PeriodicGridBase.cxx:107
HLT::MET::PeriodicGridBase::Tower::towerEta
double towerEta() const
The central eta coordinate of this tower.
Definition: PeriodicGridBase.cxx:39
HLT::MET::PeriodicGridBase::globalIndex
std::size_t globalIndex(std::size_t iEta, std::size_t iPhi) const
Convert eta and phi to a global index.
Definition: PeriodicGridBase.cxx:120
HLT::MET::PeriodicGridBase
Base class for grids used in some of the pufit algorithms.
Definition: PeriodicGridBase.h:76
HLT::MET::PeriodicGridBase::centralPhi
double centralPhi(std::size_t iPhi) const
Central phi coordinate of the given phi.
Definition: PeriodicGridBase.cxx:133
HLT::MET::PeriodicGridBase::centralEta
double centralEta(std::size_t iEta) const
Central eta coordinate of the given eta index.
Definition: PeriodicGridBase.cxx:129
Trk::iPhi
@ iPhi
Definition: ParamDefs.h:53
HLT::MET::GridParameters::operator!=
bool operator!=(const GridParameters &other) const
Check inequality with other parameter sets.
Definition: PeriodicGridBase.cxx:11
HLT::MET::GridParameters::maxEta
double maxEta
The maximum |eta| value.
Definition: PeriodicGridBase.h:45
HLT::MET::PeriodicGridBase::Tower::~Tower
virtual ~Tower()=default
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
HLT::MET::GridParameters
Parameters describing a grid.
Definition: PeriodicGridBase.h:43
HLT::MET::PeriodicGridBase::nTowers
std::size_t nTowers() const
The number of bins.
Definition: PeriodicGridBase.cxx:142
HLT::MET::PeriodicGridBase::Tower::m_index
std::size_t m_index
Definition: PeriodicGridBase.h:109
xAOD::iEta
setScale setgFexType iEta
Definition: gFexJetRoI_v1.cxx:74
HLT::MET::PeriodicGridBase::etaWidth
double etaWidth() const
The bin width in eta.
Definition: PeriodicGridBase.cxx:149
HLT::MET::PeriodicGridBase::nEtaTowers
std::size_t nEtaTowers() const
The number of eta bins.
Definition: PeriodicGridBase.cxx:140