ATLAS Offline Software
|
Bins energy deposits into a grid. More...
#include <PufitGrid.h>
Classes | |
class | Tower |
Describes a single element of the grid. More... | |
Public Types | |
enum | SumStrategy { SumStrategy::All, SumStrategy::Masked, SumStrategy::Unmasked } |
Helper enum to describe how to sum over towers. More... | |
Public Member Functions | |
PufitGrid (double maxEta, std::size_t nEtaTowers, std::size_t nPhiTowers, bool displaceEta=false, bool displacePhi=false) | |
Create a new tower grid. More... | |
PufitGrid (const GridParameters ¶meters) | |
Construct a grid from the provided parameters. More... | |
PufitGrid (const PufitGrid &other) | |
Copy constructor. More... | |
PufitGrid & | operator= (const PufitGrid &other) |
Assignment operator. More... | |
void | reset () |
Reset the internal storage. More... | |
PufitGrid & | operator+= (const SignedKinematics &kin) |
Add a signed object to this grid. More... | |
PufitGrid & | operator-= (const SignedKinematics &kin) |
Remove the energy of a signed object from this grid. More... | |
Tower & | operator[] (const std::pair< std::size_t, std::size_t > &indices) |
Access stored value by eta/phi index (access is bounds-checked) More... | |
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) More... | |
Tower & | operator[] (std::size_t index) |
Access stored value by global index number (access is bounds checked) More... | |
const Tower & | operator[] (std::size_t index) const |
Access stored value by global index number (access is bounds checked) More... | |
std::vector< Tower >::iterator | begin () |
Access by iterator. More... | |
std::vector< Tower >::const_iterator | begin () const |
Access by iterator. More... | |
std::vector< Tower >::iterator | end () |
Iterator end point. More... | |
std::vector< Tower >::const_iterator | end () const |
Iterator end point. More... | |
METComponent | sum (SumStrategy strategy=SumStrategy::All) const |
PufitGrid & | operator+= (const PufitGrid &other) |
Add a whole grid into this. More... | |
PufitGrid & | operator-= (const PufitGrid &other) |
Subtract a whole grid from this. More... | |
std::size_t | getIndex (double eta, double phi, bool &outOfRange) const |
Get the index for the given eta, phi values. More... | |
std::size_t | getEtaIndex (double eta, bool &outOfRange) const |
Get the eta index for the given value. More... | |
std::size_t | getPhiIndex (double phi) const |
Get the phi index for the given value. More... | |
std::size_t | globalIndex (std::size_t iEta, std::size_t iPhi) const |
Convert eta and phi to a global index. More... | |
std::pair< std::size_t, std::size_t > | etaPhiIndex (std::size_t index) const |
Convert a global index to an eta/phi index pair. More... | |
double | centralEta (std::size_t iEta) const |
Central eta coordinate of the given eta index. More... | |
double | centralPhi (std::size_t iPhi) const |
Central phi coordinate of the given phi. More... | |
const GridParameters & | parameters () const |
The grid parameters. More... | |
double | maxEta () const |
The maximum eta range for the grid. More... | |
std::size_t | nEtaTowers () const |
The number of eta bins. More... | |
std::size_t | nPhiTowers () const |
The number of phi bins. More... | |
std::size_t | nTowers () const |
The number of bins. More... | |
bool | displaceEta () const |
Whether or not this is displaced in eta. More... | |
bool | displacePhi () const |
Whether or not this is displaced in phi. More... | |
GridDisplacement | displacement () const |
The grid displacement. More... | |
double | etaWidth () const |
The bin width in eta. More... | |
double | phiWidth () const |
The bin width in phi. More... | |
Private Attributes | |
std::vector< Tower > | m_towers |
const GridParameters | m_params |
The grid's parameters. More... | |
Bins energy deposits into a grid.
The grid can be displaced in eta and/or phi. In this case the grid will be moved by half a bin in the relevant directions. For these purposes the grid will be treated as periodic in eta, even though the calorimeter isn't really.
Definition at line 49 of file PufitGrid.h.
|
strong |
Helper enum to describe how to sum over towers.
Enumerator | |
---|---|
All | |
Masked | |
Unmasked |
Definition at line 232 of file PufitGrid.h.
HLT::MET::PufitGrid::PufitGrid | ( | double | maxEta, |
std::size_t | nEtaTowers, | ||
std::size_t | nPhiTowers, | ||
bool | displaceEta = false , |
||
bool | displacePhi = false |
||
) |
Create a new tower grid.
maxEta | The maximum eta range for the grid |
nEtaTowers | The number of eta towers |
nPhiTowers | The number of phi towers |
displaceEta | Whether to displace eta |
displacePhi | Whether to displace phi |
Definition at line 76 of file PufitGrid.cxx.
HLT::MET::PufitGrid::PufitGrid | ( | const GridParameters & | parameters | ) |
Copy constructor.
Definition at line 94 of file PufitGrid.cxx.
std::vector< PufitGrid::Tower >::iterator HLT::MET::PufitGrid::begin | ( | ) |
Access by iterator.
Definition at line 154 of file PufitGrid.cxx.
std::vector< PufitGrid::Tower >::const_iterator HLT::MET::PufitGrid::begin | ( | ) | const |
Access by iterator.
Definition at line 158 of file PufitGrid.cxx.
|
inherited |
|
inherited |
Central phi coordinate of the given phi.
Definition at line 133 of file PeriodicGridBase.cxx.
|
inherited |
|
inherited |
The grid displacement.
Definition at line 145 of file PeriodicGridBase.cxx.
|
inherited |
std::vector< PufitGrid::Tower >::iterator HLT::MET::PufitGrid::end | ( | ) |
Iterator end point.
Definition at line 162 of file PufitGrid.cxx.
std::vector< PufitGrid::Tower >::const_iterator HLT::MET::PufitGrid::end | ( | ) | const |
Iterator end point.
Definition at line 166 of file PufitGrid.cxx.
|
inherited |
Convert a global index to an eta/phi index pair.
Definition at line 124 of file PeriodicGridBase.cxx.
|
inherited |
|
inherited |
Get the eta index for the given value.
eta | The eta value | |
[out] | outOfRange | Set to true if outside of the eta range |
If it's out of range the returned index will be nEta
Definition at line 87 of file PeriodicGridBase.cxx.
|
inherited |
Get the index for the given eta, phi values.
eta | The eta value | |
phi | The phi value | |
[out] | outOfRange | Set to true if outside of the eta range |
If it's out of range the returned index will be nTowers
Definition at line 79 of file PeriodicGridBase.cxx.
|
inherited |
|
inherited |
Convert eta and phi to a global index.
Definition at line 120 of file PeriodicGridBase.cxx.
|
inherited |
|
inherited |
|
inherited |
|
inherited |
PufitGrid & HLT::MET::PufitGrid::operator+= | ( | const SignedKinematics & | kin | ) |
Add a signed object to this grid.
The object will be assigned to the relevant bin. It will not be added if it falls outside of the eta range. The momentum of the kinematics will be used. If you do not want this (i.e. you want mass to be ignored) you should construct the kinematics without mass.
Definition at line 115 of file PufitGrid.cxx.
PufitGrid & HLT::MET::PufitGrid::operator-= | ( | const SignedKinematics & | kin | ) |
Remove the energy of a signed object from this grid.
The object will be assigned to the relevant bin. It will not be added if it falls outside of the eta range. The momentum of the kinematics will be used. If you do not want this (i.e. you want mass to be ignored) you should construct the kinematics without mass.
Definition at line 124 of file PufitGrid.cxx.
Assignment operator.
other | The grid whose towers to take @except std::invalid_argument If other's parameters don't match ours. |
Take the tower energies/masking from the other grid. This is only allowed between two grids with matching parameters.
Definition at line 99 of file PufitGrid.cxx.
PufitGrid::Tower & HLT::MET::PufitGrid::operator[] | ( | const std::pair< std::size_t, std::size_t > & | indices | ) |
Access stored value by eta/phi index (access is bounds-checked)
Definition at line 134 of file PufitGrid.cxx.
const PufitGrid::Tower & HLT::MET::PufitGrid::operator[] | ( | const std::pair< std::size_t, std::size_t > & | indices | ) | const |
Access stored value by eta/phi index (access is bounds checked)
Definition at line 139 of file PufitGrid.cxx.
PufitGrid::Tower & HLT::MET::PufitGrid::operator[] | ( | std::size_t | index | ) |
Access stored value by global index number (access is bounds checked)
Definition at line 145 of file PufitGrid.cxx.
const PufitGrid::Tower & HLT::MET::PufitGrid::operator[] | ( | std::size_t | index | ) | const |
Access stored value by global index number (access is bounds checked)
Definition at line 149 of file PufitGrid.cxx.
|
inherited |
|
inherited |
void HLT::MET::PufitGrid::reset | ( | ) |
Reset the internal storage.
Definition at line 107 of file PufitGrid.cxx.
METComponent HLT::MET::PufitGrid::sum | ( | SumStrategy | strategy = SumStrategy::All | ) | const |
Definition at line 171 of file PufitGrid.cxx.
|
privateinherited |
The grid's parameters.
Definition at line 191 of file PeriodicGridBase.h.
|
private |
Definition at line 247 of file PufitGrid.h.