Changeset 9851 for trunk/Mars
- Timestamp:
- 08/12/10 09:43:02 (14 years ago)
- Location:
- trunk/Mars
- Files:
-
- 35 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Mars/Changelog
r9850 r9851 28 28 - added new data members to Clear function 29 29 30 * mimage/MHHillas.cc, mimage/MHHillasExt.cc, mimage/MHNewImagePar.cc, 31 mimage/MHVsSize.cc, mimage/MHHillasSrc.cc, mimage/MHImagePar.cc, 32 mhcalib/MHGausEvents.cc, mhflux/MHThetaSq.cc, mhflux/MHAlpha.cc, 33 mhflux/MHFalseSource.cc, mhflux/MHEffectiveOnTime.cc, 34 mhflux/MHCollectionArea.cc, mhflux/MHThetaSqN.cc, mhflux/MHDisp.cc, 35 mhflux/MHThreshold.cc, mhflux/MHEnergyEst.cc, mjtrain/MJTrainDisp.cc, 36 mtools/MHSimulatedAnnealing.cc, mmuon/MHSingleMuon.cc, 37 mmuon/MHMuonPar.cc, mpointing/MHSrcPosCam.cc, 38 mpedestal/MHPedestalCor.cc, mhist/MHCamEventRot.cc, 39 mhist/MHStarMap.cc, mjobs/MJSpectrum.cc, mbadpixels/MHBadPixels.cc, 40 mfbase/MFEventSelector2.cc, mhbase/MBinning.cc, mhbase/MH.[h,cc], 41 mhbase/MH3.cc, mhbase/MHMatrix.cc, msim/MHPhotonEvent.cc: 42 - changes MH::SetBinning and similar functions to take references 43 instead of pointers 44 - for the time being wrappers are kept not to break macros 45 30 46 31 47 -
trunk/Mars/NEWS
r9846 r9851 21 21 * Added a new class MJTrainImpact to estimate the impact parameter by use 22 22 of a random forest 23 24 * Changed MH::SetBinning and similar functions to take references instead 25 of pointers. Except for SetBinning(TH1&, const TH1&), which was renamed 26 to CopyBinning(const TH1&, TH1&) wrapper functions are provided so that 27 old macros should still work. 28 WARNING: These wrappers might be removed in future releases. 23 29 24 30 ;ceres: -
trunk/Mars/mbadpixels/MHBadPixels.cc
r9153 r9851 80 80 fBinsPix->SetEdges(578, -0.5, 577.5); // pixel id 81 81 82 SetBinning( fBadId, fBinsTheta,fBinsPix);83 SetBinning( fBadN, fBinsTheta,fBinsPix);82 SetBinning(*fBadId, *fBinsTheta, *fBinsPix); 83 SetBinning(*fBadN, *fBinsTheta, *fBinsPix); 84 84 85 85 //----------------------------------------- … … 151 151 const UInt_t npix1 = fPedPhot->GetSize()+1; 152 152 //*fLog << "MHBadPixels::SetupFill(); npix1 = " << npix1 << endl; 153 MBinning binspix("BinningPixel"); 154 binspix.SetEdges(npix1, -0.5, npix1-0.5); 153 const MBinning binspix(npix1, -0.5, npix1-0.5); 155 154 156 155 // Set binnings in histograms 157 SetBinning( fBadId, binstheta, &binspix);158 SetBinning( fBadN, binstheta, &binspix);156 SetBinning(*fBadId, *binstheta, binspix); 157 SetBinning(*fBadN, *binstheta, binspix); 159 158 160 159 *fLog << "MHBadPixels::SetupFill(); binnings were set" << endl; -
trunk/Mars/mfbase/MFEventSelector2.cc
r8106 r9851 196 196 197 197 // duplicate the fHistNom histogram 198 hist = (MH3*)fHistNom->New();198 hist = static_cast<MH3*>(fHistNom->New()); 199 199 200 200 // copy binning from one histogram to the other one 201 MH::SetBinning( &hist->GetHist(), &fHistNom->GetHist());201 MH::SetBinning(hist->GetHist(), fHistNom->GetHist()); 202 202 203 203 return hist->GetHist(); -
trunk/Mars/mhbase/MBinning.cc
r9369 r9851 537 537 } 538 538 539 MH::SetBinning( &h,this);539 MH::SetBinning(h, *this); 540 540 } 541 541 -
trunk/Mars/mhbase/MH.cc
r9414 r9851 20 20 ! Author(s): Thomas Bretz 07/2001 <mailto:tbretz@astro.uni-wuerzburg.de> 21 21 ! 22 ! Copyright: MAGIC Software Development, 2000-20 0822 ! Copyright: MAGIC Software Development, 2000-2010 23 23 ! 24 24 ! … … 256 256 // labels. 257 257 // 258 void MH::SetBinning(TH1 *h, const MBinning *binsx)258 void MH::SetBinning(TH1 &h, const MBinning &binsx) 259 259 { 260 260 // 261 261 // Another strange behaviour: TAxis::Set deletes the axis title! 262 262 // 263 TAxis &x = *h ->GetXaxis();263 TAxis &x = *h.GetXaxis(); 264 264 265 265 #if ROOT_VERSION_CODE < ROOT_VERSION(3,03,03) … … 278 278 // TH1D::fNcells must be set correctly. 279 279 // 280 h ->SetBins(binsx->GetNumBins(), 0, 1);280 h.SetBins(binsx.GetNumBins(), 0, 1); 281 281 282 282 // … … 284 284 // in one of the two given histograms 285 285 // 286 x.Set(binsx ->GetNumBins(), binsx->GetEdges());286 x.Set(binsx.GetNumBins(), binsx.GetEdges()); 287 287 288 288 // All this is reset by TAxis::Set … … 292 292 #else 293 293 if (!x.GetLabels()) 294 h ->SetBins(binsx->GetNumBins(), binsx->GetEdges());294 h.SetBins(binsx.GetNumBins(), binsx.GetEdges()); 295 295 #endif 296 296 … … 307 307 // the binning is set according to the labels. 308 308 // 309 void MH::SetBinning(TH2 *h, const MBinning *binsx, const MBinning *binsy)310 { 311 TAxis &x = *h ->GetXaxis();312 TAxis &y = *h ->GetYaxis();313 314 const MBinning bx(GetBinningForLabels(x, binsx));315 const MBinning by(GetBinningForLabels(y, binsy));309 void MH::SetBinning(TH2 &h, const MBinning &binsx, const MBinning &binsy) 310 { 311 TAxis &x = *h.GetXaxis(); 312 TAxis &y = *h.GetYaxis(); 313 314 const MBinning bx(GetBinningForLabels(x, &binsx)); 315 const MBinning by(GetBinningForLabels(y, &binsy)); 316 316 317 317 // … … 337 337 // TH1D::fNcells must be set correctly. 338 338 // 339 h ->SetBins(bx.GetNumBins(), 0, 1,340 339 h.SetBins(bx.GetNumBins(), 0, 1, 340 by.GetNumBins(), 0, 1); 341 341 342 342 // … … 355 355 y.SetTimeFormat(tfy); 356 356 #else 357 if (h ->InheritsFrom(TProfile2D::Class()))358 { 359 h ->SetBins(bx.GetNumBins(), 0, 1,360 361 362 h ->SetBinsLength();357 if (h.InheritsFrom(TProfile2D::Class())) 358 { 359 h.SetBins(bx.GetNumBins(), 0, 1, 360 by.GetNumBins(), 0, 1); 361 362 h.SetBinsLength(); 363 363 364 364 x.Set(bx.GetNumBins(), bx.GetEdges()); … … 366 366 } 367 367 else 368 h ->SetBins(bx.GetNumBins(), bx.GetEdges(),369 368 h.SetBins(bx.GetNumBins(), bx.GetEdges(), 369 by.GetNumBins(), by.GetEdges()); 370 370 #endif 371 371 … … 385 385 // the binning is set according to the labels. 386 386 // 387 void MH::SetBinning(TH3 *h, const MBinning *binsx, const MBinning *binsy, const MBinning *binsz)387 void MH::SetBinning(TH3 &h, const MBinning &binsx, const MBinning &binsy, const MBinning &binsz) 388 388 { 389 389 // 390 390 // Another strange behaviour: TAxis::Set deletes the axis title! 391 391 // 392 TAxis &x = *h ->GetXaxis();393 TAxis &y = *h ->GetYaxis();394 TAxis &z = *h ->GetZaxis();395 396 const MBinning bx(GetBinningForLabels(x, binsx));397 const MBinning by(GetBinningForLabels(y, binsy));398 const MBinning bz(GetBinningForLabels(z, binsz));392 TAxis &x = *h.GetXaxis(); 393 TAxis &y = *h.GetYaxis(); 394 TAxis &z = *h.GetZaxis(); 395 396 const MBinning bx(GetBinningForLabels(x, &binsx)); 397 const MBinning by(GetBinningForLabels(y, &binsy)); 398 const MBinning bz(GetBinningForLabels(z, &binsz)); 399 399 400 400 #if ROOT_VERSION_CODE < ROOT_VERSION(3,03,03) … … 422 422 // TH1D::fNcells must be set correctly. 423 423 // 424 h ->SetBins(bx.GetNumBins(), 0, 1,425 426 424 h.SetBins(bx.GetNumBins(), 0, 1, 425 by.GetNumBins(), 0, 1, 426 bz.GetNumBins(), 0, 1); 427 427 428 428 // … … 462 462 // Applies given binning (the n+1 edges) to the axis of a 1D-histogram 463 463 // 464 void MH::SetBinning(TH1 *h, const TArrayD &binsx)464 void MH::SetBinning(TH1 &h, const TArrayD &binsx) 465 465 { 466 466 MBinning bx; 467 467 bx.SetEdges(binsx); 468 SetBinning(h, &bx);468 SetBinning(h, bx); 469 469 } 470 470 … … 474 474 // 2D-histogram 475 475 // 476 void MH::SetBinning(TH2 *h, const TArrayD &binsx, const TArrayD &binsy)476 void MH::SetBinning(TH2 &h, const TArrayD &binsx, const TArrayD &binsy) 477 477 { 478 478 MBinning bx; … … 480 480 bx.SetEdges(binsx); 481 481 by.SetEdges(binsy); 482 SetBinning(h, &bx, &by);482 SetBinning(h, bx, by); 483 483 } 484 484 … … 488 488 // 3D-histogram 489 489 // 490 void MH::SetBinning(TH3 *h, const TArrayD &binsx, const TArrayD &binsy, const TArrayD &binsz)490 void MH::SetBinning(TH3 &h, const TArrayD &binsx, const TArrayD &binsy, const TArrayD &binsz) 491 491 { 492 492 MBinning bx; … … 496 496 by.SetEdges(binsy); 497 497 bz.SetEdges(binsz); 498 SetBinning(h, &bx, &by, &bz);498 SetBinning(h, bx, by, bz); 499 499 } 500 500 … … 504 504 // of a 1D-histogram 505 505 // 506 void MH::SetBinning(TH1 *h, const TAxis *binsx)507 { 508 const Int_t nx = binsx ->GetNbins();506 void MH::SetBinning(TH1 &h, const TAxis &binsx) 507 { 508 const Int_t nx = binsx.GetNbins(); 509 509 510 510 TArrayD bx(nx+1); 511 for (int i=0; i<nx; i++) bx[i] = binsx ->GetBinLowEdge(i+1);512 bx[nx] = binsx ->GetXmax();511 for (int i=0; i<nx; i++) bx[i] = binsx.GetBinLowEdge(i+1); 512 bx[nx] = binsx.GetXmax(); 513 513 514 514 SetBinning(h, bx); … … 520 520 // two axis' of a 2D-histogram 521 521 // 522 void MH::SetBinning(TH2 *h, const TAxis *binsx, const TAxis *binsy)523 { 524 const Int_t nx = binsx ->GetNbins();525 const Int_t ny = binsy ->GetNbins();522 void MH::SetBinning(TH2 &h, const TAxis &binsx, const TAxis &binsy) 523 { 524 const Int_t nx = binsx.GetNbins(); 525 const Int_t ny = binsy.GetNbins(); 526 526 527 527 TArrayD bx(nx+1); 528 528 TArrayD by(ny+1); 529 for (int i=0; i<nx; i++) bx[i] = binsx ->GetBinLowEdge(i+1);530 for (int i=0; i<ny; i++) by[i] = binsy ->GetBinLowEdge(i+1);531 bx[nx] = binsx ->GetXmax();532 by[ny] = binsy ->GetXmax();529 for (int i=0; i<nx; i++) bx[i] = binsx.GetBinLowEdge(i+1); 530 for (int i=0; i<ny; i++) by[i] = binsy.GetBinLowEdge(i+1); 531 bx[nx] = binsx.GetXmax(); 532 by[ny] = binsy.GetXmax(); 533 533 534 534 SetBinning(h, bx, by); … … 540 540 // three axis' of a 3D-histogram 541 541 // 542 void MH::SetBinning(TH3 *h, const TAxis *binsx, const TAxis *binsy, const TAxis *binsz)543 { 544 const Int_t nx = binsx ->GetNbins();545 const Int_t ny = binsy ->GetNbins();546 const Int_t nz = binsz ->GetNbins();542 void MH::SetBinning(TH3 &h, const TAxis &binsx, const TAxis &binsy, const TAxis &binsz) 543 { 544 const Int_t nx = binsx.GetNbins(); 545 const Int_t ny = binsy.GetNbins(); 546 const Int_t nz = binsz.GetNbins(); 547 547 548 548 TArrayD bx(nx+1); 549 549 TArrayD by(ny+1); 550 550 TArrayD bz(nz+1); 551 for (int i=0; i<nx; i++) bx[i] = binsx ->GetBinLowEdge(i+1);552 for (int i=0; i<ny; i++) by[i] = binsy ->GetBinLowEdge(i+1);553 for (int i=0; i<nz; i++) bz[i] = binsz ->GetBinLowEdge(i+1);554 bx[nx] = binsx ->GetXmax();555 by[ny] = binsy ->GetXmax();556 bz[nz] = binsz ->GetXmax();551 for (int i=0; i<nx; i++) bx[i] = binsx.GetBinLowEdge(i+1); 552 for (int i=0; i<ny; i++) by[i] = binsy.GetBinLowEdge(i+1); 553 for (int i=0; i<nz; i++) bz[i] = binsz.GetBinLowEdge(i+1); 554 bx[nx] = binsx.GetXmax(); 555 by[ny] = binsy.GetXmax(); 556 bz[nz] = binsz.GetXmax(); 557 557 558 558 SetBinning(h, bx, by, bz); … … 564 564 // Both histograms must be of the same type: TH1, TH2 or TH3 565 565 // 566 void MH:: SetBinning(TH1 *h, const TH1 *x)567 { 568 if (h ->InheritsFrom(TH3::Class()) && x->InheritsFrom(TH3::Class()))569 { 570 SetBinning( (TH3*)h, x->GetXaxis(), x->GetYaxis(), x->GetZaxis());566 void MH::CopyBinning(const TH1 &x, TH1 &h) 567 { 568 if (h.InheritsFrom(TH3::Class()) && x.InheritsFrom(TH3::Class())) 569 { 570 SetBinning(static_cast<TH3&>(h), *x.GetXaxis(), *x.GetYaxis(), *x.GetZaxis()); 571 571 return; 572 572 } 573 if (h ->InheritsFrom(TH3::Class()) || x->InheritsFrom(TH3::Class()))573 if (h.InheritsFrom(TH3::Class()) || x.InheritsFrom(TH3::Class())) 574 574 return; 575 if (h ->InheritsFrom(TH2::Class()) && x->InheritsFrom(TH2::Class()))576 { 577 SetBinning( (TH2*)h, x->GetXaxis(), x->GetYaxis());575 if (h.InheritsFrom(TH2::Class()) && x.InheritsFrom(TH2::Class())) 576 { 577 SetBinning(static_cast<TH2&>(h), *x.GetXaxis(), *x.GetYaxis()); 578 578 return; 579 579 } 580 if (h ->InheritsFrom(TH2::Class()) || x->InheritsFrom(TH2::Class()))580 if (h.InheritsFrom(TH2::Class()) || x.InheritsFrom(TH2::Class())) 581 581 return; 582 if (h ->InheritsFrom(TH1::Class()) && x->InheritsFrom(TH1::Class()))583 { 584 SetBinning(h, x->GetXaxis());582 if (h.InheritsFrom(TH1::Class()) && x.InheritsFrom(TH1::Class())) 583 { 584 SetBinning(h, *x.GetXaxis()); 585 585 return; 586 586 } … … 652 652 // Scales the binning of one, two or three axis of a histogram by a float f 653 653 // 654 void MH::ScaleAxis(TH1 *h, Double_t fx, Double_t fy, Double_t fz)655 { 656 if (h ->InheritsFrom(TH3::Class()))657 { 658 SetBinning( (TH3*)h,659 ScaleAxis(*h ->GetXaxis(), fx),660 ScaleAxis(*h ->GetYaxis(), fy),661 ScaleAxis(*h ->GetZaxis(), fz));654 void MH::ScaleAxis(TH1 &h, Double_t fx, Double_t fy, Double_t fz) 655 { 656 if (h.InheritsFrom(TH3::Class())) 657 { 658 SetBinning(static_cast<TH3&>(h), 659 ScaleAxis(*h.GetXaxis(), fx), 660 ScaleAxis(*h.GetYaxis(), fy), 661 ScaleAxis(*h.GetZaxis(), fz)); 662 662 return; 663 663 } 664 664 665 if (h ->InheritsFrom(TH2::Class()))666 { 667 SetBinning( (TH2*)h,668 ScaleAxis(*h ->GetXaxis(), fx),669 ScaleAxis(*h ->GetYaxis(), fy));665 if (h.InheritsFrom(TH2::Class())) 666 { 667 SetBinning(static_cast<TH2&>(h), 668 ScaleAxis(*h.GetXaxis(), fx), 669 ScaleAxis(*h.GetYaxis(), fy)); 670 670 return; 671 671 } 672 672 673 if (h->InheritsFrom(TH1::Class())) 674 SetBinning(h, ScaleAxis(*h->GetXaxis(), fx)); 673 SetBinning(h, ScaleAxis(*h.GetXaxis(), fx)); 675 674 } 676 675 … … 683 682 // no binning is applied. 684 683 // 685 Bool_t MH::ApplyBinning(const MParList &plist, TString name, TH1 *h)686 { 687 if (h ->InheritsFrom(TH2::Class()) || h->InheritsFrom(TH3::Class()))688 { 689 gLog << warn << "MH::ApplyBinning: '" << h ->GetName() << "' is not a basic TH1 object... no binning applied." << endl;684 Bool_t MH::ApplyBinning(const MParList &plist, const TString name, TH1 &h) 685 { 686 if (h.InheritsFrom(TH2::Class()) || h.InheritsFrom(TH3::Class())) 687 { 688 gLog << warn << "MH::ApplyBinning: '" << h.GetName() << "' is not a basic TH1 object... no binning applied." << endl; 690 689 return kFALSE; 691 690 } … … 704 703 } 705 704 706 SetBinning(h, bins);705 SetBinning(h, *bins); 707 706 return kTRUE; 708 707 } 709 708 710 Bool_t MH::ApplyBinning(const MParList &plist, TString x, TString y, TH2 *h)709 Bool_t MH::ApplyBinning(const MParList &plist, const TString x, const TString y, TH2 &h) 711 710 { 712 711 const MBinning *binsx = (MBinning*)plist.FindObject("Binning"+x); … … 738 737 739 738 MBinning binsxx, binsyy; 740 binsxx.SetEdges( *h, 'x');741 binsyy.SetEdges( *h, 'y');742 743 SetBinning(h, binsx? binsx:&binsxx, binsy?binsy:&binsyy);739 binsxx.SetEdges(h, 'x'); 740 binsyy.SetEdges(h, 'y'); 741 742 SetBinning(h, binsx?*binsx:binsxx, binsy?*binsy:binsyy); 744 743 745 744 return kTRUE; 746 745 } 747 746 748 Bool_t MH::ApplyBinning(const MParList &plist, TString x, TString y, TString z, TH3 *h)747 Bool_t MH::ApplyBinning(const MParList &plist, const TString x, const TString y, const TString z, TH3 &h) 749 748 { 750 749 const MBinning *binsx = (MBinning*)plist.FindObject("Binning"+x); … … 786 785 787 786 MBinning binsxx, binsyy, binszz; 788 binsxx.SetEdges( *h, 'x');789 binsyy.SetEdges( *h, 'y');790 binszz.SetEdges( *h, 'z');791 792 SetBinning(h, binsx? binsx:&binsxx, binsy?binsy:&binsyy, binsz?binsz:&binszz);787 binsxx.SetEdges(h, 'x'); 788 binsyy.SetEdges(h, 'y'); 789 binszz.SetEdges(h, 'z'); 790 791 SetBinning(h, binsx?*binsx:binsxx, binsy?*binsy:binsyy, binsz?*binsz:binszz); 793 792 794 793 return kTRUE; … … 1189 1188 // Returns the new (real) number of bins 1190 1189 // 1191 Int_t MH::StripZeros(TH1 *h, Int_t nbins)1192 { 1193 TAxis &axe = *h ->GetXaxis();1190 Int_t MH::StripZeros(TH1 &h, Int_t nbins) 1191 { 1192 TAxis &axe = *h.GetXaxis(); 1194 1193 1195 1194 const Int_t min1 = axe.GetFirst(); … … 1205 1204 Int_t min2 = 0; 1206 1205 for (int i=min1; i<=max1; i++) 1207 if (h ->GetBinContent(i) != 0)1206 if (h.GetBinContent(i) != 0) 1208 1207 { 1209 1208 min2 = i; … … 1219 1218 Int_t max2 = 0; 1220 1219 for (int i=max1; i>=min2; i--) 1221 if (h ->GetBinContent(i) != 0)1220 if (h.GetBinContent(i) != 0) 1222 1221 { 1223 1222 max2 = i; … … 1229 1228 // But this workaround helps quite fine 1230 1229 // 1231 Axis_t min = h ->GetBinLowEdge(min2);1232 Axis_t max = h ->GetBinLowEdge(max2)+h->GetBinWidth(max2);1230 Axis_t min = h.GetBinLowEdge(min2); 1231 Axis_t max = h.GetBinLowEdge(max2)+h.GetBinWidth(max2); 1233 1232 1234 1233 Int_t nbins2 = max2-min2; … … 1238 1237 if (nbins > 0) 1239 1238 { 1240 const Int_t ngroup = (Int_t)(nbins2*h ->GetNbinsX()/nbins/(max1-min1));1239 const Int_t ngroup = (Int_t)(nbins2*h.GetNbinsX()/nbins/(max1-min1)); 1241 1240 if (ngroup > 1) 1242 1241 { 1243 h ->Rebin(ngroup);1242 h.Rebin(ngroup); 1244 1243 nbins2 /= ngroup; 1245 1244 } -
trunk/Mars/mhbase/MH.h
r9594 r9851 21 21 class MBinning; 22 22 class MParList; 23 23 #include <TH2.h> 24 #include <TH3.h> 24 25 class MH : public MParContainer 25 26 { … … 64 65 static void RemoveFromPad(const char *name); 65 66 66 // FIXME: * --> & !!! 67 // Functions to applay new binnings to histograms 68 static void SetBinning(TH1 &h, const MBinning &binsx); 69 static void SetBinning(TH2 &h, const MBinning &binsx, const MBinning &binsy); 70 static void SetBinning(TH3 &h, const MBinning &binsx, const MBinning &binsy, const MBinning &binsz); 67 71 68 static void SetBinning(TH1 *h, const MBinning *binsx);69 static void SetBinning(TH2 *h, const MBinning *binsx, const MBinning *binsy);70 static void SetBinning(TH3 *h, const MBinning *binsx, const MBinning *binsy, const MBinning *binsz);72 static void SetBinning(TH1 &h, const TArrayD &binsx); 73 static void SetBinning(TH2 &h, const TArrayD &binsx, const TArrayD &binsy); 74 static void SetBinning(TH3 &h, const TArrayD &binsx, const TArrayD &binsy, const TArrayD &binsz); 71 75 72 static void SetBinning(TH1 *h, const TArrayD&binsx);73 static void SetBinning(TH2 *h, const TArrayD &binsx, const TArrayD&binsy);74 static void SetBinning(TH3 *h, const TArrayD &binsx, const TArrayD &binsy, const TArrayD&binsz);76 static void SetBinning(TH1 &h, const TAxis &binsx); 77 static void SetBinning(TH2 &h, const TAxis &binsx, const TAxis &binsy); 78 static void SetBinning(TH3 &h, const TAxis &binsx, const TAxis &binsy, const TAxis &binsz); 75 79 76 static void SetBinning(TH1 *h, const TAxis *binsx); 77 static void SetBinning(TH2 *h, const TAxis *binsx, const TAxis *binsy); 78 static void SetBinning(TH3 *h, const TAxis *binsx, const TAxis *binsy, const TAxis *binsz); 80 static void CopyBinning(const TH1 &x, TH1 &h); 79 81 80 static void SetBinning(TH1 *h, const TH1 *x); 82 static Bool_t ApplyBinning(const MParList &plist, const TString x, TH1 &h); 83 static Bool_t ApplyBinning(const MParList &plist, const TString x, TString y, TH2 &h); 84 static Bool_t ApplyBinning(const MParList &plist, const TString x, TString y, TString z, TH3 &h); 81 85 86 // Warpper functions not to break macros (new functions take references) 87 static void SetBinning(TH1 *h, const MBinning *binsx) { SetBinning(*h, *binsx); } 88 static void SetBinning(TH2 *h, const MBinning *binsx, const MBinning *binsy) { SetBinning(*h, *binsx, *binsy); } 89 static void SetBinning(TH3 *h, const MBinning *binsx, const MBinning *binsy, const MBinning *binsz) { SetBinning(*h, *binsx, *binsy, *binsz); } 90 91 static void SetBinning(TH1 *h, const TArrayD &binsx) { SetBinning(*h, binsx); } 92 static void SetBinning(TH2 *h, const TArrayD &binsx, const TArrayD &binsy) { SetBinning(*h, binsx, binsy); } 93 static void SetBinning(TH3 *h, const TArrayD &binsx, const TArrayD &binsy, const TArrayD &binsz) { SetBinning(*h, binsx, binsy, binsz); } 94 95 static void SetBinning(TH1 *h, const TAxis *binsx) { SetBinning(*h, *binsx); } 96 static void SetBinning(TH2 *h, const TAxis *binsx, const TAxis *binsy) { SetBinning(*h, *binsx, *binsy); } 97 static void SetBinning(TH3 *h, const TAxis *binsx, const TAxis *binsy, const TAxis *binsz) { SetBinning(*h, *binsx, *binsy, *binsz); } 98 99 static Bool_t ApplyBinning(const MParList &plist, TString x, TH1 *h) { return ApplyBinning(plist, x, *h); } 100 static Bool_t ApplyBinning(const MParList &plist, TString x, TString y, TH2 *h) { return ApplyBinning(plist, x, y, *h); } 101 static Bool_t ApplyBinning(const MParList &plist, TString x, TString y, TString z, TH3 *h) { return ApplyBinning(plist, x, y, z, *h); } 102 103 // Other helpers for histogram treatment 82 104 static void SetBinomialErrors(TH1 &hres, const TH1 &h1, const TH1 &h2, Double_t c1=1, Double_t c2=1); 83 105 84 106 static void RemoveFirstBin(TH1 &h); 85 107 86 static Bool_t ApplyBinning(const MParList &plist, TString x, TH1 *h);87 static Bool_t ApplyBinning(const MParList &plist, TString x, TString y, TH2 *h);88 static Bool_t ApplyBinning(const MParList &plist, TString x, TString y, TString z, TH3 *h);89 90 108 static void ScaleArray(TArrayD &bins, Double_t f); 91 109 static TArrayD ScaleAxis(TAxis &axe, Double_t f); 92 static void ScaleAxis(TH1 *bins, Double_t fx=1, Double_t fy=1, Double_t fz=1);110 static void ScaleAxis(TH1 &bins, Double_t fx=1, Double_t fy=1, Double_t fz=1); 93 111 94 112 static Double_t GetBinCenterLog(const TAxis &axe, Int_t nbin); … … 109 127 static void FindGoodLimits(Int_t nbins, Int_t &newbins, Double_t &xmin, Double_t &xmax, Bool_t isInteger); 110 128 static Double_t GetMinimumGT(const TH1 &h, Double_t gt=0); 111 static Int_t StripZeros(TH1 *h, Int_t nbins);129 static Int_t StripZeros(TH1 &h, Int_t nbins); 112 130 113 131 static TH1I* ProjectArray(const TArrayF &array, Int_t nbins=30, -
trunk/Mars/mhbase/MH3.cc
r9829 r9851 682 682 { 683 683 case 1: 684 SetBinning( fHist,binsx);684 SetBinning(*fHist, *binsx); 685 685 return kTRUE; 686 686 case 2: 687 SetBinning(static_cast<TH2 *>(fHist), binsx,binsy);687 SetBinning(static_cast<TH2&>(*fHist), *binsx, *binsy); 688 688 return kTRUE; 689 689 case 3: 690 SetBinning(static_cast<TH3 *>(fHist), binsx, binsy,binsz);690 SetBinning(static_cast<TH3&>(*fHist), *binsx, *binsy, *binsz); 691 691 return kTRUE; 692 692 } -
trunk/Mars/mhbase/MHMatrix.cc
r9473 r9851 777 777 hta.SetName("hta"); 778 778 hta.SetTitle("Distribution after reduction"); 779 SetBinning(&hta, &hth);779 CopyBinning(hth, hta); 780 780 781 781 for (Int_t i=0; i<fM.GetNrows(); i++) … … 888 888 TH1F hth; 889 889 hth.SetNameTitle("th", "Distribution before reduction"); 890 SetBinning(&hth, &thsh);890 CopyBinning(thsh, hth); 891 891 hth.SetDirectory(NULL); 892 892 for (Int_t j=0; j<nrows; j++) … … 896 896 TH1F hthd; 897 897 hthd.SetNameTitle("thd", "Correction factors"); 898 SetBinning(&hthd, &thsh);898 CopyBinning(thsh, hthd); 899 899 hthd.SetDirectory(NULL); 900 900 hthd.Divide(&thsh, &hth, 1, 1); -
trunk/Mars/mhcalib/MHGausEvents.cc
r9308 r9851 674 674 // the _less_ bins, you have!) 675 675 // 676 StripZeros( &fHGausHist,676 StripZeros(fHGausHist, 677 677 fBinsAfterStripping ? fBinsAfterStripping 678 678 : (fNbins > 1000 ? fNbins/10 : 0)); -
trunk/Mars/mhflux/MHAlpha.cc
r9576 r9851 142 142 binsa.Apply(fHistTime); 143 143 144 MH::SetBinning( &fHist, &binst, &binse, &binsa);144 MH::SetBinning(fHist, binst, binse, binsa); 145 145 } 146 146 … … 334 334 binst.Apply(fHTheta); 335 335 binsa.Apply(fHistTime); 336 MH::SetBinning( &fHist, &binst, &binse, &binsa);336 MH::SetBinning(fHist, binst, binse, binsa); 337 337 338 338 MAlphaFitter *fit = (MAlphaFitter*)pl->FindObject("MAlphaFitter"); … … 353 353 // If this is the first call we have to initialize the time-histogram 354 354 // 355 MBinning bins; 356 bins.SetEdges(1, t.GetAxisTime()-60, t.GetAxisTime()); 355 const MBinning bins(1, t.GetAxisTime()-60, t.GetAxisTime()); 357 356 bins.Apply(fHTime); 358 357 -
trunk/Mars/mhflux/MHCollectionArea.cc
r9422 r9851 109 109 binse.Apply(fHEnergy); 110 110 111 MH::SetBinning( &fHistSel, &binst, &binse);112 MH::SetBinning( &fHistAll, &binst, &binse);111 MH::SetBinning(fHistSel, binst, binse); 112 MH::SetBinning(fHistAll, binst, binse); 113 113 114 114 // For some unknown reasons this must be called after … … 202 202 binse.Apply(fHEnergy); 203 203 204 MH::SetBinning( &fHistSel, &binst, &binse);205 MH::SetBinning( &fHistAll, &binst, &binse);204 MH::SetBinning(fHistSel, binst, binse); 205 MH::SetBinning(fHistAll, binst, binse); 206 206 207 207 fMcAreaRadius = -1; -
trunk/Mars/mhflux/MHDisp.cc
r9301 r9851 132 132 binsx.SetEdges(fHist, 'x'); 133 133 binsy.SetEdges(fHist, 'y'); 134 MH::SetBinning( &fHistBg, &binsx, &binsy);134 MH::SetBinning(fHistBg, binsx, binsy); 135 135 136 136 if (!fHistOff) 137 137 { 138 MH::SetBinning( &fHistBg1, &binsx, &binsy);139 MH::SetBinning( &fHistBg2, &binsx, &binsy);138 MH::SetBinning(fHistBg1, binsx, binsy); 139 MH::SetBinning(fHistBg2, binsx, binsy); 140 140 } 141 141 -
trunk/Mars/mhflux/MHEffectiveOnTime.cc
r9343 r9851 435 435 btime.SetEdges(50, 0, 0.1); 436 436 437 MH::SetBinning( &fH2DeltaT, &btime, &btheta);437 MH::SetBinning(fH2DeltaT, btime, btheta); 438 438 439 439 btime.Apply(fH1DeltaT); … … 480 480 } 481 481 if (binstheta && binsdtime) 482 SetBinning( &fH2DeltaT, binsdtime,binstheta);482 SetBinning(fH2DeltaT, *binsdtime, *binstheta); 483 483 484 484 fTotalTime = 0; -
trunk/Mars/mhflux/MHEnergyEst.cc
r9565 r9851 113 113 binsi.SetEdges(1, 0, 1000); 114 114 115 SetBinning( &fHEnergy, &binse, &binse, &binst);116 SetBinning( &fHImpact, &binsi, &binsr);117 118 SetBinning( &fHResolutionEst, &binse, &binsr);119 SetBinning( &fHResolutionMC, &binse, &binsr);115 SetBinning(fHEnergy, binse, binse, binst); 116 SetBinning(fHImpact, binsi, binsr); 117 118 SetBinning(fHResolutionEst, binse, binsr); 119 SetBinning(fHResolutionMC, binse, binsr); 120 120 121 121 // For some unknown reasons this must be called after … … 165 165 binsr.SetEdges(*plist, "BinningEnergyRes"); 166 166 167 SetBinning( &fHEnergy, &binse, &binse, &binst);168 SetBinning( &fHImpact, &binsi, &binsr);169 170 SetBinning( &fHResolutionEst, &binse, &binsr);171 SetBinning( &fHResolutionMC, &binse, &binsr);167 SetBinning(fHEnergy, binse, binse, binst); 168 SetBinning(fHImpact, binsi, binsr); 169 170 SetBinning(fHResolutionEst, binse, binsr); 171 SetBinning(fHResolutionMC, binse, binsr); 172 172 173 173 fChisq = 0; -
trunk/Mars/mhflux/MHFalseSource.cc
r9367 r9851 258 258 259 259 if (fHistOff) 260 MH::SetBinning( &fHist,fHistOff);260 MH::SetBinning(fHist, *fHistOff); 261 261 else 262 262 { … … 269 269 const Float_t r = (geom ? geom->GetMaxRadius()/3 : 200)*fMm2Deg; 270 270 271 MBinning b; 272 b.SetEdges(20, -r, r); 273 SetBinning(&fHist, &b, &b, &binsa); 271 const MBinning b(20, -r, r); 272 SetBinning(fHist, b, b, binsa); 274 273 } 275 274 else 276 SetBinning( &fHist, bins, bins, &binsa);275 SetBinning(fHist, *bins, *bins, binsa); 277 276 } 278 277 … … 502 501 503 502 TH2D h; 504 MH::SetBinning( &h,h2);503 MH::SetBinning(h, *h2); 505 504 506 505 // Divide by number of entries in off region (of off-data) -
trunk/Mars/mhflux/MHThetaSq.cc
r9369 r9851 95 95 binsa.Apply(fHistTime); 96 96 97 MH::SetBinning( &fHist, &binst, &binse, &binsa);97 MH::SetBinning(fHist, binst, binse, binsa); 98 98 } 99 99 … … 132 132 // Apply binning 133 133 binsa.Apply(fHistTime); 134 MH::SetBinning( &fHist, &binst, &binse, &binsa);134 MH::SetBinning(fHist, binst, binse, binsa); 135 135 136 136 // Remark: Binnings might be overwritten in MHAlpha::SetupFill -
trunk/Mars/mhflux/MHThetaSqN.cc
r9369 r9851 98 98 binsa.Apply(fHistTime); 99 99 100 MH::SetBinning( &fHist, &binst, &binse, &binsa);100 MH::SetBinning(fHist, binst, binse, binsa); 101 101 102 102 fParameter = new MParameterD; … … 142 142 // Apply binning 143 143 binsa.Apply(fHistTime); 144 MH::SetBinning( &fHist, &binst, &binse, &binsa);144 MH::SetBinning(fHist, binst, binse, binsa); 145 145 146 146 // Remark: Binnings might be overwritten in MHAlpha::SetupFill -
trunk/Mars/mhflux/MHThreshold.cc
r9362 r9851 98 98 } 99 99 100 ApplyBinning(*pl, "Threshold", &fHEnergy);100 ApplyBinning(*pl, "Threshold", fHEnergy); 101 101 102 102 return kTRUE; -
trunk/Mars/mhist/MHCamEventRot.cc
r9369 r9851 128 128 const Float_t r = fGeom->GetMaxRadius()*fGeom->GetConvMm2Deg(); 129 129 130 MBinning b; 131 b.SetEdges(41, -r, r); 132 SetBinning(&fHist, &b, &b); 130 const MBinning b(41, -r, r); 131 SetBinning(fHist, b, b); 133 132 } 134 133 else 135 SetBinning( &fHist, bins,bins);134 SetBinning(fHist, *bins, *bins); 136 135 137 136 fPointPos = (MPointingPos*)plist->FindObject(AddSerialNumber("MPointingPos")); -
trunk/Mars/mhist/MHStarMap.cc
r9153 r9851 153 153 r *= fMm2Deg; 154 154 155 MBinning b; 156 b.SetEdges(100, -r, r); 157 SetBinning(fStarMap, &b, &b); 155 const MBinning b(100, -r, r); 156 SetBinning(*fStarMap, b, b); 158 157 } 159 158 else 160 SetBinning( fStarMap, bins,bins);159 SetBinning(*fStarMap, *bins, *bins); 161 160 162 161 if (!geom) -
trunk/Mars/mimage/MHHillas.cc
r9350 r9851 157 157 158 158 159 ApplyBinning(*plist, "Width", fWidth);160 ApplyBinning(*plist, "Length", fLength);161 ApplyBinning(*plist, "Dist", fDistC);162 ApplyBinning(*plist, "Delta", fDelta);163 ApplyBinning(*plist, "Size", fSize);159 ApplyBinning(*plist, "Width", *fWidth); 160 ApplyBinning(*plist, "Length", *fLength); 161 ApplyBinning(*plist, "Dist", *fDistC); 162 ApplyBinning(*plist, "Delta", *fDelta); 163 ApplyBinning(*plist, "Size", *fSize); 164 164 165 165 const MBinning *bins = (MBinning*)plist->FindObject("BinningCamera"); … … 168 168 const Float_t r = fGeomCam->GetMaxRadius()*fGeomCam->GetConvMm2Deg(); 169 169 170 MBinning b; 171 b.SetEdges(61, -r, r); 172 SetBinning(fCenter, &b, &b); 170 const MBinning b(61, -r, r); 171 SetBinning(*fCenter, b, b); 173 172 } 174 173 else 175 SetBinning( fCenter, bins,bins);174 SetBinning(*fCenter, *bins, *bins); 176 175 177 176 -
trunk/Mars/mimage/MHHillasExt.cc
r9362 r9851 129 129 binsx.Apply(fHAsym); 130 130 131 binsx.SetEdges(100, 0,1.5);132 binsy.SetEdges(100, -9,9);133 MH::SetBinning( &fHSlopeL, &binsx, &binsy);131 binsx.SetEdges(100, 0, 1.5); 132 binsy.SetEdges(100, -9, 9); 133 MH::SetBinning(fHSlopeL, binsx, binsy); 134 134 } 135 135 … … 167 167 } 168 168 169 ApplyBinning(*plist, "Asym", &fHAsym);170 ApplyBinning(*plist, "M3Long", &fHM3Long);171 ApplyBinning(*plist, "M3Trans", &fHM3Trans);172 ApplyBinning(*plist, "Dist", "Slope", &fHSlopeL);169 ApplyBinning(*plist, "Asym", fHAsym); 170 ApplyBinning(*plist, "M3Long", fHM3Long); 171 ApplyBinning(*plist, "M3Trans", fHM3Trans); 172 ApplyBinning(*plist, "Dist", "Slope", fHSlopeL); 173 173 174 174 return kTRUE; -
trunk/Mars/mimage/MHHillasSrc.cc
r9350 r9851 135 135 } 136 136 137 ApplyBinning(*plist, "Alpha", fAlpha);138 ApplyBinning(*plist, "Dist", fDist);139 ApplyBinning(*plist, "DCA", fDCA);140 ApplyBinning(*plist, "DCADelta", fDCADelta);137 ApplyBinning(*plist, "Alpha", *fAlpha); 138 ApplyBinning(*plist, "Dist", *fDist); 139 ApplyBinning(*plist, "DCA", *fDCA); 140 ApplyBinning(*plist, "DCADelta", *fDCADelta); 141 141 142 142 return kTRUE; -
trunk/Mars/mimage/MHImagePar.cc
r9344 r9851 145 145 Bool_t MHImagePar::SetupFill(const MParList *plist) 146 146 { 147 ApplyBinning(*plist, "Pixels", &fHistSatLo);148 ApplyBinning(*plist, "Pixels", &fHistSatHi);149 ApplyBinning(*plist, "Pixels", &fHistNumSP);150 151 ApplyBinning(*plist, "Islands", &fHistIslands);152 153 ApplyBinning(*plist, "Size", &fHistSizeSubIslands);154 ApplyBinning(*plist, "Size", &fHistSizeMainIsland);155 ApplyBinning(*plist, "Size", &fHistSizeSP);147 ApplyBinning(*plist, "Pixels", fHistSatLo); 148 ApplyBinning(*plist, "Pixels", fHistSatHi); 149 ApplyBinning(*plist, "Pixels", fHistNumSP); 150 151 ApplyBinning(*plist, "Islands", fHistIslands); 152 153 ApplyBinning(*plist, "Size", fHistSizeSubIslands); 154 ApplyBinning(*plist, "Size", fHistSizeMainIsland); 155 ApplyBinning(*plist, "Size", fHistSizeSP); 156 156 157 157 return kTRUE; -
trunk/Mars/mimage/MHNewImagePar.cc
r9343 r9851 197 197 } 198 198 199 ApplyBinning(*plist, "Leakage", &fHistLeakage1);200 ApplyBinning(*plist, "Leakage", &fHistLeakage2);201 202 ApplyBinning(*plist, "Pixels", &fHistUsedPix);203 ApplyBinning(*plist, "Pixels", &fHistCorePix);204 205 //ApplyBinning(*plist, "Area", &fHistUsedArea);206 //ApplyBinning(*plist, "Area", &fHistCoreArea);207 208 ApplyBinning(*plist, "Conc", &fHistConc);209 ApplyBinning(*plist, "Conc1", &fHistConc1);210 ApplyBinning(*plist, "ConcCOG", &fHistConcCOG);211 ApplyBinning(*plist, "ConcCore", &fHistConcCore);199 ApplyBinning(*plist, "Leakage", fHistLeakage1); 200 ApplyBinning(*plist, "Leakage", fHistLeakage2); 201 202 ApplyBinning(*plist, "Pixels", fHistUsedPix); 203 ApplyBinning(*plist, "Pixels", fHistCorePix); 204 205 //ApplyBinning(*plist, "Area", fHistUsedArea); 206 //ApplyBinning(*plist, "Area", fHistCoreArea); 207 208 ApplyBinning(*plist, "Conc", fHistConc); 209 ApplyBinning(*plist, "Conc1", fHistConc1); 210 ApplyBinning(*plist, "ConcCOG", fHistConcCOG); 211 ApplyBinning(*plist, "ConcCore", fHistConcCore); 212 212 213 213 return kTRUE; -
trunk/Mars/mimage/MHVsSize.cc
r9343 r9851 100 100 fM3Long.SetYTitle("M3Long [\\circ]"); 101 101 102 MBinning binse, binsl, binsd, binsc, binsa, binsm; 103 binse.SetEdgesLog( 50, 10, 1e5); 104 binsl.SetEdges( 100, 0, 0.5); 105 binsd.SetEdges( 100, 0, 2.0); 106 binsc.SetEdgesLog(100, 3e-3, 1); 107 binsa.SetEdges( 100, 0, 0.25); 108 binsm.SetEdges( 100, -1.5, 1.5); 109 110 MH::SetBinning(&fLength, &binse, &binsl); 111 MH::SetBinning(&fWidth, &binse, &binsl); 112 MH::SetBinning(&fDist, &binse, &binsd); 113 MH::SetBinning(&fConc1, &binse, &binsc); 114 MH::SetBinning(&fArea, &binse, &binsa); 115 MH::SetBinning(&fM3Long, &binse, &binsm); 102 const MBinning binse( 50, 10, 1e5, "", "log"); 103 const MBinning binsc(100, 3e-3, 1, "", "log"); 104 const MBinning binsl(100, 0, 0.5); 105 const MBinning binsd(100, 0, 2.0); 106 const MBinning binsa(100, 0, 0.25); 107 const MBinning binsm(100, -1.5, 1.5); 108 109 MH::SetBinning(fLength, binse, binsl); 110 MH::SetBinning(fWidth, binse, binsl); 111 MH::SetBinning(fDist, binse, binsd); 112 MH::SetBinning(fConc1, binse, binsc); 113 MH::SetBinning(fArea, binse, binsa); 114 MH::SetBinning(fM3Long, binse, binsm); 116 115 117 116 fLength.UseCurrentStyle(); -
trunk/Mars/mjobs/MJSpectrum.cc
r9584 r9851 1648 1648 TH2D hist; 1649 1649 hist.UseCurrentStyle(); 1650 MH::SetBinning( &hist, &bins3, &bins2);1650 MH::SetBinning(hist, bins3, bins2); 1651 1651 if (!ReadOrigMCDistribution(set, hist, weight)) 1652 1652 return kFALSE; -
trunk/Mars/mjtrain/MJTrainDisp.cc
r9848 r9851 142 142 heff.SetYTitle("Efficiency"); 143 143 144 MH::SetBinning( &heff, hist.GetXaxis());144 MH::SetBinning(heff, hist); 145 145 146 146 for (int x=0; x<=hist.GetNbinsX()+1; x++) -
trunk/Mars/mmuon/MHMuonPar.cc
r9360 r9851 164 164 } 165 165 166 ApplyBinning(*plist, "Radius", &fHistRadius);167 ApplyBinning(*plist, "ArcWidth", &fHistArcWidth);168 ApplyBinning(*plist, "RingBroadening", &fHistBroad);169 ApplyBinning(*plist, "SizeVsRadius", &fHistSize);166 ApplyBinning(*plist, "Radius", fHistRadius); 167 ApplyBinning(*plist, "ArcWidth", fHistArcWidth); 168 ApplyBinning(*plist, "RingBroadening", fHistBroad); 169 ApplyBinning(*plist, "SizeVsRadius", fHistSize); 170 170 171 171 return kTRUE; -
trunk/Mars/mmuon/MHSingleMuon.cc
r9574 r9851 184 184 fMargin = setup->GetMargin()/fGeomCam->GetConvMm2Deg(); 185 185 186 ApplyBinning(*plist, "ArcPhi", &fHistPhi);187 ApplyBinning(*plist, "MuonWidth", &fHistWidth);188 ApplyBinning(*plist, "MuonTime", &fHistTime);186 ApplyBinning(*plist, "ArcPhi", fHistPhi); 187 ApplyBinning(*plist, "MuonWidth", fHistWidth); 188 ApplyBinning(*plist, "MuonTime", fHistTime); 189 189 190 190 return kTRUE; -
trunk/Mars/mpedestal/MHPedestalCor.cc
r9153 r9851 95 95 fProf.SetDirectory(0); 96 96 97 MBinning binsx(15, -0.5, 14.5);98 MH::SetBinning( &fProf, &binsx);97 const MBinning binsx(15, -0.5, 14.5); 98 MH::SetBinning(fProf, binsx); 99 99 } 100 100 … … 181 181 182 182 const Axis_t xmax = fProf.GetXaxis()->GetXmax(); 183 MBinning bins(n, -xmax, xmax); 184 185 MH::SetBinning( &h, &bins, &bins);183 184 const MBinning bins(n, -xmax, xmax); 185 MH::SetBinning(h, bins, bins); 186 186 187 187 for (int x=0; x<n; x++) -
trunk/Mars/mpointing/MHSrcPosCam.cc
r9361 r9851 81 81 const Int_t n = wobble ? 101 : 51; 82 82 83 MBinning bins; 84 bins.SetEdges(n, -x, x); // bin=0.01ø ~0.5SE 85 86 MH::SetBinning(&fHist, &bins, &bins); 83 const MBinning bins(n, -x, x); // bin=0.01ø ~0.5SE 84 85 MH::SetBinning(fHist, bins, bins); 87 86 } 88 87 -
trunk/Mars/msim/MHPhotonEvent.cc
r9567 r9851 146 146 Init(name, title); 147 147 148 MBinning binsd, binsa; 149 binsd.SetEdges(50, -max, max); 150 binsa.SetEdges(50, -1, 1); 151 152 SetBinning(&fHistXY, &binsd, &binsd); 153 SetBinning(&fHistUV, &binsa, &binsa); 154 SetBinning(&fHistT, &binsd, &binsd); 148 const MBinning binsd(50, -max, max); 149 const MBinning binsa(50, -1, 1); 150 151 SetBinning(fHistXY, binsd, binsd); 152 SetBinning(fHistUV, binsa, binsa); 153 SetBinning(fHistT, binsd, binsd); 155 154 } 156 155 … … 166 165 Init(name, title); 167 166 168 MBinning binsd, bins; 169 bins.SetEdges(50, -1, 1); 170 171 SetBinning(&fHistUV, &bins, &bins); 167 const MBinning bins(50, -1, 1); 168 169 SetBinning(fHistUV, bins, bins); 172 170 } 173 171 … … 183 181 MH::FindGoodLimits(num, num, min, max, kFALSE); 184 182 MH::FindGoodLimits(num, num, min, max, kFALSE); 185 MBinning binsd, binsa, binsz; 186 binsd.SetEdges(num, min, max);187 188 SetBinning( &fHistXY, &binsd, &binsd);189 SetBinning( &fHistT, &binsd, &binsd);183 184 const MBinning binsd(num, min, max); 185 186 SetBinning(fHistXY, binsd, binsd); 187 SetBinning(fHistT, binsd, binsd); 190 188 } 191 189 -
trunk/Mars/mtools/MHSimulatedAnnealing.cc
r7749 r9851 74 74 binsx.SetEdges(fMoves+1, 0, 1); 75 75 binsy.SetEdges(fDim, 0.5, fDim+0.5); 76 MH::SetBinning( &fBestEver, &binsx, &binsy);76 MH::SetBinning(fBestEver, binsx, binsy); 77 77 78 78 // For better visibility, omit the first entry in fBestFuncEval
Note:
See TracChangeset
for help on using the changeset viewer.