![]() |
ATLAS Offline Software
|
Container for binned sums of calorimeter variables. More...
#include <CaloSum.h>
Public Types | |
enum | CaloRegion { Central = 0x01, EndCap = 0x02, Forward = 0x04, Em = 0x08, Had = 0x10, UnknownRegion = 0xff } |
Region indicator implementation. More... | |
enum | CaloVarType { E = 0x01, EDensity = 0x02, EFraction = 0x04, Et = 0x08, EtFraction = 0x10, UnknownType = 0xff } |
Binned variable type. More... | |
typedef std::pair< CaloRegion, CaloSampling::CaloSample > | key_t |
Key type for compressed storage. More... | |
typedef std::vector< double > | data_t |
Data type for parallel running sums in a bin. More... | |
typedef data_t::iterator | data_iter_t |
Data iterator type. More... | |
typedef data_t::const_iterator | data_const_iter_t |
Data const iterator type. More... | |
typedef std::vector< data_t > | bin_t |
Bin type. More... | |
typedef bin_t::iterator | bin_iter_t |
Bin iterator type. More... | |
typedef bin_t::const_iterator | bin_const_iter_t |
Bin const iterator type. More... | |
typedef std::map< key_t, bin_t > | store_t |
Store data type. More... | |
typedef store_t::iterator | store_iter_t |
Store iterator type. More... | |
typedef store_t::const_iterator | store_const_iter_t |
Store const iterator type. More... | |
typedef std::pair< double, double > | range_t |
Range type. More... | |
typedef std::vector< range_t > | range_cont_t |
Range container type. More... | |
typedef std::map< CaloRegion, range_cont_t > | range_map_t |
Range map type. More... | |
typedef store_const_iter_t | const_iterator |
Store iterator type. More... | |
Public Member Functions | |
CaloSum () | |
Default constructor. More... | |
CaloSum (CaloVarType varType, const CaloBinDescriptor< double > &theBins, size_t numberOfSums=1) | |
Useful constructor. More... | |
virtual | ~CaloSum () |
Useful constructor. More... | |
virtual bool | setRegion (const CaloSum::CaloRegion &theRegion, double etaLow, double etaHigh) |
Configure regions. More... | |
virtual bool | setRegion (const CaloSum::CaloRegion &theRegion, const std::vector< double > &etaLow, const std::vector< double > &etaHigh) |
Configure regions. More... | |
virtual CaloRegion | getRegion (double theEta) const |
Retrieve region for a given eta. More... | |
virtual bool | getRange (const CaloRegion &theRegion, std::vector< double > &lowEtas, std::vector< double > &highEtas) const |
Returns eta range(s) for a given region. More... | |
virtual CaloVarType | getVarType () const |
Returns binned variable type. More... | |
virtual size_t | getNumberOfBins () const |
Returns number of bins. More... | |
virtual size_t | getNumberOfSums () const |
Returns number of sums in each bin. More... | |
virtual bool | getVariableRange (double &lowLimit, double &highLimit) const |
Returs lower and upper limit of binned variable range. More... | |
virtual bool | getBinEdges (size_t theIndex, double &lowEdge, double &highEdge) const |
Returns bin edges for a given bin. More... | |
virtual bool | getBinCenter (size_t theIndex, double &binCenter) const |
Returns bin center. More... | |
virtual const CaloBinDescriptor< double > & | getBinDescriptor () const |
Returns reference to complete bin descriptor. More... | |
virtual bool | add (const CaloCell *theCell, double theBinnedVariable, const std::vector< double > &theSummedVariables) |
Add to sums. More... | |
virtual bool | add (const CaloCell *theCell, double theBinnedVariable, double theSummedVariable) |
Add to sum. More... | |
virtual bool | add (const CaloSampling::CaloSample &theSampling, double theEta, double theBinnedVariable, const std::vector< double > &theSummedVariables) |
Add to sums. More... | |
virtual bool | add (const CaloSampling::CaloSample &theSampling, double theEta, double theBinnedVariable, double theSummedVariable) |
Add to sums. More... | |
const_iterator | begin () const |
Store begin iterator. More... | |
const_iterator | end () const |
Store end iterator. More... | |
bool | getSums (const_iterator &theIterator, size_t theBinIndex, std::vector< double > &theSums) const |
Returns sums for a given iterator. More... | |
bool | getSums (const_iterator &theIterator, double theBinnedVariable, std::vector< double > &theSums) const |
Returns sums for a given binned variable. More... | |
bool | getSums (const CaloSum::CaloRegion &theRegion, const CaloSampling::CaloSample &theSampling, size_t theIndex, std::vector< double > &theSums) const |
Returns sums for a given key and index. More... | |
bool | getSums (const CaloSum::CaloRegion &theRegion, const CaloSampling::CaloSample &theSampling, double theBinnedVariable, std::vector< double > &theSums) const |
Returns sums for a given key and binned variable. More... | |
virtual bool | contains (const CaloSum::CaloRegion &theRegion) const |
Returns sums for a given sampling, eta, and index. More... | |
virtual bool | contains (const CaloSampling::CaloSample &theSampling) const |
Checks if sampling in store. More... | |
virtual bool | contains (const CaloSum::CaloRegion &theRegion, const CaloSampling::CaloSample &theSampling) const |
Checks if region/sampling combination is in store. More... | |
Static Public Member Functions | |
static CaloRegion | getRegion (const_iterator &theIterator) |
Returns region for a given iterator. More... | |
static CaloSampling::CaloSample | getSampling (const_iterator &theIterator) |
Returns sampling for a given iterator. More... | |
Protected Member Functions | |
key_t | getKey (double theEta, const CaloSampling::CaloSample &theSample) const |
Translate into key. More... | |
bool | setUp () |
Set up defaults. More... | |
Static Protected Member Functions | |
static key_t | getKey (const CaloRegion &theRegion, const CaloSampling::CaloSample &theSample) |
Translate into key. More... | |
Private Attributes | |
bool | m_defaultRanges |
Process flow control: indicates default range overwrite. More... | |
size_t | m_numberOfSums |
Store size: number of sums. More... | |
CaloVarType | m_varType |
Binned variable type. More... | |
CaloBinDescriptor< double > | m_binDescriptor |
Bin descriptor. More... | |
range_map_t | m_regionRanges |
Store for region ranges. More... | |
store_t | m_sumStore |
Store for sums. More... | |
Container for binned sums of calorimeter variables.
Simple data container for indexed running sums. Presently three indices are supported:
CaloRegion
indicates a calorimeter region. CaloSample
indicates a calorimeter sampling. BinIndex
indicates a variable bin index It is possible to run several sums in a given bin. The binned variable can be different from the summed variable(s).
CaloRegion
s can be configured by the client. Three named regions are available, indentified by enumerators with default settings:
Central
central region \( |\eta| < 0.8\) ; EndCap
endcap region \( 0.8 < |\eta| < 2.5 \) ; Forward
forward region \( |\eta| > 2.5 \) ; EM
electromagnetic calorimeter only HAD
hadronic calorimeter only More than one \( \eta \) range can be assigned for each region, thus allowing categorizing these regions as non-contiguous entities. Also, the regions can overlap. In this case the to-be-summed quantities are added to all sums in overlapping regions.
Other configuration parameters are the type of the binned variable and the number of sums in each bin.
Code example:
typedef bin_t::const_iterator CaloSum::bin_const_iter_t |
typedef bin_t::iterator CaloSum::bin_iter_t |
typedef std::vector<data_t> CaloSum::bin_t |
typedef data_t::const_iterator CaloSum::data_const_iter_t |
typedef data_t::iterator CaloSum::data_iter_t |
typedef std::vector<double> CaloSum::data_t |
typedef std::pair<CaloRegion,CaloSampling::CaloSample> CaloSum::key_t |
typedef std::vector<range_t> CaloSum::range_cont_t |
typedef std::map<CaloRegion,range_cont_t> CaloSum::range_map_t |
typedef std::pair<double,double> CaloSum::range_t |
typedef store_t::const_iterator CaloSum::store_const_iter_t |
typedef store_t::iterator CaloSum::store_iter_t |
typedef std::map<key_t,bin_t> CaloSum::store_t |
enum CaloSum::CaloRegion |
enum CaloSum::CaloVarType |
CaloSum::CaloSum | ( | ) |
Default constructor.
Usefulness limited, allows only default configuration, but has no bin descriptor, i.e. no sums!
Definition at line 18 of file CaloSum.cxx.
CaloSum::CaloSum | ( | CaloVarType | varType, |
const CaloBinDescriptor< double > & | theBins, | ||
size_t | numberOfSums = 1 |
||
) |
Useful constructor.
Accepts a variable type indicator, a bin descriptor, and the number of sums in a bin.
varType | variable type indicator |
theBins | bin descriptor |
numberOfSums | number of running sums (default 1 if omitted) |
The constructor implements default range assignments to each region
Central
\( -0.8 < \eta < 0.8 \) EndCap
\( -2.5 < \eta < -0.8 \) and \( 0.8 < \eta < 2.5 \) Forward
\( -5.0 < \eta < -2.5 \) and \( 2.5 < \eta < 5.0 \) This constructor implements only the regions defined above.
Definition at line 24 of file CaloSum.cxx.
|
virtualdefault |
Useful constructor.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Constructor allows to give a list of regions. / CaloSum(CaloVarType varType, const CaloBinDescriptor<double>& theBins, const std::vector<CaloRegion>& theRegions, size_t numberOfSums = 1 ); /*! Descructor
|
virtual |
Add to sums.
Returns false if problems adding (outside region range, outside binned variable range).
theCell | pointer to a CaloCell |
theBinnedVariable | binned variable |
theSummedVariables | summed variables |
In case of dimension mismatch, only the members of theSummedVariables fitting within the configured dimensions will be used.
If the cell is in a new region or sampling, a new key is generated and added to the internal store. No pre-setting of included (region,sampling) pairs (the keys) is necessary or possible. Unwanted combinations have to be avoided by the algorithms.
Definition at line 234 of file CaloSum.cxx.
|
virtual |
Add to sum.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
theCell | pointer to a CaloCell |
theBinnedVariable | binned variable |
theSummedVariable | summed variable |
Definition at line 226 of file CaloSum.cxx.
|
virtual |
Add to sums.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
theSampling | sampling indicator |
theEta | eta of CaloCell |
theBinnedVariable | binned variable |
theSummedVariables | summed variables |
Uses explicit sampling indicator and eta instead of CaloCell
reference.
Definition at line 255 of file CaloSum.cxx.
|
virtual |
Add to sums.
theSampling | sampling indicator |
theEta | eta of CaloCell |
theBinnedVariable | binned variable |
theSummedVariable | summed variable |
Definition at line 246 of file CaloSum.cxx.
CaloSum::const_iterator CaloSum::begin | ( | ) | const |
Store begin iterator.
Definition at line 297 of file CaloSum.cxx.
|
virtual |
Checks if sampling in store.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Returns true if given sampling is in store.
theSampling | sampling indicator |
Definition at line 402 of file CaloSum.cxx.
|
virtual |
Returns sums for a given sampling, eta, and index.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
theSampling | sampling indicator |
theEta | eta value |
theIndex | bin index |
theSums | reference to vector with running sums |
Returns sums for a given sampling, eta, and binned variable
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
theSampling | sampling indicator |
theEta | eta value |
theBinnedVariable | binned variable |
theSums | reference to vector with running sums |
Checks if region in store
Returns true if given region is in store.
theRegion | region indicator |
Definition at line 389 of file CaloSum.cxx.
|
virtual |
Checks if region/sampling combination is in store.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Returns true if given region/sampling combination is in store.
theRegion | region indicator |
theSampling | sampling indicator |
Definition at line 415 of file CaloSum.cxx.
CaloSum::const_iterator CaloSum::end | ( | ) | const |
Store end iterator.
Definition at line 302 of file CaloSum.cxx.
|
virtual |
Returns bin center.
Returns false if configuration incorrect or index invalid.
theIndex | bin index |
binCenter | center of bin |
Definition at line 202 of file CaloSum.cxx.
|
virtual |
Returns reference to complete bin descriptor.
Definition at line 216 of file CaloSum.cxx.
|
virtual |
Returns bin edges for a given bin.
Returns false if configuration incorrect or index invalid.
theIndex | bin index |
lowEdge | reference to variable containing lower bin limit on return |
highEdge | reference to variable containing upper bin limit on return |
Definition at line 193 of file CaloSum.cxx.
|
staticprotected |
Translate into key.
theRegion | region indicator |
theSample | sampling indicator |
Definition at line 443 of file CaloSum.cxx.
|
protected |
Translate into key.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
theEta | eta value |
theSample | sampling indicator |
Definition at line 450 of file CaloSum.cxx.
|
virtual |
Returns number of bins.
Return value 0 means incomplete configuration.
Definition at line 173 of file CaloSum.cxx.
|
virtual |
Returns number of sums in each bin.
Return value 0 means incomplete configuration.
Definition at line 178 of file CaloSum.cxx.
|
virtual |
Returns eta range(s) for a given region.
The ranges are returned in vectors owned by the client. The vectors are not cleared before filling, i.e. ranges are added if vectors already contain data.
theRegion | region on input |
lowEtas | reference to vector for lower eta limits |
highEtas | reference to vector for upper eta limits |
Definition at line 143 of file CaloSum.cxx.
|
static |
Returns region for a given iterator.
theIterator | store iterator |
Definition at line 308 of file CaloSum.cxx.
|
virtual |
Retrieve region for a given eta.
Returns UnknownRegion
if eta outside of all eta ranges. Returns first region in which eta is found.
theEta | eta on input |
Definition at line 124 of file CaloSum.cxx.
|
static |
Returns sampling for a given iterator.
theIterator | store iterator |
Definition at line 314 of file CaloSum.cxx.
bool CaloSum::getSums | ( | const CaloSum::CaloRegion & | theRegion, |
const CaloSampling::CaloSample & | theSampling, | ||
double | theBinnedVariable, | ||
std::vector< double > & | theSums | ||
) | const |
Returns sums for a given key and binned variable.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
theRegion | region indicator |
theSampling | sampling indicator |
theBinnedVariable | bin index |
theSums | reference to vector with running sums |
Definition at line 369 of file CaloSum.cxx.
bool CaloSum::getSums | ( | const CaloSum::CaloRegion & | theRegion, |
const CaloSampling::CaloSample & | theSampling, | ||
size_t | theIndex, | ||
std::vector< double > & | theSums | ||
) | const |
Returns sums for a given key and index.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
theRegion | region indicator |
theSampling | sampling indicator |
theIndex | bin index |
theSums | reference to vector with running sums |
Definition at line 345 of file CaloSum.cxx.
bool CaloSum::getSums | ( | const_iterator & | theIterator, |
double | theBinnedVariable, | ||
std::vector< double > & | theSums | ||
) | const |
Returns sums for a given binned variable.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
theIterator | store iterator |
theBinnedVariable | bin variable value |
theSums | reference to vector with running sums |
Definition at line 336 of file CaloSum.cxx.
bool CaloSum::getSums | ( | const_iterator & | theIterator, |
size_t | theBinIndex, | ||
std::vector< double > & | theSums | ||
) | const |
Returns sums for a given iterator.
Returns false if invalid iterator or index mismatch. Fills vector on successful return without clearing, i.e. sums are added as new members to the vector.
theIterator | store iterator |
theBinIndex | index of bin |
theSums | reference to vector with running sums |
Definition at line 319 of file CaloSum.cxx.
|
virtual |
Returs lower and upper limit of binned variable range.
Returns false if configuration incorrect, especially if lowLimit < highLimit.
lowLimit | reference to variable storing lower limit on return |
highLimit | reference to variable storing upper limit on return |
Definition at line 186 of file CaloSum.cxx.
|
virtual |
Returns binned variable type.
Definition at line 119 of file CaloSum.cxx.
|
virtual |
Configure regions.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Assigns eta ranges to a region.
theRegion | region indicator |
etaLow | vector of lower eta limits |
etaHigh | vector of upper eta limits |
It is expected that both vectors have the same dimension. Otherwise ranges up to the smallest dimension will be configured.
Definition at line 94 of file CaloSum.cxx.
|
virtual |
Configure regions.
Assigns one eta range to a region. This method overwrites the default settings.
theRegion | region indicator |
etaLow | lower eta limit |
etaHigh | upper eta limit |
Definition at line 54 of file CaloSum.cxx.
|
protected |
|
private |
|
private |
|
private |
|
private |
|
private |