ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
TBDependence Class Reference
Inheritance diagram for TBDependence:
Collaboration diagram for TBDependence:

Public Member Functions

 TBDependence (TFile *)
 

Private Attributes

TDirectory * errors
 

Detailed Description

Definition at line 4288 of file TRTCalib_makeplots.cxx.

Constructor & Destructor Documentation

◆ TBDependence()

TBDependence::TBDependence ( TFile *  file)

Definition at line 4297 of file TRTCalib_makeplots.cxx.

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

Member Data Documentation

◆ errors

TDirectory* TBDependence::errors
private

Definition at line 4294 of file TRTCalib_makeplots.cxx.


The documentation for this class was generated from the following file:
GetPn
TGraphErrors * GetPn(TH2F *histo)
Definition: TRTCalib_makeplots.cxx:3960
GetMean
TGraphErrors * GetMean(TH2F *histo)
Definition: TRTCalib_makeplots.cxx:3907
GetMeanE
TGraphErrors * GetMeanE(TH2F *histo)
Definition: TRTCalib_makeplots.cxx:3936
GetWidth
TGraphErrors * GetWidth(TH2F *histo)
Definition: TRTCalib_makeplots.cxx:3983
GetEntries
TGraphErrors * GetEntries(TH2F *histo)
Definition: TRTCalib_makeplots.cxx:4019
python.TrigEgammaMonitorHelper.TH2F
def TH2F(name, title, nxbins, bins_par2, bins_par3, bins_par4, bins_par5=None, bins_par6=None, path='', **kwargs)
Definition: TrigEgammaMonitorHelper.py:45
x
#define x
lumiFormat.i
int i
Definition: lumiFormat.py:85
TBDependence::errors
TDirectory * errors
Definition: TRTCalib_makeplots.cxx:4294
file
TFile * file
Definition: tile_monitor.h:29
GetPWidth
TGraphErrors * GetPWidth(TH2F *histo)
Definition: TRTCalib_makeplots.cxx:4042
SCT_CalibAlgs::nbins
@ nbins
Definition: SCT_CalibNumbers.h:10
Cut::all
@ all
Definition: SUSYToolsAlg.cxx:67
calibdata.cd
cd
Definition: calibdata.py:51
jobOptions.prec
prec
Definition: jobOptions.Superchic_UPC_yyMuMu.py:20