Commit a389fc81 authored by Vratislav Chudoba's avatar Vratislav Chudoba

ThetaAT() implemented.

parent 9d4118df
......@@ -54,6 +54,22 @@ BeAnalysis::BeAnalysis() : che(0), spectra(1) {
cosThetaY[2] = 1;
cosThetaY[4] = 1;
// thetaP1T = new Bool_t[noIntervals];
// for (Int_t i = 0; i < noIntervals; i++) {
// thetaP1T[i] = 0;
// }
// thetaP1T[0] = 1;
// thetaP1T[2] = 1;
// thetaP1T[4] = 1;
thetaAT = new Bool_t[noIntervals];
for (Int_t i = 0; i < noIntervals; i++) {
thetaAT[i] = 0;
}
thetaAT[0] = 1;
thetaAT[2] = 1;
thetaAT[4] = 1;
kVerbose = 1;
kRangeProportionIn = 2.0;
......@@ -770,7 +786,178 @@ void BeAnalysis::CosThetaYk() {
}
void BeAnalysis::ThetaP1T() {
//void BeAnalysis::ThetaP1T() {
//
// const Double_t tP1Range[5][6] = {90, 90, 90, 90, 90, 90,
// 140, 140, 140, 140, 140, 140,
// 130, 130, 130, 130, 130, 130,
// 190, 190, 190, 190, 190, 190,
// 200, 200, 200, 200, 200, 200};
//
//
// TCanvas *cThetaP1T[noIntervals];
// for (Int_t i = 0; i<noIntervals; i++) { //energy intervals (canvases)
//
// TH1F *hsthetaP1T[noIntervals][6];
// TH1F *hethetaP1T[noIntervals][6];
// TH1F *hithetaP1T[noIntervals][6];
//
// if (!thetaP1T[i]) continue;
// // {
//
// cThetaP1T[i] = new TCanvas();
//
// canvasTitle.Form("cos theta p1 in %s T-system;\t(%d,%d) degrees", (const char*)cBeE[i], kMinAngle, kMaxAngle);
// cThetaP1T[i]->SetTitle(canvasTitle.Data());
// cThetaP1T[i]->Divide(2, 3);
//
// che->SetLineColor(kBlack);
// for (Int_t j = 0; j < 6; j++) { //different files
// cThetaP1T[i]->cd(j+1);
// chs[j]->SetLineColor(kGray+1);
// chs[j]->SetFillColor(kGray+1);
// hsName.Form("hsthetaP1T%d_%d", i, j);
// drawCommand.Form("fP1ThetaCM>>%s(50,0,3.14)", hsName.Data());
// chs[j]->Draw(drawCommand.Data(), cQ && crBeE[i] && crAngles && crEpsilonT && sRatio[j], "", sEvents[j]);
// hsthetaP1T[i][j] = (TH1F*)gPad->FindObject(hsName.Data());
// heName.Form("hethetaP1T%d_%d", i, j);
// drawCommand.Form("fP1ThetaCM>>%s(50,0,3.14)", heName.Data());
// che->Draw(drawCommand.Data(), cQ && cBeE[i] && cAngles && cEpsilonT, "E same", eEvents[j]);
// hethetaP1T[i][j] = (TH1F*)gPad->FindObject(heName.Data());
//
// hsthetaP1T[i][j]->Draw();
// hsthetaP1T[i][j]->GetYaxis()->SetRangeUser(0, tP1Range[i][j]);
// hethetaP1T[i][j]->Draw("E same");
// cThetaP1T[i]->Update();
//
//
// hiName.Form("hithetaP1T%d_%d", i, j);
// drawCommand.Form("sP1CM.Theta()>>%s", hiName.Data());
// ti[j]->Draw(drawCommand.Data(), ciEpsilon && ciBeE[i] && sRatio[j], "same");
// hithetaP1T[i][j] = (TH1F*)gPad->FindObject(hiName.Data());
// Float_t rightmax = 1.1*hithetaP1T[i][j]->GetMaximum();
// Float_t scale = cThetaP1T[i]->GetPad(j+1)->GetUymax()/rightmax;
// hithetaP1T[i][j]->SetLineColor(kRed);
// hithetaP1T[i][j]->Scale(scale);
//
// //draw an axis on the right side
// TGaxis *axis = new TGaxis(gPad->GetUxmax(),gPad->GetUymin(),
// gPad->GetUxmax(), gPad->GetUymax(),0,rightmax,510,"+L");
// axis->SetLineColor(kRed);
// axis->SetLabelColor(kRed);
// axis->Draw();
//
// cThetaP1T[i]->Update();
//
//
// }//for j
// /*if (savePictures) {
// canvasName.Form("%sfig%dthetaP1T:%s%s", ppath.Data(), i, configuration.Data(), pictFormat.Data());
// cThetaP1T[i]->SaveAs(canvasName.Data());
// cThetaP1T[i]->cd();
// cThetaP1T[i]->Close();
// }*/
// // }//if
// }//for i
//
//}
void BeAnalysis::ThetaAT() {
TCanvas *cThetaAT[noIntervals];
for (Int_t i = 0; i<noIntervals; i++) { //energy intervals (canvases)
TH1F *hsthetaAT[noIntervals][6];
TH1F *hethetaAT[noIntervals][6];
TH1F *hithetaAT[noIntervals][6];
if (!thetaAT[i]) continue;
// {
cThetaAT[i] = new TCanvas();
canvasTitle.Form("cos theta alpha in %s T-system;\t(%d,%d) degrees", (const char*)cBeE[i], kMinAngle, kMaxAngle);
cThetaAT[i]->SetTitle(canvasTitle.Data());
cThetaAT[i]->Divide(2, 3);
che->SetLineColor(kBlack);
for (Int_t j = 0; j < 6; j++) { //different files
if (!kChains[j]) continue;
cThetaAT[i]->cd(j+1);
hsName.Form("hsthetaAT%d_%d", i, j);
hsthetaAT[i][j] = new TH1F(hsName.Data(), "title", 50, 0, 3.14);
// hsthetaAT[i][j] = new TH1F(hsName.Data(), "title", 50, -1, 1);
hsthetaAT[i][j]->SetLineColor(kGray+1);
hsthetaAT[i][j]->SetFillColor(kGray+1);
drawCommand.Form("fAThetaCM>>%s", hsthetaAT[i][j]->GetName());
// drawCommand.Form("cos(fAThetaCM)>>%s", hsthetaAT[i][j]->GetName());
chs[j]->Draw(drawCommand.Data(), cQ && crBeE[i] && crAngles && crEpsilonT && sRatio[j], "goff", sEventsECuts[i][j]);
heName.Form("hethetaAT%d_%d", i, j);
hethetaAT[i][j] = new TH1F(heName.Data(), "title", 50, 0, 3.14);
// hethetaAT[i][j] = new TH1F(heName.Data(), "title", 50, -1, 1);
drawCommand.Form("fAThetaCM>>%s", hethetaAT[i][j]->GetName());
// drawCommand.Form("cos(fAThetaCM)>>%s", hethetaAT[i][j]->GetName());
che->Draw(drawCommand.Data(), cQ && cBeE[i] && cAngles && cEpsilonT, "goff", eEventsECuts[i][j]);
hsthetaAT[i][j]->Draw();
hsthetaAT[i][j]->SetTitle("");
hsthetaAT[i][j]->SetXTitle("\\theta_{\\alpha} [rad]");
hsthetaAT[i][j]->GetXaxis()->SetTitleOffset(0.95);
hsthetaAT[i][j]->GetXaxis()->CenterTitle();
hsthetaAT[i][j]->SetYTitle("counts");
// hsthetaAT[i][j]->GetYaxis()->SetTitleOffset(1.09);
hsthetaAT[i][j]->GetYaxis()->SetTitleOffset(0.7);
hsthetaAT[i][j]->GetYaxis()->CenterTitle();
hethetaAT[i][j]->Draw("E same");
if (kAutoRange) {
Float_t leftMaxMC = kRangeProportion*hethetaAT[i][j]->GetMaximum();
Float_t leftMaxE = kRangeProportion*hsthetaAT[i][j]->GetMaximum();
hsthetaAT[i][j]->GetYaxis()->SetRangeUser(0, leftMaxE);
leftMaxMC > leftMaxE ? hsthetaAT[i][j]->GetYaxis()->SetRangeUser(0, leftMaxMC) : hsthetaAT[i][j]->GetYaxis()->SetRangeUser(0, leftMaxE);
}
else {
hsthetaAT[i][j]->GetYaxis()->SetRangeUser(0, eTRange[i][j]);
}
cThetaAT[i]->Update();
hiName.Form("hithetaAT%d_%d", i, j);
drawCommand.Form("sACM.Theta()>>%s(50,0,3.14)", hiName.Data());
// drawCommand.Form("cos(sACM.Theta())>>%s(50,-1,1)", hiName.Data());
ti[j]->Draw(drawCommand.Data(), ciEpsilon && ciBeE[i] && sRatio[j], "same");
hithetaAT[i][j] = (TH1F*)gPad->FindObject(hiName.Data());
Float_t rightmax = 1.1*hithetaAT[i][j]->GetMaximum();
Float_t scale = cThetaAT[i]->GetPad(j+1)->GetUymax()/rightmax;
hithetaAT[i][j]->SetLineColor(kRed);
hithetaAT[i][j]->Scale(scale);
//draw an axis on the right side
TGaxis *axis = new TGaxis(gPad->GetUxmax(),gPad->GetUymin(),
gPad->GetUxmax(), gPad->GetUymax(),0,rightmax,510,"+L");
axis->SetLineColor(kRed);
axis->SetLabelColor(kRed);
axis->Draw();
cThetaAT[i]->Update();
if (kVerbose) {
Info("sfAngInt_thetaAT.cxx", "cut%d; case%d: %3.1f (exp)/ %3.1f (sim) = %3.3f",
i, j, hethetaAT[i][j]->Integral(0,hethetaAT[i][j]->GetNbinsX()),
hsthetaAT[i][j]->Integral(0,hsthetaAT[i][j]->GetNbinsX()),
hethetaAT[i][j]->Integral(0,hethetaAT[i][j]->GetNbinsX())/hsthetaAT[i][j]->Integral(0,hsthetaAT[i][j]->GetNbinsX()) );
}
}//for j
/*if (savePictures) {
canvasName.Form("%sfig%dthetaAT:%s%s", ppath.Data(), i, configuration.Data(), pictFormat.Data());
cThetaAT[i]->SaveAs(canvasName.Data());
cThetaAT[i]->cd();
cThetaAT[i]->Close();
}*/
// }//if
}//for i
}
void BeAnalysis::ExpEventsECuts() {
......@@ -836,6 +1023,3 @@ void BeAnalysis::EpsilonTRange() {
}
void BeAnalysis::ThetaAT() {
}
......@@ -71,6 +71,9 @@ private:
Bool_t *epsilonY; //!
Bool_t *cosThetaY; //!
// Bool_t *thetaP1T; //!
Bool_t *thetaAT; //!
Bool_t kAutoRange;
Float_t kRangeProportion;
Bool_t kVerbose;
......
......@@ -20,6 +20,8 @@ void lib_test() {
// ana.EpsilonT();
// ana.CosThetaTk();
ana.EpsilonY();
ana.CosThetaYk();
// ana.EpsilonY();
// ana.CosThetaYk();
ana.ThetaAT();
}
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