Changeset 8679 for trunk/MagicSoft/Mars/mhbase
- Timestamp:
- 08/19/07 22:40:04 (17 years ago)
- Location:
- trunk/MagicSoft/Mars/mhbase
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhbase/MBinning.cc
r8106 r8679 1 1 /* ======================================================================== *\ 2 ! $Name: not supported by cvs2svn $:$Id: MBinning.cc,v 1.1 7 2006-10-17 17:16:00 tbretz Exp $2 ! $Name: not supported by cvs2svn $:$Id: MBinning.cc,v 1.18 2007-08-19 21:35:00 tbretz Exp $ 3 3 ! -------------------------------------------------------------------------- 4 4 ! … … 134 134 // -------------------------------------------------------------------------- 135 135 // 136 // Initialize Binning from TArrayD. 137 // 138 MBinning::MBinning(const TArrayD &axis, const char *name, const char *title) 139 { 140 fName = name ? name : gsDefName.Data(); 141 fTitle = title ? title : gsDefTitle.Data(); 142 143 SetEdges(axis); 144 } 145 146 // -------------------------------------------------------------------------- 147 // 136 148 // Search in the parameter list for the binning with name "name". If found, 137 149 // set the edges and title accordingly. Default is name of object. -
trunk/MagicSoft/Mars/mhbase/MBinning.h
r8398 r8679 43 43 MBinning(const TH1 &h, const Char_t axis='x', const char *name=0, const char *title=0); 44 44 MBinning(const TAxis &a, const char *name=0, const char *title=0); 45 MBinning(const TArrayD &a, const char *name=0, const char *title=0); 45 46 46 47 void Copy(TObject &named) const -
trunk/MagicSoft/Mars/mhbase/MH.cc
r8657 r8679 1 1 /* ======================================================================== *\ 2 ! $Name: not supported by cvs2svn $:$Id: MH.cc,v 1.3 3 2007-08-06 14:44:13tbretz Exp $2 ! $Name: not supported by cvs2svn $:$Id: MH.cc,v 1.34 2007-08-19 21:36:00 tbretz Exp $ 3 3 ! -------------------------------------------------------------------------- 4 4 ! … … 20 20 ! Author(s): Thomas Bretz 07/2001 <mailto:tbretz@astro.uni-wuerzburg.de> 21 21 ! 22 ! Copyright: MAGIC Software Development, 2000-200 222 ! Copyright: MAGIC Software Development, 2000-2007 23 23 ! 24 24 ! … … 1409 1409 // -------------------------------------------------------------------------- 1410 1410 // 1411 // Return the first and last bin of the histogram which is not 0 1412 // 1413 void MH::GetRange(const TH1 &h, Int_t &lo, Int_t &hi) 1414 { 1415 lo = 0; 1416 hi = 1; 1417 1418 for (int i=2; i<=h.GetNbinsX(); i++) 1419 { 1420 if (lo==0 && h.GetBinContent(i)>0) 1421 lo = i; 1422 1423 if (h.GetBinContent(i)>0) 1424 hi = i; 1425 } 1426 } 1427 1428 // -------------------------------------------------------------------------- 1429 // 1430 // Return the lower edge of the first and the upper edge of the last bin 1431 // of the histogram which is not 0 1432 // 1433 void MH::GetRangeUser(const TH1 &h, Axis_t &lo, Axis_t &hi) 1434 { 1435 Int_t f, l; 1436 GetRange(h, f, l); 1437 1438 lo = h.GetBinLowEdge(f); 1439 hi = h.GetBinLowEdge(l+1); 1440 } 1441 1442 // -------------------------------------------------------------------------- 1443 // 1411 1444 // See MTask::PrintSkipped 1412 1445 // -
trunk/MagicSoft/Mars/mhbase/MH.h
r8657 r8679 119 119 static void ProjectionY(TH1D &dest, const TH2 &src, Int_t firstxbin=-1, Int_t lastxbin=9999); 120 120 121 static void GetRangeUser(const TH1 &hist, Axis_t &lo, Axis_t &hi); 122 static void GetRange(const TH1 &hist, Int_t &lo, Int_t &hi); 123 121 124 static TObject *FindObjectInPad(const char *name, TVirtualPad *pad=NULL); 122 125
Note:
See TracChangeset
for help on using the changeset viewer.