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

Public Member Functions

 ToTDependence (TFile *, bool, bool, bool isAr)
 

Private Attributes

TDirectory * m_errors
 

Detailed Description

Definition at line 4590 of file TRTCalib_makeplots.cxx.

Constructor & Destructor Documentation

◆ ToTDependence()

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

Definition at line 4599 of file TRTCalib_makeplots.cxx.

4600 {
4601  m_errors = nullptr;
4602  cout << "READING CORRECTIONS: " << endl;
4603 
4604  if (!isAr)
4605  m_errors = (TDirectory *)file->FindKey("Correction")->ReadObj();
4606  else
4607  m_errors = (TDirectory *)file->FindKey("CorrectionAr")->ReadObj();
4608 
4609  this->Divide(2, 3, 0.01, 0.01);
4610 
4611  // Read the histos:
4612 
4613  TH2F *tres_vs_ToT_ba = nullptr;
4614  TH2F *tres_vs_ToT_bc = nullptr;
4615  // Residual:
4616  TH2F *res_vs_ToT_ba = nullptr;
4617  TH2F *res_vs_ToT_bc = nullptr;
4618 
4619  if (!isAr)
4620  {
4621  if (!isht)
4622  {
4623  if (isba)
4624  {
4625  if (m_errors->FindKey("tres_vs_ToT_ba"))
4626  tres_vs_ToT_ba = (TH2F *)m_errors->FindKey("tres_vs_ToT_ba")->ReadObj();
4627  if (m_errors->FindKey("res_vs_ToT_ba"))
4628  res_vs_ToT_ba = (TH2F *)m_errors->FindKey("res_vs_ToT_ba")->ReadObj();
4629  if (m_errors->FindKey("tres_vs_ToT_bc"))
4630  tres_vs_ToT_bc = (TH2F *)m_errors->FindKey("tres_vs_ToT_bc")->ReadObj();
4631  if (m_errors->FindKey("res_vs_ToT_bc"))
4632  res_vs_ToT_bc = (TH2F *)m_errors->FindKey("res_vs_ToT_bc")->ReadObj();
4633  }
4634  else
4635  {
4636  if (m_errors->FindKey("tres_vs_ToT_ea"))
4637  tres_vs_ToT_ba = (TH2F *)m_errors->FindKey("tres_vs_ToT_ea")->ReadObj();
4638  if (m_errors->FindKey("res_vs_ToT_ea"))
4639  res_vs_ToT_ba = (TH2F *)m_errors->FindKey("res_vs_ToT_ea")->ReadObj();
4640  if (m_errors->FindKey("tres_vs_ToT_ec"))
4641  tres_vs_ToT_bc = (TH2F *)m_errors->FindKey("tres_vs_ToT_ec")->ReadObj();
4642  if (m_errors->FindKey("res_vs_ToT_ec"))
4643  res_vs_ToT_bc = (TH2F *)m_errors->FindKey("res_vs_ToT_ec")->ReadObj();
4644  }
4645  }
4646  else
4647  {
4648  if (isba)
4649  {
4650  if (m_errors->FindKey("tres_vs_HT_ba"))
4651  tres_vs_ToT_ba = (TH2F *)m_errors->FindKey("tres_vs_HT_ba")->ReadObj();
4652  if (m_errors->FindKey("res_vs_HT_ba"))
4653  res_vs_ToT_ba = (TH2F *)m_errors->FindKey("res_vs_HT_ba")->ReadObj();
4654  if (m_errors->FindKey("tres_vs_HT_bc"))
4655  tres_vs_ToT_bc = (TH2F *)m_errors->FindKey("tres_vs_HT_bc")->ReadObj();
4656  if (m_errors->FindKey("res_vs_HT_bc"))
4657  res_vs_ToT_bc = (TH2F *)m_errors->FindKey("res_vs_HT_bc")->ReadObj();
4658  }
4659  else
4660  {
4661  if (m_errors->FindKey("tres_vs_HT_ea"))
4662  tres_vs_ToT_ba = (TH2F *)m_errors->FindKey("tres_vs_HT_ea")->ReadObj();
4663  if (m_errors->FindKey("res_vs_HT_ea"))
4664  res_vs_ToT_ba = (TH2F *)m_errors->FindKey("res_vs_HT_ea")->ReadObj();
4665  if (m_errors->FindKey("tres_vs_HT_ec"))
4666  tres_vs_ToT_bc = (TH2F *)m_errors->FindKey("tres_vs_HT_ec")->ReadObj();
4667  if (m_errors->FindKey("res_vs_HT_ec"))
4668  res_vs_ToT_bc = (TH2F *)m_errors->FindKey("res_vs_HT_ec")->ReadObj();
4669  }
4670  }
4671  }
4672  else
4673  {
4674  if (!isht)
4675  {
4676  if (isba)
4677  {
4678  if (m_errors->FindKey("tresAr_vs_ToT_ba"))
4679  tres_vs_ToT_ba = (TH2F *)m_errors->FindKey("tresAr_vs_ToT_ba")->ReadObj();
4680  if (m_errors->FindKey("resAr_vs_ToT_ba"))
4681  res_vs_ToT_ba = (TH2F *)m_errors->FindKey("resAr_vs_ToT_ba")->ReadObj();
4682  if (m_errors->FindKey("tresAr_vs_ToT_bc"))
4683  tres_vs_ToT_bc = (TH2F *)m_errors->FindKey("tresAr_vs_ToT_bc")->ReadObj();
4684  if (m_errors->FindKey("resAr_vs_ToT_bc"))
4685  res_vs_ToT_bc = (TH2F *)m_errors->FindKey("resAr_vs_ToT_bc")->ReadObj();
4686  }
4687  else
4688  {
4689  if (m_errors->FindKey("tresAr_vs_ToT_ea"))
4690  tres_vs_ToT_ba = (TH2F *)m_errors->FindKey("tresAr_vs_ToT_ea")->ReadObj();
4691  if (m_errors->FindKey("resAr_vs_ToT_ea"))
4692  res_vs_ToT_ba = (TH2F *)m_errors->FindKey("resAr_vs_ToT_ea")->ReadObj();
4693  if (m_errors->FindKey("tresAr_vs_ToT_ec"))
4694  tres_vs_ToT_bc = (TH2F *)m_errors->FindKey("tresAr_vs_ToT_ec")->ReadObj();
4695  if (m_errors->FindKey("resAr_vs_ToT_ec"))
4696  res_vs_ToT_bc = (TH2F *)m_errors->FindKey("resAr_vs_ToT_ec")->ReadObj();
4697  }
4698  }
4699  else
4700  {
4701  if (isba)
4702  {
4703  if (m_errors->FindKey("tresAr_vs_HT_ba"))
4704  tres_vs_ToT_ba = (TH2F *)m_errors->FindKey("tresAr_vs_HT_ba")->ReadObj();
4705  if (m_errors->FindKey("resAr_vs_HT_ba"))
4706  res_vs_ToT_ba = (TH2F *)m_errors->FindKey("resAr_vs_HT_ba")->ReadObj();
4707  if (m_errors->FindKey("tresAr_vs_HT_bc"))
4708  tres_vs_ToT_bc = (TH2F *)m_errors->FindKey("tresAr_vs_HT_bc")->ReadObj();
4709  if (m_errors->FindKey("resAr_vs_HT_bc"))
4710  res_vs_ToT_bc = (TH2F *)m_errors->FindKey("resAr_vs_HT_bc")->ReadObj();
4711  }
4712  else
4713  {
4714  if (m_errors->FindKey("tresAr_vs_HT_ea"))
4715  tres_vs_ToT_ba = (TH2F *)m_errors->FindKey("tresAr_vs_HT_ea")->ReadObj();
4716  if (m_errors->FindKey("resAr_vs_HT_ea"))
4717  res_vs_ToT_ba = (TH2F *)m_errors->FindKey("resAr_vs_HT_ea")->ReadObj();
4718  if (m_errors->FindKey("tresAr_vs_HT_ec"))
4719  tres_vs_ToT_bc = (TH2F *)m_errors->FindKey("tresAr_vs_HT_ec")->ReadObj();
4720  if (m_errors->FindKey("resAr_vs_HT_ec"))
4721  res_vs_ToT_bc = (TH2F *)m_errors->FindKey("resAr_vs_HT_ec")->ReadObj();
4722  }
4723  }
4724  }
4725 
4726  this->cd(1);
4727  // Time Residual Mean Vs Pt:
4728  TGraphErrors *tresBA = GetMean(tres_vs_ToT_ba);
4729  tresBA->SetLineColor(kRed);
4730  tresBA->SetMarkerColor(kRed);
4731  if (not tres_vs_ToT_ba){
4732  throw std::runtime_error("tres_vs_ToT_ba pointer is null");
4733  }
4734  if (isba)
4735  tres_vs_ToT_ba->SetTitle("Barrel A Time Residual Mean VS ToT");
4736  else
4737  tres_vs_ToT_ba->SetTitle("Endcap A Time Residual Mean VS ToT");
4738  tres_vs_ToT_ba->GetXaxis()->SetTitle("ToT (bin)");
4739  tres_vs_ToT_ba->GetYaxis()->SetTitle("Time Residual (ns)");
4740 
4741  if (isht){
4742  if (isba){
4743  tres_vs_ToT_ba->SetTitle("Barrel A Time Residual Mean VS HT");
4744  }else{
4745  tres_vs_ToT_ba->SetTitle("Endcap A Time Residual Mean VS HT");}
4746  tres_vs_ToT_ba->GetXaxis()->SetTitle("HT (bin)");
4747  }
4748 
4749  tres_vs_ToT_ba->Draw("colz");
4750  tresBA->Draw("same");
4751 
4752  this->cd(3);
4753  TGraphErrors *tresBC = GetMean(tres_vs_ToT_bc);
4754  tresBC->SetLineColor(kBlue);
4755  tresBC->SetMarkerColor(kBlue);
4756  if (isba){
4757  if (not tres_vs_ToT_bc){
4758  throw std::runtime_error(" tres_vs_ToT_bc is null");
4759  }
4760  tres_vs_ToT_bc->SetTitle("Barrel C Time Residual Mean VS ToT");
4761  }else{
4762  tres_vs_ToT_bc->SetTitle("Endcap C Time Residual Mean VS ToT");}
4763  tres_vs_ToT_bc->GetXaxis()->SetTitle("ToT (bin)");
4764  tres_vs_ToT_bc->GetYaxis()->SetTitle("Time Residual (ns)");
4765  if (isht){
4766  if (isba){
4767  tres_vs_ToT_bc->SetTitle("Barrel C Time Residual Mean VS HT");
4768  }else{
4769  tres_vs_ToT_bc->SetTitle("Endcap C Time Residual Mean VS HT");
4770  }
4771  tres_vs_ToT_bc->GetXaxis()->SetTitle("HT (bin)");
4772  }
4773 
4774  tres_vs_ToT_bc->Draw("colz");
4775  tresBC->Draw("same");
4776 
4777  this->cd(5);
4778  tresBA->SetTitle("Barrel Time Residual Mean vs ToT");
4779  if (!isba)
4780  tresBA->SetTitle("Endcap Time Residual Mean vs ToT");
4781  tresBA->GetXaxis()->SetTitle("ToT (bin)");
4782 
4783  if (isht)
4784  {
4785  tresBA->SetTitle("Barrel Time Residual Mean vs HT");
4786  if (!isba)
4787  tresBA->SetTitle("Endcap Time Residual Mean vs HT");
4788  tresBA->GetXaxis()->SetTitle("HT");
4789  }
4790  tresBA->GetXaxis()->SetRangeUser(-0.5, 23.5);
4791  tresBA->GetYaxis()->SetRangeUser(-10, 10);
4792  if (isht)
4793  {
4794  tresBA->GetXaxis()->SetRangeUser(-0.5, 1.5);
4795  tresBA->GetYaxis()->SetRangeUser(-3, 3);
4796  }
4797  tresBA->Draw("alp");
4798  tresBC->Draw("same");
4799 
4800  this->cd(2);
4801  TGraphErrors *resBA1 = GetMean(res_vs_ToT_ba);
4802  resBA1->SetLineColor(kRed);
4803  resBA1->SetMarkerColor(kRed);
4804  if (not res_vs_ToT_ba){
4805  throw std::runtime_error("res_vs_ToT_ba is null ptr");
4806  }
4807  if (isba)
4808  res_vs_ToT_ba->SetTitle("Barrel A Residual Mean VS ToT");
4809  else
4810  res_vs_ToT_ba->SetTitle("Endcap A Residual Mean VS ToT");
4811  res_vs_ToT_ba->GetXaxis()->SetTitle("ToT (bin)");
4812  res_vs_ToT_ba->GetYaxis()->SetTitle("Residual (mm)");
4813  if (isht)
4814  {
4815  if (isba)
4816  res_vs_ToT_ba->SetTitle("Barrel A Residual Mean VS HT");
4817  else
4818  res_vs_ToT_ba->SetTitle("Endcap A Residual Mean VS HT");
4819  res_vs_ToT_ba->GetXaxis()->SetTitle("HT (bin)");
4820  }
4821  res_vs_ToT_ba->Draw("colz");
4822  resBA1->Draw("same");
4823 
4824  this->cd(4);
4825  TGraphErrors *resBC1 = GetMean(res_vs_ToT_bc);
4826  resBC1->SetLineColor(kBlue);
4827  resBC1->SetMarkerColor(kBlue);
4828  if (isba)
4829  res_vs_ToT_bc->SetTitle("Barrel C Residual Mean VS ToT");
4830  else
4831  res_vs_ToT_bc->SetTitle("Endcap C Residual Mean VS ToT");
4832  res_vs_ToT_bc->GetXaxis()->SetTitle("ToT (bin)");
4833  res_vs_ToT_bc->GetYaxis()->SetTitle("Residual (mm)");
4834  if (isht)
4835  {
4836  if (isba)
4837  res_vs_ToT_bc->SetTitle("Barrel C Residual Mean VS HT");
4838  else
4839  res_vs_ToT_bc->SetTitle("Endcap C Residual Mean VS HT");
4840  res_vs_ToT_bc->GetXaxis()->SetTitle("HT (bin)");
4841  }
4842  res_vs_ToT_bc->Draw("colz");
4843  resBC1->Draw("same");
4844 
4845  this->cd(6);
4846 
4847  TGraphErrors *resBA = GetWidth(res_vs_ToT_ba);
4848  resBA->SetLineColor(kRed);
4849  resBA->SetMarkerColor(kRed);
4850  TGraphErrors *resBC = GetWidth(res_vs_ToT_bc);
4851  resBC->SetLineColor(kBlue);
4852  resBC->SetMarkerColor(kBlue);
4853  resBA->SetTitle("Barrel Time Residual Width vs ToT");
4854  if (!isba)
4855  resBA->SetTitle("Endcap Time Residual Width vs ToT");
4856  resBA->GetXaxis()->SetTitle("ToT (bin)");
4857 
4858  if (isht)
4859  {
4860  resBA->SetTitle("Barrel Residual Width vs HT");
4861  if (!isba)
4862  resBA->SetTitle("Endcap Residual Width vs HT");
4863  resBA->GetXaxis()->SetTitle("HT");
4864  }
4865  resBA->GetXaxis()->SetRangeUser(-0.5, 23.5);
4866  resBA->GetYaxis()->SetRangeUser(0.08, 0.2);
4867  if (isht)
4868  {
4869  resBA->GetXaxis()->SetRangeUser(-0.5, 1.5);
4870  resBA->GetYaxis()->SetRangeUser(0.08, 0.2);
4871  }
4872  resBA->Draw("alp");
4873  resBC->Draw("same");
4874 }

Member Data Documentation

◆ m_errors

TDirectory* ToTDependence::m_errors
private

Definition at line 4596 of file TRTCalib_makeplots.cxx.


The documentation for this class was generated from the following file:
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
ToTDependence::m_errors
TDirectory * m_errors
Definition: TRTCalib_makeplots.cxx:4596
file
TFile * file
Definition: tile_monitor.h:29
calibdata.cd
cd
Definition: calibdata.py:51