22 m_kin = other.kinematics();
63 m_kin += other.kinematics();
70 m_kin -= other.kinematics();
102 throw std::invalid_argument(
"Grid parameters do not match!");
103 std::copy(other.begin(), other.end(),
m_towers.begin());
118 bool outOfRange =
false;
127 bool outOfRange =
false;
135 const std::pair<std::size_t, std::size_t> &indices)
140 const std::pair<std::size_t, std::size_t> &indices)
const
177 for (
const Tower &tower : *
this)
181 for (
const Tower &tower : *
this)
186 for (
const Tower &tower : *
this)
197 throw std::invalid_argument(
"Grid parameters do not match");
199 auto otherItr = other.begin();
200 for (; itr !=
end(); ++itr, ++otherItr)
207 throw std::invalid_argument(
"Grid parameters do not match");
209 auto otherItr = other.begin();
210 for (; itr !=
end(); ++itr, ++otherItr)
217 PufitGrid(maxEta, nEta, nPhi,
true,
false),
218 PufitGrid(maxEta, nEta, nPhi,
false,
true),
219 PufitGrid(maxEta, nEta, nPhi,
true,
true)})
237 return grids[displacement];
241 return grids[displacement];
Helper struct to build up MET values before moving them into the EDM.
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.
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 ¶meters)
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.
const GridParameters & parameters() const
The grid parameters.
Describes a single element of the grid.
void mask(bool value=true)
Set the mask on this tower.
Tower & operator=(const Tower &other)
Copy assignment operator.
double eta() const
This tower's kinematic eta.
double ey() const
The y-component of this tower's energy.
double m_sumE
The summed energy.
double phi() const
This tower's kinematic phi.
Tower & operator+=(const SignedKinematics &kin)
Add a signed object to this tower.
bool masked() const
Whether or not this tower was masked.
Tower & operator-=(const SignedKinematics &kin)
Remove the energy of a signed object from this tower.
bool m_mask
The mask value.
double ez() const
The z-component of this tower's energy.
virtual const PufitGrid * grid() const override
The parent grid of this tower.
SignedKinematics kinematics() const
Build a kinematics object from this tower.
const PufitGrid *const m_parent
The parent grid.
double ex() const
The x-component of this tower's energy.
Tower(const PufitGrid *parent, std::size_t index)
Create a tower with its parent.
double sumEt() const
The total sumEt in this tower.
double m_sumEt
The summed et.
double sumE() const
The total sumE in this tower.
Bins energy deposits into a grid.
std::vector< Tower >::iterator begin()
Access by iterator.
std::vector< Tower >::iterator end()
Iterator end point.
SumStrategy
Helper enum to describe how to sum over towers.
PufitGrid & operator=(const PufitGrid &other)
Assignment operator.
PufitGrid & operator+=(const SignedKinematics &kin)
Add a signed object to this grid.
METComponent sum(SumStrategy strategy=SumStrategy::All) const
Tower & operator[](const std::pair< std::size_t, std::size_t > &indices)
Access stored value by eta/phi index (access is bounds-checked)
void reset()
Reset the internal storage.
PufitGrid & operator-=(const SignedKinematics &kin)
Remove the energy of a signed object from this grid.
PufitGrid(double maxEta, std::size_t nEtaTowers, std::size_t nPhiTowers, bool displaceEta=false, bool displacePhi=false)
Create a new tower grid.
std::vector< Tower > m_towers
Class to describe the kinematics of an object that can have negative energies.
double eta() const
Direction.
double energy() const
Energy values (signed) energy.
double pt() const
(signed) pt
METComponent operator+(const METComponent &lhs, const METComponent &rhs)
GridDisplacement
Enum to describe the positioning of the grid.
PufitGrid operator-(const PufitGrid &lhs, const PufitGrid &rhs)
Elementwise subtraction.
It used to be useful piece of code for replacing actual SG with other store of similar functionality ...
Parameters describing a grid.
PufitGridSet & operator-=(const SignedKinematics &kin)
Subtract kinematics.
PufitGridSet & operator+=(const SignedKinematics &kin)
Add kinematics.
PufitGrid & operator[](GridDisplacement displacement)
Select a grid.
PufitGridSet(double maxEta, std::size_t nEta, std::size_t nPhi)
std::array< PufitGrid, 4 > grids