Changeset 7413 for trunk/MagicSoft/Mars/mhbase
- Timestamp:
- 11/21/05 11:09:12 (19 years ago)
- Location:
- trunk/MagicSoft/Mars/mhbase
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhbase/MBinning.cc
r7151 r7413 242 242 // lowest <lo> and highest <up> Edge (of your histogram) 243 243 // 244 void MBinning::SetEdges(const Int_t nbins, const Axis_t lo, Axis_t up) 245 { 244 void MBinning::SetEdgesLin(Int_t nbins, Axis_t lo, Axis_t up) 245 { 246 if (nbins<=0) 247 { 248 *fLog << warn << "WARNING - Number of bins cannot be <= 0... reset to 1." << endl; 249 nbins = 1; 250 } 251 252 if (up<lo) 253 { 254 *fLog << warn << "WARNING - Upper edge must be greater than lower edge... exchanging." << endl; 255 256 const Axis_t dummy(lo); 257 lo = up; 258 up = dummy; 259 } 260 246 261 const Double_t binsize = nbins<=0 ? 0 : (up-lo)/nbins; 247 262 fEdges.Set(nbins+1); … … 402 417 // lowest <lo> and highest <up> Edge (of your histogram) 403 418 // 404 void MBinning::SetEdgesLog( const Int_t nbins, constAxis_t lo, Axis_t up)419 void MBinning::SetEdgesLog(Int_t nbins, Axis_t lo, Axis_t up) 405 420 { 406 421 // if (lo==0) ... 422 if (nbins<=0) 423 { 424 *fLog << warn << "WARNING - Number of bins cannot be <= 0... reset to 1." << endl; 425 nbins = 1; 426 } 427 428 if (up<lo) 429 { 430 *fLog << warn << "WARNING - Upper edge must be greater than lower edge... exchanging." << endl; 431 432 const Axis_t dummy(lo); 433 lo = up; 434 up = dummy; 435 } 407 436 408 437 const Double_t binsize = log10(up/lo)/nbins; … … 419 448 // lowest [deg] <lo> and highest [deg] <up> Edge (of your histogram) 420 449 // 421 void MBinning::SetEdgesCos(const Int_t nbins, const Axis_t lo, Axis_t up) 422 { 450 void MBinning::SetEdgesCos(Int_t nbins, Axis_t lo, Axis_t up) 451 { 452 if (nbins<=0) 453 { 454 *fLog << warn << "WARNING - Number of bins cannot be <= 0... reset to 1." << endl; 455 nbins = 1; 456 } 457 458 if (up<lo) 459 { 460 *fLog << warn << "WARNING - Upper edge must be greater than lower edge... exchanging." << endl; 461 462 const Axis_t dummy(lo); 463 lo = up; 464 up = dummy; 465 } 466 423 467 // if (lo==0) ... 424 468 const Axis_t ld = lo/kRad2Deg; … … 436 480 // lowest [deg] <lo> and highest [deg] <up> Edge (of your histogram) 437 481 // 438 void MBinning::SetEdgesASin(const Int_t nbins, Axis_t lo, Axis_t up) 439 { 482 void MBinning::SetEdgesASin(Int_t nbins, Axis_t lo, Axis_t up) 483 { 484 if (nbins<=0) 485 { 486 *fLog << warn << "WARNING - Number of bins cannot be <= 0... reset to 1." << endl; 487 nbins = 1; 488 } 489 490 if (up<lo) 491 { 492 *fLog << warn << "WARNING - Upper edge must be greater than lower edge... exchanging." << endl; 493 494 const Axis_t dummy(lo); 495 lo = up; 496 up = dummy; 497 } 498 440 499 const Double_t binsize = nbins<=0 ? 0 : (up-lo)/nbins; 441 500 fEdges.Set(nbins+1); -
trunk/MagicSoft/Mars/mhbase/MBinning.h
r7142 r7413 62 62 void SetEdges(const MBinning &bins) { SetEdges(bins.fEdges); fType = bins.fType; fTitle = bins.fTitle; } 63 63 void SetEdges(const TH1 &h, const Char_t axis='x'); 64 void SetEdges( const Int_t nbins, const Axis_t lo, Axis_t up);64 void SetEdges(Int_t nbins, const Axis_t lo, const Axis_t up) { SetEdgesLin(nbins, lo, up); } 65 65 void SetEdges(const Int_t nbins, const Axis_t lo, Axis_t up, const char *opt); 66 void SetEdgesLog(const Int_t nbins, const Axis_t lo, Axis_t up); 67 void SetEdgesCos(const Int_t nbins, const Axis_t lo, Axis_t up); 68 void SetEdgesASin(const Int_t nbins, Axis_t lo, Axis_t up); 66 void SetEdgesLin(Int_t nbins, Axis_t lo, Axis_t up); 67 void SetEdgesLog(Int_t nbins, Axis_t lo, Axis_t up); 68 void SetEdgesCos(Int_t nbins, Axis_t lo, Axis_t up); 69 void SetEdgesASin(Int_t nbins, Axis_t lo, Axis_t up); 69 70 70 71 Int_t FindLoEdge(Double_t val) const -
trunk/MagicSoft/Mars/mhbase/MH3.cc
r6917 r7413 561 561 TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(fHist); 562 562 pad->SetBorderMode(0); 563 pad->SetGridx(); 564 pad->SetGridy(); 563 565 564 566 fHist->SetFillStyle(4000); -
trunk/MagicSoft/Mars/mhbase/MHMatrix.cc
r7399 r7413 209 209 } 210 210 211 void MHMatrix::AddColumns(const TCollection &list) 212 { 213 TIter Next(&list); 214 TObject *obj = 0; 215 while ((obj=Next())) 216 AddColumn(obj->GetName()); 217 } 218 219 211 220 // -------------------------------------------------------------------------- 212 221 // -
trunk/MagicSoft/Mars/mhbase/MHMatrix.h
r7399 r7413 73 73 Int_t AddColumn(const char *name); 74 74 void AddColumns(MDataArray *mat); 75 void AddColumns(const TCollection &list); 75 76 76 77 //MDataArray *GetColumns() { return fData; }
Note:
See TracChangeset
for help on using the changeset viewer.