Ignore:
Timestamp:
04/26/02 10:17:49 (22 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

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

    r1082 r1303  
    4848MHFadcPix::MHFadcPix(UInt_t pixid) : fPixId(pixid)
    4949{
    50     Char_t *name  = StrDup(pixid ? Form("HiGain%03d", pixid) : "HiGain");
    51     Char_t *title = StrDup(pixid ? Form("Hi Gain Pixel #%d", pixid) : "Hi Gain Samples");
    52 
    53     fHistHi =  new TH1F(name, title, 256, 0, 255);
     50    fHistHi =  new TH1F(pixid ? Form("HiGain%03d", pixid) : "HiGain",
     51                        pixid ? Form("Hi Gain Pixel #%d", pixid) : "Hi Gain Samples",
     52                        256, -.5, 255.5);
    5453
    5554    fHistHi->SetDirectory(NULL);
     
    5756    fHistHi->SetYTitle("Count");
    5857
    59     delete [] name;
    60     delete [] title;
    61 
    62     name  = StrDup(pixid ? Form("LoGain%03d", pixid) : "LoGain");
    63     title = StrDup(pixid ? Form("Lo Gain Pixel #%d", pixid) : "Lo Gain Samples");
    64 
    65     fHistLo = new TH1F(name, title, 256, 0, 255);
     58    fHistLo = new TH1F(pixid ? Form("LoGain%03d", pixid) : "LoGain",
     59                       pixid ? Form("Lo Gain Pixel #%d", pixid) : "Lo Gain Samples",
     60                       256, -.5, 255.5);
    6661
    6762    fHistLo->SetDirectory(NULL);
    6863    fHistLo->SetXTitle("Signal/FADC Units");
    6964    fHistLo->SetYTitle("Count");
    70 
    71     delete [] name;
    72     delete [] title;
    7365}
    7466
     
    10597
    10698// --------------------------------------------------------------------------
     99//
     100// We need our own clone function to get rid of the histogram in any
     101// directory
     102//
     103TObject *MHFadcPix::Clone(const char *) const
     104{
     105    MHFadcPix &pix = *(MHFadcPix*)TObject::Clone();
     106
     107    pix.fHistHi->SetDirectory(NULL);
     108    pix.fHistLo->SetDirectory(NULL);
     109
     110    return &pix;
     111}
     112
     113// --------------------------------------------------------------------------
    107114void MHFadcPix::Draw(Option_t *)
    108115{
     
    110117    {
    111118        const char *name  = StrDup(fPixId ? Form("Pixel #%d", fPixId) : "Pixel");
    112         const char *title = StrDup(fPixId ? Form("%s FADC Samples", name) : "FADC Samples");
    113         MH::MakeDefCanvas(name, title);
     119        MH::MakeDefCanvas(name, fPixId ? Form("%s FADC Samples", name) : "FADC Samples");
    114120        delete [] name;
    115         delete [] title;
    116121    }
    117122
Note: See TracChangeset for help on using the changeset viewer.