From dd7078c278d1dcbb3f081e2bcdf7acd955ab441d Mon Sep 17 00:00:00 2001 From: Vratislav Chudoba Date: Tue, 1 Aug 2017 13:29:04 +0300 Subject: [PATCH] SaveCosThetaTHist() implemented --- Be/BeAnalysis.cpp | 69 ++++++++++++++++++++++++++++++++++++----------- Be/BeAnalysis.h | 11 +++++--- 2 files changed, 61 insertions(+), 19 deletions(-) diff --git a/Be/BeAnalysis.cpp b/Be/BeAnalysis.cpp index f555a8c..4f1c260 100644 --- a/Be/BeAnalysis.cpp +++ b/Be/BeAnalysis.cpp @@ -238,6 +238,14 @@ void BeAnalysis::InitHistos() { hseT[i][j] = 0; heeT[i][j] = 0; hieT[i][j] = 0; + + hscoskT[i][j] = 0; + hecoskT[i][j] = 0; + hicoskT[i][j] = 0; + + hseY[i][j] = 0; + heeY[i][j] = 0; + hieY[i][j] = 0; } } @@ -256,6 +264,7 @@ void BeAnalysis::SaveSpectrumHist(Int_t i) { void BeAnalysis::SaveEpsilonTHist(Int_t interval, Int_t chain) { TFile fw("figures/epsilonT.root", "UPDATE"); + if (heeT[interval][chain] != 0) { heeT[interval][chain]->Write(); Info("BeAnalysis::SaveEpsilonTHist", "Histogram saved."); @@ -272,6 +281,27 @@ void BeAnalysis::SaveEpsilonTHist(Int_t interval, Int_t chain) { } +void BeAnalysis::SaveCosThetaTHist(Int_t interval, Int_t chain) { + + TFile fw("figures/cosThetaT.root", "UPDATE"); + + if (hecoskT[interval][chain] != 0) { + hecoskT[interval][chain]->Write(); + Info("BeAnalysis::SaveCosThetaTHist", "Histogram saved."); + } + if (hscoskT[interval][chain] != 0) { + Info("BeAnalysis::SaveCosThetaTHist", "Histogram saved."); + hscoskT[interval][chain]->Write(); + } + if (hicoskT[interval][chain] != 0) { + Info("BeAnalysis::SaveCosThetaTHist", "Histogram saved."); + hicoskT[interval][chain]->Write(); + } + + fw.Close(); + +} + void BeAnalysis::SetCMAngularCuts() { TString sAngles, srAngles; @@ -527,9 +557,9 @@ void BeAnalysis::CosThetaTk() { TCanvas *cThetaT[noIntervals]; for (Int_t i = 0; icd(j+1); - chs[j]->SetLineColor(kGray+1); - chs[j]->SetFillColor(kGray+1); +// chs[j]->SetLineColor(kGray+1); +// chs[j]->SetFillColor(kGray+1); hsName.Form("hscoskT%d_%d", i, j); - drawCommand.Form("fCosThetaTk>>%s(30,-1,1)", hsName.Data()); + hscoskT[i][j] = new TH1F(hsName.Data(), cAngles.GetTitle(), noBinsCorr, -1., 1.); + hscoskT[i][j]->SetLineColor(kGray+1); + hscoskT[i][j]->SetFillColor(kGray+1); + drawCommand.Form("fCosThetaTk>>%s", hsName.Data()); chs[j]->Draw(drawCommand.Data(), cQ && crBeE[i] && crAngles && sRatio[j], "", sEventsECuts[i][j]); - hscoskT[i][j] = (TH1F*)gPad->FindObject(hsName.Data()); +// hscoskT[i][j] = (TH1F*)gPad->FindObject(hsName.Data()); + heName.Form("hecoskT%d_%d", i, j); - drawCommand.Form("fCosThetaTk>>%s(30,-1,1)", heName.Data()); + hecoskT[i][j] = new TH1F(heName.Data(), cAngles.GetTitle(), noBinsCorr, -1., 1.); + drawCommand.Form("fCosThetaTk>>%s", heName.Data()); +// drawCommand.Form("fCosThetaTk>>%s(30,-1,1)", heName.Data()); che->Draw(drawCommand.Data(), cQ && cBeE[i] && cAngles, "E same", eEventsECuts[i][j]); - hecoskT[i][j] = (TH1F*)gPad->FindObject(heName.Data()); +// hecoskT[i][j] = (TH1F*)gPad->FindObject(heName.Data()); hscoskT[i][j]->Draw(); hscoskT[i][j]->SetTitle(""); @@ -583,9 +619,10 @@ void BeAnalysis::CosThetaTk() { hiName.Form("hicoskT%d_%d", i, j); - drawCommand.Form("sCosThetaTk>>%s(30,0,1)", hiName.Data()); + hicoskT[i][j] = new TH1F(hiName.Data(), cAngles.GetTitle(), noBinsCorr, -1., 1.); + drawCommand.Form("sCosThetaTk>>%s", hiName.Data()); ti[j]->Draw(drawCommand.Data(), ciBeE[i] && sRatio[j], "same"); - hicoskT[i][j] = (TH1F*)gPad->FindObject(hiName.Data()); +// hicoskT[i][j] = (TH1F*)gPad->FindObject(hiName.Data()); Float_t rightmax = 1.1*hicoskT[i][j]->GetMaximum(); Float_t scale = cThetaT[i]->GetPad(j+1)->GetUymax()/rightmax; hicoskT[i][j]->SetLineColor(kRed); @@ -625,15 +662,14 @@ void BeAnalysis::EpsilonY() { TCanvas *canEpsilonY[noIntervals]; for (Int_t i = 0; iSetTitle(canvasTitle.Data()); // canEpsilonY[i]->Divide(2, 3); @@ -646,9 +682,10 @@ void BeAnalysis::EpsilonY() { chs[j]->SetLineColor(kGray+1); chs[j]->SetFillColor(kGray+1); hsName.Form("hseY%d_%d", i, j); + hseY[i][j] = new TH1F(hsName.Data(), cAngles.GetTitle(), noBinsCorr, 0., 1.); drawCommand.Form("fTap/f6BeIM>>%s(50,0,1)", hsName.Data()); chs[j]->Draw(drawCommand.Data(), cQ && crBeE[i] && crAngles && sRatio[j], "", sEvents[j]); - hseY[i][j] = (TH1F*)gPad->FindObject(hsName.Data()); +// hseY[i][j] = (TH1F*)gPad->FindObject(hsName.Data()); heName.Form("heeY%d_%d", i, j); drawCommand.Form("fTap/fBeIM>>%s(50,0,1)", heName.Data()); che->Draw(drawCommand.Data(), cQ && cBeE[i] && cAngles, "E same", eEvents[j]); diff --git a/Be/BeAnalysis.h b/Be/BeAnalysis.h index 7a3e3f6..85cd83c 100644 --- a/Be/BeAnalysis.h +++ b/Be/BeAnalysis.h @@ -79,6 +79,7 @@ public: void SaveSpectrumHist(Int_t i); void SaveEpsilonTHist(Int_t interval, Int_t chain); + void SaveCosThetaTHist(Int_t interval, Int_t chain); // @@ -111,9 +112,13 @@ private: TH1F *heeT[5][6]; TH1F *hieT[5][6]; -// TH1F *hscoskT[noIntervals][6]; -// TH1F *hecoskT[noIntervals][6]; -// TH1F *hicoskT[noIntervals][6]; + TH1F *hscoskT[5][6]; + TH1F *hecoskT[5][6]; + TH1F *hicoskT[5][6]; + + TH1F *hseY[5][6]; + TH1F *heeY[5][6]; + TH1F *hieY[5][6]; //cuts TCut cAngles; -- 2.18.1