Changeset 959 for trunk/MagicSoft/Mars/mhist
- Timestamp:
- 10/02/01 14:46:56 (23 years ago)
- Location:
- trunk/MagicSoft/Mars/mhist
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhist/MHFadcPix.cc
r859 r959 46 46 { 47 47 // FIXME! Set the right axis titles and ... and ... 48 Char_t tmp1[40] ="hi";49 Char_t tmp2[40] ="hi gain Pixel";48 Char_t tmp1[40]; 49 Char_t tmp2[40]; 50 50 51 if (pixid)52 {53 sprintf(tmp1, "%s%d", tmp1, pixid);54 sprintf(tmp2, "%s %d", tmp2, pixid);55 }51 // if (pixid) 52 // { 53 sprintf(tmp1, "HiGain%03d", pixid); 54 sprintf(tmp2, "Hi Gain Pixel #%d", pixid); 55 // } 56 56 fHistHi = new TH1F(tmp1, tmp2, 256, 0, 255); 57 57 58 59 Char_t tmp3[40]="lo"; 60 Char_t tmp4[40]="lo gain Pixel"; 61 62 if (pixid) 63 { 64 sprintf(tmp3, "%s%d", tmp3, pixid); 65 sprintf(tmp4, "%s %d", tmp4, pixid); 66 } 67 fHistLo = new TH1F(tmp3, tmp4, 256, 0, 255); 58 // if (pixid) 59 // { 60 sprintf(tmp1, "LoGain%03d", pixid); 61 sprintf(tmp2, "Lo Gain Pixel #%d", pixid); 62 // } 63 fHistLo = new TH1F(tmp2, tmp2, 256, 0, 255); 68 64 } 69 65 -
trunk/MagicSoft/Mars/mhist/MHHillas.cc
r957 r959 132 132 void MHHillas::Draw(Option_t *) 133 133 { 134 if (!gPad) 135 { 136 if (!gROOT->GetMakeDefCanvas()) 137 return; 138 (gROOT->GetMakeDefCanvas())(); 139 } 134 140 135 // 136 // Fixme! Check for an existing canvas. 137 // And create one if no canvas exists only! 138 // 139 TCanvas *c = new TCanvas("Hillas", "Histograms of Hillas Parameters"); 140 c->Divide(2,2); 141 //TCanvas *c = new TCanvas("Hillas", "Histograms of Hillas Parameters"); 142 gPad->Divide(2,2); 141 143 142 c->cd(1);144 gPad->cd(1); 143 145 fAlpha->Draw(); 144 146 145 c->cd(2);147 gPad->cd(2); 146 148 fLength->Draw(); 147 149 148 c->cd(3);150 gPad->cd(3); 149 151 fDist->Draw(); 150 152 151 c->cd(4);153 gPad->cd(4); 152 154 fWidth->Draw(); 153 155 154 c->Modified();155 c->Update();156 gPad->Modified(); 157 gPad->Update(); 156 158 } -
trunk/MagicSoft/Mars/mhist/MHMcCollectionArea.cc
r957 r959 110 110 void MHMcCollectionArea::DrawAll(Option_t* option) 111 111 { 112 TCanvas *c=new TCanvas(fHistAll->GetName(), fHistAll->GetTitle()); 112 if (!gPad) 113 { 114 if (!gROOT->GetMakeDefCanvas()) 115 return; 116 (gROOT->GetMakeDefCanvas())(); 117 } 118 119 //TCanvas *c=new TCanvas(fHistAll->GetName(), fHistAll->GetTitle()); 113 120 114 121 fHistAll->Draw(option); 115 122 116 c->Modified();117 c->Update();123 gPad->Modified(); 124 gPad->Update(); 118 125 } 119 126 … … 124 131 void MHMcCollectionArea::DrawSel(Option_t* option) 125 132 { 126 TCanvas *c=new TCanvas(fHistSel->GetName(), fHistSel->GetTitle()); 133 if (!gPad) 134 { 135 if (!gROOT->GetMakeDefCanvas()) 136 return; 137 (gROOT->GetMakeDefCanvas())(); 138 } 139 140 //TCanvas *c=new TCanvas(fHistSel->GetName(), fHistSel->GetTitle()); 127 141 128 142 fHistSel->Draw(option); 129 143 130 c->Modified();131 c->Update();144 gPad->Modified(); 145 gPad->Update(); 132 146 } 133 147 … … 157 171 void MHMcCollectionArea::Draw(Option_t* option) 158 172 { 159 TCanvas *c=new TCanvas(fHistCol->GetName(), fHistCol->GetTitle()); 173 if (!gPad) 174 { 175 if (!gROOT->GetMakeDefCanvas()) 176 return; 177 (gROOT->GetMakeDefCanvas())(); 178 } 179 // TCanvas *c=new TCanvas(fHistCol->GetName(), fHistCol->GetTitle()); 160 180 161 181 fHistCol->Draw(option); 162 182 163 c->Modified();164 c->Update();183 gPad->Modified(); 184 gPad->Update(); 165 185 } 166 186 -
trunk/MagicSoft/Mars/mhist/MHMcEnergy.cc
r954 r959 133 133 } 134 134 135 // ------------------------------------------------------------------------ 136 // 137 // Helper function for Draw() and DrawClone() which adds some useful 138 // information to the plot. 139 // 135 140 void MHMcEnergy::DrawLegend() const 136 141 { … … 157 162 void MHMcEnergy::Draw(Option_t *option) 158 163 { 159 TCanvas *c=new TCanvas(fHist->GetName(), fHist->GetTitle()); 164 if (!gPad) 165 { 166 if (!gROOT->GetMakeDefCanvas()) 167 return; 168 (gROOT->GetMakeDefCanvas())(); 169 } 170 //TCanvas *c=new TCanvas(fHist->GetName(), fHist->GetTitle()); 160 171 161 172 fHist->Draw(option); … … 163 174 DrawLegend(); 164 175 165 c->Modified();166 c->Update();176 gPad->Modified(); 177 gPad->Update(); 167 178 } 168 179 -
trunk/MagicSoft/Mars/mhist/MHStarMap.cc
r952 r959 196 196 void MHStarMap::Draw(Option_t *) 197 197 { 198 TCanvas *c = new TCanvas("Star Map", "Star Map created from Hillas Parameters", 500, 500); 198 if (!gPad) 199 { 200 if (!gROOT->GetMakeDefCanvas()) 201 return; 202 (gROOT->GetMakeDefCanvas())(); 203 } 204 205 // TCanvas *c = new TCanvas("Star Map", "Star Map created from Hillas Parameters", 500, 500); 199 206 200 207 PrepareDrawing(); … … 202 209 fStarMap->Draw("colz"); 203 210 204 c->Modified();205 c->Update();206 } 207 211 gPad->Modified(); 212 gPad->Update(); 213 } 214
Note:
See TracChangeset
for help on using the changeset viewer.