Changeset 1502
- Timestamp:
- 08/16/02 08:58:34 (22 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r1501 r1502 1 1 -*-*- END -*-*- 2 3 2002/08/16: Thomas Bretz 4 5 * mhist/MFillH.cc: 6 - if not title is given create a default title from the names 7 8 * mhist/MHHillas.cc, mhist/MHHillasExt.cc: 9 - added legends. (still work to be done with the stat boxes) 10 11 2 12 3 13 2002/08/14: Thomas Bretz -
trunk/MagicSoft/Mars/mhist/MFillH.cc
r1483 r1502 130 130 fHName = hist; 131 131 fParContainerName = par; 132 133 if (title) 134 return; 135 136 fTitle = "Fill " + fHName; 137 if (!par) 138 return; 139 140 fTitle += " from " + fParContainerName; 132 141 } 133 142 … … 163 172 fParContainer = par; 164 173 fParContainerName = par->GetName(); 174 175 if (!title) 176 fTitle = "Fill " + fHName + " from " + par->GetDescriptor(); 165 177 } 166 178 … … 181 193 fHName = hist->GetName(); 182 194 fParContainerName = par; 195 196 if (title) 197 return; 198 199 fTitle = (TString)"Fill " + hist->GetDescriptor(); 200 if (!par) 201 return; 202 203 fTitle += " from " + fParContainerName; 183 204 } 184 205 … … 200 221 fParContainer = par; 201 222 fParContainerName = par->GetName(); 223 224 if (!title) 225 fTitle = (TString)"Fill " + hist->GetDescriptor() + " from " + par->GetDescriptor(); 202 226 } 203 227 -
trunk/MagicSoft/Mars/mhist/MHHillas.cc
r1489 r1502 41 41 #include <TStyle.h> 42 42 #include <TCanvas.h> 43 #include <TLegend.h> 43 44 44 45 #include "MLog.h" … … 73 74 fUsedPix = new TH1F("UsedPix", "Number of used pixels", 150, 0, 150); 74 75 fCorePix = new TH1F("CorePix", "Number of core pixels", 150, 0, 150); 76 77 fLength->SetLineColor(kBlue); 78 fCorePix->SetLineColor(kRed); 79 fUsedPix->SetLineColor(kGreen); 75 80 76 81 fLength->SetDirectory(NULL); … … 290 295 291 296 c->cd(1); 292 fWidth->DrawCopy(); 293 fLength->SetLineColor(kBlue); 294 fLength->DrawCopy("same"); 297 298 TObject *obj; 299 TLegend *l = new TLegend(0.75, 0.8, 0.9, 0.9); 300 obj = fWidth->DrawCopy(); 301 ((TH1*)obj)->SetTitle(" Width / Length "); 302 l->AddEntry(obj, "Width"); 303 obj = fLength->DrawCopy("same"); 304 l->AddEntry(obj, "Length"); 305 l->SetBit(kCanDelete); 306 l->Draw(); 295 307 296 308 c->cd(2); … … 299 311 300 312 c->cd(3); 301 fCorePix->SetLineColor(kRed); 302 fCorePix->DrawCopy(); 303 fUsedPix->SetLineColor(kGreen); 304 fUsedPix->DrawCopy("same"); 313 l = new TLegend(0.70, 0.8, 0.9, 0.9); 314 obj = fCorePix->DrawCopy(); 315 ((TH1*)obj)->SetTitle(" Number of core/used Pixels "); 316 l->AddEntry(obj, "# Core Pixels"); 317 obj = fUsedPix->DrawCopy("same"); 318 l->AddEntry(obj, "# Used Pixels"); 319 l->SetBit(kCanDelete); 320 l->Draw(); 305 321 306 322 c->cd(4); … … 335 351 gPad->cd(1); 336 352 fWidth->Draw(); 337 fLength->SetLineColor(kBlue);338 353 fLength->Draw("same"); 339 354 … … 343 358 344 359 gPad->cd(3); 345 fCorePix->SetLineColor(kRed);346 360 fCorePix->Draw(); 347 fUsedPix->SetLineColor(kGreen);348 361 fUsedPix->Draw("same"); 349 362 -
trunk/MagicSoft/Mars/mhist/MHHillasExt.cc
r1490 r1502 37 37 #include <TH1.h> 38 38 #include <TPad.h> 39 #include <TLegend.h> 39 40 #include <TCanvas.h> 40 41 … … 259 260 gROOT->SetSelectedPad(NULL); 260 261 261 262 262 c.cd(1); 263 ((TH1F)fHConc1).DrawCopy(); 264 ((TH1F)fHConc).DrawCopy("same"); 263 TObject *obj; 264 TLegend *l = new TLegend(0.75, 0.8, 0.9, 0.9); 265 obj = ((TH1F)fHConc1).DrawCopy(); 266 ((TH1*)obj)->SetTitle(" Concentrations "); 267 l->AddEntry(obj, "Conc1"); 268 obj = ((TH1F)fHConc).DrawCopy("same"); 269 l->AddEntry(obj, "Conc2"); 270 l->SetBit(kCanDelete); 271 l->Draw(); 265 272 266 273 c.cd(2); … … 293 300 294 301 gPad->cd(1); 295 fHConc1.SetLineColor(kBlue);296 302 fHConc1.Draw(); 297 303 fHConc.Draw("same"); 298 304 305 TLegend *l = new TLegend(0.75, 0.8, 0.9, 0.9); 306 l->AddEntry((TH1*)&fHConc1, "Conc 1"); 307 l->AddEntry((TH1*)&fHConc, "Conc"); 308 l->SetBit(kCanDelete); 309 l->Draw(); 310 299 311 gPad->cd(2); 300 312 fHAsym.Draw();
Note:
See TracChangeset
for help on using the changeset viewer.