3 // read UA1 data from file
7 cout << "================================" << endl;
9 cout << "read UA1 YIELD data from file" <<endl;
10 cout << "Number of bins: " << binsUa1 <<endl;
11 cout << "Filename: " << filenameUa1 <<endl;
13 cout << "================================" << endl;
16 ifstream fileCrossUa1;
17 fileCrossUa1.open(filenameUa1);
20 while(!fileCrossUa1.eof()) {
21 if(i == binsUa1) break;
22 // textfile content: pt:cross_yield:(stat + syst error added linerarly)
23 fileCrossUa1 >> centerPtUa1[i] >> crossUa1[i] >> errCrossUa1[i];
25 ptUa1[i] = centerPtUa1[i];
27 // the width of the pt bins, currently hardwired....
29 if (centerPtUa1[i] > 4) widthPtUa1[i] = 0.2;
30 if (centerPtUa1[i] > 6) widthPtUa1[i] = 1.0;
32 errPtUa1[i] = widthPtUa1[i] / 2.0;
33 lowPtUa1[i] = centerPtUa1[i] - errPtUa1[i];
34 highPtUa1[i] = centerPtUa1[i] + errPtUa1[i];
37 lowStatCrossUa1[i] = crossUa1[i] - statCrossUa1[i];
38 highStatCrossUa1[i] = crossUa1[i] + statCrossUa1[i];
39 relStatCrossUa1[i] = statCrossUa1[i] / crossUa1[i];
40 lowSystCrossUa1[i] = crossUa1[i] - systCrossUa1[i];
41 highSystCrossUa1[i] = crossUa1[i] + systCrossUa1[i];
42 relSystCrossUa1[i] = systCrossUa1[i] / crossUa1[i];
44 lowErrCrossUa1[i] = crossUa1[i] - errCrossUa1[i];
45 highErrCrossUa1[i] = crossUa1[i] + errCrossUa1[i];
46 relErrCrossUa1[i] = errCrossUa1[i] / crossUa1[i];
47 err2CrossUa1[i] = errCrossUa1[i];
48 lowErr2CrossUa1[i] = lowErrCrossUa1[i];
49 highErr2CrossUa1[i] = highErrCrossUa1[i];
50 relErr2CrossUa1[i] = relErrCrossUa1[i];
52 yieldUa1[i] = crossUa1[i] * (avgToHadr / sigmaInelUa1);
63 errYieldUa1[i] = errCrossUa1[i] * (avgToHadr / sigmaInelUa1);
64 lowErrYieldUa1[i] = yieldUa1[i] - errYieldUa1[i];
65 highErrYieldUa1[i] = yieldUa1[i] + errYieldUa1[i];
66 relErrYieldUa1[i] = errYieldUa1[i] / yieldUa1[i];
67 err2YieldUa1[i] = errYieldUa1[i];
68 lowErr2YieldUa1[i] = lowErrYieldUa1[i];
69 highErr2YieldUa1[i] = highErrYieldUa1[i];
70 relErr2YieldUa1[i] = relErrYieldUa1[i];
72 cout << "ptUa1[" << i << "] = " << ptUa1[i] <<endl;
73 cout << " centerPtUa1[" << i << "] = " << centerPtUa1[i] <<endl;
74 cout << " widthPtUa1[" << i << "] = " << widthPtUa1[i] <<endl;
75 cout << " errPtUa1[" << i << "] = " << errPtUa1[i] <<endl;
76 cout << " lowPtUa1[" << i << "] = " << lowPtUa1[i] <<endl;
77 cout << " highPtUa1[" << i << "] = " << highPtUa1[i] <<endl;
78 cout << "crossUa1[" << i << "] = " << crossUa1[i] <<endl;
80 cout << " statCrossUa1[" << i << "] = " << statCrossUa1[i] <<endl;
81 cout << " lowStatCrossUa1[" << i << "] = " << lowStatCrossUa1[i] <<endl;
82 cout << " highStatCrossUa1[" << i << "] = " << highStatCrossUa1[i] <<endl;
83 cout << " relStatCrossUa1[" << i << "] = " << relStatCrossUa1[i] <<endl;
84 cout << " systCrossUa1[" << i << "] = " << systCrossUa1[i] <<endl;
85 cout << " lowSystCrossUa1[" << i << "] = " << lowSystCrossUa1[i] <<endl;
86 cout << " highSystCrossUa1[" << i << "] = " << highSystCrossUa1[i] <<endl;
87 cout << " relSystCrossUa1[" << i << "] = " << relSystCrossUa1[i] <<endl;
89 cout << "errCrossUa1[" << i << "] = " << errCrossUa1[i] <<endl;
90 cout << " lowErrCrossUa1[" << i << "] = " << lowErrCrossUa1[i] <<endl;
91 cout << " highErrCrossUa1[" << i << "] = " << highErrCrossUa1[i] <<endl;
92 cout << " relErrCrossUa1[" << i << "] = " << relErrCrossUa1[i] <<endl;
93 cout << "err2CrossUa1[" << i << "] = " << err2CrossUa1[i] <<endl;
94 cout << " lowErr2CrossUa1[" << i << "] = " << lowErr2CrossUa1[i] <<endl;
95 cout << " highErr2CrossUa1[" << i << "] = " << highErr2CrossUa1[i] <<endl;
96 cout << " relErr2CrossUa1[" << i << "] = " << relErr2CrossUa1[i] <<endl;
98 cout << "yieldUa1[" << i << "] = " << yieldUa1[i] <<endl;
100 cout << " statYieldUa1[" << i << "] = " << statYieldUa1[i] <<endl;
101 cout << " lowStatYieldUa1[" << i << "] = " << lowStatYieldUa1[i] <<endl;
102 cout << " highStatYieldUa1[" << i << "] = " << highStatYieldUa1[i] <<endl;
103 cout << " relStatYieldUa1[" << i << "] = " << relStatYieldUa1[i] <<endl;
104 cout << " systYieldUa1[" << i << "] = " << systYieldUa1[i] <<endl;
105 cout << " lowSystYieldUa1[" << i << "] = " << lowSystYieldUa1[i] <<endl;
106 cout << " highSystYieldUa1[" << i << "] = " << highSystYieldUa1[i] <<endl;
107 cout << " relSystYieldUa1[" << i << "] = " << relSystYieldUa1[i] <<endl;
109 cout << "errYieldUa1[" << i << "] = " << errYieldUa1[i] <<endl;
110 cout << " lowErrYieldUa1[" << i << "] = " << lowErrYieldUa1[i] <<endl;
111 cout << " highErrYieldUa1[" << i << "] = " << highErrYieldUa1[i] <<endl;
112 cout << " relErrYieldUa1[" << i << "] = " << relErrYieldUa1[i] <<endl;
113 cout << "err2YieldUa1[" << i << "] = " << err2YieldUa1[i] <<endl;
114 cout << " lowErr2YieldUa1[" << i << "] = " << lowErr2YieldUa1[i] <<endl;
115 cout << " highErr2YieldUa1[" << i << "] = " << highErr2YieldUa1[i] <<endl;
116 cout << " relErr2YieldUa1[" << i << "] = " << relErr2YieldUa1[i] <<endl;
120 } // while(!fileCrossUa1.eof())
121 fileCrossUa1.close();
122 //if (fileCrossUa1) { delete fileCrossUa1; }
125 cout << "================================" << endl;
127 cout << "Finished reading UA1 YIELD data" <<endl;
128 cout << "Number of bins read: " << i <<endl;
130 cout << "================================" << endl;