A set of histograms for efficiency 4D RecHits. More...
#include <Histograms.h>
Public Member Functions | |
void | ComputeEfficiency () |
void | Fill (float etaSimSegm, float phiSimSegm, float xSimSegm, float ySimSegm, float alphaSimSegm, float betaSimSegm, bool fillRecHit) |
HEff4DHit (std::string name_) | |
HEff4DHit (TString name_, TFile *file) | |
void | Write () |
~HEff4DHit () | |
Public Attributes | |
TH1F * | hAlphaRecHit |
TH1F * | hAlphaSimSegm |
TH1F * | hBetaRecHit |
TH1F * | hBetaSimSegm |
TH1F * | hEffVsAlpha |
TH1F * | hEffVsBeta |
TH1F * | hEffVsEta |
TH1F * | hEffVsPhi |
TH1F * | hEffVsX |
TH1F * | hEffVsY |
TH1F * | hEtaRecHit |
TH1F * | hEtaSimSegm |
TH1F * | hPhiRecHit |
TH1F * | hPhiSimSegm |
TH1F * | hXRecHit |
TH1F * | hXSimSegm |
TH1F * | hYRecHit |
TH1F * | hYSimSegm |
TString | name |
A set of histograms for efficiency 4D RecHits.
Definition at line 1076 of file Histograms.h.
HEff4DHit::HEff4DHit | ( | std::string | name_ | ) | [inline] |
Definition at line 1078 of file Histograms.h.
References hAlphaRecHit, hAlphaSimSegm, hBetaRecHit, hBetaSimSegm, hEffVsAlpha, hEffVsBeta, hEffVsEta, hEffVsPhi, hEffVsX, hEffVsY, hEtaRecHit, hEtaSimSegm, hPhiRecHit, hPhiSimSegm, hXRecHit, hXSimSegm, hYRecHit, hYSimSegm, MultiGaussianStateTransform::N, name, and Pi.
{ TString N = name_.c_str(); name=N; hEtaSimSegm = new TH1F("4D_"+N+"_hEtaSimSegm", "Eta of SimHit segment", 100, -1.5, 1.5); hEtaRecHit = new TH1F("4D_"+N+"_hEtaRecHit", "Eta distribution of SimHit segment with 4D RecHit", 100, -1.5, 1.5); hEffVsEta = 0; hPhiSimSegm = new TH1F("4D_"+N+"_hPhiSimSegm", "Phi of SimHit segment", 100, -TMath::Pi(),TMath::Pi()); hPhiRecHit = new TH1F("4D_"+N+"_hPhiRecHit", "Phi distribution of SimHit segment with 4D RecHit", 100, -TMath::Pi(),TMath::Pi()); hEffVsPhi = 0; hXSimSegm = new TH1F("4D_"+N+"_hXSimSegm", "X position in Chamber of SimHit segment (cm)", 100, -200, 200); hXRecHit = new TH1F("4D_"+N+"_hXRecHit", "X position in Chamber of SimHit segment with 4D RecHit (cm)", 100, -200, 200); hEffVsX = 0; hYSimSegm = new TH1F("4D_"+N+"_hYSimSegm", "Y position in Chamber of SimHit segment (cm)", 100, -200, 200); hYRecHit = new TH1F("4D_"+N+"_hYRecHit", "Y position in Chamber of SimHit segment with 4D RecHit (cm)", 100, -200, 200); hEffVsY = 0; hAlphaSimSegm = new TH1F("4D_"+N+"_hAlphaSimSegm", "Alpha of SimHit segment (rad)", 100, -1.5, 1.5); hAlphaRecHit = new TH1F("4D_"+N+"_hAlphaRecHit", "Alpha of SimHit segment with 4D RecHit (rad)", 100, -1.5, 1.5); hEffVsAlpha = 0; hBetaSimSegm = new TH1F("4D_"+N+"_hBetaSimSegm", "Beta of SimHit segment (rad)", 100, -2, 2); hBetaRecHit = new TH1F("4D_"+N+"_hBetaRecHit", "Beta of SimHit segment with 4D RecHit (rad)", 100, -2, 2); hEffVsBeta = 0; }
HEff4DHit::HEff4DHit | ( | TString | name_, |
TFile * | file | ||
) | [inline] |
Definition at line 1120 of file Histograms.h.
References hAlphaRecHit, hAlphaSimSegm, hBetaRecHit, hBetaSimSegm, hEffVsAlpha, hEffVsBeta, hEffVsEta, hEffVsPhi, hEffVsX, hEffVsY, hEtaRecHit, hEtaSimSegm, hPhiRecHit, hPhiSimSegm, hXRecHit, hXSimSegm, hYRecHit, hYSimSegm, and name.
{ name=name_; hEtaSimSegm = (TH1F *) file->Get("4D_"+name+"_hEtaSimSegm"); hEtaRecHit = (TH1F *) file->Get("4D_"+name+"_hEtaRecHit"); hEffVsEta = (TH1F *) file->Get("4D_"+name+"_hEffVsEta"); hPhiSimSegm = (TH1F *) file->Get("4D_"+name+"_hPhiSimSegm"); hPhiRecHit = (TH1F *) file->Get("4D_"+name+"_hPhiRecHit"); hEffVsPhi = (TH1F *) file->Get("4D_"+name+"_hEffVsPhi"); hXSimSegm = (TH1F *) file->Get("4D_"+name+"_hXSimSegm"); hXRecHit = (TH1F *) file->Get("4D_"+name+"_hXRecHit"); hEffVsX = (TH1F *) file->Get("4D_"+name+"_hEffVsX"); hYSimSegm = (TH1F *) file->Get("4D_"+name+"_hYSimSegm"); hYRecHit = (TH1F *) file->Get("4D_"+name+"_hYRecHit"); hEffVsY = (TH1F *) file->Get("4D_"+name+"_hEffVsY"); hAlphaSimSegm = (TH1F *) file->Get("4D_"+name+"_hAlphaSimSegm"); hAlphaRecHit = (TH1F *) file->Get("4D_"+name+"_hAlphaRecHit"); hEffVsAlpha = (TH1F *) file->Get("4D_"+name+"_hEffVsAlpha"); hBetaSimSegm = (TH1F *) file->Get("4D_"+name+"_hBetaSimSegm"); hBetaRecHit = (TH1F *) file->Get("4D_"+name+"_hBetaRecHit"); hEffVsBeta = (TH1F *) file->Get("4D_"+name+"_hEffVsBeta"); }
HEff4DHit::~HEff4DHit | ( | ) | [inline] |
Definition at line 1148 of file Histograms.h.
{ /*delete hEtaSimSegm; delete hEtaRecHit; delete hEffVsEta; delete hPhiSimSegm; delete hPhiRecHit; delete hEffVsPhi; delete hXSimSegm; delete hXRecHit; delete hEffVsX; delete hYSimSegm; delete hYRecHit; delete hEffVsY; delete hAlphaSimSegm; delete hAlphaRecHit; delete hEffVsAlpha; delete hBetaSimSegm; delete hBetaRecHit; delete hEffVsBeta;*/ }
void HEff4DHit::ComputeEfficiency | ( | ) | [inline] |
Definition at line 1197 of file Histograms.h.
References newFWLiteAna::bin, error, hAlphaRecHit, hAlphaSimSegm, hBetaRecHit, hBetaSimSegm, hEffVsAlpha, hEffVsBeta, hEffVsEta, hEffVsPhi, hEffVsX, hEffVsY, hEtaRecHit, hEtaSimSegm, hPhiRecHit, hPhiSimSegm, hXRecHit, hXSimSegm, hYRecHit, hYSimSegm, name, and mathSSE::sqrt().
{ hEffVsEta = (TH1F *) hEtaRecHit->Clone(); hEffVsEta->SetName("4D_"+name+"_hEffVsEta"); hEffVsEta->SetTitle("4D RecHit Efficiency as a function of Eta"); hEffVsEta->Divide(hEtaSimSegm); // Set the error accordingly to binomial statistics int nBinsEta = hEffVsEta->GetNbinsX(); for(int bin = 1; bin <= nBinsEta; bin++) { float nSimHit = hEtaSimSegm->GetBinContent(bin); float eff = hEffVsEta->GetBinContent(bin); float error = 0; if(nSimHit != 0) { error = sqrt(eff*(1-eff)/nSimHit); } hEffVsEta->SetBinError(bin, error); } hEffVsPhi = (TH1F *) hPhiRecHit->Clone(); hEffVsPhi->SetName("4D_"+name+"_hEffVsPhi"); hEffVsPhi->SetTitle("4D RecHit Efficiency as a function of Phi"); hEffVsPhi->Divide(hPhiSimSegm); // Set the error accordingly to binomial statistics int nBinsPhi = hEffVsPhi->GetNbinsX(); for(int bin = 1; bin <= nBinsPhi; bin++) { float nSimHit = hPhiSimSegm->GetBinContent(bin); float eff = hEffVsPhi->GetBinContent(bin); float error = 0; if(nSimHit != 0) { error = sqrt(eff*(1-eff)/nSimHit); } hEffVsPhi->SetBinError(bin, error); } hEffVsX = (TH1F *) hXRecHit->Clone(); hEffVsX->SetName("4D_"+name+"_hEffVsX"); hEffVsX->SetTitle("4D RecHit Efficiency as a function of x position in Chamber"); hEffVsX->Divide(hXSimSegm); // Set the error accordingly to binomial statistics int nBinsX = hEffVsX->GetNbinsX(); for(int bin = 1; bin <= nBinsX; bin++) { float nSimHit = hXSimSegm->GetBinContent(bin); float eff = hEffVsX->GetBinContent(bin); float error = 0; if(nSimHit != 0) { error = sqrt(eff*(1-eff)/nSimHit); } hEffVsX->SetBinError(bin, error); } hEffVsY = (TH1F *) hYRecHit->Clone(); hEffVsY->SetName("4D_"+name+"_hEffVsY"); hEffVsY->SetTitle("4D RecHit Efficiency as a function of y position in Chamber"); hEffVsY->Divide(hYSimSegm); // Set the error accordingly to binomial statistics int nBinsY = hEffVsY->GetNbinsX(); for(int bin = 1; bin <= nBinsY; bin++) { float nSimHit = hYSimSegm->GetBinContent(bin); float eff = hEffVsY->GetBinContent(bin); float error = 0; if(nSimHit != 0) { error = sqrt(eff*(1-eff)/nSimHit); } hEffVsY->SetBinError(bin, error); } hEffVsAlpha = (TH1F *) hAlphaRecHit->Clone(); hEffVsAlpha->SetName("4D_"+name+"_hEffVsAlpha"); hEffVsAlpha->SetTitle("4D RecHit Efficiency as a function of alpha"); hEffVsAlpha->Divide(hAlphaSimSegm); // Set the error accordingly to binomial statistics int nBinsAlpha = hEffVsAlpha->GetNbinsX(); for(int bin = 1; bin <= nBinsAlpha; bin++) { float nSimHit = hAlphaSimSegm->GetBinContent(bin); float eff = hEffVsAlpha->GetBinContent(bin); float error = 0; if(nSimHit != 0) { error = sqrt(eff*(1-eff)/nSimHit); } hEffVsAlpha->SetBinError(bin, error); } hEffVsBeta = (TH1F *) hBetaRecHit->Clone(); hEffVsBeta->SetName("4D_"+name+"_hEffVsBeta"); hEffVsBeta->SetTitle("4D RecHit Efficiency as a function of beta"); hEffVsBeta->Divide(hBetaSimSegm); // Set the error accordingly to binomial statistics int nBinsBeta = hEffVsBeta->GetNbinsX(); for(int bin = 1; bin <= nBinsBeta; bin++) { float nSimHit = hBetaSimSegm->GetBinContent(bin); float eff = hEffVsBeta->GetBinContent(bin); float error = 0; if(nSimHit != 0) { error = sqrt(eff*(1-eff)/nSimHit); } hEffVsBeta->SetBinError(bin, error); } }
void HEff4DHit::Fill | ( | float | etaSimSegm, |
float | phiSimSegm, | ||
float | xSimSegm, | ||
float | ySimSegm, | ||
float | alphaSimSegm, | ||
float | betaSimSegm, | ||
bool | fillRecHit | ||
) | [inline] |
Definition at line 1170 of file Histograms.h.
References hAlphaRecHit, hAlphaSimSegm, hBetaRecHit, hBetaSimSegm, hEtaRecHit, hEtaSimSegm, hPhiRecHit, hPhiSimSegm, hXRecHit, hXSimSegm, hYRecHit, and hYSimSegm.
Referenced by DTSegment4DQuality::analyze().
{ hEtaSimSegm->Fill(etaSimSegm); hPhiSimSegm->Fill(phiSimSegm); hXSimSegm->Fill(xSimSegm); hYSimSegm->Fill(ySimSegm); hAlphaSimSegm->Fill(alphaSimSegm); hBetaSimSegm->Fill(betaSimSegm); if(fillRecHit) { hEtaRecHit->Fill(etaSimSegm); hPhiRecHit->Fill(phiSimSegm); hXRecHit->Fill(xSimSegm); hYRecHit->Fill(ySimSegm); hAlphaRecHit->Fill(alphaSimSegm); hBetaRecHit->Fill(betaSimSegm); } }
void HEff4DHit::Write | ( | ) | [inline] |
Definition at line 1298 of file Histograms.h.
References hAlphaRecHit, hAlphaSimSegm, hBetaRecHit, hBetaSimSegm, hEffVsAlpha, hEffVsBeta, hEffVsEta, hEffVsPhi, hEffVsX, hEffVsY, hEtaRecHit, hEtaSimSegm, hPhiRecHit, hPhiSimSegm, hXRecHit, hXSimSegm, hYRecHit, and hYSimSegm.
{ hEtaSimSegm->Write(); hEtaRecHit->Write(); if(hEffVsEta != 0) hEffVsEta->Write(); hPhiSimSegm->Write(); hPhiRecHit->Write(); if(hEffVsPhi != 0) hEffVsPhi->Write(); hXSimSegm->Write(); hXRecHit->Write(); if(hEffVsX != 0) hEffVsX->Write(); hYSimSegm->Write(); hYRecHit->Write(); if(hEffVsY != 0) hEffVsY->Write(); hAlphaSimSegm->Write(); hAlphaRecHit->Write(); if(hEffVsAlpha != 0) hEffVsAlpha->Write(); hBetaSimSegm->Write(); hBetaRecHit->Write(); if(hEffVsBeta != 0) hEffVsBeta->Write(); }
TH1F* HEff4DHit::hAlphaRecHit |
Definition at line 1340 of file Histograms.h.
Referenced by ComputeEfficiency(), Fill(), HEff4DHit(), and Write().
TH1F* HEff4DHit::hAlphaSimSegm |
Definition at line 1339 of file Histograms.h.
Referenced by ComputeEfficiency(), Fill(), HEff4DHit(), and Write().
TH1F* HEff4DHit::hBetaRecHit |
Definition at line 1343 of file Histograms.h.
Referenced by ComputeEfficiency(), Fill(), HEff4DHit(), and Write().
TH1F* HEff4DHit::hBetaSimSegm |
Definition at line 1342 of file Histograms.h.
Referenced by ComputeEfficiency(), Fill(), HEff4DHit(), and Write().
TH1F* HEff4DHit::hEffVsAlpha |
Definition at line 1341 of file Histograms.h.
Referenced by ComputeEfficiency(), HEff4DHit(), and Write().
TH1F* HEff4DHit::hEffVsBeta |
Definition at line 1344 of file Histograms.h.
Referenced by ComputeEfficiency(), HEff4DHit(), and Write().
TH1F* HEff4DHit::hEffVsEta |
Definition at line 1329 of file Histograms.h.
Referenced by ComputeEfficiency(), HEff4DHit(), and Write().
TH1F* HEff4DHit::hEffVsPhi |
Definition at line 1332 of file Histograms.h.
Referenced by ComputeEfficiency(), HEff4DHit(), and Write().
TH1F* HEff4DHit::hEffVsX |
Definition at line 1335 of file Histograms.h.
Referenced by ComputeEfficiency(), HEff4DHit(), and Write().
TH1F* HEff4DHit::hEffVsY |
Definition at line 1338 of file Histograms.h.
Referenced by ComputeEfficiency(), HEff4DHit(), and Write().
TH1F* HEff4DHit::hEtaRecHit |
Definition at line 1328 of file Histograms.h.
Referenced by ComputeEfficiency(), Fill(), HEff4DHit(), and Write().
TH1F* HEff4DHit::hEtaSimSegm |
Definition at line 1327 of file Histograms.h.
Referenced by ComputeEfficiency(), Fill(), HEff4DHit(), and Write().
TH1F* HEff4DHit::hPhiRecHit |
Definition at line 1331 of file Histograms.h.
Referenced by ComputeEfficiency(), Fill(), HEff4DHit(), and Write().
TH1F* HEff4DHit::hPhiSimSegm |
Definition at line 1330 of file Histograms.h.
Referenced by ComputeEfficiency(), Fill(), HEff4DHit(), and Write().
TH1F* HEff4DHit::hXRecHit |
Definition at line 1334 of file Histograms.h.
Referenced by ComputeEfficiency(), Fill(), HEff4DHit(), and Write().
TH1F* HEff4DHit::hXSimSegm |
Definition at line 1333 of file Histograms.h.
Referenced by ComputeEfficiency(), Fill(), HEff4DHit(), and Write().
TH1F* HEff4DHit::hYRecHit |
Definition at line 1337 of file Histograms.h.
Referenced by ComputeEfficiency(), Fill(), HEff4DHit(), and Write().
TH1F* HEff4DHit::hYSimSegm |
Definition at line 1336 of file Histograms.h.
Referenced by ComputeEfficiency(), Fill(), HEff4DHit(), and Write().
TString HEff4DHit::name |
Definition at line 1346 of file Histograms.h.
Referenced by ComputeEfficiency(), and HEff4DHit().