17 :
SG::AuxElement(),m_binWidthX(0),m_binWidthY(0) {
22 initialize(nbins_x, min_x, max_x, nbins_y, min_y, max_y);
37 void
TrigHisto2D_v1::
initialize(
unsigned int nbins_x,
float min_x,
float max_x,
unsigned int nbins_y,
float min_y,
float max_y){
41 this->makePrivateStore();
49 setContents(std::vector<float>(contents_size,0.));
59 m_binWidthX = (max_x - min_x)/((
float)nbins_x);
66 m_binWidthY = (max_y - min_y)/((
float)nbins_y);
75 unsigned int ibin_x =
findBinX(value_x);
76 unsigned int ibin_y =
findBinY(value_y);
82 acc_contents(*this).at(ibin)+=
weight;
113 unsigned int ibin, ibin_x, ibin_y, ibin_x_selected, ibin_y_selected;
119 ibin_x_selected =
findBinX(value_x);
122 ibin_y_selected =
findBinY(value_y);
132 for(ibin_x = 0; ibin_x <= ibin_x_selected; ibin_x++) {
133 for(ibin_y = 0; ibin_y <= ibin_y_selected; ibin_y++) {
134 ibin = ibin_y*(
nbinsX()+2) + ibin_x;
135 entries += acc_contents(*this).at(ibin);
141 for(ibin_y = 0; ibin_y <= ibin_y_selected; ibin_y++) {
143 entries += acc_contents(*this).at(ibin);
148 for(ibin_x = 0; ibin_x <= ibin_x_selected; ibin_x++) {
151 entries += acc_contents(*this).at(ibin);
159 entries += acc_contents(*this).at(ibin);
173 unsigned int ibin = 0;
191 unsigned int ibin = 0;
210 for(
std::vector<float>::iterator contents_iter = acc_contents(*this).begin(); contents_iter !=acc_contents(*this).end(); ++contents_iter)
217 std::cout<<
"Dump contets vector of size:: "<<acc_contents(*this).size()<<std::endl;
218 for(
unsigned int i = 0 ;
i < acc_contents(*this).size();
i++)
219 std::cout<<acc_contents(*this).at(
i)<<
" ";
220 std::cout<<std::endl;
222 std::cout<<
"NbinX:: "<<
nbinsX()<<
"\tRangeX:: ["<<
minX()<<
","<<
maxX()<<
"]"<<std::endl;
223 std::cout<<
"NbinY:: "<<
nbinsY()<<
"\tRangeY:: ["<<
minY()<<
","<<
maxY()<<
"]"<<std::endl;
227 std::cout<<std::endl;
232 std::cout<<std::endl;