3 void merge_chi2_npp_k(
const Char_t* inputFileList =
"file_chi2.list")
5 ifstream fin(inputFileList);
7 Error(
"merge_chi2",
"can't open %s", inputFileList);
56 const Int_t nppbin = 30 ;
57 const Double_t nppmin = 0.7 ;
58 const Double_t nppmax = 1.0 ;
59 const Int_t kbin = 30 ;
60 const Double_t kmin = 0.50 ;
61 const Double_t kmax = 3.50 ;
63 TH2* hChi2 =
new TH2D(
"hchi2Merge",
"", nppbin, nppmin, nppmax, kbin, kmin, kmax);
64 hChi2->SetXTitle(
"n_{pp}");
65 hChi2->SetYTitle(
"k");
68 Double_t nevents = 0 ;
71 TFile* file = TFile::Open(name);
72 if(!file || !file->IsOpen()){
73 Error(
"merge_chi2",
"can't open %s", name.Data());
76 cout <<
"OPEN " << file->GetName() << endl;
78 TH3* hchi2 = (TH3D*) file->Get(
"hChi2");
79 nevents += hchi2->GetEntries() ;
80 for(Int_t x=0; x<hchi2->GetNbinsX(); x++){
81 const Int_t y = ifile ;
82 hChi2->SetBinContent(x+1, y+1, hchi2->GetBinContent(x+1, 1, 1));
88 hChi2->SetEntries(nevents);
90 TFile* output = TFile::Open(
"chi2_merge.root",
"recreate");
97 void merge_chi2_npp_x(
const Char_t* inputFileList =
"file_chi2.list")
99 ifstream fin(inputFileList);
101 Error(
"merge_chi2",
"can't open %s", inputFileList);
105 const Int_t nppbin = 50 ;
108 const Double_t nppmin = 1.3 ;
109 const Double_t nppmax = 1.8 ;
113 const Int_t xbin = 70 ;
114 const Double_t xmin = 0.08 ;
115 const Double_t xmax = 0.15 ;
117 TH2* hChi2 =
new TH2D(
"hchi2Merge",
"", nppbin, nppmin, nppmax, xbin, xmin, xmax);
118 hChi2->SetXTitle(
"n_{pp}");
119 hChi2->SetYTitle(
"x");
122 Double_t nevents = 0 ;
124 while( fin >> name ){
125 TFile* file = TFile::Open(name);
126 if(!file || !file->IsOpen()){
127 Error(
"merge_chi2",
"can't open %s", name.Data());
130 cout <<
"OPEN " << file->GetName() <<
" nfile=[" << ifile <<
"]" << endl;
132 TH3* hchi2 = (TH3D*) file->Get(
"hChi2");
133 nevents += hchi2->GetEntries() ;
134 for(Int_t x=0; x<hchi2->GetNbinsX(); x++){
135 const Int_t z = ifile ;
136 hChi2->SetBinContent(x+1, z+1, hchi2->GetBinContent(x+1, 1, 1));
141 hChi2->SetEntries(nevents);
143 TFile* output = TFile::Open(
"chi2_merge_x_vs_npp.root",
"recreate");
149 void merge_chi2_eff(
const Char_t* inputFileList =
"file_chi2.list")
151 ifstream fin(inputFileList);
153 Error(
"merge_chi2",
"can't open %s", inputFileList);
161 const Int_t nppbin = 50 ;
162 const Double_t nppmin = 0.70 ;
163 const Double_t nppmax = 1.20 ;
166 const Int_t nppbin = 20 ;
167 const Double_t nppmin = 1.00 ;
168 const Double_t nppmax = 1.20 ;
183 const Int_t effbin = 30 ;
184 const Double_t effmin = 0.05 ;
185 const Double_t effmax = 0.35 ;
189 TH2* hChi2 =
new TH2D(
"hchi2Merge",
"", nppbin, nppmin, nppmax, effbin, effmin, effmax);
190 hChi2->SetXTitle(
"n_{pp}");
191 hChi2->SetYTitle(
"#varepsilon");
194 Double_t nevents = 0 ;
196 while( fin >> name ){
197 TFile* file = TFile::Open(name);
198 if(!file || !file->IsOpen()){
199 Error(
"merge_chi2",
"can't open %s", name.Data());
202 cout <<
"OPEN " << file->GetName() << endl;
204 TH3* hchi2 = (TH3D*) file->Get(
"hChi2");
206 TH1* hchi2npp = (TH1D*) hchi2->Project3D(
"x");
207 nevents += hchi2->GetEntries() ;
209 for(Int_t x=0; x<hchi2npp->GetNbinsX(); x++){
210 const Int_t z = ifile ;
212 hChi2->SetBinContent(x+1, z+1, hchi2npp->GetBinContent(x+1));
218 hChi2->SetEntries(nevents);
220 TFile* output = TFile::Open(
"chi2_merge.root",
"recreate");