Changeset 2563 for trunk/MagicSoft/Mars/mhist/MHCamera.cc
- Timestamp:
- 11/23/03 21:18:30 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhist/MHCamera.cc
r2557 r2563 299 299 { 300 300 if (fMinimum != -1111) 301 return Profile(fMinimum);301 return fMinimum; 302 302 303 303 if (fNcells<=1) … … 329 329 { 330 330 if (fMaximum!=-1111) 331 return Profile(fMaximum);331 return fMaximum; 332 332 333 333 if (fNcells<=1) … … 359 359 // To draw a camera into its own pad do something like: 360 360 // 361 // MGeomCamMagic m; 362 // MHCamera *d=new MHCamera(m); 363 // 364 // TCanvas *c = new TCanvas; 365 // c->Divide(2,1); 366 // c->cd(1); 367 // 368 // d->FillRandom(); 369 // d->Draw(); 370 // d->SetBit(kCanDelete); 361 // MGeomCamMagic m; 362 // MHCamera *d=new MHCamera(m); 363 // 364 // TCanvas *c = new TCanvas; 365 // c->Divide(2,1); 366 // c->cd(1); 367 // 368 // d->FillRandom(); 369 // d->Draw(); 370 // d->SetBit(kCanDelete); 371 // 372 // There are several drawing options: 373 // 'hist' Draw as a standard TH1 histogram (value vs. pixel index) 374 // 'box' Draw hexagons which size is in respect to its contents 375 // 'nocol' Leave the 'boxed' hexagons empty 376 // 'pixelindex' Display the pixel index in each pixel 377 // 'sectorindex' Display the sector index in each pixel 378 // 'content' Display the relative content aligned to GetMaximum() and 379 // GeMinimum() ((val-min)/(max-min)) 371 380 // 372 381 void MHCamera::Draw(Option_t *option) … … 570 579 571 580 if (opt.Contains("pixelindex")) 572 PaintIndices( kFALSE);581 PaintIndices(0); 573 582 if (opt.Contains("sectorindex")) 574 PaintIndices(kTRUE); 583 PaintIndices(1); 584 if (opt.Contains("content")) 585 PaintIndices(2); 575 586 } 576 587 … … 632 643 } 633 644 634 void MHCamera::PaintIndices( Bool_t sector)645 void MHCamera::PaintIndices(Int_t type) 635 646 { 636 647 if (fNcells<=1) 648 return; 649 650 const Double_t min = GetMinimum(); 651 const Double_t max = GetMaximum(); 652 653 if (type==2 && max==min) 637 654 return; 638 655 … … 646 663 647 664 TString num; 648 num += sector ? h.GetSector() : i; 665 switch (type) 666 { 667 case 0: num += i; break; 668 case 1: num += h.GetSector(); break; 669 case 2: num += (Int_t)((fArray[i+1]-min)/(max-min)); break; 670 } 649 671 650 672 txt.SetTextSize(0.3*h.GetD()/fGeomCam->GetMaxRadius()/1.05);
Note:
See TracChangeset
for help on using the changeset viewer.