Changeset 1303 for trunk/MagicSoft/Mars/mhist/MHFadcPix.cc
- Timestamp:
- 04/26/02 10:17:49 (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhist/MHFadcPix.cc
r1082 r1303 48 48 MHFadcPix::MHFadcPix(UInt_t pixid) : fPixId(pixid) 49 49 { 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); 54 53 55 54 fHistHi->SetDirectory(NULL); … … 57 56 fHistHi->SetYTitle("Count"); 58 57 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); 66 61 67 62 fHistLo->SetDirectory(NULL); 68 63 fHistLo->SetXTitle("Signal/FADC Units"); 69 64 fHistLo->SetYTitle("Count"); 70 71 delete [] name;72 delete [] title;73 65 } 74 66 … … 105 97 106 98 // -------------------------------------------------------------------------- 99 // 100 // We need our own clone function to get rid of the histogram in any 101 // directory 102 // 103 TObject *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 // -------------------------------------------------------------------------- 107 114 void MHFadcPix::Draw(Option_t *) 108 115 { … … 110 117 { 111 118 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"); 114 120 delete [] name; 115 delete [] title;116 121 } 117 122
Note:
See TracChangeset
for help on using the changeset viewer.