Changeset 1966 for trunk/MagicSoft/Mars/mhist
- Timestamp:
- 04/20/03 12:51:47 (22 years ago)
- Location:
- trunk/MagicSoft/Mars/mhist
- Files:
-
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhist/MFillH.cc
r1965 r1966 469 469 fCanvas->cd(); 470 470 fH->DrawClone("nonew"); 471 fCanvas->Modified(); 472 fCanvas->Update(); 471 473 } 472 474 -
trunk/MagicSoft/Mars/mhist/MH.cc
r1965 r1966 584 584 // Draw first histogram 585 585 // 586 TH1 *h1 = ( TH1*)((TH1&)hist1).DrawCopy();586 TH1 *h1 = ((TH1&)hist1).DrawCopy(); 587 587 gPad->SetBorderMode(0); 588 588 gPad->Update(); 589 590 h1->SetMaximum(TMath::Max(hist1.GetMaximum(), hist2.GetMaximum())); 591 h1->SetMinimum(TMath::Min(hist1.GetMinimum(), hist2.GetMinimum())); 589 592 590 593 TPaveText *t = (TPaveText*)gPad->FindObject("title"); … … 609 612 // 610 613 TPaveStats &s1 = *(TPaveStats*)gPad->FindObject("stats"); 611 s1.SetX1NDC(s1.GetX1NDC()-0.01); 612 s1.SetName("MHStat"); 614 const Double_t x1 = s1.GetX1NDC()-0.01; 615 s1.SetName((TString)"Stat"+hist1.GetTitle()); 616 s1.SetX1NDC(x1-(s1.GetX2NDC()-s1.GetX1NDC())); 617 s1.SetX2NDC(x1); 613 618 614 619 // 615 620 // Draw second histogram 616 621 // 617 TH1 *h2 = (TH1*)((TH1&)hist2).DrawCopy("sames");622 ((TH1&)hist2).DrawCopy("sames"); 618 623 gPad->Update(); 619 624 620 625 // 621 // Set new position of second statistics box626 // Draw Legend 622 627 // 623 628 TPaveStats &s2 = *(TPaveStats*)gPad->FindObject("stats"); 624 s2.SetX1NDC(s1.GetX1NDC()-(s2.GetX2NDC()-s2.GetX1NDC())-0.01); 625 s2.SetX2NDC(s1.GetX1NDC()-0.01); 626 627 // 628 // Draw Legend 629 // 630 const Int_t n = s1.GetListOfLines()->GetSize(); 631 const Double_t h = s1.GetY2NDC()-s1.GetY1NDC(); 632 TLegend &l = *new TLegend(s1.GetX1NDC(), s1.GetY1NDC()-0.015-h*2/n, 633 s1.GetX2NDC(), s1.GetY1NDC()-0.01 634 ); 635 l.AddEntry(h1, h1->GetTitle()); 636 l.AddEntry(h2, h2->GetTitle()); 629 TLegend &l = *new TLegend(s2.GetX1NDC(), 630 s2.GetY1NDC()-0.015-(s2.GetY2NDC()-s2.GetY1NDC())/2, 631 s2.GetX2NDC(), 632 s2.GetY1NDC()-0.01 633 ); 634 l.AddEntry((TH1*)&hist1, hist1.GetTitle()); 635 l.AddEntry((TH1*)&hist2, hist2.GetTitle()); 637 636 l.SetTextSize(s2.GetTextSize()); 638 637 l.SetTextFont(s2.GetTextFont()); 639 638 l.SetBorderSize(s2.GetBorderSize()); 640 639 l.SetBit(kCanDelete); 641 642 640 l.Draw(); 643 641 } … … 656 654 gPad->SetBorderMode(0); 657 655 gPad->Update(); 656 657 hist1.SetMaximum(TMath::Max(hist1.GetMaximum(), hist2.GetMaximum())); 658 hist1.SetMinimum(TMath::Min(hist1.GetMinimum(), hist2.GetMinimum())); 658 659 659 660 TPaveText *t = (TPaveText*)gPad->FindObject("title"); … … 678 679 // 679 680 TPaveStats &s1 = *(TPaveStats*)gPad->FindObject("stats"); 680 s1.SetX1NDC(s1.GetX1NDC()-0.01);681 const Double_t x1 = s1.GetX1NDC()-0.01; 681 682 s1.SetName((TString)"Stat"+hist1.GetTitle()); 683 s1.SetX1NDC(x1-(s1.GetX2NDC()-s1.GetX1NDC())); 684 s1.SetX2NDC(x1); 682 685 683 686 // … … 685 688 // 686 689 hist2.Draw("sames"); 687 688 690 gPad->Update(); 689 691 690 692 // 691 // Set new position of second statistics box693 // Draw Legend 692 694 // 693 695 TPaveStats &s2 = *(TPaveStats*)gPad->FindObject("stats"); 694 s2.SetX1NDC(s1.GetX1NDC()-(s2.GetX2NDC()-s2.GetX1NDC())-0.01); 695 s2.SetX2NDC(s1.GetX1NDC()-0.01); 696 697 // 698 // Draw Legend 699 // 700 TLegend &l = *new TLegend(s1.GetX1NDC(), 701 s1.GetY1NDC()-0.015-(s1.GetY2NDC()-s1.GetY1NDC())/2, 702 s1.GetX2NDC(), 703 s1.GetY1NDC()-0.01 696 TLegend &l = *new TLegend(s2.GetX1NDC(), 697 s2.GetY1NDC()-0.015-(s2.GetY2NDC()-s2.GetY1NDC())/2, 698 s2.GetX2NDC(), 699 s2.GetY1NDC()-0.01 704 700 ); 705 701 l.AddEntry(&hist1, hist1.GetTitle()); -
trunk/MagicSoft/Mars/mhist/MH3.cc
r1965 r1966 112 112 fTitle = Form(gsDefTitle.Data(), 1); 113 113 114 fHist->SetDirectory(NULL); 114 if (fHist) 115 fHist->SetDirectory(NULL); 115 116 116 117 fScale[0] = 1; … … 451 452 // pointer to it from this function 452 453 // 454 /* 453 455 TObject *MH3::DrawClone(Option_t *opt) const 454 456 { … … 499 501 return c; 500 502 } 503 */ 501 504 502 505 // -------------------------------------------------------------------------- … … 517 520 void MH3::Draw(Option_t *opt) 518 521 { 519 if (!gPad) 520 MH::MakeDefCanvas(fHist); 522 TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(fHist); 523 pad->SetBorderMode(0); 524 525 AppendPad(""); 521 526 522 527 TString str(opt); 523 528 529 // FIXME: Do it in Paint() 524 530 if (str.Contains("COL", TString::kIgnoreCase)) 525 531 SetColors(); 532 533 fHist->SetFillStyle(4000); 526 534 527 535 Bool_t only = str.Contains("ONLY", TString::kIgnoreCase) && fDimension==2; … … 546 554 } 547 555 548 if (fHist->TestBit(kIsLogx)) gPad->SetLogx();549 if (fHist->TestBit(kIsLogy)) gPad->SetLogy();550 if (fHist->TestBit(kIsLogz)) gPad->SetLogz();551 552 gPad->Modified();553 gPad->Update();556 if (fHist->TestBit(kIsLogx)) pad->SetLogx(); 557 if (fHist->TestBit(kIsLogy)) pad->SetLogy(); 558 if (fHist->TestBit(kIsLogz)) pad->SetLogz(); 559 560 pad->Modified(); 561 pad->Update(); 554 562 } 555 563 -
trunk/MagicSoft/Mars/mhist/MHCerPhotEvt.cc
r1965 r1966 165 165 pad->SetBorderMode(0); 166 166 167 //168 // All this is necessary to get the background in the correct color169 //170 pad->Divide(1,1);171 pad->cd(1);172 173 gPad->SetBorderMode(0);174 gPad->SetFillColor(gPad->GetFillColor());175 176 //177 // set the color palette for the TBox elements178 //179 167 AppendPad(""); 180 181 //182 // Necessary to visualize the background color (FIXME?)183 //184 gPad->Modified();185 gPad->Update();186 168 } 187 169 -
trunk/MagicSoft/Mars/mhist/MHMcIntRate.cc
r1606 r1966 81 81 } 82 82 83 //-------------------------------------------------------------------------84 //85 // Defualt Destructor86 //87 MHMcIntRate::~MHMcIntRate()88 {89 }90 91 83 // ------------------------------------------------------------------------ 92 84 // … … 95 87 void MHMcIntRate::Draw(Option_t *option) 96 88 { 97 if (!gPad)98 MH::MakeDefCanvas(&fHist);89 TVirtualPad *pad = gPad ? gPad : MH::MakeDefCanvas(this); 90 pad->SetBorderMode(0); 99 91 100 gPad->SetLogx(); 92 AppendPad(""); 93 94 pad->SetLogx(); 101 95 102 96 fHist.Draw(option); 103 97 104 gPad->Modified(); 105 gPad->Update(); 106 } 107 108 TObject *MHMcIntRate::DrawClone(Option_t *option) const 109 { 110 TCanvas *c = MH::MakeDefCanvas(&fHist); 111 112 c->SetLogx(); 113 114 // 115 // This is necessary to get the expected bahviour of DrawClone 116 // 117 gROOT->SetSelectedPad(NULL); 118 119 ((TH1D&)fHist).DrawCopy(option); 120 121 c->Modified(); 122 c->Update(); 123 124 return c; 98 pad->Modified(); 99 pad->Update(); 125 100 } 126 101 -
trunk/MagicSoft/Mars/mhist/MHMcIntRate.h
r1663 r1966 21 21 public: 22 22 MHMcIntRate(const char *name=NULL, const char *title=NULL); 23 ~MHMcIntRate();24 23 25 24 void SetName(const char *name); … … 32 31 33 32 void Draw(Option_t* option = ""); 34 TObject *DrawClone(Option_t* option = "") const;35 33 36 34 void Calc(const MHMcDifRate &rate); -
trunk/MagicSoft/Mars/mhist/MHRanForest.cc
r1929 r1966 67 67 fGraphSigma->SetTitle("Evolution of Standard deviation of estimated hadronness in tree combination"); 68 68 fGraphSigma->SetMaximum(1); 69 fGraphSigma->SetMarkerStyle(kFullDotSmall); 69 70 } 70 71 … … 157 158 // -------------------------------------------------------------------------- 158 159 // 159 // Draw clone of histogram160 //161 TObject *MHRanForest::DrawClone(Option_t *opt) const162 {163 if (fGraphSigma->GetN()==0)164 return NULL;165 166 TCanvas &c = *MakeDefCanvas("RanForest", fTitle);167 gROOT->SetSelectedPad(NULL);168 169 //gStyle->SetOptStat(10);170 TGraph &g = (TGraph&)*fGraphSigma->DrawClone("AL");171 g.SetBit(kCanDelete);172 gPad->Modified();173 gPad->Update();174 if (g.GetHistogram())175 {176 g.GetXaxis()->SetRangeUser(0, fNumEvent);177 g.GetXaxis()->SetTitle("Number of Trees");178 g.GetYaxis()->SetTitle("Standard deviation of estimated hadronness");179 g.SetMarkerStyle(kFullDotMedium);180 gPad->Modified();181 gPad->Update();182 //g.Draw("P");183 }184 gPad->SetGrid();185 186 return &c;187 }188 189 // --------------------------------------------------------------------------190 //191 160 // Draw histogram. (For the Meaning see class description) 192 161 // … … 196 165 return; 197 166 198 if (!gPad)199 MakeDefCanvas("RanForest", fTitle);167 TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(this); 168 pad->SetBorderMode(0); 200 169 201 //gStyle->SetOptStat(10); 170 AppendPad(""); 171 202 172 fGraphSigma->Draw("ALP"); 203 gPad->Modified(); 204 gPad->Update(); 205 if (fGraphSigma->GetHistogram()) 206 { 207 fGraphSigma->GetXaxis()->SetRangeUser(0, 1); 208 fGraphSigma->GetXaxis()->SetTitle("Number of Trees"); 209 fGraphSigma->GetYaxis()->SetTitle("Standard deviation of estimated hadronness"); 173 pad->Modified(); 174 pad->Update(); 210 175 211 fGraphSigma->SetMarkerStyle(kFullDotSmall); 212 //fGraphSigma->Draw("P"); 213 gPad->Modified(); 214 gPad->Update(); 215 } 176 TH1 *h=fGraphSigma->GetHistogram(); 177 if (!h) 178 return; 179 180 h->GetXaxis()->SetRangeUser(0, 1); 181 h->SetXTitle("No.of Trees"); 182 h->SetYTitle("\\sigma of est.hadronness"); 183 184 pad->Modified(); 185 pad->Update(); 216 186 } -
trunk/MagicSoft/Mars/mhist/MHRanForest.h
r1880 r1966 37 37 38 38 void Draw(Option_t *opt=""); 39 TObject *DrawClone(Option_t *opt="") const;40 39 41 40 ClassDef(MHRanForest, 1) // Histogram showing variance of estimated Hadronness -
trunk/MagicSoft/Mars/mhist/MHRanForestGini.cc
r1929 r1966 65 65 fGraphGini->SetTitle("Importance of RF-input parameters measured by mean Gini decrease"); 66 66 fGraphGini->SetMaximum(1); 67 fGraphGini->SetMarkerStyle(kFullDotSmall); 67 68 } 68 69 … … 140 141 // -------------------------------------------------------------------------- 141 142 // 142 // Draw clone of histogram (For the Meaning see class description)143 //144 TObject *MHRanForestGini::DrawClone(Option_t *opt) const145 {146 if (fGraphGini->GetN()==0)147 return NULL;148 149 TCanvas &c = *MakeDefCanvas("RanForestGini", fTitle);150 gROOT->SetSelectedPad(NULL);151 152 //gStyle->SetOptStat(10);153 TGraph &g = (TGraph&)*fGraphGini->DrawClone("AL");154 g.SetBit(kCanDelete);155 gPad->Modified();156 gPad->Update();157 if (g.GetHistogram())158 {159 g.GetXaxis()->SetRangeUser(0, fRanForest->GetNumTrees());160 g.GetXaxis()->SetTitle("No. of RF-input parameter");161 g.GetYaxis()->SetTitle("Mean decrease in Gini-index [a.u.]");162 g.SetMarkerStyle(kFullDotMedium);163 //g.Draw("P");164 gPad->Modified();165 gPad->Update();166 }167 gPad->SetGrid();168 169 return &c;170 }171 172 // --------------------------------------------------------------------------173 //174 143 // Draw histogram. (For the Meaning see class description) 175 144 // 176 145 void MHRanForestGini::Draw(Option_t *) 177 146 { 178 if (fGraphGini->GetN()==0)147 if (fGraphGini->GetN()==0) 179 148 return; 180 149 181 if (!gPad)182 MakeDefCanvas("RanForest", fTitle);150 TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(this); 151 pad->SetBorderMode(0); 183 152 184 //gStyle->SetOptStat(10); 153 AppendPad(""); 154 185 155 fGraphGini->Draw("ALP"); 186 gPad->Modified(); 187 gPad->Update(); 188 if (fGraphGini->GetHistogram()) 189 { 190 fGraphGini->GetXaxis()->SetRangeUser(0, 1); 191 fGraphGini->GetXaxis()->SetTitle("No. of RF-input parameter"); 192 fGraphGini->GetYaxis()->SetTitle("Mean decrease in Gini-index [a.u.]"); 156 pad->Modified(); 157 pad->Update(); 193 158 194 fGraphGini->SetMarkerStyle(kFullDotSmall); 195 //fGraphGini->Draw("P"); 196 gPad->Modified(); 197 gPad->Update(); 198 } 159 TH1 *h = fGraphGini->GetHistogram(); 160 if (!h) 161 return; 162 163 h->GetXaxis()->SetRangeUser(0, 1); 164 h->SetXTitle("No.of RF-input parameter"); 165 h->SetYTitle("Mean decrease in Gini-index [a.u.]"); 166 167 pad->Modified(); 168 pad->Update(); 199 169 } -
trunk/MagicSoft/Mars/mhist/MHRanForestGini.h
r1880 r1966 35 35 36 36 void Draw(Option_t *opt=""); 37 TObject *DrawClone(Option_t *opt="") const;38 37 39 38 ClassDef(MHRanForestGini, 1) -
trunk/MagicSoft/Mars/mhist/MHSigmaPixel.cc
r1951 r1966 124 124 void MHSigmaPixel::Draw(Option_t *opt) 125 125 { 126 //gStyle->SetOptStat(1000); 127 if (!gPad) 128 MakeDefCanvas("SigmaPixel", fTitle); 129 130 fHist.Draw(opt); 131 132 gPad->Modified(); 133 gPad->Update(); 126 TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(this); 127 pad->SetBorderMode(0); 128 129 AppendPad(""); 130 131 fHist.Draw(opt); 132 133 gPad->Modified(); 134 gPad->Update(); 134 135 } 135 136 136 // --------------------------------------------------------------------------137 //138 // Draw copies of the histogram139 //140 TObject *MHSigmaPixel::DrawClone(Option_t *opt) const141 {142 //gStyle->SetOptStat(1000);143 TCanvas &c = *MakeDefCanvas("SigmaPixel", fTitle);144 145 ((TH2&)fHist).DrawCopy(opt);146 147 c.Modified();148 c.Update();149 150 return &c;151 }152 -
trunk/MagicSoft/Mars/mhist/MHSigmaPixel.h
r1951 r1966 35 35 36 36 void Draw(Option_t *option=""); 37 TObject *DrawClone(Option_t *option="") const;38 37 39 38 ClassDef(MHSigmaPixel, 1) //2D-histogram in Sigma and Pixel number -
trunk/MagicSoft/Mars/mhist/MHSigmaTheta.cc
r1961 r1966 249 249 TObject *MHSigmaTheta::DrawClone(Option_t *opt) 250 250 { 251 TCanvas &c = *MakeDefCanvas("SigmaThetaPlot", "Sigmabar vs. Theta", 252 900, 900); 253 c.Divide(3, 3); 254 255 gROOT->SetSelectedPad(NULL); 256 257 //-------------------------------------------------------------------- 251 return MH::DrawClone(opt, 900, 900); 252 } 253 254 // -------------------------------------------------------------------------- 255 // 256 // Draw the histogram 257 // 258 void MHSigmaTheta::Draw(Option_t *opt) 259 { 260 TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(this, 900, 900); 261 pad->SetBorderMode(0); 262 263 AppendPad(""); 264 265 pad->Divide(3, 3); 266 258 267 // draw the 2D histogram Sigmabar versus Theta 259 TH1D *h; 260 261 c.cd(1); 262 h = ((TH2*)&fSigmaTheta)->ProjectionX("ProjX-Theta", -1, 9999, "E"); 268 TH1 *h; 269 270 pad->cd(1); 271 gPad->SetLogy(); 272 h = fSigmaTheta.ProjectionX("ProjX-Theta", -1, 9999, "E"); 263 273 h->SetDirectory(NULL); 264 274 h->SetTitle("Distribution of \\Theta"); 265 275 h->SetXTitle("\\Theta [\\circ]"); 266 276 h->SetYTitle("No.of events"); 267 268 h->DrawCopy(opt); 269 h->SetBit(kCanDelete);; 270 gPad->SetLogy(); 271 272 c.cd(4); 273 h = ((TH2*)&fSigmaTheta)->ProjectionY("ProjY-sigma", -1, 9999, "E"); 274 h->SetDirectory(NULL); 275 h->SetTitle("Distribution of Sigmabar"); 276 h->SetXTitle("Sigmabar"); 277 h->Draw("box"); 278 h->SetBit(kCanDelete); 279 280 pad->cd(2); 281 h = fDiffPixTheta.Project3D("zx"); 282 h->SetDirectory(NULL); 283 h->SetTitle("\\sigma_{ped}^{2}-\\bar{\\sigma}_{ped}^{2} vs. \\Theta (all pixels)"); 284 h->SetXTitle("\\Theta [\\circ]"); 285 h->SetYTitle("\\sigma_{ped}^2-\\bar{\\sigma}_{ped}^{2}"); 286 h->SetBit(kCanDelete); 287 288 pad->cd(3); 289 h = fSigmaPixTheta.Project3D("zx"); 290 h->SetDirectory(NULL); 291 h->SetTitle("\\sigma_{ped} vs. \\Theta (all pixels)"); 292 h->SetXTitle("\\Theta [\\circ]"); 293 h->SetYTitle("\\sigma_{ped}"); 294 h->Draw("box"); 295 h->SetBit(kCanDelete); 296 297 pad->cd(4); 298 h = fSigmaTheta.ProjectionY("ProjY-sigma", -1, 9999, "E"); 299 h->SetDirectory(NULL); 300 h->SetTitle("Distribution of \\bar{\\sigma}_{ped}"); 301 h->SetXTitle("\\bar{\\sigma}_{ped}"); 277 302 h->SetYTitle("No.of events"); 278 279 h->DrawCopy(opt);280 h->SetBit(kCanDelete);;281 282 c.cd(7);283 ((TH2*)&fSigmaTheta)->DrawCopy(opt);284 285 //--------------------------------------------------------------------286 // draw the 3D histogram : Theta, pixel, Sigma^2-Sigmabar^2287 288 TH2D *l;289 290 c.cd(2);291 l = (TH2D*) ((TH3*)&fDiffPixTheta)->Project3D("zx");292 l->SetDirectory(NULL);293 l->SetTitle("Sigma^2-Sigmabar^2 vs. \\Theta (all pixels)");294 l->SetXTitle("\\Theta [\\circ]");295 l->SetYTitle("Sigma^2-Sigmabar^2");296 297 l->DrawCopy("box");298 l->SetBit(kCanDelete);;299 300 c.cd(5);301 l = (TH2D*) ((TH3*)&fDiffPixTheta)->Project3D("zy");302 l->SetDirectory(NULL);303 l->SetTitle("Sigma^2-Sigmabar^2 vs. pixel number (all \\Theta)");304 l->SetXTitle("pixel");305 l->SetYTitle("Sigma^2-Sigmabar^2");306 307 l->DrawCopy("box");308 l->SetBit(kCanDelete);;309 310 //c.cd(8);311 //((TH2*)&fDiffPixTheta)->DrawCopy(opt);312 313 c.cd(8);314 ((TH1*)&fBlindId)->DrawCopy(opt);315 316 317 //--------------------------------------------------------------------318 // draw the 3D histogram : Theta, pixel, Sigma319 320 TH2D *k;321 322 c.cd(3);323 k = (TH2D*) ((TH3*)&fSigmaPixTheta)->Project3D("zx");324 k->SetDirectory(NULL);325 k->SetTitle("Sigma vs. \\Theta (all pixels)");326 k->SetXTitle("\\Theta [\\circ]");327 k->SetYTitle("Sigma");328 329 k->DrawCopy("box");330 k->SetBit(kCanDelete);;331 332 c.cd(6);333 k = (TH2D*) ((TH3*)&fSigmaPixTheta)->Project3D("zy");334 k->SetDirectory(NULL);335 k->SetTitle("Sigma vs. pixel number (all \\Theta)");336 k->SetXTitle("pixel");337 k->SetYTitle("Sigma");338 339 k->DrawCopy("box");340 k->SetBit(kCanDelete);;341 342 //c.cd(9);343 //((TH2*)&fSigmaPixTheta)->DrawCopy(opt);344 345 c.cd(9);346 ((TH1*)&fNpix)->DrawCopy(opt);347 348 //--------------------------------------------------------------------349 c.Modified();350 c.Update();351 352 return &c;353 }354 355 // --------------------------------------------------------------------------356 //357 // Draw the histogram358 //359 void MHSigmaTheta::Draw(Option_t *opt)360 {361 if (!gPad)362 MakeDefCanvas("SigmaTheta", "Sigmabar vs. Theta", 600, 600);363 364 TH1D *h;365 366 gPad->Divide(2,2);367 368 gPad->cd(1);369 h = ((TH2*)&fSigmaTheta)->ProjectionX("ProjX-Theta", -1, 9999, "E");370 h->SetTitle("Distribution of \\Theta");371 h->SetXTitle("\\Theta [\\circ]");372 h->SetYTitle("No.of events");373 374 303 h->Draw(opt); 375 h->SetBit(kCanDelete);; 376 gPad->SetLogy(); 377 378 gPad->cd(2); 379 h = ((TH2*)&fSigmaTheta)->ProjectionY("ProjY-sigma", -1, 9999, "E"); 380 h->SetTitle("Distribution of Sigmabar"); 381 h->SetXTitle("Sigmabar"); 382 h->SetYTitle("No.of events"); 383 384 h->Draw(opt); 385 h->SetBit(kCanDelete);; 386 387 gPad->cd(3); 388 fSigmaTheta.DrawCopy(opt); 389 390 gPad->Modified(); 391 gPad->Update(); 392 } 393 // -------------------------------------------------------------------------- 394 395 396 397 304 h->SetBit(kCanDelete); 305 306 pad->cd(5); 307 h = fDiffPixTheta.Project3D("zy"); 308 h->SetDirectory(NULL); 309 h->SetTitle("\\sigma_{ped}^{2}-\\bar{\\sigma}_{ped}^{2} vs. pixel Id (all \\Theta)"); 310 h->SetXTitle("Id"); 311 h->SetYTitle("\\sigma_{ped}^{2}-\\bar{\\sigma}_{ped}^{2}"); 312 h->Draw("box"); 313 h->SetBit(kCanDelete); 314 315 pad->cd(6); 316 h = fSigmaPixTheta.Project3D("zy"); 317 h->SetDirectory(NULL); 318 h->SetTitle("\\sigma_{ped} vs. pixel Id (all \\Theta)"); 319 h->SetXTitle("Id"); 320 h->SetYTitle("\\sigma_{ped}"); 321 h->Draw("box"); 322 h->SetBit(kCanDelete); 323 324 pad->cd(7); 325 fSigmaTheta.Draw(opt); 326 327 pad->cd(8); 328 fDiffPixTheta.Draw(opt); 329 330 pad->cd(9); 331 fSigmaPixTheta.Draw(opt); 332 } -
trunk/MagicSoft/Mars/mhist/MHSigmabarTheta.cc
r1951 r1966 63 63 fHist.SetTitle("3D-plot of sigmabar and theta"); 64 64 fHist.SetXTitle("\\theta [\\circ]"); 65 fHist.SetYTitle("\\ overline{\\sigma}");65 fHist.SetYTitle("\\bar{\\sigma}"); 66 66 fHist.SetZTitle("N"); 67 67 } … … 123 123 void MHSigmabarTheta::Draw(Option_t *opt) 124 124 { 125 if (!gPad) 126 MakeDefCanvas("SigmabarTheta", fTitle); 127 125 TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(this); 126 pad->SetBorderMode(0); 127 128 AppendPad(""); 129 128 130 fHist.Draw(opt); 129 131 130 gPad->Modified();131 gPad->Update();132 pad->Modified(); 133 pad->Update(); 132 134 } 133 135 134 // --------------------------------------------------------------------------135 //136 // Draw copies of the histogram137 //138 TObject *MHSigmabarTheta::DrawClone(Option_t *opt) const139 {140 TCanvas &c = *MakeDefCanvas("SigmabarTheta", fTitle);141 142 ((TH2&)fHist).DrawCopy(opt);143 144 c.Modified();145 c.Update();146 147 return &c;148 }149 -
trunk/MagicSoft/Mars/mhist/MHSigmabarTheta.h
r1951 r1966 36 36 37 37 void Draw(Option_t *option=""); 38 TObject *DrawClone(Option_t *option="") const;39 38 40 39 ClassDef(MHSigmabarTheta, 1) //3D-histogram in alpha, Energy and theta -
trunk/MagicSoft/Mars/mhist/MHThetabarTheta.cc
r1668 r1966 61 61 62 62 fHist.SetXTitle("\\Theta [\\circ]"); 63 fHist.SetYTitle(" Theta-bar[ \\circ]");63 fHist.SetYTitle("\\bar{\\Theta} [ \\circ]"); 64 64 } 65 65 … … 91 91 // -------------------------------------------------------------------------- 92 92 // 93 // Draw a copy of the histogram94 //95 TObject *MHThetabarTheta::DrawClone(Option_t *opt) const96 {97 TCanvas &c = *MakeDefCanvas("ThetabarTheta", "Thetabar vs. Theta");98 99 gROOT->SetSelectedPad(NULL);100 101 ((TProfile)fHist).DrawCopy(opt);102 103 c.Modified();104 c.Update();105 106 return &c;107 }108 109 // --------------------------------------------------------------------------110 //111 93 // Draw the histogram 112 94 // 113 95 void MHThetabarTheta::Draw(Option_t *opt) 114 96 { 115 if (!gPad)116 MakeDefCanvas("ThetabarTheta", "Thetabar vs. Theta");97 TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(this); 98 pad->SetBorderMode(0); 117 99 118 fHist.DrawCopy(opt);100 AppendPad(""); 119 101 120 gPad->Modified(); 121 gPad->Update(); 102 fHist.Draw(opt); 103 104 pad->Modified(); 105 pad->Update(); 122 106 } 123 107 -
trunk/MagicSoft/Mars/mhist/MHThetabarTheta.h
r1668 r1966 34 34 35 35 void Draw(Option_t *option=""); 36 TObject *DrawClone(Option_t *option="") const;37 36 38 37 ClassDef(MHThetabarTheta, 0) //Profile histogram Thetabar vs. time -
trunk/MagicSoft/Mars/mhist/MHThetabarTime.cc
r1412 r1966 63 63 64 64 fHist.SetXTitle("time [s]"); 65 fHist.SetYTitle(" Theta-bar[ \\circ]");65 fHist.SetYTitle("\\bar{\\Theta} [ \\circ]"); 66 66 } 67 67 … … 100 100 // -------------------------------------------------------------------------- 101 101 // 102 // Draw a copy of the histogram103 //104 TObject *MHThetabarTime::DrawClone(Option_t *opt) const105 {106 TCanvas &c = *MakeDefCanvas("ThetabarTime", "Thetabar vs. time");107 108 gROOT->SetSelectedPad(NULL);109 110 ((TProfile*)&fHist)->DrawCopy(opt);111 112 c.Modified();113 c.Update();114 115 return &c;116 }117 118 // --------------------------------------------------------------------------119 //120 102 // Draw the histogram 121 103 // 122 104 void MHThetabarTime::Draw(Option_t *opt) 123 105 { 124 if (!gPad)125 MakeDefCanvas("ThetabarTime", "Thetabar vs. time");106 TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(this); 107 pad->SetBorderMode(0); 126 108 127 fHist.DrawCopy(opt);109 AppendPad(""); 128 110 129 gPad->Modified(); 130 gPad->Update(); 111 fHist.Draw(opt); 112 113 pad->Modified(); 114 pad->Update(); 131 115 } 132 116 -
trunk/MagicSoft/Mars/mhist/MHThetabarTime.h
r1668 r1966 37 37 38 38 void Draw(Option_t *option=""); 39 TObject *DrawClone(Option_t *option="") const;40 39 41 40 ClassDef(MHThetabarTime, 0) //Profile histogram Thetabar vs. time -
trunk/MagicSoft/Mars/mhist/MHTimeDiffTheta.cc
r1668 r1966 102 102 // -------------------------------------------------------------------------- 103 103 // 104 // Draw a copy of the histogram105 //106 TObject *MHTimeDiffTheta::DrawClone(Option_t *opt) const107 {108 TCanvas &c = *MakeDefCanvas("DiffTimeTheta", "Distrib of \\Delta t, Theta");109 110 c.Divide(2, 2);111 112 gROOT->SetSelectedPad(NULL);113 114 //115 // FIXME: ProjectionX,Y is not const within root116 //117 118 TH1D *h;119 120 c.cd(1);121 h = ((TH2*)&fHist)->ProjectionX("ProjX-Theta", -1, 9999, "E");122 123 h->SetTitle("Distribution of \\Delta t [s]");124 h->SetXTitle("\\Delta t [s]");125 h->SetYTitle("Counts");126 127 h->Draw(opt);128 h->SetBit(kCanDelete);;129 gPad->SetLogy();130 131 c.cd(2);132 h = ((TH2*)&fHist)->ProjectionY("ProjY-timediff", -1, 9999, "E");133 134 h->SetTitle("Distribution of \\Theta [\\circ]");135 h->SetXTitle("\\Theta [\\circ]");136 h->SetYTitle("Counts");137 138 h->Draw(opt);139 h->SetBit(kCanDelete);;140 141 c.cd(3);142 ((TH2*)&fHist)->DrawCopy(opt);143 144 c.Modified();145 c.Update();146 147 return &c;148 }149 150 // --------------------------------------------------------------------------151 //152 104 // Draw the histogram 153 105 // 154 106 void MHTimeDiffTheta::Draw(Option_t *opt) 155 107 { 156 if (!gPad)157 MakeDefCanvas("DiffTimeTheta", "Distrib of Delta t, Theta");108 TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(this); 109 pad->SetBorderMode(0); 158 110 159 TH1D *h;111 AppendPad(""); 160 112 161 gPad->Divide(2,2);113 TH1 *h; 162 114 163 gPad->cd(1); 115 pad->Divide(2,2); 116 117 pad->cd(1); 118 gPad->SetLogy(); 164 119 h = fHist.ProjectionX("ProjX_Theta", -1, 9999, "E"); 165 166 120 h->SetTitle("Distribution of \\Delta t [s]"); 167 121 h->SetXTitle("\\Delta t [s]"); 168 122 h->SetYTitle("Counts"); 169 170 123 h->Draw(opt); 171 124 h->SetBit(kCanDelete);; 172 gPad->SetLogy();173 125 174 gPad->cd(2);126 pad->cd(2); 175 127 h = fHist.ProjectionY("ProjY_timediff", -1, 9999, "E"); 176 177 128 h->SetTitle("Distribution of \\Theta [\\circ]"); 178 129 h->SetXTitle("\\Theta [\\circ]"); 179 130 h->SetYTitle("Counts"); 180 181 131 h->Draw(opt); 182 132 h->SetBit(kCanDelete);; 183 133 184 gPad->cd(3);185 fHist.Draw Copy(opt);134 pad->cd(3); 135 fHist.Draw(opt); 186 136 187 gPad->Modified();188 gPad->Update();137 pad->Modified(); 138 pad->Update(); 189 139 } 190 140 -
trunk/MagicSoft/Mars/mhist/MHTimeDiffTheta.h
r1668 r1966 35 35 36 36 void Draw(Option_t *option=""); 37 TObject *DrawClone(Option_t *option="") const;38 37 39 38 ClassDef(MHTimeDiffTheta, 0) //2D-histogram time-diff vs. Theta -
trunk/MagicSoft/Mars/mhist/MHTimeDiffTime.cc
r1668 r1966 95 95 // -------------------------------------------------------------------------- 96 96 // 97 // Draw a copy of the histogram98 //99 TObject *MHTimeDiffTime::DrawClone(Option_t *opt) const100 {101 102 TCanvas &c = *MakeDefCanvas("DiffTimeTime", "Distrib of dt and t");103 104 c.Divide(2, 2);105 106 gROOT->SetSelectedPad(NULL);107 108 TH1D *h;109 110 c.cd(1);111 h = ((TH2*)&fHist)->ProjectionX("ProjX-sumtime", -1, 9999, "E");112 113 h->SetTitle("Distribution of \\Delta t [s]");114 h->SetXTitle("\\Delta t [s]");115 h->SetYTitle("Counts");116 117 h->Draw(opt);118 h->SetBit(kCanDelete);119 gPad->SetLogy();120 121 c.cd(2);122 h = ((TH2*)&fHist)->ProjectionY("ProjY-sumtimediff", -1, 9999, "E");123 124 h->SetTitle("Distribution of time [s]");125 h->SetXTitle("time [s]");126 h->SetYTitle("Counts");127 128 h->Draw(opt);129 h->SetBit(kCanDelete);130 131 c.cd(3);132 ((TH2*)&fHist)->DrawCopy(opt);133 134 c.Modified();135 c.Update();136 137 return &c;138 }139 140 // --------------------------------------------------------------------------141 //142 97 // Draw the histogram 143 98 // 144 99 void MHTimeDiffTime::Draw(Option_t *opt) 145 100 { 146 if (!gPad)147 MakeDefCanvas("DiffTimeTime", "Distrib of \\Delta t, time");101 TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(this); 102 pad->SetBorderMode(0); 148 103 149 gPad->Divide(2,2); 104 AppendPad(""); 105 106 pad->Divide(2,2); 150 107 151 108 TH1D *h; 152 109 153 gPad->cd(1); 110 pad->cd(1); 111 gPad->SetLogy(); 154 112 h = fHist.ProjectionX("ProjX_sumtime", -1, 9999, "E"); 155 156 113 h->SetTitle("Distribution of \\Delta t [s]"); 157 114 h->SetXTitle("\\Delta t [s]"); 158 115 h->SetYTitle("Counts"); 159 160 116 h->Draw(opt); 161 117 h->SetBit(kCanDelete); 162 gPad->SetLogy();163 118 164 gPad->cd(2);119 pad->cd(2); 165 120 h = fHist.ProjectionY("ProjY_sumtimediff", -1, 9999, "E"); 166 167 121 h->SetTitle("Distribution of time [s]"); 168 122 h->SetXTitle("time [s]"); 169 123 h->SetYTitle("Counts"); 170 171 124 h->Draw(opt); 172 125 h->SetBit(kCanDelete); 173 126 174 gPad->cd(3);127 pad->cd(3); 175 128 fHist.DrawCopy(opt); 176 129 177 gPad->Modified(); 178 gPad->Update(); 179 130 pad->Modified(); 131 pad->Update(); 180 132 } 181 133 -
trunk/MagicSoft/Mars/mhist/MHTimeDiffTime.h
r1668 r1966 33 33 34 34 void Draw(Option_t *option=""); 35 TObject *DrawClone(Option_t *option="") const;36 35 37 36 ClassDef(MHTimeDiffTime, 0) //2D-histogram time-diff vs. time
Note:
See TracChangeset
for help on using the changeset viewer.