00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #include "BCH1D.h"
00011 #include "BCMath.h"
00012
00013 #include <TH2.h>
00014 #include <TLine.h>
00015 #include <TPolyLine.h>
00016 #include <TPaveLabel.h>
00017 #include <TLatex.h>
00018 #include <TError.h>
00019 #include <TCanvas.h>
00020 #include <TMarker.h>
00021 #include <TLegend.h>
00022
00023
00024
00025 BCH1D::BCH1D()
00026 {
00027
00028 fHistogram = 0;
00029 fDefaultCLLimit = 95.;
00030
00031 fModeFlag = 0;
00032 }
00033
00034
00035
00036 BCH1D::~BCH1D()
00037 {
00038
00039 if (fHistogram)
00040 delete fHistogram;
00041
00042 }
00043
00044
00045
00046 double BCH1D::GetMode()
00047 {
00048
00049 return fHistogram -> GetBinCenter(fHistogram -> GetMaximumBin());
00050
00051 }
00052
00053
00054
00055 double BCH1D::GetQuantile(double probability)
00056 {
00057
00058 int nquantiles = 1;
00059 double quantiles[1];
00060 double probsum[1];
00061
00062 probsum[0] = probability;
00063
00064
00065
00066 fHistogram -> GetQuantiles(nquantiles, quantiles, probsum);
00067
00068 return quantiles[0];
00069
00070 }
00071
00072
00073
00074 double BCH1D::GetIntegral(double valuemin, double valuemax)
00075 {
00076
00077 double integral = 0;
00078
00079 int binmin = fHistogram -> FindBin(valuemin);
00080 int binmax = fHistogram -> FindBin(valuemax);
00081
00082
00083
00084 integral = fHistogram -> Integral(binmin, binmax);
00085
00086 return integral;
00087
00088 }
00089
00090
00091
00092 double BCH1D::GetPValue(double probability)
00093 {
00094
00095
00096
00097
00098 double integral = fHistogram -> Integral(1, fHistogram -> FindBin(probability));
00099
00100 return integral;
00101
00102 }
00103
00104
00105
00106 void BCH1D::SetDefaultCLLimit(double limit)
00107 {
00108
00109
00110
00111 if(limit>=100. || limit<68.)
00112 BCLog::Out(BCLog::warning,BCLog::warning,
00113 Form("BCH1D::SetDefaultCLLimit. Value %.1f out of range. Keeping default %.1f%% CL limit.",limit,fDefaultCLLimit));
00114
00115
00116
00117 else
00118 fDefaultCLLimit = limit;
00119
00120 }
00121
00122
00123
00124 void BCH1D::Print(const char * filename, int options, double ovalue, int ww, int wh)
00125 {
00126 char file[256];
00127 int i=0;
00128 while(i<255 && *filename!='\0')
00129 file[i++]=*filename++;
00130 file[i]='\0';
00131
00132
00133 fHistogram -> SetLineWidth(1);
00134
00135
00136 TCanvas * c;
00137 if(ww > 0 && wh > 0)
00138 c = new TCanvas("c","c",ww,wh);
00139 else
00140 c = new TCanvas("c","c");
00141
00142 c -> cd();
00143
00144 this->Draw(options, ovalue);
00145
00146 gPad->RedrawAxis();
00147
00148
00149 c -> Print(file);
00150 }
00151
00152
00153
00154 void BCH1D::Draw(int options, double ovalue)
00155 {
00156 double min, max;
00157 double mode;
00158 double thismode = this->GetMode();
00159
00160 int nbins = fHistogram->GetNbinsX();
00161
00162 fHistogram->Scale(1./fHistogram->Integral("width"));
00163
00164 if(fModeFlag)
00165 mode=fMode;
00166 else
00167 mode=thismode;
00168
00169
00170 TLine * line;
00171
00172
00173 switch(options)
00174 {
00175
00176
00177 case 0:
00178
00179 if (fabs(ovalue) >= 100 || fabs(ovalue) < 68)
00180 {
00181 min = this -> GetQuantile(.16);
00182 max = this -> GetQuantile(.84);
00183
00184
00185
00186 if ( fHistogram -> FindBin(thismode) == fHistogram -> GetNbinsX() )
00187 {
00188 min = this -> GetQuantile(1.-(double)fDefaultCLLimit/100.);
00189 max = fHistogram->GetXaxis()->GetXmax();
00190 ovalue = fDefaultCLLimit;
00191 }
00192
00193 else if ( fHistogram->FindBin(thismode)==1)
00194 {
00195 min = fHistogram->GetXaxis()->GetXmin();
00196 max = this -> GetQuantile((double)fDefaultCLLimit/100.);
00197 ovalue = -fDefaultCLLimit;
00198 }
00199 }
00200
00201 else if(ovalue < 0)
00202 {
00203 min = fHistogram->GetXaxis()->GetXmin();
00204 max = this -> GetQuantile(-ovalue/100.);
00205 }
00206 else
00207 {
00208 min = this -> GetQuantile((1-ovalue)/100.);
00209 max = fHistogram->GetXaxis()->GetXmax();
00210 }
00211
00212
00213 this->DrawShadedLimits(mode, min, max, ovalue);
00214
00215 break;
00216
00217
00218 case 1:
00219
00220 fHistogram -> Draw();
00221 min = fHistogram->GetBinLowEdge(1);
00222 max = fHistogram->GetBinLowEdge(nbins+1);
00223 if(min<=ovalue && ovalue<=max)
00224 {
00225 line = new TLine();
00226 line -> SetLineColor(kRed);
00227 line -> DrawLine(ovalue, 0., ovalue, 1.05 * fHistogram -> GetMaximum());
00228 }
00229
00230 break;
00231
00232
00233 case 2:
00234
00235 if(ovalue<50)
00236 ovalue = 68.;
00237
00238 this->GetSmallestInterval(min, max, ovalue/100.);
00239 this->DrawShadedLimits(mode, min, max, 0.);
00240
00241 break;
00242
00243
00244 case 3:
00245
00246 if(ovalue<50)
00247 ovalue = 68.;
00248
00249 this -> DrawSmallest(mode,ovalue);
00250
00251 break;
00252
00253
00254 default:
00255
00256 BCLog::Out(BCLog::warning, BCLog::warning, Form("BCH1D::Draw. Invalid option %d",options));
00257 break;
00258 }
00259
00260 }
00261
00262
00263
00264 void BCH1D::DrawShadedLimits(double mode, double min, double max, double limit)
00265 {
00266
00267 double maximum = fHistogram -> GetMaximum();
00268
00269 double x0 = mode;
00270 double y0 = fHistogram->GetBinContent( fHistogram->FindBin(mode) );
00271
00272 double x1 = fHistogram->GetMean();
00273 double y1 = fHistogram->GetBinContent( fHistogram->FindBin(x1) );
00274
00275 double x2 = this -> GetQuantile(.5);
00276 double y2 = fHistogram->GetBinContent( fHistogram->FindBin(x2) );
00277
00278 double ysize = maximum*1.3;
00279
00280 double xmin = fHistogram->GetXaxis()->GetXmin();
00281 double xmax = fHistogram->GetXaxis()->GetXmax();
00282
00283
00284
00285 TH2D * hsc = new TH2D(Form("h2scale_%s_%d",fHistogram->GetName(),BCLog::GetHIndex()),"",
00286 10, xmin, xmax, 10, 0., ysize);
00287 hsc -> SetStats(0);
00288 hsc -> SetXTitle(fHistogram->GetXaxis()->GetTitle());
00289 hsc -> SetYTitle(fHistogram->GetYaxis()->GetTitle());
00290 hsc -> Draw();
00291
00292
00293 fHistogram -> SetLineWidth(1);
00294 fHistogram -> Draw("same");
00295
00296
00297 TH1D * hist_shaded = this->GetSubHisto(min,max,Form("%s_sub_%d",fHistogram->GetName(),BCLog::GetHIndex()));
00298 hist_shaded -> SetFillStyle(1001);
00299 hist_shaded -> SetFillColor(kYellow);
00300
00301
00302 hist_shaded -> Draw("same");
00303
00304 gPad->RedrawAxis();
00305
00306
00307 TPolyLine * tmax;
00308
00309 double dx = 0.01*(xmax-xmin);
00310 double dy = 0.04*(ysize);
00311 y0+=dy/5.;
00312 double tmax_x[] = {x0, x0 + dx, x0 - dx, x0};
00313 double tmax_y[] = {y0, y0 + dy, y0 + dy, y0};
00314 tmax = new TPolyLine(4,tmax_x,tmax_y);
00315 tmax->SetLineColor(kRed);
00316 tmax->SetLineWidth(1);
00317 tmax->SetFillColor(kRed);
00318 tmax->Draw();
00319 tmax->Draw("f");
00320
00321
00322
00323 TPolyLine * tmean;
00324
00325 y1+=dy/5.;
00326
00327
00328 double tmean_x[] = {x1, x1 + dx, x1 , x1 - dx, x1};
00329 double tmean_y[] = {y1, y1 + dy/2., y1 + dy, y1 + dy/2., y1};
00330 tmean = new TPolyLine(5,tmean_x,tmean_y);
00331 tmean->SetLineColor(kBlue);
00332
00333 tmean->SetLineWidth(1);
00334
00335 tmean->Draw();
00336
00337
00338
00339
00340
00341
00342
00343
00344
00345
00346
00347
00348
00349
00350
00351
00352
00353
00354
00355
00356
00357
00358 TLine * line;
00359 line = new TLine();
00360 line -> SetLineStyle(2);
00361 line -> SetLineColor(kGreen+2);
00362 line -> DrawLine(x2, 0., x2, y2);
00363
00364
00365
00366
00367
00368 double delta_max = fmax(fabs(max-x1),fabs(x1-min));
00369
00370 int sd = 2 + (int)log10(fabs(x1/delta_max));
00371
00372 if( (int)log10(x1) > (int)log10(delta_max) )
00373 sd++;
00374
00375
00376 TLatex * tmax_text = new TLatex();
00377 tmax_text->SetTextSize(0.045);
00378 tmax_text->SetTextFont(62);
00379 tmax_text->SetTextAlign(22);
00380
00381
00382 double xprint=(xmax+xmin)/2.;
00383
00384 double yprint=ysize*(1-1.4*tmax_text->GetTextSize());
00385
00386 if(fabs(limit)<50)
00387 tmax_text->DrawLatex(xprint,yprint,
00388 Form( Form("%%s^{med} = %%.%dg ^{+%%.2g}_{ -%%.2g}",sd),
00389 fHistogram->GetXaxis()->GetTitle(), x2, max-x2, x2-min));
00390
00391 else if (limit<0)
00392 tmax_text->DrawLatex(xprint,yprint,
00393 Form( Form("%%s (%d%%%% prob.) < %%.4g",-(int)limit),
00394 fHistogram->GetXaxis()->GetTitle(), max));
00395
00396 else if (limit>0)
00397 tmax_text->DrawLatex(xprint,yprint,
00398 Form( Form("%%s (%d%%%% prob.) > %%.4g",(int)limit),
00399 fHistogram->GetXaxis()->GetTitle(), min));
00400
00401
00402
00403
00404
00405
00406
00407
00408
00409
00410
00411
00412
00413
00414
00415
00416
00417
00418
00419
00420
00421 }
00422
00423
00424
00425 void BCH1D::DrawSmallest(double mode, double prob, bool drawmean)
00426 {
00427
00428 TPolyLine * tmax;
00429
00430 double x0 = mode;
00431 double y0 = fHistogram->GetBinContent( fHistogram->FindBin(mode) );
00432 double xmin = fHistogram->GetXaxis()->GetXmin();
00433 double xmax = fHistogram->GetXaxis()->GetXmax();
00434 double ysize = 1.3 * fHistogram -> GetMaximum();
00435
00436 double x1 = fHistogram->GetMean();
00437 double y1 = fHistogram->GetBinContent( fHistogram->FindBin(x1) );
00438
00439 double x2 = this -> GetQuantile(.5);
00440 double y2 = fHistogram->GetBinContent( fHistogram->FindBin(x2) );
00441
00442 double dx = 0.01*(xmax-xmin);
00443 double dy = 0.04*(ysize);
00444 double tmax_x[] = {x0, x0 + dx, x0 - dx, x0};
00445 double tmax_y[] = {y0, y0 + dy, y0 + dy, y0};
00446 tmax = new TPolyLine(4,tmax_x,tmax_y);
00447 tmax->SetLineColor(kRed);
00448 tmax->SetFillColor(kRed);
00449
00450
00451 TH2D * hsc = new TH2D(Form("h2scale_%s_%d",fHistogram->GetName(),BCLog::GetHIndex()),"",
00452 10, xmin, xmax, 10, 0., ysize);
00453 hsc -> SetStats(0);
00454 hsc -> SetXTitle(fHistogram->GetXaxis()->GetTitle());
00455 hsc -> SetYTitle(fHistogram->GetYaxis()->GetTitle());
00456 hsc -> Draw();
00457
00458
00459 TH1D * hist_temp1 = (TH1D*) fHistogram -> Clone();
00460 hist_temp1 -> Scale(1.0/fHistogram -> Integral("width"));
00461 hist_temp1 -> SetFillColor(kYellow);
00462 hist_temp1 -> SetFillStyle(1001);
00463
00464
00465 TH1D * hist_temp2 = (TH1D*) fHistogram -> Clone();
00466 hist_temp2 -> Scale(1.0/fHistogram -> Integral("width"));
00467
00468
00469 hist_temp1 -> Reset();
00470
00471
00472
00473 prob /= 100.;
00474
00475
00476 double sum = 0.0;
00477
00478 int n=0;
00479 int nbins=fHistogram->GetNbinsX();
00480
00481
00482 while (sum < prob && n < nbins)
00483 {
00484 n++;
00485
00486
00487 int bin = hist_temp2 -> GetMaximumBin();
00488
00489
00490 double val = hist_temp2 -> GetBinContent(bin);
00491 hist_temp1 -> SetBinContent(bin, val);
00492
00493
00494 hist_temp2 -> SetBinContent(bin, 0.0);
00495
00496
00497 sum += val * hist_temp2->GetBinWidth(bin);
00498 }
00499
00500
00501 hist_temp1 -> Scale(fHistogram -> Integral("width"));
00502
00503
00504 fHistogram -> Draw("same");
00505 hist_temp1 -> Draw("same");
00506
00507
00508 tmax->Draw("f");
00509
00510 if(drawmean)
00511 {
00512
00513
00514 TPolyLine * tmean;
00515
00516 y1+=dy/5.;
00517
00518
00519 double tmean_x[] = {x1, x1 + dx, x1 , x1 - dx, x1};
00520 double tmean_y[] = {y1, y1 + dy/2., y1 + dy, y1 + dy/2., y1};
00521 tmean = new TPolyLine(5,tmean_x,tmean_y);
00522 tmean->SetLineColor(kBlue);
00523
00524 tmean->SetLineWidth(1);
00525
00526 tmean->Draw();
00527
00528
00529 TLine * line;
00530 line = new TLine();
00531 line -> SetLineStyle(2);
00532 line -> SetLineColor(kGreen+2);
00533 line -> DrawLine(x2, 0., x2, y2);
00534 }
00535
00536
00537
00538 delete hist_temp2;
00539
00540 }
00541
00542
00543
00544 void BCH1D::GetSmallestInterval(double & min, double & max, double content)
00545 {
00546
00547 if(content<=0. || content>= 1.)
00548 return;
00549
00550 int nbins = fHistogram -> GetNbinsX();
00551
00552 double factor = fHistogram->Integral("width");
00553 if(factor==0)
00554 return;
00555
00556
00557
00558 fHistogram->Scale(1./factor);
00559
00560 double xmin = fHistogram->GetXaxis()->GetXmin();
00561 double xmax = fHistogram->GetXaxis()->GetXmax();
00562 double width = xmax - xmin;
00563
00564 double xdown=xmin;
00565 double xup=xmax;
00566
00567 int ndiv = 100;
00568 if(nbins<100)
00569 ndiv = 1000;
00570 if(nbins>1000)
00571 ndiv = 10;
00572
00573 int warn=0;
00574
00575
00576
00577 for(int i=1;i<nbins+1;i++)
00578 {
00579 if(fHistogram->Integral(i,nbins,"width") < content)
00580 break;
00581
00582
00583
00584 double firstbinwidth = fHistogram->GetBinWidth(i);
00585
00586
00587
00588
00589 for(int j=0;j<ndiv;j++)
00590 {
00591 double dxdown = (double)(ndiv-j)/(double)ndiv * firstbinwidth;
00592 xdown = fHistogram->GetBinLowEdge(i) + firstbinwidth - dxdown;
00593 double integral = dxdown * fHistogram->GetBinContent(i);
00594
00595 if(integral>content)
00596 {
00597
00598
00599 xup = xdown + content / fHistogram->GetBinContent(i);
00600 warn = 1;
00601 }
00602 else
00603 {
00604 for(int k=i+1;k<nbins+1;k++)
00605 {
00606 double thisbin = fHistogram->GetBinContent(k) * fHistogram->GetBinWidth(k);
00607
00608 if(integral+thisbin==content)
00609 {
00610 xup = fHistogram->GetBinLowEdge(k+1);
00611 break;
00612 }
00613
00614 if(integral+thisbin>content)
00615 {
00616 xup = fHistogram->GetBinLowEdge(k) + (content-integral)/thisbin * fHistogram->GetBinWidth(k);
00617 integral += thisbin * (xup-fHistogram->GetBinLowEdge(k))/fHistogram->GetBinWidth(k);
00618 break;
00619 }
00620
00621 integral += thisbin;
00622 }
00623 }
00624 if(integral < content)
00625 continue;
00626 if(xup - xdown < width)
00627 {
00628
00629 width = xup - xdown;
00630 xmin = xdown;
00631 xmax = xup;
00632 }
00633 }
00634 }
00635
00636 if(warn)
00637 {
00638 BCLog::Out(BCLog::warning,BCLog::warning,
00639 Form("BCH1D::GetSmallestInterval. The requested content of %d%% fits within one bin.",(int)(content*100)));
00640 BCLog::Out(BCLog::warning,BCLog::warning,
00641 "BCH1D::GetSmallestInterval. MAKE FINER BINNING (OR CHANGE RANGE) !!!");
00642 }
00643
00644
00645
00646 fHistogram->Scale(factor);
00647
00648 min=xmin;
00649 max=xmax;
00650
00651 }
00652
00653
00654
00655 double BCH1D::IntegralWidth(double min, double max)
00656 {
00657 int imin = fHistogram->FindBin(min);
00658 int imax = fHistogram->FindBin(max);
00659
00660 int nbins = fHistogram->GetNbinsX();
00661
00662
00663 if ( imin<1 || imin>nbins || imax<1 || imax>nbins )
00664 return -1.;
00665
00666 if ( imin==imax )
00667 return -1.;
00668
00669
00670 if (imin>imax)
00671 {
00672 int i=imin;
00673 double x=min;
00674 imin=imax, min=max;
00675 imax=i, max=x;
00676 }
00677
00678
00679 double first = ( fHistogram->GetBinLowEdge(imin+1) - min ) * fHistogram->GetBinContent(imin);
00680
00681
00682 double last = ( max - fHistogram->GetBinLowEdge(imax) ) * fHistogram->GetBinContent(imax);
00683
00684
00685 double inbetween=0.;
00686 if(imax-imin>1)
00687 inbetween = fHistogram->Integral(imin+1, imax-1, "width");
00688
00689 return first + inbetween + last;
00690 }
00691
00692
00693
00694 TH1D * BCH1D::GetSubHisto(double min, double max, const char * name)
00695 {
00696 if(min>max)
00697 {
00698 double t=min;
00699 min=max;
00700 max=t;
00701 }
00702
00703 int imin = fHistogram->FindBin(min);
00704 int imax = fHistogram->FindBin(max);
00705
00706 int nbins = fHistogram->GetNbinsX();
00707 double xmin = fHistogram->GetXaxis()->GetXmin();
00708 double xmax = fHistogram->GetXaxis()->GetXmax();
00709
00710 if( min==max || (min<=xmin && max>=xmax) )
00711 {
00712 TH1D * h0 = (TH1D*) fHistogram->Clone(name);
00713 return h0;
00714 }
00715
00716 if (imin<1)
00717 {
00718 imin=1;
00719 min=xmin;
00720 }
00721 if (imax>nbins)
00722 {
00723 imax=nbins;
00724 max=xmax;
00725 }
00726
00727 double * xb = new double[nbins+3];
00728 int n=0;
00729
00730 int domin=1;
00731 int domax=1;
00732
00733 for (int i=1;i<nbins+2;i++)
00734 {
00735 double x0 = fHistogram->GetBinLowEdge(i);
00736
00737 if (min<x0 && domin)
00738 {
00739 xb[n++]=min;
00740 domin=0;
00741 }
00742 else if (min==x0)
00743 domin=0;
00744
00745 if (max<x0 && domax)
00746 {
00747 xb[n++]=max;
00748 domax=0;
00749 }
00750 else if (max==x0)
00751 domax=0;
00752
00753 xb[n++]=x0;
00754
00755 }
00756
00757
00758 TH1D * h0 = new TH1D(name,"",n-1,xb);
00759 for(int i=1;i<n;i++)
00760 {
00761 double x0 = h0->GetBinCenter(i);
00762 if(x0<min || x0>max)
00763 continue;
00764
00765 int bin=fHistogram->FindBin(x0);
00766 h0->SetBinContent(i, fHistogram->GetBinContent(bin));
00767 }
00768
00769 return h0;
00770 }
00771
00772
00773
00774 TH1D * BCH1D::GetSmallestIntervalHistogram(double level)
00775 {
00776
00777
00778 TH1D * hist_yellow = (TH1D*) fHistogram -> Clone();
00779 hist_yellow -> Reset();
00780 hist_yellow -> SetFillStyle(1001);
00781 hist_yellow -> SetFillColor(kYellow);
00782
00783
00784 TH1D * hist_temp = (TH1D*) fHistogram -> Clone();
00785 double factor = hist_temp -> Integral("");
00786
00787 if(factor == 0)
00788 return 0;
00789
00790 hist_temp -> Scale(1.0 / factor);
00791
00792
00793
00794
00795
00796
00797
00798
00799 double sumprob = 0.0;
00800
00801 while (sumprob < level)
00802 {
00803
00804
00805 int bin = hist_temp -> GetMaximumBin();
00806 double value = hist_temp -> GetMaximum();
00807
00808
00809 hist_yellow -> SetBinContent(bin, 1.0);
00810
00811
00812 hist_temp -> SetBinContent(bin, 0.0);
00813
00814
00815 sumprob += value;
00816 }
00817
00818 delete hist_temp;
00819
00820 return hist_yellow;
00821
00822 }
00823
00824
00825
00826 std::vector <double> BCH1D::GetSmallestIntervals(double content)
00827 {
00828
00829 std::vector <double> v;
00830
00831 TH1D * hist = 0;
00832
00833 hist = this -> GetSmallestIntervalHistogram(content);
00834
00835 int nbins = hist -> GetNbinsX();
00836 int ninter = 0;
00837 int lastbin = -1;
00838
00839 double max = -1;
00840 double localmax = -1;
00841 double localmaxpos = -1;
00842
00843 double localint = 0;
00844
00845 bool flag = false;
00846
00847 for (int i = 1; i <= nbins; ++i)
00848 {
00849
00850 if (!flag && hist -> GetBinContent(i) > 0.)
00851 {
00852 flag = true;
00853 v.push_back(hist -> GetBinLowEdge(i));
00854
00855
00856 lastbin = i;
00857
00858
00859 ninter++;
00860
00861
00862 localmax = fHistogram -> GetBinContent(i);
00863 localmaxpos = hist -> GetBinLowEdge(i);
00864
00865
00866 localint = 0;
00867 }
00868
00869
00870 if ((flag && !(hist -> GetBinContent(i) > 0.)) || (flag && i == nbins))
00871 {
00872 flag = false;
00873 v.push_back(hist -> GetBinLowEdge(i) + hist -> GetBinWidth(i));
00874
00875
00876 if (i == nbins && localmax < fHistogram -> GetBinContent(i))
00877 localmaxpos = hist -> GetBinCenter(i) + 0.5 * hist -> GetBinWidth(i);
00878
00879
00880 if (localmax > max)
00881 max = localmax;
00882
00883
00884 v.push_back(localmax);
00885 v.push_back(localmaxpos);
00886
00887
00888 v.push_back(localint);
00889 }
00890
00891
00892 if (i < nbins && localmax < fHistogram -> GetBinContent(i))
00893 {
00894 localmax = fHistogram -> GetBinContent(i);
00895 localmaxpos = hist -> GetBinCenter(i);
00896 }
00897
00898
00899 localint += fHistogram -> GetBinContent(i) / fHistogram -> Integral();
00900 }
00901
00902
00903 for (int i = 0; i < ninter; ++i)
00904 v[i*5+2] = v.at(i*5+2) / max;
00905
00906 return v;
00907
00908 }
00909
00910