Changeset 8696
- Timestamp:
- 08/22/07 19:23:06 (17 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r8695 r8696 62 62 * mmuon/MHMuonPar.cc: 63 63 - enable all grids 64 65 * mimage/MNewImagePar.cc: 66 - Set fConcCOG to 0 if smaller 0. This produces at least a defined 67 value (-inf) when the logarithm is calculated, which is better 68 than an undefined one (NaN). 64 69 65 70 -
trunk/MagicSoft/Mars/mhbase/MH.cc
r8679 r8696 1 1 /* ======================================================================== *\ 2 ! $Name: not supported by cvs2svn $:$Id: MH.cc,v 1.3 4 2007-08-19 21:36:00tbretz Exp $2 ! $Name: not supported by cvs2svn $:$Id: MH.cc,v 1.35 2007-08-22 18:22:49 tbretz Exp $ 3 3 ! -------------------------------------------------------------------------- 4 4 ! … … 1416 1416 hi = 1; 1417 1417 1418 for (int i= 2; i<=h.GetNbinsX(); i++)1418 for (int i=1; i<=h.GetNbinsX(); i++) 1419 1419 { 1420 1420 if (lo==0 && h.GetBinContent(i)>0) … … 1438 1438 lo = h.GetBinLowEdge(f); 1439 1439 hi = h.GetBinLowEdge(l+1); 1440 } 1441 1442 // -------------------------------------------------------------------------- 1443 // 1444 // Return the first and last column (x-bin) of the histogram which is not 0. 1445 // Therefor a proper projection is produced if the argument is a TH2. 1446 // 1447 // TH3 are not yet supported 1448 // 1449 void MH::GetRangeX(const TH1 &hist, Int_t &lo, Int_t &hi) 1450 { 1451 if (hist.InheritsFrom(TH3::Class())) 1452 return; 1453 1454 if (hist.InheritsFrom(TH2::Class())) 1455 { 1456 TH1 *pro = static_cast<const TH2&>(hist).ProjectionX(); 1457 GetRange(*pro, lo, hi); 1458 delete pro; 1459 return; 1460 } 1461 1462 GetRange(hist, lo, hi); 1463 } 1464 1465 // -------------------------------------------------------------------------- 1466 // 1467 // Return the first and last row (y-bin) of the histogram which is not 0. 1468 // Therefor a proper projection is produced if the argument is a TH2. 1469 // 1470 // TH3 are not yet supported 1471 // 1472 void MH::GetRangeY(const TH1 &hist, Int_t &lo, Int_t &hi) 1473 { 1474 if (hist.InheritsFrom(TH3::Class())) 1475 return; 1476 1477 if (hist.InheritsFrom(TH2::Class())) 1478 { 1479 TH1 *pro = static_cast<const TH2&>(hist).ProjectionY(); 1480 GetRange(*pro, lo, hi); 1481 delete pro; 1482 } 1483 } 1484 1485 // -------------------------------------------------------------------------- 1486 // 1487 // Return the lower edge of the first and the upper edge of the last bin 1488 // of the histogram h returned by GetRangeX 1489 // 1490 void MH::GetRangeUserX(const TH1 &h, Axis_t &lo, Axis_t &hi) 1491 { 1492 Int_t f, l; 1493 GetRangeX(h, f, l); 1494 1495 lo = h.GetXaxis()->GetBinLowEdge(f); 1496 hi = h.GetXaxis()->GetBinLowEdge(l+1); 1497 } 1498 1499 // -------------------------------------------------------------------------- 1500 // 1501 // Return the lower edge of the first and the upper edge of the last bin 1502 // of the histogram h returned by GetRangeY 1503 // 1504 void MH::GetRangeUserY(const TH1 &h, Axis_t &lo, Axis_t &hi) 1505 { 1506 Int_t f, l; 1507 GetRangeY(h, f, l); 1508 1509 lo = h.GetYaxis()->GetBinLowEdge(f); 1510 hi = h.GetYaxis()->GetBinLowEdge(l+1); 1440 1511 } 1441 1512 -
trunk/MagicSoft/Mars/mhbase/MH.h
r8679 r8696 120 120 121 121 static void GetRangeUser(const TH1 &hist, Axis_t &lo, Axis_t &hi); 122 static void GetRangeUserX(const TH1 &hist, Axis_t &lo, Axis_t &hi); 123 static void GetRangeUserY(const TH1 &hist, Axis_t &lo, Axis_t &hi); 122 124 static void GetRange(const TH1 &hist, Int_t &lo, Int_t &hi); 125 static void GetRangeX(const TH1 &hist, Int_t &lo, Int_t &hi); 126 static void GetRangeY(const TH1 &hist, Int_t &lo, Int_t &hi); 123 127 124 128 static TObject *FindObjectInPad(const char *name, TVirtualPad *pad=NULL); 125 129 126 static void SetPalette(TString paletteName , Int_t ncol=50);130 static void SetPalette(TString paletteName="pretty", Int_t ncol=50); 127 131 128 132 ClassDef(MH, 2) //A base class for Mars histograms
Note:
See TracChangeset
for help on using the changeset viewer.