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