]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGLF/SPECTRA/ChargedHadrons/dNdPt/macros/plots/readCms.C
Merge branch 'feature-movesplit'
[u/mrichter/AliRoot.git] / PWGLF / SPECTRA / ChargedHadrons / dNdPt / macros / plots / readCms.C
CommitLineData
2803ac99 1Int_t readCms()
2{
3// read CMS NSD data from file
4//
5
6cout << endl;
7cout << "================================" << endl;
8cout << endl;
9cout << "read CMS NSD data from file" <<endl;
10cout << "Number of bins: " << binsCms <<endl;
11cout << "Filename: " << filenameCms <<endl;
12cout << endl;
13cout << "================================" << endl;
14cout << endl;
15
16ifstream fileNsdCms;
17fileNsdCms.open(filenameCms);
18
19Int_t i = 0;
20while(!fileNsdCms.eof()) {
21 if(i == binsCms) break;
22 // textfile content: pt:NSD_yield:(stat + syst error added linerarly)
23 fileNsdCms >> centerPtCms[i] >> nsdCms[i] >> errNsdCms[i];
24
25 ptCms[i] = centerPtCms[i];
26
27 // the width of the pt bins, currently hardwired....
28 widthPtCms[i] = 0.1;
29 if (centerPtCms[i] > 1) widthPtCms[i] = 0.2;
30
31 errPtCms[i] = widthPtCms[i] / 2.0;
32 lowPtCms[i] = centerPtCms[i] - errPtCms[i];
33 highPtCms[i] = centerPtCms[i] + errPtCms[i];
34
35 /*
36 lowStatNsdCms[i] = nsdCms[i] - statNsdCms[i];
37 highStatNsdCms[i] = nsdCms[i] + statNsdCms[i];
38 relStatNsdCms[i] = statNsdCms[i] / nsdCms[i];
39 lowSystNsdCms[i] = nsdCms[i] - systNsdCms[i];
40 highSystNsdCms[i] = nsdCms[i] + systNsdCms[i];
41 relSystNsdCms[i] = systNsdCms[i] / nsdCms[i];
42 */
43 lowErrNsdCms[i] = nsdCms[i] - errNsdCms[i];
44 highErrNsdCms[i] = nsdCms[i] + errNsdCms[i];
45 relErrNsdCms[i] = errNsdCms[i] / nsdCms[i];
46 err2NsdCms[i] = errNsdCms[i];
47 lowErr2NsdCms[i] = lowErrNsdCms[i];
48 highErr2NsdCms[i] = highErrNsdCms[i];
49 relErr2NsdCms[i] = relErrNsdCms[i];
50
51 cout << "ptCms[" << i << "] = " << ptCms[i] <<endl;
52 cout << " centerPtCms[" << i << "] = " << centerPtCms[i] <<endl;
53 cout << " widthPtCms[" << i << "] = " << widthPtCms[i] <<endl;
54 cout << " errPtCms[" << i << "] = " << errPtCms[i] <<endl;
55 cout << " lowPtCms[" << i << "] = " << lowPtCms[i] <<endl;
56 cout << " highPtCms[" << i << "] = " << highPtCms[i] <<endl;
57 cout << "nsdCms[" << i << "] = " << nsdCms[i] <<endl;
58 /*
59 cout << " statNsdCms[" << i << "] = " << statNsdCms[i] <<endl;
60 cout << " lowStatNsdCms[" << i << "] = " << lowStatNsdCms[i] <<endl;
61 cout << " highStatNsdCms[" << i << "] = " << highStatNsdCms[i] <<endl;
62 cout << " relStatNsdCms[" << i << "] = " << relStatNsdCms[i] <<endl;
63 cout << " systNsdCms[" << i << "] = " << systNsdCms[i] <<endl;
64 cout << " lowSystNsdCms[" << i << "] = " << lowSystNsdCms[i] <<endl;
65 cout << " highSystNsdCms[" << i << "] = " << highSystNsdCms[i] <<endl;
66 cout << " relSystNsdCms[" << i << "] = " << relSystNsdCms[i] <<endl;
67 */
68 cout << "errNsdCms[" << i << "] = " << errNsdCms[i] <<endl;
69 cout << " lowErrNsdCms[" << i << "] = " << lowErrNsdCms[i] <<endl;
70 cout << " highErrNsdCms[" << i << "] = " << highErrNsdCms[i] <<endl;
71 cout << " relErrNsdCms[" << i << "] = " << relErrNsdCms[i] <<endl;
72 cout << "err2NsdCms[" << i << "] = " << err2NsdCms[i] <<endl;
73 cout << " lowErr2NsdCms[" << i << "] = " << lowErr2NsdCms[i] <<endl;
74 cout << " highErr2NsdCms[" << i << "] = " << highErr2NsdCms[i] <<endl;
75 cout << " relErr2NsdCms[" << i << "] = " << relErr2NsdCms[i] <<endl;
76 cout << endl;
77
78 i++;
79} // while(!fileNsdCms.eof())
80fileNsdCms.close();
81//if (fileNsdCms) { delete fileNsdCms; }
82//fileNsdCms=0;
83
84cout << "================================" << endl;
85cout << endl;
86cout << "Finished reading CMS NSD data" <<endl;
87cout << "Number of bins read: " << i <<endl;
88cout << endl;
89cout << "================================" << endl;
90cout << endl;
91
92return i;
93}