Changeset 1554 for trunk/MagicSoft/Mars/mhist/MHHadroness.cc
- Timestamp:
- 10/24/02 17:04:13 (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhist/MHHadroness.cc
r1354 r1554 105 105 fIntPhness->SetYTitle("Acceptance"); 106 106 107 /* 107 108 fQfac = new TH1D("Qfac", "Naive Quality factor", nbins, 0, 1); 108 109 fQfac->SetXTitle("Hadroness"); 109 110 fQfac->SetYTitle("Quality"); 111 */ 112 fQfac = new TGraph; 113 fQfac->SetTitle(" Naive Quality factor "); 110 114 111 115 fMinDist = new TH1D("MinDist", "Minimum Dist to (0, 1)", nbins, 0, 1); … … 113 117 fMinDist->SetYTitle("Distance"); 114 118 115 fQfac->SetDirectory(NULL);119 //fQfac->SetDirectory(NULL); 116 120 fGhness->SetDirectory(NULL); 117 121 fPhness->SetDirectory(NULL); … … 200 204 201 205 fGraph->Set(n); 206 fQfac->Set(n); 202 207 203 208 const Stat_t sumg = fGhness->Integral(1, n+1); … … 218 223 219 224 fMinDist->SetBinContent(i, 1-sqrt(ip*ip + (ig-1)*(ig-1))); 220 fQfac->SetBinContent(i, ig/sqrt(ip)); 225 fQfac->SetPoint(i, ig, ig/sqrt(ip)); 226 //fQfac->SetBinContent(fQfac->FindBin(ig), ig/sqrt(ip)); 227 *fLog << all << i << ": " << ig << " " << ig/sqrt(ip) << endl; 221 228 } 222 229 … … 279 286 *fLog << " Acc Gammas = " << Form("%3.0f", fIntGhness->GetBinContent(h)*100) << "%, "; 280 287 *fLog << "Acc Hadrons = " << Form("%3.0f", fIntPhness->GetBinContent(h)*100) << "%" << endl; 281 const Int_t q = GetQfac()->GetMaximumBin(); 282 *fLog << "Maximum Q-Factor: " << GetQfac()->GetMaximum() << " @ H="; 283 *fLog << GetQfac()->GetBinCenter(q) << endl;; 284 *fLog << " Acc Gammas = " << Form("%3.0f", fIntGhness->GetBinContent(q)*100) << "%, "; 285 *fLog << "Acc Hadrons = " << Form("%3.0f", fIntPhness->GetBinContent(q)*100) << "%" << endl; 288 /* 289 const Int_t q = GetQfac()->GetMaximumBin(); 290 *fLog << "Maximum Q-Factor: " << GetQfac()->GetMaximum() << " @ H="; 291 *fLog << GetQfac()->GetBinCenter(q) << endl;; 292 *fLog << " Acc Gammas = " << Form("%3.0f", fIntGhness->GetBinContent(q)*100) << "%, "; 293 *fLog << "Acc Hadrons = " << Form("%3.0f", fIntPhness->GetBinContent(q)*100) << "%" << endl; 294 */ 286 295 *fLog << endl; 287 296 } … … 303 312 Getphness()->SetLineColor(kRed); 304 313 Getphness()->DrawCopy("same"); 305 c.cd(4);306 TGraph &g = (TGraph&)*fGraph->DrawClone("AC");307 g.SetBit(kCanDelete);308 gPad->Modified();309 gPad->Update();310 if (g.GetHistogram())311 {312 g.GetXaxis()->SetRangeUser(0, 1);313 g.GetXaxis()->SetTitle("Acceptance Hadrons");314 g.GetYaxis()->SetTitle("Acceptance Gammas");315 g.SetMarkerStyle(kFullDotSmall);316 g.Draw("P");317 318 gPad->Modified();319 gPad->Update();320 }321 const Int_t h = fMinDist->GetMaximumBin();322 TMarker *m = new TMarker(fIntPhness->GetBinContent(h),323 fIntGhness->GetBinContent(h), kStar);324 m->SetMarkerColor(kBlue);325 m->SetBit(kCanDelete);326 m->Draw();327 314 c.cd(2); 328 315 gStyle->SetOptStat(0); … … 333 320 fMinDist->DrawCopy("same"); 334 321 c.cd(3); 335 GetQfac()->DrawCopy(); 336 337 return &c; 338 } 339 340 // -------------------------------------------------------------------------- 341 // 342 // Draw all histograms. (For the Meaning see class description) 343 // 344 void MHHadroness::Draw(Option_t *) 345 { 346 if (!gPad) 347 MakeDefCanvas("Hadroness", fTitle); 348 349 gPad->Divide(2, 2); 350 351 gPad->cd(1); 352 gStyle->SetOptStat(10); 353 Getghness()->Draw(); 354 Getphness()->SetLineColor(kRed); 355 Getphness()->Draw("same"); 356 gPad->cd(4); 357 fGraph->Draw("AC"); 358 gPad->Modified(); 359 gPad->Update(); 360 if (fGraph->GetHistogram()) 361 { 362 fGraph->GetXaxis()->SetRangeUser(0, 1); 363 fGraph->GetXaxis()->SetTitle("Acceptance Hadrons"); 364 fGraph->GetYaxis()->SetTitle("Acceptance Gammas"); 365 fGraph->SetMarkerStyle(kFullDotSmall); 366 fGraph->Draw("P"); 322 //GetQfac()->DrawCopy(); 323 TGraph &g2 = (TGraph&)*fQfac->DrawClone("AC"); 324 g2.SetBit(kCanDelete); 325 gPad->Modified(); 326 gPad->Update(); 327 if (g2.GetHistogram()) 328 { 329 g2.GetXaxis()->SetRangeUser(0, 1); 330 g2.GetXaxis()->SetTitle("Acceptance Gammas"); 331 g2.GetYaxis()->SetTitle("Quality"); 332 g2.SetMarkerStyle(kFullDotSmall); 333 g2.Draw("P"); 334 335 gPad->Modified(); 336 gPad->Update(); 337 } 338 c.cd(4); 339 gPad->Modified(); 340 gPad->Update(); 341 TGraph &g = (TGraph&)*fGraph->DrawClone("AC"); 342 g.SetBit(kCanDelete); 343 gPad->Modified(); 344 gPad->Update(); 345 if (g.GetHistogram()) 346 { 347 g.GetXaxis()->SetRangeUser(0, 1); 348 g.GetXaxis()->SetTitle("Acceptance Hadrons"); 349 g.GetYaxis()->SetTitle("Acceptance Gammas"); 350 g.SetMarkerStyle(kFullDotSmall); 351 g.Draw("P"); 352 367 353 gPad->Modified(); 368 354 gPad->Update(); … … 374 360 m->SetBit(kCanDelete); 375 361 m->Draw(); 362 return &c; 363 } 364 365 // -------------------------------------------------------------------------- 366 // 367 // Draw all histograms. (For the Meaning see class description) 368 // 369 void MHHadroness::Draw(Option_t *) 370 { 371 if (!gPad) 372 MakeDefCanvas("Hadroness", fTitle); 373 374 gPad->Divide(2, 2); 375 376 gPad->cd(1); 377 gStyle->SetOptStat(10); 378 Getghness()->Draw(); 379 Getphness()->SetLineColor(kRed); 380 Getphness()->Draw("same"); 376 381 gPad->cd(2); 377 382 gStyle->SetOptStat(0); … … 382 387 fMinDist->Draw("same"); 383 388 gPad->cd(3); 384 GetQfac()->Draw(); 385 } 389 //GetQfac()->Draw(); 390 fQfac->Draw("AC"); 391 gPad->Modified(); 392 gPad->Update(); 393 if (fQfac->GetHistogram()) 394 { 395 fQfac->GetXaxis()->SetRangeUser(0, 1); 396 fQfac->GetXaxis()->SetTitle("Acceptance Gammas"); 397 fQfac->GetYaxis()->SetTitle("Quality"); 398 fQfac->SetMarkerStyle(kFullDotSmall); 399 fQfac->Draw("P"); 400 401 gPad->Modified(); 402 gPad->Update(); 403 } 404 gPad->cd(4); 405 gPad->Modified(); 406 gPad->Update(); 407 fGraph->Draw("AC"); 408 gPad->Modified(); 409 gPad->Update(); 410 if (fGraph->GetHistogram()) 411 { 412 fGraph->GetXaxis()->SetRangeUser(0, 1); 413 fGraph->GetXaxis()->SetTitle("Acceptance Hadrons"); 414 fGraph->GetYaxis()->SetTitle("Acceptance Gammas"); 415 fGraph->SetMarkerStyle(kFullDotSmall); 416 fGraph->Draw("P"); 417 gPad->Modified(); 418 gPad->Update(); 419 } 420 const Int_t h = fMinDist->GetMaximumBin(); 421 TMarker *m = new TMarker(fIntPhness->GetBinContent(h), 422 fIntGhness->GetBinContent(h), kStar); 423 m->SetMarkerColor(kBlue); 424 m->SetBit(kCanDelete); 425 m->Draw(); 426 }
Note:
See TracChangeset
for help on using the changeset viewer.