]>
Commit | Line | Data |
---|---|---|
cd12341d | 1 | #include <iostream> |
2 | #include <math.h> | |
3 | #include "TChain.h" | |
4 | #include "TFile.h" | |
5 | #include "TKey.h" | |
6 | #include "TObject.h" | |
7 | #include "TObjString.h" | |
8 | #include "TList.h" | |
9 | #include "TTree.h" | |
10 | #include "TH1F.h" | |
11 | #include "TH1D.h" | |
12 | #include "TH2D.h" | |
13 | #include "TH3D.h" | |
14 | #include "TProfile.h" | |
15 | #include "TProfile2D.h" | |
16 | #include "TCanvas.h" | |
17 | #include "TRandom3.h" | |
18 | #include "TF1.h" | |
19 | ||
20 | #include "AliAnalysisTask.h" | |
21 | #include "AliAnalysisManager.h" | |
22 | ||
23 | ||
24 | #include "AliESDEvent.h" | |
25 | #include "AliESDInputHandler.h" | |
26 | #include "AliESDtrackCuts.h" | |
27 | ||
28 | #include "AliAODEvent.h" | |
29 | #include "AliAODInputHandler.h" | |
30 | #include "AliAODMCParticle.h" | |
31 | ||
32 | #include "AliChaoticity.h" | |
33 | ||
34 | #define PI 3.1415927 | |
35 | #define G_Coeff 0.006399 // 2*pi*alpha*M_pion | |
36 | ||
37 | ||
38 | // Author: Dhevan Gangadharan | |
39 | ||
40 | ClassImp(AliChaoticity) | |
41 | ||
42 | //________________________________________________________________________ | |
43 | AliChaoticity::AliChaoticity(): | |
44 | AliAnalysisTaskSE(), | |
45 | fname(0), | |
46 | fAOD(0x0), | |
cd12341d | 47 | fOutputList(0x0), |
48 | fPIDResponse(0x0), | |
49 | fEC(0x0), | |
50 | fEvt(0x0), | |
51 | fTempStruct(0x0), | |
52 | fRandomNumber(0x0), | |
53 | fLEGO(kTRUE), | |
54 | fMCcase(kFALSE), | |
55 | fAODcase(kTRUE), | |
56 | fPbPbcase(kTRUE), | |
654866df | 57 | fGenerateSignal(kFALSE), |
cd12341d | 58 | fPdensityExplicitLoop(kFALSE), |
59 | fPdensityPairCut(kTRUE), | |
60 | fTabulatePairs(kFALSE), | |
654866df | 61 | fRBinMax(5), |
5fc49f8c | 62 | fFixedLambdaBinMomRes(5), |
63 | fFixedLambdaBinr3(20), | |
654866df | 64 | fFilterBit(7), |
cd12341d | 65 | fBfield(0), |
66 | fMbin(0), | |
ae9b34d1 | 67 | fFSIbin(0), |
cd12341d | 68 | fEDbin(0), |
654866df | 69 | fMbins(fCentBins), |
cd12341d | 70 | fMultLimit(0), |
71 | fCentBinLowLimit(0), | |
72 | fCentBinHighLimit(1), | |
73 | fEventCounter(0), | |
74 | fEventsToMix(0), | |
75 | fZvertexBins(0), | |
76 | fMultLimits(), | |
77 | fQcut(), | |
78 | fQLowerCut(0), | |
79 | fNormQcutLow(), | |
80 | fNormQcutHigh(), | |
81 | fKupperBound(0), | |
82 | fQupperBound(0), | |
83 | fQupperBoundWeights(0), | |
84 | fKstepT(), | |
85 | fKstepY(), | |
86 | fKmeanT(), | |
87 | fKmeanY(), | |
88 | fKmiddleT(), | |
89 | fKmiddleY(), | |
90 | fQstep(0), | |
5e3e77d6 | 91 | fQstepWeights(0), |
cd12341d | 92 | fQmean(), |
93 | fDampStart(0), | |
94 | fDampStep(0), | |
cd12341d | 95 | fTPCTOFboundry(0), |
96 | fTOFboundry(0), | |
654866df | 97 | fSigmaCutTPC(2.0), |
98 | fSigmaCutTOF(2.0), | |
99 | fMinSepPair(0.035), | |
cd12341d | 100 | fShareQuality(0), |
101 | fShareFraction(0), | |
102 | fTrueMassP(0), | |
103 | fTrueMassPi(0), | |
104 | fTrueMassK(0), | |
105 | fTrueMassKs(0), | |
106 | fTrueMassLam(0), | |
f5df8b1d | 107 | fKtIndexL(0), |
108 | fKtIndexH(0), | |
109 | fQoIndexL(0), | |
110 | fQoIndexH(0), | |
111 | fQsIndexL(0), | |
112 | fQsIndexH(0), | |
113 | fQlIndexL(0), | |
114 | fQlIndexH(0), | |
cd12341d | 115 | fDummyB(0), |
cd12341d | 116 | fDefaultsCharMult(), |
117 | fDefaultsCharSE(), | |
118 | fDefaultsCharME(), | |
119 | fDefaultsInt(), | |
120 | fPairLocationSE(), | |
121 | fPairLocationME(), | |
122 | fTripletSkip1(), | |
123 | fTripletSkip2(), | |
124 | fOtherPairLocation1(), | |
125 | fOtherPairLocation2(), | |
126 | fNormPairSwitch(), | |
127 | fPairSplitCut(), | |
5e3e77d6 | 128 | fNormPairs(), |
edc35fd5 | 129 | fMomResC2(0x0) |
130 | ||
cd12341d | 131 | { |
132 | // Default constructor | |
133 | for(Int_t mb=0; mb<fMbins; mb++){ | |
654866df | 134 | for(Int_t edB=0; edB<fEDbins; edB++){ |
cd12341d | 135 | for(Int_t c1=0; c1<2; c1++){ |
136 | for(Int_t c2=0; c2<2; c2++){ | |
137 | for(Int_t sc=0; sc<kSCLimit2; sc++){ | |
138 | for(Int_t term=0; term<2; term++){ | |
139 | ||
140 | Charge1[c1].Charge2[c2].SC[sc].MB[mb].EDB[edB].TwoPT[term].fExplicit2=0x0; | |
141 | ||
142 | Charge1[c1].Charge2[c2].SC[sc].MB[mb].EDB[edB].TwoPT[term].fIdeal = 0x0; | |
143 | Charge1[c1].Charge2[c2].SC[sc].MB[mb].EDB[edB].TwoPT[term].fSmeared = 0x0; | |
144 | Charge1[c1].Charge2[c2].SC[sc].MB[mb].EDB[edB].TwoPT[term].OSL_ktbin[0].fExplicit2OSL = 0x0; | |
145 | Charge1[c1].Charge2[c2].SC[sc].MB[mb].EDB[edB].TwoPT[term].OSL_ktbin[0].fExplicit2OSLQW = 0x0; | |
146 | Charge1[c1].Charge2[c2].SC[sc].MB[mb].EDB[edB].TwoPT[term].OSL_ktbin[1].fExplicit2OSL = 0x0; | |
147 | Charge1[c1].Charge2[c2].SC[sc].MB[mb].EDB[edB].TwoPT[term].OSL_ktbin[1].fExplicit2OSLQW = 0x0; | |
148 | ||
149 | }// term_2 | |
150 | }// SC_2 | |
151 | ||
152 | for(Int_t c3=0; c3<2; c3++){ | |
153 | for(Int_t sc=0; sc<kSCLimit3; sc++){ | |
154 | for(Int_t term=0; term<5; term++){ | |
155 | ||
156 | Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].fExplicit3 = 0x0; | |
157 | Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].fNormEx3 = 0x0; | |
158 | Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].fNorm3 = 0x0; | |
159 | Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].fTerms3 = 0x0; | |
160 | for(Int_t dt=0; dt<kDENtypes; dt++){ | |
161 | Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].DT[dt].fTwoPartNorm = 0x0; | |
90814457 | 162 | Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].DT[dt].f4VectProd1TwoPartNorm = 0x0; |
163 | Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].DT[dt].f4VectProd2TwoPartNorm = 0x0; | |
164 | Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].DT[dt].f4VectProd1TwoPartNormIdeal = 0x0; | |
165 | Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].DT[dt].f4VectProd2TwoPartNormIdeal = 0x0; | |
166 | Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].DT[dt].f4VectProd1TwoPartNormSmeared = 0x0; | |
167 | Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].DT[dt].f4VectProd2TwoPartNormSmeared = 0x0; | |
cd12341d | 168 | }//dt |
169 | ||
170 | }// term_3 | |
171 | }// SC_3 | |
172 | }//c3 | |
173 | }//c2 | |
174 | }//c1 | |
654866df | 175 | for(Int_t tKbin=0; tKbin<fKbinsT; tKbin++){ |
176 | for(Int_t yKbin=0; yKbin<fKbinsY; yKbin++){ | |
cd12341d | 177 | KT[tKbin].KY[yKbin].MB[mb].EDB[edB].TwoPT[0].fExplicit2ThreeD = 0x0; |
178 | KT[tKbin].KY[yKbin].MB[mb].EDB[edB].TwoPT[1].fExplicit2ThreeD = 0x0; | |
179 | } | |
180 | } | |
181 | ||
182 | }// ED | |
183 | }// Mbin | |
184 | ||
edc35fd5 | 185 | // Initialize FSI histograms |
186 | for(Int_t i=0; i<2; i++){ | |
187 | fFSI2SS[i]=0x0; | |
188 | fFSI2OS[i]=0x0; | |
189 | } | |
190 | for(Int_t i=0; i<6; i++){ | |
191 | fFSIOmega0SS[i]=0x0; | |
192 | fFSIOmega0OS[i]=0x0; | |
193 | } | |
194 | ||
195 | ||
196 | // Initialize fNormWeight and fNormWeightErr to 0 | |
f5df8b1d | 197 | for(Int_t i=0; i<3; i++){// Kt iterator |
198 | for(Int_t j=0; j<10; j++){// Mbin iterator | |
199 | fNormWeight[i][j]=0x0; | |
edc35fd5 | 200 | } |
201 | } | |
f5df8b1d | 202 | |
edc35fd5 | 203 | |
cd12341d | 204 | } |
205 | //________________________________________________________________________ | |
654866df | 206 | AliChaoticity::AliChaoticity(const Char_t *name) |
cd12341d | 207 | : AliAnalysisTaskSE(name), |
208 | fname(name), | |
209 | fAOD(0x0), | |
cd12341d | 210 | fOutputList(0x0), |
211 | fPIDResponse(0x0), | |
212 | fEC(0x0), | |
213 | fEvt(0x0), | |
214 | fTempStruct(0x0), | |
215 | fRandomNumber(0x0), | |
140107fb | 216 | fLEGO(kTRUE), |
654866df | 217 | fMCcase(kFALSE), |
cd12341d | 218 | fAODcase(kTRUE), |
654866df | 219 | fPbPbcase(kTRUE), |
220 | fGenerateSignal(kFALSE), | |
cd12341d | 221 | fPdensityExplicitLoop(kFALSE), |
222 | fPdensityPairCut(kTRUE), | |
654866df | 223 | fTabulatePairs(kFALSE), |
224 | fRBinMax(5), | |
5fc49f8c | 225 | fFixedLambdaBinMomRes(5), |
226 | fFixedLambdaBinr3(20), | |
654866df | 227 | fFilterBit(7), |
cd12341d | 228 | fBfield(0), |
229 | fMbin(0), | |
ae9b34d1 | 230 | fFSIbin(0), |
cd12341d | 231 | fEDbin(0), |
654866df | 232 | fMbins(fCentBins), |
cd12341d | 233 | fMultLimit(0), |
654866df | 234 | fCentBinLowLimit(0), |
235 | fCentBinHighLimit(1), | |
cd12341d | 236 | fEventCounter(0), |
237 | fEventsToMix(0), | |
238 | fZvertexBins(0), | |
239 | fMultLimits(), | |
240 | fQcut(), | |
241 | fQLowerCut(0), | |
242 | fNormQcutLow(), | |
243 | fNormQcutHigh(), | |
244 | fKupperBound(0), | |
245 | fQupperBound(0), | |
246 | fQupperBoundWeights(0), | |
247 | fKstepT(), | |
248 | fKstepY(), | |
249 | fKmeanT(), | |
250 | fKmeanY(), | |
251 | fKmiddleT(), | |
252 | fKmiddleY(), | |
253 | fQstep(0), | |
5e3e77d6 | 254 | fQstepWeights(0), |
cd12341d | 255 | fQmean(), |
256 | fDampStart(0), | |
257 | fDampStep(0), | |
cd12341d | 258 | fTPCTOFboundry(0), |
259 | fTOFboundry(0), | |
654866df | 260 | fSigmaCutTPC(2.0), |
261 | fSigmaCutTOF(2.0), | |
262 | fMinSepPair(0.035), | |
cd12341d | 263 | fShareQuality(0), |
264 | fShareFraction(0), | |
265 | fTrueMassP(0), | |
266 | fTrueMassPi(0), | |
267 | fTrueMassK(0), | |
268 | fTrueMassKs(0), | |
269 | fTrueMassLam(0), | |
f5df8b1d | 270 | fKtIndexL(0), |
271 | fKtIndexH(0), | |
272 | fQoIndexL(0), | |
273 | fQoIndexH(0), | |
274 | fQsIndexL(0), | |
275 | fQsIndexH(0), | |
276 | fQlIndexL(0), | |
277 | fQlIndexH(0), | |
cd12341d | 278 | fDummyB(0), |
cd12341d | 279 | fDefaultsCharMult(), |
280 | fDefaultsCharSE(), | |
281 | fDefaultsCharME(), | |
282 | fDefaultsInt(), | |
283 | fPairLocationSE(), | |
284 | fPairLocationME(), | |
285 | fTripletSkip1(), | |
286 | fTripletSkip2(), | |
287 | fOtherPairLocation1(), | |
288 | fOtherPairLocation2(), | |
289 | fNormPairSwitch(), | |
290 | fPairSplitCut(), | |
5e3e77d6 | 291 | fNormPairs(), |
edc35fd5 | 292 | fMomResC2(0x0) |
293 | ||
cd12341d | 294 | { |
295 | // Main constructor | |
cd12341d | 296 | fAODcase=kTRUE; |
cd12341d | 297 | fPdensityExplicitLoop = kFALSE; |
298 | fPdensityPairCut = kTRUE; | |
654866df | 299 | |
cd12341d | 300 | |
301 | for(Int_t mb=0; mb<fMbins; mb++){ | |
654866df | 302 | for(Int_t edB=0; edB<fEDbins; edB++){ |
cd12341d | 303 | for(Int_t c1=0; c1<2; c1++){ |
304 | for(Int_t c2=0; c2<2; c2++){ | |
305 | for(Int_t sc=0; sc<kSCLimit2; sc++){ | |
306 | for(Int_t term=0; term<2; term++){ | |
307 | ||
308 | Charge1[c1].Charge2[c2].SC[sc].MB[mb].EDB[edB].TwoPT[term].fExplicit2=0x0; | |
309 | ||
310 | Charge1[c1].Charge2[c2].SC[sc].MB[mb].EDB[edB].TwoPT[term].fIdeal = 0x0; | |
311 | Charge1[c1].Charge2[c2].SC[sc].MB[mb].EDB[edB].TwoPT[term].fSmeared = 0x0; | |
312 | Charge1[c1].Charge2[c2].SC[sc].MB[mb].EDB[edB].TwoPT[term].OSL_ktbin[0].fExplicit2OSL = 0x0; | |
313 | Charge1[c1].Charge2[c2].SC[sc].MB[mb].EDB[edB].TwoPT[term].OSL_ktbin[0].fExplicit2OSLQW = 0x0; | |
314 | Charge1[c1].Charge2[c2].SC[sc].MB[mb].EDB[edB].TwoPT[term].OSL_ktbin[1].fExplicit2OSL = 0x0; | |
315 | Charge1[c1].Charge2[c2].SC[sc].MB[mb].EDB[edB].TwoPT[term].OSL_ktbin[1].fExplicit2OSLQW = 0x0; | |
316 | ||
317 | }// term_2 | |
318 | }// SC_2 | |
319 | ||
320 | for(Int_t c3=0; c3<2; c3++){ | |
321 | for(Int_t sc=0; sc<kSCLimit3; sc++){ | |
322 | for(Int_t term=0; term<5; term++){ | |
323 | ||
324 | Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].fExplicit3 = 0x0; | |
325 | Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].fNormEx3 = 0x0; | |
326 | Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].fNorm3 = 0x0; | |
327 | Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].fTerms3 = 0x0; | |
328 | for(Int_t dt=0; dt<kDENtypes; dt++){ | |
329 | Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].DT[dt].fTwoPartNorm = 0x0; | |
90814457 | 330 | Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].DT[dt].f4VectProd1TwoPartNorm = 0x0; |
331 | Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].DT[dt].f4VectProd2TwoPartNorm = 0x0; | |
332 | Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].DT[dt].f4VectProd1TwoPartNormIdeal = 0x0; | |
333 | Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].DT[dt].f4VectProd2TwoPartNormIdeal = 0x0; | |
334 | Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].DT[dt].f4VectProd1TwoPartNormSmeared = 0x0; | |
335 | Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].DT[dt].f4VectProd2TwoPartNormSmeared = 0x0; | |
cd12341d | 336 | }//dt |
337 | ||
338 | }// term_3 | |
339 | }// SC_3 | |
340 | }//c3 | |
341 | }//c2 | |
342 | }//c1 | |
654866df | 343 | for(Int_t tKbin=0; tKbin<fKbinsT; tKbin++){ |
344 | for(Int_t yKbin=0; yKbin<fKbinsY; yKbin++){ | |
cd12341d | 345 | KT[tKbin].KY[yKbin].MB[mb].EDB[edB].TwoPT[0].fExplicit2ThreeD = 0x0; |
346 | KT[tKbin].KY[yKbin].MB[mb].EDB[edB].TwoPT[1].fExplicit2ThreeD = 0x0; | |
347 | } | |
348 | } | |
349 | ||
350 | }// ED | |
351 | }// Mbin | |
352 | ||
edc35fd5 | 353 | // Initialize FSI histograms |
354 | for(Int_t i=0; i<2; i++){ | |
355 | fFSI2SS[i]=0x0; | |
356 | fFSI2OS[i]=0x0; | |
357 | } | |
358 | for(Int_t i=0; i<6; i++){ | |
359 | fFSIOmega0SS[i]=0x0; | |
360 | fFSIOmega0OS[i]=0x0; | |
361 | } | |
f5df8b1d | 362 | |
edc35fd5 | 363 | // Initialize fNormWeight and fNormWeightErr to 0 |
f5df8b1d | 364 | for(Int_t i=0; i<3; i++){// Kt iterator |
365 | for(Int_t j=0; j<10; j++){// Mbin iterator | |
366 | fNormWeight[i][j]=0x0; | |
edc35fd5 | 367 | } |
368 | } | |
cd12341d | 369 | |
f5df8b1d | 370 | |
cd12341d | 371 | DefineOutput(1, TList::Class()); |
372 | } | |
373 | //________________________________________________________________________ | |
374 | AliChaoticity::AliChaoticity(const AliChaoticity &obj) | |
375 | : AliAnalysisTaskSE(obj.fname), | |
376 | fname(obj.fname), | |
377 | fAOD(obj.fAOD), | |
b6e5ec54 | 378 | //fESD(obj.fESD), |
cd12341d | 379 | fOutputList(obj.fOutputList), |
380 | fPIDResponse(obj.fPIDResponse), | |
381 | fEC(obj.fEC), | |
382 | fEvt(obj.fEvt), | |
383 | fTempStruct(obj.fTempStruct), | |
384 | fRandomNumber(obj.fRandomNumber), | |
385 | fLEGO(obj.fLEGO), | |
386 | fMCcase(obj.fMCcase), | |
387 | fAODcase(obj.fAODcase), | |
388 | fPbPbcase(obj.fPbPbcase), | |
654866df | 389 | fGenerateSignal(obj.fGenerateSignal), |
cd12341d | 390 | fPdensityExplicitLoop(obj.fPdensityExplicitLoop), |
391 | fPdensityPairCut(obj.fPdensityPairCut), | |
392 | fTabulatePairs(obj.fTabulatePairs), | |
654866df | 393 | fRBinMax(obj.fRBinMax), |
5fc49f8c | 394 | fFixedLambdaBinMomRes(obj.fFixedLambdaBinMomRes), |
395 | fFixedLambdaBinr3(obj.fFixedLambdaBinr3), | |
654866df | 396 | fFilterBit(obj.fFilterBit), |
cd12341d | 397 | fBfield(obj.fBfield), |
398 | fMbin(obj.fMbin), | |
ae9b34d1 | 399 | fFSIbin(obj.fFSIbin), |
cd12341d | 400 | fEDbin(obj.fEDbin), |
401 | fMbins(obj.fMbins), | |
402 | fMultLimit(obj.fMultLimit), | |
403 | fCentBinLowLimit(obj.fCentBinLowLimit), | |
404 | fCentBinHighLimit(obj.fCentBinHighLimit), | |
405 | fEventCounter(obj.fEventCounter), | |
406 | fEventsToMix(obj.fEventsToMix), | |
407 | fZvertexBins(obj.fZvertexBins), | |
408 | fMultLimits(), | |
409 | fQcut(), | |
410 | fQLowerCut(obj.fQLowerCut), | |
411 | fNormQcutLow(), | |
412 | fNormQcutHigh(), | |
413 | fKupperBound(obj.fKupperBound), | |
414 | fQupperBound(obj.fQupperBound), | |
415 | fQupperBoundWeights(obj.fQupperBoundWeights), | |
416 | fKstepT(), | |
417 | fKstepY(), | |
418 | fKmeanT(), | |
419 | fKmeanY(), | |
420 | fKmiddleT(), | |
421 | fKmiddleY(), | |
422 | fQstep(obj.fQstep), | |
5e3e77d6 | 423 | fQstepWeights(obj.fQstepWeights), |
cd12341d | 424 | fQmean(), |
425 | fDampStart(obj.fDampStart), | |
426 | fDampStep(obj.fDampStep), | |
cd12341d | 427 | fTPCTOFboundry(obj.fTPCTOFboundry), |
428 | fTOFboundry(obj.fTOFboundry), | |
429 | fSigmaCutTPC(obj.fSigmaCutTPC), | |
430 | fSigmaCutTOF(obj.fSigmaCutTOF), | |
654866df | 431 | fMinSepPair(obj.fMinSepPair), |
cd12341d | 432 | fShareQuality(obj.fShareQuality), |
433 | fShareFraction(obj.fShareFraction), | |
434 | fTrueMassP(obj.fTrueMassP), | |
435 | fTrueMassPi(obj.fTrueMassPi), | |
436 | fTrueMassK(obj.fTrueMassK), | |
437 | fTrueMassKs(obj.fTrueMassKs), | |
438 | fTrueMassLam(obj.fTrueMassLam), | |
f5df8b1d | 439 | fKtIndexL(obj.fKtIndexL), |
440 | fKtIndexH(obj.fKtIndexH), | |
441 | fQoIndexL(obj.fQoIndexL), | |
442 | fQoIndexH(obj.fQoIndexH), | |
443 | fQsIndexL(obj.fQsIndexL), | |
444 | fQsIndexH(obj.fQsIndexH), | |
445 | fQlIndexL(obj.fQlIndexL), | |
446 | fQlIndexH(obj.fQlIndexH), | |
cd12341d | 447 | fDummyB(obj.fDummyB), |
cd12341d | 448 | fDefaultsCharMult(), |
449 | fDefaultsCharSE(), | |
450 | fDefaultsCharME(), | |
451 | fDefaultsInt(), | |
452 | fPairLocationSE(), | |
453 | fPairLocationME(), | |
454 | fTripletSkip1(), | |
455 | fTripletSkip2(), | |
456 | fOtherPairLocation1(), | |
457 | fOtherPairLocation2(), | |
458 | fNormPairSwitch(), | |
459 | fPairSplitCut(), | |
5e3e77d6 | 460 | fNormPairs(), |
edc35fd5 | 461 | fMomResC2(obj.fMomResC2) |
cd12341d | 462 | { |
463 | // Copy constructor | |
edc35fd5 | 464 | for(Int_t i=0; i<2; i++){ |
465 | fFSI2SS[i]=obj.fFSI2SS[i]; | |
466 | fFSI2OS[i]=obj.fFSI2OS[i]; | |
467 | } | |
468 | for(Int_t i=0; i<6; i++){ | |
469 | fFSIOmega0SS[i]=obj.fFSIOmega0SS[i]; | |
470 | fFSIOmega0OS[i]=obj.fFSIOmega0OS[i]; | |
471 | } | |
472 | ||
473 | // Initialize fNormWeight and fNormWeightErr to 0 | |
f5df8b1d | 474 | for(Int_t i=0; i<3; i++){// Kt iterator |
475 | for(Int_t j=0; j<10; j++){// Mbin iterator | |
476 | fNormWeight[i][j]=0x0; | |
edc35fd5 | 477 | } |
478 | } | |
f5df8b1d | 479 | |
edc35fd5 | 480 | |
cd12341d | 481 | } |
482 | //________________________________________________________________________ | |
483 | AliChaoticity &AliChaoticity::operator=(const AliChaoticity &obj) | |
484 | { | |
485 | // Assignment operator | |
486 | if (this == &obj) | |
487 | return *this; | |
488 | ||
489 | fname = obj.fname; | |
490 | fAOD = obj.fAOD; | |
cd12341d | 491 | fOutputList = obj.fOutputList; |
492 | fPIDResponse = obj.fPIDResponse; | |
493 | fEC = obj.fEC; | |
494 | fEvt = obj.fEvt; | |
495 | fTempStruct = obj.fTempStruct; | |
496 | fRandomNumber = obj.fRandomNumber; | |
497 | fLEGO = fLEGO; | |
498 | fMCcase = obj.fMCcase; | |
499 | fAODcase = obj.fAODcase; | |
654866df | 500 | fPbPbcase = obj.fPbPbcase; |
501 | fGenerateSignal = obj.fGenerateSignal; | |
cd12341d | 502 | fPdensityExplicitLoop = obj.fPdensityExplicitLoop; |
503 | fPdensityPairCut = obj.fPdensityPairCut; | |
504 | fTabulatePairs = obj.fTabulatePairs; | |
654866df | 505 | fRBinMax = obj.fRBinMax; |
5fc49f8c | 506 | fFixedLambdaBinMomRes = obj.fFixedLambdaBinMomRes; |
507 | fFixedLambdaBinr3 = obj.fFixedLambdaBinr3; | |
654866df | 508 | fFilterBit = obj.fFilterBit; |
cd12341d | 509 | fBfield = obj.fBfield; |
510 | fMbin = obj.fMbin; | |
ae9b34d1 | 511 | fFSIbin = obj.fFSIbin; |
cd12341d | 512 | fEDbin = obj.fEDbin; |
513 | fMbins = obj.fMbins; | |
514 | fMultLimit = obj.fMultLimit; | |
515 | fCentBinLowLimit = obj.fCentBinLowLimit; | |
516 | fCentBinHighLimit = obj.fCentBinHighLimit; | |
517 | fEventCounter = obj.fEventCounter; | |
518 | fEventsToMix = obj.fEventsToMix; | |
519 | fZvertexBins = obj.fZvertexBins; | |
cd12341d | 520 | fQLowerCut = obj.fQLowerCut; |
cd12341d | 521 | fKupperBound = obj.fKupperBound; |
522 | fQupperBound = obj.fQupperBound; | |
523 | fQupperBoundWeights = obj.fQupperBoundWeights; | |
cd12341d | 524 | fQstep = obj.fQstep; |
5e3e77d6 | 525 | fQstepWeights = obj.fQstepWeights; |
cd12341d | 526 | fDampStart = obj.fDampStart; |
527 | fDampStep = obj.fDampStep; | |
cd12341d | 528 | fTPCTOFboundry = obj.fTPCTOFboundry; |
529 | fTOFboundry = obj.fTOFboundry; | |
530 | fSigmaCutTPC = obj.fSigmaCutTPC; | |
531 | fSigmaCutTOF = obj.fSigmaCutTOF; | |
654866df | 532 | fMinSepPair = obj.fMinSepPair; |
cd12341d | 533 | fShareQuality = obj.fShareQuality; |
534 | fShareFraction = obj.fShareFraction; | |
535 | fTrueMassP = obj.fTrueMassP; | |
536 | fTrueMassPi = obj.fTrueMassPi; | |
537 | fTrueMassK = obj.fTrueMassK; | |
538 | fTrueMassKs = obj.fTrueMassKs; | |
539 | fTrueMassLam = obj.fTrueMassLam; | |
f5df8b1d | 540 | fKtIndexL = obj.fKtIndexL; |
541 | fKtIndexH = obj.fKtIndexH; | |
542 | fQoIndexL = obj.fQoIndexL; | |
543 | fQoIndexH = obj.fQoIndexH; | |
544 | fQsIndexL = obj.fQsIndexL; | |
545 | fQsIndexH = obj.fQsIndexH; | |
546 | fQlIndexL = obj.fQlIndexL; | |
547 | fQlIndexH = obj.fQlIndexH; | |
cd12341d | 548 | fDummyB = obj.fDummyB; |
edc35fd5 | 549 | fMomResC2 = obj.fMomResC2; |
550 | ||
551 | for(Int_t i=0; i<2; i++){ | |
552 | fFSI2SS[i]=obj.fFSI2SS[i]; | |
553 | fFSI2OS[i]=obj.fFSI2OS[i]; | |
554 | } | |
555 | for(Int_t i=0; i<6; i++){ | |
556 | fFSIOmega0SS[i]=obj.fFSIOmega0SS[i]; | |
557 | fFSIOmega0OS[i]=obj.fFSIOmega0OS[i]; | |
558 | } | |
f5df8b1d | 559 | for(Int_t i=0; i<3; i++){// Kt iterator |
560 | for(Int_t j=0; j<10; j++){// Mbin iterator | |
561 | fNormWeight[i][j]=obj.fNormWeight[i][j]; | |
edc35fd5 | 562 | } |
563 | } | |
f5df8b1d | 564 | |
cd12341d | 565 | return (*this); |
566 | } | |
567 | //________________________________________________________________________ | |
568 | AliChaoticity::~AliChaoticity() | |
569 | { | |
570 | // Destructor | |
571 | if(fAOD) delete fAOD; | |
b6e5ec54 | 572 | //if(fESD) delete fESD; |
cd12341d | 573 | if(fOutputList) delete fOutputList; |
574 | if(fPIDResponse) delete fPIDResponse; | |
575 | if(fEC) delete fEC; | |
576 | if(fEvt) delete fEvt; | |
68b2d0b9 | 577 | if(fTempStruct) delete [] fTempStruct; |
cd12341d | 578 | if(fRandomNumber) delete fRandomNumber; |
5e3e77d6 | 579 | if(fMomResC2) delete fMomResC2; |
ef23297f | 580 | |
5e3e77d6 | 581 | |
edc35fd5 | 582 | for(Int_t i=0; i<fMultLimit; i++){ |
68b2d0b9 | 583 | if(fPairLocationSE[i]) delete [] fPairLocationSE[i]; |
584 | if(fPairLocationME[i]) delete [] fPairLocationME[i]; | |
edc35fd5 | 585 | for(Int_t j=0; j<2; j++){ |
68b2d0b9 | 586 | if(fOtherPairLocation1[j][i]) delete [] fOtherPairLocation1[j][i]; |
587 | if(fOtherPairLocation2[j][i]) delete [] fOtherPairLocation2[j][i]; | |
588 | } | |
edc35fd5 | 589 | for(Int_t j=0; j<3; j++) if(fNormPairSwitch[j][i]) delete [] fNormPairSwitch[j][i]; |
590 | for(Int_t j=0; j<4; j++) if(fPairSplitCut[j][i]) delete [] fPairSplitCut[j][i]; | |
68b2d0b9 | 591 | } |
edc35fd5 | 592 | for(Int_t i=0; i<kPairLimit; i++) if(fTripletSkip1[i]) delete [] fTripletSkip1[i]; |
593 | for(Int_t i=0; i<2*kPairLimit; i++) if(fTripletSkip2[i]) delete [] fTripletSkip2[i]; | |
594 | for(Int_t i=0; i<3; i++) if(fNormPairs[i]) delete [] fNormPairs[i]; | |
cd12341d | 595 | // |
596 | for(Int_t mb=0; mb<fMbins; mb++){ | |
654866df | 597 | for(Int_t edB=0; edB<fEDbins; edB++){ |
cd12341d | 598 | for(Int_t c1=0; c1<2; c1++){ |
599 | for(Int_t c2=0; c2<2; c2++){ | |
600 | for(Int_t sc=0; sc<kSCLimit2; sc++){ | |
601 | for(Int_t term=0; term<2; term++){ | |
602 | ||
603 | if(Charge1[c1].Charge2[c2].SC[sc].MB[mb].EDB[edB].TwoPT[term].fExplicit2) delete Charge1[c1].Charge2[c2].SC[sc].MB[mb].EDB[edB].TwoPT[term].fExplicit2; | |
604 | ||
605 | if(Charge1[c1].Charge2[c2].SC[sc].MB[mb].EDB[edB].TwoPT[term].fIdeal) delete Charge1[c1].Charge2[c2].SC[sc].MB[mb].EDB[edB].TwoPT[term].fIdeal; | |
606 | if(Charge1[c1].Charge2[c2].SC[sc].MB[mb].EDB[edB].TwoPT[term].fSmeared) delete Charge1[c1].Charge2[c2].SC[sc].MB[mb].EDB[edB].TwoPT[term].fSmeared; | |
607 | if(Charge1[c1].Charge2[c2].SC[sc].MB[mb].EDB[edB].TwoPT[term].OSL_ktbin[0].fExplicit2OSL) delete Charge1[c1].Charge2[c2].SC[sc].MB[mb].EDB[edB].TwoPT[term].OSL_ktbin[0].fExplicit2OSL; | |
608 | if(Charge1[c1].Charge2[c2].SC[sc].MB[mb].EDB[edB].TwoPT[term].OSL_ktbin[0].fExplicit2OSLQW) delete Charge1[c1].Charge2[c2].SC[sc].MB[mb].EDB[edB].TwoPT[term].OSL_ktbin[0].fExplicit2OSLQW; | |
609 | if(Charge1[c1].Charge2[c2].SC[sc].MB[mb].EDB[edB].TwoPT[term].OSL_ktbin[1].fExplicit2OSL) delete Charge1[c1].Charge2[c2].SC[sc].MB[mb].EDB[edB].TwoPT[term].OSL_ktbin[1].fExplicit2OSL; | |
610 | if(Charge1[c1].Charge2[c2].SC[sc].MB[mb].EDB[edB].TwoPT[term].OSL_ktbin[1].fExplicit2OSLQW) delete Charge1[c1].Charge2[c2].SC[sc].MB[mb].EDB[edB].TwoPT[term].OSL_ktbin[1].fExplicit2OSLQW; | |
fa109294 | 611 | // |
612 | if(Charge1[c1].Charge2[c2].SC[sc].MB[mb].EDB[edB].TwoPT[term].fMCqinv) delete Charge1[c1].Charge2[c2].SC[sc].MB[mb].EDB[edB].TwoPT[term].fMCqinv; | |
613 | if(Charge1[c1].Charge2[c2].SC[sc].MB[mb].EDB[edB].TwoPT[term].fMCqinvQW) delete Charge1[c1].Charge2[c2].SC[sc].MB[mb].EDB[edB].TwoPT[term].fMCqinvQW; | |
cd12341d | 614 | }// term_2 |
615 | }// SC_2 | |
616 | ||
617 | for(Int_t c3=0; c3<2; c3++){ | |
618 | for(Int_t sc=0; sc<kSCLimit3; sc++){ | |
619 | for(Int_t term=0; term<5; term++){ | |
620 | ||
621 | if(Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].fExplicit3) delete Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].fExplicit3; | |
622 | if(Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].fNormEx3) delete Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].fNormEx3; | |
623 | if(Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].fNorm3) delete Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].fNorm3; | |
624 | if(Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].fTerms3) delete Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].fTerms3; | |
90814457 | 625 | if(Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].f4VectProd1Terms) delete Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].f4VectProd1Terms; |
626 | if(Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].f4VectProd2Terms) delete Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].f4VectProd2Terms; | |
627 | if(Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].f4VectProd1TermsIdeal) delete Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].f4VectProd1TermsIdeal; | |
628 | if(Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].f4VectProd2TermsIdeal) delete Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].f4VectProd2TermsIdeal; | |
629 | if(Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].f4VectProd1TermsSmeared) delete Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].f4VectProd1TermsSmeared; | |
630 | if(Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].f4VectProd2TermsSmeared) delete Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].f4VectProd2TermsSmeared; | |
0e58bc53 | 631 | if(Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].f4VectProd1Q3W) delete Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].f4VectProd1Q3W; |
632 | if(Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].f4VectProd2Q3W) delete Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].f4VectProd2Q3W; | |
fa109294 | 633 | // |
90814457 | 634 | if(Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].f4VectProd1TermsSumK3) delete Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].f4VectProd1TermsSumK3; |
635 | if(Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].f4VectProd2TermsSumK3) delete Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].f4VectProd2TermsSumK3; | |
636 | if(Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].f4VectProd1TermsEnK3) delete Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].f4VectProd1TermsEnK3; | |
637 | if(Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].f4VectProd2TermsEnK3) delete Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].f4VectProd2TermsEnK3; | |
638 | // | |
639 | if(Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].f4VectProd1TermsSumK2) delete Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].f4VectProd1TermsSumK2; | |
640 | if(Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].f4VectProd2TermsSumK2) delete Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].f4VectProd2TermsSumK2; | |
641 | if(Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].f4VectProd1TermsEnK2) delete Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].f4VectProd1TermsEnK2; | |
642 | if(Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].f4VectProd2TermsEnK2) delete Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].f4VectProd2TermsEnK2; | |
643 | ||
fa109294 | 644 | // |
cd12341d | 645 | for(Int_t dt=0; dt<kDENtypes; dt++){ |
646 | if(Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].DT[dt].fTwoPartNorm) delete Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].DT[dt].fTwoPartNorm; | |
fa109294 | 647 | if(Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].DT[dt].f4VectProd1TwoPartNorm) delete Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].DT[dt].f4VectProd1TwoPartNorm; |
648 | if(Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].DT[dt].f4VectProd2TwoPartNorm) delete Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].DT[dt].f4VectProd2TwoPartNorm; | |
90814457 | 649 | if(Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].DT[dt].f4VectProd1TwoPartNormIdeal) delete Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].DT[dt].f4VectProd1TwoPartNormIdeal; |
650 | if(Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].DT[dt].f4VectProd2TwoPartNormIdeal) delete Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].DT[dt].f4VectProd2TwoPartNormIdeal; | |
651 | if(Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].DT[dt].f4VectProd1TwoPartNormSmeared) delete Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].DT[dt].f4VectProd1TwoPartNormSmeared; | |
652 | if(Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].DT[dt].f4VectProd2TwoPartNormIdeal) delete Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].DT[dt].f4VectProd2TwoPartNormSmeared; | |
653 | ||
cd12341d | 654 | }//dt |
655 | ||
656 | }// term_3 | |
657 | }// SC_3 | |
658 | }//c3 | |
659 | }//c2 | |
660 | }//c1 | |
654866df | 661 | for(Int_t tKbin=0; tKbin<fKbinsT; tKbin++){ |
662 | for(Int_t yKbin=0; yKbin<fKbinsY; yKbin++){ | |
cd12341d | 663 | if(KT[tKbin].KY[yKbin].MB[mb].EDB[edB].TwoPT[0].fExplicit2ThreeD) delete KT[tKbin].KY[yKbin].MB[mb].EDB[edB].TwoPT[0].fExplicit2ThreeD; |
664 | if(KT[tKbin].KY[yKbin].MB[mb].EDB[edB].TwoPT[1].fExplicit2ThreeD) delete KT[tKbin].KY[yKbin].MB[mb].EDB[edB].TwoPT[1].fExplicit2ThreeD; | |
665 | } | |
666 | } | |
667 | ||
668 | }// ED | |
669 | }// Mbin | |
edc35fd5 | 670 | |
671 | if(fMomResC2) delete fMomResC2; | |
672 | ||
673 | for(Int_t i=0; i<2; i++){ | |
674 | if(fFSI2SS[i]) delete fFSI2SS[i]; | |
675 | if(fFSI2OS[i]) delete fFSI2OS[i]; | |
676 | } | |
677 | for(Int_t i=0; i<6; i++){ | |
678 | if(fFSIOmega0SS[i]) delete fFSIOmega0SS[i]; | |
679 | if(fFSIOmega0OS[i]) delete fFSIOmega0OS[i]; | |
680 | } | |
f5df8b1d | 681 | for(Int_t i=0; i<3; i++){// Kt iterator |
682 | for(Int_t j=0; j<10; j++){// Mbin iterator | |
683 | if(fNormWeight[i][j]) delete fNormWeight[i][j]; | |
684 | } | |
685 | } | |
686 | ||
cd12341d | 687 | } |
688 | //________________________________________________________________________ | |
689 | void AliChaoticity::ParInit() | |
690 | { | |
691 | cout<<"AliChaoticity MyInit() call"<<endl; | |
5fc49f8c | 692 | cout<<"lego:"<<fLEGO<<" MCcase:"<<fMCcase<<" PbPbcase:"<<fPbPbcase<<" TabulatePairs:"<<fTabulatePairs<<" GenSignal:"<<fGenerateSignal<<" CentLow:"<<fCentBinLowLimit<<" CentHigh:"<<fCentBinHighLimit<<" RBinMax:"<<fRBinMax<<" LambdaBinMomRes:"<<fFixedLambdaBinMomRes<<" LambdaBinr3:"<<fFixedLambdaBinr3<<" FB:"<<fFilterBit<<" MinPairSep:"<<fMinSepPair<<" NsigTPC:"<<fSigmaCutTPC<<" NsigTOF:"<<fSigmaCutTOF<<endl; |
140107fb | 693 | |
cd12341d | 694 | fRandomNumber = new TRandom3(); |
695 | fRandomNumber->SetSeed(0); | |
cd12341d | 696 | |
697 | // | |
698 | fEventCounter=0; | |
699 | if(fPdensityExplicitLoop) fEventsToMix=3; | |
700 | else if(fPdensityPairCut && !fPdensityExplicitLoop) fEventsToMix=2; | |
701 | else fEventsToMix=0; | |
702 | fZvertexBins=2;//2 | |
703 | ||
704 | fTPCTOFboundry = 0.6;// TPC pid used below this momentum, TOF above but below TOF_boundry | |
705 | fTOFboundry = 2.1;// TOF pid used below this momentum | |
cd12341d | 706 | |
707 | //////////////////////////////////////////////// | |
654866df | 708 | // PadRow Pair Cuts |
cd12341d | 709 | fShareQuality = .5;// max |
710 | fShareFraction = .05;// max | |
711 | //////////////////////////////////////////////// | |
5e3e77d6 | 712 | |
cd12341d | 713 | |
714 | fMultLimits[0]=0, fMultLimits[1]=2, fMultLimits[2]=4, fMultLimits[3]=6, fMultLimits[4]=8, fMultLimits[5]=10; | |
715 | fMultLimits[6]=12, fMultLimits[7]=14, fMultLimits[8]=16, fMultLimits[9]=18, fMultLimits[10]=20, fMultLimits[11]=150; | |
716 | ||
717 | ||
90814457 | 718 | |
cd12341d | 719 | if(fPbPbcase) {// PbPb |
720 | fMultLimit=kMultLimitPbPb; | |
654866df | 721 | fMbins=fCentBins; |
140107fb | 722 | fQcut[0]=0.1;//pi-pi, pi-k, pi-p |
723 | fQcut[1]=0.1;//k-k | |
724 | fQcut[2]=0.6;//the rest | |
725 | fNormQcutLow[0] = 0.15;//0.15 | |
726 | fNormQcutHigh[0] = 0.175;//0.175 | |
cd12341d | 727 | fNormQcutLow[1] = 1.34;//1.34 |
728 | fNormQcutHigh[1] = 1.4;//1.4 | |
729 | fNormQcutLow[2] = 1.1;//1.1 | |
730 | fNormQcutHigh[2] = 1.4;//1.4 | |
731 | } | |
732 | else {// pp | |
733 | fMultLimit=kMultLimitpp; | |
734 | fMbins=kMultBinspp; | |
735 | fQcut[0]=0.6; | |
736 | fQcut[1]=0.6; | |
737 | fQcut[2]=0.6; | |
738 | fNormQcutLow[0] = 1.0; | |
739 | fNormQcutHigh[0] = 1.5; | |
740 | fNormQcutLow[1] = 1.0; | |
741 | fNormQcutHigh[1] = 1.5; | |
742 | fNormQcutLow[2] = 1.0; | |
743 | fNormQcutHigh[2] = 1.5; | |
744 | } | |
745 | ||
90814457 | 746 | fQLowerCut = 0.005;// was 0.005 |
cd12341d | 747 | fKupperBound = 1.0; |
748 | // | |
140107fb | 749 | fKstepY[0] = 1.6; |
cd12341d | 750 | fKmeanY[0] = 0;// central y |
cd12341d | 751 | fKmiddleY[0] = 0; |
140107fb | 752 | |
753 | // 4x1 (Kt: 0-0.25, 0.25-0.35, 0.35-0.45, 0.45-1.0) | |
754 | if(fKbinsT==4){ | |
755 | fKstepT[0] = 0.25; fKstepT[1] = 0.1; fKstepT[2] = 0.1; fKstepT[3] = 0.55; | |
756 | fKmeanT[0] = 0.212; fKmeanT[1] = 0.299; fKmeanT[2] = 0.398; fKmeanT[3] = 0.576; | |
757 | fKmiddleT[0] = 0.125; fKmiddleT[1] = 0.3; fKmiddleT[2] = 0.4; fKmiddleT[3] = 0.725; | |
758 | } | |
759 | // 3x1 (Kt: 0-0.3, 0.3-0.45, 0.45-1.0) | |
760 | if(fKbinsT==3){ | |
761 | fKstepT[0] = 0.3; fKstepT[1] = 0.15; fKstepT[2] = 0.55; | |
762 | fKmeanT[0] = 0.240; fKmeanT[1] = 0.369; fKmeanT[2] = 0.576; | |
763 | fKmiddleT[0] = 0.15; fKmiddleT[1] = 0.375; fKmiddleT[2] = 0.725; | |
764 | } | |
765 | // 2x1 (Kt: 0-0.35, 0.35-1.0) | |
766 | if(fKbinsT==2){ | |
767 | fKstepT[0] = 0.35; fKstepT[1] = 0.65; | |
768 | fKmeanT[0] = 0.264; fKmeanT[1] = 0.500; | |
769 | fKmiddleT[0] = 0.175; fKmiddleT[1] = 0.675; | |
770 | } | |
771 | ||
cd12341d | 772 | // |
773 | fQupperBoundWeights = 0.2; | |
774 | fQupperBound = 0.1; | |
5e3e77d6 | 775 | fQstep = fQupperBound/Float_t(kQbins); |
776 | fQstepWeights = fQupperBoundWeights/Float_t(kQbinsWeights); | |
777 | for(Int_t i=0; i<kQbinsWeights; i++) {fQmean[i]=(i+0.5)*fQstepWeights;} | |
cd12341d | 778 | // |
779 | fDampStart = 0.3; | |
780 | fDampStep = 0.02; | |
781 | ||
f9a5e67a | 782 | // |
783 | ||
cd12341d | 784 | |
785 | fEC = new AliChaoticityEventCollection **[fZvertexBins]; | |
786 | for(UShort_t i=0; i<fZvertexBins; i++){ | |
787 | ||
788 | fEC[i] = new AliChaoticityEventCollection *[fMbins]; | |
789 | ||
790 | for(UShort_t j=0; j<fMbins; j++){ | |
791 | ||
6e805184 | 792 | fEC[i][j] = new AliChaoticityEventCollection(fEventsToMix+1, fMultLimit, kPairLimit, kMCarrayLimit, fMCcase); |
cd12341d | 793 | } |
794 | } | |
795 | ||
796 | ||
797 | for(Int_t i=0; i<fMultLimit; i++) fDefaultsCharMult[i]='0'; | |
798 | for(Int_t i=0; i<kPairLimit; i++) fDefaultsCharSE[i]='0'; | |
799 | for(Int_t i=0; i<2*kPairLimit; i++) fDefaultsCharME[i]='0'; | |
800 | for(Int_t i=0; i<fMultLimit; i++) fDefaultsInt[i]=-1; | |
801 | for(Int_t i=0; i<fMultLimit; i++) fPairLocationSE[i] = new TArrayI(fMultLimit,fDefaultsInt); | |
802 | for(Int_t i=0; i<fMultLimit; i++) fPairLocationME[i] = new TArrayI(fMultLimit,fDefaultsInt); | |
803 | for(Int_t i=0; i<kPairLimit; i++) fTripletSkip1[i] = new TArrayC(fMultLimit,fDefaultsCharSE); | |
804 | for(Int_t i=0; i<2*kPairLimit; i++) fTripletSkip2[i] = new TArrayC(fMultLimit,fDefaultsCharME); | |
805 | ||
806 | ||
807 | // Normalization utilities | |
808 | for(Int_t i=0; i<fMultLimit; i++) fOtherPairLocation1[0][i] = new TArrayI(fMultLimit,fDefaultsInt); | |
809 | for(Int_t i=0; i<fMultLimit; i++) fOtherPairLocation1[1][i] = new TArrayI(fMultLimit,fDefaultsInt); | |
810 | for(Int_t i=0; i<fMultLimit; i++) fOtherPairLocation2[0][i] = new TArrayI(fMultLimit,fDefaultsInt); | |
811 | for(Int_t i=0; i<fMultLimit; i++) fOtherPairLocation2[1][i] = new TArrayI(fMultLimit,fDefaultsInt); | |
812 | for(Int_t i=0; i<fMultLimit; i++) fNormPairSwitch[0][i] = new TArrayC(fMultLimit,fDefaultsCharMult); | |
813 | for(Int_t i=0; i<fMultLimit; i++) fNormPairSwitch[1][i] = new TArrayC(fMultLimit,fDefaultsCharMult); | |
814 | for(Int_t i=0; i<fMultLimit; i++) fNormPairSwitch[2][i] = new TArrayC(fMultLimit,fDefaultsCharMult); | |
815 | ||
816 | // Track Merging/Splitting utilities | |
817 | for(Int_t i=0; i<fMultLimit; i++) fPairSplitCut[0][i] = new TArrayC(fMultLimit,fDefaultsCharMult);// P11 | |
818 | for(Int_t i=0; i<fMultLimit; i++) fPairSplitCut[1][i] = new TArrayC(fMultLimit,fDefaultsCharMult);// P12 | |
819 | for(Int_t i=0; i<fMultLimit; i++) fPairSplitCut[2][i] = new TArrayC(fMultLimit,fDefaultsCharMult);// P13 | |
820 | for(Int_t i=0; i<fMultLimit; i++) fPairSplitCut[3][i] = new TArrayC(fMultLimit,fDefaultsCharMult);// P23 | |
821 | ||
822 | ||
823 | fNormPairs[0] = new AliChaoticityNormPairStruct[kNormPairLimit]; | |
824 | fNormPairs[1] = new AliChaoticityNormPairStruct[kNormPairLimit]; | |
825 | ||
826 | ||
827 | fTempStruct = new AliChaoticityTrackStruct[fMultLimit]; | |
828 | ||
829 | ||
830 | fTrueMassP=0.93827, fTrueMassPi=0.13957, fTrueMassK=0.493677, fTrueMassKs=0.497614, fTrueMassLam=1.11568; | |
831 | ||
832 | ||
cd12341d | 833 | |
834 | // Set weights, Coulomb corrections, and Momentum resolution corrections manually if not on LEGO | |
90814457 | 835 | if(!fLEGO) { |
5e3e77d6 | 836 | SetFSICorrelations(fLEGO);// Read in 2-particle and 3-particle FSI correlations |
90814457 | 837 | if(!fTabulatePairs) SetWeightArrays(fLEGO);// Set Weight Array |
140107fb | 838 | if(!fMCcase && !fTabulatePairs) SetMomResCorrections(fLEGO);// Read Momentum resolution file |
839 | //if(!fTabulatePairs) SetMomResCorrections(fLEGO);// Read Momentum resolution file | |
cd12341d | 840 | } |
90814457 | 841 | |
842 | ///////////////////////////////////////////// | |
140107fb | 843 | ///////////////////////////////////////////// |
90814457 | 844 | |
cd12341d | 845 | } |
846 | //________________________________________________________________________ | |
847 | void AliChaoticity::UserCreateOutputObjects() | |
848 | { | |
849 | // Create histograms | |
850 | // Called once | |
851 | ||
852 | ParInit();// Initialize my settings | |
5e3e77d6 | 853 | |
cd12341d | 854 | |
855 | fOutputList = new TList(); | |
856 | fOutputList->SetOwner(); | |
857 | ||
858 | TH3F *fVertexDist = new TH3F("fVertexDist","Vertex Distribution",20,-1,1, 20,-1,1, 600,-30,30); | |
859 | fVertexDist->GetXaxis()->SetTitle("X Vertex (cm)"); | |
860 | fVertexDist->GetYaxis()->SetTitle("Y Vertex (cm)"); | |
861 | fVertexDist->GetZaxis()->SetTitle("Z Vertex (cm)"); | |
862 | fOutputList->Add(fVertexDist); | |
863 | ||
864 | ||
865 | TH2F *fDCAxyDistPlus = new TH2F("fDCAxyDistPlus","DCA distribution",300,0,3., 50,0,5); | |
866 | fOutputList->Add(fDCAxyDistPlus); | |
867 | TH2F *fDCAzDistPlus = new TH2F("fDCAzDistPlus","DCA distribution",300,0,3., 50,0,5); | |
868 | fOutputList->Add(fDCAzDistPlus); | |
869 | TH2F *fDCAxyDistMinus = new TH2F("fDCAxyDistMinus","DCA distribution",300,0,3., 50,0,5); | |
870 | fOutputList->Add(fDCAxyDistMinus); | |
871 | TH2F *fDCAzDistMinus = new TH2F("fDCAzDistMinus","DCA distribution",300,0,3., 50,0,5); | |
872 | fOutputList->Add(fDCAzDistMinus); | |
873 | ||
874 | ||
875 | TH1F *fEvents1 = new TH1F("fEvents1","Events vs. fMbin",fMbins,.5,fMbins+.5); | |
876 | fOutputList->Add(fEvents1); | |
877 | TH1F *fEvents2 = new TH1F("fEvents2","Events vs. fMbin",fMbins,.5,fMbins+.5); | |
878 | fOutputList->Add(fEvents2); | |
879 | ||
880 | TH1F *fMultDist1 = new TH1F("fMultDist1","Multiplicity Distribution",fMultLimit,-.5,fMultLimit-.5); | |
881 | fMultDist1->GetXaxis()->SetTitle("Multiplicity"); | |
882 | fOutputList->Add(fMultDist1); | |
883 | ||
884 | TH1F *fMultDist2 = new TH1F("fMultDist2","Multiplicity Distribution",fMultLimit,-.5,fMultLimit-.5); | |
885 | fMultDist2->GetXaxis()->SetTitle("Multiplicity"); | |
886 | fOutputList->Add(fMultDist2); | |
887 | ||
888 | TH1F *fMultDist3 = new TH1F("fMultDist3","Multiplicity Distribution",fMultLimit,-.5,fMultLimit-.5); | |
889 | fMultDist3->GetXaxis()->SetTitle("Multiplicity"); | |
890 | fOutputList->Add(fMultDist3); | |
891 | ||
892 | TH3F *fPtEtaDist = new TH3F("fPtEtaDist","fPtEtaDist",2,-1.1,1.1, 300,0,3., 28,-1.4,1.4); | |
893 | fOutputList->Add(fPtEtaDist); | |
894 | ||
895 | TH3F *fPhiPtDist = new TH3F("fPhiPtDist","fPhiPtDist",2,-1.1,1.1, 120,0,2*PI, 300,0,3.); | |
896 | fOutputList->Add(fPhiPtDist); | |
897 | ||
898 | TH3F *fTOFResponse = new TH3F("fTOFResponse","TOF relative time",20,0,100, 200,0,2, 4000,-20000,20000); | |
899 | fOutputList->Add(fTOFResponse); | |
900 | TH3F *fTPCResponse = new TH3F("fTPCResponse","TPCsignal",20,0,100, 200,0,2, 1000,0,1000); | |
901 | fOutputList->Add(fTPCResponse); | |
902 | ||
903 | TH1F *fRejectedPairs = new TH1F("fRejectedPairs","",200,0,2); | |
904 | fOutputList->Add(fRejectedPairs); | |
905 | TH1I *fRejectedEvents = new TH1I("fRejectedEvents","",fMbins,0.5,fMbins+.5); | |
906 | fOutputList->Add(fRejectedEvents); | |
907 | ||
908 | TH3F *fPairsDetaDPhiNum = new TH3F("fPairsDetaDPhiNum","",10,-.5,9.5, 200,-0.2,0.2, 600,-0.3,0.3); | |
909 | if(fMCcase) fOutputList->Add(fPairsDetaDPhiNum); | |
910 | TH3F *fPairsDetaDPhiDen = new TH3F("fPairsDetaDPhiDen","",10,-.5,9.5, 200,-0.2,0.2, 600,-0.3,0.3); | |
911 | if(fMCcase) fOutputList->Add(fPairsDetaDPhiDen); | |
912 | ||
913 | TH2D *fResonanceOSPairs = new TH2D("fResonanceOSPairs","",fMbins,.5,fMbins+.5, 1000,0,2); | |
914 | if(fMCcase) fOutputList->Add(fResonanceOSPairs); | |
915 | TH2D *fAllOSPairs = new TH2D("fAllOSPairs","",fMbins,.5,fMbins+.5, 1000,0,2); | |
916 | if(fMCcase) fOutputList->Add(fAllOSPairs); | |
917 | ||
918 | TProfile *fAvgMult = new TProfile("fAvgMult","",fMbins,.5,fMbins+.5, 0,1500,""); | |
919 | fOutputList->Add(fAvgMult); | |
920 | ||
5e027bd6 | 921 | TH3D *fTPNRejects1 = new TH3D("fTPNRejects1","",kQbins,0,fQupperBound, kQbins,0,fQupperBound, kQbins,0,fQupperBound); |
922 | fOutputList->Add(fTPNRejects1); | |
923 | TH3D *fTPNRejects2 = new TH3D("fTPNRejects2","",kQbins,0,fQupperBound, kQbins,0,fQupperBound, kQbins,0,fQupperBound); | |
924 | fOutputList->Add(fTPNRejects2); | |
925 | TH3D *fTPNRejects3 = new TH3D("fTPNRejects3","",kQbins,0,fQupperBound, kQbins,0,fQupperBound, kQbins,0,fQupperBound); | |
926 | fOutputList->Add(fTPNRejects3); | |
927 | TH3D *fTPNRejects4 = new TH3D("fTPNRejects4","",kQbins,0,fQupperBound, kQbins,0,fQupperBound, kQbins,0,fQupperBound); | |
928 | fOutputList->Add(fTPNRejects4); | |
929 | TH3D *fTPNRejects5 = new TH3D("fTPNRejects5","",kQbins,0,fQupperBound, kQbins,0,fQupperBound, kQbins,0,fQupperBound); | |
930 | fOutputList->Add(fTPNRejects5); | |
931 | ||
cd12341d | 932 | |
140107fb | 933 | TH3D *fKt3DistTerm1 = new TH3D("fKt3DistTerm1","",fMbins,.5,fMbins+.5, 20,0,1, 20,0,0.2); |
934 | TH3D *fKt3DistTerm5 = new TH3D("fKt3DistTerm5","",fMbins,.5,fMbins+.5, 20,0,1, 20,0,0.2); | |
935 | fOutputList->Add(fKt3DistTerm1); | |
936 | fOutputList->Add(fKt3DistTerm5); | |
cd12341d | 937 | |
938 | ||
cd12341d | 939 | if(fPdensityExplicitLoop || fPdensityPairCut){ |
940 | ||
941 | for(Int_t mb=0; mb<fMbins; mb++){ | |
942 | if((mb < fCentBinLowLimit) || (mb > fCentBinHighLimit)) continue; | |
943 | ||
654866df | 944 | for(Int_t edB=0; edB<fEDbins; edB++){ |
cd12341d | 945 | for(Int_t c1=0; c1<2; c1++){ |
946 | for(Int_t c2=0; c2<2; c2++){ | |
947 | for(Int_t sc=0; sc<kSCLimit2; sc++){ | |
948 | for(Int_t term=0; term<2; term++){ | |
949 | ||
950 | TString *nameEx2 = new TString("Explicit2_Charge1_"); | |
951 | *nameEx2 += c1; | |
952 | nameEx2->Append("_Charge2_"); | |
953 | *nameEx2 += c2; | |
954 | nameEx2->Append("_SC_"); | |
955 | *nameEx2 += sc; | |
956 | nameEx2->Append("_M_"); | |
957 | *nameEx2 += mb; | |
958 | nameEx2->Append("_ED_"); | |
959 | *nameEx2 += edB; | |
960 | nameEx2->Append("_Term_"); | |
961 | *nameEx2 += term+1; | |
962 | ||
963 | if(sc==0 || sc==3 || sc==5){ | |
964 | if( (c1+c2)==1 ) {if(c1!=0) continue;}// skip degenerate histogram | |
965 | } | |
966 | ||
967 | Charge1[c1].Charge2[c2].SC[sc].MB[mb].EDB[edB].TwoPT[term].fExplicit2 = new TH2D(nameEx2->Data(),"Two Particle Distribution",20,0,1, 400,0,2); | |
968 | fOutputList->Add(Charge1[c1].Charge2[c2].SC[sc].MB[mb].EDB[edB].TwoPT[term].fExplicit2); | |
5e3e77d6 | 969 | TString *nameEx2QW=new TString(nameEx2->Data()); |
970 | nameEx2QW->Append("_QW"); | |
971 | Charge1[c1].Charge2[c2].SC[sc].MB[mb].EDB[edB].TwoPT[term].fExplicit2QW = new TH2D(nameEx2QW->Data(),"Two Particle Distribution",20,0,1, 400,0,2); | |
972 | fOutputList->Add(Charge1[c1].Charge2[c2].SC[sc].MB[mb].EDB[edB].TwoPT[term].fExplicit2QW); | |
704f2481 | 973 | TString *nameAvgP=new TString(nameEx2->Data()); |
974 | nameAvgP->Append("_AvgP"); | |
975 | Charge1[c1].Charge2[c2].SC[sc].MB[mb].EDB[edB].TwoPT[term].fAvgP = new TProfile2D(nameAvgP->Data(),"",10,0,1, 400,0,2, 0.,1.0,""); | |
976 | fOutputList->Add(Charge1[c1].Charge2[c2].SC[sc].MB[mb].EDB[edB].TwoPT[term].fAvgP); | |
977 | ||
cd12341d | 978 | // Momentum resolution histos |
979 | if(fMCcase && sc==0){ | |
980 | TString *nameIdeal = new TString(nameEx2->Data()); | |
981 | nameIdeal->Append("_Ideal"); | |
654866df | 982 | Charge1[c1].Charge2[c2].SC[sc].MB[mb].EDB[edB].TwoPT[term].fIdeal = new TH2D(nameIdeal->Data(),"Two Particle Distribution",fRVALUES*kNDampValues,-0.5,fRVALUES*kNDampValues-0.5, kQbinsWeights,0,fQupperBoundWeights); |
cd12341d | 983 | fOutputList->Add(Charge1[c1].Charge2[c2].SC[sc].MB[mb].EDB[edB].TwoPT[term].fIdeal); |
984 | TString *nameSmeared = new TString(nameEx2->Data()); | |
985 | nameSmeared->Append("_Smeared"); | |
654866df | 986 | Charge1[c1].Charge2[c2].SC[sc].MB[mb].EDB[edB].TwoPT[term].fSmeared = new TH2D(nameSmeared->Data(),"Two Particle Distribution",fRVALUES*kNDampValues,-0.5,fRVALUES*kNDampValues-0.5, kQbinsWeights,0,fQupperBoundWeights); |
cd12341d | 987 | fOutputList->Add(Charge1[c1].Charge2[c2].SC[sc].MB[mb].EDB[edB].TwoPT[term].fSmeared); |
fa109294 | 988 | // |
989 | TString *nameEx2MC=new TString(nameEx2->Data()); | |
990 | nameEx2MC->Append("_MCqinv"); | |
991 | Charge1[c1].Charge2[c2].SC[sc].MB[mb].EDB[edB].TwoPT[term].fMCqinv = new TH1D(nameEx2MC->Data(),"",400,0,2); | |
992 | fOutputList->Add(Charge1[c1].Charge2[c2].SC[sc].MB[mb].EDB[edB].TwoPT[term].fMCqinv); | |
993 | TString *nameEx2MCQW=new TString(nameEx2->Data()); | |
994 | nameEx2MCQW->Append("_MCqinvQW"); | |
995 | Charge1[c1].Charge2[c2].SC[sc].MB[mb].EDB[edB].TwoPT[term].fMCqinvQW = new TH1D(nameEx2MCQW->Data(),"",400,0,2); | |
996 | fOutputList->Add(Charge1[c1].Charge2[c2].SC[sc].MB[mb].EDB[edB].TwoPT[term].fMCqinvQW); | |
54d66278 | 997 | // |
998 | TString *nameEx2PIDpurityDen=new TString(nameEx2->Data()); | |
999 | nameEx2PIDpurityDen->Append("_PIDpurityDen"); | |
1000 | Charge1[c1].Charge2[c2].SC[sc].MB[mb].EDB[edB].TwoPT[term].fPIDpurityDen = new TH2D(nameEx2PIDpurityDen->Data(),"Two Particle Distribution",20,0,1, 400,0,2); | |
1001 | fOutputList->Add(Charge1[c1].Charge2[c2].SC[sc].MB[mb].EDB[edB].TwoPT[term].fPIDpurityDen); | |
1002 | TString *nameEx2PIDpurityNum=new TString(nameEx2->Data()); | |
1003 | nameEx2PIDpurityNum->Append("_PIDpurityNum"); | |
1004 | Charge1[c1].Charge2[c2].SC[sc].MB[mb].EDB[edB].TwoPT[term].fPIDpurityNum = new TH2D(nameEx2PIDpurityNum->Data(),"Two Particle Distribution",20,0,1, 400,0,2); | |
1005 | fOutputList->Add(Charge1[c1].Charge2[c2].SC[sc].MB[mb].EDB[edB].TwoPT[term].fPIDpurityNum); | |
cd12341d | 1006 | } |
fa109294 | 1007 | if(sc==0){ |
cd12341d | 1008 | |
1009 | TString *nameEx2OSLB1 = new TString(nameEx2->Data()); | |
1010 | nameEx2OSLB1->Append("_osl_b1"); | |
fa109294 | 1011 | Charge1[c1].Charge2[c2].SC[sc].MB[mb].EDB[edB].TwoPT[term].OSL_ktbin[0].fExplicit2OSL = new TH3D(nameEx2OSLB1->Data(),"Two Particle Distribution",kQbinsWeights,0,fQupperBoundWeights, kQbinsWeights,0,fQupperBoundWeights, kQbinsWeights,0,fQupperBoundWeights); |
cd12341d | 1012 | fOutputList->Add(Charge1[c1].Charge2[c2].SC[sc].MB[mb].EDB[edB].TwoPT[term].OSL_ktbin[0].fExplicit2OSL); |
1013 | nameEx2OSLB1->Append("_QW"); | |
fa109294 | 1014 | Charge1[c1].Charge2[c2].SC[sc].MB[mb].EDB[edB].TwoPT[term].OSL_ktbin[0].fExplicit2OSLQW = new TH3D(nameEx2OSLB1->Data(),"Two Particle Distribution",kQbinsWeights,0,fQupperBoundWeights, kQbinsWeights,0,fQupperBoundWeights, kQbinsWeights,0,fQupperBoundWeights); |
cd12341d | 1015 | fOutputList->Add(Charge1[c1].Charge2[c2].SC[sc].MB[mb].EDB[edB].TwoPT[term].OSL_ktbin[0].fExplicit2OSLQW); |
1016 | // | |
1017 | TString *nameEx2OSLB2 = new TString(nameEx2->Data()); | |
1018 | nameEx2OSLB2->Append("_osl_b2"); | |
fa109294 | 1019 | Charge1[c1].Charge2[c2].SC[sc].MB[mb].EDB[edB].TwoPT[term].OSL_ktbin[1].fExplicit2OSL = new TH3D(nameEx2OSLB2->Data(),"Two Particle Distribution",kQbinsWeights,0,fQupperBoundWeights, kQbinsWeights,0,fQupperBoundWeights, kQbinsWeights,0,fQupperBoundWeights); |
cd12341d | 1020 | fOutputList->Add(Charge1[c1].Charge2[c2].SC[sc].MB[mb].EDB[edB].TwoPT[term].OSL_ktbin[1].fExplicit2OSL); |
1021 | nameEx2OSLB2->Append("_QW"); | |
fa109294 | 1022 | Charge1[c1].Charge2[c2].SC[sc].MB[mb].EDB[edB].TwoPT[term].OSL_ktbin[1].fExplicit2OSLQW = new TH3D(nameEx2OSLB2->Data(),"Two Particle Distribution",kQbinsWeights,0,fQupperBoundWeights, kQbinsWeights,0,fQupperBoundWeights, kQbinsWeights,0,fQupperBoundWeights); |
cd12341d | 1023 | fOutputList->Add(Charge1[c1].Charge2[c2].SC[sc].MB[mb].EDB[edB].TwoPT[term].OSL_ktbin[1].fExplicit2OSLQW); |
1024 | ||
1025 | } | |
1026 | ||
1027 | }// term_2 | |
1028 | }// SC_2 | |
1029 | ||
1030 | // skip 3-particle if Tabulate6DPairs is true | |
1031 | if(fTabulatePairs) continue; | |
1032 | ||
1033 | for(Int_t c3=0; c3<2; c3++){ | |
1034 | for(Int_t sc=0; sc<kSCLimit3; sc++){ | |
1035 | for(Int_t term=0; term<5; term++){ | |
1036 | TString *nameEx3 = new TString("Explicit3_Charge1_"); | |
1037 | *nameEx3 += c1; | |
1038 | nameEx3->Append("_Charge2_"); | |
1039 | *nameEx3 += c2; | |
1040 | nameEx3->Append("_Charge3_"); | |
1041 | *nameEx3 += c3; | |
1042 | nameEx3->Append("_SC_"); | |
1043 | *nameEx3 += sc; | |
1044 | nameEx3->Append("_M_"); | |
1045 | *nameEx3 += mb; | |
1046 | nameEx3->Append("_ED_"); | |
1047 | *nameEx3 += edB; | |
1048 | nameEx3->Append("_Term_"); | |
1049 | *nameEx3 += term+1; | |
1050 | ||
1051 | TString *namePC3 = new TString("PairCut3_Charge1_"); | |
1052 | *namePC3 += c1; | |
1053 | namePC3->Append("_Charge2_"); | |
1054 | *namePC3 += c2; | |
1055 | namePC3->Append("_Charge3_"); | |
1056 | *namePC3 += c3; | |
1057 | namePC3->Append("_SC_"); | |
1058 | *namePC3 += sc; | |
1059 | namePC3->Append("_M_"); | |
1060 | *namePC3 += mb; | |
1061 | namePC3->Append("_ED_"); | |
1062 | *namePC3 += edB; | |
1063 | namePC3->Append("_Term_"); | |
1064 | *namePC3 += term+1; | |
1065 | ||
1066 | /////////////////////////////////////// | |
1067 | // skip degenerate histograms | |
1068 | if(sc==0 || sc==6 || sc==9){// Identical species | |
1069 | if( (c1+c2+c3)==1) {if(c3!=1) continue;} | |
1070 | if( (c1+c2+c3)==2) {if(c1!=0) continue;} | |
1071 | }else if(sc!=5){ | |
1072 | if( (c1+c2)==1) {if(c1!=0) continue;} | |
1073 | }else {}// do nothing for pi-k-p case | |
1074 | ||
1075 | ///////////////////////////////////////// | |
1076 | ||
654866df | 1077 | |
1078 | ||
cd12341d | 1079 | if(fPdensityExplicitLoop){ |
1080 | Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].fExplicit3 = new TH1D(nameEx3->Data(),"Three Particle Distribution",200,0,2); | |
1081 | fOutputList->Add(Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].fExplicit3); | |
1082 | // | |
1083 | nameEx3->Append("_Norm"); | |
1084 | Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].fNormEx3 = new TH1D(nameEx3->Data(),"Explicit_3 Norm",1,-0.5,0.5); | |
1085 | fOutputList->Add(Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].fNormEx3); | |
1086 | } | |
1087 | if(fPdensityPairCut){ | |
1088 | TString *nameNorm=new TString(namePC3->Data()); | |
1089 | nameNorm->Append("_Norm"); | |
1090 | Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].fNorm3 = new TH1D(nameNorm->Data(),"Norm",1,-0.5,0.5); | |
1091 | fOutputList->Add(Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].fNorm3); | |
1092 | // | |
1093 | if(sc<=2){ | |
1094 | TString *name3DQ=new TString(namePC3->Data()); | |
1095 | name3DQ->Append("_3D"); | |
1096 | Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].fTerms3 = new TH3D(name3DQ->Data(),"", kQbins,0,fQupperBound, kQbins,0,fQupperBound, kQbins,0,fQupperBound); | |
1097 | fOutputList->Add(Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].fTerms3); | |
1098 | // | |
6e805184 | 1099 | |
90814457 | 1100 | const int NEdgesPos=16; |
1101 | double lowEdges4vectPos[NEdgesPos]={0}; | |
1102 | lowEdges4vectPos[0]=0.0; | |
6e805184 | 1103 | lowEdges4vectPos[1]=0.00005;// best resolution at low Q^2 |
90814457 | 1104 | for(int edge=2; edge<NEdgesPos; edge++){ |
1105 | lowEdges4vectPos[edge] = lowEdges4vectPos[edge-1] + lowEdges4vectPos[1]*(edge); | |
1106 | } | |
1107 | const int NEdges=2*NEdgesPos-1; | |
fa109294 | 1108 | double lowEdges4vect[NEdges]={0}; |
90814457 | 1109 | for(int edge=0; edge<NEdges; edge++){ |
1110 | if(edge<NEdgesPos-1) lowEdges4vect[edge] = -lowEdges4vectPos[NEdgesPos-1-edge]; | |
1111 | else if(edge==NEdgesPos-1) lowEdges4vect[edge] = 0; | |
1112 | else lowEdges4vect[edge] = lowEdges4vectPos[edge-NEdgesPos+1]; | |
6e805184 | 1113 | //if(c1==c2 && c1==c3) cout<<lowEdges4vect[edge]<<endl; |
fa109294 | 1114 | } |
6e805184 | 1115 | |
1116 | /* | |
46b217b3 | 1117 | const int NEdgesPos=16; |
1118 | double lowEdges4vectPos[NEdgesPos]={0}; | |
1119 | lowEdges4vectPos[0]=0.0; | |
6e805184 | 1120 | lowEdges4vectPos[1]=0.0002;// was 0.0005, then 0.0002 |
46b217b3 | 1121 | for(int edge=2; edge<NEdgesPos; edge++){ |
1122 | lowEdges4vectPos[edge] = lowEdges4vectPos[edge-1] + lowEdges4vectPos[1]; | |
1123 | } | |
1124 | const int NEdges=2*NEdgesPos-1; | |
1125 | double lowEdges4vect[NEdges]={0}; | |
1126 | for(int edge=0; edge<NEdges; edge++){ | |
1127 | if(edge<NEdgesPos-1) lowEdges4vect[edge] = -lowEdges4vectPos[NEdgesPos-1-edge]; | |
1128 | else if(edge==NEdgesPos-1) lowEdges4vect[edge] = 0; | |
1129 | else lowEdges4vect[edge] = lowEdges4vectPos[edge-NEdgesPos+1]; | |
1130 | } | |
6e805184 | 1131 | */ |
5e3e77d6 | 1132 | if(c1==c2 && c1==c3 && sc==0 && fMCcase==kFALSE){ |
90814457 | 1133 | TString *name4vect1=new TString(namePC3->Data()); |
1134 | TString *name4vect2=new TString(namePC3->Data()); | |
1135 | name4vect1->Append("_4VectProd1"); | |
1136 | name4vect2->Append("_4VectProd2"); | |
5e3e77d6 | 1137 | // use 3.75e6 MeV^4 as the resolution on QprodSum |
90814457 | 1138 | Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].f4VectProd1Terms = new TH3D(name4vect1->Data(),"",NEdges-1,lowEdges4vect, NEdges-1,lowEdges4vect, NEdges-1,lowEdges4vect); |
1139 | fOutputList->Add(Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].f4VectProd1Terms); | |
1140 | Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].f4VectProd2Terms = new TH3D(name4vect2->Data(),"",NEdges-1,lowEdges4vect, NEdges-1,lowEdges4vect, NEdges-1,lowEdges4vect); | |
1141 | fOutputList->Add(Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].f4VectProd2Terms); | |
5e3e77d6 | 1142 | } |
1143 | if(sc==0 && fMCcase==kTRUE){ | |
1144 | TString *name3DMomResIdeal=new TString(namePC3->Data()); | |
1145 | name3DMomResIdeal->Append("_Ideal"); | |
1146 | Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].fIdeal = new TH3D(name3DMomResIdeal->Data(),"", kQbins,0,fQupperBound, kQbins,0,fQupperBound, kQbins,0,fQupperBound); | |
1147 | fOutputList->Add(Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].fIdeal); | |
1148 | TString *name3DMomResSmeared=new TString(namePC3->Data()); | |
1149 | name3DMomResSmeared->Append("_Smeared"); | |
1150 | Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].fSmeared = new TH3D(name3DMomResSmeared->Data(),"", kQbins,0,fQupperBound, kQbins,0,fQupperBound, kQbins,0,fQupperBound); | |
1151 | fOutputList->Add(Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].fSmeared); | |
601fbb33 | 1152 | // |
1153 | TString *name3DMomResQW12=new TString(namePC3->Data()); | |
1154 | name3DMomResQW12->Append("_QW12"); | |
1155 | Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].fQW12 = new TH3D(name3DMomResQW12->Data(),"", kQbins,0,fQupperBound, kQbins,0,fQupperBound, kQbins,0,fQupperBound); | |
1156 | fOutputList->Add(Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].fQW12); | |
1157 | TString *name3DMomResQW13=new TString(namePC3->Data()); | |
1158 | name3DMomResQW13->Append("_QW13"); | |
1159 | Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].fQW13 = new TH3D(name3DMomResQW13->Data(),"", kQbins,0,fQupperBound, kQbins,0,fQupperBound, kQbins,0,fQupperBound); | |
1160 | fOutputList->Add(Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].fQW13); | |
90814457 | 1161 | // |
1162 | if(term==0){ | |
1163 | TString *name3DSumK3=new TString(namePC3->Data()); | |
1164 | name3DSumK3->Append("_SumK3"); | |
1165 | Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].fSumK3 = new TH3D(name3DSumK3->Data(),"", kQbins,0,fQupperBound, kQbins,0,fQupperBound, kQbins,0,fQupperBound); | |
1166 | fOutputList->Add(Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].fSumK3); | |
1167 | TString *name3DEnK3=new TString(namePC3->Data()); | |
1168 | name3DEnK3->Append("_EnK3"); | |
1169 | Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].fEnK3 = new TH3D(name3DEnK3->Data(),"", kQbins,0,fQupperBound, kQbins,0,fQupperBound, kQbins,0,fQupperBound); | |
1170 | fOutputList->Add(Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].fEnK3); | |
1171 | } | |
1172 | ||
1173 | if(c1==c2 && c1==c3){ | |
1174 | TString *name4vect1Ideal=new TString(namePC3->Data()); | |
1175 | TString *name4vect1Smeared=new TString(namePC3->Data()); | |
1176 | TString *name4vect2Ideal=new TString(namePC3->Data()); | |
1177 | TString *name4vect2Smeared=new TString(namePC3->Data()); | |
0e58bc53 | 1178 | TString *name4vect1Q3W=new TString(namePC3->Data()); |
1179 | TString *name4vect2Q3W=new TString(namePC3->Data()); | |
90814457 | 1180 | name4vect1Ideal->Append("_4VectProd1Ideal"); |
1181 | name4vect1Smeared->Append("_4VectProd1Smeared"); | |
1182 | name4vect2Ideal->Append("_4VectProd2Ideal"); | |
1183 | name4vect2Smeared->Append("_4VectProd2Smeared"); | |
0e58bc53 | 1184 | name4vect1Q3W->Append("_4VectProd1Q3W"); |
1185 | name4vect2Q3W->Append("_4VectProd2Q3W"); | |
1186 | // | |
90814457 | 1187 | Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].f4VectProd1TermsIdeal = new TH3D(name4vect1Ideal->Data(),"",NEdges-1,lowEdges4vect, NEdges-1,lowEdges4vect, NEdges-1,lowEdges4vect); |
1188 | fOutputList->Add(Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].f4VectProd1TermsIdeal); | |
1189 | Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].f4VectProd1TermsSmeared = new TH3D(name4vect1Smeared->Data(),"",NEdges-1,lowEdges4vect, NEdges-1,lowEdges4vect, NEdges-1,lowEdges4vect); | |
1190 | fOutputList->Add(Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].f4VectProd1TermsSmeared); | |
1191 | // | |
1192 | Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].f4VectProd2TermsIdeal = new TH3D(name4vect2Ideal->Data(),"",NEdges-1,lowEdges4vect, NEdges-1,lowEdges4vect, NEdges-1,lowEdges4vect); | |
1193 | fOutputList->Add(Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].f4VectProd2TermsIdeal); | |
1194 | Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].f4VectProd2TermsSmeared = new TH3D(name4vect2Smeared->Data(),"",NEdges-1,lowEdges4vect, NEdges-1,lowEdges4vect, NEdges-1,lowEdges4vect); | |
1195 | fOutputList->Add(Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].f4VectProd2TermsSmeared); | |
1196 | // | |
0e58bc53 | 1197 | if(term==0){// average Q3 in each FVP cell |
1198 | Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].f4VectProd1Q3W = new TH3D(name4vect1Q3W->Data(),"",NEdges-1,lowEdges4vect, NEdges-1,lowEdges4vect, NEdges-1,lowEdges4vect); | |
1199 | fOutputList->Add(Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].f4VectProd1Q3W); | |
1200 | Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].f4VectProd2Q3W = new TH3D(name4vect2Q3W->Data(),"",NEdges-1,lowEdges4vect, NEdges-1,lowEdges4vect, NEdges-1,lowEdges4vect); | |
1201 | fOutputList->Add(Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].f4VectProd2Q3W); | |
1202 | } | |
1203 | // | |
90814457 | 1204 | if(term==0){ |
1205 | TString *name4vect1SumK3=new TString(namePC3->Data()); | |
1206 | TString *name4vect2SumK3=new TString(namePC3->Data()); | |
1207 | TString *name4vect1EnK3=new TString(namePC3->Data()); | |
1208 | TString *name4vect2EnK3=new TString(namePC3->Data()); | |
1209 | name4vect1SumK3->Append("_4VectProd1SumK3"); | |
1210 | name4vect2SumK3->Append("_4VectProd2SumK3"); | |
1211 | name4vect1EnK3->Append("_4VectProd1EnK3"); | |
1212 | name4vect2EnK3->Append("_4VectProd2EnK3"); | |
1213 | Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].f4VectProd1TermsSumK3 = new TH3D(name4vect1SumK3->Data(),"",NEdges-1,lowEdges4vect, NEdges-1,lowEdges4vect, NEdges-1,lowEdges4vect); | |
1214 | fOutputList->Add(Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].f4VectProd1TermsSumK3); | |
1215 | Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].f4VectProd2TermsSumK3 = new TH3D(name4vect2SumK3->Data(),"",NEdges-1,lowEdges4vect, NEdges-1,lowEdges4vect, NEdges-1,lowEdges4vect); | |
1216 | fOutputList->Add(Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].f4VectProd2TermsSumK3); | |
1217 | Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].f4VectProd1TermsEnK3 = new TH3D(name4vect1EnK3->Data(),"",NEdges-1,lowEdges4vect, NEdges-1,lowEdges4vect, NEdges-1,lowEdges4vect); | |
1218 | fOutputList->Add(Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].f4VectProd1TermsEnK3); | |
1219 | Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].f4VectProd2TermsEnK3 = new TH3D(name4vect2EnK3->Data(),"",NEdges-1,lowEdges4vect, NEdges-1,lowEdges4vect, NEdges-1,lowEdges4vect); | |
1220 | fOutputList->Add(Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].f4VectProd2TermsEnK3); | |
1221 | }// term 0 | |
1222 | if(term > 0 && term < 4){ | |
1223 | TString *name4vect1SumK2=new TString(namePC3->Data()); | |
1224 | TString *name4vect2SumK2=new TString(namePC3->Data()); | |
1225 | TString *name4vect1EnK2=new TString(namePC3->Data()); | |
1226 | TString *name4vect2EnK2=new TString(namePC3->Data()); | |
1227 | name4vect1SumK2->Append("_4VectProd1SumK2"); | |
1228 | name4vect2SumK2->Append("_4VectProd2SumK2"); | |
1229 | name4vect1EnK2->Append("_4VectProd1EnK2"); | |
1230 | name4vect2EnK2->Append("_4VectProd2EnK2"); | |
1231 | Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].f4VectProd1TermsSumK2 = new TH3D(name4vect1SumK2->Data(),"",NEdges-1,lowEdges4vect, NEdges-1,lowEdges4vect, NEdges-1,lowEdges4vect); | |
1232 | fOutputList->Add(Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].f4VectProd1TermsSumK2); | |
1233 | Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].f4VectProd2TermsSumK2 = new TH3D(name4vect2SumK2->Data(),"",NEdges-1,lowEdges4vect, NEdges-1,lowEdges4vect, NEdges-1,lowEdges4vect); | |
1234 | fOutputList->Add(Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].f4VectProd2TermsSumK2); | |
1235 | Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].f4VectProd1TermsEnK2 = new TH3D(name4vect1EnK2->Data(),"",NEdges-1,lowEdges4vect, NEdges-1,lowEdges4vect, NEdges-1,lowEdges4vect); | |
1236 | fOutputList->Add(Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].f4VectProd1TermsEnK2); | |
1237 | Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].f4VectProd2TermsEnK2 = new TH3D(name4vect2EnK2->Data(),"",NEdges-1,lowEdges4vect, NEdges-1,lowEdges4vect, NEdges-1,lowEdges4vect); | |
1238 | fOutputList->Add(Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].f4VectProd2TermsEnK2); | |
1239 | }// terms 1,2,3 | |
1240 | } | |
1241 | }// MCcase | |
5e3e77d6 | 1242 | // |
90814457 | 1243 | if(c1==c2 && c1==c3 && term==4 && sc==0){ |
cd12341d | 1244 | for(Int_t dt=0; dt<kDENtypes; dt++){ |
1245 | TString *nameDenType=new TString("PairCut3_Charge1_"); | |
1246 | *nameDenType += c1; | |
1247 | nameDenType->Append("_Charge2_"); | |
1248 | *nameDenType += c2; | |
1249 | nameDenType->Append("_Charge3_"); | |
1250 | *nameDenType += c3; | |
1251 | nameDenType->Append("_SC_"); | |
1252 | *nameDenType += sc; | |
1253 | nameDenType->Append("_M_"); | |
1254 | *nameDenType += mb; | |
1255 | nameDenType->Append("_ED_"); | |
1256 | *nameDenType += edB; | |
1257 | nameDenType->Append("_TPN_"); | |
1258 | *nameDenType += dt; | |
1259 | ||
1260 | Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].DT[dt].fTwoPartNorm = new TH3D(nameDenType->Data(),"",kQbins,0,fQupperBound, kQbins,0,fQupperBound, kQbins,0,fQupperBound); | |
1261 | fOutputList->Add(Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].DT[dt].fTwoPartNorm); | |
1262 | // neglect errors for TPN | |
1263 | //nameDenType->Append("_Err"); | |
1264 | //Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].DT[dt].fTwoPartNormErr = new TH3D(nameDenType->Data(),"",kQbins,0,fQupperBound, kQbins,0,fQupperBound, kQbins,0,fQupperBound); | |
1265 | //fOutputList->Add(Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].DT[dt].fTwoPartNormErr); | |
5e3e77d6 | 1266 | // |
fa109294 | 1267 | TString *name4vect1TPN=new TString(nameDenType->Data()); |
1268 | TString *name4vect2TPN=new TString(nameDenType->Data()); | |
1269 | name4vect1TPN->Append("_4VectProd1"); | |
1270 | name4vect2TPN->Append("_4VectProd2"); | |
1271 | Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].DT[dt].f4VectProd1TwoPartNorm = new TH3D(name4vect1TPN->Data(),"",NEdges-1,lowEdges4vect, NEdges-1,lowEdges4vect, NEdges-1,lowEdges4vect); | |
1272 | fOutputList->Add(Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].DT[dt].f4VectProd1TwoPartNorm); | |
1273 | Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].DT[dt].f4VectProd2TwoPartNorm = new TH3D(name4vect2TPN->Data(),"",NEdges-1,lowEdges4vect, NEdges-1,lowEdges4vect, NEdges-1,lowEdges4vect); | |
1274 | fOutputList->Add(Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].DT[dt].f4VectProd2TwoPartNorm); | |
90814457 | 1275 | // |
1276 | if(fMCcase){ | |
1277 | TString *name4vect1TPNIdeal=new TString(nameDenType->Data()); | |
1278 | TString *name4vect2TPNIdeal=new TString(nameDenType->Data()); | |
1279 | TString *name4vect1TPNSmeared=new TString(nameDenType->Data()); | |
1280 | TString *name4vect2TPNSmeared=new TString(nameDenType->Data()); | |
1281 | name4vect1TPNIdeal->Append("_4VectProd1Ideal"); | |
1282 | name4vect2TPNIdeal->Append("_4VectProd2Ideal"); | |
1283 | name4vect1TPNSmeared->Append("_4VectProd1Smeared"); | |
1284 | name4vect2TPNSmeared->Append("_4VectProd2Smeared"); | |
1285 | Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].DT[dt].f4VectProd1TwoPartNormIdeal = new TH3D(name4vect1TPNIdeal->Data(),"",NEdges-1,lowEdges4vect, NEdges-1,lowEdges4vect, NEdges-1,lowEdges4vect); | |
1286 | fOutputList->Add(Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].DT[dt].f4VectProd1TwoPartNormIdeal); | |
1287 | Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].DT[dt].f4VectProd2TwoPartNormIdeal = new TH3D(name4vect2TPNIdeal->Data(),"",NEdges-1,lowEdges4vect, NEdges-1,lowEdges4vect, NEdges-1,lowEdges4vect); | |
1288 | fOutputList->Add(Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].DT[dt].f4VectProd2TwoPartNormIdeal); | |
1289 | Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].DT[dt].f4VectProd1TwoPartNormSmeared = new TH3D(name4vect1TPNSmeared->Data(),"",NEdges-1,lowEdges4vect, NEdges-1,lowEdges4vect, NEdges-1,lowEdges4vect); | |
1290 | fOutputList->Add(Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].DT[dt].f4VectProd1TwoPartNormSmeared); | |
1291 | Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].DT[dt].f4VectProd2TwoPartNormSmeared = new TH3D(name4vect2TPNSmeared->Data(),"",NEdges-1,lowEdges4vect, NEdges-1,lowEdges4vect, NEdges-1,lowEdges4vect); | |
1292 | fOutputList->Add(Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[mb].EDB[edB].ThreePT[term].DT[dt].f4VectProd2TwoPartNormSmeared); | |
1293 | } | |
1294 | ||
cd12341d | 1295 | } |
1296 | ||
1297 | }// term=4 | |
1298 | }// c and sc exclusion | |
1299 | }// PdensityPairCut | |
1300 | }// term_3 | |
1301 | }// SC_3 | |
1302 | }//c3 | |
1303 | }//c2 | |
1304 | }//c1 | |
1305 | }// ED | |
1306 | }// mbin | |
1307 | }// Pdensity Method | |
1308 | ||
1309 | ||
1310 | if(fTabulatePairs){ | |
1311 | ||
654866df | 1312 | for(Int_t tKbin=0; tKbin<fKbinsT; tKbin++){ |
1313 | for(Int_t yKbin=0; yKbin<fKbinsY; yKbin++){ | |
cd12341d | 1314 | for(Int_t mb=0; mb<fMbins; mb++){ |
654866df | 1315 | for(Int_t edB=0; edB<fEDbins; edB++){ |
cd12341d | 1316 | |
1317 | TString *nameNum = new TString("TwoPart_num_Kt_"); | |
1318 | *nameNum += tKbin; | |
1319 | nameNum->Append("_Ky_"); | |
1320 | *nameNum += yKbin; | |
1321 | nameNum->Append("_M_"); | |
1322 | *nameNum += mb; | |
1323 | nameNum->Append("_ED_"); | |
1324 | *nameNum += edB; | |
1325 | ||
1326 | TString *nameDen = new TString("TwoPart_den_Kt_"); | |
1327 | *nameDen += tKbin; | |
1328 | nameDen->Append("_Ky_"); | |
1329 | *nameDen += yKbin; | |
1330 | nameDen->Append("_M_"); | |
1331 | *nameDen += mb; | |
1332 | nameDen->Append("_ED_"); | |
1333 | *nameDen += edB; | |
1334 | ||
1335 | ||
654866df | 1336 | KT[tKbin].KY[yKbin].MB[mb].EDB[edB].TwoPT[0].fExplicit2ThreeD = new TH3D(nameNum->Data(),"", kQbinsWeights,0,fQupperBoundWeights, kQbinsWeights,0,fQupperBoundWeights, kQbinsWeights,0,fQupperBoundWeights); |
cd12341d | 1337 | fOutputList->Add(KT[tKbin].KY[yKbin].MB[mb].EDB[edB].TwoPT[0].fExplicit2ThreeD); |
1338 | ||
654866df | 1339 | KT[tKbin].KY[yKbin].MB[mb].EDB[edB].TwoPT[1].fExplicit2ThreeD = new TH3D(nameDen->Data(),"", kQbinsWeights,0,fQupperBoundWeights, kQbinsWeights,0,fQupperBoundWeights, kQbinsWeights,0,fQupperBoundWeights); |
cd12341d | 1340 | fOutputList->Add(KT[tKbin].KY[yKbin].MB[mb].EDB[edB].TwoPT[1].fExplicit2ThreeD); |
1341 | } | |
1342 | } | |
1343 | } | |
1344 | } | |
1345 | ||
1346 | } | |
46b217b3 | 1347 | |
cd12341d | 1348 | |
1349 | TProfile *fQsmearMean = new TProfile("fQsmearMean","",2,0.5,2.5, -0.2,0.2,""); | |
1350 | fOutputList->Add(fQsmearMean); | |
1351 | TProfile *fQsmearSq = new TProfile("fQsmearSq","",2,0.5,2.5, -2,2,""); | |
1352 | fOutputList->Add(fQsmearSq); | |
1353 | TH1D *fQDist = new TH1D("fQDist","",200,-.2,.2); | |
1354 | fOutputList->Add(fQDist); | |
1355 | ||
46b217b3 | 1356 | |
cd12341d | 1357 | |
1358 | //////////////////////////////////// | |
1359 | /////////////////////////////////// | |
1360 | ||
1361 | PostData(1, fOutputList); | |
1362 | } | |
1363 | ||
1364 | //________________________________________________________________________ | |
1365 | void AliChaoticity::Exec(Option_t *) | |
1366 | { | |
1367 | // Main loop | |
1368 | // Called for each event | |
1ccd6f0d | 1369 | //cout<<"=========== Event # "<<fEventCounter+1<<" ==========="<<endl; |
cd12341d | 1370 | fEventCounter++; |
1371 | ||
b6e5ec54 | 1372 | if(!fAODcase) {cout<<"ESDs not supported"<<endl; return;} |
cd12341d | 1373 | |
b6e5ec54 | 1374 | fAOD = dynamic_cast<AliAODEvent*> (InputEvent()); |
1375 | if (!fAOD) {Printf("ERROR: fAOD not available"); return;} | |
cd12341d | 1376 | |
cd12341d | 1377 | |
1378 | // Trigger Cut | |
1379 | if(fAOD->GetRunNumber() >= 136851 && fAOD->GetRunNumber() <= 139517){// 10h data | |
1380 | Bool_t isSelected1 = (((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected() & AliVEvent::kMB); | |
fa109294 | 1381 | if(!isSelected1 && !fMCcase) {return;} |
5e3e77d6 | 1382 | }else if(fAOD->GetRunNumber() >= 167693 && fAOD->GetRunNumber() <= 170593){// 11h data |
cd12341d | 1383 | Bool_t isSelected1 = (((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected() & AliVEvent::kCentral); |
1384 | Bool_t isSelected2 = (((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected() & AliVEvent::kSemiCentral); | |
fa109294 | 1385 | if(!isSelected1 && !isSelected2 && !fMCcase) {return;} |
1386 | }else {return;} | |
cd12341d | 1387 | |
1388 | /////////////////////////////////////////////////////////// | |
1389 | const AliAODVertex *primaryVertexAOD; | |
1390 | AliCentrality *centrality;// for AODs and ESDs | |
1391 | ||
1392 | ||
1393 | AliAnalysisManager *man=AliAnalysisManager::GetAnalysisManager(); | |
1394 | AliInputEventHandler* inputHandler = (AliInputEventHandler*) (man->GetInputEventHandler()); | |
1395 | fPIDResponse = inputHandler->GetPIDResponse(); | |
1396 | ||
1397 | ||
1398 | TClonesArray *mcArray = 0x0; | |
1399 | if(fMCcase){ | |
1400 | if(fAODcase){ | |
1401 | mcArray = (TClonesArray*)fAOD->FindListObject(AliAODMCParticle::StdBranchName()); | |
6e805184 | 1402 | if(!mcArray || mcArray->GetEntriesFast() >= kMCarrayLimit){ |
cd12341d | 1403 | cout<<"No MC particle branch found or Array too large!!"<<endl; |
cd12341d | 1404 | return; |
1405 | } | |
1406 | } | |
1407 | } | |
1408 | ||
1409 | ||
1410 | UInt_t status=0; | |
1411 | Int_t positiveTracks=0, negativeTracks=0; | |
1412 | Int_t myTracks=0, pionCount=0, kaonCount=0, protonCount=0; | |
1413 | ||
1414 | Double_t vertex[3]={0}; | |
1415 | Int_t zbin=0; | |
1416 | Double_t zstep=2*10/Double_t(fZvertexBins), zstart=-10.; | |
1417 | ///////////////////////////////////////////////// | |
1418 | ||
1419 | ||
1420 | Float_t centralityPercentile=0; | |
1421 | Float_t cStep=5.0, cStart=0; | |
1422 | ||
1423 | ||
1424 | if(fAODcase){// AOD case | |
1425 | ||
1426 | if(fPbPbcase){ | |
1427 | centrality = fAOD->GetCentrality(); | |
1428 | centralityPercentile = centrality->GetCentralityPercentile("V0M"); | |
1429 | if(centralityPercentile == 0) {cout<<"Centrality = 0, skipping event"<<endl; return;} | |
5e3e77d6 | 1430 | if((centralityPercentile < 5*fCentBinLowLimit) || (centralityPercentile>= 5*(fCentBinHighLimit+1))) {/*cout<<"Centrality out of Range. Skipping Event"<<endl;*/ return;} |
cd12341d | 1431 | cout<<"Centrality % = "<<centralityPercentile<<endl; |
1432 | } | |
1433 | ||
1434 | ||
1435 | ||
1436 | ||
1437 | //////////////////////////////// | |
1438 | // Vertexing | |
1439 | ((TH1F*)fOutputList->FindObject("fMultDist1"))->Fill(fAOD->GetNumberOfTracks()); | |
1440 | primaryVertexAOD = fAOD->GetPrimaryVertex(); | |
1441 | vertex[0]=primaryVertexAOD->GetX(); vertex[1]=primaryVertexAOD->GetY(); vertex[2]=primaryVertexAOD->GetZ(); | |
1442 | ||
1443 | if(fabs(vertex[2]) > 10) {cout<<"Zvertex Out of Range. Skip Event"<<endl; return;} // Z-Vertex Cut | |
1444 | ((TH3F*)fOutputList->FindObject("fVertexDist"))->Fill(vertex[0], vertex[1], vertex[2]); | |
1445 | ||
1446 | if(fAOD->IsPileupFromSPD()) {cout<<"PileUpEvent. Skip Event"<<endl; return;} // Reject Pile-up events | |
1447 | if(primaryVertexAOD->GetNContributors() < 1) {cout<<"Bad Vertex. Skip Event"<<endl; return;} | |
1448 | ||
1449 | ((TH1F*)fOutputList->FindObject("fMultDist2"))->Fill(fAOD->GetNumberOfTracks()); | |
1450 | ||
1451 | fBfield = fAOD->GetMagneticField(); | |
1452 | ||
1453 | for(Int_t i=0; i<fZvertexBins; i++){ | |
1454 | if( (vertex[2] >= zstart+i*zstep) && (vertex[2] < zstart+(i+1)*zstep) ){ | |
1455 | zbin=i; | |
1456 | break; | |
1457 | } | |
1458 | } | |
1459 | ||
1460 | ||
1461 | ||
1462 | ///////////////////////////// | |
1463 | // Create Shuffled index list | |
1464 | Int_t randomIndex[fAOD->GetNumberOfTracks()]; | |
1465 | for (Int_t i = 0; i < fAOD->GetNumberOfTracks(); i++) randomIndex[i]=i; | |
1466 | Shuffle(randomIndex,0,fAOD->GetNumberOfTracks()-1); | |
1467 | ///////////////////////////// | |
1468 | ||
1469 | // Track loop | |
1470 | for (Int_t i = 0; i < fAOD->GetNumberOfTracks(); i++) { | |
1471 | AliAODTrack* aodtrack = fAOD->GetTrack(randomIndex[i]); | |
1472 | if (!aodtrack) continue; | |
1473 | if(myTracks >= fMultLimit) {cout<<"More tracks than Track Limit"<<endl; return;} | |
1474 | ||
1475 | status=aodtrack->GetStatus(); | |
1476 | ||
654866df | 1477 | |
1478 | if(!aodtrack->TestFilterBit(BIT(fFilterBit))) continue;// AOD filterBit cut | |
1479 | ||
cd12341d | 1480 | if(aodtrack->Pt() < 0.16) continue; |
1481 | if(fabs(aodtrack->Eta()) > 0.8) continue; | |
1482 | ||
1483 | ||
1484 | Bool_t goodMomentum = aodtrack->GetPxPyPz( fTempStruct[myTracks].fP); | |
1485 | if(!goodMomentum) continue; | |
1486 | aodtrack->GetXYZ( fTempStruct[myTracks].fX); | |
1487 | ||
1488 | Float_t dca2[2]; | |
1489 | Float_t dca3d; | |
1490 | ||
1491 | dca2[0] = sqrt( pow(fTempStruct[myTracks].fX[0] - vertex[0],2) + pow(fTempStruct[myTracks].fX[1] - vertex[1],2)); | |
1492 | dca2[1] = sqrt( pow(fTempStruct[myTracks].fX[2] - vertex[2],2)); | |
1493 | dca3d = sqrt( pow(dca2[0],2) + pow(dca2[1],2)); | |
1494 | ||
1495 | fTempStruct[myTracks].fStatus = status; | |
1496 | fTempStruct[myTracks].fFiltermap = aodtrack->GetFilterMap(); | |
1497 | fTempStruct[myTracks].fId = aodtrack->GetID(); | |
1498 | fTempStruct[myTracks].fLabel = aodtrack->GetLabel(); | |
1499 | fTempStruct[myTracks].fPhi = atan2(fTempStruct[myTracks].fP[1], fTempStruct[myTracks].fP[0]); | |
1500 | if(fTempStruct[myTracks].fPhi < 0) fTempStruct[myTracks].fPhi += 2*PI; | |
1501 | fTempStruct[myTracks].fPt = sqrt(pow(fTempStruct[myTracks].fP[0],2) + pow(fTempStruct[myTracks].fP[1],2)); | |
1502 | fTempStruct[myTracks].fMom = sqrt( pow(fTempStruct[myTracks].fPt,2) + pow(fTempStruct[myTracks].fP[2],2) ); | |
1503 | fTempStruct[myTracks].fEta = aodtrack->Eta(); | |
1504 | fTempStruct[myTracks].fCharge = aodtrack->Charge(); | |
1505 | fTempStruct[myTracks].fDCAXY = dca2[0]; | |
1506 | fTempStruct[myTracks].fDCAZ = dca2[1]; | |
1507 | fTempStruct[myTracks].fDCA = dca3d; | |
1508 | fTempStruct[myTracks].fClusterMap = aodtrack->GetTPCClusterMap(); | |
1509 | fTempStruct[myTracks].fSharedMap = aodtrack->GetTPCSharedMap(); | |
1510 | ||
1511 | ||
1512 | ||
1513 | if(fTempStruct[myTracks].fMom > 0.9999) continue;// upper P bound | |
1514 | if(fTempStruct[myTracks].fPt > 0.9999) continue;// upper P bound | |
1515 | if(fTempStruct[myTracks].fP[2] > 0.9999) continue;// upper P bound | |
1516 | ||
1517 | if(fTempStruct[myTracks].fCharge==+1) { | |
1518 | ((TH2F*)fOutputList->FindObject("fDCAxyDistPlus"))->Fill(fTempStruct[myTracks].fPt, dca2[0]); | |
1519 | ((TH2F*)fOutputList->FindObject("fDCAzDistPlus"))->Fill(fTempStruct[myTracks].fPt, dca2[1]); | |
1520 | }else { | |
1521 | ((TH2F*)fOutputList->FindObject("fDCAxyDistMinus"))->Fill(fTempStruct[myTracks].fPt, dca2[0]); | |
1522 | ((TH2F*)fOutputList->FindObject("fDCAzDistMinus"))->Fill(fTempStruct[myTracks].fPt, dca2[1]); | |
1523 | } | |
1524 | ||
1525 | ((TH3F*)fOutputList->FindObject("fPhiPtDist"))->Fill(aodtrack->Charge(), aodtrack->Phi(), aodtrack->Pt()); | |
1526 | ((TH3F*)fOutputList->FindObject("fPtEtaDist"))->Fill(aodtrack->Charge(), aodtrack->Pt(), aodtrack->Eta()); | |
1527 | ||
1528 | ||
1529 | // nSimga PID workaround | |
1530 | fTempStruct[myTracks].fElectron = kFALSE; | |
1531 | fTempStruct[myTracks].fPion = kFALSE; | |
1532 | fTempStruct[myTracks].fKaon = kFALSE; | |
1533 | fTempStruct[myTracks].fProton = kFALSE; | |
1534 | ||
1535 | Float_t nSigmaTPC[5]; | |
1536 | Float_t nSigmaTOF[5]; | |
1537 | nSigmaTPC[0]=10; nSigmaTPC[1]=10; nSigmaTPC[2]=10; nSigmaTPC[3]=10; nSigmaTPC[4]=10; | |
1538 | nSigmaTOF[0]=10; nSigmaTOF[1]=10; nSigmaTOF[2]=10; nSigmaTOF[3]=10; nSigmaTOF[4]=10; | |
1539 | fTempStruct[myTracks].fTOFhit = kFALSE;// default | |
1540 | Float_t signalTPC=0, signalTOF=0; | |
1541 | Double_t integratedTimesTOF[10]={0}; | |
1542 | for(Int_t j = 0; j < fAOD->GetNumberOfTracks(); j++) { | |
1543 | AliAODTrack* aodTrack2 = fAOD->GetTrack(j); | |
1544 | if (!aodTrack2) continue; | |
1545 | if(aodtrack->GetID() != (-aodTrack2->GetID() - 1)) continue;// (-aodTrack2->GetID() - 1) | |
1546 | ||
1547 | UInt_t status2=aodTrack2->GetStatus(); | |
1548 | ||
1549 | nSigmaTPC[0]=fabs(fPIDResponse->NumberOfSigmasTPC(aodTrack2,AliPID::kElectron)); | |
1550 | nSigmaTPC[1]=fabs(fPIDResponse->NumberOfSigmasTPC(aodTrack2,AliPID::kMuon)); | |
1551 | nSigmaTPC[2]=fabs(fPIDResponse->NumberOfSigmasTPC(aodTrack2,AliPID::kPion)); | |
1552 | nSigmaTPC[3]=fabs(fPIDResponse->NumberOfSigmasTPC(aodTrack2,AliPID::kKaon)); | |
1553 | nSigmaTPC[4]=fabs(fPIDResponse->NumberOfSigmasTPC(aodTrack2,AliPID::kProton)); | |
1554 | // | |
1555 | nSigmaTOF[0]=fabs(fPIDResponse->NumberOfSigmasTOF(aodTrack2,AliPID::kElectron)); | |
1556 | nSigmaTOF[1]=fabs(fPIDResponse->NumberOfSigmasTOF(aodTrack2,AliPID::kMuon)); | |
1557 | nSigmaTOF[2]=fabs(fPIDResponse->NumberOfSigmasTOF(aodTrack2,AliPID::kPion)); | |
1558 | nSigmaTOF[3]=fabs(fPIDResponse->NumberOfSigmasTOF(aodTrack2,AliPID::kKaon)); | |
1559 | nSigmaTOF[4]=fabs(fPIDResponse->NumberOfSigmasTOF(aodTrack2,AliPID::kProton)); | |
1560 | signalTPC = aodTrack2->GetTPCsignal(); | |
1561 | ||
1562 | if( (status2&AliESDtrack::kTOFpid)!=0 && (status2&AliESDtrack::kTIME)!=0 && (status2&AliESDtrack::kTOFout)!=0 && (status2&AliESDtrack::kTOFmismatch)<=0){// good tof hit | |
1563 | fTempStruct[myTracks].fTOFhit = kTRUE; | |
1564 | signalTOF = aodTrack2->GetTOFsignal(); | |
1565 | aodTrack2->GetIntegratedTimes(integratedTimesTOF); | |
1566 | }else fTempStruct[myTracks].fTOFhit = kFALSE; | |
1567 | ||
1568 | }// aodTrack2 | |
5e3e77d6 | 1569 | |
c4980714 | 1570 | //cout<<nSigmaTPC[2]<<endl; |
cd12341d | 1571 | /////////////////// |
1572 | ((TH3F*)fOutputList->FindObject("fTPCResponse"))->Fill(centralityPercentile, fTempStruct[myTracks].fMom, signalTPC); | |
1573 | if(fTempStruct[myTracks].fTOFhit) { | |
1574 | ((TH3F*)fOutputList->FindObject("fTOFResponse"))->Fill(centralityPercentile, fTempStruct[myTracks].fMom, signalTOF - integratedTimesTOF[3]); | |
1575 | } | |
1576 | /////////////////// | |
1577 | ||
1578 | // Use TOF if good hit and above threshold | |
1579 | if(fTempStruct[myTracks].fTOFhit && fTempStruct[myTracks].fMom > fTPCTOFboundry){ | |
1580 | if(nSigmaTOF[0]<fSigmaCutTOF) fTempStruct[myTracks].fElectron = kTRUE;// Electron candidate | |
1581 | if(nSigmaTOF[2]<fSigmaCutTOF) fTempStruct[myTracks].fPion = kTRUE;// Pion candidate | |
1582 | if(nSigmaTOF[3]<fSigmaCutTOF) fTempStruct[myTracks].fKaon = kTRUE;// Kaon candidate | |
1583 | if(nSigmaTOF[4]<fSigmaCutTOF) fTempStruct[myTracks].fProton = kTRUE;// Proton candidate | |
1584 | }else {// TPC info instead | |
1585 | if(nSigmaTPC[0]<fSigmaCutTPC) fTempStruct[myTracks].fElectron = kTRUE;// Electron candidate | |
1586 | if(nSigmaTPC[2]<fSigmaCutTPC) fTempStruct[myTracks].fPion = kTRUE;// Pion candidate | |
1587 | if(nSigmaTPC[3]<fSigmaCutTPC) fTempStruct[myTracks].fKaon = kTRUE;// Kaon candidate | |
1588 | if(nSigmaTPC[4]<fSigmaCutTPC) fTempStruct[myTracks].fProton = kTRUE;// Proton candidate | |
1589 | } | |
1590 | ||
fa109294 | 1591 | //cout<<nSigmaTPC[2]<<endl; |
cd12341d | 1592 | ////////////////////////////////////// |
1593 | // Bayesian PIDs for TPC only tracking | |
1594 | //const Double_t* PID = aodtrack->PID(); | |
1595 | //fTempStruct[myTracks].fElectron = kFALSE; | |
1596 | //fTempStruct[myTracks].Pion = kFALSE; | |
1597 | //fTempStruct[myTracks].Kaon = kFALSE; | |
1598 | //fTempStruct[myTracks].Proton = kFALSE; | |
1599 | ||
1600 | // Pions | |
1601 | //if(PID[2] > 0.2) fTempStruct[myTracks].Pion = kTRUE;// pions: 0.2 --> 0.5 | |
1602 | // | |
1603 | // Kaons | |
1604 | //if(PID[3] <= 0.5) fTempStruct[myTracks].Kaon = kFALSE;// kaons | |
1605 | // | |
1606 | // Protons | |
1607 | //if(PID[4] <= 0.5) fTempStruct[myTracks].Proton = kFALSE;// protons | |
1608 | ////////////////////////////////////// | |
1609 | ||
1610 | ||
1611 | // Ensure there is only 1 candidate per track | |
1612 | if(fTempStruct[myTracks].fElectron && fTempStruct[myTracks].fMom < 0.45) continue;// Remove electron band | |
1613 | if(!fTempStruct[myTracks].fPion && !fTempStruct[myTracks].fKaon && !fTempStruct[myTracks].fProton) continue; | |
1614 | if(fTempStruct[myTracks].fPion && fTempStruct[myTracks].fKaon) continue; | |
1615 | if(fTempStruct[myTracks].fPion && fTempStruct[myTracks].fProton) continue; | |
1616 | if(fTempStruct[myTracks].fKaon && fTempStruct[myTracks].fProton) continue; | |
1617 | if(fTempStruct[myTracks].fPion && fTempStruct[myTracks].fKaon && fTempStruct[myTracks].fProton) continue; | |
1618 | //////////////////////// | |
1619 | if(fTempStruct[myTracks].fProton && fTempStruct[myTracks].fMom < 0.25) continue;//extra cut for protons | |
1620 | ||
1621 | if(!fTempStruct[myTracks].fPion) continue;// only pions | |
1622 | ||
1623 | ||
1624 | ||
1625 | ||
1626 | if(fTempStruct[myTracks].fPion) {// pions | |
1627 | fTempStruct[myTracks].fEaccepted = sqrt(pow(fTempStruct[myTracks].fMom,2) + pow(fTrueMassPi,2)); | |
1628 | fTempStruct[myTracks].fKey = 1; | |
1629 | }else if(fTempStruct[myTracks].fKaon){// kaons | |
1630 | fTempStruct[myTracks].fEaccepted = sqrt(pow(fTempStruct[myTracks].fMom,2) + pow(fTrueMassK,2));; | |
1631 | fTempStruct[myTracks].fKey = 10; | |
1632 | }else{// protons | |
1633 | fTempStruct[myTracks].fEaccepted = sqrt(pow(fTempStruct[myTracks].fMom,2) + pow(fTrueMassP,2));; | |
1634 | fTempStruct[myTracks].fKey = 100; | |
1635 | } | |
1636 | ||
1637 | ||
1638 | ||
1639 | if(aodtrack->Charge() > 0) positiveTracks++; | |
1640 | else negativeTracks++; | |
1641 | ||
1642 | if(fTempStruct[myTracks].fPion) pionCount++; | |
1643 | if(fTempStruct[myTracks].fKaon) kaonCount++; | |
1644 | if(fTempStruct[myTracks].fProton) protonCount++; | |
1645 | ||
1646 | myTracks++; | |
1647 | ||
1648 | } | |
1649 | }else {// ESD tracks | |
1650 | cout<<"ESDs not supported currently"<<endl; | |
1651 | return; | |
1652 | } | |
1653 | ||
1654 | ||
1655 | if(myTracks >= 1) { | |
1656 | ((TH1F*)fOutputList->FindObject("fMultDist3"))->Fill(myTracks); | |
1657 | } | |
1658 | ||
1659 | ||
b6e5ec54 | 1660 | //cout<<"There are "<<myTracks<<" myTracks"<<endl; |
1661 | //cout<<"pionCount = "<<pionCount<<" kaonCount = "<<kaonCount<<" protonCount = "<<protonCount<<endl; | |
cd12341d | 1662 | |
1663 | ///////////////////////////////////////// | |
1664 | // Pion Multiplicity Cut (To ensure all Correlation orders are present in each event) | |
1665 | if(myTracks < 3) {cout<<"Less than 3 tracks. Skipping Event."<<endl; return;} | |
1666 | ///////////////////////////////////////// | |
fa109294 | 1667 | |
cd12341d | 1668 | |
1669 | //////////////////////////////// | |
1670 | /////////////////////////////// | |
1671 | // Mbin determination | |
1672 | // | |
1673 | // Mbin set to Pion Count Only for pp!!!!!!! | |
1674 | fMbin=-1; | |
1675 | if(!fPbPbcase){ | |
1676 | for(Int_t i=0; i<kMultBinspp; i++){ | |
1677 | if( ( pionCount > fMultLimits[i]) && ( pionCount <= fMultLimits[i+1]) ) { fMbin=i; break;} | |
1678 | // Mbin 0 has 1 pion | |
1679 | } | |
1680 | }else{ | |
654866df | 1681 | for(Int_t i=0; i<fCentBins; i++){ |
cd12341d | 1682 | if( (centralityPercentile >= cStart+i*cStep) && (centralityPercentile < cStart+(i+1)*cStep) ){ |
1683 | fMbin=i;// 0 = most central | |
1684 | break; | |
1685 | } | |
1686 | } | |
1687 | } | |
1688 | ||
1689 | if(fMbin==-1) {cout<<"Bad Mbin+++++++++++++++++++++++++++++++++++++++++++++++++++"<<endl; return;} | |
1690 | ||
704f2481 | 1691 | fFSIbin=0; |
ae9b34d1 | 1692 | if(fMbin==0) fFSIbin = 0;//0-5% |
1693 | else if(fMbin==1) fFSIbin = 1;//5-10% | |
1694 | else if(fMbin<=3) fFSIbin = 2;//10-20% | |
1695 | else if(fMbin<=5) fFSIbin = 3;//20-30% | |
1696 | else if(fMbin<=7) fFSIbin = 4;//30-40% | |
1697 | else fFSIbin = 5;//40-50% | |
1698 | ||
f9a5e67a | 1699 | Int_t rIndexForTPNMomRes = fRBinMax; |
1700 | if(fMbin<=1) {rIndexForTPNMomRes=fRBinMax;} | |
1701 | else if(fMbin<=3) {rIndexForTPNMomRes=fRBinMax-1;} | |
1702 | else if(fMbin<=5) {rIndexForTPNMomRes=fRBinMax-2;} | |
1703 | else {rIndexForTPNMomRes=fRBinMax-3;} | |
90814457 | 1704 | |
cd12341d | 1705 | ////////////////////////////////////////////////// |
1706 | fEDbin=0;// Extra Dimension bin (Kt, (Kt-Psi),....) | |
1707 | ////////////////////////////////////////////////// | |
1708 | ||
1709 | ||
654866df | 1710 | |
cd12341d | 1711 | ((TH1F*)fOutputList->FindObject("fEvents1"))->Fill(fMbin+1); |
1712 | ((TProfile*)fOutputList->FindObject("fAvgMult"))->Fill(fMbin+1., pionCount); | |
1713 | ||
1714 | //////////////////////////////////// | |
1715 | // Add event to buffer if > 0 tracks | |
1716 | if(myTracks > 0){ | |
1717 | fEC[zbin][fMbin]->FIFOShift(); | |
1718 | (fEvt) = fEC[zbin][fMbin]->fEvtStr; | |
1719 | (fEvt)->fNtracks = myTracks; | |
1720 | (fEvt)->fFillStatus = 1; | |
1721 | for(Int_t i=0; i<myTracks; i++) (fEvt)->fTracks[i] = fTempStruct[i]; | |
1722 | if(fMCcase){ | |
1723 | (fEvt)->fMCarraySize = mcArray->GetEntriesFast(); | |
1724 | for(Int_t i=0; i<mcArray->GetEntriesFast(); i++) { | |
1725 | AliAODMCParticle *tempMCTrack = (AliAODMCParticle*)mcArray->At(i); | |
1726 | (fEvt)->fMCtracks[i].fPx = tempMCTrack->Px(); | |
1727 | (fEvt)->fMCtracks[i].fPy = tempMCTrack->Py(); | |
1728 | (fEvt)->fMCtracks[i].fPz = tempMCTrack->Pz(); | |
1729 | (fEvt)->fMCtracks[i].fPtot = sqrt(pow(tempMCTrack->Px(),2)+pow(tempMCTrack->Py(),2)+pow(tempMCTrack->Pz(),2)); | |
1730 | } | |
1731 | } | |
1732 | } | |
1733 | ||
654866df | 1734 | |
cd12341d | 1735 | |
1736 | Float_t qinv12=0, qinv13=0, qinv23=0; | |
654866df | 1737 | Float_t qinv12Flat=0; |
cd12341d | 1738 | Float_t qout=0, qside=0, qlong=0; |
654866df | 1739 | Float_t qoutFlat=0, qsideFlat=0, qlongFlat=0; |
cd12341d | 1740 | Float_t qoutMC=0, qsideMC=0, qlongMC=0; |
1741 | Float_t transK12=0, rapK12=0, transK3=0; | |
1742 | Int_t transKbin=0, rapKbin=0; | |
1743 | Float_t q3=0; | |
1744 | Int_t ch1=0, ch2=0, ch3=0; | |
1745 | Short_t key1=0, key2=0, key3=0; | |
1746 | Int_t bin1=0, bin2=0, bin3=0; | |
1747 | Float_t pVect1[4]={0}; | |
1748 | Float_t pVect2[4]={0}; | |
1749 | Float_t pVect3[4]={0}; | |
1750 | Float_t pVect1MC[4]={0}; | |
1751 | Float_t pVect2MC[4]={0}; | |
5e3e77d6 | 1752 | Float_t pVect3MC[4]={0}; |
654866df | 1753 | Float_t pVect2Flat[4]={0}; |
1754 | Float_t pVect3Flat[4]={0}; | |
cd12341d | 1755 | Int_t index1=0, index2=0, index3=0; |
1756 | Float_t weight12=0, weight13=0, weight23=0; | |
1757 | Float_t weight12Err=0, weight13Err=0, weight23Err=0; | |
1758 | Float_t weight12CC=0, weight13CC=0, weight23CC=0; | |
1759 | Float_t weightTotal=0;//, weightTotalErr=0; | |
5e3e77d6 | 1760 | Float_t qinv12MC=0, qinv13MC=0, qinv23MC=0; |
90814457 | 1761 | Float_t Qsum1v1=0, Qsum2=0, Qsum3v1=0, Qsum1v2=0, Qsum3v2=0; |
1762 | Float_t Qsum1v1MC=0, Qsum2MC=0, Qsum3v1MC=0, Qsum1v2MC=0, Qsum3v2MC=0; | |
1763 | // | |
cd12341d | 1764 | AliAODMCParticle *mcParticle1=0x0; |
1765 | AliAODMCParticle *mcParticle2=0x0; | |
1766 | ||
1767 | ||
1768 | if(fPdensityPairCut){ | |
1769 | //////////////////// | |
1770 | Int_t pairCountSE=0, pairCountME=0; | |
1771 | Int_t normPairCount[2]={0}; | |
1772 | Int_t numOtherPairs1[2][fMultLimit]; | |
1773 | Int_t numOtherPairs2[2][fMultLimit]; | |
1774 | Bool_t exitCode=kFALSE; | |
1775 | Int_t tempNormFillCount[2][2][2][10][5]; | |
1776 | ||
1777 | ||
1778 | // reset to defaults | |
1779 | for(Int_t i=0; i<fMultLimit; i++) { | |
1780 | fPairLocationSE[i]->Set(fMultLimit,fDefaultsInt); | |
1781 | fPairLocationME[i]->Set(fMultLimit,fDefaultsInt); | |
1782 | ||
1783 | // Normalization Utilities | |
1784 | fOtherPairLocation1[0][i]->Set(fMultLimit,fDefaultsInt); | |
1785 | fOtherPairLocation1[1][i]->Set(fMultLimit,fDefaultsInt); | |
1786 | fOtherPairLocation2[0][i]->Set(fMultLimit,fDefaultsInt); | |
1787 | fOtherPairLocation2[1][i]->Set(fMultLimit,fDefaultsInt); | |
1788 | fNormPairSwitch[0][i]->Set(fMultLimit,fDefaultsCharMult); | |
1789 | fNormPairSwitch[1][i]->Set(fMultLimit,fDefaultsCharMult); | |
1790 | fNormPairSwitch[2][i]->Set(fMultLimit,fDefaultsCharMult); | |
1791 | numOtherPairs1[0][i]=0; | |
1792 | numOtherPairs1[1][i]=0; | |
1793 | numOtherPairs2[0][i]=0; | |
1794 | numOtherPairs2[1][i]=0; | |
1795 | ||
1796 | // Track Merging/Splitting Utilities | |
1797 | fPairSplitCut[0][i]->Set(fMultLimit,fDefaultsCharMult);// P11 | |
1798 | fPairSplitCut[1][i]->Set(fMultLimit,fDefaultsCharMult);// P12 | |
1799 | fPairSplitCut[2][i]->Set(fMultLimit,fDefaultsCharMult);// P13 | |
1800 | fPairSplitCut[3][i]->Set(fMultLimit,fDefaultsCharMult);// P23 | |
1801 | } | |
1802 | ||
1803 | // Reset the temp Normalization counters | |
1804 | for(Int_t i=0; i<2; i++){// Charge1 | |
1805 | for(Int_t j=0; j<2; j++){// Charge2 | |
1806 | for(Int_t k=0; k<2; k++){// Charge3 | |
1807 | for(Int_t l=0; l<10; l++){// FillIndex (species Combination) | |
1808 | for(Int_t m=0; m<5; m++){// Term (Cumulant term) | |
1809 | tempNormFillCount[i][j][k][l][m] = 0; | |
1810 | } | |
1811 | } | |
1812 | } | |
1813 | } | |
1814 | } | |
1815 | ||
1816 | ||
1817 | /////////////////////////////////////////////////////// | |
1818 | // Start the pairing process | |
1819 | // P11 pairing | |
1820 | // 1st Particle | |
1821 | ||
1822 | for (Int_t i=0; i<myTracks; i++) { | |
1823 | ||
1824 | Int_t en2=0; | |
1825 | ||
1826 | // 2nd particle | |
1827 | for (Int_t j=i+1; j<(fEvt+en2)->fNtracks; j++) { | |
1828 | ||
1829 | key1 = (fEvt)->fTracks[i].fKey; | |
1830 | key2 = (fEvt+en2)->fTracks[j].fKey; | |
1831 | Short_t fillIndex2 = FillIndex2part(key1+key2); | |
1832 | Short_t qCutBin = SetQcutBin(fillIndex2); | |
1833 | Short_t normBin = SetNormBin(fillIndex2); | |
1834 | pVect1[0]=(fEvt)->fTracks[i].fEaccepted; pVect2[0]=(fEvt+en2)->fTracks[j].fEaccepted; | |
1835 | pVect1[1]=(fEvt)->fTracks[i].fP[0]; pVect2[1]=(fEvt+en2)->fTracks[j].fP[0]; | |
1836 | pVect1[2]=(fEvt)->fTracks[i].fP[1]; pVect2[2]=(fEvt+en2)->fTracks[j].fP[1]; | |
1837 | pVect1[3]=(fEvt)->fTracks[i].fP[2]; pVect2[3]=(fEvt+en2)->fTracks[j].fP[2]; | |
654866df | 1838 | |
cd12341d | 1839 | // |
1840 | ||
1841 | qinv12 = GetQinv(fillIndex2, pVect1, pVect2); | |
1842 | GetQosl(pVect1, pVect2, qout, qside, qlong); | |
1843 | transK12 = sqrt(pow(pVect1[1]+pVect2[1],2) + pow(pVect1[2]+pVect2[2],2))/2.; | |
1844 | ||
654866df | 1845 | if(fGenerateSignal){// Flatten the Q-dist to increase pair population at low-q (testing purposes only) |
5fc49f8c | 1846 | /*Float_t Qflattened = 0.005 + 0.2*gRandom->Rndm(); |
654866df | 1847 | Float_t theta12 = PI*gRandom->Rndm(); |
1848 | Float_t phi12 = 2*PI*gRandom->Rndm(); | |
1849 | pVect2Flat[1] = pVect1[1] + Qflattened*sin(theta12)*cos(phi12); | |
1850 | pVect2Flat[2] = pVect1[2] + Qflattened*sin(theta12)*sin(phi12); | |
1851 | pVect2Flat[3] = pVect1[3] + Qflattened*cos(theta12); | |
5fc49f8c | 1852 | pVect2Flat[0] = sqrt(pow(pVect2Flat[1],2)+pow(pVect2Flat[2],2)+pow(pVect2Flat[3],2)+pow(fTrueMassPi,2));*/ |
654866df | 1853 | // |
5fc49f8c | 1854 | pVect2Flat[0]=pVect2[0]; pVect2Flat[1]=pVect2[1]; pVect2Flat[2]=pVect2[2]; pVect2Flat[3]=pVect2[3]; |
654866df | 1855 | // |
1856 | qinv12Flat = GetQinv(fillIndex2, pVect1, pVect2Flat); | |
1857 | GetQosl(pVect1, pVect2Flat, qoutFlat, qsideFlat, qlongFlat); | |
1858 | } | |
1859 | ||
cd12341d | 1860 | if(qinv12 < fQLowerCut) continue;// remove unwanted low-q pairs (also a type of track splitting/merging cut) |
1861 | ||
654866df | 1862 | |
1863 | // | |
1864 | ||
cd12341d | 1865 | /////////////////////////////// |
1866 | ch1 = Int_t(((fEvt)->fTracks[i].fCharge + 1)/2.); | |
1867 | ch2 = Int_t(((fEvt+en2)->fTracks[j].fCharge + 1)/2.); | |
1868 | SetFillBins2(fillIndex2, key1, key2, ch1, ch2, bin1, bin2); | |
1869 | ||
1870 | if(fMCcase && ch1==ch2 && fMbin==0){ | |
1871 | for(Int_t rstep=0; rstep<10; rstep++){ | |
1872 | Float_t coeff = (rstep)*0.2*(0.18/1.2); | |
1873 | // propagate through B field to r=1.2m | |
1874 | Float_t phi1 = (fEvt)->fTracks[i].fPhi - asin((fEvt)->fTracks[i].fCharge*(0.1*fBfield)*coeff/(fEvt)->fTracks[i].fPt); | |
1875 | if(phi1 > 2*PI) phi1 -= 2*PI; | |
1876 | if(phi1 < 0) phi1 += 2*PI; | |
1877 | Float_t phi2 = (fEvt+en2)->fTracks[j].fPhi - asin((fEvt+en2)->fTracks[j].fCharge*(0.1*fBfield)*coeff/(fEvt+en2)->fTracks[j].fPt); | |
1878 | if(phi2 > 2*PI) phi2 -= 2*PI; | |
1879 | if(phi2 < 0) phi2 += 2*PI; | |
1880 | Float_t deltaphi = phi1 - phi2; | |
1881 | if(deltaphi > PI) deltaphi -= PI; | |
1882 | if(deltaphi < -PI) deltaphi += PI; | |
1883 | ((TH3F*)fOutputList->FindObject("fPairsDetaDPhiNum"))->Fill(rstep, (fEvt)->fTracks[i].fEta-(fEvt+en2)->fTracks[j].fEta, deltaphi); | |
1884 | } | |
1885 | } | |
5e3e77d6 | 1886 | |
cd12341d | 1887 | // Pair Splitting/Merging cut |
1888 | if(ch1 == ch2){ | |
1889 | if(!AcceptPair((fEvt)->fTracks[i], (fEvt+en2)->fTracks[j])) { | |
1890 | fPairSplitCut[0][i]->AddAt('1',j); | |
1891 | ((TH1F*)fOutputList->FindObject("fRejectedPairs"))->Fill(qinv12); | |
1892 | continue; | |
1893 | } | |
1894 | } | |
5e3e77d6 | 1895 | |
cd12341d | 1896 | // HIJING tests |
1897 | if(fMCcase && fillIndex2==0){ | |
1898 | ||
1899 | // Check that label does not exceed stack size | |
1900 | if((fEvt)->fTracks[i].fLabel < (fEvt)->fMCarraySize && (fEvt+en2)->fTracks[j].fLabel < (fEvt+en2)->fMCarraySize){ | |
1901 | pVect1MC[0]=sqrt(pow((fEvt)->fMCtracks[abs((fEvt)->fTracks[i].fLabel)].fPtot,2)+pow(fTrueMassPi,2)); | |
1902 | pVect2MC[0]=sqrt(pow((fEvt+en2)->fMCtracks[abs((fEvt+en2)->fTracks[j].fLabel)].fPtot,2)+pow(fTrueMassPi,2)); | |
1903 | pVect1MC[1]=(fEvt)->fMCtracks[abs((fEvt)->fTracks[i].fLabel)].fPx; pVect2MC[1]=(fEvt+en2)->fMCtracks[abs((fEvt+en2)->fTracks[j].fLabel)].fPx; | |
1904 | pVect1MC[2]=(fEvt)->fMCtracks[abs((fEvt)->fTracks[i].fLabel)].fPy; pVect2MC[2]=(fEvt+en2)->fMCtracks[abs((fEvt+en2)->fTracks[j].fLabel)].fPy; | |
1905 | pVect1MC[3]=(fEvt)->fMCtracks[abs((fEvt)->fTracks[i].fLabel)].fPz; pVect2MC[3]=(fEvt+en2)->fMCtracks[abs((fEvt+en2)->fTracks[j].fLabel)].fPz; | |
1906 | qinv12MC = GetQinv(fillIndex2, pVect1MC, pVect2MC); | |
1907 | GetQosl(pVect1MC, pVect2MC, qoutMC, qsideMC, qlongMC); | |
1908 | if(qinv12<0.1 && ch1==ch2) { | |
1909 | ((TProfile*)fOutputList->FindObject("fQsmearMean"))->Fill(1.,qinv12-qinv12MC); | |
1910 | ((TProfile*)fOutputList->FindObject("fQsmearSq"))->Fill(1.,1000.*pow(qinv12-qinv12MC,2)); | |
1911 | ((TH1D*)fOutputList->FindObject("fQDist"))->Fill(qinv12-qinv12MC); | |
1912 | } | |
1913 | ||
1914 | ||
654866df | 1915 | for(Int_t rIter=0; rIter<fRVALUES; rIter++){// 3fm to 8fm + 1 Therminator setting |
cd12341d | 1916 | for(Int_t myDampIt=0; myDampIt<kNDampValues; myDampIt++){ |
1917 | Int_t denIndex = rIter*kNDampValues + myDampIt; | |
cd12341d | 1918 | Float_t WInput = MCWeight(ch1,ch2, rIter, myDampIt, qinv12MC); |
1919 | Charge1[bin1].Charge2[bin2].SC[fillIndex2].MB[fMbin].EDB[fEDbin].TwoPT[0].fIdeal->Fill(denIndex, qinv12MC, WInput); | |
1920 | Charge1[bin1].Charge2[bin2].SC[fillIndex2].MB[fMbin].EDB[fEDbin].TwoPT[1].fIdeal->Fill(denIndex, qinv12MC); | |
1921 | Charge1[bin1].Charge2[bin2].SC[fillIndex2].MB[fMbin].EDB[fEDbin].TwoPT[0].fSmeared->Fill(denIndex, qinv12, WInput); | |
1922 | Charge1[bin1].Charge2[bin2].SC[fillIndex2].MB[fMbin].EDB[fEDbin].TwoPT[1].fSmeared->Fill(denIndex, qinv12); | |
1923 | } | |
1924 | } | |
1925 | ||
fa109294 | 1926 | mcParticle1 = (AliAODMCParticle*)mcArray->At(abs((fEvt)->fTracks[i].fLabel)); |
1927 | mcParticle2 = (AliAODMCParticle*)mcArray->At(abs((fEvt+en2)->fTracks[j].fLabel)); | |
1928 | ||
cd12341d | 1929 | //HIJING resonance test |
1930 | if(ch1 != ch2){ | |
cd12341d | 1931 | ((TH1F*)fOutputList->FindObject("fAllOSPairs"))->Fill(fMbin+1, qinv12); |
fa109294 | 1932 | if(abs(mcParticle1->GetPdgCode())==211 && abs(mcParticle2->GetPdgCode())==211){// Pions |
cd12341d | 1933 | if(mcParticle1->GetMother() == mcParticle2->GetMother() && mcParticle1->GetMother() >=0){ |
1934 | ((TH1F*)fOutputList->FindObject("fResonanceOSPairs"))->Fill(fMbin+1, qinv12); | |
1935 | } | |
1936 | } | |
1937 | } | |
90814457 | 1938 | Charge1[bin1].Charge2[bin2].SC[fillIndex2].MB[fMbin].EDB[fEDbin].TwoPT[en2].fMCqinv->Fill(qinv12MC, MCWeight(ch1,ch2,4,5,qinv12MC)); |
1939 | Charge1[bin1].Charge2[bin2].SC[fillIndex2].MB[fMbin].EDB[fEDbin].TwoPT[en2].fMCqinvQW->Fill(qinv12MC, qinv12MC*MCWeight(ch1,ch2,4,5,qinv12MC)); | |
54d66278 | 1940 | // pion purity |
1941 | Charge1[bin1].Charge2[bin2].SC[fillIndex2].MB[fMbin].EDB[fEDbin].TwoPT[en2].fPIDpurityDen->Fill(transK12, qinv12); | |
1942 | if(abs(mcParticle1->GetPdgCode())==211 && abs(mcParticle2->GetPdgCode())==211){// Pions | |
1943 | Charge1[bin1].Charge2[bin2].SC[fillIndex2].MB[fMbin].EDB[fEDbin].TwoPT[en2].fPIDpurityNum->Fill(transK12, qinv12); | |
1944 | } | |
1945 | ||
cd12341d | 1946 | }// label check 2 |
1947 | }// MC case | |
1948 | ||
1949 | ////////////////////////////////////////// | |
1950 | // 2-particle term | |
1951 | Charge1[bin1].Charge2[bin2].SC[fillIndex2].MB[fMbin].EDB[fEDbin].TwoPT[en2].fExplicit2->Fill(transK12, qinv12); | |
5e3e77d6 | 1952 | Charge1[bin1].Charge2[bin2].SC[fillIndex2].MB[fMbin].EDB[fEDbin].TwoPT[en2].fExplicit2QW->Fill(transK12, qinv12, qinv12); |
704f2481 | 1953 | Charge1[bin1].Charge2[bin2].SC[fillIndex2].MB[fMbin].EDB[fEDbin].TwoPT[en2].fAvgP->Fill(transK12, qinv12, (fEvt)->fTracks[i].fMom); |
1954 | Charge1[bin1].Charge2[bin2].SC[fillIndex2].MB[fMbin].EDB[fEDbin].TwoPT[en2].fAvgP->Fill(transK12, qinv12, (fEvt+en2)->fTracks[j].fMom); | |
fa109294 | 1955 | |
cd12341d | 1956 | // osl frame |
fa109294 | 1957 | if(fillIndex2==0){ |
cd12341d | 1958 | if((transK12 > 0.2) && (transK12 < 0.3)){ |
1959 | Charge1[bin1].Charge2[bin2].SC[fillIndex2].MB[fMbin].EDB[fEDbin].TwoPT[en2].OSL_ktbin[0].fExplicit2OSL->Fill(fabs(qout), fabs(qside), fabs(qlong)); | |
1960 | Charge1[bin1].Charge2[bin2].SC[fillIndex2].MB[fMbin].EDB[fEDbin].TwoPT[en2].OSL_ktbin[0].fExplicit2OSLQW->Fill(fabs(qout), fabs(qside), fabs(qlong), qinv12); | |
1961 | } | |
1962 | if((transK12 > 0.6) && (transK12 < 0.7)){ | |
1963 | Charge1[bin1].Charge2[bin2].SC[fillIndex2].MB[fMbin].EDB[fEDbin].TwoPT[en2].OSL_ktbin[1].fExplicit2OSL->Fill(fabs(qout), fabs(qside), fabs(qlong)); | |
1964 | Charge1[bin1].Charge2[bin2].SC[fillIndex2].MB[fMbin].EDB[fEDbin].TwoPT[en2].OSL_ktbin[1].fExplicit2OSLQW->Fill(fabs(qout), fabs(qside), fabs(qlong), qinv12); | |
1965 | } | |
1966 | } | |
5e3e77d6 | 1967 | |
cd12341d | 1968 | ////////////////////////////////////////// |
1969 | if(fTabulatePairs){ | |
1970 | if(fillIndex2==0 && bin1==bin2){ | |
1971 | rapK12 = 0; | |
1972 | transKbin=-1; rapKbin=-1; | |
654866df | 1973 | |
1974 | for(Int_t kIt=0; kIt<fKbinsT; kIt++) {if(transK12 < (fKmiddleT[kIt] + fKstepT[kIt]/2.)) {transKbin = kIt; break;}} | |
1975 | for(Int_t kIt=0; kIt<fKbinsY; kIt++) {if(rapK12 < (fKmiddleY[kIt] + fKstepY[kIt]/2.)) {rapKbin = kIt; break;}} | |
cd12341d | 1976 | if((transKbin<0) || (rapKbin<0)) {cout<<"problem!!!!!!!!!!!!!!!!!!!!!!!!!!!!"<<endl; continue;} |
654866df | 1977 | if((transKbin>=fKbinsT) || (rapKbin>=fKbinsY)) {cout<<"problem!!!!!!!!!!!!!!!!!!!!!!!!!!!!"<<endl; continue;} |
1978 | Float_t WInput = 1.0; | |
1979 | if(fGenerateSignal) { | |
5fc49f8c | 1980 | WInput = MCWeight(ch1,ch2, fRBinMax, fFixedLambdaBinMomRes, qinv12Flat); |
654866df | 1981 | KT[transKbin].KY[rapKbin].MB[fMbin].EDB[fEDbin].TwoPT[en2].fExplicit2ThreeD->Fill(fabs(qoutFlat), fabs(qsideFlat), fabs(qlongFlat), WInput); |
1982 | }else KT[transKbin].KY[rapKbin].MB[fMbin].EDB[fEDbin].TwoPT[en2].fExplicit2ThreeD->Fill(fabs(qout), fabs(qside), fabs(qlong)); | |
1983 | ||
cd12341d | 1984 | continue; |
1985 | } | |
1986 | } | |
1987 | ||
1988 | ||
1989 | // exit out of loop if there are too many pairs | |
654866df | 1990 | if(pairCountSE >= kPairLimit) {exitCode=kTRUE; continue;}// Too many SE pairs |
cd12341d | 1991 | if(exitCode) continue; |
5e3e77d6 | 1992 | |
cd12341d | 1993 | ////////////////////////// |
1994 | // Enforce the Qcut | |
1995 | if(qinv12 <= fQcut[qCutBin]) { | |
5e3e77d6 | 1996 | |
cd12341d | 1997 | /////////////////////////// |
1998 | // particle 1 | |
1999 | (fEvt)->fPairsSE[pairCountSE].fP1[0] = (fEvt)->fTracks[i].fP[0]; | |
2000 | (fEvt)->fPairsSE[pairCountSE].fP1[1] = (fEvt)->fTracks[i].fP[1]; | |
2001 | (fEvt)->fPairsSE[pairCountSE].fP1[2] = (fEvt)->fTracks[i].fP[2]; | |
2002 | (fEvt)->fPairsSE[pairCountSE].fE1 = (fEvt)->fTracks[i].fEaccepted; | |
2003 | (fEvt)->fPairsSE[pairCountSE].fCharge1 = (fEvt)->fTracks[i].fCharge; | |
2004 | (fEvt)->fPairsSE[pairCountSE].fIndex1 = i; | |
2005 | (fEvt)->fPairsSE[pairCountSE].fKey1 = key1; | |
2006 | (fEvt)->fPairsSE[pairCountSE].fLabel1 = (fEvt)->fTracks[i].fLabel; | |
2007 | if(fMCcase && ((fEvt)->fTracks[i].fLabel < (fEvt)->fMCarraySize)){ | |
2008 | (fEvt)->fPairsSE[pairCountSE].fP1MC[0] = (fEvt)->fMCtracks[abs((fEvt)->fTracks[i].fLabel)].fPx; | |
2009 | (fEvt)->fPairsSE[pairCountSE].fP1MC[1] = (fEvt)->fMCtracks[abs((fEvt)->fTracks[i].fLabel)].fPy; | |
2010 | (fEvt)->fPairsSE[pairCountSE].fP1MC[2] = (fEvt)->fMCtracks[abs((fEvt)->fTracks[i].fLabel)].fPz; | |
5e3e77d6 | 2011 | } |
cd12341d | 2012 | // particle 2 |
2013 | (fEvt)->fPairsSE[pairCountSE].fP2[0] = (fEvt+en2)->fTracks[j].fP[0]; | |
2014 | (fEvt)->fPairsSE[pairCountSE].fP2[1] = (fEvt+en2)->fTracks[j].fP[1]; | |
2015 | (fEvt)->fPairsSE[pairCountSE].fP2[2] = (fEvt+en2)->fTracks[j].fP[2]; | |
2016 | (fEvt)->fPairsSE[pairCountSE].fE2 = (fEvt+en2)->fTracks[j].fEaccepted; | |
2017 | (fEvt)->fPairsSE[pairCountSE].fCharge2 = (fEvt+en2)->fTracks[j].fCharge; | |
2018 | (fEvt)->fPairsSE[pairCountSE].fIndex2 = j; | |
2019 | (fEvt)->fPairsSE[pairCountSE].fKey2 = key2; | |
2020 | (fEvt)->fPairsSE[pairCountSE].fLabel2 = (fEvt+en2)->fTracks[j].fLabel; | |
2021 | if(fMCcase && ((fEvt+en2)->fTracks[j].fLabel < (fEvt+en2)->fMCarraySize)){ | |
2022 | (fEvt)->fPairsSE[pairCountSE].fP2MC[0] = (fEvt+en2)->fMCtracks[abs((fEvt+en2)->fTracks[j].fLabel)].fPx; | |
2023 | (fEvt)->fPairsSE[pairCountSE].fP2MC[1] = (fEvt+en2)->fMCtracks[abs((fEvt+en2)->fTracks[j].fLabel)].fPy; | |
2024 | (fEvt)->fPairsSE[pairCountSE].fP2MC[2] = (fEvt+en2)->fMCtracks[abs((fEvt+en2)->fTracks[j].fLabel)].fPz; | |
2025 | } | |
5e3e77d6 | 2026 | |
cd12341d | 2027 | (fEvt)->fPairsSE[pairCountSE].fQinv = qinv12; |
2028 | ||
2029 | fPairLocationSE[i]->AddAt(pairCountSE,j); | |
2030 | ||
2031 | pairCountSE++; | |
2032 | ||
2033 | } | |
2034 | ||
2035 | ||
2036 | ///////////////////////////////////////////////////////// | |
2037 | // Normalization Region | |
2038 | ||
2039 | if((qinv12 >= fNormQcutLow[normBin]) && (qinv12 < fNormQcutHigh[normBin])){ | |
2040 | // particle 1 | |
2041 | fNormPairs[en2][normPairCount[en2]].fCharge1 = (fEvt)->fTracks[i].fCharge; | |
2042 | fNormPairs[en2][normPairCount[en2]].fIndex1 = i; | |
2043 | fNormPairs[en2][normPairCount[en2]].fKey1 = (fEvt)->fTracks[i].fKey; | |
2044 | // particle 2 | |
2045 | fNormPairs[en2][normPairCount[en2]].fCharge2 = (fEvt+en2)->fTracks[j].fCharge; | |
2046 | fNormPairs[en2][normPairCount[en2]].fIndex2 = j; | |
2047 | fNormPairs[en2][normPairCount[en2]].fKey2 = (fEvt+en2)->fTracks[j].fKey; | |
2048 | ||
2049 | ||
2050 | //other past pairs with particle j | |
2051 | for(Int_t pastpair=0; pastpair<numOtherPairs2[0][j]; pastpair++){ | |
2052 | Int_t locationOtherPair = fOtherPairLocation2[0][j]->At(pastpair); | |
2053 | if(locationOtherPair < 0) continue;// no pair there | |
2054 | Int_t indexOther1 = i; | |
2055 | Int_t indexOther2 = fNormPairs[0][ locationOtherPair ].fIndex1; | |
2056 | ||
2057 | // Both possible orderings of other indexes | |
2058 | if( (fNormPairSwitch[0][indexOther1]->At(indexOther2)=='1') || (fNormPairSwitch[0][indexOther2]->At(indexOther1)=='1')) { | |
2059 | ||
2060 | // 1 and 2 are from SE | |
2061 | ch3 = Int_t((fNormPairs[0][ locationOtherPair ].fCharge1 + 1)/2.); | |
2062 | key3 = fNormPairs[0][ locationOtherPair ].fKey1; | |
2063 | Short_t fillIndex3 = FillIndex3part(key1+key2+key3); | |
2064 | SetFillBins3(fillIndex3, key1, key2, key3, ch1, ch2, ch3, 0, bin1, bin2, bin3, fDummyB, fDummyB, fDummyB); | |
2065 | ||
2066 | tempNormFillCount[bin1][bin2][bin3][fillIndex3][0]++; | |
2067 | } | |
2068 | ||
2069 | }// pastpair P11 loop | |
2070 | ||
2071 | ||
2072 | fNormPairSwitch[en2][i]->AddAt('1',j); | |
2073 | fOtherPairLocation1[en2][i]->AddAt(normPairCount[en2], numOtherPairs1[en2][i]);// location of otherpair with i as 1st particle | |
2074 | fOtherPairLocation2[en2][j]->AddAt(normPairCount[en2], numOtherPairs2[en2][j]);// location of otherpair with j as 2nd particle | |
2075 | ||
2076 | numOtherPairs1[en2][i]++; | |
2077 | numOtherPairs2[en2][j]++; | |
2078 | ||
2079 | ||
2080 | normPairCount[en2]++; | |
2081 | if(normPairCount[en2] >= kNormPairLimit) exitCode=kTRUE; | |
2082 | ||
2083 | }// Norm Region | |
2084 | ||
2085 | }// j particle | |
2086 | }// i particle | |
2087 | ||
2088 | ||
2089 | ||
2090 | ////////////////////////////////////////////// | |
2091 | // P12 pairing | |
2092 | // 1st Particle | |
2093 | for (Int_t i=0; i<myTracks; i++) { | |
2094 | ||
2095 | Int_t en2=1; | |
2096 | ||
2097 | // 2nd particle | |
2098 | for (Int_t j=0; j<(fEvt+en2)->fNtracks; j++) { | |
2099 | ||
2100 | key1 = (fEvt)->fTracks[i].fKey; | |
2101 | key2 = (fEvt+en2)->fTracks[j].fKey; | |
2102 | Short_t fillIndex2 = FillIndex2part(key1+key2); | |
2103 | Short_t qCutBin = SetQcutBin(fillIndex2); | |
2104 | Short_t normBin = SetNormBin(fillIndex2); | |
2105 | pVect1[0]=(fEvt)->fTracks[i].fEaccepted; pVect2[0]=(fEvt+en2)->fTracks[j].fEaccepted; | |
2106 | pVect1[1]=(fEvt)->fTracks[i].fP[0]; pVect2[1]=(fEvt+en2)->fTracks[j].fP[0]; | |
2107 | pVect1[2]=(fEvt)->fTracks[i].fP[1]; pVect2[2]=(fEvt+en2)->fTracks[j].fP[1]; | |
2108 | pVect1[3]=(fEvt)->fTracks[i].fP[2]; pVect2[3]=(fEvt+en2)->fTracks[j].fP[2]; | |
654866df | 2109 | |
cd12341d | 2110 | qinv12 = GetQinv(fillIndex2, pVect1, pVect2); |
2111 | GetQosl(pVect1, pVect2, qout, qside, qlong); | |
2112 | transK12 = sqrt(pow(pVect1[1]+pVect2[1],2) + pow(pVect1[2]+pVect2[2],2))/2.; | |
654866df | 2113 | |
2114 | if(fGenerateSignal){// Flatten the Q-dist to increase pair population at low-q (testing purposes only) | |
5fc49f8c | 2115 | /*Float_t Qflattened = 0.005 + 0.2*gRandom->Rndm(); |
654866df | 2116 | Float_t theta12 = PI*gRandom->Rndm(); |
2117 | Float_t phi12 = 2*PI*gRandom->Rndm(); | |
2118 | pVect2Flat[1] = pVect1[1] + Qflattened*sin(theta12)*cos(phi12); | |
2119 | pVect2Flat[2] = pVect1[2] + Qflattened*sin(theta12)*sin(phi12); | |
2120 | pVect2Flat[3] = pVect1[3] + Qflattened*cos(theta12); | |
5fc49f8c | 2121 | pVect2Flat[0] = sqrt(pow(pVect2Flat[1],2)+pow(pVect2Flat[2],2)+pow(pVect2Flat[3],2)+pow(fTrueMassPi,2));*/ |
654866df | 2122 | // |
5fc49f8c | 2123 | pVect2Flat[0]=pVect2[0]; pVect2Flat[1]=pVect2[1]; pVect2Flat[2]=pVect2[2]; pVect2Flat[3]=pVect2[3]; |
654866df | 2124 | // |
2125 | qinv12Flat = GetQinv(fillIndex2, pVect1, pVect2Flat); | |
2126 | GetQosl(pVect1, pVect2Flat, qoutFlat, qsideFlat, qlongFlat); | |
2127 | } | |
cd12341d | 2128 | |
2129 | if(qinv12 < fQLowerCut) continue;// remove unwanted low-q pairs (also a type of track splitting cut) | |
2130 | ||
2131 | /////////////////////////////// | |
2132 | ch1 = Int_t(((fEvt)->fTracks[i].fCharge + 1)/2.); | |
2133 | ch2 = Int_t(((fEvt+en2)->fTracks[j].fCharge + 1)/2.); | |
2134 | SetFillBins2(fillIndex2, key1, key2, ch1, ch2, bin1, bin2); | |
2135 | ||
2136 | if(fMCcase && ch1==ch2 && fMbin==0){ | |
2137 | for(Int_t rstep=0; rstep<10; rstep++){ | |
2138 | Float_t coeff = (rstep)*0.2*(0.18/1.2); | |
2139 | // propagate through B field to r=1.2m | |
2140 | Float_t phi1 = (fEvt)->fTracks[i].fPhi - asin((fEvt)->fTracks[i].fCharge*(0.1*fBfield)*coeff/(fEvt)->fTracks[i].fPt); | |
2141 | if(phi1 > 2*PI) phi1 -= 2*PI; | |
2142 | if(phi1 < 0) phi1 += 2*PI; | |
2143 | Float_t phi2 = (fEvt+en2)->fTracks[j].fPhi - asin((fEvt+en2)->fTracks[j].fCharge*(0.1*fBfield)*coeff/(fEvt+en2)->fTracks[j].fPt); | |
2144 | if(phi2 > 2*PI) phi2 -= 2*PI; | |
2145 | if(phi2 < 0) phi2 += 2*PI; | |
2146 | Float_t deltaphi = phi1 - phi2; | |
2147 | if(deltaphi > PI) deltaphi -= PI; | |
2148 | if(deltaphi < -PI) deltaphi += PI; | |
2149 | ((TH3F*)fOutputList->FindObject("fPairsDetaDPhiDen"))->Fill(rstep, (fEvt)->fTracks[i].fEta-(fEvt+en2)->fTracks[j].fEta, deltaphi); | |
2150 | } | |
2151 | } | |
2152 | ||
2153 | if(ch1 == ch2){ | |
2154 | if(!AcceptPair((fEvt)->fTracks[i], (fEvt+en2)->fTracks[j])) { | |
2155 | fPairSplitCut[1][i]->AddAt('1',j); | |
2156 | continue; | |
2157 | } | |
2158 | } | |
2159 | ||
2160 | ////////////////////////////////////////// | |
2161 | // 2-particle term | |
2162 | Charge1[bin1].Charge2[bin2].SC[fillIndex2].MB[fMbin].EDB[fEDbin].TwoPT[en2].fExplicit2->Fill(transK12, qinv12); | |
5e3e77d6 | 2163 | Charge1[bin1].Charge2[bin2].SC[fillIndex2].MB[fMbin].EDB[fEDbin].TwoPT[en2].fExplicit2QW->Fill(transK12, qinv12, qinv12); |
2164 | ||
cd12341d | 2165 | // osl frame |
fa109294 | 2166 | if(fillIndex2==0){ |
2167 | if((transK12 > 0.2) && (transK12 < 0.3)){ | |
cd12341d | 2168 | Charge1[bin1].Charge2[bin2].SC[fillIndex2].MB[fMbin].EDB[fEDbin].TwoPT[en2].OSL_ktbin[0].fExplicit2OSL->Fill(fabs(qout), fabs(qside), fabs(qlong)); |
2169 | Charge1[bin1].Charge2[bin2].SC[fillIndex2].MB[fMbin].EDB[fEDbin].TwoPT[en2].OSL_ktbin[0].fExplicit2OSLQW->Fill(fabs(qout), fabs(qside), fabs(qlong), qinv12); | |
2170 | } | |
2171 | if((transK12 > 0.6) && (transK12 < 0.7)){ | |
2172 | Charge1[bin1].Charge2[bin2].SC[fillIndex2].MB[fMbin].EDB[fEDbin].TwoPT[en2].OSL_ktbin[1].fExplicit2OSL->Fill(fabs(qout), fabs(qside), fabs(qlong)); | |
2173 | Charge1[bin1].Charge2[bin2].SC[fillIndex2].MB[fMbin].EDB[fEDbin].TwoPT[en2].OSL_ktbin[1].fExplicit2OSLQW->Fill(fabs(qout), fabs(qside), fabs(qlong), qinv12); | |
2174 | } | |
2175 | } | |
2176 | ////////////////////////////////////////// | |
2177 | if(fTabulatePairs){ | |
2178 | if(fillIndex2==0 && bin1==bin2){ | |
2179 | rapK12 = 0; | |
2180 | transKbin=-1; rapKbin=-1; | |
654866df | 2181 | |
2182 | for(Int_t kIt=0; kIt<fKbinsT; kIt++) {if(transK12 < (fKmiddleT[kIt] + fKstepT[kIt]/2.)) {transKbin = kIt; break;}} | |
2183 | for(Int_t kIt=0; kIt<fKbinsY; kIt++) {if(rapK12 < (fKmiddleY[kIt] + fKstepY[kIt]/2.)) {rapKbin = kIt; break;}} | |
cd12341d | 2184 | if((transKbin<0) || (rapKbin<0)) {cout<<"problem!!!!!!!!!!!!!!!!!!!!!!!!!!!!"<<endl; continue;} |
654866df | 2185 | if((transKbin>=fKbinsT) || (rapKbin>=fKbinsY)) {cout<<"problem!!!!!!!!!!!!!!!!!!!!!!!!!!!!"<<endl; continue;} |
2186 | ||
2187 | if(fGenerateSignal) KT[transKbin].KY[rapKbin].MB[fMbin].EDB[fEDbin].TwoPT[en2].fExplicit2ThreeD->Fill(fabs(qoutFlat), fabs(qsideFlat), fabs(qlongFlat)); | |
2188 | else KT[transKbin].KY[rapKbin].MB[fMbin].EDB[fEDbin].TwoPT[en2].fExplicit2ThreeD->Fill(fabs(qout), fabs(qside), fabs(qlong)); | |
2189 | ||
cd12341d | 2190 | continue; |
2191 | } | |
2192 | } | |
2193 | ||
2194 | ||
654866df | 2195 | if(pairCountME >= 2*kPairLimit) {exitCode=kTRUE; continue;}// Too many SE pairs |
cd12341d | 2196 | if(exitCode) continue; |
2197 | ||
2198 | if(qinv12 <= fQcut[qCutBin]) { | |
2199 | /////////////////////////// | |
2200 | ||
2201 | // particle 1 | |
2202 | (fEvt)->fPairsME[pairCountME].fP1[0] = (fEvt)->fTracks[i].fP[0]; | |
2203 | (fEvt)->fPairsME[pairCountME].fP1[1] = (fEvt)->fTracks[i].fP[1]; | |
2204 | (fEvt)->fPairsME[pairCountME].fP1[2] = (fEvt)->fTracks[i].fP[2]; | |
2205 | (fEvt)->fPairsME[pairCountME].fE1 = (fEvt)->fTracks[i].fEaccepted; | |
2206 | (fEvt)->fPairsME[pairCountME].fCharge1 = (fEvt)->fTracks[i].fCharge; | |
2207 | (fEvt)->fPairsME[pairCountME].fIndex1 = i; | |
2208 | (fEvt)->fPairsME[pairCountME].fKey1 = key1; | |
2209 | (fEvt)->fPairsME[pairCountME].fLabel1 = (fEvt)->fTracks[i].fLabel; | |
2210 | if(fMCcase && ((fEvt)->fTracks[i].fLabel < (fEvt)->fMCarraySize)){ | |
2211 | (fEvt)->fPairsME[pairCountME].fP1MC[0] = (fEvt)->fMCtracks[abs((fEvt)->fTracks[i].fLabel)].fPx; | |
2212 | (fEvt)->fPairsME[pairCountME].fP1MC[1] = (fEvt)->fMCtracks[abs((fEvt)->fTracks[i].fLabel)].fPy; | |
2213 | (fEvt)->fPairsME[pairCountME].fP1MC[2] = (fEvt)->fMCtracks[abs((fEvt)->fTracks[i].fLabel)].fPz; | |
2214 | } | |
2215 | // particle 2 | |
2216 | (fEvt)->fPairsME[pairCountME].fP2[0] = (fEvt+en2)->fTracks[j].fP[0]; | |
2217 | (fEvt)->fPairsME[pairCountME].fP2[1] = (fEvt+en2)->fTracks[j].fP[1]; | |
2218 | (fEvt)->fPairsME[pairCountME].fP2[2] = (fEvt+en2)->fTracks[j].fP[2]; | |
2219 | (fEvt)->fPairsME[pairCountME].fE2 = (fEvt+en2)->fTracks[j].fEaccepted; | |
2220 | (fEvt)->fPairsME[pairCountME].fCharge2 = (fEvt+en2)->fTracks[j].fCharge; | |
2221 | (fEvt)->fPairsME[pairCountME].fIndex2 = j; | |
2222 | (fEvt)->fPairsME[pairCountME].fKey2 = key2; | |
2223 | (fEvt)->fPairsME[pairCountME].fLabel2 = (fEvt+en2)->fTracks[j].fLabel; | |
2224 | if(fMCcase && ((fEvt+en2)->fTracks[j].fLabel < (fEvt+en2)->fMCarraySize)){ | |
2225 | (fEvt)->fPairsME[pairCountME].fP2MC[0] = (fEvt+en2)->fMCtracks[abs((fEvt+en2)->fTracks[j].fLabel)].fPx; | |
2226 | (fEvt)->fPairsME[pairCountME].fP2MC[1] = (fEvt+en2)->fMCtracks[abs((fEvt+en2)->fTracks[j].fLabel)].fPy; | |
2227 | (fEvt)->fPairsME[pairCountME].fP2MC[2] = (fEvt+en2)->fMCtracks[abs((fEvt+en2)->fTracks[j].fLabel)].fPz; | |
2228 | } | |
2229 | ||
2230 | (fEvt)->fPairsME[pairCountME].fQinv = qinv12; | |
2231 | ||
2232 | fPairLocationME[i]->AddAt(Int_t(pairCountME),j); | |
2233 | ||
2234 | pairCountME++; | |
2235 | ||
2236 | } | |
2237 | ||
2238 | if((qinv12 >= fNormQcutLow[normBin]) && (qinv12 < fNormQcutHigh[normBin])){ | |
2239 | // particle 1 | |
2240 | fNormPairs[en2][normPairCount[en2]].fCharge1 = (fEvt)->fTracks[i].fCharge; | |
2241 | fNormPairs[en2][normPairCount[en2]].fIndex1 = i; | |
2242 | fNormPairs[en2][normPairCount[en2]].fKey1 = (fEvt)->fTracks[i].fKey; | |
2243 | // particle 2 | |
2244 | fNormPairs[en2][normPairCount[en2]].fCharge2 = (fEvt+en2)->fTracks[j].fCharge; | |
2245 | fNormPairs[en2][normPairCount[en2]].fIndex2 = j; | |
2246 | fNormPairs[en2][normPairCount[en2]].fKey2 = (fEvt+en2)->fTracks[j].fKey; | |
2247 | ||
2248 | //other past pairs in P11 with particle i | |
2249 | for(Int_t pastpairP11=0; pastpairP11<numOtherPairs2[0][i]; pastpairP11++){// past pair in P11 with i as 1st and 2nd particle | |
2250 | Int_t locationOtherPairP11 = fOtherPairLocation2[0][i]->At(pastpairP11);// i is 2nd particle | |
2251 | if(locationOtherPairP11 < 0) continue;// no pair there | |
2252 | Int_t indexOther1P11 = fNormPairs[0][ locationOtherPairP11 ].fIndex1; | |
2253 | ||
2254 | //Check other past pairs in P12 | |
2255 | if( (fNormPairSwitch[1][indexOther1P11]->At(j)=='0')) continue; | |
2256 | ||
2257 | // 1 and 3 are from SE | |
2258 | ch3 = Int_t((fNormPairs[0][ locationOtherPairP11 ].fCharge1 + 1)/2.);// charge of second particle in P11 | |
2259 | key3 = fNormPairs[0][ locationOtherPairP11 ].fKey1; | |
2260 | Short_t fillIndex3 = FillIndex3part(key1+key2+key3); | |
2261 | Bool_t fill2=kFALSE, fill3=kFALSE, fill4=kFALSE; | |
2262 | SetFillBins3(fillIndex3, key1, key2, key3, ch1, ch2, ch3, 2, bin1, bin2, bin3, fill2, fill3, fill4); | |
2263 | ||
2264 | ||
2265 | if(fill2) tempNormFillCount[bin1][bin2][bin3][fillIndex3][1]++; | |
2266 | if(fill3) tempNormFillCount[bin1][bin2][bin3][fillIndex3][2]++; | |
2267 | if(fill4) tempNormFillCount[bin1][bin2][bin3][fillIndex3][3]++; | |
2268 | ||
2269 | ||
2270 | }// P11 loop | |
2271 | ||
2272 | ||
2273 | fNormPairSwitch[en2][i]->AddAt('1',j); | |
2274 | fOtherPairLocation1[en2][i]->AddAt(normPairCount[en2], numOtherPairs1[en2][i]);// location of otherpair with i as 1st particle | |
2275 | fOtherPairLocation2[en2][j]->AddAt(normPairCount[en2], numOtherPairs2[en2][j]);// location of otherpair with j as 2nd particle | |
2276 | ||
2277 | numOtherPairs1[en2][i]++; | |
2278 | numOtherPairs2[en2][j]++; | |
2279 | ||
2280 | normPairCount[en2]++; | |
2281 | if(normPairCount[en2] >= kNormPairLimit) exitCode=kTRUE; | |
2282 | ||
2283 | }// Norm Region | |
2284 | ||
2285 | ||
2286 | } | |
2287 | } | |
2288 | ||
2289 | ||
2290 | /////////////////////////////////////// | |
2291 | // P13 pairing (just for Norm counting of term5) | |
2292 | for (Int_t i=0; i<myTracks; i++) { | |
2293 | ||
2294 | // exit out of loop if there are too many pairs | |
2295 | // dont bother with this loop if exitCode is set. | |
2296 | if(exitCode) break; | |
2297 | ||
2298 | // 2nd particle | |
2299 | Int_t en2=2; | |
2300 | ||
2301 | for (Int_t j=0; j<(fEvt+en2)->fNtracks; j++) { | |
2302 | ||
2303 | key1 = (fEvt)->fTracks[i].fKey; | |
2304 | key2 = (fEvt+en2)->fTracks[j].fKey; | |
2305 | Short_t fillIndex2 = FillIndex2part(key1+key2); | |
2306 | Short_t normBin = SetNormBin(fillIndex2); | |
2307 | pVect1[0]=(fEvt)->fTracks[i].fEaccepted; pVect2[0]=(fEvt+en2)->fTracks[j].fEaccepted; | |
2308 | pVect1[1]=(fEvt)->fTracks[i].fP[0]; pVect2[1]=(fEvt+en2)->fTracks[j].fP[0]; | |
2309 | pVect1[2]=(fEvt)->fTracks[i].fP[1]; pVect2[2]=(fEvt+en2)->fTracks[j].fP[1]; | |
2310 | pVect1[3]=(fEvt)->fTracks[i].fP[2]; pVect2[3]=(fEvt+en2)->fTracks[j].fP[2]; | |
2311 | ||
2312 | qinv12 = GetQinv(fillIndex2, pVect1, pVect2); | |
2313 | ||
2314 | if(qinv12 < fQLowerCut) continue;// remove unwanted low-q pairs (also a type of track splitting cut) | |
2315 | ||
2316 | ch1 = Int_t(((fEvt)->fTracks[i].fCharge + 1)/2.); | |
2317 | ch2 = Int_t(((fEvt+en2)->fTracks[j].fCharge + 1)/2.); | |
2318 | ||
2319 | if(ch1 == ch2){ | |
2320 | if(!AcceptPair((fEvt)->fTracks[i], (fEvt+en2)->fTracks[j])) { | |
2321 | fPairSplitCut[2][i]->AddAt('1',j); | |
2322 | continue; | |
2323 | } | |
2324 | } | |
2325 | ||
2326 | ///////////////////////////////////////////////////////// | |
2327 | // Normalization Region | |
2328 | ||
2329 | if((qinv12 >= fNormQcutLow[normBin]) && (qinv12 < fNormQcutHigh[normBin])){ | |
2330 | ||
2331 | fNormPairSwitch[en2][i]->AddAt('1',j); | |
2332 | ||
2333 | }// Norm Region | |
2334 | } | |
2335 | } | |
2336 | ||
2337 | ||
2338 | ||
2339 | /////////////////////////////////////// | |
2340 | // P23 pairing (just for Norm counting of term5) | |
2341 | Int_t en1=1; | |
2342 | for (Int_t i=0; i<(fEvt+en1)->fNtracks; i++) { | |
2343 | ||
2344 | // exit out of loop if there are too many pairs | |
2345 | // dont bother with this loop if exitCode is set. | |
2346 | if(exitCode) break; | |
2347 | ||
2348 | // 2nd event | |
2349 | Int_t en2=2; | |
2350 | // 2nd particle | |
2351 | for (Int_t j=0; j<(fEvt+en2)->fNtracks; j++) { | |
2352 | ||
2353 | if(exitCode) break; | |
2354 | ||
2355 | key1 = (fEvt+en1)->fTracks[i].fKey; | |
2356 | key2 = (fEvt+en2)->fTracks[j].fKey; | |
2357 | Short_t fillIndex2 = FillIndex2part(key1+key2); | |
2358 | Short_t normBin = SetNormBin(fillIndex2); | |
2359 | pVect1[0]=(fEvt+en1)->fTracks[i].fEaccepted; pVect2[0]=(fEvt+en2)->fTracks[j].fEaccepted; | |
2360 | pVect1[1]=(fEvt+en1)->fTracks[i].fP[0]; pVect2[1]=(fEvt+en2)->fTracks[j].fP[0]; | |
2361 | pVect1[2]=(fEvt+en1)->fTracks[i].fP[1]; pVect2[2]=(fEvt+en2)->fTracks[j].fP[1]; | |
2362 | pVect1[3]=(fEvt+en1)->fTracks[i].fP[2]; pVect2[3]=(fEvt+en2)->fTracks[j].fP[2]; | |
2363 | ||
2364 | qinv12 = GetQinv(fillIndex2, pVect1, pVect2); | |
2365 | ||
2366 | if(qinv12 < fQLowerCut) continue;// remove unwanted low-q pairs (also a type of track splitting cut) | |
2367 | ||
2368 | /////////////////////////////// | |
2369 | ch1 = Int_t(((fEvt+en1)->fTracks[i].fCharge + 1)/2.); | |
2370 | ch2 = Int_t(((fEvt+en2)->fTracks[j].fCharge + 1)/2.); | |
2371 | ||
2372 | if(ch1 == ch2){ | |
2373 | if(!AcceptPair((fEvt+en1)->fTracks[i], (fEvt+en2)->fTracks[j])) { | |
2374 | fPairSplitCut[3][i]->AddAt('1',j); | |
2375 | continue; | |
2376 | } | |
2377 | } | |
2378 | ||
2379 | if((qinv12 < fNormQcutLow[normBin]) || (qinv12 >= fNormQcutHigh[normBin])) continue; | |
2380 | ||
2381 | Int_t index1P23 = i; | |
2382 | Int_t index2P23 = j; | |
2383 | ||
2384 | for(Int_t pastpairP12=0; pastpairP12<numOtherPairs2[1][index1P23]; pastpairP12++){// loop in P12 with i as 2nd particle | |
2385 | Int_t locationOtherPairP12 = fOtherPairLocation2[1][index1P23]->At(pastpairP12); | |
2386 | if(locationOtherPairP12 < 0) continue; // no pair there | |
2387 | Int_t index1P12 = fNormPairs[1][ locationOtherPairP12 ].fIndex1; | |
2388 | ||
2389 | ||
2390 | //Check other past pair status in P13 | |
2391 | if( (fNormPairSwitch[2][index1P12]->At(index2P23)=='0')) continue; | |
2392 | ||
2393 | // all from different event | |
2394 | ch3 = Int_t((fNormPairs[1][ locationOtherPairP12 ].fCharge1 + 1)/2.);// charge of first particle in P12 | |
2395 | key3 = fNormPairs[1][ locationOtherPairP12 ].fKey1; | |
2396 | Short_t fillIndex3 = FillIndex3part(key1+key2+key3); | |
2397 | SetFillBins3(fillIndex3, key1, key2, key3, ch1, ch2, ch3, 3, bin1, bin2, bin3, fDummyB, fDummyB, fDummyB); | |
2398 | ||
2399 | tempNormFillCount[bin1][bin2][bin3][fillIndex3][4]++; | |
2400 | } | |
2401 | } | |
2402 | } | |
2403 | ||
2404 | ||
2405 | ||
2406 | ||
2407 | /////////////////////////////////////////////////// | |
2408 | // Do not use pairs from events with too many pairs | |
2409 | if(exitCode) { | |
2410 | cout<<"SE or ME or Norm PairCount too large. Discarding all pairs and skipping event"<<endl; | |
2411 | (fEvt)->fNpairsSE = 0; | |
2412 | (fEvt)->fNpairsME = 0; | |
2413 | ((TH1F*)fOutputList->FindObject("fRejectedEvents"))->Fill(fMbin+1); | |
2414 | return;// Skip event | |
2415 | }else{ | |
2416 | (fEvt)->fNpairsSE = pairCountSE; | |
2417 | (fEvt)->fNpairsME = pairCountME; | |
2418 | ((TH1F*)fOutputList->FindObject("fEvents2"))->Fill(fMbin+1); | |
2419 | } | |
2420 | /////////////////////////////////////////////////// | |
2421 | ||
cd12341d | 2422 | |
2423 | //cout<<"pairCountSE = "<<pairCountSE<<" pairCountME = "<<pairCountME<<endl; | |
b6e5ec54 | 2424 | //cout<<"Start Main analysis"<<endl; |
cd12341d | 2425 | |
2426 | /////////////////////////////////////////////////////////////////////// | |
2427 | /////////////////////////////////////////////////////////////////////// | |
2428 | /////////////////////////////////////////////////////////////////////// | |
2429 | // | |
2430 | // | |
5e3e77d6 | 2431 | // Start the Main Correlation Analysis |
cd12341d | 2432 | // |
2433 | // | |
2434 | /////////////////////////////////////////////////////////////////////// | |
2435 | ||
f5df8b1d | 2436 | |
654866df | 2437 | |
cd12341d | 2438 | ///////////////////////////////////////////////////////// |
2439 | // Skip 3-particle part if Tabulate6DPairs is set to true | |
2440 | if(fTabulatePairs) return; | |
2441 | ///////////////////////////////////////////////////////// | |
2442 | ||
2443 | // Set the Normalization counters | |
2444 | for(Int_t termN=0; termN<5; termN++){ | |
2445 | ||
2446 | if(termN==0){ | |
2447 | if((fEvt)->fNtracks ==0) continue; | |
2448 | }else if(termN<4){ | |
2449 | if((fEvt)->fNtracks ==0) continue; | |
2450 | if((fEvt+1)->fNtracks ==0) continue; | |
2451 | }else { | |
2452 | if((fEvt)->fNtracks ==0) continue; | |
2453 | if((fEvt+1)->fNtracks ==0) continue; | |
2454 | if((fEvt+2)->fNtracks ==0) continue; | |
2455 | } | |
654866df | 2456 | |
cd12341d | 2457 | for(Int_t sc=0; sc<kSCLimit3; sc++){ |
2458 | ||
2459 | for(Int_t c1=0; c1<2; c1++){ | |
2460 | for(Int_t c2=0; c2<2; c2++){ | |
2461 | for(Int_t c3=0; c3<2; c3++){ | |
2462 | ||
2463 | if(sc==0 || sc==6 || sc==9){// Identical species | |
2464 | if( (c1+c2+c3)==1) {if(c1!=0 || c2!=0 || c3!=1) continue;} | |
2465 | if( (c1+c2+c3)==2) {if(c1!=0) continue;} | |
2466 | }else if(sc!=5){ | |
2467 | if( (c1+c2)==1) {if(c1!=0) continue;} | |
2468 | }else {}// do nothing for pi-k-p case | |
2469 | Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[fMbin].EDB[fEDbin].ThreePT[termN].fNorm3->Fill(0.,tempNormFillCount[c1][c2][c3][sc][termN]); | |
2470 | } | |
2471 | } | |
2472 | } | |
2473 | } | |
2474 | } | |
2475 | ||
2476 | ||
2477 | ||
2478 | ///////////////////////////////////////////// | |
2479 | // Calculate Pair-Cut Correlations | |
2480 | for(Int_t en1case=0; en1case<2; en1case++){// limit at 2 (normal) | |
2481 | ||
2482 | Int_t nump1=0; | |
2483 | if(en1case==0) nump1 = (fEvt)->fNpairsSE; | |
2484 | if(en1case==1) nump1 = (fEvt)->fNpairsME; | |
2485 | ||
2486 | // 1st pair | |
2487 | for(Int_t p1=0; p1<nump1; p1++){ | |
2488 | ||
2489 | if(en1case==0){ | |
2490 | ch1 = Int_t(((fEvt)->fPairsSE[p1].fCharge1 + 1)/2.); | |
2491 | ch2 = Int_t(((fEvt)->fPairsSE[p1].fCharge2 + 1)/2.); | |
2492 | pVect1[0] = (fEvt)->fPairsSE[p1].fE1; pVect2[0] = (fEvt)->fPairsSE[p1].fE2; | |
2493 | pVect1[1] = (fEvt)->fPairsSE[p1].fP1[0]; pVect2[1] = (fEvt)->fPairsSE[p1].fP2[0]; | |
2494 | pVect1[2] = (fEvt)->fPairsSE[p1].fP1[1]; pVect2[2] = (fEvt)->fPairsSE[p1].fP2[1]; | |
2495 | pVect1[3] = (fEvt)->fPairsSE[p1].fP1[2]; pVect2[3] = (fEvt)->fPairsSE[p1].fP2[2]; | |
2496 | index1 = (fEvt)->fPairsSE[p1].fIndex1; index2 = (fEvt)->fPairsSE[p1].fIndex2; | |
2497 | key1 = (fEvt)->fPairsSE[p1].fKey1; key2 = (fEvt)->fPairsSE[p1].fKey2; | |
2498 | pVect1MC[1] = (fEvt)->fPairsSE[p1].fP1MC[0]; pVect2MC[1] = (fEvt)->fPairsSE[p1].fP2MC[0]; | |
2499 | pVect1MC[2] = (fEvt)->fPairsSE[p1].fP1MC[1]; pVect2MC[2] = (fEvt)->fPairsSE[p1].fP2MC[1]; | |
2500 | pVect1MC[3] = (fEvt)->fPairsSE[p1].fP1MC[2]; pVect2MC[3] = (fEvt)->fPairsSE[p1].fP2MC[2]; | |
2501 | pVect1MC[0] = sqrt(pow(pVect1MC[1],2)+pow(pVect1MC[2],2)+pow(pVect1MC[3],2)+pow(fTrueMassPi,2)); | |
2502 | pVect2MC[0] = sqrt(pow(pVect2MC[1],2)+pow(pVect2MC[2],2)+pow(pVect2MC[3],2)+pow(fTrueMassPi,2)); | |
654866df | 2503 | |
cd12341d | 2504 | qinv12 = (fEvt)->fPairsSE[p1].fQinv; |
2505 | } | |
2506 | if(en1case==1){ | |
2507 | ch1 = Int_t(((fEvt)->fPairsME[p1].fCharge1 + 1)/2.); | |
2508 | ch2 = Int_t(((fEvt)->fPairsME[p1].fCharge2 + 1)/2.); | |
2509 | pVect1[0] = (fEvt)->fPairsME[p1].fE1; pVect2[0] = (fEvt)->fPairsME[p1].fE2; | |
2510 | pVect1[1] = (fEvt)->fPairsME[p1].fP1[0]; pVect2[1] = (fEvt)->fPairsME[p1].fP2[0]; | |
2511 | pVect1[2] = (fEvt)->fPairsME[p1].fP1[1]; pVect2[2] = (fEvt)->fPairsME[p1].fP2[1]; | |
2512 | pVect1[3] = (fEvt)->fPairsME[p1].fP1[2]; pVect2[3] = (fEvt)->fPairsME[p1].fP2[2]; | |
2513 | index1 = (fEvt)->fPairsME[p1].fIndex1; index2 = (fEvt)->fPairsME[p1].fIndex2; | |
2514 | key1 = (fEvt)->fPairsME[p1].fKey1; key2 = (fEvt)->fPairsME[p1].fKey2; | |
2515 | pVect1MC[1] = (fEvt)->fPairsME[p1].fP1MC[0]; pVect2MC[1] = (fEvt)->fPairsME[p1].fP2MC[0]; | |
2516 | pVect1MC[2] = (fEvt)->fPairsME[p1].fP1MC[1]; pVect2MC[2] = (fEvt)->fPairsME[p1].fP2MC[1]; | |
2517 | pVect1MC[3] = (fEvt)->fPairsME[p1].fP1MC[2]; pVect2MC[3] = (fEvt)->fPairsME[p1].fP2MC[2]; | |
2518 | pVect1MC[0] = sqrt(pow(pVect1MC[1],2)+pow(pVect1MC[2],2)+pow(pVect1MC[3],2)+pow(fTrueMassPi,2)); | |
2519 | pVect2MC[0] = sqrt(pow(pVect2MC[1],2)+pow(pVect2MC[2],2)+pow(pVect2MC[3],2)+pow(fTrueMassPi,2)); | |
2520 | ||
2521 | qinv12 = (fEvt)->fPairsME[p1].fQinv; | |
2522 | } | |
2523 | ||
140107fb | 2524 | /*if(fGenerateSignal){ |
2525 | Bool_t goodFlattenedPair=kFALSE; | |
2526 | while(!goodFlattenedPair){ | |
2527 | Float_t Qflattened = fQLowerCut + (fQcut[0]-fQLowerCut)*gRandom->Rndm(); | |
2528 | Float_t theta12 = PI*gRandom->Rndm(); | |
2529 | Float_t phi12 = 2*PI*gRandom->Rndm(); | |
2530 | pVect2Flat[1] = pVect1[1] + Qflattened*sin(theta12)*cos(phi12); | |
2531 | pVect2Flat[2] = pVect1[2] + Qflattened*sin(theta12)*sin(phi12); | |
2532 | pVect2Flat[3] = pVect1[3] + Qflattened*cos(theta12); | |
2533 | pVect2Flat[0] = sqrt(pow(pVect2Flat[1],2)+pow(pVect2Flat[2],2)+pow(pVect2Flat[3],2)+pow(fTrueMassPi,2)); | |
2534 | // | |
2535 | //pVect2Flat[0]=pVect2[0]; pVect2Flat[1]=pVect2[1]; pVect2Flat[2]=pVect2[2]; pVect2Flat[3]=pVect2[3]; | |
2536 | // | |
2537 | qinv12 = GetQinv(0, pVect1, pVect2Flat); | |
2538 | if(qinv12 < fQcut[0] && qinv12>fQLowerCut) goodFlattenedPair=kTRUE; | |
2539 | } | |
2540 | }*/ | |
2541 | ||
cd12341d | 2542 | // en2 buffer |
2543 | for(Int_t en2=0; en2<3; en2++){ | |
2544 | ////////////////////////////////////// | |
2545 | ||
2546 | Bool_t skipcase=kTRUE; | |
2547 | Short_t config=-1, part=-1; | |
2548 | if(en1case==0 && en2==0) {skipcase=kFALSE; config=1; part=0;}// P11T1 | |
2549 | if(en1case==0 && en2==1) {skipcase=kFALSE; config=2; part=1;}// P11T2 | |
2550 | if(en1case==1 && en2==0) {skipcase=kFALSE; config=2; part=2;}// P12T1 | |
2551 | if(en1case==1 && en2==2) {skipcase=kFALSE; config=3; part=3;}// P12T3 | |
2552 | ||
2553 | if(skipcase) continue; | |
2554 | ||
2555 | ||
2556 | // 3-particle terms | |
2557 | // 3rd particle | |
2558 | for(Int_t k=0; k<(fEvt+en2)->fNtracks; k++){ | |
2559 | index3 = k; | |
2560 | ||
2561 | ||
2562 | // remove auto-correlations and duplicate triplets | |
2563 | if(config==1){ | |
2564 | if( index1 == index3) continue; | |
2565 | if( index2 == index3) continue; | |
2566 | if(fPairSplitCut[0][index1]->At(index2)=='1') continue;// Track splitting/merging | |
2567 | ||
2568 | // skip the switched off triplets | |
2569 | if(fTripletSkip1[fPairLocationSE[index1]->At(index2)]->At(index3)=='1') { | |
2570 | fTripletSkip1[fPairLocationSE[index1]->At(index2)]->AddAt('0',index3);// Reset | |
2571 | continue; | |
2572 | } | |
2573 | /////////////////////////////// | |
2574 | // Turn off 1st possible degenerate triplet | |
2575 | if(index1 < index3){// verify correct id ordering ( index1 < k ) | |
2576 | if(fPairLocationSE[index1]->At(index3) >= 0){ | |
2577 | fTripletSkip1[fPairLocationSE[index1]->At(index3)]->AddAt('1',index2); | |
2578 | } | |
2579 | if(fPairSplitCut[0][index1]->At(index3)=='1') continue;// Track splitting/merging | |
2580 | }else {// or k < index1 | |
2581 | if(fPairLocationSE[index3]->At(index1) >= 0){ | |
2582 | fTripletSkip1[fPairLocationSE[index3]->At(index1)]->AddAt('1',index2); | |
2583 | } | |
2584 | if(fPairSplitCut[0][index3]->At(index1)=='1') continue;// Track splitting/merging | |
2585 | } | |
2586 | // turn off 2nd possible degenerate triplet | |
2587 | if(index2 < index3){// verify correct id ordering (index2 < k) | |
2588 | if(fPairLocationSE[index2]->At(index3) >= 0){ | |
2589 | fTripletSkip1[fPairLocationSE[index2]->At(index3)]->AddAt('1',index1); | |
2590 | } | |
2591 | if(fPairSplitCut[0][index2]->At(index3)=='1') continue;// Track splitting/merging | |
2592 | }else {// or k < index2 | |
2593 | if(fPairLocationSE[index3]->At(index2) >= 0){ | |
2594 | fTripletSkip1[fPairLocationSE[index3]->At(index2)]->AddAt('1',index1); | |
2595 | } | |
2596 | if(fPairSplitCut[0][index3]->At(index2)=='1') continue;// Track splitting/merging | |
2597 | } | |
2598 | ||
2599 | }// end config 1 | |
2600 | ||
2601 | if(config==2 && part==1){// SE pair and third particle from next event. P11T2 | |
2602 | /////////////////////////////// | |
2603 | // Turn off 1st possible degenerate triplet | |
2604 | if(fPairLocationME[index1]->At(index3) >= 0){ | |
2605 | fTripletSkip2[fPairLocationME[index1]->At(index3)]->AddAt('1',index2); | |
2606 | } | |
2607 | ||
2608 | // turn off 2nd possible degenerate triplet | |
2609 | if(fPairLocationME[index2]->At(index3) >= 0){ | |
2610 | fTripletSkip2[fPairLocationME[index2]->At(index3)]->AddAt('1',index1); | |
2611 | } | |
2612 | ||
2613 | if(fPairSplitCut[0][index1]->At(index2)=='1') continue;// Track splitting/merging | |
2614 | if(fPairSplitCut[1][index1]->At(index3)=='1') continue;// Track splitting/merging | |
2615 | if(fPairSplitCut[1][index2]->At(index3)=='1') continue;// Track splitting/merging | |
2616 | }// end config 2 part 1 | |
2617 | ||
2618 | if(config==2 && part==2){// P12T1 | |
2619 | if( index1 == index3) continue; | |
2620 | ||
2621 | // skip the switched off triplets | |
2622 | if(fTripletSkip2[fPairLocationME[index1]->At(index2)]->At(index3)=='1') { | |
2623 | fTripletSkip2[fPairLocationME[index1]->At(index2)]->AddAt('0',index3);// Reset | |
2624 | continue; | |
2625 | } | |
2626 | // turn off another possible degenerate | |
2627 | if(fPairLocationME[index3]->At(index2) >= 0){ | |
2628 | fTripletSkip2[fPairLocationME[index3]->At(index2)]->AddAt('1',index1); | |
2629 | }// end config 2 part 2 | |
2630 | ||
2631 | if(fPairSplitCut[1][index1]->At(index2)=='1') continue;// Track splitting/merging | |
2632 | if(index1 < index3) {if(fPairSplitCut[0][index1]->At(index3)=='1') continue;}// Track splitting/merging | |
2633 | else {if(fPairSplitCut[0][index3]->At(index1)=='1') continue;}// Track splitting/merging | |
2634 | if(fPairSplitCut[1][index3]->At(index2)=='1') continue;// Track splitting/merging | |
2635 | } | |
2636 | if(config==3){// P12T3 | |
2637 | if(fPairSplitCut[1][index1]->At(index2)=='1') continue;// Track splitting/merging | |
2638 | if(fPairSplitCut[2][index1]->At(index3)=='1') continue;// Track splitting/merging | |
2639 | if(fPairSplitCut[3][index2]->At(index3)=='1') continue;// Track splitting/merging | |
2640 | }// end config 3 | |
2641 | ||
2642 | ||
5e3e77d6 | 2643 | |
cd12341d | 2644 | ch3 = Int_t(((fEvt+en2)->fTracks[k].fCharge + 1)/2.); |
2645 | key3 = (fEvt+en2)->fTracks[k].fKey; | |
2646 | Short_t fillIndex3 = FillIndex3part(key1+key2+key3); | |
2647 | Short_t fillIndex13 = FillIndex2part(key1+key3); | |
2648 | Short_t fillIndex23 = FillIndex2part(key2+key3); | |
2649 | Short_t qCutBin13 = SetQcutBin(fillIndex13); | |
2650 | Short_t qCutBin23 = SetQcutBin(fillIndex23); | |
2651 | pVect3[0] = (fEvt+en2)->fTracks[k].fEaccepted; | |
2652 | pVect3[1] = (fEvt+en2)->fTracks[k].fP[0]; | |
2653 | pVect3[2] = (fEvt+en2)->fTracks[k].fP[1]; | |
2654 | pVect3[3] = (fEvt+en2)->fTracks[k].fP[2]; | |
654866df | 2655 | qinv13 = GetQinv(fillIndex13, pVect1, pVect3); |
2656 | qinv23 = GetQinv(fillIndex23, pVect2, pVect3); | |
2657 | ||
2658 | if(qinv13 < fQLowerCut) continue; | |
2659 | if(qinv23 < fQLowerCut) continue; | |
2660 | if(qinv13 > fQcut[qCutBin13]) continue; | |
2661 | if(qinv23 > fQcut[qCutBin23]) continue; | |
2662 | ||
140107fb | 2663 | /*if(fGenerateSignal){ |
2664 | Bool_t goodFlattenedTriplet=kFALSE; | |
2665 | while(!goodFlattenedTriplet){ | |
2666 | Float_t Qflattened = fQLowerCut + (fQcut[0]-fQLowerCut)*gRandom->Rndm(); | |
2667 | Float_t theta13 = PI*gRandom->Rndm(); | |
2668 | Float_t phi13 = 2*PI*gRandom->Rndm(); | |
2669 | pVect3Flat[1] = pVect1[1] + Qflattened*sin(theta13)*cos(phi13); | |
2670 | pVect3Flat[2] = pVect1[2] + Qflattened*sin(theta13)*sin(phi13); | |
2671 | pVect3Flat[3] = pVect1[3] + Qflattened*cos(theta13); | |
2672 | pVect3Flat[0] = sqrt(pow(pVect3Flat[1],2)+pow(pVect3Flat[2],2)+pow(pVect3Flat[3],2)+pow(fTrueMassPi,2)); | |
2673 | // | |
2674 | pVect3Flat[0]=pVect3[0]; pVect3Flat[1]=pVect3[1]; pVect3Flat[2]=pVect3[2]; pVect3Flat[3]=pVect3[3]; | |
2675 | // | |
2676 | qinv13 = GetQinv(0, pVect1, pVect3Flat); | |
2677 | qinv23 = GetQinv(0, pVect2Flat, pVect3Flat); | |
2678 | if(qinv13 < fQcut[qCutBin13] && qinv23 < fQcut[qCutBin23]) { | |
2679 | if(qinv13>fQLowerCut && qinv23>fQLowerCut) goodFlattenedTriplet=kTRUE; | |
2680 | } | |
2681 | } | |
2682 | }*/ | |
2683 | ||
2684 | ||
5e3e77d6 | 2685 | if(fMCcase){ |
2686 | pVect3MC[1] = (fEvt+en2)->fMCtracks[abs((fEvt+en2)->fTracks[k].fLabel)].fPx; | |
2687 | pVect3MC[2] = (fEvt+en2)->fMCtracks[abs((fEvt+en2)->fTracks[k].fLabel)].fPy; | |
2688 | pVect3MC[3] = (fEvt+en2)->fMCtracks[abs((fEvt+en2)->fTracks[k].fLabel)].fPz; | |
2689 | pVect3MC[0] = sqrt(pow(pVect3MC[1],2)+pow(pVect3MC[2],2)+pow(pVect3MC[3],2)+pow(fTrueMassPi,2)); | |
2690 | qinv12MC = GetQinv(0, pVect1MC, pVect2MC); | |
2691 | qinv13MC = GetQinv(0, pVect1MC, pVect3MC); | |
2692 | qinv23MC = GetQinv(0, pVect2MC, pVect3MC); | |
2693 | } | |
654866df | 2694 | |
140107fb | 2695 | |
5e3e77d6 | 2696 | // if all three pair cuts are the same then the case (config=2 && term=2) never reaches here. |
2697 | ||
cd12341d | 2698 | q3 = sqrt(pow(qinv12,2) + pow(qinv13,2) + pow(qinv23,2)); |
2699 | transK3 = sqrt( pow(pVect1[1]+pVect2[1]+pVect3[1],2) + pow(pVect1[2]+pVect2[2]+pVect3[2],2))/3.; | |
2700 | Float_t firstQ=0, secondQ=0, thirdQ=0; | |
654866df | 2701 | Float_t firstQMC=0, secondQMC=0, thirdQMC=0; |
140107fb | 2702 | |
5e3e77d6 | 2703 | // |
fa109294 | 2704 | |
5e3e77d6 | 2705 | // |
cd12341d | 2706 | if(config==1) {// 123 |
2707 | SetFillBins3(fillIndex3, key1, key2, key3, ch1, ch2, ch3, 0, bin1, bin2, bin3, fDummyB, fDummyB, fDummyB); | |
fa109294 | 2708 | |
cd12341d | 2709 | if(fillIndex3 <= 2){ |
2710 | ArrangeQs(fillIndex3, key1, key2, key3, ch1, ch2, ch3, qinv12, qinv13, qinv23, 0, 1, firstQ, secondQ, thirdQ); | |
654866df | 2711 | if(fillIndex3==0 && fMCcase) ArrangeQs(fillIndex3, key1, key2, key3, ch1, ch2, ch3, qinv12MC, qinv13MC, qinv23MC, 0, 1, firstQMC, secondQMC, thirdQMC); |
2712 | Float_t WInput = 1.0; | |
5fc49f8c | 2713 | if(fGenerateSignal && ch1==ch2 && ch1==ch3) WInput = MCWeight3D(kTRUE, 1, fFixedLambdaBinMomRes, firstQ, secondQ, thirdQ); |
654866df | 2714 | //// |
2715 | ||
2716 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[0].fTerms3->Fill(firstQ, secondQ, thirdQ, WInput); | |
2717 | //// | |
5e3e77d6 | 2718 | // |
2719 | if(fillIndex3==0 && ch1==ch2 && ch1==ch3 && fMCcase==kFALSE){ | |
90814457 | 2720 | FourVectProdTerms(pVect1, pVect2, pVect3, Qsum1v1, Qsum2, Qsum3v1, Qsum1v2, Qsum3v2);// 4-vector product sums |
2721 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[0].f4VectProd1Terms->Fill(Qsum1v1, Qsum2, Qsum3v1); | |
2722 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[0].f4VectProd2Terms->Fill(Qsum1v2, Qsum2, Qsum3v2); | |
140107fb | 2723 | ((TH3D*)fOutputList->FindObject("fKt3DistTerm1"))->Fill(fMbin+1, transK3, q3); |
5e3e77d6 | 2724 | } |
2725 | ////////////////////////////////////// | |
90814457 | 2726 | // Momentum resolution and <K3> calculation |
5e3e77d6 | 2727 | if(fillIndex3==0 && fMCcase){ |
654866df | 2728 | |
2729 | WInput = 1.0; | |
90814457 | 2730 | Double_t K3=1.0; |
5e3e77d6 | 2731 | if(ch1==ch2 && ch1==ch3){// same charge |
5fc49f8c | 2732 | WInput = MCWeight3D(kTRUE, 1, fFixedLambdaBinMomRes, firstQMC, secondQMC, thirdQMC); |
90814457 | 2733 | K3 = FSICorrelationOmega0(kTRUE, firstQMC, secondQMC, thirdQMC);// K3 |
5e3e77d6 | 2734 | }else {// mixed charge |
034e970d | 2735 | if(bin1==bin2) { |
5fc49f8c | 2736 | WInput = MCWeight3D(kFALSE, 1, fFixedLambdaBinMomRes, firstQMC, secondQMC, thirdQMC); |
034e970d | 2737 | K3 = FSICorrelationOmega0(kFALSE, firstQMC, secondQMC, thirdQMC);// K3 |
2738 | }else { | |
5fc49f8c | 2739 | WInput = MCWeight3D(kFALSE, 1, fFixedLambdaBinMomRes, thirdQMC, secondQMC, firstQMC);// thirdQMC is ss |
034e970d | 2740 | K3 = FSICorrelationOmega0(kFALSE, thirdQMC, secondQMC, firstQMC);// K3 |
2741 | } | |
5e3e77d6 | 2742 | } |
654866df | 2743 | |
54d66278 | 2744 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[0].fIdeal->Fill(firstQMC, secondQMC, thirdQMC, WInput); |
2745 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[0].fSmeared->Fill(firstQ, secondQ, thirdQ, WInput); | |
2746 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[0].fQW12->Fill(firstQMC, secondQMC, thirdQMC, WInput*firstQMC); | |
2747 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[0].fQW13->Fill(firstQMC, secondQMC, thirdQMC, WInput*secondQMC); | |
90814457 | 2748 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[0].fSumK3->Fill(firstQMC, secondQMC, thirdQMC, WInput/K3); |
2749 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[0].fEnK3->Fill(firstQMC, secondQMC, thirdQMC, WInput); | |
2750 | if(ch1==ch2 && ch1==ch3){ | |
2751 | FourVectProdTerms(pVect1, pVect2, pVect3, Qsum1v1, Qsum2, Qsum3v1, Qsum1v2, Qsum3v2);// 4-vector product sums | |
2752 | FourVectProdTerms(pVect1MC, pVect2MC, pVect3MC, Qsum1v1MC, Qsum2MC, Qsum3v1MC, Qsum1v2MC, Qsum3v2MC);// 4-vector product sums | |
2753 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[0].f4VectProd1TermsIdeal->Fill(Qsum1v1MC, Qsum2MC, Qsum3v1MC, WInput); | |
2754 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[0].f4VectProd1TermsSmeared->Fill(Qsum1v1, Qsum2, Qsum3v1, WInput); | |
2755 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[0].f4VectProd2TermsIdeal->Fill(Qsum1v2MC, Qsum2MC, Qsum3v2MC, WInput); | |
2756 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[0].f4VectProd2TermsSmeared->Fill(Qsum1v2, Qsum2, Qsum3v2, WInput); | |
0e58bc53 | 2757 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[0].f4VectProd1Q3W->Fill(Qsum1v1MC, Qsum2MC, Qsum3v1MC, WInput*q3); |
2758 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[0].f4VectProd2Q3W->Fill(Qsum1v2MC, Qsum2MC, Qsum3v2MC, WInput*q3); | |
90814457 | 2759 | // |
d60cf3cf | 2760 | if(qinv12MC > fQLowerCut && qinv13MC > fQLowerCut && qinv23MC > fQLowerCut){ |
2761 | // does not really matter if MC or real data triplets are used to average 1/K3...but better to use umsmeared values | |
b3316be6 | 2762 | WInput = MCWeight3D(kTRUE, 1, 35, firstQMC, secondQMC, thirdQMC);// pure 3-pion (lambda=1) |
d60cf3cf | 2763 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[0].f4VectProd1TermsSumK3->Fill(Qsum1v1MC, Qsum2MC, Qsum3v1MC, WInput/K3); |
2764 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[0].f4VectProd2TermsSumK3->Fill(Qsum1v2MC, Qsum2MC, Qsum3v2MC, WInput/K3); | |
2765 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[0].f4VectProd1TermsEnK3->Fill(Qsum1v1MC, Qsum2MC, Qsum3v1MC, WInput); | |
2766 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[0].f4VectProd2TermsEnK3->Fill(Qsum1v2MC, Qsum2MC, Qsum3v2MC, WInput); | |
2767 | } | |
90814457 | 2768 | } |
fa109294 | 2769 | }// fMCcase |
2770 | ||
cd12341d | 2771 | } |
2772 | ||
2773 | }else if(config==2){// 12, 13, 23 | |
5e3e77d6 | 2774 | |
cd12341d | 2775 | Bool_t fill2=kFALSE, fill3=kFALSE, fill4=kFALSE; |
2776 | SetFillBins3(fillIndex3, key1, key2, key3, ch1, ch2, ch3, part, bin1, bin2, bin3, fill2, fill3, fill4); | |
2777 | ||
2778 | // loop over terms 2-4 | |
5e3e77d6 | 2779 | for(Int_t jj=2; jj<5; jj++){ |
2780 | if(jj==2) {if(!fill2) continue;}//12 | |
2781 | if(jj==3) {if(!fill3) continue;}//13 | |
2782 | if(jj==4) {if(!fill4) continue;}//23 | |
cd12341d | 2783 | |
2784 | if(fillIndex3 <= 2){ | |
5e3e77d6 | 2785 | ArrangeQs(fillIndex3, key1, key2, key3, ch1, ch2, ch3, qinv12, qinv13, qinv23, part, jj, firstQ, secondQ, thirdQ); |
654866df | 2786 | if(fillIndex3==0 && fMCcase) ArrangeQs(fillIndex3, key1, key2, key3, ch1, ch2, ch3, qinv12MC, qinv13MC, qinv23MC, part, jj, firstQMC, secondQMC, thirdQMC); |
2787 | Float_t WInput = 1.0; | |
5fc49f8c | 2788 | if(fGenerateSignal && ch1==ch2 && ch1==ch3) WInput = MCWeight3D(kTRUE, jj, fFixedLambdaBinMomRes, firstQ, secondQ, thirdQ); |
654866df | 2789 | //// |
2790 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[jj-1].fTerms3->Fill(firstQ, secondQ, thirdQ, WInput); | |
2791 | //// | |
90814457 | 2792 | if(fillIndex3==0 && ch1==ch2 && ch1==ch3){ |
2793 | if(part==1){// P11T2 | |
2794 | if(jj==2) { | |
2795 | FourVectProdTerms(pVect1, pVect2, pVect3, Qsum1v1, Qsum2, Qsum3v1, Qsum1v2, Qsum3v2);// 4-vector product sums | |
2796 | if(fMCcase) FourVectProdTerms(pVect1MC, pVect2MC, pVect3MC, Qsum1v1MC, Qsum2MC, Qsum3v1MC, Qsum1v2MC, Qsum3v2MC);// 4-vector product sums | |
2797 | }if(jj==3){ | |
2798 | FourVectProdTerms(pVect1, pVect3, pVect2, Qsum1v1, Qsum2, Qsum3v1, Qsum1v2, Qsum3v2);// 4-vector product sums | |
2799 | if(fMCcase) FourVectProdTerms(pVect1MC, pVect3MC, pVect2MC, Qsum1v1MC, Qsum2MC, Qsum3v1MC, Qsum1v2MC, Qsum3v2MC);// 4-vector product sums | |
2800 | }if(jj==4) { | |
2801 | FourVectProdTerms(pVect3, pVect1, pVect2, Qsum1v1, Qsum2, Qsum3v1, Qsum1v2, Qsum3v2);// 4-vector product sums | |
2802 | if(fMCcase) FourVectProdTerms(pVect3MC, pVect1MC, pVect2MC, Qsum1v1MC, Qsum2MC, Qsum3v1MC, Qsum1v2MC, Qsum3v2MC);// 4-vector product sums | |
2803 | } | |
2804 | }else{// P12T1 | |
2805 | if(jj==2) { | |
2806 | FourVectProdTerms(pVect1, pVect3, pVect2, Qsum1v1, Qsum2, Qsum3v1, Qsum1v2, Qsum3v2);// 4-vector product sums | |
2807 | if(fMCcase) FourVectProdTerms(pVect1MC, pVect3MC, pVect2MC, Qsum1v1MC, Qsum2MC, Qsum3v1MC, Qsum1v2MC, Qsum3v2MC);// 4-vector product sums | |
2808 | }if(jj==3) { | |
2809 | FourVectProdTerms(pVect1, pVect2, pVect3, Qsum1v1, Qsum2, Qsum3v1, Qsum1v2, Qsum3v2);// 4-vector product sums | |
2810 | if(fMCcase) FourVectProdTerms(pVect1MC, pVect2MC, pVect3MC, Qsum1v1MC, Qsum2MC, Qsum3v1MC, Qsum1v2MC, Qsum3v2MC);// 4-vector product sums | |
2811 | }if(jj==4) { | |
2812 | FourVectProdTerms(pVect2, pVect1, pVect3, Qsum1v1, Qsum2, Qsum3v1, Qsum1v2, Qsum3v2);// 4-vector product sums | |
2813 | if(fMCcase) FourVectProdTerms(pVect2MC, pVect1MC, pVect3MC, Qsum1v1MC, Qsum2MC, Qsum3v1MC, Qsum1v2MC, Qsum3v2MC);// 4-vector product sums | |
2814 | } | |
2815 | } | |
2816 | if(!fMCcase){ | |
2817 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[jj-1].f4VectProd1Terms->Fill(Qsum1v1, Qsum2, Qsum3v1); | |
2818 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[jj-1].f4VectProd2Terms->Fill(Qsum1v2, Qsum2, Qsum3v2); | |
fa109294 | 2819 | } |
5e3e77d6 | 2820 | } |
2821 | ////////////////////////////////////// | |
2822 | // Momentum resolution calculation | |
2823 | if(fillIndex3==0 && fMCcase){ | |
654866df | 2824 | WInput = 1.0; |
5e3e77d6 | 2825 | if(ch1==ch2 && ch1==ch3){// same charge |
5fc49f8c | 2826 | WInput = MCWeight3D(kTRUE, jj, fFixedLambdaBinMomRes, firstQMC, secondQMC, thirdQMC); |
5e3e77d6 | 2827 | }else {// mixed charge |
5fc49f8c | 2828 | if(bin1==bin2) WInput = MCWeight3D(kFALSE, jj, fFixedLambdaBinMomRes, firstQMC, secondQMC, thirdQMC); |
2829 | else WInput = MCWeight3D(kFALSE, 6-jj, fFixedLambdaBinMomRes, thirdQMC, secondQMC, firstQMC);// thirdQMC is ss | |
90814457 | 2830 | } |
2831 | // | |
2832 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[jj-1].fIdeal->Fill(firstQMC, secondQMC, thirdQMC, WInput); | |
2833 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[jj-1].fSmeared->Fill(firstQ, secondQ, thirdQ, WInput); | |
2834 | // | |
2835 | if(ch1==ch2 && ch1==ch3){ | |
2836 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[jj-1].f4VectProd1TermsIdeal->Fill(Qsum1v1MC, Qsum2MC, Qsum3v1MC, WInput); | |
2837 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[jj-1].f4VectProd1TermsSmeared->Fill(Qsum1v1, Qsum2, Qsum3v1, WInput); | |
2838 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[jj-1].f4VectProd2TermsIdeal->Fill(Qsum1v2MC, Qsum2MC, Qsum3v2MC, WInput); | |
2839 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[jj-1].f4VectProd2TermsSmeared->Fill(Qsum1v2, Qsum2, Qsum3v2, WInput); | |
2840 | // | |
d60cf3cf | 2841 | if(qinv12MC > fQLowerCut && qinv13MC > fQLowerCut && qinv23MC > fQLowerCut){ |
b3316be6 | 2842 | // does not really matter if MC or real data triplets are used to average 1/K2...but better to use umsmeared values |
d60cf3cf | 2843 | Float_t InteractingQ=0; |
b3316be6 | 2844 | if(part==1) {InteractingQ=qinv12MC;}// 12 from SE |
2845 | else {InteractingQ=qinv13MC;}// 13 from SE | |
d60cf3cf | 2846 | Double_t K2 = FSICorrelationTherm2(+1,+1, InteractingQ);// K2 from Therminator source |
b3316be6 | 2847 | WInput = MCWeight3D(kTRUE, jj, 35, firstQMC, secondQMC, thirdQMC);// pure 2-pion (lambda=1) |
d60cf3cf | 2848 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[jj-1].f4VectProd1TermsSumK2->Fill(Qsum1v1MC, Qsum2MC, Qsum3v1MC, WInput/K2); |
2849 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[jj-1].f4VectProd2TermsSumK2->Fill(Qsum1v2MC, Qsum2MC, Qsum3v2MC, WInput/K2); | |
2850 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[jj-1].f4VectProd1TermsEnK2->Fill(Qsum1v1MC, Qsum2MC, Qsum3v1MC, WInput); | |
2851 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[jj-1].f4VectProd2TermsEnK2->Fill(Qsum1v2MC, Qsum2MC, Qsum3v2MC, WInput); | |
2852 | } | |
5e3e77d6 | 2853 | } |
2854 | }// fMCcase | |
2855 | ||
cd12341d | 2856 | } |
2857 | } | |
5e3e77d6 | 2858 | |
cd12341d | 2859 | }else {// config 3: All particles from different events |
cd12341d | 2860 | |
704f2481 | 2861 | // "enhancement" differs from 1.0 only when Qinv goes over fQcut |
2862 | //Float_t enhancement=1.0; | |
2863 | //Int_t nUnderCut=0; | |
2864 | //if(qinv13<fQcut[qCutBin13]) nUnderCut++; | |
2865 | //if(qinv23<fQcut[qCutBin23]) nUnderCut++; | |
2866 | //if(nUnderCut==0) enhancement = (1+1+1)/1.;// 1 LowQ pair | |
2867 | //if(nUnderCut==1) enhancement = (1+2)/2.;// 2 LowQ pair | |
2868 | //if(nUnderCut==2) enhancement = 1.;// 3 LowQ pair | |
cd12341d | 2869 | |
2870 | SetFillBins3(fillIndex3, key1, key2, key3, ch1, ch2, ch3, 3, bin1, bin2, bin3, fDummyB, fDummyB, fDummyB); | |
90814457 | 2871 | |
140107fb | 2872 | if(ch1==ch2 && ch1==ch3 && fillIndex3==0) { |
2873 | FourVectProdTerms(pVect1, pVect2, pVect3, Qsum1v1, Qsum2, Qsum3v1, Qsum1v2, Qsum3v2);// 4-vector product sums | |
2874 | if(fMCcase==kFALSE) ((TH3D*)fOutputList->FindObject("fKt3DistTerm5"))->Fill(fMbin+1, transK3, q3); | |
2875 | } | |
90814457 | 2876 | if(fMCcase && ch1==ch2 && ch1==ch3 && fillIndex3==0) FourVectProdTerms(pVect1MC, pVect2MC, pVect3MC, Qsum1v1MC, Qsum2MC, Qsum3v1MC, Qsum1v2MC, Qsum3v2MC); |
cd12341d | 2877 | |
2878 | if(fillIndex3 <= 2){ | |
2879 | ArrangeQs(fillIndex3, key1, key2, key3, ch1, ch2, ch3, qinv12, qinv13, qinv23, part, 5, firstQ, secondQ, thirdQ); | |
704f2481 | 2880 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[4].fTerms3->Fill(firstQ, secondQ, thirdQ); |
5e3e77d6 | 2881 | if(fillIndex3==0 && ch1==ch2 && ch1==ch3 && fMCcase==kFALSE){ |
90814457 | 2882 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[4].f4VectProd1Terms->Fill(Qsum1v1, Qsum2, Qsum3v1); |
2883 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[4].f4VectProd2Terms->Fill(Qsum1v2, Qsum2, Qsum3v2); | |
5e3e77d6 | 2884 | } |
2885 | ////////////////////////////////////// | |
2886 | // Momentum resolution calculation | |
2887 | if(fillIndex3==0 && fMCcase){ | |
5e3e77d6 | 2888 | ArrangeQs(fillIndex3, key1, key2, key3, ch1, ch2, ch3, qinv12MC, qinv13MC, qinv23MC, part, 5, firstQMC, secondQMC, thirdQMC); |
90814457 | 2889 | Float_t WInput=1; |
5e3e77d6 | 2890 | if(ch1==ch2 && ch1==ch3){// same charge |
5fc49f8c | 2891 | WInput = MCWeight3D(kTRUE, 5, fFixedLambdaBinMomRes, firstQMC, secondQMC, thirdQMC); |
5e3e77d6 | 2892 | }else {// mixed charge |
5fc49f8c | 2893 | if(bin1==bin2) WInput = MCWeight3D(kFALSE, 5, fFixedLambdaBinMomRes, firstQMC, secondQMC, thirdQMC); |
2894 | else WInput = MCWeight3D(kFALSE, 5, fFixedLambdaBinMomRes, thirdQMC, secondQMC, firstQMC);// thirdQMC is ss in this case. 1st Q argument is ss | |
90814457 | 2895 | } |
2896 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[4].fIdeal->Fill(firstQMC, secondQMC, thirdQMC, WInput); | |
2897 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[4].fSmeared->Fill(firstQ, secondQ, thirdQ, WInput); | |
2898 | if(ch1==ch2 && ch1==ch3){ | |
2899 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[4].f4VectProd1TermsIdeal->Fill(Qsum1v1MC, Qsum2MC, Qsum3v1MC, WInput); | |
2900 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[4].f4VectProd1TermsSmeared->Fill(Qsum1v1, Qsum2, Qsum3v1, WInput); | |
2901 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[4].f4VectProd2TermsIdeal->Fill(Qsum1v2MC, Qsum2MC, Qsum3v2MC, WInput); | |
2902 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[4].f4VectProd2TermsSmeared->Fill(Qsum1v2, Qsum2, Qsum3v2, WInput); | |
2903 | ||
5e3e77d6 | 2904 | } |
2905 | }// fMCcase | |
2906 | ||
cd12341d | 2907 | } |
5e3e77d6 | 2908 | |
cd12341d | 2909 | if(fillIndex3 !=0) continue;// only calculate TPN for pi-pi-pi |
2910 | if(ch1!=ch2 || ch1!=ch3) continue;// only calcualte TPN for ss | |
5e3e77d6 | 2911 | |
90814457 | 2912 | |
654866df | 2913 | //if(fMCcase) continue;// only calcualte TPN for real data |
2914 | if(!fGenerateSignal){ | |
2915 | GetWeight(pVect1, pVect2, pVect1, pVect2, weight12, weight12Err); | |
2916 | GetWeight(pVect1, pVect3, pVect1, pVect3, weight13, weight13Err); | |
2917 | GetWeight(pVect2, pVect3, pVect2, pVect3, weight23, weight23Err); | |
2918 | }else { | |
2919 | GetWeight(pVect1, pVect2Flat, pVect1, pVect2, weight12, weight12Err); | |
2920 | GetWeight(pVect1, pVect3Flat, pVect1, pVect3, weight13, weight13Err); | |
2921 | GetWeight(pVect2Flat, pVect3Flat, pVect2, pVect3, weight23, weight23Err); | |
2922 | } | |
5e027bd6 | 2923 | if(sqrt(fabs(weight12*weight13*weight23)) > 1.0) { |
2924 | if(fMbin==0 && bin1==0) { | |
2925 | ((TH3F*)fOutputList->FindObject("fTPNRejects1"))->Fill(qinv12, qinv13, qinv23, sqrt(fabs(weight12*weight13*weight23))); | |
2926 | } | |
2927 | continue;// weight should never be larger than 1 | |
2928 | } | |
46b217b3 | 2929 | |
654866df | 2930 | |
5fc49f8c | 2931 | Float_t myDamp = fDampStart + (fDampStep)*fFixedLambdaBinr3;// lambdabin=0.52 for v1 draft, 0.7 is more realistic |
fa109294 | 2932 | Int_t denIndex = 0; |
f9a5e67a | 2933 | Int_t momResIndex = rIndexForTPNMomRes*kNDampValues + fFixedLambdaBinMomRes;// lambdabin=0.52 for v1 draft, 0.4 is more realistic |
90814457 | 2934 | |
704f2481 | 2935 | Float_t coulCorr12 = FSICorrelationTherm2(+1,+1, qinv12); |
2936 | Float_t coulCorr13 = FSICorrelationTherm2(+1,+1, qinv13); | |
2937 | Float_t coulCorr23 = FSICorrelationTherm2(+1,+1, qinv23); | |
d60cf3cf | 2938 | if(coulCorr12 < 0.1 || coulCorr13 < 0.1 || coulCorr23 < 0.1) {// Safety check |
2939 | if(fMbin==0 && bin1==0) { | |
5e027bd6 | 2940 | ((TH3F*)fOutputList->FindObject("fTPNRejects2"))->Fill(qinv12, qinv13, qinv23, sqrt(fabs(weight12*weight13*weight23))); |
d60cf3cf | 2941 | } |
2942 | continue; | |
2943 | } | |
704f2481 | 2944 | Float_t MomResCorr12=1.0, MomResCorr13=1.0, MomResCorr23=1.0; |
5fc49f8c | 2945 | if(!fGenerateSignal && !fMCcase) { |
704f2481 | 2946 | Int_t momBin12 = fMomResC2->GetYaxis()->FindBin(qinv12); |
2947 | Int_t momBin13 = fMomResC2->GetYaxis()->FindBin(qinv13); | |
2948 | Int_t momBin23 = fMomResC2->GetYaxis()->FindBin(qinv23); | |
2949 | if(momBin12 >= kQbins) momBin12 = kQbins-1; | |
2950 | if(momBin13 >= kQbins) momBin13 = kQbins-1; | |
2951 | if(momBin23 >= kQbins) momBin23 = kQbins-1; | |
2952 | MomResCorr12 = fMomResC2->GetBinContent(momResIndex+1, momBin12); | |
2953 | MomResCorr13 = fMomResC2->GetBinContent(momResIndex+1, momBin13); | |
2954 | MomResCorr23 = fMomResC2->GetBinContent(momResIndex+1, momBin23); | |
d60cf3cf | 2955 | if(MomResCorr12 > 1.2 || MomResCorr13 > 1.2 || MomResCorr23 > 1.2) {// Safety check |
2956 | if(fMbin==0 && bin1==0) { | |
5e027bd6 | 2957 | ((TH3F*)fOutputList->FindObject("fTPNRejects3"))->Fill(qinv12, qinv13, qinv23, sqrt(fabs(weight12*weight13*weight23))); |
d60cf3cf | 2958 | } |
2959 | continue; | |
2960 | } | |
704f2481 | 2961 | } |
2962 | weight12CC = ((weight12+1)*MomResCorr12 - myDamp*coulCorr12 - (1-myDamp)); | |
2963 | weight12CC /= coulCorr12*myDamp; | |
2964 | weight13CC = ((weight13+1)*MomResCorr13 - myDamp*coulCorr13 - (1-myDamp)); | |
2965 | weight13CC /= coulCorr13*myDamp; | |
2966 | weight23CC = ((weight23+1)*MomResCorr23 - myDamp*coulCorr23 - (1-myDamp)); | |
2967 | weight23CC /= coulCorr23*myDamp; | |
2968 | ||
2969 | if(weight12CC < 0 || weight13CC < 0 || weight23CC < 0) { | |
2970 | if(fMbin==0 && bin1==0) { | |
2971 | weightTotal = sqrt(fabs(weight12CC*weight13CC*weight23CC)); | |
5e027bd6 | 2972 | ((TH3F*)fOutputList->FindObject("fTPNRejects4"))->Fill(qinv12, qinv13, qinv23, weightTotal); |
704f2481 | 2973 | } |
2974 | continue;// C2^QS can never be less than unity | |
2975 | } | |
2976 | ||
2977 | ///////////////////////////////////////////////////// | |
2978 | weightTotal = sqrt(weight12CC*weight13CC*weight23CC); | |
2979 | ///////////////////////////////////////////////////// | |
2980 | ||
2981 | if(weightTotal > 1.5) { | |
2982 | if(fMbin==0 && bin1==0) { | |
5e027bd6 | 2983 | ((TH3F*)fOutputList->FindObject("fTPNRejects5"))->Fill(qinv12, qinv13, qinv23, weightTotal); |
704f2481 | 2984 | } |
2985 | continue;// C2^QS never be greater than 1.0 in theory. Can be slightly larger than 1.0 with fluctuations | |
2986 | } | |
2987 | ||
2988 | ||
2989 | ||
2990 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[4].DT[denIndex].fTwoPartNorm->Fill(qinv12, qinv13, qinv23, weightTotal); | |
2991 | ||
2992 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[4].DT[denIndex].f4VectProd1TwoPartNorm->Fill(Qsum1v1, Qsum2, Qsum3v1, weightTotal); | |
2993 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[4].DT[denIndex].f4VectProd2TwoPartNorm->Fill(Qsum1v2, Qsum2, Qsum3v2, weightTotal); | |
2994 | if(fMCcase){ | |
2995 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[4].DT[denIndex].f4VectProd1TwoPartNormIdeal->Fill(Qsum1v1MC, Qsum2MC, Qsum3v1MC, weightTotal); | |
2996 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[4].DT[denIndex].f4VectProd1TwoPartNormSmeared->Fill(Qsum1v1, Qsum2, Qsum3v1, weightTotal); | |
2997 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[4].DT[denIndex].f4VectProd2TwoPartNormIdeal->Fill(Qsum1v2MC, Qsum2MC, Qsum3v2MC, weightTotal); | |
2998 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[4].DT[denIndex].f4VectProd2TwoPartNormSmeared->Fill(Qsum1v2, Qsum2, Qsum3v2, weightTotal); | |
2999 | } | |
90814457 | 3000 | |
3001 | ||
704f2481 | 3002 | // Save cpu time and memory by skipping r3 denominator calculation below. den errors are negligible compared to num errors. |
3003 | /* | |
3004 | if(weightTotal > 0.0001){// tiny numbers cause a Float_ting point exception below | |
3005 | weightTotalErr = pow((weight12Err*coulCorr12)*weight13CC*weight23CC,2); | |
3006 | weightTotalErr += pow(weight12CC*(weight13Err*coulCorr13)*weight23CC,2); | |
3007 | weightTotalErr += pow(weight12CC*weight13CC*(weight23Err*coulCorr23),2); | |
3008 | weightTotalErr /= pow(2*weightTotal,2); | |
3009 | ||
3010 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[4].TwoPartNormErr->Fill(denIndex, q3, weightTotalErr); | |
3011 | } | |
3012 | */ | |
3013 | ||
3014 | //}// damp iter | |
3015 | //}// R iter | |
3016 | ||
cd12341d | 3017 | |
3018 | ||
3019 | } | |
3020 | }// end 3rd particle | |
3021 | }// en2 | |
3022 | ||
3023 | ||
fa109294 | 3024 | }// p1 |
3025 | }//en1 | |
cd12341d | 3026 | |
cd12341d | 3027 | /////////////////// |
3028 | }// end of PdensityPairs | |
3029 | ||
fa109294 | 3030 | |
cd12341d | 3031 | |
3032 | ||
3033 | ||
3034 | ||
3035 | ||
3036 | //////////////////////////////////////////////////////// | |
3037 | // Pdensity Method with Explicit Loops | |
3038 | if(fPdensityExplicitLoop){ | |
3039 | ||
3040 | //////////////////////////////////// | |
3041 | // 2nd, 3rd, and 4th order Correlations | |
3042 | ||
3043 | // First Particle | |
3044 | for (Int_t i=0; i<myTracks; i++) { | |
3045 | ch1 = Int_t( ((fEvt)->fTracks[i].fCharge + 1)/2. ); | |
3046 | pVect1[0] = (fEvt)->fTracks[i].fEaccepted; | |
3047 | pVect1[1] = (fEvt)->fTracks[i].fP[0]; | |
3048 | pVect1[2] = (fEvt)->fTracks[i].fP[1]; | |
3049 | pVect1[3] = (fEvt)->fTracks[i].fP[2]; | |
3050 | key1 = (fEvt)->fTracks[i].fKey; | |
3051 | ||
3052 | // Second Event | |
3053 | for(Int_t en2=0; en2<fEventsToMix+1; en2++){ | |
3054 | Int_t startbin2=0; | |
3055 | if(en2==0) startbin2=i+1; | |
3056 | ||
3057 | // Second Particle | |
3058 | for (Int_t j=startbin2; j<(fEvt+en2)->fNtracks; j++) { | |
3059 | ch2 = Int_t( ((fEvt+en2)->fTracks[j].fCharge + 1)/2. ); | |
3060 | pVect2[0] = (fEvt+en2)->fTracks[j].fEaccepted; | |
3061 | pVect2[1] = (fEvt+en2)->fTracks[j].fP[0]; | |
3062 | pVect2[2] = (fEvt+en2)->fTracks[j].fP[1]; | |
3063 | pVect2[3] = (fEvt+en2)->fTracks[j].fP[2]; | |
3064 | key2 = (fEvt+en2)->fTracks[j].fKey; | |
3065 | ||
3066 | Short_t fillIndex12 = FillIndex2part(key1+key2); | |
3067 | qinv12 = GetQinv(fillIndex12, pVect1, pVect2); | |
3068 | ||
3069 | if(qinv12 < fQLowerCut) continue; | |
3070 | ||
3071 | ||
3072 | // 2-particle part is filled always during pair creator | |
3073 | ||
3074 | // Third Event | |
3075 | for(Int_t en3=en2; en3<fEventsToMix+1; en3++){ | |
3076 | Int_t startbin3=0; | |
3077 | if(en3==en2) startbin3=j+1; | |
3078 | else startbin3=0; | |
3079 | ||
3080 | ||
3081 | // Third Particle | |
3082 | for (Int_t k=startbin3; k<(fEvt+en3)->fNtracks; k++) { | |
3083 | ch3 = Int_t( ((fEvt+en3)->fTracks[k].fCharge + 1)/2. ); | |
3084 | pVect3[0] = (fEvt+en3)->fTracks[k].fEaccepted; | |
3085 | pVect3[1] = (fEvt+en3)->fTracks[k].fP[0]; | |
3086 | pVect3[2] = (fEvt+en3)->fTracks[k].fP[1]; | |
3087 | pVect3[3] = (fEvt+en3)->fTracks[k].fP[2]; | |
3088 | key3 = (fEvt+en3)->fTracks[k].fKey; | |
3089 | ||
3090 | Short_t fillIndex3 = FillIndex3part(key1+key2+key3); | |
3091 | Short_t fillIndex13 = FillIndex2part(key1+key3); | |
3092 | qinv13 = GetQinv(fillIndex13, pVect1, pVect3); | |
3093 | Short_t fillIndex23 = FillIndex2part(key2+key3); | |
3094 | qinv23 = GetQinv(fillIndex23, pVect2, pVect3); | |
3095 | ||
3096 | ||
3097 | if(qinv13 < fQLowerCut) continue; | |
3098 | if(qinv23 < fQLowerCut) continue; | |
3099 | ||
3100 | ||
3101 | q3 = sqrt(pow(qinv12,2) + pow(qinv13,2) + pow(qinv23,2)); | |
3102 | ||
3103 | Short_t normBin12 = SetNormBin(fillIndex12); | |
3104 | Short_t normBin13 = SetNormBin(fillIndex13); | |
3105 | Short_t normBin23 = SetNormBin(fillIndex23); | |
3106 | ||
3107 | ||
3108 | if(en3==0 && en2==0) {// 123 | |
3109 | SetFillBins3(fillIndex3, key1, key2, key3, ch1, ch2, ch3, 0, bin1, bin2, bin3, fDummyB, fDummyB, fDummyB); | |
3110 | ||
3111 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[0].fExplicit3->Fill(q3);// 123 | |
3112 | ||
3113 | if((qinv12>=fNormQcutLow[normBin12]) && (qinv13>=fNormQcutLow[normBin13]) && (qinv23>=fNormQcutLow[normBin23])) { | |
3114 | if((qinv12<fNormQcutHigh[normBin12]) && (qinv13<fNormQcutHigh[normBin13]) && (qinv23<fNormQcutHigh[normBin23])) { | |
3115 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[0].fNormEx3->Fill(0.); | |
3116 | } | |
3117 | } | |
3118 | ||
3119 | }else if((en2==0 && en3==1) ) {// 12-3, 13-2, 23-1 | |
3120 | Float_t gFact=1; | |
3121 | ||
3122 | Bool_t fill2=kFALSE, fill3=kFALSE, fill4=kFALSE; | |
3123 | SetFillBins3(fillIndex3, key1, key2, key3, ch1, ch2, ch3, 1, bin1, bin2, bin3, fill2, fill3, fill4); | |
3124 | ||
3125 | ||
3126 | if(fill2){ | |
3127 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[1].fExplicit3->Fill(q3, gFact);// 12 | |
3128 | if((qinv12>=fNormQcutLow[normBin12]) && (qinv13>=fNormQcutLow[normBin13]) && (qinv23>=fNormQcutLow[normBin23])) { | |
3129 | if((qinv12<fNormQcutHigh[normBin12]) && (qinv13<fNormQcutHigh[normBin13]) && (qinv23<fNormQcutHigh[normBin23])) { | |
3130 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[1].fNormEx3->Fill(0.); | |
3131 | } | |
3132 | } | |
3133 | } | |
3134 | if(fill3){ | |
3135 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[2].fExplicit3->Fill(q3, gFact);// 12 | |
3136 | if((qinv12>=fNormQcutLow[normBin12]) && (qinv13>=fNormQcutLow[normBin13]) && (qinv23>=fNormQcutLow[normBin23])) { | |
3137 | if((qinv12<fNormQcutHigh[normBin12]) && (qinv13<fNormQcutHigh[normBin13]) && (qinv23<fNormQcutHigh[normBin23])) { | |
3138 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[2].fNormEx3->Fill(0.); | |
3139 | } | |
3140 | } | |
3141 | } | |
3142 | if(fill4){ | |
3143 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[3].fExplicit3->Fill(q3, gFact);// 12 | |
3144 | if((qinv12>=fNormQcutLow[normBin12]) && (qinv13>=fNormQcutLow[normBin13]) && (qinv23>=fNormQcutLow[normBin23])) { | |
3145 | if((qinv12<fNormQcutHigh[normBin12]) && (qinv13<fNormQcutHigh[normBin13]) && (qinv23<fNormQcutHigh[normBin23])) { | |
3146 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[3].fNormEx3->Fill(0.); | |
3147 | } | |
3148 | } | |
3149 | } | |
3150 | ||
3151 | }else if(en2==1 && en3==2){// all uncorrelated events | |
3152 | SetFillBins3(fillIndex3, key1, key2, key3, ch1, ch2, ch3, 3, bin1, bin2, bin3, fDummyB, fDummyB, fDummyB); | |
3153 | ||
3154 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[4].fExplicit3->Fill(q3); | |
3155 | if((qinv12>=fNormQcutLow[normBin12]) && (qinv13>=fNormQcutLow[normBin13]) && (qinv23>=fNormQcutLow[normBin23])) { | |
3156 | if((qinv12<fNormQcutHigh[normBin12]) && (qinv13<fNormQcutHigh[normBin13]) && (qinv23<fNormQcutHigh[normBin23])) { | |
3157 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[4].fNormEx3->Fill(0.); | |
3158 | } | |
3159 | } | |
3160 | Short_t qCutBin12 = SetQcutBin(fillIndex12); | |
3161 | Short_t qCutBin13 = SetQcutBin(fillIndex13); | |
3162 | Short_t qCutBin23 = SetQcutBin(fillIndex23); | |
3163 | ||
3164 | if( (qinv12 < fQcut[qCutBin12]) || (qinv13 < fQcut[qCutBin13]) || (qinv23 < fQcut[qCutBin23])){ | |
3165 | ||
3166 | Int_t nUnderCut=0; | |
3167 | if(qinv12<fQcut[qCutBin12]) nUnderCut++; | |
3168 | if(qinv13<fQcut[qCutBin13]) nUnderCut++; | |
3169 | if(qinv23<fQcut[qCutBin23]) nUnderCut++; | |
3170 | ||
3171 | } | |
3172 | ||
3173 | }else {} | |
3174 | ||
3175 | ||
3176 | }// 3rd particle | |
3177 | }// 3rd event | |
3178 | ||
3179 | }// 2nd particle | |
3180 | }// 2nd event | |
3181 | ||
3182 | }// 1st particle | |
3183 | ||
3184 | ||
3185 | ||
3186 | ||
3187 | }// End of PdensityExplicit | |
3188 | ||
3189 | ||
3190 | ||
3191 | ||
3192 | // Post output data. | |
3193 | PostData(1, fOutputList); | |
3194 | ||
3195 | } | |
3196 | //________________________________________________________________________ | |
3197 | void AliChaoticity::Terminate(Option_t *) | |
3198 | { | |
3199 | // Called once at the end of the query | |
3200 | ||
3201 | cout<<"Done"<<endl; | |
3202 | ||
3203 | } | |
3204 | //________________________________________________________________________ | |
3205 | Bool_t AliChaoticity::AcceptPair(AliChaoticityTrackStruct first, AliChaoticityTrackStruct second) | |
3206 | { | |
3207 | ||
654866df | 3208 | if(fabs(first.fEta-second.fEta) > fMinSepPair) return kTRUE; |
cd12341d | 3209 | |
3210 | // propagate through B field to r=1m | |
5e3e77d6 | 3211 | Float_t phi1 = first.fPhi - asin(first.fCharge*(0.1*fBfield)*0.15/first.fPt);// 0.15 for D=1m |
cd12341d | 3212 | if(phi1 > 2*PI) phi1 -= 2*PI; |
3213 | if(phi1 < 0) phi1 += 2*PI; | |
5e3e77d6 | 3214 | Float_t phi2 = second.fPhi - asin(second.fCharge*(0.1*fBfield)*0.15/second.fPt);// 0.15 for D=1m |
cd12341d | 3215 | if(phi2 > 2*PI) phi2 -= 2*PI; |
3216 | if(phi2 < 0) phi2 += 2*PI; | |
3217 | ||
3218 | Float_t deltaphi = phi1 - phi2; | |
3219 | if(deltaphi > PI) deltaphi -= 2*PI; | |
3220 | if(deltaphi < -PI) deltaphi += 2*PI; | |
3221 | deltaphi = fabs(deltaphi); | |
3222 | ||
654866df | 3223 | //cout<<deltaphi<<" "<<fMinSepPair<<" "<<fMinSepTPCEntranceEta<<endl; |
3224 | if(deltaphi < fMinSepPair) return kFALSE;// Min Separation | |
cd12341d | 3225 | |
3226 | // propagate through B field to r=1.6m | |
5e3e77d6 | 3227 | phi1 = first.fPhi - asin(first.fCharge*(0.1*fBfield)*0.24/first.fPt);// mine. 0.24 for D=1.6m |
cd12341d | 3228 | if(phi1 > 2*PI) phi1 -= 2*PI; |
3229 | if(phi1 < 0) phi1 += 2*PI; | |
5e3e77d6 | 3230 | phi2 = second.fPhi - asin(second.fCharge*(0.1*fBfield)*0.24/second.fPt);// mine. 0.24 for D=1.6m |
cd12341d | 3231 | if(phi2 > 2*PI) phi2 -= 2*PI; |
3232 | if(phi2 < 0) phi2 += 2*PI; | |
3233 | ||
3234 | deltaphi = phi1 - phi2; | |
3235 | if(deltaphi > PI) deltaphi -= 2*PI; | |
3236 | if(deltaphi < -PI) deltaphi += 2*PI; | |
3237 | deltaphi = fabs(deltaphi); | |
3238 | ||
654866df | 3239 | if(deltaphi < fMinSepPair) return kFALSE;// Min Separation |
cd12341d | 3240 | |
3241 | ||
3242 | // | |
46b217b3 | 3243 | |
cd12341d | 3244 | Int_t ncl1 = first.fClusterMap.GetNbits(); |
3245 | Int_t ncl2 = second.fClusterMap.GetNbits(); | |
3246 | Int_t sumCls = 0; Int_t sumSha = 0; Int_t sumQ = 0; | |
3247 | Double_t shfrac = 0; Double_t qfactor = 0; | |
3248 | for(Int_t imap = 0; imap < ncl1 && imap < ncl2; imap++) { | |
3249 | if (first.fClusterMap.TestBitNumber(imap) && second.fClusterMap.TestBitNumber(imap)) {// Both clusters | |
3250 | if (first.fSharedMap.TestBitNumber(imap) && second.fSharedMap.TestBitNumber(imap)) { // Shared | |
3251 | sumQ++; | |
3252 | sumCls+=2; | |
3253 | sumSha+=2;} | |
3254 | else {sumQ--; sumCls+=2;} | |
3255 | } | |
3256 | else if (first.fClusterMap.TestBitNumber(imap) || second.fClusterMap.TestBitNumber(imap)) {// Non shared | |
3257 | sumQ++; | |
3258 | sumCls++;} | |
3259 | } | |
3260 | if (sumCls>0) { | |
3261 | qfactor = sumQ*1.0/sumCls; | |
3262 | shfrac = sumSha*1.0/sumCls; | |
3263 | } | |
3264 | ||
3265 | if(qfactor > fShareQuality || shfrac > fShareFraction) return kFALSE; | |
46b217b3 | 3266 | |
cd12341d | 3267 | |
3268 | return kTRUE; | |
5e3e77d6 | 3269 | |
cd12341d | 3270 | |
3271 | } | |
3272 | //________________________________________________________________________ | |
3273 | Float_t AliChaoticity::GamovFactor(Int_t chargeBin1, Int_t chargeBin2, Float_t qinv) | |
3274 | { | |
3275 | Float_t arg = G_Coeff/qinv; | |
3276 | ||
3277 | if(chargeBin1==chargeBin2) return (exp(arg)-1)/(arg); | |
3278 | else {return (exp(-arg)-1)/(-arg);} | |
3279 | ||
3280 | } | |
3281 | //________________________________________________________________________ | |
3282 | void AliChaoticity::Shuffle(Int_t *iarr, Int_t i1, Int_t i2) | |
3283 | { | |
3284 | Int_t j, k; | |
3285 | Int_t a = i2 - i1; | |
3286 | for (Int_t i = i1; i < i2+1; i++) { | |
3287 | j = (Int_t) (gRandom->Rndm() * a); | |
3288 | k = iarr[j]; | |
3289 | iarr[j] = iarr[i]; | |
3290 | iarr[i] = k; | |
3291 | } | |
3292 | } | |
3293 | //________________________________________________________________________ | |
3294 | Short_t AliChaoticity::FillIndex2part(Short_t key){ | |
3295 | ||
3296 | if(key==2) return 0;// pi-pi | |
3297 | else if(key==11) return 1;// pi-k | |
3298 | else if(key==101) return 2;// pi-p | |
3299 | else if(key==20) return 3;// k-k | |
3300 | else if(key==110) return 4;// k-p | |
3301 | else return 5;// p-p | |
3302 | } | |
3303 | //________________________________________________________________________ | |
3304 | Short_t AliChaoticity::FillIndex3part(Short_t key){ | |
3305 | ||
3306 | if(key==3) return 0;// pi-pi-pi | |
3307 | else if(key==12) return 1;// pi-pi-k | |
3308 | else if(key==21) return 2;// k-k-pi | |
3309 | else if(key==102) return 3;// pi-pi-p | |
3310 | else if(key==201) return 4;// p-p-pi | |
3311 | else if(key==111) return 5;// pi-k-p | |
3312 | else if(key==30) return 6;// k-k-k | |
3313 | else if(key==120) return 7;// k-k-p | |
3314 | else if(key==210) return 8;// p-p-k | |
3315 | else return 9;// p-p-p | |
3316 | ||
3317 | } | |
3318 | //________________________________________________________________________ | |
3319 | Short_t AliChaoticity::SetQcutBin(Short_t fi){// fi=FillIndex | |
3320 | if(fi <= 2) return 0; | |
3321 | else if(fi==3) return 1; | |
3322 | else return 2; | |
3323 | } | |
3324 | //________________________________________________________________________ | |
3325 | Short_t AliChaoticity::SetNormBin(Short_t fi){// fi=FillIndex | |
3326 | if(fi==0) return 0; | |
3327 | else if(fi <= 2) return 1; | |
3328 | else return 2; | |
3329 | } | |
3330 | //________________________________________________________________________ | |
3331 | void AliChaoticity::SetFillBins2(Short_t fi, Short_t key1, Short_t key2, Int_t c1, Int_t c2, Int_t &b1, Int_t &b2){ | |
3332 | ||
3333 | if(fi==0 || fi==3 || fi==5){// Identical species | |
3334 | if((c1+c2)==1) {b1=0; b2=1;}// Re-assign to merge degenerate histos | |
3335 | else {b1=c1; b2=c2;} | |
3336 | }else {// Mixed species | |
3337 | if(key1 < key2) { b1=c1; b2=c2;} | |
3338 | else {b1=c2; b2=c1;} | |
3339 | } | |
3340 | ||
3341 | } | |
3342 | //________________________________________________________________________ | |
3343 | void AliChaoticity::SetFillBins3(Short_t fi, Short_t key1, Short_t key2, Short_t key3, Int_t c1, Int_t c2, Int_t c3, Short_t part, Int_t &b1, Int_t &b2, Int_t &b3, Bool_t &fill2, Bool_t &fill3, Bool_t &fill4){ | |
3344 | ||
3345 | ||
3346 | // seSS, seSK, SE_keysum only used to determine which terms to fill (only used for terms 2-4) | |
3347 | Bool_t seSS=kFALSE; | |
3348 | Bool_t seSK=kFALSE; | |
3349 | Short_t seKeySum=0;// only used for pi-k-p case | |
3350 | if(part==1) {// default case (irrelevant for term 1 and term 5) | |
3351 | if(c1==c2) seSS=kTRUE; | |
3352 | if(key1==key2) seSK=kTRUE; | |
3353 | seKeySum = key1+key2; | |
3354 | } | |
3355 | if(part==2){ | |
3356 | if(c1==c3) seSS=kTRUE; | |
3357 | if(key1==key3) seSK=kTRUE; | |
3358 | seKeySum = key1+key3; | |
3359 | } | |
3360 | ||
3361 | ||
3362 | // fill2, fill3, fill4 are only used for Cumulant Terms 2,3,4 | |
3363 | ||
3364 | if(fi==0 || fi==6 || fi==9){// Identical species | |
3365 | if( (c1+c2+c3)==1) { | |
3366 | b1=0; b2=0; b3=1;// Re-assign to merge degenerate histos | |
3367 | // | |
3368 | if(seSS) fill2=kTRUE; | |
3369 | else {fill3=kTRUE; fill4=kTRUE;} | |
3370 | // | |
3371 | }else if( (c1+c2+c3)==2) { | |
3372 | b1=0; b2=1; b3=1; | |
3373 | // | |
3374 | if(!seSS) {fill2=kTRUE; fill3=kTRUE;} | |
3375 | else fill4=kTRUE; | |
3376 | // | |
3377 | }else { | |
3378 | b1=c1; b2=c2; b3=c3; | |
3379 | fill2=kTRUE; fill3=kTRUE; fill4=kTRUE; | |
3380 | } | |
3381 | }else if(fi != 5){// all the rest except pi-k-p | |
3382 | if(key1==key2){ | |
3383 | b3=c3; | |
3384 | if( (c1+c2)==1) {b1=0; b2=1;} | |
3385 | else {b1=c1; b2=c2;} | |
3386 | }else if(key1==key3){ | |
3387 | b3=c2; | |
3388 | if( (c1+c3)==1) {b1=0; b2=1;} | |
3389 | else {b1=c1; b2=c3;} | |
3390 | }else {// Key2==Key3 | |
3391 | b3=c1; | |
3392 | if( (c2+c3)==1) {b1=0; b2=1;} | |
3393 | else {b1=c2; b2=c3;} | |
3394 | } | |
3395 | ////////////////////////////// | |
3396 | if(seSK) fill2=kTRUE;// Same keys from Same Event | |
3397 | else {// Different keys from Same Event | |
3398 | if( (c1+c2+c3)==1) { | |
3399 | if(b3==0) { | |
3400 | if(seSS) fill3=kTRUE; | |
3401 | else fill4=kTRUE; | |
3402 | }else{fill3=kTRUE; fill4=kTRUE;}// b3=1 so fill both | |
3403 | }else if( (c1+c2+c3)==2) { | |
3404 | if(b3==1) { | |
3405 | if(seSS) fill4=kTRUE; | |
3406 | else fill3=kTRUE; | |
3407 | }else{fill3=kTRUE; fill4=kTRUE;}// b3=0 so fill both | |
3408 | }else{fill3=kTRUE; fill4=kTRUE;}// all same charge so fill both | |
3409 | } | |
3410 | ///////////////////////////// | |
3411 | }else {// pi-k-p (no charge ordering applies since all are unique) | |
3412 | if(key1==1){ | |
3413 | if(key2==10) {b1=c1; b2=c2; b3=c3;}// pi-k-p | |
3414 | else {b1=c1; b2=c3; b3=c2;}// pi-p-k | |
3415 | }else if(key1==10){ | |
3416 | if(key2==1) {b1=c2; b2=c1; b3=c3;}// k-pi-p | |
3417 | else {b1=c3; b2=c1; b3=c2;}// k-p-pi | |
3418 | }else {// key1==100 | |
3419 | if(key2==1) {b1=c2; b2=c3; b3=c1;}// p-pi-k | |
3420 | else {b1=c3; b2=c2; b3=c1;}// p-k-pi | |
3421 | } | |
3422 | //////////////////////////////////// | |
3423 | if(seKeySum==11) fill2=kTRUE; | |
3424 | else if(seKeySum==101) fill3=kTRUE; | |
3425 | else fill4=kTRUE; | |
3426 | //////////////////////////////////// | |
3427 | } | |
3428 | ||
3429 | } | |
3430 | //________________________________________________________________________ | |
3431 | void AliChaoticity::ArrangeQs(Short_t fi, Short_t key1, Short_t key2, Short_t key3, Int_t c1, Int_t c2, Int_t c3, Float_t q12, Float_t q13, Float_t q23, Short_t part, Short_t term, Float_t &fQ, Float_t &sQ, Float_t &tQ){ | |
3432 | ||
3433 | // for terms 2-4: start by setting q12(part 1) or q13(part 2) | |
3434 | if(fi==0 || fi==6 || fi==9){// Identical species | |
3435 | if( (c1+c2+c3)==1) {// fQ=ss, sQ=os, tQ=os | |
3436 | if(term==1 || term==5){ | |
3437 | if(c1==c2) {fQ=q12; sQ=q13; tQ=q23;} | |
3438 | else if(c1==c3) {fQ=q13; sQ=q12; tQ=q23;} | |
3439 | else {fQ=q23; sQ=q12; tQ=q13;} | |
3440 | }else if(term==2 && part==1){ | |
3441 | fQ=q12; sQ=q13; tQ=q23; | |
3442 | }else if(term==2 && part==2){ | |
3443 | fQ=q13; sQ=q12; tQ=q23; | |
3444 | }else if(term==3 && part==1){ | |
3445 | sQ=q12; | |
3446 | if(c1==c3) {fQ=q13; tQ=q23;} | |
3447 | else {fQ=q23; tQ=q13;} | |
3448 | }else if(term==3 && part==2){ | |
3449 | sQ=q13; | |
3450 | if(c1==c2) {fQ=q12; tQ=q23;} | |
3451 | else {fQ=q23; tQ=q12;} | |
3452 | }else if(term==4 && part==1){ | |
3453 | tQ=q12; | |
3454 | if(c1==c3) {fQ=q13; sQ=q23;} | |
3455 | else {fQ=q23; sQ=q13;} | |
3456 | }else if(term==4 && part==2){ | |
3457 | tQ=q13; | |
3458 | if(c1==c2) {fQ=q12; sQ=q23;} | |
3459 | else {fQ=q23; sQ=q12;} | |
3460 | }else cout<<"problem!!!!!!!!!!!!!"<<endl; | |
3461 | }else if( (c1+c2+c3)==2) {// fQ=os, sQ=os, tQ=ss | |
3462 | if(term==1 || term==5){ | |
3463 | if(c1==c2) {tQ=q12; sQ=q13; fQ=q23;} | |
3464 | else if(c1==c3) {tQ=q13; sQ=q12; fQ=q23;} | |
3465 | else {tQ=q23; sQ=q12; fQ=q13;} | |
3466 | }else if(term==2 && part==1){ | |
3467 | fQ=q12; | |
3468 | if(c1==c3) {tQ=q13; sQ=q23;} | |
3469 | else {tQ=q23; sQ=q13;} | |
3470 | }else if(term==2 && part==2){ | |
3471 | fQ=q13; | |
3472 | if(c1==c2) {tQ=q12; sQ=q23;} | |
3473 | else {tQ=q23; sQ=q12;} | |
3474 | }else if(term==3 && part==1){ | |
3475 | sQ=q12; | |
3476 | if(c1==c3) {tQ=q13; fQ=q23;} | |
3477 | else {tQ=q23; fQ=q13;} | |
3478 | }else if(term==3 && part==2){ | |
3479 | sQ=q13; | |
3480 | if(c1==c2) {tQ=q12; fQ=q23;} | |
3481 | else {tQ=q23; fQ=q12;} | |
3482 | }else if(term==4 && part==1){ | |
3483 | tQ=q12; sQ=q13; fQ=q23; | |
3484 | }else if(term==4 && part==2){ | |
3485 | tQ=q13; sQ=q12; fQ=q23; | |
3486 | }else cout<<"problem!!!!!!!!!!!!!"<<endl; | |
3487 | }else {// fQ=ss, sQ=ss, tQ=ss | |
3488 | if(term==1 || term==5) {fQ=q12; sQ=q13; tQ=q23;} | |
3489 | else if(term==2 && part==1) {fQ=q12; sQ=q13; tQ=q23;} | |
3490 | else if(term==2 && part==2) {fQ=q13; sQ=q12; tQ=q23;} | |
3491 | else if(term==3 && part==1) {sQ=q12; fQ=q13; tQ=q23;} | |
3492 | else if(term==3 && part==2) {sQ=q13; fQ=q12; tQ=q23;} | |
3493 | else if(term==4 && part==1) {tQ=q12; fQ=q13; sQ=q23;} | |
3494 | else if(term==4 && part==2) {tQ=q13; fQ=q12; sQ=q23;} | |
3495 | } | |
3496 | }else if(fi != 5){// all the rest except pi-k-p | |
3497 | if(key1==key2){ | |
3498 | fQ=q12; | |
3499 | if(c1==c2){ | |
3500 | // cases not explicity shown below are not possible | |
3501 | if(term==1 || term==5) {sQ=q13; tQ=q23;} | |
3502 | else if(term==2 && part==1) {sQ=q13; tQ=q23;} | |
3503 | else if(term==3 && part==2) {sQ=q13; tQ=q23;} | |
3504 | else if(term==4 && part==2) {tQ=q13; sQ=q23;} | |
3505 | else cout<<"problem!!!!!!!!!!!!!"<<endl; | |
3506 | }else if(c3==0){ | |
3507 | if(c1==c3) {sQ=q13; tQ=q23;} | |
3508 | else {sQ=q23; tQ=q13;} | |
3509 | }else {//c3==1 | |
3510 | if(c1==c3) {tQ=q13; sQ=q23;} | |
3511 | else {tQ=q23; sQ=q13;} | |
3512 | } | |
3513 | }else if(key1==key3){ | |
3514 | fQ=q13; | |
3515 | if(c1==c3){ | |
3516 | // cases not explicity shown below are not possible | |
3517 | if(term==1 || term==5) {sQ=q12; tQ=q23;} | |
3518 | else if(term==2 && part==2) {sQ=q12; tQ=q23;} | |
3519 | else if(term==3 && part==1) {sQ=q12; tQ=q23;} | |
3520 | else if(term==4 && part==1) {tQ=q12; sQ=q23;} | |
3521 | else cout<<"problem!!!!!!!!!!!!!!!!!!!!!!"<<endl; | |
3522 | }else if(c2==0){ | |
3523 | if(c1==c2) {sQ=q12; tQ=q23;} | |
3524 | else {sQ=q23; tQ=q12;} | |
3525 | }else {//c2==1 | |
3526 | if(c1==c2) {tQ=q12; sQ=q23;} | |
3527 | else {tQ=q23; sQ=q12;} | |
3528 | } | |
3529 | }else {// key2==key3 | |
3530 | fQ=q23; | |
3531 | if(c2==c3){ | |
3532 | // cases not explicity shown below are not possible | |
3533 | if(term==1 || term==5) {sQ=q12; tQ=q13;} | |
3534 | else if(term==3 && part==1) {sQ=q12; tQ=q13;} | |
3535 | else if(term==3 && part==2) {sQ=q13; tQ=q12;} | |
3536 | else if(term==4 && part==1) {tQ=q12; sQ=q13;} | |
3537 | else if(term==4 && part==2) {tQ=q13; sQ=q12;} | |
3538 | else cout<<"problem!!!!!!!!!!!!!!!!!!!!!!"<<endl; | |
3539 | }else if(c1==0){ | |
3540 | if(c1==c2) {sQ=q12; tQ=q13;} | |
3541 | else {sQ=q13; tQ=q12;} | |
3542 | }else {//c1==1 | |
3543 | if(c1==c2) {tQ=q12; sQ=q13;} | |
3544 | else {tQ=q13; sQ=q12;} | |
3545 | } | |
3546 | } | |
3547 | }else {// pi-k-p | |
3548 | if(key1==1){ | |
3549 | if(key2==10) {fQ=q12; sQ=q13; tQ=q23;}// pi-k-p | |
3550 | else {fQ=q13; sQ=q12; tQ=q23;}// pi-p-k | |
3551 | }else if(key1==10){ | |
3552 | if(key2==1) {fQ=q12; sQ=q23; tQ=q13;}// k-pi-p | |
3553 | else {fQ=q13; sQ=q23; tQ=q12;}// k-p-pi | |
3554 | }else {// key1==100 | |
3555 | if(key2==1) {fQ=q23; sQ=q12; tQ=q13;}// p-pi-k | |
3556 | else {fQ=q23; sQ=q13; tQ=q12;}// p-k-pi | |
3557 | } | |
3558 | ||
3559 | } | |
3560 | ||
3561 | ||
3562 | } | |
3563 | //________________________________________________________________________ | |
3564 | Float_t AliChaoticity::GetQinv(Short_t fi, Float_t track1[], Float_t track2[]){ | |
3565 | ||
3566 | Float_t qinv=1.0; | |
3567 | ||
3568 | if(fi==0 || fi==3 || fi==5){// identical masses | |
3569 | qinv = sqrt( pow(track1[1]-track2[1],2) + pow(track1[2]-track2[2],2) + pow(track1[3]-track2[3],2) - pow(track1[0]-track2[0],2)); | |
3570 | }else{// different masses | |
3571 | Float_t px = track1[1] + track2[1]; | |
3572 | Float_t py = track1[2] + track2[2]; | |
3573 | Float_t pz = track1[3] + track2[3]; | |
3574 | Float_t pSquared = pow(track1[0]+track2[0],2) - px*px - py*py - pz*pz; | |
3575 | Float_t deltaDOTsum = (track1[0]-track2[0])*(track1[0]+track2[0]); | |
3576 | deltaDOTsum -= (track1[1]-track2[1])*px + (track1[2]-track2[2])*py + (track1[3]-track2[3])*pz; | |
3577 | ||
3578 | qinv = pow( (track1[1]-track2[1]) - deltaDOTsum*px/(pSquared),2); | |
3579 | qinv += pow( (track1[2]-track2[2]) - deltaDOTsum*py/(pSquared),2); | |
3580 | qinv += pow( (track1[3]-track2[3]) - deltaDOTsum*pz/(pSquared),2); | |
3581 | qinv -= pow( (track1[0]-track2[0]) - deltaDOTsum*(track1[0]+track2[0])/(pSquared),2); | |
3582 | qinv = sqrt(qinv); | |
3583 | } | |
3584 | ||
3585 | return qinv; | |
3586 | ||
3587 | } | |
3588 | //________________________________________________________________________ | |
3589 | void AliChaoticity::GetQosl(Float_t track1[], Float_t track2[], Float_t& qout, Float_t& qside, Float_t& qlong){ | |
3590 | ||
3591 | Float_t p0 = track1[0] + track2[0]; | |
3592 | Float_t px = track1[1] + track2[1]; | |
3593 | Float_t py = track1[2] + track2[2]; | |
3594 | Float_t pz = track1[3] + track2[3]; | |
3595 | ||
3596 | Float_t mt = sqrt(p0*p0 - pz*pz); | |
3597 | Float_t pt = sqrt(px*px + py*py); | |
3598 | ||
3599 | Float_t v0 = track1[0] - track2[0]; | |
3600 | Float_t vx = track1[1] - track2[1]; | |
3601 | Float_t vy = track1[2] - track2[2]; | |
3602 | Float_t vz = track1[3] - track2[3]; | |
3603 | ||
3604 | qout = (px*vx + py*vy)/pt; | |
3605 | qside = (px*vy - py*vx)/pt; | |
3606 | qlong = (p0*vz - pz*v0)/mt; | |
3607 | } | |
3608 | //________________________________________________________________________ | |
654866df | 3609 | void AliChaoticity::SetWeightArrays(Bool_t legoCase, TH3F *histos[AliChaoticity::fKbinsT][AliChaoticity::fCentBins]){ |
3610 | ||
90814457 | 3611 | if(legoCase){ |
3612 | cout<<"LEGO call to SetWeightArrays"<<endl; | |
704f2481 | 3613 | |
654866df | 3614 | for(Int_t tKbin=0; tKbin<fKbinsT; tKbin++){ |
3615 | for(Int_t mb=0; mb<fCentBins; mb++){ | |
f5df8b1d | 3616 | fNormWeight[tKbin][mb] = (TH3F*)histos[tKbin][mb]->Clone(); |
3617 | fNormWeight[tKbin][mb]->SetDirectory(0); | |
90814457 | 3618 | } |
3619 | } | |
f5df8b1d | 3620 | |
90814457 | 3621 | }else{ |
3622 | ||
3623 | TFile *wFile = new TFile("WeightFile.root","READ"); | |
3624 | if(!wFile->IsOpen()) {cout<<"No Weight File!!!!!!!!!!"<<endl; return;} | |
3625 | else cout<<"Good Weight File Found!"<<endl; | |
3626 | ||
654866df | 3627 | for(Int_t tKbin=0; tKbin<fKbinsT; tKbin++){ |
3628 | for(Int_t mb=0; mb<fCentBins; mb++){ | |
f5df8b1d | 3629 | |
3630 | TString *name = new TString("Weight_Kt_"); | |
3631 | *name += tKbin; | |
3632 | name->Append("_Ky_0"); | |
3633 | name->Append("_M_"); | |
3634 | *name += mb; | |
3635 | name->Append("_ED_0"); | |
3636 | ||
f5df8b1d | 3637 | |
3638 | fNormWeight[tKbin][mb] = (TH3F*)wFile->Get(name->Data()); | |
3639 | fNormWeight[tKbin][mb]->SetDirectory(0); | |
3640 | ||
3641 | ||
f5df8b1d | 3642 | }//mb |
90814457 | 3643 | }//kt |
3644 | ||
3645 | wFile->Close(); | |
3646 | } | |
f5df8b1d | 3647 | |
5e3e77d6 | 3648 | cout<<"Done reading weight file"<<endl; |
cd12341d | 3649 | |
3650 | } | |
3651 | //________________________________________________________________________ | |
654866df | 3652 | void AliChaoticity::GetWeight(Float_t track1[], Float_t track2[], Float_t track3[], Float_t track4[], Float_t& wgt, Float_t& wgtErr){ |
cd12341d | 3653 | |
654866df | 3654 | Float_t kt=sqrt( pow(track3[1]+track4[1],2) + pow(track3[2]+track4[2],2))/2.; |
cd12341d | 3655 | // |
3656 | Float_t qOut=0,qSide=0,qLong=0; | |
3657 | GetQosl(track1, track2, qOut, qSide, qLong); | |
3658 | qOut = fabs(qOut); | |
3659 | qSide = fabs(qSide); | |
3660 | qLong = fabs(qLong); | |
3661 | // | |
3662 | ||
140107fb | 3663 | if(kt < fKmeanT[0]) {fKtIndexL=0; fKtIndexH=1;}// fKtIndexL=0; fKtIndexH=0; no extrapolation |
3664 | else if(kt >= fKmeanT[fKbinsT-1]) {fKtIndexL=fKbinsT-2; fKtIndexH=fKbinsT-1;}// fKtIndexL=fKbinsT-1; fKtIndexH=fKbinsT-1; no extrapolation | |
cd12341d | 3665 | else { |
654866df | 3666 | for(Int_t i=0; i<fKbinsT-1; i++){ |
f5df8b1d | 3667 | if((kt >= fKmeanT[i]) && (kt < fKmeanT[i+1])) {fKtIndexL=i; fKtIndexH=i+1; break;} |
cd12341d | 3668 | } |
3669 | } | |
3670 | // | |
3671 | ///////// | |
f5df8b1d | 3672 | if(qOut < fQmean[0]) {fQoIndexL=0; fQoIndexH=0;} |
3673 | else if(qOut >= fQmean[kQbinsWeights-1]) {fQoIndexL=kQbinsWeights-1; fQoIndexH=kQbinsWeights-1;} | |
cd12341d | 3674 | else { |
3675 | for(Int_t i=0; i<kQbinsWeights-1; i++){ | |
f5df8b1d | 3676 | if((qOut >= fQmean[i]) && (qOut < fQmean[i+1])) {fQoIndexL=i; fQoIndexH=i+1; break;} |
cd12341d | 3677 | } |
3678 | } | |
3679 | // | |
f5df8b1d | 3680 | if(qSide < fQmean[0]) {fQsIndexL=0; fQsIndexH=0;} |
3681 | else if(qSide >= fQmean[kQbinsWeights-1]) {fQsIndexL=kQbinsWeights-1; fQsIndexH=kQbinsWeights-1;} | |
cd12341d | 3682 | else { |
3683 | for(Int_t i=0; i<kQbinsWeights-1; i++){ | |
f5df8b1d | 3684 | if((qSide >= fQmean[i]) && (qSide < fQmean[i+1])) {fQsIndexL=i; fQsIndexH=i+1; break;} |
cd12341d | 3685 | } |
3686 | } | |
3687 | // | |
f5df8b1d | 3688 | if(qLong < fQmean[0]) {fQlIndexL=0; fQlIndexH=0;} |
3689 | else if(qLong >= fQmean[kQbinsWeights-1]) {fQlIndexL=kQbinsWeights-1; fQlIndexH=kQbinsWeights-1;} | |
cd12341d | 3690 | else { |
3691 | for(Int_t i=0; i<kQbinsWeights-1; i++){ | |
f5df8b1d | 3692 | if((qLong >= fQmean[i]) && (qLong < fQmean[i+1])) {fQlIndexL=i; fQlIndexH=i+1; break;} |
cd12341d | 3693 | } |
3694 | } | |
3695 | // | |
3696 | ||
f5df8b1d | 3697 | |
3698 | Float_t min = fNormWeight[fKtIndexL][fMbin]->GetBinContent(fQoIndexH+1,fQsIndexH+1,fQlIndexH+1); | |
3699 | Float_t minErr = fNormWeight[fKtIndexL][fMbin]->GetBinError(fQoIndexH+1,fQsIndexH+1,fQlIndexH+1); | |
cd12341d | 3700 | |
cd12341d | 3701 | Float_t deltaW=0; |
3702 | // kt | |
f5df8b1d | 3703 | deltaW += (fNormWeight[fKtIndexH][fMbin]->GetBinContent(fQoIndexH+1, fQsIndexH+1, fQlIndexH+1) - min)*(kt-fKmeanT[fKtIndexL])/((fKstepT[fKtIndexL]+fKstepT[fKtIndexH])/2.); |
cd12341d | 3704 | // Qo |
f5df8b1d | 3705 | deltaW += (fNormWeight[fKtIndexL][fMbin]->GetBinContent(fQoIndexL+1, fQsIndexH+1, fQlIndexH+1) - min)*(qOut-fQmean[fQoIndexL])/fQstepWeights; |
cd12341d | 3706 | // Qs |
f5df8b1d | 3707 | deltaW += (fNormWeight[fKtIndexL][fMbin]->GetBinContent(fQoIndexH+1, fQsIndexL+1, fQlIndexH+1) - min)*(qSide-fQmean[fQsIndexL])/fQstepWeights; |
cd12341d | 3708 | // Ql |
f5df8b1d | 3709 | deltaW += (fNormWeight[fKtIndexL][fMbin]->GetBinContent(fQoIndexH+1, fQsIndexH+1, fQlIndexL+1) - min)*(qLong-fQmean[fQlIndexL])/fQstepWeights; |
cd12341d | 3710 | // |
3711 | wgt = min + deltaW; | |
3712 | ||
46b217b3 | 3713 | |
cd12341d | 3714 | //// |
3715 | ||
3716 | // Denominator errors negligible compared to numerator so do not waste cpu time below. | |
3717 | Float_t deltaWErr=0; | |
3718 | // Kt | |
3719 | /* | |
f5df8b1d | 3720 | deltaWErr += (fNormWeight[fKtIndexH][fMbin]->GetBinContent(fQoIndexH+1, fQsIndexH+1, fQlIndexH+1) - minErr)*(kt-fKmeanT[fKtIndexL])/((fKstepT[fKtIndexL]+fKstepT[fKtIndexH])/2.); |
cd12341d | 3721 | // Qo |
f5df8b1d | 3722 | deltaWErr += (fNormWeight[fKtIndexL][fMbin]->GetBinContent(fQoIndexL+1, fQsIndexH+1, fQlIndexH+1) - minErr)*(qOut-fQmean[fQoIndexL])/fQstepWeights; |
cd12341d | 3723 | // Qs |
f5df8b1d | 3724 | deltaWErr += (fNormWeight[fKtIndexL][fMbin]->GetBinContent(fQoIndexH+1, fQsIndexL+1, fQlIndexH+1) - minErr)*(qSide-fQmean[fQsIndexL])/fQstepWeights; |
cd12341d | 3725 | // Ql |
f5df8b1d | 3726 | deltaWErr += (fNormWeight[fKtIndexL][fMbin]->GetBinContent(fQoIndexH+1, fQsIndexH+1, fQlIndexL+1) - minErr)*(qLong-fQmean[fQlIndexL])/fQstepWeights; |
cd12341d | 3727 | */ |
3728 | wgtErr = minErr + deltaWErr; | |
cd12341d | 3729 | |
3730 | ||
cd12341d | 3731 | } |
3732 | //________________________________________________________________________ | |
3733 | Float_t AliChaoticity::MCWeight(Int_t charge1, Int_t charge2, Int_t rIndex, Int_t dampIndex, Float_t qinv){ | |
3734 | ||
5e3e77d6 | 3735 | Float_t radius = Float_t(rIndex+3.)/0.19733;// convert to GeV |
cd12341d | 3736 | Float_t myDamp = fDampStart + (fDampStep)*dampIndex; |
654866df | 3737 | Float_t coulCorr12 = FSICorrelationTherm2(charge1, charge2, qinv); |
cd12341d | 3738 | if(charge1==charge2){ |
5e3e77d6 | 3739 | return ((1-myDamp) + myDamp*(1 + exp(-pow(qinv*radius,2)))*coulCorr12); |
cd12341d | 3740 | }else { |
5e3e77d6 | 3741 | return ((1-myDamp) + myDamp*coulCorr12); |
cd12341d | 3742 | } |
3743 | ||
3744 | } | |
654866df | 3745 | //________________________________________________________________________ |
3746 | Float_t AliChaoticity::MCWeightOSL(Int_t charge1, Int_t charge2, Int_t rIndex, Int_t dampIndex, Float_t qinv, Float_t qo, Float_t qs, Float_t ql){ | |
3747 | ||
3748 | Float_t radiusOut = Float_t(rIndex+3.)/0.19733;// convert to GeV | |
3749 | Float_t radiusSide = radiusOut; | |
3750 | Float_t radiusLong = radiusOut; | |
3751 | Float_t myDamp = fDampStart + (fDampStep)*dampIndex; | |
3752 | Float_t coulCorr12 = FSICorrelationTherm2(charge1, charge2, qinv); | |
3753 | if(charge1==charge2){ | |
3754 | return ((1-myDamp) + myDamp*(1 + exp(-pow(qo*radiusOut,2)) * exp(-pow(qs*radiusSide,2)) * exp(-pow(ql*radiusLong,2)))*coulCorr12); | |
3755 | }else { | |
3756 | return ((1-myDamp) + myDamp*coulCorr12); | |
3757 | } | |
3758 | ||
3759 | } | |
3760 | ||
cd12341d | 3761 | //________________________________________________________________________ |
90814457 | 3762 | Float_t AliChaoticity::MCWeight3D(Bool_t SameCharge, Int_t term, Int_t dampIndex, Float_t q12, Float_t q13, Float_t q23){ |
cd12341d | 3763 | if(term==5) return 1.0; |
5e3e77d6 | 3764 | |
f9a5e67a | 3765 | Float_t radius=(fRBinMax+3);// RBin=0 corresponds to R=3 fm |
3766 | //if(fMbin<=1) {} | |
3767 | //else if(fMbin<=3) {radius = radius-1;} | |
3768 | //else if(fMbin<=5) {radius = radius-2;} | |
3769 | //else {radius = radius-3;} | |
3770 | ||
90814457 | 3771 | radius /= 0.19733; |
3772 | ||
cd12341d | 3773 | Float_t myDamp = fDampStart + (fDampStep)*dampIndex; |
3774 | Float_t fc = sqrt(myDamp); | |
b3316be6 | 3775 | |
5e3e77d6 | 3776 | if(SameCharge){// all three of the same charge |
90814457 | 3777 | Float_t coulCorr12 = FSICorrelationTherm2(+1,+1, q12);// K2 |
3778 | Float_t coulCorr13 = FSICorrelationTherm2(+1,+1, q13);// K2 | |
3779 | Float_t coulCorr23 = FSICorrelationTherm2(+1,+1, q23);// K2 | |
cd12341d | 3780 | |
5e3e77d6 | 3781 | if(term==1){ |
3782 | Float_t c3QS = 1 + exp(-pow(q12*radius,2)) + exp(-pow(q13*radius,2)) + exp(-pow(q23*radius,2)); | |
3783 | c3QS += 2*exp(-pow(radius,2)*(pow(q12,2) + pow(q13,2) + pow(q23,2))/2.); | |
3784 | Float_t w123 = pow(1-fc,3) + 3*fc*pow(1-fc,2); | |
3785 | w123 += pow(fc,2)*(1-fc)*(1+exp(-pow(q12*radius,2)))*coulCorr12; | |
3786 | w123 += pow(fc,2)*(1-fc)*(1+exp(-pow(q13*radius,2)))*coulCorr13; | |
3787 | w123 += pow(fc,2)*(1-fc)*(1+exp(-pow(q23*radius,2)))*coulCorr23; | |
3788 | w123 += pow(fc,3)*c3QS*FSICorrelationOmega0(kTRUE, q12, q13, q23); | |
3789 | return w123; | |
3790 | }else if(term==2){ | |
3791 | return ((1-myDamp) + myDamp*(1 + exp(-pow(q12*radius,2)))*coulCorr12); | |
3792 | }else if(term==3){ | |
3793 | return ((1-myDamp) + myDamp*(1 + exp(-pow(q13*radius,2)))*coulCorr13); | |
3794 | }else if(term==4){ | |
3795 | return ((1-myDamp) + myDamp*(1 + exp(-pow(q23*radius,2)))*coulCorr23); | |
3796 | }else return 1.0; | |
3797 | ||
3798 | }else{// mixed charge case pair 12 always treated as ss | |
90814457 | 3799 | Float_t coulCorr12 = FSICorrelationTherm2(+1,+1, q12);// K2 ss |
3800 | Float_t coulCorr13 = FSICorrelationTherm2(+1,-1, q13);// K2 os | |
3801 | Float_t coulCorr23 = FSICorrelationTherm2(+1,-1, q23);// K2 os | |
5e3e77d6 | 3802 | if(term==1){ |
3803 | Float_t c3QS = 1 + exp(-pow(q12*radius,2)); | |
3804 | Float_t w123 = pow(1-fc,3) + 3*fc*pow(1-fc,2); | |
3805 | w123 += pow(fc,2)*(1-fc)*(1+exp(-pow(q12*radius,2)))*coulCorr12; | |
3806 | w123 += pow(fc,2)*(1-fc)*coulCorr13; | |
3807 | w123 += pow(fc,2)*(1-fc)*coulCorr23; | |
3808 | w123 += pow(fc,3)*c3QS*FSICorrelationOmega0(kFALSE, q12, q13, q23); | |
3809 | return w123; | |
3810 | }else if(term==2){ | |
3811 | return ((1-myDamp) + myDamp*(1 + exp(-pow(q12*radius,2)))*coulCorr12); | |
3812 | }else if(term==3){ | |
3813 | return ((1-myDamp) + myDamp*coulCorr13); | |
3814 | }else if(term==4){ | |
3815 | return ((1-myDamp) + myDamp*coulCorr23); | |
3816 | }else return 1.0; | |
3817 | } | |
3818 | ||
cd12341d | 3819 | } |
3820 | //________________________________________________________________________ | |
90814457 | 3821 | void AliChaoticity::SetMomResCorrections(Bool_t legoCase, TH2D *temp2D){ |
5e3e77d6 | 3822 | |
3823 | ||
3824 | if(legoCase){ | |
90814457 | 3825 | cout<<"LEGO call to SetMomResCorrections"<<endl; |
5e3e77d6 | 3826 | fMomResC2 = (TH2D*)temp2D->Clone(); |
5e3e77d6 | 3827 | fMomResC2->SetDirectory(0); |
5e3e77d6 | 3828 | }else { |
3829 | TFile *momResFile = new TFile("MomResFile.root","READ"); | |
3830 | if(!momResFile->IsOpen()) { | |
3831 | cout<<"No momentum resolution file found"<<endl; | |
3832 | AliFatal("No momentum resolution file found. Kill process."); | |
3833 | }else {cout<<"Good Momentum Resolution File Found!"<<endl;} | |
3834 | ||
3835 | TH2D *temp2D2 = (TH2D*)momResFile->Get("MomResHisto_pp"); | |
5e3e77d6 | 3836 | fMomResC2 = (TH2D*)temp2D2->Clone(); |
5e3e77d6 | 3837 | fMomResC2->SetDirectory(0); |
90814457 | 3838 | |
5e3e77d6 | 3839 | momResFile->Close(); |
3840 | } | |
cd12341d | 3841 | |
704f2481 | 3842 | // fMomResC2->GetBinContent(1,5) should be ~1.007 |
3843 | if(fMomResC2->GetBinContent(1,5) > 1.2) AliFatal("AliChaoticity: SetMomResCorrections Problem");// Additional Safety check | |
3844 | if(fMomResC2->GetBinContent(1,5) < 0.95) AliFatal("AliChaoticity: SetMomResCorrections Problem");// Additional Safety check | |
3845 | ||
3846 | for(Int_t bx=1; bx<=fMomResC2->GetNbinsX(); bx++){ | |
3847 | for(Int_t by=1; by<=fMomResC2->GetNbinsX(); by++){ | |
3848 | if(fMomResC2->GetBinContent(bx,by) > 1.5) fMomResC2->SetBinContent(bx,by, 1.5);// Maximum is ~1.02 | |
3849 | if(fMomResC2->GetBinContent(bx,by) < 0.95) fMomResC2->SetBinContent(bx,by, 0.95);// Minimum is ~0.98 | |
3850 | } | |
3851 | } | |
3852 | ||
5e3e77d6 | 3853 | cout<<"Done reading momentum resolution file"<<endl; |
3854 | } | |
3855 | //________________________________________________________________________ | |
90814457 | 3856 | void AliChaoticity::SetFSICorrelations(Bool_t legoCase, TH2D *temp2DGaus[2], TH2D *temp2DTherm[2], TH3D *temp3Dos[6], TH3D *temp3Dss[6]){ |
5e3e77d6 | 3857 | // read in 2-particle and 3-particle FSI correlations = K2 & K3 |
3858 | // 2-particle input histo from file is binned in qinv. 3-particle in qinv of each pair | |
3859 | if(legoCase){ | |
c4980714 | 3860 | cout<<"LEGO call to SetFSICorrelations"<<endl; |
90814457 | 3861 | fFSI2SS[0] = (TH2D*)temp2DGaus[0]->Clone(); |
3862 | fFSI2OS[0] = (TH2D*)temp2DGaus[1]->Clone(); | |
3863 | fFSI2SS[1] = (TH2D*)temp2DTherm[0]->Clone(); | |
3864 | fFSI2OS[1] = (TH2D*)temp2DTherm[1]->Clone(); | |
5e3e77d6 | 3865 | // |
90814457 | 3866 | fFSI2SS[0]->SetDirectory(0); |
3867 | fFSI2OS[0]->SetDirectory(0); | |
3868 | fFSI2SS[1]->SetDirectory(0); | |
3869 | fFSI2OS[1]->SetDirectory(0); | |
3870 | ||
3871 | for(Int_t CB=0; CB<6; CB++) { | |
3872 | fFSIOmega0OS[CB] = (TH3D*)temp3Dos[CB]->Clone(); | |
3873 | fFSIOmega0SS[CB] = (TH3D*)temp3Dss[CB]->Clone(); | |
3874 | // | |
3875 | fFSIOmega0OS[CB]->SetDirectory(0); | |
3876 | fFSIOmega0SS[CB]->SetDirectory(0); | |
3877 | } | |
5e3e77d6 | 3878 | }else { |
c4980714 | 3879 | cout<<"non LEGO call to SetFSICorrelations"<<endl; |
5e3e77d6 | 3880 | TFile *fsifile = new TFile("KFile.root","READ"); |
3881 | if(!fsifile->IsOpen()) { | |
3882 | cout<<"No FSI file found"<<endl; | |
3883 | AliFatal("No FSI file found. Kill process."); | |
3884 | }else {cout<<"Good FSI File Found!"<<endl;} | |
3885 | ||
90814457 | 3886 | TH2D *temphisto2GausSS = (TH2D*)fsifile->Get("K2ssG"); |
3887 | TH2D *temphisto2GausOS = (TH2D*)fsifile->Get("K2osG"); | |
3888 | TH2D *temphisto2ThermSS = (TH2D*)fsifile->Get("K2ssT"); | |
3889 | TH2D *temphisto2ThermOS = (TH2D*)fsifile->Get("K2osT"); | |
3890 | TH3D *temphisto3OS[6]; | |
ae9b34d1 | 3891 | TH3D *temphisto3SS[6]; |
3892 | for(Int_t CB=0; CB<6; CB++) { | |
90814457 | 3893 | TString *nameK3SS = new TString("K3ss_"); |
3894 | *nameK3SS += CB; | |
3895 | temphisto3SS[CB] = (TH3D*)fsifile->Get(nameK3SS->Data()); | |
3896 | // | |
3897 | TString *nameK3OS = new TString("K3os_"); | |
3898 | *nameK3OS += CB; | |
3899 | temphisto3OS[CB] = (TH3D*)fsifile->Get(nameK3OS->Data()); | |
ae9b34d1 | 3900 | } |
3901 | ||
90814457 | 3902 | fFSI2SS[0] = (TH2D*)temphisto2GausSS->Clone(); |
3903 | fFSI2OS[0] = (TH2D*)temphisto2GausOS->Clone(); | |
3904 | fFSI2SS[1] = (TH2D*)temphisto2ThermSS->Clone(); | |
3905 | fFSI2OS[1] = (TH2D*)temphisto2ThermOS->Clone(); | |
3906 | fFSI2SS[0]->SetDirectory(0); | |
3907 | fFSI2OS[0]->SetDirectory(0); | |
3908 | fFSI2SS[1]->SetDirectory(0); | |
3909 | fFSI2OS[1]->SetDirectory(0); | |
ae9b34d1 | 3910 | |
90814457 | 3911 | for(Int_t CB=0; CB<6; CB++) { |
3912 | fFSIOmega0SS[CB] = (TH3D*)temphisto3SS[CB]->Clone(); | |
3913 | fFSIOmega0OS[CB] = (TH3D*)temphisto3OS[CB]->Clone(); | |
3914 | fFSIOmega0SS[CB]->SetDirectory(0); | |
3915 | fFSIOmega0OS[CB]->SetDirectory(0); | |
3916 | } | |
3917 | // | |
3918 | ||
5e3e77d6 | 3919 | fsifile->Close(); |
cd12341d | 3920 | } |
0e58bc53 | 3921 | /* |
5e3e77d6 | 3922 | // condition FSI histogram for edge effects |
ae9b34d1 | 3923 | for(Int_t CB=0; CB<6; CB++){ |
3924 | for(Int_t ii=1; ii<=fFSIOmega0SS[CB]->GetNbinsX(); ii++){ | |
3925 | for(Int_t jj=1; jj<=fFSIOmega0SS[CB]->GetNbinsY(); jj++){ | |
3926 | for(Int_t kk=1; kk<=fFSIOmega0SS[CB]->GetNbinsZ(); kk++){ | |
5e3e77d6 | 3927 | |
ae9b34d1 | 3928 | if(fFSIOmega0SS[CB]->GetBinContent(ii,jj,kk) <=0){ |
3929 | Double_t Q12 = fFSIOmega0SS[CB]->GetXaxis()->GetBinCenter(ii); | |
3930 | Double_t Q23 = fFSIOmega0SS[CB]->GetYaxis()->GetBinCenter(jj); | |
3931 | Double_t Q13 = fFSIOmega0SS[CB]->GetZaxis()->GetBinCenter(kk); | |
3932 | // | |
3933 | Int_t Q12bin=ii; | |
3934 | Int_t Q23bin=jj; | |
3935 | Int_t Q13bin=kk; | |
3936 | Int_t AC=0;//Adjust Counter | |
3937 | Int_t AClimit=10;// maximum bin shift | |
3938 | if(Q12 < sqrt(pow(Q13,2)+pow(Q23,2) - 2*Q13*Q23)) {while(fFSIOmega0SS[CB]->GetBinContent(Q12bin, Q23bin, Q13bin) <=0 && AC<AClimit) {Q12bin++; AC++;}} | |
3939 | if(Q12 > sqrt(pow(Q13,2)+pow(Q23,2) + 2*Q13*Q23)) {while(fFSIOmega0SS[CB]->GetBinContent(Q12bin, Q23bin, Q13bin) <=0 && AC<AClimit) {Q12bin--; AC++;}} | |
3940 | // | |
3941 | if(Q13 < sqrt(pow(Q12,2)+pow(Q23,2) - 2*Q12*Q23)) {while(fFSIOmega0SS[CB]->GetBinContent(Q12bin, Q23bin, Q13bin) <=0 && AC<AClimit) {Q13bin++; AC++;}} | |
3942 | if(Q13 > sqrt(pow(Q12,2)+pow(Q23,2) + 2*Q12*Q23)) {while(fFSIOmega0SS[CB]->GetBinContent(Q12bin, Q23bin, Q13bin) <=0 && AC<AClimit) {Q13bin--; AC++;}} | |
3943 | // | |
3944 | if(Q23 < sqrt(pow(Q12,2)+pow(Q13,2) - 2*Q12*Q13)) {while(fFSIOmega0SS[CB]->GetBinContent(Q12bin, Q23bin, Q13bin) <=0 && AC<AClimit) {Q23bin++; AC++;}} | |
3945 | if(Q23 > sqrt(pow(Q12,2)+pow(Q13,2) + 2*Q12*Q13)) {while(fFSIOmega0SS[CB]->GetBinContent(Q12bin, Q23bin, Q13bin) <=0 && AC<AClimit) {Q23bin--; AC++;}} | |
3946 | ||
3947 | // Save cpu time by setting empty cell contents (edge effects) to nearest non-zero cell (these cells are not used very often anyway.) | |
3948 | if(AC==AClimit) { | |
3949 | fFSIOmega0SS[CB]->SetBinContent(ii,jj,kk, 1.0); | |
90814457 | 3950 | fFSIOmega0OS[CB]->SetBinContent(ii,jj,kk, 1.0); |
ae9b34d1 | 3951 | }else { |
3952 | fFSIOmega0SS[CB]->SetBinContent(ii,jj,kk, fFSIOmega0SS[CB]->GetBinContent(Q12bin, Q23bin, Q13bin)); | |
90814457 | 3953 | fFSIOmega0OS[CB]->SetBinContent(ii,jj,kk, fFSIOmega0OS[CB]->GetBinContent(Q12bin, Q23bin, Q13bin)); |
ae9b34d1 | 3954 | } |
5e3e77d6 | 3955 | } |
ae9b34d1 | 3956 | |
5e3e77d6 | 3957 | } |
5e3e77d6 | 3958 | } |
cd12341d | 3959 | } |
3960 | } | |
0e58bc53 | 3961 | */ |
704f2481 | 3962 | // fFSI2SS[1]->GetBinContent(1,2) should be ~0.32 |
3963 | if(fFSI2SS[1]->GetBinContent(1,2) > 1.0) AliFatal("AliChaoticity: SetFSICorrelations Problem");// Additional Safety check | |
3964 | if(fFSI2SS[1]->GetBinContent(1,2) < 0.1) AliFatal("AliChaoticity: SetFSICorrelations Problem");// Additional Safety check | |
3965 | ||
3966 | for(Int_t ii=1; ii<=fFSI2SS[0]->GetNbinsX(); ii++){ | |
3967 | for(Int_t jj=1; jj<=fFSI2SS[0]->GetNbinsY(); jj++){ | |
3968 | if(fFSI2SS[0]->GetBinContent(ii,jj) > 1.0) fFSI2SS[0]->SetBinContent(ii,jj, 1.0); | |
3969 | if(fFSI2SS[1]->GetBinContent(ii,jj) > 1.0) fFSI2SS[1]->SetBinContent(ii,jj, 1.0); | |
3970 | if(fFSI2OS[0]->GetBinContent(ii,jj) > 10.0) fFSI2OS[0]->SetBinContent(ii,jj, 10.0); | |
3971 | if(fFSI2OS[1]->GetBinContent(ii,jj) > 10.0) fFSI2OS[1]->SetBinContent(ii,jj, 10.0); | |
3972 | // | |
3973 | if(fFSI2SS[0]->GetBinContent(ii,jj) < 0.05) fFSI2SS[0]->SetBinContent(ii,jj, 0.05); | |
3974 | if(fFSI2SS[1]->GetBinContent(ii,jj) < 0.05) fFSI2SS[1]->SetBinContent(ii,jj, 0.05); | |
3975 | if(fFSI2OS[0]->GetBinContent(ii,jj) < 0.9) fFSI2OS[0]->SetBinContent(ii,jj, 0.9); | |
3976 | if(fFSI2OS[1]->GetBinContent(ii,jj) < 0.9) fFSI2OS[1]->SetBinContent(ii,jj, 0.9); | |
3977 | } | |
3978 | } | |
3979 | ||
5e3e77d6 | 3980 | cout<<"Done reading FSI file"<<endl; |
cd12341d | 3981 | } |
3982 | //________________________________________________________________________ | |
90814457 | 3983 | Float_t AliChaoticity::FSICorrelationGaus2(Int_t charge1, Int_t charge2, Int_t rIndex, Float_t qinv){ |
5e3e77d6 | 3984 | // returns 2-particle Coulomb correlations = K2 |
654866df | 3985 | if(rIndex >= fRVALUES) return 1.0; |
90814457 | 3986 | Int_t qbinL = fFSI2SS[0]->GetYaxis()->FindBin(qinv-fFSI2SS[0]->GetYaxis()->GetBinWidth(1)/2.); |
3987 | Int_t qbinH = qbinL+1; | |
3988 | if(qbinL <= 0) return 1.0; | |
3989 | if(qbinH > fFSI2SS[0]->GetNbinsY()) return 1.0; | |
3990 | ||
3991 | Float_t slope=0; | |
3992 | if(charge1==charge2){ | |
3993 | slope = fFSI2SS[0]->GetBinContent(rIndex+1, qbinL) - fFSI2SS[0]->GetBinContent(rIndex+1, qbinH); | |
3994 | slope /= fFSI2SS[0]->GetYaxis()->GetBinCenter(qbinL) - fFSI2SS[0]->GetYaxis()->GetBinCenter(qbinH); | |
3995 | return (slope*(qinv - fFSI2SS[0]->GetYaxis()->GetBinCenter(qbinL)) + fFSI2SS[0]->GetBinContent(rIndex+1, qbinL)); | |
3996 | }else { | |
3997 | slope = fFSI2OS[0]->GetBinContent(rIndex+1, qbinL) - fFSI2OS[0]->GetBinContent(rIndex+1, qbinH); | |
3998 | slope /= fFSI2OS[0]->GetYaxis()->GetBinCenter(qbinL) - fFSI2OS[0]->GetYaxis()->GetBinCenter(qbinH); | |
3999 | return (slope*(qinv - fFSI2OS[0]->GetYaxis()->GetBinCenter(qbinL)) + fFSI2OS[0]->GetBinContent(rIndex+1, qbinL)); | |
4000 | } | |
4001 | } | |
4002 | //________________________________________________________________________ | |
4003 | Float_t AliChaoticity::FSICorrelationTherm2(Int_t charge1, Int_t charge2, Float_t qinv){ | |
4004 | // returns 2-particle Coulomb correlations = K2 | |
4005 | Int_t qbinL = fFSI2SS[1]->GetYaxis()->FindBin(qinv-fFSI2SS[1]->GetYaxis()->GetBinWidth(1)/2.); | |
5e3e77d6 | 4006 | Int_t qbinH = qbinL+1; |
4007 | if(qbinL <= 0) return 1.0; | |
90814457 | 4008 | if(qbinH > fFSI2SS[1]->GetNbinsY()) return 1.0; |
5e3e77d6 | 4009 | |
4010 | Float_t slope=0; | |
4011 | if(charge1==charge2){ | |
90814457 | 4012 | slope = fFSI2SS[1]->GetBinContent(fFSIbin+1, qbinL) - fFSI2SS[1]->GetBinContent(fFSIbin+1, qbinH); |
4013 | slope /= fFSI2SS[1]->GetYaxis()->GetBinCenter(qbinL) - fFSI2SS[1]->GetYaxis()->GetBinCenter(qbinH); | |
4014 | return (slope*(qinv - fFSI2SS[1]->GetYaxis()->GetBinCenter(qbinL)) + fFSI2SS[1]->GetBinContent(fFSIbin+1, qbinL)); | |
5e3e77d6 | 4015 | }else { |
90814457 | 4016 | slope = fFSI2OS[1]->GetBinContent(fFSIbin+1, qbinL) - fFSI2OS[1]->GetBinContent(fFSIbin+1, qbinH); |
4017 | slope /= fFSI2OS[1]->GetYaxis()->GetBinCenter(qbinL) - fFSI2OS[1]->GetYaxis()->GetBinCenter(qbinH); | |
4018 | return (slope*(qinv - fFSI2OS[1]->GetYaxis()->GetBinCenter(qbinL)) + fFSI2OS[1]->GetBinContent(fFSIbin+1, qbinL)); | |
cd12341d | 4019 | } |
4020 | } | |
4021 | //________________________________________________________________________ | |
5e3e77d6 | 4022 | Double_t AliChaoticity::FSICorrelationOmega0(Bool_t SameCharge, Double_t Q12, Double_t Q13, Double_t Q23){ |
5e3e77d6 | 4023 | // returns 3d 3-particle Coulomb Correlation = K3 |
ae9b34d1 | 4024 | Int_t Q12bin = fFSIOmega0SS[fFSIbin]->GetXaxis()->FindBin(Q12); |
4025 | Int_t Q13bin = fFSIOmega0SS[fFSIbin]->GetZaxis()->FindBin(Q13); | |
4026 | Int_t Q23bin = fFSIOmega0SS[fFSIbin]->GetYaxis()->FindBin(Q23); | |
0e58bc53 | 4027 | Int_t index12L = int(fabs(Q12 - fFSI2SS[1]->GetYaxis()->GetBinWidth(1)/2.)/(fFSI2SS[1]->GetYaxis()->GetBinWidth(1))); |
4028 | Int_t index12H = index12L+1; | |
4029 | Int_t index13L = int(fabs(Q13 - fFSI2SS[1]->GetYaxis()->GetBinWidth(1)/2.)/(fFSI2SS[1]->GetYaxis()->GetBinWidth(1))); | |
4030 | Int_t index13H = index13L+1; | |
4031 | Int_t index23L = int(fabs(Q23 - fFSI2SS[1]->GetYaxis()->GetBinWidth(1)/2.)/(fFSI2SS[1]->GetYaxis()->GetBinWidth(1))); | |
4032 | Int_t index23H = index23L+1; | |
4033 | ||
5e3e77d6 | 4034 | if(SameCharge){ |
ae9b34d1 | 4035 | if(fFSIOmega0SS[fFSIbin]->GetBinContent(Q12bin, Q23bin, Q13bin) <=0) return 1.0; |
0e58bc53 | 4036 | Double_t base = fFSIOmega0SS[fFSIbin]->GetBinContent(index12L+1, index23L+1, index13L+1); |
4037 | Double_t InterPolated = 0; | |
4038 | Double_t slope12 = fFSIOmega0SS[fFSIbin]->GetBinContent(index12H+1, index23L+1, index13L+1); | |
4039 | slope12 -= base; | |
4040 | slope12 /= fFSIOmega0SS[fFSIbin]->GetXaxis()->GetBinWidth(1); | |
4041 | InterPolated += slope12*fabs(Q12 - fFSIOmega0SS[fFSIbin]->GetXaxis()->GetBinCenter(index12L+1)); | |
4042 | Double_t slope23 = fFSIOmega0SS[fFSIbin]->GetBinContent(index12L+1, index23H+1, index13L+1); | |
4043 | slope23 -= base; | |
4044 | slope23 /= fFSIOmega0SS[fFSIbin]->GetYaxis()->GetBinWidth(1); | |
4045 | InterPolated += slope23*fabs(Q23 - fFSIOmega0SS[fFSIbin]->GetYaxis()->GetBinCenter(index23L+1)); | |
4046 | Double_t slope13 = fFSIOmega0SS[fFSIbin]->GetBinContent(index12L+1, index23L+1, index13H+1); | |
4047 | slope13 -= base; | |
4048 | slope13 /= fFSIOmega0SS[fFSIbin]->GetZaxis()->GetBinWidth(1); | |
4049 | InterPolated += slope13*fabs(Q13 - fFSIOmega0SS[fFSIbin]->GetZaxis()->GetBinCenter(index13L+1)); | |
4050 | if( (base+InterPolated) <= 0) return 1.0; | |
4051 | return (base+InterPolated); | |
4052 | ||
4053 | }else{// mixed charge. Q12 is always designated as the same-charge pair | |
90814457 | 4054 | if(fFSIOmega0OS[fFSIbin]->GetBinContent(Q12bin, Q23bin, Q13bin) <=0) return 1.0; |
0e58bc53 | 4055 | Double_t base = fFSIOmega0OS[fFSIbin]->GetBinContent(index12L+1, index23H+1, index13H+1); |
4056 | Double_t InterPolated = 0; | |
4057 | Double_t slope12 = fFSIOmega0OS[fFSIbin]->GetBinContent(index12H+1, index23H+1, index13H+1); | |
4058 | slope12 -= base; | |
4059 | slope12 /= fFSIOmega0OS[fFSIbin]->GetXaxis()->GetBinWidth(1); | |
4060 | InterPolated += slope12*fabs(Q12 - fFSIOmega0OS[fFSIbin]->GetXaxis()->GetBinCenter(index12L+1)); | |
4061 | Double_t slope23 = fFSIOmega0OS[fFSIbin]->GetBinContent(index12L+1, index23L+1, index13H+1); | |
4062 | slope23 -= base; | |
4063 | slope23 /= fFSIOmega0OS[fFSIbin]->GetYaxis()->GetBinWidth(1); | |
4064 | InterPolated += slope23*fabs(Q23 - fFSIOmega0OS[fFSIbin]->GetYaxis()->GetBinCenter(index23L+1)); | |
4065 | Double_t slope13 = fFSIOmega0OS[fFSIbin]->GetBinContent(index12L+1, index23H+1, index13L+1); | |
4066 | slope13 -= base; | |
4067 | slope13 /= fFSIOmega0OS[fFSIbin]->GetZaxis()->GetBinWidth(1); | |
4068 | InterPolated += slope13*fabs(Q13 - fFSIOmega0OS[fFSIbin]->GetZaxis()->GetBinCenter(index13L+1)); | |
4069 | if( (base+InterPolated) <= 0) return 1.0; | |
4070 | return (base+InterPolated); | |
4071 | ||
5e3e77d6 | 4072 | } |
cd12341d | 4073 | } |
90814457 | 4074 | //________________________________________________________________________ |
4075 | void AliChaoticity::FourVectProdTerms(Float_t pV1[], Float_t pV2[], Float_t pV3[], Float_t& QS1v1, Float_t& QS2, Float_t& QS3v1, Float_t& QS1v2, Float_t& QS3v2){ | |
4076 | QS1v1 = (pV1[0]-pV2[0])*(pV2[1]-pV3[1]) - (pV1[1]-pV2[1])*(pV2[0]-pV3[0]); | |
4077 | QS1v1 += (pV1[0]-pV2[0])*(pV2[2]-pV3[2]) - (pV1[2]-pV2[2])*(pV2[0]-pV3[0]); | |
4078 | QS1v1 += (pV1[0]-pV2[0])*(pV2[3]-pV3[3]) - (pV1[3]-pV2[3])*(pV2[0]-pV3[0]); | |
4079 | QS2 = (pV1[1]-pV2[1])*(pV2[2]-pV3[2]) - (pV1[2]-pV2[2])*(pV2[1]-pV3[1]); | |
4080 | QS3v1 = (pV1[1]-pV2[1])*(pV2[3]-pV3[3]) - (pV1[3]-pV2[3])*(pV2[1]-pV3[1]); | |
4081 | QS3v1 += (pV1[2]-pV2[2])*(pV2[3]-pV3[3]) - (pV1[3]-pV2[3])*(pV2[2]-pV3[2]); | |
4082 | // | |
4083 | QS1v2 = (pV1[0]-pV2[0])*(pV2[1]-pV3[1]) - (pV1[1]-pV2[1])*(pV2[0]-pV3[0]); | |
4084 | QS1v2 += (pV1[0]-pV2[0])*(pV2[2]-pV3[2]) - (pV1[2]-pV2[2])*(pV2[0]-pV3[0]); | |
4085 | QS3v2 = (pV1[1]-pV2[1])*(pV2[3]-pV3[3]) - (pV1[3]-pV2[3])*(pV2[1]-pV3[1]); | |
4086 | QS3v2 += (pV1[0]-pV2[0])*(pV2[3]-pV3[3]) - (pV1[3]-pV2[3])*(pV2[0]-pV3[0]); | |
4087 | QS3v2 += (pV1[2]-pV2[2])*(pV2[3]-pV3[3]) - (pV1[3]-pV2[3])*(pV2[2]-pV3[2]); | |
4088 | } | |
4089 | //________________________________________________________________________ |