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);
40 //____________________________________________________________________
41 AliForwardFlowWeights::~AliForwardFlowWeights()
46 const char* fgkPt2Name = "v22VsPt";
47 const char* fgkPt4Name = "v24VsPt";
48 const char* fgkPt4Alt = "v24AltVsPt";
49 const char* fgkBName = "v2VsB";
50 const char* fgkCName = "v2VsC";
53 //____________________________________________________________________
55 AliForwardFlowWeights::Init(TList* l)
58 const Double_t ptX[] = {0.00, 0.25, 0.350, 0.45,
59 0.55, 0.650, 0.75, 0.85,
60 0.950, 1.10, 1.30, 1.500,
61 1.70, 1.90, 2.250, 2.75,
64 // v2{2} dependence on pt
65 const Double_t y[] = {0.00000, 0.043400, 0.059911, 0.073516,
66 0.089756, 0.105486, 0.117391, 0.128199,
67 0.138013, 0.158271, 0.177726, 0.196383,
68 0.208277, 0.216648, 0.242954, 0.249961,
69 0.240131, 0.269006, 0.207796};
71 fV22Pt = new TGraph(ptN, ptX, y);
72 fV22Pt->SetName(fgkPt2Name);
73 fV22Pt->SetMarkerStyle(20);
74 fV22Pt->SetMarkerColor(kRed+1);
79 const Double_t y[] = {0.000000, 0.038646, 0.049824, 0.066662,
80 0.075856, 0.081583, 0.099778, 0.104674,
81 0.118545, 0.131874, 0.152959, 0.155348,
82 0.169751, 0.179052, 0.178532, 0.198851,
83 0.185737, 0.239901, 0.186098};
85 // v2{4} dependence on pt
86 fV24Pt = new TGraph(ptN, ptX, y);
87 fV24Pt->SetName(fgkPt4Name);
88 fV24Pt->SetMarkerStyle(20);
89 fV24Pt->SetMarkerColor(kBlue+1);
94 const Double_t y[] = {0.000000, 0.037071, 0.048566, 0.061083,
95 0.070910, 0.078831, 0.091396, 0.102026,
96 0.109691, 0.124449, 0.139819, 0.155561,
97 0.165701, 0.173678, 0.191149, 0.202015,
98 0.204540, 0.212560, 0.195885};
99 // v2{4} dependence on pt (30-40%)
100 fV24AltPt = new TGraph(ptN, ptX, y);
101 fV24AltPt->SetName(fgkPt4Alt);
102 fV24AltPt->SetMarkerStyle(20);
103 fV24AltPt->SetMarkerColor(kBlue+1);
107 const Double_t by[] = {0.017855, 0.032440, 0.055818, 0.073137,
108 0.083898, 0.086690, 0.082040, 0.077777};
110 // V2 dependence on impact parameter
111 const Double_t x[] = {1.75, 4.225, 5.965, 7.765,
112 9.215, 10.46, 11.565, 12.575};
113 fV2B = new TGraph(nb, x, by);
114 fV2B->SetName(fgkBName);
115 fV2B->SetMarkerStyle(20);
116 fV2B->SetMarkerColor(kGreen+1);
120 // V2 dependence on impact parameter
121 const Double_t x[] = { 2.5, 7.5, 15, 25, 35, 45, 55, 65};
122 fV2C = new TGraph(nb, x, by);
123 fV2C->SetName(fgkCName);
124 fV2C->SetMarkerStyle(20);
125 fV2C->SetMarkerColor(kGreen+1);
130 //____________________________________________________________________
132 AliForwardFlowWeights::CalcEtaWeight(Double_t eta, Int_t type) const
134 if (type == 0) return 1;
135 return 0.1 * TMath::Gaus(eta, 0, (type == 2 ? 3. :
136 type == 3 ? 15 : 9));
138 //____________________________________________________________________
140 AliForwardFlowWeights::CalcPidWeight(Int_t id, Int_t type) const
142 if (type == 0) return 1;
143 if (type == 2) return 1.207;
144 switch (TMath::Abs(id)) {
145 case 211: return 1.3; break; // pions
146 case 2212: return 1.0; break; // protons
147 default: return 0.7; break;
151 //____________________________________________________________________
153 AliForwardFlowWeights::CalcPtWeight(Double_t pt, Int_t type) const
157 case 2: return fV22Pt->Eval(pt);
158 case 3: return fV24AltPt->Eval(pt); // From 30-40
159 case 4: return fV24Pt->Eval(pt);
161 return 0.5 * (fV22Pt->Eval(pt) + fV24Pt->Eval(pt));
164 //____________________________________________________________________
166 AliForwardFlowWeights::CalcBWeight(Double_t b) const
168 return fV2B->Eval(b) / fV2B->Eval(10.46);
171 //____________________________________________________________________
173 AliForwardFlowWeights::CalcCentWeight(Double_t c) const
175 return fV2C->Eval(c) / fV2C->Eval(45);
178 //____________________________________________________________________
180 AliForwardFlowWeights::CalcWeight(Double_t eta,
191 if (what & kEta) w *= CalcEtaWeight(eta, type);
192 if (what & kPt) w *= CalcPtWeight(pt, type);
193 if (what & kPID) w *= CalcPidWeight(id, type);
194 if (what & kCent) w *= CalcCentWeight(cOrB);
195 else if (what & kB) w *= CalcBWeight(cOrB);
197 w *= 20 * 2. * TMath::Cos(order * (phi - phiR));
202 //____________________________________________________________________
204 AliForwardFlowWeights::CalcWeight(Double_t eta, Double_t pt,
205 Double_t phi, Int_t id,
206 Double_t phiR, Double_t b) const
208 return CalcWeight(eta, pt, phi, id, phiR, b, 1, 2, kEta|kPt|kPID|kB);
213 TObject* GetListObject(TList* l, const char* name)
215 if (!name || name[0] == '\0') {
216 Error("GetListObject", "No object name");
220 Error("GetListObject", "No list");
223 TObject* o = l->FindObject(name);
225 Error("GetListObject", "Object %s not found in list %s",
232 //____________________________________________________________________
233 AliForwardFlowWeights*
234 AliForwardFlowWeights::FromList(TList* l)
236 TObject* pt2 = GetListObject(l, fgkPt2Name);
237 TObject* pt4 = GetListObject(l, fgkPt4Name);
238 TObject* alt = GetListObject(l, fgkPt4Alt);
239 TObject* b = GetListObject(l, fgkBName);
240 TObject* c = GetListObject(l, fgkCName);
242 if (!pt2 || !pt4 || !alt || !b || !c) {
243 ::Error("FromList", "One or more histograms not found");
246 AliForwardFlowWeights* ret = new AliForwardFlowWeights;
247 ret->fV22Pt = static_cast<TGraph*>(pt2);
248 ret->fV24Pt = static_cast<TGraph*>(pt4);
249 ret->fV24AltPt = static_cast<TGraph*>(alt);
250 ret->fV2B = static_cast<TGraph*>(b);
251 ret->fV2C = static_cast<TGraph*>(c);
256 //____________________________________________________________________