]>
Commit | Line | Data |
---|---|---|
9d84731e | 1 | #if !defined (__CINT__) || (defined(__MAKECINT__)) |
2 | #include <iostream> | |
3 | #include "TClonesArray.h" | |
4 | #include "AliParticleYield.h" | |
5 | ||
6 | #endif | |
7 | TClonesArray * arr =0; | |
8 | ||
ad431d97 | 9 | void InterpolateRatios(Int_t pdg1, Int_t pdg2, TString centr1="V0M0005", TString centr2="V0M0510", TString centrfinal="V0M0010") ; |
9d84731e | 10 | void Interpolate0010(Int_t pdg) ; |
0bf9d3e4 | 11 | void Interpolate2040(Int_t pdg) ; |
ad431d97 | 12 | void Interpolate6080(Int_t pdg) ; |
9d84731e | 13 | |
ad431d97 | 14 | void ExtrapolateWithConstantRatioToPions(Int_t pdg, TString centrOrigin, TString centrDest); |
15 | Int_t collSystem = -1; | |
16 | Float_t energy = -1; | |
9d84731e | 17 | |
18 | void InterpolateRatiosAndYields() { | |
19 | #if !(!defined (__CINT__) || (defined(__MAKECINT__))) | |
20 | LoadLibs(); | |
21 | #endif | |
ad431d97 | 22 | collSystem = 2; energy =2760; |
9d84731e | 23 | // *************** pi, K, pr ***************** |
ad431d97 | 24 | arr= AliParticleYield::ReadFromASCIIFile("PbPb_2760_PiKaPr.txt"); |
9d84731e | 25 | // Interpolate0010(211); |
26 | // Interpolate0010(-211); | |
27 | // Interpolate0010(321); | |
28 | // Interpolate0010(-321); | |
29 | // Interpolate0010(2212); | |
30 | // Interpolate0010(-2212); | |
4c7bd9d1 | 31 | // InterpolateRatios(2212,211, "V0M0005", "V0M0510", "V0M0010"); |
32 | // InterpolateRatios(321,211 , "V0M0005", "V0M0510", "V0M0010"); | |
ad431d97 | 33 | // Interpolate6080(211); |
34 | // Interpolate6080(-211); | |
35 | // Interpolate6080(2212); | |
36 | // Interpolate6080(-2212); | |
4c7bd9d1 | 37 | // Interpolate6080(321); |
38 | // Interpolate6080(-321); | |
ad431d97 | 39 | // InterpolateRatios(2212,211, "V0M6070", "V0M7080", "V0M6080"); |
4c7bd9d1 | 40 | // InterpolateRatios(321,211, "V0M6070", "V0M7080", "V0M6080"); |
ad431d97 | 41 | |
0bf9d3e4 | 42 | Interpolate2040(211); |
43 | Interpolate2040(-211); | |
44 | Interpolate2040(2212); | |
45 | Interpolate2040(-2212); | |
46 | Interpolate2040(321); | |
47 | Interpolate2040(-321); | |
48 | ||
9d84731e | 49 | // *************** Lambda and K0 ***************** |
50 | // arr= AliParticleYield::ReadFromASCIIFile("PbPb_2760_LambdaK0.txt"); | |
51 | // Interpolate0010(3122); | |
52 | // Interpolate0010(310); | |
53 | // *************** Helium 3 ***************** | |
0bf9d3e4 | 54 | // arr = AliParticleYield::ReadFromASCIIFile("PbPb_2760_DeuHelium3.txt"); |
55 | // arr->AbsorbObjects(AliParticleYield::ReadFromASCIIFile("./PbPb_2760_AveragedNumbers.txt")); | |
56 | // ExtrapolateWithConstantRatioToPions(1000020030, "V0M0020", "V0M0010"); | |
9d84731e | 57 | // *************** Kstar ***************** |
ad431d97 | 58 | // arr = AliParticleYield::ReadFromASCIIFile("PbPb_2760_Kstar892.txt"); |
59 | // arr->AbsorbObjects(AliParticleYield::ReadFromASCIIFile("./PbPb_2760_AveragedNumbers.txt")); | |
60 | // ExtrapolateWithConstantRatioToPions(313, "V0M0020", "V0M0010"); | |
61 | ||
62 | // *************** pPb, deuteron ********************* | |
63 | // collSystem = 1; energy = 5020; | |
64 | // 1. Average pions | |
65 | //arr = AliParticleYield::ReadFromASCIIFile("pPb_5020_PiKaPrLamndaK0.txt"); | |
66 | // Interpolate0010(211); | |
67 | // Interpolate0010(-211); | |
68 | // 2. Extrapolate the deuteron | |
69 | // arr = AliParticleYield::ReadFromASCIIFile("pPb_5020_deuteron.txt"); | |
70 | // arr->AbsorbObjects(AliParticleYield::ReadFromASCIIFile("pPb_5020_PiKaPrLamndaK0.txt")); | |
71 | // ExtrapolateWithConstantRatioToPions(1000010020, "V0A0010", "V0A0005"); | |
72 | // ExtrapolateWithConstantRatioToPions(-1000010020, "V0A0010", "V0A0005"); | |
4c7bd9d1 | 73 | // ExtrapolateWithConstantRatioToPions(1000010020, "V0A6000", "V0A6080"); |
74 | // ExtrapolateWithConstantRatioToPions(-1000010020, "V0A6000", "V0A6080"); | |
9d84731e | 75 | |
76 | ||
77 | } | |
78 | ||
79 | void DUMP(){ | |
80 | AliParticleYield * p0 = AliParticleYield::FindParticle(arr, 211, 2, 2760., "V0M0005"); | |
81 | // p0 = AliParticleYield::Add(p0, AliParticleYield::FindParticle(arr, -211, 2, 2760., "V0M0005")); | |
82 | AliParticleYield * p2 = AliParticleYield::FindParticle(arr, 2212, 2, 2760., "V0M0005"); | |
83 | // p2 = AliParticleYield::Add(p2,AliParticleYield::FindParticle(arr, -2212, 2, 2760., "V0M0005")); | |
84 | AliParticleYield *pratio = AliParticleYield::Divide(p2,p0); | |
85 | pratio->Print(); | |
86 | AliParticleYield::FindRatio(arr, 2212, 211, 2, 2760, "V0M0005")->Print(); | |
87 | ||
88 | } | |
89 | ||
90 | void Interpolate0010(Int_t pdg) { | |
91 | ||
ad431d97 | 92 | TString centrPrefix = collSystem == 2 ? "V0M" : "V0A"; |
93 | ||
94 | AliParticleYield * p0 = AliParticleYield::FindParticle(arr, pdg, collSystem, energy, centrPrefix+"0005"); | |
95 | AliParticleYield * p1 = AliParticleYield::FindParticle(arr, pdg, collSystem, energy, centrPrefix+"0510"); | |
96 | p0->Scale(0.5); | |
97 | p1->Scale(0.5); | |
98 | AliParticleYield * pav = AliParticleYield::Add(p0,p1); | |
99 | std::cout << pav->GetYield() << ", " << pav->GetStatError() << ", "<< pav->GetSystError() << std::endl; | |
100 | ||
101 | ||
102 | } | |
103 | void Interpolate6080(Int_t pdg) { | |
104 | ||
105 | TString centrPrefix = collSystem == 2 ? "V0M" : "V0A"; | |
106 | ||
107 | AliParticleYield * p0 = AliParticleYield::FindParticle(arr, pdg, collSystem, energy, centrPrefix+"6070"); | |
108 | AliParticleYield * p1 = AliParticleYield::FindParticle(arr, pdg, collSystem, energy, centrPrefix+"7080"); | |
9d84731e | 109 | p0->Scale(0.5); |
110 | p1->Scale(0.5); | |
111 | AliParticleYield * pav = AliParticleYield::Add(p0,p1); | |
112 | std::cout << pav->GetYield() << ", " << pav->GetStatError() << ", "<< pav->GetSystError() << std::endl; | |
113 | ||
114 | ||
0bf9d3e4 | 115 | } |
116 | ||
117 | void Interpolate2040(Int_t pdg) { | |
118 | ||
119 | TString centrPrefix = collSystem == 2 ? "V0M" : "V0A"; | |
120 | ||
121 | AliParticleYield * p0 = AliParticleYield::FindParticle(arr, pdg, collSystem, energy, centrPrefix+"2030"); | |
122 | AliParticleYield * p1 = AliParticleYield::FindParticle(arr, pdg, collSystem, energy, centrPrefix+"3040"); | |
123 | p0->Scale(0.5); | |
124 | p1->Scale(0.5); | |
125 | AliParticleYield * pav = AliParticleYield::Add(p0,p1); | |
126 | std::cout << pav->GetYield() << ", " << pav->GetStatError() << ", "<< pav->GetSystError() << std::endl; | |
127 | ||
128 | ||
9d84731e | 129 | } |
130 | ||
ad431d97 | 131 | void InterpolateRatios(Int_t pdg1, Int_t pdg2, TString centr1, TString centr2, TString centrfinal) { |
9d84731e | 132 | |
4c7bd9d1 | 133 | // Get the ratios from the DB for the correct centralities |
9d84731e | 134 | AliParticleYield * ratio[2]; |
ad431d97 | 135 | ratio[0] = AliParticleYield::FindRatio(arr, pdg1, pdg2, 2, 2760., centr1, 1); |
136 | ratio[1] = AliParticleYield::FindRatio(arr, pdg1, pdg2, 2, 2760., centr2, 1); | |
4c7bd9d1 | 137 | |
9d84731e | 138 | AliParticleYield * average = AliParticleYield::Add(ratio[0], ratio[1]); |
139 | average->Scale(0.5); | |
4c7bd9d1 | 140 | |
9d84731e | 141 | AliParticleYield * pi[2]; |
ad431d97 | 142 | pi[0] = AliParticleYield::FindParticle(arr, pdg2, 2, 2760., centr1, 0); |
143 | pi[0] = AliParticleYield::Add(pi[0],AliParticleYield::FindParticle(arr, -pdg2, 2, 2760., centr1, 0)); | |
144 | pi[1] = AliParticleYield::FindParticle(arr, pdg2, 2, 2760., centr2, 0); | |
145 | pi[1] = AliParticleYield::Add(pi[1],AliParticleYield::FindParticle(arr, -pdg2, 2, 2760., centr2, 0)); | |
9d84731e | 146 | |
147 | ||
148 | // Scale to get protons with errors corresponding to the ratio | |
149 | ratio[0]->Scale(pi[0]->GetYield()) ; | |
150 | ratio[1]->Scale(pi[1]->GetYield()) ; | |
151 | ||
4c7bd9d1 | 152 | ratio[0] = AliParticleYield::Add(ratio[0], ratio[1]); |
153 | pi[0] = AliParticleYield::Add(pi[0],pi[1]); | |
9d84731e | 154 | pi[0]->SetNormError(0); |
155 | pi[0]->SetStatError(0); | |
156 | pi[0]->SetSystError(0); | |
157 | ||
158 | ratio[0]->Scale(1./pi[0]->GetYield()); | |
ad431d97 | 159 | ratio[0]->SetCentr(centrfinal); |
4c7bd9d1 | 160 | cout << "*** "<< ratio[0]->GetPartName() << " " << centrfinal << " ***"<< std::endl; |
161 | std::cout << "RATIO OF AVERAGE: " ; | |
162 | ratio[0]->Print("justvalue"); | |
9d84731e | 163 | // average->Dump(); |
4c7bd9d1 | 164 | std::cout << "AVERAGE OF RATIO: " ; |
165 | average->Print("justvalue"); | |
9d84731e | 166 | |
167 | ||
168 | } | |
169 | ||
170 | void ExtrapolateWithConstantRatioToPions(Int_t pdg, TString centrOrigin, TString centrDest) { | |
171 | ||
ad431d97 | 172 | AliParticleYield * part = AliParticleYield::FindParticle(arr, pdg,collSystem, energy, centrOrigin); |
173 | AliParticleYield * pionOrigin = AliParticleYield::FindParticle(arr, 211,collSystem, energy, centrOrigin); | |
174 | AliParticleYield * pionDest = AliParticleYield::FindParticle(arr, 211,collSystem, energy, centrDest); | |
9d84731e | 175 | if(!part || !pionOrigin | !pionDest) { |
176 | return; | |
177 | } | |
178 | // The pion yield is takes | |
179 | part->Scale (1./pionOrigin->GetYield()); | |
180 | part->Scale (pionDest->GetYield()); | |
181 | part->SetCentr(centrDest); | |
182 | part->SetMeasurementType(part->GetMeasurementType() | AliParticleYield::kTypeExtrPionRatio); | |
183 | part->Print(); | |
184 | // std::cout << "1" << std::endl; | |
185 | TClonesArray * arrOut = new TClonesArray("AliParticleYield"); | |
186 | // std::cout << "2" << std::endl; | |
187 | new((*arrOut)[0]) AliParticleYield(*part) ; | |
188 | ||
189 | // std::cout << "3" << std::endl; | |
190 | // std::cout << "4" << std::endl; | |
191 | AliParticleYield::SaveAsASCIIFile(arrOut, "temp.txt"); | |
192 | } |