Changeset 1303 for trunk/MagicSoft


Ignore:
Timestamp:
04/26/02 10:17:49 (23 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r1301 r1303  
    11                                                                  -*-*- END -*-*-
     2 2002/04/26: Thomas Bretz
     3
     4   * mhist/MHFadcCam.cc:
     5     - start numbering of pixels with 1
     6
     7   * mhist/MHFadcPix.[h,cc]:
     8     - overloaded clone to get rid of the histograms in any directory
     9     - removed some unnecessary StrDup calls
     10     - changed binning (Thanks to Abelardo)
     11
     12
     13
    214 2002/04/25: Thomas Bretz
    315
  • trunk/MagicSoft/Mars/mhist/MHFadcCam.cc

    r1211 r1303  
    6060
    6161    for (Int_t i=0; i<577; i++)
    62         (*fArray)[i] = new MHFadcPix(i);
     62        (*fArray)[i] = new MHFadcPix(i+1);
    6363}
    6464
  • 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
  • trunk/MagicSoft/Mars/mhist/MHFadcPix.h

    r1015 r1303  
    2929    void DrawLo();
    3030
     31    TObject *Clone(const char *) const;
     32
    3133    void Draw(Option_t *opt=NULL);
    3234
Note: See TracChangeset for help on using the changeset viewer.