Commit dd7078c2 authored by Vratislav Chudoba's avatar Vratislav Chudoba

SaveCosThetaTHist() implemented

parent cc87a0d7
......@@ -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; i<noIntervals; i++) { //energy intervals (canvases)
TH1F *hscoskT[noIntervals][6];
TH1F *hecoskT[noIntervals][6];
TH1F *hicoskT[noIntervals][6];
// TH1F *hscoskT[noIntervals][6];
// TH1F *hecoskT[noIntervals][6];
// TH1F *hicoskT[noIntervals][6];
if (!cosThetaT[i]) continue;
// {
......@@ -545,16 +575,22 @@ void BeAnalysis::CosThetaTk() {
for (Int_t j = 0; j < 6; j++) { //different files
if (!kChains[j]) continue;
cThetaT[i]->cd(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; i<noIntervals; i++) { //energy intervals (canvases)
TH1F *hseY[noIntervals][6];
TH1F *heeY[noIntervals][6];
TH1F *hieY[noIntervals][6];
// TH1F *hseY[noIntervals][6];
// TH1F *heeY[noIntervals][6];
// TH1F *hieY[noIntervals][6];
if (!epsilonY[i]) continue;
// {
canEpsilonY[i] = new TCanvas();
canvasTitle.Form("epsilon in %s Y-system;\t(%d,%d) degrees", (const char*)cBeE[i], kMinAngle, kMaxAngle);
canEpsilonY[i]->SetTitle(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]);
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment