Commit 1679e74c authored by Vratislav Chudoba's avatar Vratislav Chudoba

SaveThetaAHist() implemented

parent c7b887ba
...@@ -24,6 +24,7 @@ BeAnalysis::BeAnalysis() : che(0), lowExpFile(0), upExpFile(0), spectra(0) { ...@@ -24,6 +24,7 @@ BeAnalysis::BeAnalysis() : che(0), lowExpFile(0), upExpFile(0), spectra(0) {
SetNoBinsSpectra(); SetNoBinsSpectra();
SetNoBinsCorrelations(); SetNoBinsCorrelations();
SetNoBinsThetaA();
InitHistos(); InitHistos();
...@@ -246,6 +247,10 @@ void BeAnalysis::InitHistos() { ...@@ -246,6 +247,10 @@ void BeAnalysis::InitHistos() {
hseY[i][j] = 0; hseY[i][j] = 0;
heeY[i][j] = 0; heeY[i][j] = 0;
hieY[i][j] = 0; hieY[i][j] = 0;
hethetaAT[i][j] = 0;
hsthetaAT[i][j] = 0;
hithetaAT[i][j] = 0;
} }
} }
...@@ -274,9 +279,9 @@ void BeAnalysis::SaveSpectrumHist(Int_t chain) { ...@@ -274,9 +279,9 @@ void BeAnalysis::SaveSpectrumHist(Int_t chain) {
} }
void BeAnalysis::SaveEpsilonTHist(Int_t interval, Int_t chain) { void BeAnalysis::SaveEpsilonTHist(Int_t interval, Int_t chain, TString outfilename) {
TFile fw("figures/epsilonT.root", "UPDATE"); TFile fw(outfilename.Data(), "UPDATE");
TString hName; TString hName;
...@@ -351,6 +356,34 @@ void BeAnalysis::SaveEpsilonYHist(Int_t interval, Int_t chain) { ...@@ -351,6 +356,34 @@ void BeAnalysis::SaveEpsilonYHist(Int_t interval, Int_t chain) {
} }
void BeAnalysis::SaveThetaAHist(Int_t interval, Int_t chain) {
TFile fw("figures/thetaA.root", "UPDATE");
TString hName;
if (hethetaAT[interval][chain] != 0) {
hName.Form("hethetaAT%d_%d_%d%d", interval, chain, kMinAngle, kMaxAngle);
hethetaAT[interval][chain]->SetName(hName.Data());
hethetaAT[interval][chain]->Write();
Info("BeAnalysis::SaveThetaAHist", "Histogram saved.");
}
if (hsthetaAT[interval][chain] != 0) {
hName.Form("hsthetaAT%d_%d_%d%d", interval, chain, kMinAngle, kMaxAngle);
hsthetaAT[interval][chain]->SetName(hName.Data());
hsthetaAT[interval][chain]->Write();
Info("BeAnalysis::SaveThetaAHist", "Histogram saved.");
}
if (hithetaAT[interval][chain] != 0) {
hName.Form("hithetaAT%d_%d_%d%d", interval, chain, kMinAngle, kMaxAngle);
hithetaAT[interval][chain]->SetName(hName.Data());
hithetaAT[interval][chain]->Write();
Info("BeAnalysis::SaveThetaAHist", "Histogram saved.");
}
fw.Close();
}
void BeAnalysis::SetCMAngularCuts() { void BeAnalysis::SetCMAngularCuts() {
TString sAngles, srAngles; TString sAngles, srAngles;
...@@ -905,9 +938,9 @@ void BeAnalysis::ThetaAT() { ...@@ -905,9 +938,9 @@ void BeAnalysis::ThetaAT() {
TCanvas *cThetaAT[noIntervals]; TCanvas *cThetaAT[noIntervals];
for (Int_t i = 0; i<noIntervals; i++) { //energy intervals (canvases) for (Int_t i = 0; i<noIntervals; i++) { //energy intervals (canvases)
TH1F *hsthetaAT[noIntervals][6]; // TH1F *hsthetaAT[noIntervals][6];
TH1F *hethetaAT[noIntervals][6]; // TH1F *hethetaAT[noIntervals][6];
TH1F *hithetaAT[noIntervals][6]; // TH1F *hithetaAT[noIntervals][6];
if (!thetaAT[i]) continue; if (!thetaAT[i]) continue;
...@@ -921,20 +954,23 @@ void BeAnalysis::ThetaAT() { ...@@ -921,20 +954,23 @@ void BeAnalysis::ThetaAT() {
che->SetLineColor(kBlack); che->SetLineColor(kBlack);
for (Int_t j = 0; j < 6; j++) { //different files for (Int_t j = 0; j < 6; j++) { //different files
if (!kChains[j]) continue; if (!kChains[j]) continue;
cThetaAT[i]->cd(j+1); cThetaAT[i]->cd(j+1);
hsName.Form("hsthetaAT%d_%d", i, j); hsName.Form("hsthetaAT%d_%d", i, j);
hsthetaAT[i][j] = new TH1F(hsName.Data(), "title", 30, 0, 3.14); hsthetaAT[i][j] = new TH1F(hsName.Data(), cAngles.GetTitle(), noBinsThetaA, 0, TMath::Pi());
hsthetaAT[i][j]->SetLineColor(kGray+1); hsthetaAT[i][j]->SetLineColor(kGray+1);
hsthetaAT[i][j]->SetFillColor(kGray+1); hsthetaAT[i][j]->SetFillColor(kGray+1);
drawCommand.Form("fAThetaCM>>%s", hsthetaAT[i][j]->GetName()); drawCommand.Form("fAThetaCM>>%s", hsthetaAT[i][j]->GetName());
chs[j]->Draw(drawCommand.Data(), cQ && crBeE[i] && crAngles && crEpsilonT && sRatio[j], "goff", sEventsECuts[i][j]); chs[j]->Draw(drawCommand.Data(), cQ && crBeE[i] && crAngles && crEpsilonT && sRatio[j], "goff", sEventsECuts[i][j]);
heName.Form("hethetaAT%d_%d", i, j); heName.Form("hethetaAT%d_%d", i, j);
hethetaAT[i][j] = new TH1F(heName.Data(), "title", 30, 0, 3.14); hethetaAT[i][j] = new TH1F(heName.Data(), cAngles.GetTitle(), noBinsThetaA, 0, TMath::Pi());
drawCommand.Form("fAThetaCM>>%s", hethetaAT[i][j]->GetName()); drawCommand.Form("fAThetaCM>>%s", hethetaAT[i][j]->GetName());
che->Draw(drawCommand.Data(), cQ && cBeE[i] && cAngles && cEpsilonT, "goff", eEventsECuts[i][j]); che->Draw(drawCommand.Data(), cQ && cBeE[i] && cAngles && cEpsilonT, "goff", eEventsECuts[i][j]);
hsthetaAT[i][j]->Draw(); hsthetaAT[i][j]->Draw();
hsthetaAT[i][j]->SetTitle(""); // hsthetaAT[i][j]->SetTitle("");
hsthetaAT[i][j]->SetXTitle("\\theta_{\\alpha} (rad)"); hsthetaAT[i][j]->SetXTitle("\\theta_{\\alpha} (rad)");
// hsthetaAT[i][j]->GetXaxis()->SetTitleOffset(0.95); // hsthetaAT[i][j]->GetXaxis()->SetTitleOffset(0.95);
hsthetaAT[i][j]->GetXaxis()->CenterTitle(); hsthetaAT[i][j]->GetXaxis()->CenterTitle();
...@@ -956,9 +992,10 @@ void BeAnalysis::ThetaAT() { ...@@ -956,9 +992,10 @@ void BeAnalysis::ThetaAT() {
cThetaAT[i]->Update(); cThetaAT[i]->Update();
hiName.Form("hithetaAT%d_%d", i, j); hiName.Form("hithetaAT%d_%d", i, j);
drawCommand.Form("sACM.Theta()>>%s(30,0,3.14)", hiName.Data()); hithetaAT[i][j] = new TH1F(hiName.Data(), cAngles.GetTitle(), noBinsThetaA, 0, TMath::Pi());
drawCommand.Form("sACM.Theta()>>%s", hiName.Data());
ti[j]->Draw(drawCommand.Data(), ciEpsilon && ciBeE[i] && sRatio[j], "same"); ti[j]->Draw(drawCommand.Data(), ciEpsilon && ciBeE[i] && sRatio[j], "same");
hithetaAT[i][j] = (TH1F*)gPad->FindObject(hiName.Data()); // hithetaAT[i][j] = (TH1F*)gPad->FindObject(hiName.Data());
Float_t rightmax = 1.1*hithetaAT[i][j]->GetMaximum(); Float_t rightmax = 1.1*hithetaAT[i][j]->GetMaximum();
Float_t scale = cThetaAT[i]->GetPad(j+1)->GetUymax()/rightmax; Float_t scale = cThetaAT[i]->GetPad(j+1)->GetUymax()/rightmax;
hithetaAT[i][j]->SetLineColor(kRed); hithetaAT[i][j]->SetLineColor(kRed);
......
...@@ -40,6 +40,7 @@ public: ...@@ -40,6 +40,7 @@ public:
void SetNoBinsSpectra(Int_t noBins = 100) {noBinsSpectra = noBins;}; void SetNoBinsSpectra(Int_t noBins = 100) {noBinsSpectra = noBins;};
void SetNoBinsCorrelations(Int_t noBins = 30) {noBinsCorr = noBins;}; void SetNoBinsCorrelations(Int_t noBins = 30) {noBinsCorr = noBins;};
void SetNoBinsThetaA(Int_t noBins = 30) {noBinsThetaA = noBins;};
TChain* GetExpChain() {return che;}; TChain* GetExpChain() {return che;};
TChain* GetSimChain(Int_t i) {return chs[i];}; TChain* GetSimChain(Int_t i) {return chs[i];};
...@@ -79,11 +80,13 @@ public: ...@@ -79,11 +80,13 @@ public:
void SaveSpectrumHist(Int_t chain); void SaveSpectrumHist(Int_t chain);
void SaveEpsilonTHist(Int_t interval, Int_t chain); void SaveEpsilonTHist(Int_t interval, Int_t chain, TString outfilename = "figures/epsilonT.root");
void SaveCosThetaTHist(Int_t interval, Int_t chain); void SaveCosThetaTHist(Int_t interval, Int_t chain);
void SaveEpsilonYHist(Int_t interval, Int_t chain); void SaveEpsilonYHist(Int_t interval, Int_t chain);
void SaveThetaAHist(Int_t interval, Int_t chain);
// //
private: private:
...@@ -102,6 +105,7 @@ private: ...@@ -102,6 +105,7 @@ private:
Int_t noBinsSpectra; Int_t noBinsSpectra;
Int_t noBinsCorr; Int_t noBinsCorr;
Int_t noBinsThetaA;
Int_t kMinAngle; Int_t kMinAngle;
Int_t kMaxAngle; Int_t kMaxAngle;
...@@ -123,6 +127,10 @@ private: ...@@ -123,6 +127,10 @@ private:
TH1F *heeY[5][6]; TH1F *heeY[5][6];
TH1F *hieY[5][6]; TH1F *hieY[5][6];
TH1F *hsthetaAT[5][6];
TH1F *hethetaAT[5][6];
TH1F *hithetaAT[5][6];
//cuts //cuts
TCut cAngles; TCut cAngles;
TCut crAngles; TCut crAngles;
......
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