ATLAS Offline Software
Loading...
Searching...
No Matches
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
16
17namespace HLT
18{
19 namespace MET
20 {
23 {
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
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
std::pair< std::size_t, std::size_t > etaPhiIndex() const
The eta/phi indices of the tower together.
std::size_t etaIndex() const
The eta index of this tower.
virtual const PeriodicGridBase * grid() const =0
The grid which owns this tower.
double towerEta() const
The central eta coordinate of this tower.
std::size_t index() const
The global index of this tower.
double towerPhi() const
The central phi coordinate of this tower.
std::size_t phiIndex() const
The phi index of this tower.
std::size_t nPhiTowers() const
The number of phi bins.
double maxEta() const
The maximum eta range for the grid.
std::size_t nTowers() const
The number of bins.
double centralEta(std::size_t iEta) const
Central eta coordinate of the given eta index.
std::size_t getPhiIndex(double phi) const
Get the phi index for the given value.
std::size_t nEtaTowers() const
The number of eta bins.
std::size_t getIndex(double eta, double phi, bool &outOfRange) const
Get the index for the given eta, phi values.
bool displacePhi() const
Whether or not this is displaced in phi.
PeriodicGridBase(const GridParameters &parameters)
Construct the grid from its parameters.
bool displaceEta() const
Whether or not this is displaced in eta.
std::size_t globalIndex(std::size_t iEta, std::size_t iPhi) const
Convert eta and phi to a global index.
std::pair< std::size_t, std::size_t > etaPhiIndex(std::size_t index) const
Convert a global index to an eta/phi index pair.
double phiWidth() const
The bin width in phi.
double centralPhi(std::size_t iPhi) const
Central phi coordinate of the given phi.
GridDisplacement displacement() const
The grid displacement.
std::size_t getEtaIndex(double eta, bool &outOfRange) const
Get the eta index for the given value.
double etaWidth() const
The bin width in eta.
const GridParameters & parameters() const
The grid parameters.
const GridParameters m_params
The grid's parameters.
GridDisplacement
Enum to describe the positioning of the grid.
@ EtaPhiDisplaced
The grid is shifted by half a tower width in both eta and phi.
@ PhiDisplaced
The grid is shifted by half a tower width in phi.
@ NoDisplacement
The grid is not shifted.
@ EtaDisplaced
The grid is shifted by half a tower width in eta.
It used to be useful piece of code for replacing actual SG with other store of similar functionality ...
Definition index.py:1
Parameters describing a grid.
bool operator!=(const GridParameters &other) const
Check inequality with other parameter sets.
GridDisplacement displacement() const
The.
bool displaceEta
Whether the grid is displaced in eta.
bool displacePhi
Whether the grid is displaced in phi.
std::size_t nPhiTowers
The number of divisions along the phi axis.
bool operator==(const GridParameters &other) const
std::size_t nEtaTowers
The number of divisions along the eta axis.
double maxEta
The maximum |eta| value.