33 std::set<unsigned int> used_indices;
34 for(
int ybin=1; ybin<h2->GetNbinsY(); ybin++)
36 auto mItr=
m_edges.emplace_hint(
m_edges.end(),ybin-1,std::vector<range_index_t>());
37 for(
int xbin=1; xbin<h2->GetNbinsX(); xbin++)
39 if(h2->GetBinContent(xbin,ybin) < 0)
continue;
40 unsigned int v=h2->GetBinContent(xbin,ybin);
45 auto sItr=used_indices.find(
v);
46 if(sItr==used_indices.end()) used_indices.insert(
v);
55 mItr->second.push_back(
range_index_t(h2->GetXaxis()->GetBinLowEdge(xbin),h2->GetXaxis()->GetBinUpEdge(xbin),
v));
76 mItr->second[eb].index=
index;
87 unsigned int num_eta_bins=
static_cast<unsigned int>(
std::round(std::abs((emax-emin)/deta)));
89 for(
unsigned int k=0;
k<num_eta_bins;
k++)
95 mItr->second[
k+num_eta_bins].eta_max=
roundToTenth(emin+
k*deta+deta);
98 index+=2*num_eta_bins;
114 const std::vector<range_index_t>&
vec=mItr->second;
115 unsigned int vsize=
vec.size();
119 std::cerr <<
"Layer " <<
layer <<
" has no range in calorimeter" << std::endl;
120 throw std::range_error(
"Bad binning request");
127 float abs_eta=std::abs(
eta);
131 if(abs_eta < rmin) eta_c=rmin+std::copysign(1
e-2,
eta);
132 else if(abs_eta > rmax) eta_c=rmax-std::copysign(1
e-2,
eta);
135 unsigned int pIndex=0;
136 for(; pIndex < vsize-1; pIndex++)
142 return (etaIndex) ? pIndex :
vec.at(pIndex).index;
158 if(shape_container==
nullptr)
167 return shape_container->
at(
bin);
172 if(shape_container==
nullptr)
181 return shape_container->
at(
bin);
191 return shape_container->
at(
bin);
201 std::cerr <<
"Layer " <<
layer <<
" has no binning specification" << std::endl;
202 throw std::range_error(
"Bad binning request");
215 bool isEmpty=(shape_container->
size()==0);
226 for(
auto ri : pp.second)
233 shape_container->operator[](ri.index)=
slice;
235 else slice=shape_container->
at(ri.index);
237 slice->setEtaMin(ri.eta_min);
238 slice->setEtaMax(ri.eta_max);
239 slice->setLayer(pp.first);
240 slice->etCos().assign(num_harmonics,0);
241 slice->etSin().assign(num_harmonics,0);
249 std::stringstream
ss;
253 for(
const auto & ri : pp.second)
255 ss << std::setw(10) << pp.first
256 << std::setw(10) << ri.eta_min
257 << std::setw(10) << ri.eta_max
258 << std::setw(10) << ri.index