Fix in AliTrackerBase::PropagateTo... routines: length integral was not correctly...
[u/mrichter/AliRoot.git] / PWGLF / SPECTRA / ChargedHadrons / dNdPt / macros / plots / readPythia109.C
1 Int_t readPythia109() 
2 {
3 // read PYTHIA 109 INEL data from file
4
5 cout << endl;
6 cout << "================================" << endl;
7 cout << endl;
8 cout << "read PHYTIA 109 INEL data from file" <<endl;
9 cout << "Number of bins: " << binsPythia109 <<endl;
10 cout << "Filename:       " << filenamePythia109 <<endl;
11 cout << endl;
12 cout << "================================" << endl;
13 cout << endl;
14
15 TFile* filePythia109 = new TFile(filenamePythia109,"OPEN");
16 nEventsPythia109 = ((TH1F*)filePythia109->Get("eventsINEL"))->GetBinContent(1);
17
18 TH1F* histPythia109 = (TH1F*)filePythia109->Get("ptINEL");
19
20 int bins = 0;
21 for (int i=0; i < histPythia109->GetNbinsX(); i++) {
22     if (histPythia109->GetBinContent(i) > 0 ) {
23         centerPtPythia109[bins]    = histPythia109->GetBinCenter(i);
24         ptPythia109[bins]          = centerPtPythia109[bins];
25         widthPtPythia109[bins]     = histPythia109->GetBinWidth(i);        
26         errPtPythia109[bins]       = widthPtPythia109[bins] / 2.0;
27         lowPtPythia109[bins]       = centerPtPythia109[bins] - errPtPythia109[bins];
28         highPtPythia109[bins]      = centerPtPythia109[bins] + errPtPythia109[bins];
29         
30         inelPythia109[bins]        = histPythia109->GetBinContent(i) / (nEventsPythia109 * etaRange * 2 * M_PI * ptPythia109[bins]);
31         errInelPythia109[bins]     = histPythia109->GetBinError(i) / (nEventsPythia109 * etaRange * 2 * M_PI * ptPythia109[bins]);
32         lowErrInelPythia109[bins]  = inelPythia109[bins] - errInelPythia109[bins];
33         highErrInelPythia109[bins] = inelPythia109[bins] + errInelPythia109[bins];
34         relErrInelPythia109[bins]  = errInelPythia109[bins] / inelPythia109[bins];
35         
36         
37         
38         centerPt2PiPtPythia109[bins]    = histPythia109->GetBinCenter(i);
39         pt2PiPtPythia109[bins]          = centerPt2PiPtPythia109[bins];
40         widthPt2PiPtPythia109[bins]     = histPythia109->GetBinWidth(i);        
41         errPt2PiPtPythia109[bins]       = widthPt2PiPtPythia109[bins] / 2.0;
42         lowPt2PiPtPythia109[bins]       = centerPt2PiPtPythia109[bins] - errPt2PiPtPythia109[bins];
43         highPt2PiPtPythia109[bins]      = centerPt2PiPtPythia109[bins] + errPt2PiPtPythia109[bins];        
44         inel2PiPtPythia109[bins]        = histPythia109->GetBinContent(i) / (nEventsPythia109 * etaRange);
45         errInel2PiPtPythia109[bins]     = histPythia109->GetBinError(i) / (nEventsPythia109 * etaRange);
46         lowErrInel2PiPtPythia109[bins]  = inel2PiPtPythia109[bins] - errInel2PiPtPythia109[bins];
47         highErrInel2PiPtPythia109[bins] = inel2PiPtPythia109[bins] + errInel2PiPtPythia109[bins];
48         relErrInel2PiPtPythia109[bins]  = errInel2PiPtPythia109[bins] / inel2PiPtPythia109[bins];         
49         
50         
51         
52         cout << "ptPythia109[" << bins << "]              = " << ptPythia109[bins] <<endl;
53         cout << "   centerPtPythia109[" << bins << "]     = " << centerPtPythia109[bins] <<endl;
54         cout << "   widthPtPythia109[" << bins << "]      = " << widthPtPythia109[bins] <<endl;
55         cout << "   errPtPythia109[" << bins << "]        = " << errPtPythia109[bins] <<endl;
56         cout << "   lowPtPythia109[" << bins << "]        = " << lowPtPythia109[bins] <<endl;
57         cout << "   highPtPythia109[" << bins << "]       = " << highPtPythia109[bins] <<endl;
58         cout << "inelPythia109[" << bins << "]            = " << inelPythia109[bins] <<endl;        
59         cout << "errInelPythia109[" << bins << "]         = " << errInelPythia109[bins] <<endl;
60         cout << "   lowErrInelPythia109[" << bins << "]   = " << lowErrInelPythia109[bins] <<endl;
61         cout << "   highErrInelPythia109[" << bins << "]  = " << highErrInelPythia109[bins] <<endl;
62         cout << "   relErrInelPythia109[" << bins << "]   = " << relErrInelPythia109[bins] <<endl;
63         cout << endl;
64         bins++;
65     }
66 }
67
68 filePythia109->Close();
69
70 cout << "================================" << endl;
71 cout << endl;
72 cout << "Finished reading PYTHIA 109 INEL data" <<endl;
73 cout << "Number of bins read: " << bins <<endl;
74 cout << endl;
75 cout << "================================" << endl;
76 cout << endl;
77
78 return bins;
79 }