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

Public Member Functions

 SinDependence (TFile *, bool, bool, bool)
 

Private Attributes

TDirectory * m_errors
 

Detailed Description

Definition at line 4876 of file TRTCalib_makeplots.cxx.

Constructor & Destructor Documentation

◆ SinDependence()

SinDependence::SinDependence ( TFile *  file,
bool  isba = true,
bool  isht = false,
bool  isAr = false 
)

Definition at line 4885 of file TRTCalib_makeplots.cxx.

4886 {
4887  m_errors = nullptr;
4888 
4889  if (!isAr)
4890  m_errors = (TDirectory *)file->FindKey("Correction")->ReadObj();
4891  else
4892  m_errors = (TDirectory *)file->FindKey("CorrectionAr")->ReadObj();
4893  if (!m_errors)
4894  throw(string("No errors folder!!!!!!!!!!!!!!!"));
4895 
4896  this->Divide(2, 3, 0.01, 0.01);
4897 
4898  // Read the histos:
4899 
4900  TH2F *tres_vs_ToT_ba = nullptr;
4901  TH2F *tres_vs_ToT_bc = nullptr;
4902  // Residual:
4903  TH2F *res_vs_ToT_ba = nullptr;
4904  TH2F *res_vs_ToT_bc = nullptr;
4905 
4906  if (!isAr)
4907  {
4908  if (!isht)
4909  {
4910  if (isba)
4911  { // sin
4912  tres_vs_ToT_ba = (TH2F *)m_errors->FindKey("tres_vs_SinOverP_bc")->ReadObj();
4913  res_vs_ToT_ba = (TH2F *)m_errors->FindKey("res_vs_SinOverP_ba")->ReadObj();
4914  tres_vs_ToT_bc = (TH2F *)m_errors->FindKey("tres_vs_SinOverP_bc")->ReadObj();
4915  res_vs_ToT_bc = (TH2F *)m_errors->FindKey("res_vs_SinOverP_bc")->ReadObj();
4916  }
4917  else
4918  {
4919  tres_vs_ToT_ba = (TH2F *)m_errors->FindKey("tres_vs_SinOverP_ea")->ReadObj();
4920  res_vs_ToT_ba = (TH2F *)m_errors->FindKey("res_vs_SinOverP_ea")->ReadObj();
4921  tres_vs_ToT_bc = (TH2F *)m_errors->FindKey("tres_vs_SinOverP_ec")->ReadObj();
4922  res_vs_ToT_bc = (TH2F *)m_errors->FindKey("res_vs_SinOverP_ec")->ReadObj();
4923  }
4924  }
4925  else
4926  {
4927  if (isba)
4928  { // cos
4929  tres_vs_ToT_ba = (TH2F *)m_errors->FindKey("tres_vs_CosOverP_bc")->ReadObj();
4930  res_vs_ToT_ba = (TH2F *)m_errors->FindKey("res_vs_CosOverP_ba")->ReadObj();
4931  tres_vs_ToT_bc = (TH2F *)m_errors->FindKey("tres_vs_CosOverP_bc")->ReadObj();
4932  res_vs_ToT_bc = (TH2F *)m_errors->FindKey("res_vs_CosOverP_bc")->ReadObj();
4933  }
4934  else
4935  {
4936  tres_vs_ToT_ba = (TH2F *)m_errors->FindKey("tres_vs_CosOverP_ea")->ReadObj();
4937  res_vs_ToT_ba = (TH2F *)m_errors->FindKey("res_vs_CosOverP_ea")->ReadObj();
4938  tres_vs_ToT_bc = (TH2F *)m_errors->FindKey("tres_vs_CosOverP_ec")->ReadObj();
4939  res_vs_ToT_bc = (TH2F *)m_errors->FindKey("res_vs_CosOverP_ec")->ReadObj();
4940  }
4941  }
4942  }
4943  else
4944  {
4945  if (!isht)
4946  {
4947  if (isba)
4948  { // sin
4949  tres_vs_ToT_ba = (TH2F *)m_errors->FindKey("tresAr_vs_SinOverP_bc")->ReadObj();
4950  res_vs_ToT_ba = (TH2F *)m_errors->FindKey("resAr_vs_SinOverP_ba")->ReadObj();
4951  tres_vs_ToT_bc = (TH2F *)m_errors->FindKey("tresAr_vs_SinOverP_bc")->ReadObj();
4952  res_vs_ToT_bc = (TH2F *)m_errors->FindKey("resAr_vs_SinOverP_bc")->ReadObj();
4953  }
4954  else
4955  {
4956  tres_vs_ToT_ba = (TH2F *)m_errors->FindKey("tresAr_vs_SinOverP_ea")->ReadObj();
4957  res_vs_ToT_ba = (TH2F *)m_errors->FindKey("resAr_vs_SinOverP_ea")->ReadObj();
4958  tres_vs_ToT_bc = (TH2F *)m_errors->FindKey("tresAr_vs_SinOverP_ec")->ReadObj();
4959  res_vs_ToT_bc = (TH2F *)m_errors->FindKey("resAr_vs_SinOverP_ec")->ReadObj();
4960  }
4961  }
4962  else
4963  {
4964  if (isba)
4965  { // cos
4966  tres_vs_ToT_ba = (TH2F *)m_errors->FindKey("tresAr_vs_CosOverP_bc")->ReadObj();
4967  res_vs_ToT_ba = (TH2F *)m_errors->FindKey("resAr_vs_CosOverP_ba")->ReadObj();
4968  tres_vs_ToT_bc = (TH2F *)m_errors->FindKey("tresAr_vs_CosOverP_bc")->ReadObj();
4969  res_vs_ToT_bc = (TH2F *)m_errors->FindKey("resAr_vs_CosOverP_bc")->ReadObj();
4970  }
4971  else
4972  {
4973  tres_vs_ToT_ba = (TH2F *)m_errors->FindKey("tresAr_vs_CosOverP_ea")->ReadObj();
4974  res_vs_ToT_ba = (TH2F *)m_errors->FindKey("resAr_vs_CosOverP_ea")->ReadObj();
4975  tres_vs_ToT_bc = (TH2F *)m_errors->FindKey("tresAr_vs_CosOverP_ec")->ReadObj();
4976  res_vs_ToT_bc = (TH2F *)m_errors->FindKey("resAr_vs_CosOverP_ec")->ReadObj();
4977  }
4978  }
4979  }
4980 
4981  this->cd(1);
4982  // Time Residual Mean Vs Pt:
4983  TGraphErrors *tresBA = GetMean(tres_vs_ToT_ba);
4984  tresBA->SetLineColor(kRed);
4985  tresBA->SetMarkerColor(kRed);
4986  if (isba)
4987  tres_vs_ToT_ba->SetTitle("Barrel A Time Residual Mean VS sin(Theta)/p");
4988  else
4989  tres_vs_ToT_ba->SetTitle("Endcap A Time Residual Mean VS sin(Theta)/p");
4990  tres_vs_ToT_ba->GetXaxis()->SetTitle("sin(Theta)/p");
4991  tres_vs_ToT_ba->GetYaxis()->SetTitle("Time Residual (ns)");
4992 
4993  if (isht)
4994  {
4995  if (isba)
4996  tres_vs_ToT_ba->SetTitle("Barrel A Time Residual Mean VS cos(Theta)/p");
4997  else
4998  tres_vs_ToT_ba->SetTitle("Endcap A Time Residual Mean VS cos(Theta)/p");
4999  tres_vs_ToT_ba->GetXaxis()->SetTitle("cos(Theta)/p");
5000  }
5001 
5002  tres_vs_ToT_ba->Draw("colz");
5003  tresBA->Draw("same");
5004 
5005  this->cd(3);
5006  TGraphErrors *tresBC = GetMean(tres_vs_ToT_bc);
5007  tresBC->SetLineColor(kBlue);
5008  tresBC->SetMarkerColor(kBlue);
5009  if (isba)
5010  tres_vs_ToT_bc->SetTitle("Barrel C Time Residual Mean VS sin(Theta)/p");
5011  else
5012  tres_vs_ToT_bc->SetTitle("Endcap C Time Residual Mean VS sin(Theta)/p");
5013  tres_vs_ToT_bc->GetXaxis()->SetTitle("sin(Theta)/p");
5014  tres_vs_ToT_bc->GetYaxis()->SetTitle("Time Residual (ns)");
5015  if (isht)
5016  {
5017  if (isba)
5018  tres_vs_ToT_bc->SetTitle("Barrel C Time Residual Mean VS cos(Theta)/p");
5019  else
5020  tres_vs_ToT_bc->SetTitle("Endcap C Time Residual Mean VS cos(Theta)/p");
5021  tres_vs_ToT_bc->GetXaxis()->SetTitle("cos(Theta)/p");
5022  }
5023  tres_vs_ToT_bc->Draw("colz");
5024  tresBC->Draw("same");
5025 
5026  this->cd(5);
5027  tresBA->SetTitle("Barrel Time Residual Mean vs Sin(theta) / p");
5028  if (!isba)
5029  tresBA->SetTitle("Endcap Time Residual Mean vs Sin(theta) / p");
5030 
5031  if (isht)
5032  {
5033  tresBA->SetTitle("Barrel Time Residual Mean vs Cos(theta) / p");
5034  if (!isba)
5035  tresBA->SetTitle("Endcap Time Residual Mean vs Cos(theta) / p");
5036  }
5037 
5038  tresBA->GetXaxis()->SetRangeUser(0, 1);
5039  tresBA->GetYaxis()->SetRangeUser(-1, 1.5);
5040  tresBA->Draw("alp");
5041  tresBC->Draw("same");
5042 
5043  this->cd(2);
5044  TGraphErrors *resBA1 = GetMean(res_vs_ToT_ba);
5045  resBA1->SetLineColor(kRed);
5046  resBA1->SetMarkerColor(kRed);
5047  if (isba)
5048  res_vs_ToT_ba->SetTitle("Barrel A Residual Mean VS sin(Theta)/p");
5049  else
5050  res_vs_ToT_ba->SetTitle("Endcap A Residual Mean VS sin(Theta)/p");
5051  res_vs_ToT_ba->GetXaxis()->SetTitle("sin(Theta)/p");
5052  res_vs_ToT_ba->GetYaxis()->SetTitle("Residual (mm)");
5053  if (isht)
5054  {
5055  if (isba)
5056  res_vs_ToT_ba->SetTitle("Barrel A Residual Mean VS cos(Theta)/p");
5057  else
5058  res_vs_ToT_ba->SetTitle("Endcap A Residual Mean VS cos(Theta)/p");
5059  res_vs_ToT_ba->GetXaxis()->SetTitle("cos(Theta)/p");
5060  }
5061  res_vs_ToT_ba->Draw("colz");
5062  resBA1->Draw("same");
5063 
5064  this->cd(4);
5065  TGraphErrors *resBC1 = GetMean(res_vs_ToT_bc);
5066  resBC1->SetLineColor(kBlue);
5067  resBC1->SetMarkerColor(kBlue);
5068  if (isba)
5069  res_vs_ToT_bc->SetTitle("Barrel C Residual Mean VS sin(Theta)/p");
5070  else
5071  res_vs_ToT_bc->SetTitle("Endcap C Residual Mean VS sin(Theta)/p");
5072  res_vs_ToT_bc->GetXaxis()->SetTitle("sin(Theta)/p");
5073  res_vs_ToT_bc->GetYaxis()->SetTitle("Residual (mm)");
5074  if (isht)
5075  {
5076  if (isba)
5077  res_vs_ToT_bc->SetTitle("Barrel C Residual Mean VS cos(Theta)/p");
5078  else
5079  res_vs_ToT_bc->SetTitle("Endcap C Residual Mean VS cos(Theta)/p");
5080  res_vs_ToT_bc->GetXaxis()->SetTitle("cos(Theta)/p");
5081  }
5082  res_vs_ToT_bc->Draw("colz");
5083  resBC1->Draw("same");
5084 
5085  this->cd(6);
5086 
5087  TGraphErrors *resBA = GetWidth(res_vs_ToT_ba);
5088  resBA->SetLineColor(kRed);
5089  resBA->SetMarkerColor(kRed);
5090  TGraphErrors *resBC = GetWidth(res_vs_ToT_bc);
5091  resBC->SetLineColor(kBlue);
5092  resBC->SetMarkerColor(kBlue);
5093  resBA->SetTitle("Barrel Residual Width vs Sin(theta) / p");
5094  if (!isba)
5095  resBA->SetTitle("Endcap Residual Widht vs Sin(theta) / p");
5096 
5097  if (isht)
5098  {
5099  resBA->SetTitle("Barrel Residual Width vs Cos(theta) / p");
5100  if (!isba)
5101  resBA->SetTitle("Endcap Residual Widht vs Cos(theta) / p");
5102  }
5103 
5104  resBA->GetXaxis()->SetRangeUser(0, 1);
5105  resBA->GetYaxis()->SetRangeUser(0.08, 0.20);
5106  resBA->Draw("alp");
5107  resBC->Draw("same");
5108 }

Member Data Documentation

◆ m_errors

TDirectory* SinDependence::m_errors
private

Definition at line 4882 of file TRTCalib_makeplots.cxx.


The documentation for this class was generated from the following file:
SinDependence::m_errors
TDirectory * m_errors
Definition: TRTCalib_makeplots.cxx:4882
GetMean
TGraphErrors * GetMean(TH2F *histo)
Definition: TRTCalib_makeplots.cxx:3907
GetWidth
TGraphErrors * GetWidth(TH2F *histo)
Definition: TRTCalib_makeplots.cxx:3983
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
file
TFile * file
Definition: tile_monitor.h:29
calibdata.cd
cd
Definition: calibdata.py:51