Ignore:
Timestamp:
11/23/03 21:18:30 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mhist/MHCamera.cc

    r2557 r2563  
    299299{
    300300    if (fMinimum != -1111)
    301         return Profile(fMinimum);
     301        return fMinimum;
    302302
    303303    if (fNcells<=1)
     
    329329{
    330330    if (fMaximum!=-1111)
    331         return Profile(fMaximum);
     331        return fMaximum;
    332332
    333333    if (fNcells<=1)
     
    359359// To draw a camera into its own pad do something like:
    360360//
    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))
    371380//
    372381void MHCamera::Draw(Option_t *option)
     
    570579
    571580    if (opt.Contains("pixelindex"))
    572         PaintIndices(kFALSE);
     581        PaintIndices(0);
    573582    if (opt.Contains("sectorindex"))
    574         PaintIndices(kTRUE);
     583        PaintIndices(1);
     584    if (opt.Contains("content"))
     585        PaintIndices(2);
    575586}
    576587
     
    632643}
    633644
    634 void MHCamera::PaintIndices(Bool_t sector)
     645void MHCamera::PaintIndices(Int_t type)
    635646{
    636647    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)
    637654        return;
    638655
     
    646663
    647664        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        }
    649671
    650672        txt.SetTextSize(0.3*h.GetD()/fGeomCam->GetMaxRadius()/1.05);
Note: See TracChangeset for help on using the changeset viewer.