Commit 3edca5dd authored by Vratislav Chudoba's avatar Vratislav Chudoba

CosThetaTk() and EpsilonY() implemented.

parent 5e0723a0
......@@ -30,6 +30,23 @@ BeAnalysis::BeAnalysis() : che(0), spectra(1) {
epsilonT[0] = 1;
epsilonT[2] = 1;
cosThetaT = new Bool_t[noIntervals];
for (Int_t i = 0; i < noIntervals; i++) {
cosThetaT[i] = 0;
}
cosThetaT[0] = 1;
cosThetaT[2] = 1;
cosThetaT[4] = 1;
epsilonY = new Bool_t[noIntervals];
for (Int_t i = 0; i < noIntervals; i++) {
epsilonY[i] = 0;
}
epsilonY[0] = 1;
epsilonY[2] = 1;
kVerbose = 1;
kRangeProportionIn = 2.0;
......@@ -483,9 +500,179 @@ void BeAnalysis::EpsilonT() {
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];
if (!cosThetaT[i]) continue;
// {
cThetaT[i] = new TCanvas();
canvasTitle.Form("cos thetak in %s T-system;\t(%d,%d) degrees", (const char*)cBeE[i], kMinAngle, kMaxAngle);
cThetaT[i]->SetTitle(canvasTitle.Data());
cThetaT[i]->Divide(2, 3);
che->SetLineColor(kBlack);
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);
hsName.Form("hscoskT%d_%d", i, j);
drawCommand.Form("fCosThetaTk>>%s(50,-1,1)", hsName.Data());
chs[j]->Draw(drawCommand.Data(), cQ && crBeE[i] && crAngles && sRatio[j], "", sEventsECuts[i][j]);
hscoskT[i][j] = (TH1F*)gPad->FindObject(hsName.Data());
heName.Form("hecoskT%d_%d", i, j);
drawCommand.Form("fCosThetaTk>>%s(50,-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());
hscoskT[i][j]->Draw();
// hscoskT[i][j]->GetYaxis()->SetRangeUser(0, coskTRange[i][j]);
hecoskT[i][j]->Draw("E same");
if (kAutoRange) {
Float_t leftMaxMC = kRangeProportion*hecoskT[i][j]->GetMaximum();
Float_t leftMaxE = kRangeProportion*hscoskT[i][j]->GetMaximum();
hscoskT[i][j]->GetYaxis()->SetRangeUser(0, leftMaxE);
leftMaxMC > leftMaxE ? hscoskT[i][j]->GetYaxis()->SetRangeUser(0, leftMaxMC) : hscoskT[i][j]->GetYaxis()->SetRangeUser(0, leftMaxE);
}
else {
hscoskT[i][j]->GetYaxis()->SetRangeUser(0, eTRange[i][j]);
}
cThetaT[i]->Update();
hiName.Form("hicoskT%d_%d", i, j);
drawCommand.Form("sCosThetaTk>>%s(50,0,1)", hiName.Data());
ti[j]->Draw(drawCommand.Data(), ciBeE[i] && sRatio[j], "same");
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);
hicoskT[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();
cThetaT[i]->Update();
if (kVerbose) {
Info("sfAngInt_cosThetaTk.cxx", "cut%d; case%d: %3.1f (exp)/ %3.1f (sim) = %3.3f",
i, j, hecoskT[i][j]->Integral(0,hecoskT[i][j]->GetNbinsX()),
hscoskT[i][j]->Integral(0,hscoskT[i][j]->GetNbinsX()),
hecoskT[i][j]->Integral(0,hecoskT[i][j]->GetNbinsX())/hscoskT[i][j]->Integral(0,hscoskT[i][j]->GetNbinsX()) );
}
}//for j
/*if (savePictures) {
canvasName.Form("%sfig%dcosThetakT:%s%s", ppath.Data(), i, configuration.Data(), pictFormat.Data());
cThetaT[i]->SaveAs(canvasName.Data());
cThetaT[i]->cd();
cThetaT[i]->Close();
}*/
// }//if
}//for i
}
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];
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);
che->SetLineColor(kBlack);
for (Int_t j = 0; j < 6; j++) { //different files
canEpsilonY[i]->cd(j+1);
chs[j]->SetLineColor(kGray+1);
chs[j]->SetFillColor(kGray+1);
hsName.Form("hseY%d_%d", i, j);
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());
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]);
heeY[i][j] = (TH1F*)gPad->FindObject(heName.Data());
hseY[i][j]->Draw();
heeY[i][j]->Draw("E same");
if (kAutoRange) {
Float_t leftMaxMC = kRangeProportion*heeY[i][j]->GetMaximum();
Float_t leftMaxE = kRangeProportion*hseY[i][j]->GetMaximum();
hseY[i][j]->GetYaxis()->SetRangeUser(0, leftMaxE);
leftMaxMC > leftMaxE ? hseY[i][j]->GetYaxis()->SetRangeUser(0, leftMaxMC) : hseY[i][j]->GetYaxis()->SetRangeUser(0, leftMaxE);
}
else {
hseY[i][j]->GetYaxis()->SetRangeUser(0, eTRange[i][j]);
}
canEpsilonY[i]->Update();
// ti[j]->Draw("sTap/E_IM", ciBeE[i] && sRatio[j], "same", iEvents[j]);
hiName.Form("hieY%d_%d", i, j);
drawCommand.Form("sTap/E_IM>>%s(50,0,1)", hiName.Data());
ti[j]->Draw(drawCommand.Data(), ciBeE[i] && sRatio[j], "same");
hieY[i][j] = (TH1F*)gPad->FindObject(hiName.Data());
Float_t rightmax = 1.1*hieY[i][j]->GetMaximum();
Float_t scale = canEpsilonY[i]->GetPad(j+1)->GetUymax()/rightmax;
hieY[i][j]->SetLineColor(kRed);
hieY[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();
canEpsilonY[i]->Update();
if (kVerbose) {
Info("sfAngInt_epsilonY.cxx", "cut%d; case%d: %3.1f (exp)/ %3.1f (sim) = %3.3f",
i, j, heeY[i][j]->Integral(0,heeY[i][j]->GetNbinsX()),
hseY[i][j]->Integral(0,hseY[i][j]->GetNbinsX()),
heeY[i][j]->Integral(0,heeY[i][j]->GetNbinsX())/hseY[i][j]->Integral(0,hseY[i][j]->GetNbinsX()) );
}
}//for j
/*if (savePictures) {
canvasName.Form("%sfig%dEpsilonY:%s%s", ppath.Data(), i, configuration.Data(), pictFormat.Data());
cout << canvasName.Data() << endl;
canEpsilonY[i]->SaveAs(canvasName.Data());
canEpsilonY[i]->cd();
canEpsilonY[i]->Close();
}//if save pictures*/
// }//if
}//for i
}
void BeAnalysis::CosThetaYk() {
......
......@@ -67,6 +67,8 @@ private:
Bool_t kChains[6];
Int_t noIntervals;
Bool_t *epsilonT; //!
Bool_t *cosThetaT; //!
Bool_t *epsilonY; //!
Bool_t kAutoRange;
Float_t kRangeProportion;
......
......@@ -16,5 +16,9 @@ void lib_test() {
ana.ExpEventsECuts();
ana.SimEventsECuts();
ana.EpsilonTRange();
ana.EpsilonT();
// ana.EpsilonT();
ana.CosThetaTk();
ana.EpsilonY();
}
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