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