diff --git a/macros/BeCorrPRC/.rootrc b/macros/BeCorrPRC/.rootrc new file mode 100644 index 0000000000000000000000000000000000000000..0d3c9af8fbfb7a4b77a2fb67402d7e03405f4c74 --- /dev/null +++ b/macros/BeCorrPRC/.rootrc @@ -0,0 +1,17 @@ +# Default histogram binnings for TTree::Draw(). + +#Rint.Logon: ./rootlogonThesis.C +Rint.Logon: ./rootlogon6panels.C +#Rint.Logon: ./rootlogonThesis4panels.C +#Rint.Logon: ./rootlogonPAC.C + +Canvas.ShowToolBar: true +Canvas.ShowEditor: true + +Hist.Binning.1D.x: 100 + +#Hist.Binning.2D.x: 40 +Hist.Binning.2D.x: 100 +#Hist.Binning.2D.y: 40 +Hist.Binning.2D.y: 100 +Hist.Binning.2D.Prof: 100 \ No newline at end of file diff --git a/macros/BeCorrPRC/ES1_6075.cxx b/macros/BeCorrPRC/ES1_6075.cxx new file mode 100644 index 0000000000000000000000000000000000000000..a3aef697a01110ef8605de74ae74510f2760ca62 --- /dev/null +++ b/macros/BeCorrPRC/ES1_6075.cxx @@ -0,0 +1,210 @@ +//void ES1_6075() +{ + //open chain with Be events only and draw E_Be + + //order: al0, noal0, al180, noal180 + + TStopwatch sw; + sw.Start(); + + const Int_t kMinAngle = 60; + const Int_t kMaxAngle = 75; + + const Int_t lowfile = 0; + const Int_t upfile = 40; + + const Int_t lowSimFile[6] = {0, 0, 0, 0, 0, 0}; + const Int_t upSimFile[6] = {14, 14, 14, 14, 14, 14}; + + + const Bool_t shapeFit = 0; + + TCut cAngles = "fBeThetaCM1>60*TMath::DegToRad() && fBeThetaCM1<75*TMath::DegToRad()"; + TCut crAngles = "f6BeThetaCM1>60*TMath::DegToRad() && f6BeThetaCM1<75*TMath::DegToRad()"; + + //simulations + //aligned, 0 degrees + TString chainAl0name = "../../../be/rootdata/correlations/v5_6075/Sim_mix_br_al_0_50-85_"; + TString inputTreeAl0name = "../../../be/rootdata/correlations/v5_6075/Sim_mix_br_al_0_50-85_000.root"; + //isotropic, 0 degrees + TString chainNoAl0name = "../../../be/rootdata/correlations/v5_6075/Sim_mix_br_noal_0_50-85_"; + TString inputTreeNoAl0name = "../../../be/rootdata/correlations/v5_6075/Sim_mix_br_noal_0_50-85_000.root"; + //aligned, 180 degrees + TString chainAl180name = "../../../be/rootdata/correlations/v5_6075/Sim_mix_br_al_180_50-85_"; + TString inputTreeAl180name = "../../../be/rootdata/correlations/v5_6075/Sim_mix_br_al_180_50-85_000.root"; + //isotropic, 180 degrees + TString chainNoAl180name = "../../../be/rootdata/correlations/v5_6075/Sim_mix_br_noal_180_50-85_"; + TString inputTreeNoAl180name = "../../../be/rootdata/correlations/v5_6075/Sim_mix_br_noal_180_50-85_000.root"; + //isotropic, 90 degrees + TString chainAl90name = "../../../be/rootdata/correlations/v5_6075/Sim_mix_br_al_90_50-85_"; + TString inputTreeAl90name = "../../../be/rootdata/correlations/v5_6075/Sim_mix_br_al_90_50-85_000.root"; + //isotropic, 90 degrees + TString chainNoAl90name = "../../../be/rootdata/correlations/v5_6075/Sim_mix_br_noal_90_50-85_"; + TString inputTreeNoAl90name = "../../../be/rootdata/correlations/v5_6075/Sim_mix_br_noal_90_50-85_000.root"; + +// TChain *che = BeWork::OpenChain("/data2/be/rootdata/correlations/Be.", +// lowfile, upfile, "beonly"); //original file +// Info("statesRatioFitting.cxx", "%d events in chain \"%s\" containing experimental data", +// che->GetEntries(), che->GetName()); + + //open tree with MC simulations + gROOT->ProcessLine(".x ../corr_templates/sfAngInt_opensimtree.cxx"); + + TChain *che = BeWork::OpenChain("../../../be/rootdata/correlations/v5_exp/Be.", + lowfile, upfile, "beonly"); //original file + Info("statesRatioFitting.cxx", "%d events in chain \"%s\" containing experimental data", + che->GetEntries(), che->GetName()); + + gROOT->ProcessLine(".x ../corr_templates/sfAngInt_cuts.cxx"); + + //auxiliary strings + TString drawCommand; + TString hsName; + TString heName; + TString hiName; + + sw.Print(); + sw.Continue(); + + const Bool_t savePictures = 0; + TString ppath = "pictures/correlations/v5_6075/"; + TString configuration = "6075"; +// TString pictFormat = ".ps"; +// gStyle->SetHistLineWidth(1); + TString pictFormat = ".eps"; +// TString pictFormat = ".gif"; + + const Bool_t kVerbose = 1; + const Bool_t kAutoRange = 1; + // const Float_t kRangeProportion = 1.2; + const Float_t kRangeProportion = 1.1; + // const Float_t kRangeProportionIn = 1.1; + const Float_t kRangeProportionIn = 2.0; + +// const Bool_t kChains[6] = {0,0,0,1,0,1}; + const Bool_t kChains[6] = {1,1,1,1,1,1}; + + const Bool_t spectra = 0; + + const Int_t nointervals = 5; + + const Bool_t cosThetaT[nointervals] = {0,0,0,0,0}; +// const Bool_t cosThetaT[nointervals] = {1,1,1,1,1}; + + const Bool_t epsilonT[nointervals] = {1,1,1,1,1}; +// const Bool_t epsilonT[nointervals] = {1,1,1,1,1}; + + const Bool_t epsilonY[nointervals] = {0,0,0,0,0}; +// const Bool_t epsilonY[nointervals] = {1,1,1,1,1}; + const Bool_t cosThetaY[nointervals] = {0,1,0,1,0}; +// const Bool_t cosThetaY[nointervals] = {1,1,1,1,1}; + + const Bool_t thetaAT[nointervals] = {0,0,0,0,0}; +// const Bool_t thetaAT[nointervals] = {1,1,1,1,1}; + + const Bool_t thetaP1T[nointervals] = {0,0,1,0,0}; +// const Bool_t thetaP1T[nointervals] = {1,1,1,1,1}; + + TCut sRatioAl0 = "sRatio>0.051 && sRatio<0.101"; +// TCut sRatioAl0 = "sRatio>0.060 && sRatio<0.110"; + TCut sRatioNoAl0 = "sRatio>0.050 && sRatio<0.100"; + TCut sRatioAl180 = "sRatio>0.047 && sRatio<0.097"; + TCut sRatioNoAl180 = "sRatio>0.048 && sRatio<0.098"; + TCut sRatioAl90 = "sRatio>0.051 && sRatio<0.101"; + TCut sRatioNoAl90 = "sRatio>0.051 && sRatio<0.101"; + TCut sRatio[6] = {sRatioAl0, sRatioNoAl0, sRatioAl180, sRatioNoAl180, sRatioAl90, sRatioNoAl90}; + + //integral fit + const Long64_t eMaxEvents = 5000000; + Long64_t eEventsAl0 = eMaxEvents; + Long64_t eEventsNoAl0 = eMaxEvents; + Long64_t eEventsAl180 = eMaxEvents; + Long64_t eEventsNoAl180 = eMaxEvents; + Long64_t eEventsAl90 = eMaxEvents; + Long64_t eEventsNoAl90 = eMaxEvents; + + Long64_t eEventsECuts[5][6] = {3950000, 3950000, 3800000, 3850000, 3950000, 3900000, + eMaxEvents, eMaxEvents, 4100000, eMaxEvents, eMaxEvents, eMaxEvents, + 3050000, 3150000, 3200000, 3200000, 3250000, 3350000, + 3850000, 3950000, 3900000, 3900000, 4000000, 4000000, + 4100000, 4100000, 4000000, 4100000, eMaxEvents, eMaxEvents}; + + const Long64_t eEvents[6] = {eEventsAl0, eEventsNoAl0, eEventsAl180, eEventsNoAl180, eEventsAl90, eEventsNoAl90}; + const TChain *chs[6] = {chsAl0, chsNoAl0, chsAl180, chsNoAl180, chsAl90, chsNoAl90}; + const TTree *ti[6] = {tiAl0, tiNoAl0, tiAl180, tiNoAl180, tiAl90, tiNoAl90}; + + const Long64_t sMaxEvents = 3000000; + Long64_t sEventsAl0 = sMaxEvents; + Long64_t sEventsNoAl0 = 2700000; + Long64_t sEventsAl180 = sMaxEvents; + Long64_t sEventsNoAl180 = 2700000; + Long64_t sEventsAl90 = 2690000; + Long64_t sEventsNoAl90 = 2710000; + const Long64_t sEvents[6] = {sEventsAl0, sEventsNoAl0, sEventsAl180, sEventsNoAl180, sEventsAl90, sEventsNoAl90}; + + Long64_t sEventsECuts[5][6] = {sMaxEvents, sMaxEvents, sMaxEvents, sMaxEvents, sMaxEvents, sMaxEvents, + sMaxEvents, 2630000, sMaxEvents, sMaxEvents, 2660000, 2660000, + sMaxEvents, sMaxEvents, sMaxEvents, sMaxEvents, sMaxEvents, sMaxEvents, + sMaxEvents, sMaxEvents, sMaxEvents, sMaxEvents, sMaxEvents, sMaxEvents, + sMaxEvents, sMaxEvents, sMaxEvents, sMaxEvents, sMaxEvents, sMaxEvents}; + + TString canvasTitle; + TString canvasName; + + const Double_t sRange[6] = {2000, 2000, 2000, 2000, 2000, 2000}; + if (spectra) { + gROOT->ProcessLine(".x ../corr_templates/sfAngInt_spectra_v5.cxx"); + } + + // "T" system + const Double_t eTRange[5][6] = {300, 300, 300, 300, 300, 300, + 380, 380, 380, 380, 380, 380, + 300, 300, 300, 300, 300, 300, + 500, 500, 500, 500, 500, 500, + 500, 500, 500, 500, 500, 500}; + gROOT->ProcessLine(".x ../corr_templates/sfAngInt_epsilonT.cxx"); + +// return; + + const Double_t coskTRange[5][6] = {350, 350, 350, 350, 350, 350, + 400, 400, 400, 400, 400, 400, + 350, 350, 350, 350, 350, 350, + 700, 700, 700, 700, 700, 700, + 900, 900, 900, 900, 900, 900}; + gROOT->ProcessLine(".x ../corr_templates/sfAngInt_cosThetaTk.cxx"); + + // "Y" system + const Double_t eYRange[5][6] = {400, 400, 400, 400, 400, 400, + 450, 450, 450, 450, 450, 450, + 400, 400, 400, 400, 400, 400, + 800, 800, 800, 800, 800, 800, + 1000, 1000, 1000, 1000, 1000, 1000}; + gROOT->ProcessLine(".x ../corr_templates/sfAngInt_epsilonY.cxx"); + + const Double_t coskYRange[5][6] = {250, 250, 250, 250, 250, 250, + 350, 350, 350, 350, 350, 350, + 300, 300, 300, 300, 300, 300, + 450, 450, 450, 450, 450, 450, + 500, 500, 500, 500, 500, 500}; + gROOT->ProcessLine(".x ../corr_templates/sfAngInt_cosThetaYk.cxx"); + + + + 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}; + gROOT->ProcessLine(".x ../corr_templates/sfAngInt_thetaP1T.cxx"); + + const Double_t tARange[5][6] = {90, 90, 90, 90, 90, 90, + 140, 140, 140, 140, 140, 140, + 160, 120, 160, 120, 160, 120, + 230, 180, 230, 180, 230, 180, + 210, 210, 210, 210, 210, 210}; + gROOT->ProcessLine(".x ../corr_templates/sfAngInt_thetaAT.cxx"); + + Info("correlations_v5_6075.cxx", "Finished."); +} + + diff --git a/macros/BeCorrPRC/load_libs.cxx b/macros/BeCorrPRC/load_libs.cxx new file mode 100644 index 0000000000000000000000000000000000000000..9283643a6a3f00ba25209c7843cc3779a9124bf0 --- /dev/null +++ b/macros/BeCorrPRC/load_libs.cxx @@ -0,0 +1,47 @@ +/* + * load_libs.cxx + * + * Created on: 12.7.2012 + * Author: vratik + */ +void load_libs() +{ +// if ( gSystem->Load("libTree") ) { +// Error("load_libs.cxx", "libTree.so was not loaded"); +// return; +// } + if ( gSystem->Load("../../libAculData.so") ) { + Error("load_libs.cxx", "libAculData.so was not loaded"); + return; + } + if ( gSystem->Load("../../libTELoss.so") ) { + Error("load_libs.cxx", "libTELoss.so was not loaded"); + return; + } + if ( gSystem->Load("../../libDetectors.so") ) { + Error("load_libs.cxx", "libDetectors.so was not loaded"); + return; + } + + +// if ( gSystem->Load("~/work/Eclipse/makefilesBe/libThreads.so") ) { +// Error("load_libs.cxx", "libThreads.so was not loaded"); +// return; +// } + + + if ( gSystem->Load("../../libBe.so") ) { + Error("load_libs.cxx", "libBe.so was not loaded"); + return; + } + +// if ( gSystem->Load("~/work/Eclipse/makefilesBe/libThreads.so") ) { +// Error("load_libs.cxx", "libThreads.so was not loaded"); +// return; +// } + + + + Info("load_libs.cxx", "Libraries loaded"); + +} diff --git a/macros/BeCorrPRC/rootlogon6panels.C b/macros/BeCorrPRC/rootlogon6panels.C new file mode 100644 index 0000000000000000000000000000000000000000..3ab3633e4cf9dfa455d67e88a6642ee7fe38506c --- /dev/null +++ b/macros/BeCorrPRC/rootlogon6panels.C @@ -0,0 +1,91 @@ +{ + + Info("rootlogonThesis.c", "This settings are used to make a nice pictures for PRC paper"); + + gROOT->ProcessLine(".x load_libs.cxx"); + + //gStyle choice +// gROOT->SetStyle("Default"); + gROOT->SetStyle("Plain"); +// gROOT->SetStyle("Bold"); +// gROOT->SetStyle("Video"); + +// gStyle->SetOptStat("n"); +// gStyle->SetOptStat("ne"); + gStyle->SetOptStat(""); + + //canvas size and position + //one panel pictures + gStyle->SetCanvasDefW(1400); + gStyle->SetCanvasDefH(600); + gStyle->SetCanvasDefX(800); + gStyle->SetCanvasDefY(300); + + //two panel pictures +// gStyle->SetCanvasDefH(850); +// gStyle->SetCanvasDefW(975); +// gStyle->SetCanvasDefX(541); +// gStyle->SetCanvasDefY(232); + + //marker attributes + gStyle->SetMarkerStyle(20); + gStyle->SetMarkerSize(0.1); + gStyle->SetMarkerColor(1); + + //line attributes + gStyle->SetHistLineWidth(1); +// gStyle->SetHistLineWidth(2); +// gStyle->SetHistLineWidth(3); + + gStyle->SetTitleBorderSize(0); + + gStyle->SetTitleXSize(0.06); + gStyle->SetTitleYSize(0.06); + + gStyle->SetTitleFont(132, "X"); + gStyle->SetTitleFont(132, "Y"); + gStyle->SetLabelFont(132, "X"); + gStyle->SetLabelFont(132, "Y"); + + gStyle->SetPadTopMargin(0.04); + gStyle->SetPadBottomMargin(0.13); + gStyle->SetPadLeftMargin(0.13); + gStyle->SetPadRightMargin(0.03); +// gStyle->SetTitleOffset(1.3, "Y"); +// gStyle->SetLabelSize(0.05, "X"); +// gStyle->SetLabelSize(0.05, "Y"); +// gStyle->SetTitleSize(0.06, "X"); +// gStyle->SetTitleSize(0.06, "Y"); + + + return; + + //parameters used for pictures in EXON paper +// gStyle->SetStatBorderSize(0); +// gStyle->SetTitleBorderSize(0); +// gStyle->SetTitleAlign(12); +// gStyle->SetTitleX(0.83); +// gStyle->SetTitleY(0.85); + gStyle->SetTitleX(0.83); //for Fig2 + gStyle->SetTitleY(0.9); //for Fig2 + gStyle->SetTitleFontSize(0.08); +// gStyle->SetTitleFillColor(0); +// gStyle->SetLineWidth(1); +// gStyle->SetHistLineWidth(1); + gStyle->SetHistLineWidth(3); + gStyle->SetPadTopMargin(0.05); + gStyle->SetPadBottomMargin(0.13); + gStyle->SetPadLeftMargin(0.14); + gStyle->SetPadRightMargin(0.05); + gStyle->SetTitleOffset(1.3, "Y"); + gStyle->SetLabelSize(0.05, "X"); + gStyle->SetLabelSize(0.05, "Y"); + gStyle->SetTitleSize(0.06, "X"); + gStyle->SetTitleSize(0.06, "Y"); + + +// gStyle->SetAxisColor(1); + gStyle->SetLabelColor(1, "X"); + gStyle->SetLabelColor(1, "Y"); + +} diff --git a/macros/corr_templates/sfAngInt_cosThetaTk.cxx b/macros/corr_templates/sfAngInt_cosThetaTk.cxx new file mode 100644 index 0000000000000000000000000000000000000000..8e627cc1ab8703fce1c1205847f9428fc6828f10 --- /dev/null +++ b/macros/corr_templates/sfAngInt_cosThetaTk.cxx @@ -0,0 +1,86 @@ +{ + + TCanvas *cThetaT[nointervals]; + for (Int_t i = 0; iSetTitle(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"); + TH1F *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 + + sw.Print(); + sw.Continue(); +} diff --git a/macros/corr_templates/sfAngInt_cosThetaYk.cxx b/macros/corr_templates/sfAngInt_cosThetaYk.cxx new file mode 100644 index 0000000000000000000000000000000000000000..b673482f0585a49342f4cc9e92c059e7f1597f77 --- /dev/null +++ b/macros/corr_templates/sfAngInt_cosThetaYk.cxx @@ -0,0 +1,87 @@ +{ + + TCanvas *cThetaY[nointervals]; + for (Int_t i = 0; iSetTitle(canvasTitle.Data()); + cThetaY[i]->Divide(2, 3); + + che->SetLineColor(kBlack); + for (Int_t j = 0; j < 6; j++) { //different files + cThetaY[i]->cd(j+1); + chs[j]->SetLineColor(kGray+1); + chs[j]->SetFillColor(kGray+1); + hsName.Form("hscoskY%d_%d", i, j); + drawCommand.Form("fCosThetaYk>>%s(50,-1,1)", hsName.Data()); + chs[j]->Draw(drawCommand.Data(), cQ && crBeE[i] && crAngles && sRatio[j], "", sEvents[j]); + TH1F *hscoskY[i][j] = (TH1F*)gPad->FindObject(hsName.Data()); + heName.Form("hecoskY%d_%d", i, j); + drawCommand.Form("fCosThetaYk>>%s(50,-1,1)", heName.Data()); + che->Draw(drawCommand.Data(), cQ && cBeE[i] && cAngles, "E same", eEvents[j]); + TH1F *hecoskY[i][j] = (TH1F*)gPad->FindObject(heName.Data()); + + hscoskY[i][j]->Draw(); +// hscoskY[i][j]->GetYaxis()->SetRangeUser(0, coskYRange[i][j]); + hecoskY[i][j]->Draw("E same"); + if (kAutoRange) { + Float_t leftMaxMC = kRangeProportion*hecoskY[i][j]->GetMaximum(); + Float_t leftMaxE = kRangeProportion*hscoskY[i][j]->GetMaximum(); + hscoskY[i][j]->GetYaxis()->SetRangeUser(0, leftMaxE); + leftMaxMC > leftMaxE ? hscoskY[i][j]->GetYaxis()->SetRangeUser(0, leftMaxMC) : hscoskY[i][j]->GetYaxis()->SetRangeUser(0, leftMaxE); + } + else { + hscoskY[i][j]->GetYaxis()->SetRangeUser(0, eTRange[i][j]); + } + + + + cThetaY[i]->Update(); + + hiName.Form("hicoskY%d_%d", i, j); + drawCommand.Form("sCosThetaYk>>%s", hiName.Data()); + ti[j]->Draw(drawCommand.Data(), ciBeE[i] && sRatio[j], "same"); + TH1F *hicoskY[i][j] = (TH1F*)gPad->FindObject(hiName.Data()); + Float_t rightmax = 1.1*hicoskY[i][j]->GetMaximum(); + Float_t scale = cThetaY[i]->GetPad(j+1)->GetUymax()/rightmax; + hicoskY[i][j]->SetLineColor(kRed); + hicoskY[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(); + + cThetaY[i]->Update(); + + if (kVerbose) { + Info("sfAngInt_cosThetaYk.cxx", "cut%d; case%d: %3.1f (exp)/ %3.1f (sim) = %3.3f", + i, j, hecoskY[i][j]->Integral(0,hecoskY[i][j]->GetNbinsX()), + hscoskY[i][j]->Integral(0,hscoskY[i][j]->GetNbinsX()), + hecoskY[i][j]->Integral(0,hecoskY[i][j]->GetNbinsX())/hscoskY[i][j]->Integral(0,hscoskY[i][j]->GetNbinsX()) ); + } + + + }//for j + if (savePictures) { + canvasName.Form("%sfig%dcosThetakY:%s%s", ppath.Data(), i, configuration.Data(), pictFormat.Data()); + cThetaY[i]->SaveAs(canvasName.Data()); + cThetaY[i]->cd(); + cThetaY[i]->Close(); + } + }//if + }//for i + + sw.Print(); + sw.Continue(); +} diff --git a/macros/corr_templates/sfAngInt_cuts.cxx b/macros/corr_templates/sfAngInt_cuts.cxx new file mode 100644 index 0000000000000000000000000000000000000000..01817b3f2175bc4fb40552442ffca4bfbd4e8dc5 --- /dev/null +++ b/macros/corr_templates/sfAngInt_cuts.cxx @@ -0,0 +1,65 @@ +{ + //script to be loaded in statesRatioFitting* scripts + // + + //file with Be events only + TCut cBe20 = "fBeIM>0 && fBeIM<20"; + TCut cBe3 = "fBeIM>0 && fBeIM<3"; + TCut cBeWork = "fBeIM>0 && fBeIM<10"; + TCut cBe0_14 = "fBeIM>0 && fBeIM<1.4"; +// TCut cBe0_14 = "fBeIM>0 && fBeIM<1.6"; +// TCut cBe0_14 = "fBeIM>0 && fBeIM<1.20"; + TCut cBe14_19 = "fBeIM>1.4 && fBeIM<1.9"; + TCut cBe19_25 = "fBeIM>1.9 && fBeIM<2.5"; + TCut cBe25_31 = "fBeIM>2.5 && fBeIM<3.1"; + TCut cBe31_37 = "fBeIM>3.1 && fBeIM<3.7"; + TCut cBeE[5] = {cBe0_14, cBe14_19, cBe19_25, cBe25_31, cBe31_37}; + + TCut cEpsilonT = "fTpp/fBeIM<0.2"; +// TCut cEpsilonT = "fTpp/fBeIM<1."; +// TCut cEpsilonY = "fTap/fBeIM<0.5"; + TCut cEpsilonY = "fTap/fBeIM>0.7"; + + //raw files + //energy cuts + TCut crBe20 = "f6BeIM>0 && f6BeIM<20"; + TCut crBe3 = "f6BeIM>0 && f6BeIM<3"; + TCut crBeWork = "f6BeIM>0 && f6BeIM<10"; + TCut crBe0_14 = "f6BeIM>0 && f6BeIM<1.4"; +// TCut crBe0_14 = "f6BeIM>0 && f6BeIM<1.6"; +// TCut crBe0_14 = "f6BeIM>0.5 && f6BeIM<1.20"; + TCut crBe14_19 = "f6BeIM>1.4 && f6BeIM<1.9"; + TCut crBe19_25 = "f6BeIM>1.9 && f6BeIM<2.5"; + TCut crBe25_31 = "f6BeIM>2.5 && f6BeIM<3.1"; + TCut crBe31_37 = "f6BeIM>3.1 && f6BeIM<3.7"; + TCut crBeE[5] = {crBe0_14, crBe14_19, crBe19_25, crBe25_31, crBe31_37}; + //angular cuts + + +// TCut crEpsilonT = "fTpp/f6BeIM>0.8"; + TCut crEpsilonT = "fTpp/f6BeIM<0.2"; +// TCut crEpsilonT = "fTpp/f6BeIM<1."; +// TCut crEpsilonY = "fTap/f6BeIM<0.5"; + TCut crEpsilonY = "fTap/f6BeIM>0.7"; + + //simulation input + TCut ciBe0_14 = "E_IM>0 && E_IM<1.4"; +// TCut ciBe0_14 = "E_IM>0 && E_IM<1.6"; +// TCut ciBe0_14 = "E_IM>0.5 && E_IM<1.20"; + TCut ciBe14_19 = "E_IM>1.4 && E_IM<1.9"; + TCut ciBe19_25 = "E_IM>1.9 && E_IM<2.5"; + TCut ciBe25_31 = "E_IM>2.5 && E_IM<3.1"; + TCut ciBe31_37 = "E_IM>3.1 && E_IM<3.7"; + TCut ciBeE[5] = {ciBe0_14, ciBe14_19, ciBe19_25, ciBe25_31, ciBe31_37}; + + TCut ciEpsilon = "sTpp/E_IM<0.2"; +// TCut ciEpsilon = "sTpp/E_IM<1."; +// TCut ciEpsilonY = "sTap/E_IM<0.5"; + TCut ciEpsilonY = "sTap/E_IM>0.7"; + + TCut cQ = "TMath::Abs(fQLiP)<10"; + TCut cProtons = "fP1Lab.fE-938.272<50 && fP2Lab.fE-938.272<50"; +// TCut cProtons = "fP1Lab.fE-938.272<34 && fP2Lab.fE-938.272<34 && fP1Lab.fE-938.272>1 && fP2Lab.fE-938.272>1"; + + +} diff --git a/macros/corr_templates/sfAngInt_epsilonT.cxx b/macros/corr_templates/sfAngInt_epsilonT.cxx new file mode 100644 index 0000000000000000000000000000000000000000..b7a47424a7d0c67ae0193ea33665d36db4c8b522 --- /dev/null +++ b/macros/corr_templates/sfAngInt_epsilonT.cxx @@ -0,0 +1,99 @@ +{ + TCanvas *canEpsilonT[nointervals]; + for (Int_t i = 0; iSetTitle(canvasTitle.Data()); + canEpsilonT[i]->Divide(2, 3); + + che->SetLineColor(kBlack); + for (Int_t j = 0; j < 6; j++) { //different files + if (!kChains[j]) continue; + canEpsilonT[i]->cd(j+1); + chs[j]->SetLineColor(kGray+1); + chs[j]->SetFillColor(kGray+1); + hsName.Form("hseT%d_%d", i, j); +// drawCommand.Form("fTpp/f6BeIM>>%s(50,0,1)", hsName.Data()); + drawCommand.Form("fTpp/f6BeIM>>%s(30,0,1)", hsName.Data()); +// chs[j]->Draw(drawCommand.Data(), cQ && crBeE[i] && crAngles && sRatio[j], "", sEventsECuts[i][j]); + chs[j]->Draw(drawCommand.Data(), cProtons && cQ && crBeE[i] && crAngles && sRatio[j], "", sEventsECuts[i][j]); + hseT[i][j] = (TH1F*)gPad->FindObject(hsName.Data()); + heName.Form("heeT%d_%d", i, j); +// drawCommand.Form("fTpp/fBeIM>>%s(50,0,1)", heName.Data()); + drawCommand.Form("fTpp/fBeIM>>%s", heName.Data()); +// che->Draw(drawCommand.Data(), cQ && cBeE[i] && cAngles, "E same", eEventsECuts[i][j]); + che->Draw(drawCommand.Data(), cProtons && cQ && cBeE[i] && cAngles, "E same", eEventsECuts[i][j]); + heeT[i][j] = (TH1F*)gPad->FindObject(heName.Data()); + + hseT[i][j]->Draw(); + hseT[i][j]->SetTitle(""); + hseT[i][j]->SetXTitle("\\varepsilon"); + hseT[i][j]->GetXaxis()->SetTitleOffset(0.95); + hseT[i][j]->GetXaxis()->CenterTitle(); + hseT[i][j]->SetYTitle("counts"); +// hseT[i][j]->GetYaxis()->SetTitleOffset(1.09); + hseT[i][j]->GetYaxis()->SetTitleOffset(0.7); + hseT[i][j]->GetYaxis()->CenterTitle(); + heeT[i][j]->Draw("E same"); + if (kAutoRange) { + Float_t leftMaxMC = kRangeProportion*hseT[i][j]->GetMaximum(); + Float_t leftMaxE = kRangeProportion*heeT[i][j]->GetMaximum(); + hseT[i][j]->GetYaxis()->SetRangeUser(0, leftMaxE); + leftMaxMC > leftMaxE ? hseT[i][j]->GetYaxis()->SetRangeUser(0, leftMaxMC) : hseT[i][j]->GetYaxis()->SetRangeUser(0, leftMaxE); + } + else { + hseT[i][j]->GetYaxis()->SetRangeUser(0, eTRange[i][j]); + } + canEpsilonT[i]->Update(); + + + hiName.Form("hieT%d_%d", i, j); +// drawCommand.Form("sTpp/E_IM>>%s(50,0,1)", hiName.Data()); + drawCommand.Form("sTpp/E_IM>>%s", hiName.Data()); + ti[j]->Draw(drawCommand.Data(), ciBeE[i] && sRatio[j], "same"); + TH1F *hieT[i][j] = (TH1F*)gPad->FindObject(hiName.Data()); + Float_t rightmax = kRangeProportionIn*hieT[i][j]->GetMaximum(); + Float_t scale = canEpsilonT[i]->GetPad(j+1)->GetUymax()/rightmax; + hieT[i][j]->SetLineColor(kRed); + hieT[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(); + + canEpsilonT[i]->Update(); + + if (kVerbose) { + Info("sfAngInt_epsilonT.cxx", "cut%d; case%d: %3.1f (exp)/ %3.1f (sim) = %3.3f", + i, j, heeT[i][j]->Integral(0,heeT[i][j]->GetNbinsX()), + hseT[i][j]->Integral(0,hseT[i][j]->GetNbinsX()), + heeT[i][j]->Integral(0,heeT[i][j]->GetNbinsX())/hseT[i][j]->Integral(0,hseT[i][j]->GetNbinsX()) ); + } + + }//for j + if (kVerbose) cout << endl; + + if (savePictures) { + canvasName.Form("%sfig%depsilonT:%s%s", ppath.Data(), i, configuration.Data(), pictFormat.Data()); + cout << canvasName.Data() << endl; + canEpsilonT[i]->SaveAs(canvasName.Data()); + canEpsilonT[i]->cd(); + canEpsilonT[i]->Close(); + }//if save pictures + }//if + }//for i + + sw.Print(); + sw.Continue(); +} diff --git a/macros/corr_templates/sfAngInt_epsilonY.cxx b/macros/corr_templates/sfAngInt_epsilonY.cxx new file mode 100644 index 0000000000000000000000000000000000000000..9489d78dca21300f9fbe7736871670d2e8f70938 --- /dev/null +++ b/macros/corr_templates/sfAngInt_epsilonY.cxx @@ -0,0 +1,90 @@ +{ + + TCanvas *canEpsilonY[nointervals]; + for (Int_t i = 0; iSetTitle(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"); + TH1F *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 + + sw.Print(); + sw.Continue(); +} diff --git a/macros/corr_templates/sfAngInt_opensimtree.cxx b/macros/corr_templates/sfAngInt_opensimtree.cxx new file mode 100644 index 0000000000000000000000000000000000000000..bbebfcde3cc58deb22c3498f86060061f7f20abf --- /dev/null +++ b/macros/corr_templates/sfAngInt_opensimtree.cxx @@ -0,0 +1,49 @@ +{ + //script to be loaded in statesRatioFitting* scripts + // + + + //experiment + TChain *che = BeWork::OpenChain("../../../be/rootdata/correlations/Be.", + lowfile, upfile, "beonly"); //original file + Info("statesRatioFitting.cxx", "%d events in chain \"%s\" containing experimental data", + che->GetEntries(), che->GetName()); + + + TChain *chsAl0 = BeWork::OpenChain(chainAl0name.Data(), + lowSimFile[0], upSimFile[0], "simbe", 4, "sbeam"); + Info("statesRatioFitting.cxx", "%d events in chain \"%s\" containing simulated data", chsAl0->GetEntries(), chsAl0->GetName()); + TTree *tiAl0 = BeWork::OpenTree(inputTreeAl0name.Data(), "sbeam", 2); +// tiAl0->SetLineWidth(2); + + TChain *chsNoAl0 = BeWork::OpenChain(chainNoAl0name.Data(), + lowSimFile[1], upSimFile[1], "simbe", 4, "sbeam"); + Info("statesRatioFitting.cxx", "%d events in chain \"%s\" containing simulated data", chsNoAl0->GetEntries(), chsNoAl0->GetName()); + TTree *tiNoAl0 = BeWork::OpenTree(inputTreeNoAl0name.Data(), "sbeam", 2); +// tiNoAl0->SetLineWidth(2); +// + TChain *chsAl180 = BeWork::OpenChain(chainAl180name.Data(), + lowSimFile[2], upSimFile[2], "simbe", 4, "sbeam"); + Info("statesRatioFitting.cxx", "%d events in chain \"%s\" containing simulated data", chsAl180->GetEntries(), chsAl180->GetName()); + TTree *tiAl180 = BeWork::OpenTree(inputTreeAl180name.Data(), "sbeam", 2); +// tiAl180->SetLineWidth(2); + + TChain *chsNoAl180 = BeWork::OpenChain(chainNoAl180name.Data(), + lowSimFile[3], upSimFile[3], "simbe", 4, "sbeam"); + Info("statesRatioFitting.cxx", "%d events in chain \"%s\" containing simulated data", chsNoAl180->GetEntries(), chsNoAl180->GetName()); + TTree *tiNoAl180 = BeWork::OpenTree(inputTreeNoAl180name.Data(), "sbeam", 2); +// tiNoAl180->SetLineWidth(2); + + TChain *chsAl90 = BeWork::OpenChain(chainAl90name.Data(), + lowSimFile[4], upSimFile[4], "simbe", 4, "sbeam"); + Info("statesRatioFitting.cxx", "%d events in chain \"%s\" containing simulated data", chsAl90->GetEntries(), chsAl90->GetName()); + TTree *tiAl90 = BeWork::OpenTree(inputTreeAl90name.Data(), "sbeam", 2); +// tiAl90->SetLineWidth(2); + + TChain *chsNoAl90 = BeWork::OpenChain(chainNoAl90name.Data(), + lowSimFile[5], upSimFile[5], "simbe", 4, "sbeam"); + Info("statesRatioFitting.cxx", "%d events in chain \"%s\" containing simulated data", chsNoAl90->GetEntries(), chsNoAl90->GetName()); + TTree *tiNoAl90 = BeWork::OpenTree(inputTreeNoAl90name.Data(), "sbeam", 2); +// tiNoAl90->SetLineWidth(2); + +} diff --git a/macros/corr_templates/sfAngInt_thetaAT.cxx b/macros/corr_templates/sfAngInt_thetaAT.cxx new file mode 100644 index 0000000000000000000000000000000000000000..4d154dbe3be7c9d3f5034919701cfa0464a08514 --- /dev/null +++ b/macros/corr_templates/sfAngInt_thetaAT.cxx @@ -0,0 +1,98 @@ +{ + + TCanvas *cThetaAT[nointervals]; + for (Int_t i = 0; iSetTitle(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"); + TH1F *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 + + sw.Print(); + sw.Continue(); +} diff --git a/macros/corr_templates/sfAngInt_thetaP1T.cxx b/macros/corr_templates/sfAngInt_thetaP1T.cxx new file mode 100644 index 0000000000000000000000000000000000000000..d0874c8fe48828eff9ec49927ee065390102d90d --- /dev/null +++ b/macros/corr_templates/sfAngInt_thetaP1T.cxx @@ -0,0 +1,69 @@ +{ + + TCanvas *cThetaP1T[nointervals]; + for (Int_t i = 0; iSetTitle(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"); + TH1F *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 + + sw.Print(); + sw.Continue(); +}