Changeset 9851 for trunk/Mars/mhbase
- Timestamp:
- 08/12/10 09:43:02 (14 years ago)
- Location:
- trunk/Mars/mhbase
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
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);
Note:
See TracChangeset
for help on using the changeset viewer.