1 #include "AliForwardFlowWeights.h"
7 //____________________________________________________________________
8 AliForwardFlowWeights::AliForwardFlowWeights()
16 //____________________________________________________________________
17 AliForwardFlowWeights::AliForwardFlowWeights(const AliForwardFlowWeights& o)
21 fV24AltPt(o.fV24AltPt),
26 //____________________________________________________________________
27 AliForwardFlowWeights&
28 AliForwardFlowWeights::operator=(const AliForwardFlowWeights& o)
30 if (&o == this) return *this;
32 fV22Pt = (o.fV22Pt ? static_cast<TGraph*>(o.fV22Pt->Clone()) : 0);
33 fV24Pt = (o.fV24Pt ? static_cast<TGraph*>(o.fV24Pt->Clone()) : 0);
34 fV24AltPt = (o.fV24AltPt ? static_cast<TGraph*>(o.fV24AltPt->Clone()) : 0);
35 fV2B = (o.fV2B ? static_cast<TGraph*>(o.fV2B->Clone()) : 0);
36 fV2C = (o.fV2C ? static_cast<TGraph*>(o.fV2C->Clone()) : 0);
42 const char* fgkPt2Name = "v22VsPt";
43 const char* fgkPt4Name = "v24VsPt";
44 const char* fgkPt4Alt = "v24AltVsPt";
45 const char* fgkBName = "v2VsB";
46 const char* fgkCName = "v2VsC";
49 //____________________________________________________________________
51 AliForwardFlowWeights::Init(TList* l)
54 const Double_t ptX[] = {0.00, 0.25, 0.350, 0.45,
55 0.55, 0.650, 0.75, 0.85,
56 0.950, 1.10, 1.30, 1.500,
57 1.70, 1.90, 2.250, 2.75,
60 // v2{2} dependence on pt
61 const Double_t y[] = {0.00000, 0.043400, 0.059911, 0.073516,
62 0.089756, 0.105486, 0.117391, 0.128199,
63 0.138013, 0.158271, 0.177726, 0.196383,
64 0.208277, 0.216648, 0.242954, 0.249961,
65 0.240131, 0.269006, 0.207796};
67 fV22Pt = new TGraph(ptN, ptX, y);
68 fV22Pt->SetName(fgkPt2Name);
69 fV22Pt->SetMarkerStyle(20);
70 fV22Pt->SetMarkerColor(kRed+1);
75 const Double_t y[] = {0.000000, 0.038646, 0.049824, 0.066662,
76 0.075856, 0.081583, 0.099778, 0.104674,
77 0.118545, 0.131874, 0.152959, 0.155348,
78 0.169751, 0.179052, 0.178532, 0.198851,
79 0.185737, 0.239901, 0.186098};
81 // v2{4} dependence on pt
82 fV24Pt = new TGraph(ptN, ptX, y);
83 fV24Pt->SetName(fgkPt4Name);
84 fV24Pt->SetMarkerStyle(20);
85 fV24Pt->SetMarkerColor(kBlue+1);
90 const Double_t y[] = {0.000000, 0.037071, 0.048566, 0.061083,
91 0.070910, 0.078831, 0.091396, 0.102026,
92 0.109691, 0.124449, 0.139819, 0.155561,
93 0.165701, 0.173678, 0.191149, 0.202015,
94 0.204540, 0.212560, 0.195885};
95 // v2{4} dependence on pt (30-40%)
96 fV24AltPt = new TGraph(ptN, ptX, y);
97 fV24AltPt->SetName(fgkPt4Alt);
98 fV24AltPt->SetMarkerStyle(20);
99 fV24AltPt->SetMarkerColor(kBlue+1);
103 const Double_t by[] = {0.017855, 0.032440, 0.055818, 0.073137,
104 0.083898, 0.086690, 0.082040, 0.077777};
106 // V2 dependence on impact parameter
107 const Double_t x[] = {1.75, 4.225, 5.965, 7.765,
108 9.215, 10.46, 11.565, 12.575};
109 fV2B = new TGraph(nb, x, by);
110 fV2B->SetName(fgkBName);
111 fV2B->SetMarkerStyle(20);
112 fV2B->SetMarkerColor(kGreen+1);
116 // V2 dependence on impact parameter
117 const Double_t x[] = { 2.5, 7.5, 15, 25, 35, 45, 55, 65};
118 fV2C = new TGraph(nb, x, by);
119 fV2C->SetName(fgkCName);
120 fV2C->SetMarkerStyle(20);
121 fV2C->SetMarkerColor(kGreen+1);
126 //____________________________________________________________________
128 AliForwardFlowWeights::CalcEtaWeight(Double_t eta, Int_t type) const
130 if (type == 0) return 1;
131 return 0.1 * TMath::Gaus(eta, 0, (type == 2 ? 3. :
132 type == 3 ? 15 : 9));
134 //____________________________________________________________________
136 AliForwardFlowWeights::CalcPidWeight(Int_t id, Int_t type) const
138 if (type == 0) return 1;
139 if (type == 2) return 1.207;
140 switch (TMath::Abs(id)) {
141 case 211: return 1.3; break; // pions
142 case 2212: return 1.0; break; // protons
143 default: return 0.7; break;
147 //____________________________________________________________________
149 AliForwardFlowWeights::CalcPtWeight(Double_t pt, Int_t type) const
153 case 2: return fV22Pt->Eval(pt);
154 case 3: return fV24AltPt->Eval(pt); // From 30-40
155 case 4: return fV24Pt->Eval(pt);
157 return 0.5 * (fV22Pt->Eval(pt) + fV24Pt->Eval(pt));
160 //____________________________________________________________________
162 AliForwardFlowWeights::CalcBWeight(Double_t b) const
164 return fV2B->Eval(b) / fV2B->Eval(10.46);
167 //____________________________________________________________________
169 AliForwardFlowWeights::CalcCentWeight(Double_t c) const
171 return fV2C->Eval(c) / fV2C->Eval(45);
174 //____________________________________________________________________
176 AliForwardFlowWeights::CalcWeight(Double_t eta,
187 if (what & kEta) w *= CalcEtaWeight(eta, type);
188 if (what & kPt) w *= CalcPtWeight(pt, type);
189 if (what & kPID) w *= CalcPidWeight(id, type);
190 if (what & kCent) w *= CalcCentWeight(cOrB);
191 else if (what & kB) w *= CalcBWeight(cOrB);
193 w *= 20 * 2. * TMath::Cos(order * (phi - phiR));
198 //____________________________________________________________________
200 AliForwardFlowWeights::CalcWeight(Double_t eta, Double_t pt,
201 Double_t phi, Int_t id,
202 Double_t phiR, Double_t b) const
204 return CalcWeight(eta, pt, phi, id, phiR, b, 1, 2, kEta|kPt|kPID|kB);
209 TObject* GetListObject(TList* l, const char* name)
211 if (!name || name[0] == '\0') {
212 Error("GetListObject", "No object name");
216 Error("GetListObject", "No list");
219 TObject* o = l->FindObject(name);
221 Error("GetListObject", "Object %s not found in list %s",
228 //____________________________________________________________________
229 AliForwardFlowWeights*
230 AliForwardFlowWeights::FromList(TList* l)
232 TObject* pt2 = GetListObject(l, fgkPt2Name);
233 TObject* pt4 = GetListObject(l, fgkPt4Name);
234 TObject* alt = GetListObject(l, fgkPt4Alt);
235 TObject* b = GetListObject(l, fgkBName);
236 TObject* c = GetListObject(l, fgkCName);
238 if (!pt2 || !pt4 || !alt || !b || !c) {
239 ::Error("FromList", "One or more histograms not found");
242 AliForwardFlowWeights* ret = new AliForwardFlowWeights;
243 ret->fV22Pt = static_cast<TGraph*>(pt2);
244 ret->fV24Pt = static_cast<TGraph*>(pt4);
245 ret->fV24AltPt = static_cast<TGraph*>(alt);
246 ret->fV2B = static_cast<TGraph*>(b);
247 ret->fV2C = static_cast<TGraph*>(c);
252 //____________________________________________________________________