#include <HIEventShapeIndex.h>
|
| HIEventShapeIndex () |
|
| ~HIEventShapeIndex () |
|
unsigned int | setBinning (const TH2 *h2, bool asMask) |
|
unsigned int | setBinning (HI::BinningScheme scheme) |
|
void | initializeEventShapeContainer (std::unique_ptr< xAOD::HIEventShapeContainer > &shape_container, unsigned int num_harmonics) const |
|
unsigned int | getIndex (float eta, int layer) const |
|
unsigned int | getIndexFromBin (unsigned int ebin, int layer) const |
|
unsigned int | getEtaBin (float eta, int layer) const |
|
unsigned int | getNumBins () const |
|
xAOD::HIEventShape * | getShape (float eta, int layer, xAOD::HIEventShapeContainer *shape_container) const |
|
const xAOD::HIEventShape * | getShape (float eta, int layer, const xAOD::HIEventShapeContainer *shape_container) const |
|
xAOD::HIEventShape * | getShape (float eta, int layer, std::unique_ptr< xAOD::HIEventShapeContainer > &shape_container) const |
|
std::string | print () const |
|
Definition at line 16 of file HIEventShapeIndex.h.
◆ HIEventShapeIndex()
HIEventShapeIndex::HIEventShapeIndex |
( |
| ) |
|
◆ ~HIEventShapeIndex()
HIEventShapeIndex::~HIEventShapeIndex |
( |
| ) |
|
◆ getEtaBin()
unsigned int HIEventShapeIndex::getEtaBin |
( |
float |
eta, |
|
|
int |
layer |
|
) |
| const |
◆ getIndex()
unsigned int HIEventShapeIndex::getIndex |
( |
float |
eta, |
|
|
int |
layer |
|
) |
| const |
◆ getIndex_Internal()
unsigned int HIEventShapeIndex::getIndex_Internal |
( |
float |
eta, |
|
|
int |
layer, |
|
|
bool |
etaIndex |
|
) |
| const |
|
private |
Definition at line 110 of file HIEventShapeIndex.cxx.
113 const std::vector<range_index_t>&
vec=mItr->second;
114 unsigned int vsize=
vec.size();
118 std::cerr <<
"Layer " <<
layer <<
" has no range in calorimeter" << std::endl;
119 throw std::range_error(
"Bad binning request");
126 float abs_eta=std::abs(
eta);
130 if(abs_eta < rmin) eta_c=rmin+std::copysign(1
e-2,
eta);
131 else if(abs_eta > rmax) eta_c=rmax-std::copysign(1
e-2,
eta);
134 unsigned int pIndex=0;
135 for(; pIndex < vsize-1; pIndex++)
137 const range_index_t&
p=
vec.at(pIndex);
141 return (etaIndex) ? pIndex :
vec.at(pIndex).index;
◆ getIndexFromBin()
unsigned int HIEventShapeIndex::getIndexFromBin |
( |
unsigned int |
ebin, |
|
|
int |
layer |
|
) |
| const |
◆ getLayer()
Definition at line 193 of file HIEventShapeIndex.cxx.
200 std::cerr <<
"Layer " <<
layer <<
" has no binning specification" << std::endl;
201 throw std::range_error(
"Bad binning request");
◆ getNumBins()
unsigned int HIEventShapeIndex::getNumBins |
( |
| ) |
const |
|
inline |
◆ getShape() [1/3]
◆ getShape() [2/3]
◆ getShape() [3/3]
◆ initializeEventShapeContainer()
void HIEventShapeIndex::initializeEventShapeContainer |
( |
std::unique_ptr< xAOD::HIEventShapeContainer > & |
shape_container, |
|
|
unsigned int |
num_harmonics |
|
) |
| const |
Definition at line 206 of file HIEventShapeIndex.cxx.
214 bool isEmpty=(shape_container->
size()==0);
225 for(
auto ri : pp.second)
232 shape_container->operator[](ri.index)=
slice;
234 else slice=shape_container->
at(ri.index);
236 slice->setEtaMin(ri.eta_min);
237 slice->setEtaMax(ri.eta_max);
238 slice->setLayer(pp.first);
239 slice->etCos().assign(num_harmonics,0);
240 slice->etSin().assign(num_harmonics,0);
◆ print()
std::string HIEventShapeIndex::print |
( |
| ) |
const |
Definition at line 246 of file HIEventShapeIndex.cxx.
248 std::stringstream
ss;
252 for(
auto ri : pp.second)
254 ss << std::setw(10) << pp.first
255 << std::setw(10) << ri.eta_min
256 << std::setw(10) << ri.eta_max
257 << std::setw(10) << ri.index
◆ roundToTenth()
float HIEventShapeIndex::roundToTenth |
( |
float |
d | ) |
const |
|
inlineprivate |
Definition at line 66 of file HIEventShapeIndex.h.
66 {
return std::floor(
d)+std::floor((
d-std::floor(
d))*10.0+0.5)/10.0;};
◆ setBinning() [1/2]
unsigned int HIEventShapeIndex::setBinning |
( |
const TH2 * |
h2, |
|
|
bool |
asMask |
|
) |
| |
Definition at line 23 of file HIEventShapeIndex.cxx.
32 std::set<unsigned int> used_indices;
33 for(
int ybin=1; ybin<h2->GetNbinsY(); ybin++)
35 auto mItr=
m_edges.emplace_hint(
m_edges.end(),ybin-1,std::vector<range_index_t>());
36 for(
int xbin=1; xbin<h2->GetNbinsX(); xbin++)
38 if(h2->GetBinContent(xbin,ybin) < 0)
continue;
39 unsigned int v=h2->GetBinContent(xbin,ybin);
44 auto sItr=used_indices.find(
v);
45 if(sItr==used_indices.end()) used_indices.insert(
v);
54 mItr->second.push_back(range_index_t(h2->GetXaxis()->GetBinLowEdge(xbin),h2->GetXaxis()->GetBinUpEdge(xbin),
v));
◆ setBinning() [2/2]
Definition at line 62 of file HIEventShapeIndex.cxx.
75 mItr->second[eb].index=
index;
86 unsigned int num_eta_bins=
static_cast<unsigned int>(
std::round(std::abs((emax-emin)/deta)));
87 auto mItr=
m_edges.emplace_hint(
m_edges.end(),
layer,std::vector<range_index_t>(2*num_eta_bins,range_index_t()));
88 for(
unsigned int k=0;
k<num_eta_bins;
k++)
94 mItr->second[
k+num_eta_bins].eta_max=
roundToTenth(emin+
k*deta+deta);
97 index+=2*num_eta_bins;
◆ m_edges
std::map<int,std::vector<range_index_t> > HIEventShapeIndex::m_edges |
|
private |
◆ m_size
unsigned int HIEventShapeIndex::m_size |
|
private |
The documentation for this class was generated from the following files: