3 // read PHOJET INEL data from file
6 cout << "================================" << endl;
8 cout << "read PHOJET INEL data from file" <<endl;
9 cout << "Number of bins: " << binsPhojet <<endl;
10 cout << "Filename: " << filenamePhojet <<endl;
12 cout << "================================" << endl;
15 TFile* filePhojet = new TFile(filenamePhojet,"OPEN");
16 Double_t nEventsPhojet = ((TH1F*)filePhojet->Get("eventsINEL"))->GetBinContent(1);
18 TH1F* histPhojet = (TH1F*)filePhojet->Get("ptINEL");
21 for (int i=0; i < histPhojet->GetNbinsX(); i++) {
22 if (histPhojet->GetBinContent(i) > 0 ) {
23 centerPtPhojet[bins] = histPhojet->GetBinCenter(i);
24 ptPhojet[bins] = centerPtPhojet[bins];
25 widthPtPhojet[bins] = histPhojet->GetBinWidth(i);
26 errPtPhojet[bins] = widthPtPhojet[bins] / 2.0;
27 lowPtPhojet[bins] = centerPtPhojet[bins] - errPtPhojet[bins];
28 highPtPhojet[bins] = centerPtPhojet[bins] + errPtPhojet[bins];
30 inelPhojet[bins] = histPhojet->GetBinContent(i) / (nEventsPhojet * etaRange * 2 * M_PI * ptPhojet[bins]);
31 errInelPhojet[bins] = histPhojet->GetBinError(i) / (nEventsPhojet * etaRange * 2 * M_PI * ptPhojet[bins]);
32 lowErrInelPhojet[bins] = inelPhojet[bins] - errInelPhojet[bins];
33 highErrInelPhojet[bins] = inelPhojet[bins] + errInelPhojet[bins];
34 relErrInelPhojet[bins] = errInelPhojet[bins] / inelPhojet[bins];
36 centerPt2PiPtPhojet[bins] = histPhojet->GetBinCenter(i);
37 pt2PiPtPhojet[bins] = centerPt2PiPtPhojet[bins];
38 widthPt2PiPtPhojet[bins] = histPhojet->GetBinWidth(i);
39 errPt2PiPtPhojet[bins] = widthPt2PiPtPhojet[bins] / 2.0;
40 lowPt2PiPtPhojet[bins] = centerPt2PiPtPhojet[bins] - errPt2PiPtPhojet[bins];
41 highPt2PiPtPhojet[bins] = centerPt2PiPtPhojet[bins] + errPt2PiPtPhojet[bins];
42 inel2PiPtPhojet[bins] = histPhojet->GetBinContent(i) / (nEventsPhojet * etaRange);
43 errInel2PiPtPhojet[bins] = histPhojet->GetBinError(i) / (nEventsPhojet * etaRange);
44 lowErrInel2PiPtPhojet[bins] = inel2PiPtPhojet[bins] - errInel2PiPtPhojet[bins];
45 highErrInel2PiPtPhojet[bins] = inel2PiPtPhojet[bins] + errInel2PiPtPhojet[bins];
46 relErrInel2PiPtPhojet[bins] = errInel2PiPtPhojet[bins] / inel2PiPtPhojet[bins];
48 cout << "ptPhojet[" << bins << "] = " << ptPhojet[bins] <<endl;
49 cout << " centerPtPhojet[" << bins << "] = " << centerPtPhojet[bins] <<endl;
50 cout << " widthPtPhojet[" << bins << "] = " << widthPtPhojet[bins] <<endl;
51 cout << " errPtPhojet[" << bins << "] = " << errPtPhojet[bins] <<endl;
52 cout << " lowPtPhojet[" << bins << "] = " << lowPtPhojet[bins] <<endl;
53 cout << " highPtPhojet[" << bins << "] = " << highPtPhojet[bins] <<endl;
54 cout << "inelPhojet[" << bins << "] = " << inelPhojet[bins] <<endl;
55 cout << "errInelPhojet[" << bins << "] = " << errInelPhojet[bins] <<endl;
56 cout << " lowErrInelPhojet[" << bins << "] = " << lowErrInelPhojet[bins] <<endl;
57 cout << " highErrInelPhojet[" << bins << "] = " << highErrInelPhojet[bins] <<endl;
58 cout << " relErrInelPhojet[" << bins << "] = " << relErrInelPhojet[bins] <<endl;
66 cout << "================================" << endl;
68 cout << "Finished reading PHOJET INEL data" <<endl;
69 cout << "Number of bins read: " << bins <<endl;
71 cout << "================================" << endl;