4304{
4305 errors = (TDirectory *)
file->FindKey(
"Errors")->ReadObj();
4307 throw(string("No errors folder!!!!!!!!!!!!!!!"));
4308 if (
errors->GetNkeys() > 19)
4309 {
4310 this->Divide(2, 3, 0.01, 0.01);
4311
4312
4313
4314 TH2F *pull_vs_tb_trt = (
TH2F *)
errors->FindKey(
"pull_vs_tb_trt")->ReadObj();
4315 TH2F *pull_vs_tb_ba = (
TH2F *)
errors->FindKey(
"pull_vs_tb_ba")->ReadObj();
4316 TH2F *pull_vs_tb_bc = (
TH2F *)
errors->FindKey(
"pull_vs_tb_bc")->ReadObj();
4317 TH2F *pull_vs_tb_ea = (
TH2F *)
errors->FindKey(
"pull_vs_tb_ea")->ReadObj();
4318 TH2F *pull_vs_tb_ec = (
TH2F *)
errors->FindKey(
"pull_vs_tb_ec")->ReadObj();
4319
4320 TH2F *errors_vs_tb_trt = (
TH2F *)
errors->FindKey(
"errors_vs_tb_trt")->ReadObj();
4321 TH2F *errors_vs_tb_ba = (
TH2F *)
errors->FindKey(
"errors_vs_tb_ba")->ReadObj();
4322 TH2F *errors_vs_tb_bc = (
TH2F *)
errors->FindKey(
"errors_vs_tb_bc")->ReadObj();
4323 TH2F *errors_vs_tb_ea = (
TH2F *)
errors->FindKey(
"errors_vs_tb_ea")->ReadObj();
4324 TH2F *errors_vs_tb_ec = (
TH2F *)
errors->FindKey(
"errors_vs_tb_ec")->ReadObj();
4325
4326 TH2F *residual_vs_tb_trt = (
TH2F *)
errors->FindKey(
"residual_vs_tb_trt")->ReadObj();
4327 TH2F *residual_vs_tb_ba = (
TH2F *)
errors->FindKey(
"residual_vs_tb_ba")->ReadObj();
4328 TH2F *residual_vs_tb_bc = (
TH2F *)
errors->FindKey(
"residual_vs_tb_bc")->ReadObj();
4329 TH2F *residual_vs_tb_ea = (
TH2F *)
errors->FindKey(
"residual_vs_tb_ea")->ReadObj();
4330 TH2F *residual_vs_tb_ec = (
TH2F *)
errors->FindKey(
"residual_vs_tb_ec")->ReadObj();
4331
4332 TH2F *trackerrors_vs_tb_trt = (
TH2F *)
errors->FindKey(
"trackerrors_vs_tb_trt")->ReadObj();
4333 TH2F *trackerrors_vs_tb_ba = (
TH2F *)
errors->FindKey(
"trackerrors_vs_tb_ba")->ReadObj();
4334 TH2F *trackerrors_vs_tb_bc = (
TH2F *)
errors->FindKey(
"trackerrors_vs_tb_bc")->ReadObj();
4335 TH2F *trackerrors_vs_tb_ea = (
TH2F *)
errors->FindKey(
"trackerrors_vs_tb_ea")->ReadObj();
4336 TH2F *trackerrors_vs_tb_ec = (
TH2F *)
errors->FindKey(
"trackerrors_vs_tb_ec")->ReadObj();
4337
4339
4340 TGraphErrors *tresTRT =
GetPWidth(pull_vs_tb_trt);
4341 TGraphErrors *tresBA =
GetPWidth(pull_vs_tb_ba);
4342 tresBA->SetLineColor(kRed);
4343 tresBA->SetMarkerColor(kRed);
4344 TGraphErrors *tresBC =
GetPWidth(pull_vs_tb_bc);
4345 tresBC->SetLineColor(kBlue);
4346 tresBC->SetMarkerColor(kBlue);
4347 TGraphErrors *tresEA =
GetPWidth(pull_vs_tb_ea);
4348 tresEA->SetLineColor(kGreen);
4349 tresEA->SetMarkerColor(kGreen);
4350 TGraphErrors *tresEC =
GetPWidth(pull_vs_tb_ec);
4351 tresEC->SetLineColor(kYellow);
4352 tresEC->SetMarkerColor(kYellow);
4353
4354 tresTRT->SetTitle("Pull Width VS Drift Time. Pt>2GeV");
4355 tresTRT->GetXaxis()->SetTitle("Drift Time ");
4356 tresTRT->GetYaxis()->SetTitle(" ");
4357 tresTRT->GetYaxis()->SetRangeUser(0.7, 1.3);
4358 tresTRT->Draw("ALP");
4359 tresBA->Draw("LP");
4360 tresBC->Draw("LP");
4361 tresEA->Draw("LP");
4362 tresEC->Draw("LP");
4363
4365 TGraphErrors *errorsTRT =
GetMeanE(errors_vs_tb_trt);
4366 TGraphErrors *errorsBA =
GetMeanE(errors_vs_tb_ba);
4367 errorsBA->SetLineColor(kRed);
4368 errorsBA->SetMarkerColor(kRed);
4369 TGraphErrors *errorsBC =
GetMeanE(errors_vs_tb_bc);
4370 errorsBC->SetLineColor(kBlue);
4371 errorsBC->SetMarkerColor(kBlue);
4372 TGraphErrors *errorsEA =
GetMeanE(errors_vs_tb_ea);
4373 errorsEA->SetLineColor(kGreen);
4374 errorsEA->SetMarkerColor(kGreen);
4375 TGraphErrors *errorsEC =
GetMeanE(errors_vs_tb_ec);
4376 errorsEC->SetLineColor(kYellow);
4377 errorsEC->SetMarkerColor(kYellow);
4378 errorsTRT->SetTitle("Error VS Drift Time");
4379 errorsTRT->GetXaxis()->SetTitle("Drift Time");
4380 errorsTRT->GetYaxis()->SetTitle("mm");
4381 errorsTRT->GetYaxis()->SetRangeUser(0.05, 0.24);
4382 errorsTRT->Draw("ALP");
4383 errorsBA->Draw("LP");
4384 errorsBC->Draw("LP");
4385 errorsEA->Draw("LP");
4386 errorsEC->Draw("LP");
4387
4389 TGraphErrors *ntresBA =
GetPn(pull_vs_tb_ba);
4390 ntresBA->SetLineColor(kRed);
4391 ntresBA->SetMarkerColor(kRed);
4392 TGraphErrors *ntresBC =
GetPn(pull_vs_tb_bc);
4393 ntresBC->SetLineColor(kBlue);
4394 ntresBC->SetMarkerColor(kBlue);
4395 TGraphErrors *ntresEA =
GetPn(pull_vs_tb_ea);
4396 ntresEA->SetLineColor(kGreen);
4397 ntresEA->SetMarkerColor(kGreen);
4398 TGraphErrors *ntresEC =
GetPn(pull_vs_tb_ec);
4399 ntresEC->SetLineColor(kYellow);
4400 ntresEC->SetMarkerColor(kYellow);
4401 ntresEA->SetTitle("Number of hits VS Drift Time. Pt>2GeV");
4402 ntresEA->GetXaxis()->SetTitle("Drift Time");
4403 ntresEA->GetYaxis()->SetTitle(" hits ");
4404 ntresEA->Draw("ALP");
4405 ntresEC->Draw("LP");
4406 ntresBA->Draw("LP");
4407 ntresBC->Draw("LP");
4408
4410 TGraphErrors *terrorsTRT =
GetMean(trackerrors_vs_tb_trt);
4411 TGraphErrors *terrorsBA =
GetMean(trackerrors_vs_tb_ba);
4412 terrorsBA->SetLineColor(kRed);
4413 terrorsBA->SetMarkerColor(kRed);
4414 TGraphErrors *terrorsBC =
GetMean(trackerrors_vs_tb_bc);
4415 terrorsBC->SetLineColor(kBlue);
4416 terrorsBC->SetMarkerColor(kBlue);
4417 TGraphErrors *terrorsEA =
GetMean(trackerrors_vs_tb_ea);
4418 terrorsEA->SetLineColor(kGreen);
4419 terrorsEA->SetMarkerColor(kGreen);
4420 TGraphErrors *terrorsEC =
GetMean(trackerrors_vs_tb_ec);
4421 terrorsEC->SetLineColor(kYellow);
4422 terrorsEC->SetMarkerColor(kYellow);
4423 terrorsTRT->SetTitle("Track Error VS Drift Time");
4424 terrorsTRT->GetXaxis()->SetTitle("Drift Time");
4425 terrorsTRT->GetYaxis()->SetTitle("mm");
4426 terrorsTRT->GetYaxis()->SetRangeUser(0.0, 0.07);
4427 terrorsTRT->Draw("ALP");
4428 terrorsBA->Draw("LP");
4429 terrorsBC->Draw("LP");
4430 terrorsEA->Draw("LP");
4431 terrorsEC->Draw("LP");
4432
4434 TGraphErrors *residualTRT =
GetWidth(residual_vs_tb_trt);
4435 TGraphErrors *residualBA =
GetWidth(residual_vs_tb_ba);
4436 residualBA->SetLineColor(kRed);
4437 residualBA->SetMarkerColor(kRed);
4438 TGraphErrors *residualBC =
GetWidth(residual_vs_tb_bc);
4439 residualBC->SetLineColor(kBlue);
4440 residualBC->SetMarkerColor(kBlue);
4441 TGraphErrors *residualEA =
GetWidth(residual_vs_tb_ea);
4442 residualEA->SetLineColor(kGreen);
4443 residualEA->SetMarkerColor(kGreen);
4444 TGraphErrors *residualEC =
GetWidth(residual_vs_tb_ec);
4445 residualEC->SetLineColor(kYellow);
4446 residualEC->SetMarkerColor(kYellow);
4447 residualTRT->SetTitle("Residual VS Drift Time. Pt > 2GeV");
4448 residualTRT->GetXaxis()->SetTitle("Drift Time ");
4449 residualTRT->GetYaxis()->SetTitle("mm");
4450 residualTRT->GetYaxis()->SetRangeUser(0.05, 0.24);
4451 residualTRT->Draw("ALP");
4452 residualBA->Draw("LP");
4453 residualBC->Draw("LP");
4454 residualEA->Draw("LP");
4455 residualEC->Draw("LP");
4456
4458
4459 TH2F *residual_trt = (
TH2F *)
errors->FindKey(
"tresidual_trt")->ReadObj();
4460 TH2F *residual_ba = (
TH2F *)
errors->FindKey(
"tresidual_ba")->ReadObj();
4461 TH2F *residual_bc = (
TH2F *)
errors->FindKey(
"tresidual_bc")->ReadObj();
4462 TH2F *residual_ea = (
TH2F *)
errors->FindKey(
"tresidual_ea")->ReadObj();
4463 TH2F *residual_ec = (
TH2F *)
errors->FindKey(
"tresidual_ec")->ReadObj();
4464
4465 TH2F *residual_trtP = (
TH2F *)
errors->FindKey(
"tresidual_trtP")->ReadObj();
4466 TH2F *residual_baP = (
TH2F *)
errors->FindKey(
"tresidual_baP")->ReadObj();
4467 TH2F *residual_bcP = (
TH2F *)
errors->FindKey(
"tresidual_bcP")->ReadObj();
4468 TH2F *residual_eaP = (
TH2F *)
errors->FindKey(
"tresidual_eaP")->ReadObj();
4469 TH2F *residual_ecP = (
TH2F *)
errors->FindKey(
"tresidual_ecP")->ReadObj();
4470
4471 TGraphErrors *residualTRT1 =
GetEntries(residual_trt);
4472 TGraphErrors *residualBA1 =
GetEntries(residual_ba);
4473 residualBA1->SetLineColor(kRed);
4474 residualBA1->SetMarkerColor(kRed);
4475 TGraphErrors *residualBC1 =
GetEntries(residual_bc);
4476 residualBC1->SetLineColor(kBlue);
4477 residualBC1->SetMarkerColor(kBlue);
4478 TGraphErrors *residualEA1 =
GetEntries(residual_ea);
4479 residualEA1->SetLineColor(kGreen);
4480 residualEA1->SetMarkerColor(kGreen);
4481 TGraphErrors *residualEC1 =
GetEntries(residual_ec);
4482 residualEC1->SetLineColor(kYellow);
4483 residualEC1->SetMarkerColor(kYellow);
4484
4485 TGraphErrors *residualTRT2 =
GetEntries(residual_trtP);
4486 TGraphErrors *residualBA2 =
GetEntries(residual_baP);
4487 residualBA2->SetLineColor(kRed);
4488 residualBA2->SetMarkerColor(kRed);
4489 TGraphErrors *residualBC2 =
GetEntries(residual_bcP);
4490 residualBC2->SetLineColor(kBlue);
4491 residualBC2->SetMarkerColor(kBlue);
4492 TGraphErrors *residualEA2 =
GetEntries(residual_eaP);
4493 residualEA2->SetLineColor(kGreen);
4494 residualEA2->SetMarkerColor(kGreen);
4495 TGraphErrors *residualEC2 =
GetEntries(residual_ecP);
4496 residualEC2->SetLineColor(kYellow);
4497 residualEC2->SetMarkerColor(kYellow);
4498
4499 int nbins = residualTRT1->GetN();
4500
4501 TGraphErrors *ratioTRT = new TGraphErrors(nbins);
4502 TGraphErrors *ratioBA = new TGraphErrors(nbins);
4503 TGraphErrors *ratioBC = new TGraphErrors(nbins);
4504 TGraphErrors *ratioEA = new TGraphErrors(nbins);
4505 TGraphErrors *ratioEC = new TGraphErrors(nbins);
4506
4507 for (
int i = 0;
i <
nbins;
i++)
4508 {
4512 residualTRT1->GetPoint(i,
x, all);
4513 residualTRT2->GetPoint(i,
x, prec);
4514 cout <<
i <<
" " <<
x <<
" " <<
prec <<
" " <<
all << endl;
4515 if (all > 0)
4516 {
4517 ratioTRT->SetPoint(i,
x, prec / all);
4518 }
4519 else
4520 {
4521 ratioTRT->SetPoint(i,
x, 0);
4522 }
4523 residualBA1->GetPoint(i,
x, all);
4524 residualBA2->GetPoint(i,
x, prec);
4525 cout <<
i <<
" " <<
x <<
" " <<
prec <<
" " <<
all << endl;
4526 if (all > 0)
4527 {
4528 ratioBA->SetPoint(i,
x, prec / all);
4529 }
4530 else
4531 {
4532 ratioBA->SetPoint(i,
x, 0);
4533 }
4534
4535 residualBC1->GetPoint(i,
x, all);
4536 residualBC2->GetPoint(i,
x, prec);
4537 cout <<
i <<
" " <<
x <<
" " <<
prec <<
" " <<
all << endl;
4538 if (all > 0)
4539 {
4540 ratioBC->SetPoint(i,
x, prec / all);
4541 }
4542 else
4543 {
4544 ratioBC->SetPoint(i,
x, 0);
4545 }
4546
4547 residualEA1->GetPoint(i,
x, all);
4548 residualEA2->GetPoint(i,
x, prec);
4549 cout <<
i <<
" " <<
x <<
" " <<
prec <<
" " <<
all << endl;
4550 if (all > 0)
4551 {
4552 ratioEA->SetPoint(i,
x, prec / all);
4553 }
4554 else
4555 {
4556 ratioEA->SetPoint(i,
x, 0);
4557 }
4558
4559 residualEC1->GetPoint(i,
x, all);
4560 residualEC2->GetPoint(i,
x, prec);
4561 cout <<
i <<
" " <<
x <<
" " <<
prec <<
" " <<
all << endl;
4562 if (all > 0)
4563 {
4564 ratioEC->SetPoint(i,
x, prec / all);
4565 }
4566 else
4567 {
4568 ratioEC->SetPoint(i,
x, 0);
4569 }
4570 cout << endl;
4571 }
4572
4573 ratioTRT->SetTitle("Ratio Precision Hits Vs Pt. Pt > 2GeV");
4574 ratioTRT->GetXaxis()->SetTitle("Precission Hits/Total Hits ");
4575 ratioTRT->GetYaxis()->SetTitle("pt");
4576 ratioTRT->GetYaxis()->SetRangeUser(0.05, 0.24);
4577 ratioTRT->GetYaxis()->SetRangeUser(0.3, 1);
4578
4579 ratioBA->SetLineColor(kRed);
4580 ratioBC->SetLineColor(kBlue);
4581 ratioEA->SetLineColor(kGreen);
4582 ratioEC->SetLineColor(kYellow);
4583
4584 ratioTRT->Draw("alp");
4585 ratioBA->Draw("lp");
4586 ratioBC->Draw("lp");
4587 ratioEA->Draw("lp");
4588 ratioEC->Draw("lp");
4589 }
4590 else
4591 {
4592 cout << " Not enough keys in Errors directory for tb dependence plots " << endl;
4593 }
4594}
TGraphErrors * GetWidth(TH2F *histo)
TGraphErrors * GetMean(TH2F *histo)
TGraphErrors * GetEntries(TH2F *histo)
TGraphErrors * GetPn(TH2F *histo)
TGraphErrors * GetMeanE(TH2F *histo)
TGraphErrors * GetPWidth(TH2F *histo)
TH2F(name, title, nxbins, bins_par2, bins_par3, bins_par4, bins_par5=None, bins_par6=None, path='', **kwargs)