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