Changeset 6959
- Timestamp:
- 04/19/05 18:54:19 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhflux/MHCollectionArea.cc
r6938 r6959 276 276 TVirtualPad *pad = gPad; 277 277 278 TH1 *h =0;278 TH1 *h1=0, *h2=0; 279 279 280 280 pad->cd(1); 281 //if (gPad->FindObject("ProjAllX"))282 // fHistAll.ProjectionX("ProjAllX", -1, 9999, "E");283 281 if (gPad->FindObject("ProjSelX")) 284 282 fHistSel.ProjectionX("ProjSelX", -1, 9999, "E"); … … 286 284 pad->cd(2); 287 285 if (gPad->FindObject("ProjAllY")) 288 h =fHistAll.ProjectionY("ProjAllY", -1, 9999, "E");286 h1=fHistAll.ProjectionY("ProjAllY", -1, 9999, "E"); 289 287 if (gPad->FindObject("ProjSelY")) 290 fHistSel.ProjectionY("ProjSelY", -1, 9999, "E");291 292 if (h ->GetMaximum()>0)288 h2=fHistSel.ProjectionY("ProjSelY", -1, 9999, "E"); 289 290 if (h1->GetMaximum()>0) 293 291 { 294 292 gPad->SetLogx(); 295 293 gPad->SetLogy(); 296 294 } 295 296 pad->cd(3); 297 TH1 *h=dynamic_cast<TH1*>(gPad->FindObject("Efficiency")); 298 if (h1 && h2 && h) 299 { 300 h->Divide(h2, h1); 301 h->SetMaximum(1); 302 } 303 297 304 pad->cd(4); 298 305 CalcEfficiency(); … … 315 322 pad->Divide(2,2); 316 323 317 TH1 D *h=0;324 TH1 *h=0, *h1=0, *h2=0; 318 325 319 326 if (fHistSel.GetNbinsX()>1) … … 348 355 gPad->SetGridy(); 349 356 350 h = fHistAll.ProjectionY("ProjAllY", -1, 9999, "E");351 h ->SetDirectory(NULL);352 h ->SetLineColor(kGreen);353 h ->SetXTitle("E [GeV]");354 h ->SetBit(kCanDelete);355 h ->Draw();356 357 h = fHistSel.ProjectionY("ProjSelY", -1, 9999, "E");358 h ->SetDirectory(NULL);359 h ->SetLineColor(kRed);360 h ->SetBit(kCanDelete);361 h ->Draw("same");357 h1 = fHistAll.ProjectionY("ProjAllY", -1, 9999, "E"); 358 h1->SetDirectory(NULL); 359 h1->SetLineColor(kGreen); 360 h1->SetXTitle("E [GeV]"); 361 h1->SetBit(kCanDelete); 362 h1->Draw(); 363 364 h2 = fHistSel.ProjectionY("ProjSelY", -1, 9999, "E"); 365 h2->SetDirectory(NULL); 366 h2->SetLineColor(kRed); 367 h2->SetBit(kCanDelete); 368 h2->Draw("same"); 362 369 } 363 370 else 364 371 delete pad->GetPad(2); 372 373 if (h1 && h2) 374 { 375 pad->cd(3); 376 gPad->SetBorderMode(0); 377 gPad->SetGridx(); 378 gPad->SetGridy(); 379 gPad->SetLogx(); 380 h = h2->DrawCopy(); 381 h->Divide(h1); 382 h->SetNameTitle("Efficiency", "Combined cut and trigger efficiency"); 383 h->SetDirectory(NULL); 384 } 385 else 386 delete pad->GetPad(4); 365 387 366 388 if (fHEnergy.GetNbinsX()>1) … … 374 396 else 375 397 delete pad->GetPad(4); 376 /*377 if (fHistAll.GetNbinsY()>1)378 {379 pad->cd(4);380 }381 else382 delete pad->GetPad(4);383 */384 398 } 385 399
Note:
See TracChangeset
for help on using the changeset viewer.