|
ATLAS Offline Software
|
Go to the documentation of this file.
5 #ifndef TRIGEFMISSINGET_PUFITMULTIGRID_H
6 #define TRIGEFMISSINGET_PUFITMULTIGRID_H
12 #include <type_traits>
61 template <std::
size_t N>
64 static_assert(
N > 0,
"N must be greater than 0");
67 static_assert(
N < 17,
"N must be no greater than 16");
71 constexpr
static std::size_t
All = (1 <<
N) - 1;
156 template <std::size_t
I,
169 template <std::size_t
I,
187 return m_parent->m_grids[ii][
index()];
192 return m_parent->m_grids[ii][
index()];
198 for (std::size_t ii = 0; ii <
N; ++ii)
199 (subTower(ii).*
f)(
other.subTower(ii));
204 template <
typename T>
208 for (std::size_t ii = 0; ii <
N; ++ii)
210 val += (subTower(ii).*
f)();
261 typename std::vector<Tower>::const_iterator
begin()
const;
265 typename std::vector<Tower>::const_iterator
end()
const;
278 template <std::size_t
I,
291 template <std::size_t
I,
306 PufitGrid
get(std::size_t
type)
const;
309 std::array<PufitGrid, N> m_grids;
310 std::vector<Tower> m_towers;
314 template <
typename Gr
id>
323 return grids[displacement];
329 return grids[displacement];
333 template <std::
size_t I>
342 template <std::size_t
I,
354 #endif //> !TRIGEFMISSINGET_PUFITMULTIGRID_H
bool displacePhi() const
Whether or not this is displaced in phi.
JetConstituentVector::iterator iterator
Bins energy deposits into a grid.
constexpr uint16_t intLog2(std::size_t i, uint16_t tmp=0)
Compile time calculation of the log base 2 of an integer.
Tower(PufitMultiGrid *parent, std::size_t index)
Create a tower with its parent grid.
PufitMultiGrid & operator+=(const PufitMultiGrid &other)
Add a whole grid into this.
PufitMultiGrid(const PufitMultiGrid &other)
Copy constructor.
Tower & operator[](std::size_t index)
Access stored value by global index number (access is bounds checked)
PufitMultiGridSet & parent
double eta(std::size_t type=All) const
This tower's kinematic eta.
std::size_t nPhiTowers() const
The number of phi bins.
PufitMultiGrid(double maxEta, std::size_t nEtaTowers, std::size_t nPhiTowers, bool displaceEta=false, bool displacePhi=false)
Create a new tower grid.
constexpr static std::size_t NCategories
The number of separate categories in the grid.
Base class for towers belonging to the grids.
Tower & operator-=(const Tower &other)
Subtract another tower's energies from this one.
std::pair< long int, long int > indices
Element & operator+=(const SignedKinematics &kin)
Helper struct to contain a full set of grids.
PufitMultiGrid & operator-=(const PufitMultiGrid &other)
Subtract a whole grid from this.
std::vector< Tower >::iterator end()
Iterator end point.
constexpr bool isPow2(std::size_t i)
Compile time check if a number is a power of 2.
const Tower & operator[](const std::pair< std::size_t, std::size_t > &indices) const
Access stored value by eta/phi index (access is bounds checked)
std::vector< Tower >::const_iterator begin() const
Access by iterator.
constexpr int nPhi
Default bin number of phi for vertex map.
double ez(std::size_t type=All) const
The z-component of this tower's energy.
std::size_t index() const
The global index of this tower.
bool displaceEta() const
Whether or not this is displaced in eta.
double sumE(std::size_t type=All) const
The total sumE in this tower.
GridDisplacement
Enum to describe the positioning of the grid.
Grid & operator[](GridDisplacement displacement)
Select a grid.
Class to describe the kinematics of an object that can have negative energies.
const Tower & operator[](std::size_t index) const
Access stored value by global index number (access is bounds checked)
const GridParameters & parameters() const
The grid parameters.
It used to be useful piece of code for replacing actual SG with other store of similar functionality ...
friend class PufitMulitGrid
PufitMultiGrid & operator=(const PufitMultiGrid &other)
Assignment operator.
Describes a single element of the grid.
constexpr static std::size_t All
Maximum value representable by N bits.
double phi(std::size_t type=All) const
This tower's kinematic phi.
double ey(std::size_t type=All) const
The y-component of this tower's energy.
double sumEt(std::size_t type=All) const
The total sumEt in this tower.
std::decay< T >::type sumOver(int type, T(PufitGrid::Tower::*f)() const) const
Sum over the results of all sub towers whose indices match the 'type' mask.
const Grid & operator[](GridDisplacement displacement) const
Select a grid (const)
Element & operator-=(const SignedKinematics &kin)
Tower(const Tower &)=default
Element(PufitMultiGridSet &parent)
SignedKinematics kinematics(std::size_t type=All) const
Build a kinematics object from this tower.
void applyToAll(PufitGrid::Tower &(PufitGrid::Tower::*f)(const PufitGrid::Tower &), const PufitMultiGrid::Tower &other)
Apply a function to all sub towers.
std::vector< Tower >::iterator begin()
Access by iterator.
double maxEta() const
The maximum eta range for the grid.
const PufitMultiGrid * grid() const override
The parent grid of this tower.
Provide a base class for the grids used in some pufit algorithms.
void reset()
Reset the internal storage.
std::vector< Tower >::const_iterator end() const
Iterator end point.
Base class for grids used in some of the pufit algorithms.
Tower & operator[](const std::pair< std::size_t, std::size_t > &indices)
Access stored value by eta/phi index (access is bounds checked)
Multiple grids combined into one.
Tower & operator=(const Tower &other)
Copy assignment operator.
double ex(std::size_t type=All) const
The x-component of this tower's energy.
Helper struct to forward the SignedKinematics operators nicely.
PufitMultiGridSet(double maxEta, std::size_t nEta, std::size_t nPhi)
void mask(bool value=true)
Set the mask on this tower.
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Parameters describing a grid.
std::array< Grid, 4 > grids
Tower & operator+=(const Tower &other)
Add another tower's energies into this one.
bool masked() const
Whether or not this tower was masked.
constexpr int nEta
Default bin number of eta for vertex map.
Helper struct to forward the SignedKinematics operators nicely.
PufitMultiGrid(const GridParameters ¶meters)
Construct a grid from the provided parameters.
std::size_t nEtaTowers() const
The number of eta bins.