]>
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; | |
71978909 | 504 | fLEGO = obj.fLEGO; |
cd12341d | 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++) { | |
f15c1f69 | 1513 | AliAODTrack* aodtrack = dynamic_cast<AliAODTrack*>(fAOD->GetTrack(randomIndex[i])); |
1514 | if(!aodtrack) AliFatal("Not a standard AOD"); | |
cd12341d | 1515 | if (!aodtrack) continue; |
1516 | if(myTracks >= fMultLimit) {cout<<"More tracks than Track Limit"<<endl; return;} | |
1517 | ||
1518 | status=aodtrack->GetStatus(); | |
1519 | ||
6903e04b | 1520 | if(!aodtrack->TestFilterBit(BIT(7))) continue;// AOD filterBit cut |
1521 | ||
1522 | ||
1523 | if(fFilterBit != 7){ | |
1524 | Bool_t goodTrackOtherFB = kFALSE; | |
1525 | for (Int_t j = 0; j < fAOD->GetNumberOfTracks(); j++) { | |
f15c1f69 | 1526 | AliAODTrack* aodtrack2 = dynamic_cast<AliAODTrack*>(fAOD->GetTrack(randomIndex[j])); |
1527 | if(!aodtrack2) AliFatal("Not a standard AOD"); | |
6903e04b | 1528 | if(!aodtrack2) continue; |
1529 | if(!aodtrack2->TestFilterBit(BIT(fFilterBit))) continue; | |
1530 | ||
1531 | if(-(aodtrack->GetID()+1)==aodtrack2->GetID()) {goodTrackOtherFB=kTRUE; break;} | |
1532 | ||
1533 | } | |
1534 | if(!goodTrackOtherFB) continue; | |
1535 | } | |
1536 | ||
654866df | 1537 | |
cd12341d | 1538 | if(aodtrack->Pt() < 0.16) continue; |
1539 | if(fabs(aodtrack->Eta()) > 0.8) continue; | |
e29e02c1 | 1540 | |
6903e04b | 1541 | |
cd12341d | 1542 | Bool_t goodMomentum = aodtrack->GetPxPyPz( fTempStruct[myTracks].fP); |
1543 | if(!goodMomentum) continue; | |
1544 | aodtrack->GetXYZ( fTempStruct[myTracks].fX); | |
6903e04b | 1545 | |
1546 | ||
1547 | Double_t dca2[2]={0}; | |
cd12341d | 1548 | dca2[0] = sqrt( pow(fTempStruct[myTracks].fX[0] - vertex[0],2) + pow(fTempStruct[myTracks].fX[1] - vertex[1],2)); |
1549 | dca2[1] = sqrt( pow(fTempStruct[myTracks].fX[2] - vertex[2],2)); | |
6903e04b | 1550 | Double_t dca3d = sqrt( pow(dca2[0],2) + pow(dca2[1],2)); |
cd12341d | 1551 | |
1552 | fTempStruct[myTracks].fStatus = status; | |
1553 | fTempStruct[myTracks].fFiltermap = aodtrack->GetFilterMap(); | |
1554 | fTempStruct[myTracks].fId = aodtrack->GetID(); | |
1555 | fTempStruct[myTracks].fLabel = aodtrack->GetLabel(); | |
1556 | fTempStruct[myTracks].fPhi = atan2(fTempStruct[myTracks].fP[1], fTempStruct[myTracks].fP[0]); | |
1557 | if(fTempStruct[myTracks].fPhi < 0) fTempStruct[myTracks].fPhi += 2*PI; | |
1558 | fTempStruct[myTracks].fPt = sqrt(pow(fTempStruct[myTracks].fP[0],2) + pow(fTempStruct[myTracks].fP[1],2)); | |
1559 | fTempStruct[myTracks].fMom = sqrt( pow(fTempStruct[myTracks].fPt,2) + pow(fTempStruct[myTracks].fP[2],2) ); | |
1560 | fTempStruct[myTracks].fEta = aodtrack->Eta(); | |
1561 | fTempStruct[myTracks].fCharge = aodtrack->Charge(); | |
1562 | fTempStruct[myTracks].fDCAXY = dca2[0]; | |
1563 | fTempStruct[myTracks].fDCAZ = dca2[1]; | |
1564 | fTempStruct[myTracks].fDCA = dca3d; | |
1565 | fTempStruct[myTracks].fClusterMap = aodtrack->GetTPCClusterMap(); | |
1566 | fTempStruct[myTracks].fSharedMap = aodtrack->GetTPCSharedMap(); | |
1567 | ||
1568 | ||
1569 | ||
1570 | if(fTempStruct[myTracks].fMom > 0.9999) continue;// upper P bound | |
1571 | if(fTempStruct[myTracks].fPt > 0.9999) continue;// upper P bound | |
1572 | if(fTempStruct[myTracks].fP[2] > 0.9999) continue;// upper P bound | |
1573 | ||
6903e04b | 1574 | |
05db4376 | 1575 | // PID section |
cd12341d | 1576 | fTempStruct[myTracks].fElectron = kFALSE; |
1577 | fTempStruct[myTracks].fPion = kFALSE; | |
1578 | fTempStruct[myTracks].fKaon = kFALSE; | |
1579 | fTempStruct[myTracks].fProton = kFALSE; | |
1580 | ||
1581 | Float_t nSigmaTPC[5]; | |
1582 | Float_t nSigmaTOF[5]; | |
1583 | nSigmaTPC[0]=10; nSigmaTPC[1]=10; nSigmaTPC[2]=10; nSigmaTPC[3]=10; nSigmaTPC[4]=10; | |
1584 | nSigmaTOF[0]=10; nSigmaTOF[1]=10; nSigmaTOF[2]=10; nSigmaTOF[3]=10; nSigmaTOF[4]=10; | |
1585 | fTempStruct[myTracks].fTOFhit = kFALSE;// default | |
1586 | Float_t signalTPC=0, signalTOF=0; | |
1587 | Double_t integratedTimesTOF[10]={0}; | |
cd12341d | 1588 | |
6903e04b | 1589 | /*if(fFilterBit != 7 ) { |
3ee47b58 | 1590 | nSigmaTPC[0]=fPIDResponse->NumberOfSigmasTPC(aodtrack,AliPID::kElectron); |
1591 | nSigmaTPC[1]=fPIDResponse->NumberOfSigmasTPC(aodtrack,AliPID::kMuon); | |
1592 | nSigmaTPC[2]=fPIDResponse->NumberOfSigmasTPC(aodtrack,AliPID::kPion); | |
1593 | nSigmaTPC[3]=fPIDResponse->NumberOfSigmasTPC(aodtrack,AliPID::kKaon); | |
1594 | nSigmaTPC[4]=fPIDResponse->NumberOfSigmasTPC(aodtrack,AliPID::kProton); | |
cd12341d | 1595 | // |
3ee47b58 | 1596 | nSigmaTOF[0]=fPIDResponse->NumberOfSigmasTOF(aodtrack,AliPID::kElectron); |
1597 | nSigmaTOF[1]=fPIDResponse->NumberOfSigmasTOF(aodtrack,AliPID::kMuon); | |
1598 | nSigmaTOF[2]=fPIDResponse->NumberOfSigmasTOF(aodtrack,AliPID::kPion); | |
1599 | nSigmaTOF[3]=fPIDResponse->NumberOfSigmasTOF(aodtrack,AliPID::kKaon); | |
1600 | nSigmaTOF[4]=fPIDResponse->NumberOfSigmasTOF(aodtrack,AliPID::kProton); | |
05db4376 | 1601 | signalTPC = aodtrack->GetTPCsignal(); |
1602 | if( (status&AliESDtrack::kTOFpid)!=0 && (status&AliESDtrack::kTIME)!=0 && (status&AliESDtrack::kTOFout)!=0 && (status&AliESDtrack::kTOFmismatch)<=0){// good tof hit | |
cd12341d | 1603 | fTempStruct[myTracks].fTOFhit = kTRUE; |
05db4376 | 1604 | signalTOF = aodtrack->GetTOFsignal(); |
1605 | aodtrack->GetIntegratedTimes(integratedTimesTOF); | |
cd12341d | 1606 | }else fTempStruct[myTracks].fTOFhit = kFALSE; |
05db4376 | 1607 | |
1608 | }else {// FilterBit 7 PID workaround | |
6903e04b | 1609 | */ |
05db4376 | 1610 | for(Int_t j = 0; j < fAOD->GetNumberOfTracks(); j++) { |
f15c1f69 | 1611 | AliAODTrack* aodTrack2 = dynamic_cast<AliAODTrack*>(fAOD->GetTrack(j)); |
1612 | if(!aodTrack2) AliFatal("Not a standard AOD"); | |
05db4376 | 1613 | if (!aodTrack2) continue; |
1614 | if(aodtrack->GetID() != (-aodTrack2->GetID() - 1)) continue;// (-aodTrack2->GetID() - 1) | |
1615 | ||
1616 | UInt_t status2=aodTrack2->GetStatus(); | |
1617 | ||
3ee47b58 | 1618 | nSigmaTPC[0]=fPIDResponse->NumberOfSigmasTPC(aodTrack2,AliPID::kElectron); |
1619 | nSigmaTPC[1]=fPIDResponse->NumberOfSigmasTPC(aodTrack2,AliPID::kMuon); | |
1620 | nSigmaTPC[2]=fPIDResponse->NumberOfSigmasTPC(aodTrack2,AliPID::kPion); | |
1621 | nSigmaTPC[3]=fPIDResponse->NumberOfSigmasTPC(aodTrack2,AliPID::kKaon); | |
1622 | nSigmaTPC[4]=fPIDResponse->NumberOfSigmasTPC(aodTrack2,AliPID::kProton); | |
05db4376 | 1623 | // |
3ee47b58 | 1624 | nSigmaTOF[0]=fPIDResponse->NumberOfSigmasTOF(aodTrack2,AliPID::kElectron); |
1625 | nSigmaTOF[1]=fPIDResponse->NumberOfSigmasTOF(aodTrack2,AliPID::kMuon); | |
1626 | nSigmaTOF[2]=fPIDResponse->NumberOfSigmasTOF(aodTrack2,AliPID::kPion); | |
1627 | nSigmaTOF[3]=fPIDResponse->NumberOfSigmasTOF(aodTrack2,AliPID::kKaon); | |
1628 | nSigmaTOF[4]=fPIDResponse->NumberOfSigmasTOF(aodTrack2,AliPID::kProton); | |
05db4376 | 1629 | signalTPC = aodTrack2->GetTPCsignal(); |
1630 | ||
1631 | if( (status2&AliESDtrack::kTOFpid)!=0 && (status2&AliESDtrack::kTIME)!=0 && (status2&AliESDtrack::kTOFout)!=0 && (status2&AliESDtrack::kTOFmismatch)<=0){// good tof hit | |
1632 | fTempStruct[myTracks].fTOFhit = kTRUE; | |
1633 | signalTOF = aodTrack2->GetTOFsignal(); | |
1634 | aodTrack2->GetIntegratedTimes(integratedTimesTOF); | |
1635 | }else fTempStruct[myTracks].fTOFhit = kFALSE; | |
1636 | ||
1637 | }// aodTrack2 | |
6903e04b | 1638 | //}// FilterBit 7 PID workaround |
05db4376 | 1639 | |
1640 | ||
cd12341d | 1641 | /////////////////// |
1642 | ((TH3F*)fOutputList->FindObject("fTPCResponse"))->Fill(centralityPercentile, fTempStruct[myTracks].fMom, signalTPC); | |
1643 | if(fTempStruct[myTracks].fTOFhit) { | |
1644 | ((TH3F*)fOutputList->FindObject("fTOFResponse"))->Fill(centralityPercentile, fTempStruct[myTracks].fMom, signalTOF - integratedTimesTOF[3]); | |
1645 | } | |
1646 | /////////////////// | |
6903e04b | 1647 | |
cd12341d | 1648 | // Use TOF if good hit and above threshold |
1649 | if(fTempStruct[myTracks].fTOFhit && fTempStruct[myTracks].fMom > fTPCTOFboundry){ | |
3ee47b58 | 1650 | if(fabs(nSigmaTOF[0])<fSigmaCutTOF) fTempStruct[myTracks].fElectron = kTRUE;// Electron candidate |
1651 | if(fabs(nSigmaTOF[2])<fSigmaCutTOF) fTempStruct[myTracks].fPion = kTRUE;// Pion candidate | |
1652 | if(fabs(nSigmaTOF[3])<fSigmaCutTOF) fTempStruct[myTracks].fKaon = kTRUE;// Kaon candidate | |
1653 | if(fabs(nSigmaTOF[4])<fSigmaCutTOF) fTempStruct[myTracks].fProton = kTRUE;// Proton candidate | |
cd12341d | 1654 | }else {// TPC info instead |
3ee47b58 | 1655 | if(fabs(nSigmaTPC[0])<fSigmaCutTPC) fTempStruct[myTracks].fElectron = kTRUE;// Electron candidate |
1656 | if(fabs(nSigmaTPC[2])<fSigmaCutTPC) fTempStruct[myTracks].fPion = kTRUE;// Pion candidate | |
1657 | if(fabs(nSigmaTPC[3])<fSigmaCutTPC) fTempStruct[myTracks].fKaon = kTRUE;// Kaon candidate | |
1658 | if(fabs(nSigmaTPC[4])<fSigmaCutTPC) fTempStruct[myTracks].fProton = kTRUE;// Proton candidate | |
1659 | // asymmetric dE/dx cut to reduce muon contamination | |
9e0b388e | 1660 | //if(nSigmaTPC[2] < -0.5) fTempStruct[myTracks].fPion = kFALSE;// asymmetric dE/dx cut |
cd12341d | 1661 | } |
05db4376 | 1662 | |
cd12341d | 1663 | |
1664 | // Ensure there is only 1 candidate per track | |
1665 | if(fTempStruct[myTracks].fElectron && fTempStruct[myTracks].fMom < 0.45) continue;// Remove electron band | |
1666 | if(!fTempStruct[myTracks].fPion && !fTempStruct[myTracks].fKaon && !fTempStruct[myTracks].fProton) continue; | |
1667 | if(fTempStruct[myTracks].fPion && fTempStruct[myTracks].fKaon) continue; | |
1668 | if(fTempStruct[myTracks].fPion && fTempStruct[myTracks].fProton) continue; | |
1669 | if(fTempStruct[myTracks].fKaon && fTempStruct[myTracks].fProton) continue; | |
1670 | if(fTempStruct[myTracks].fPion && fTempStruct[myTracks].fKaon && fTempStruct[myTracks].fProton) continue; | |
1671 | //////////////////////// | |
1672 | if(fTempStruct[myTracks].fProton && fTempStruct[myTracks].fMom < 0.25) continue;//extra cut for protons | |
1673 | ||
1674 | if(!fTempStruct[myTracks].fPion) continue;// only pions | |
1675 | ||
1676 | ||
1677 | ||
1678 | ||
1679 | if(fTempStruct[myTracks].fPion) {// pions | |
1680 | fTempStruct[myTracks].fEaccepted = sqrt(pow(fTempStruct[myTracks].fMom,2) + pow(fTrueMassPi,2)); | |
1681 | fTempStruct[myTracks].fKey = 1; | |
1682 | }else if(fTempStruct[myTracks].fKaon){// kaons | |
1683 | fTempStruct[myTracks].fEaccepted = sqrt(pow(fTempStruct[myTracks].fMom,2) + pow(fTrueMassK,2));; | |
1684 | fTempStruct[myTracks].fKey = 10; | |
1685 | }else{// protons | |
1686 | fTempStruct[myTracks].fEaccepted = sqrt(pow(fTempStruct[myTracks].fMom,2) + pow(fTrueMassP,2));; | |
1687 | fTempStruct[myTracks].fKey = 100; | |
1688 | } | |
1689 | ||
dbcaf506 | 1690 | |
1691 | ((TH2D*)fOutputList->FindObject("fTrackChi2NDF"))->Fill(centralityPercentile, aodtrack->Chi2perNDF()); | |
1692 | ((TH2D*)fOutputList->FindObject("fTrackTPCncls"))->Fill(centralityPercentile, aodtrack->GetTPCncls()); | |
1693 | if(aodtrack->Chi2perNDF() > fMaxChi2NDF) continue; | |
1694 | if(aodtrack->GetTPCncls() < fMinTPCncls) continue; | |
1695 | ||
6903e04b | 1696 | if(fTempStruct[myTracks].fCharge==+1) { |
1697 | ((TH2F*)fOutputList->FindObject("fDCAxyDistPlus"))->Fill(fTempStruct[myTracks].fPt, dca2[0]); | |
1698 | ((TH2F*)fOutputList->FindObject("fDCAzDistPlus"))->Fill(fTempStruct[myTracks].fPt, dca2[1]); | |
1699 | }else { | |
1700 | ((TH2F*)fOutputList->FindObject("fDCAxyDistMinus"))->Fill(fTempStruct[myTracks].fPt, dca2[0]); | |
1701 | ((TH2F*)fOutputList->FindObject("fDCAzDistMinus"))->Fill(fTempStruct[myTracks].fPt, dca2[1]); | |
1702 | } | |
1703 | ||
1704 | ((TH3F*)fOutputList->FindObject("fPhiPtDist"))->Fill(aodtrack->Charge(), aodtrack->Phi(), aodtrack->Pt()); | |
1705 | ((TH3F*)fOutputList->FindObject("fPtEtaDist"))->Fill(aodtrack->Charge(), aodtrack->Pt(), aodtrack->Eta()); | |
1706 | ||
dbcaf506 | 1707 | |
cd12341d | 1708 | if(aodtrack->Charge() > 0) positiveTracks++; |
1709 | else negativeTracks++; | |
1710 | ||
1711 | if(fTempStruct[myTracks].fPion) pionCount++; | |
1712 | if(fTempStruct[myTracks].fKaon) kaonCount++; | |
1713 | if(fTempStruct[myTracks].fProton) protonCount++; | |
1714 | ||
1715 | myTracks++; | |
1716 | ||
1717 | } | |
1718 | }else {// ESD tracks | |
1719 | cout<<"ESDs not supported currently"<<endl; | |
1720 | return; | |
1721 | } | |
1722 | ||
3ee47b58 | 1723 | // Generator info only |
1724 | if(fMCcase && fGeneratorOnly){ | |
1725 | myTracks=0; pionCount=0; kaonCount=0; protonCount=0;// reset track counters | |
1726 | for(Int_t mctrackN=0; mctrackN<mcArray->GetEntriesFast(); mctrackN++){ | |
1727 | if(myTracks >= fMultLimit) {cout<<"More tracks than Track Limit"<<endl; return;} | |
1728 | if(myTracks >= 1300) continue;// additional cut to limit high mult events which exceed pair # limits | |
1729 | ||
1730 | AliAODMCParticle *mcParticle = (AliAODMCParticle*)mcArray->At(mctrackN); | |
1731 | if(!mcParticle) continue; | |
1732 | if(fabs(mcParticle->Eta())>0.8) continue; | |
1733 | if(mcParticle->Charge()!=-3 && mcParticle->Charge()!=+3) continue;// x3 by convention | |
1734 | if(mcParticle->Pt() < 0.16 || mcParticle->Pt() > 1.0) continue; | |
1735 | if(!mcParticle->IsPrimary()) continue; | |
1736 | if(!mcParticle->IsPhysicalPrimary()) continue; | |
1737 | if(abs(mcParticle->GetPdgCode())!=211) continue; | |
1738 | ||
1739 | fTempStruct[myTracks].fP[0] = mcParticle->Px(); | |
1740 | fTempStruct[myTracks].fP[1] = mcParticle->Py(); | |
1741 | fTempStruct[myTracks].fP[2] = mcParticle->Pz(); | |
1742 | fTempStruct[myTracks].fX[0] = 0.; fTempStruct[myTracks].fX[1] = 0.; fTempStruct[myTracks].fX[2] = 0.; | |
1743 | ||
1744 | fTempStruct[myTracks].fId = myTracks;// use my track counter | |
1745 | fTempStruct[myTracks].fLabel = mctrackN; | |
1746 | fTempStruct[myTracks].fPhi = atan2(fTempStruct[myTracks].fP[1], fTempStruct[myTracks].fP[0]); | |
1747 | if(fTempStruct[myTracks].fPhi < 0) fTempStruct[myTracks].fPhi += 2*PI; | |
1748 | fTempStruct[myTracks].fPt = sqrt(pow(fTempStruct[myTracks].fP[0],2) + pow(fTempStruct[myTracks].fP[1],2)); | |
1749 | fTempStruct[myTracks].fMom = sqrt( pow(fTempStruct[myTracks].fPt,2) + pow(fTempStruct[myTracks].fP[2],2) ); | |
1750 | fTempStruct[myTracks].fEta = mcParticle->Eta(); | |
1751 | fTempStruct[myTracks].fCharge = int(mcParticle->Charge()/3.); | |
1752 | fTempStruct[myTracks].fDCAXY = 0.; | |
1753 | fTempStruct[myTracks].fDCAZ = 0.; | |
1754 | fTempStruct[myTracks].fDCA = 0.; | |
1755 | fTempStruct[myTracks].fPion = kTRUE; | |
1756 | fTempStruct[myTracks].fEaccepted = sqrt(pow(fTempStruct[myTracks].fMom,2) + pow(fTrueMassPi,2)); | |
1757 | fTempStruct[myTracks].fKey = 1; | |
1758 | ||
1759 | myTracks++; | |
1760 | pionCount++; | |
1761 | } | |
1762 | } | |
cd12341d | 1763 | |
1764 | if(myTracks >= 1) { | |
1765 | ((TH1F*)fOutputList->FindObject("fMultDist3"))->Fill(myTracks); | |
1766 | } | |
1767 | ||
1768 | ||
b6e5ec54 | 1769 | //cout<<"There are "<<myTracks<<" myTracks"<<endl; |
1770 | //cout<<"pionCount = "<<pionCount<<" kaonCount = "<<kaonCount<<" protonCount = "<<protonCount<<endl; | |
cd12341d | 1771 | |
1772 | ///////////////////////////////////////// | |
1773 | // Pion Multiplicity Cut (To ensure all Correlation orders are present in each event) | |
1774 | if(myTracks < 3) {cout<<"Less than 3 tracks. Skipping Event."<<endl; return;} | |
1775 | ///////////////////////////////////////// | |
fa109294 | 1776 | |
cd12341d | 1777 | |
1778 | //////////////////////////////// | |
1779 | /////////////////////////////// | |
1780 | // Mbin determination | |
1781 | // | |
1782 | // Mbin set to Pion Count Only for pp!!!!!!! | |
1783 | fMbin=-1; | |
1784 | if(!fPbPbcase){ | |
1785 | for(Int_t i=0; i<kMultBinspp; i++){ | |
1786 | if( ( pionCount > fMultLimits[i]) && ( pionCount <= fMultLimits[i+1]) ) { fMbin=i; break;} | |
1787 | // Mbin 0 has 1 pion | |
1788 | } | |
1789 | }else{ | |
654866df | 1790 | for(Int_t i=0; i<fCentBins; i++){ |
cd12341d | 1791 | if( (centralityPercentile >= cStart+i*cStep) && (centralityPercentile < cStart+(i+1)*cStep) ){ |
1792 | fMbin=i;// 0 = most central | |
1793 | break; | |
1794 | } | |
1795 | } | |
1796 | } | |
1797 | ||
1798 | if(fMbin==-1) {cout<<"Bad Mbin+++++++++++++++++++++++++++++++++++++++++++++++++++"<<endl; return;} | |
1799 | ||
704f2481 | 1800 | fFSIbin=0; |
ae9b34d1 | 1801 | if(fMbin==0) fFSIbin = 0;//0-5% |
1802 | else if(fMbin==1) fFSIbin = 1;//5-10% | |
1803 | else if(fMbin<=3) fFSIbin = 2;//10-20% | |
1804 | else if(fMbin<=5) fFSIbin = 3;//20-30% | |
1805 | else if(fMbin<=7) fFSIbin = 4;//30-40% | |
1806 | else fFSIbin = 5;//40-50% | |
1807 | ||
05db4376 | 1808 | Int_t rIndexForTPNMomRes = fRMax-6; |
05db4376 | 1809 | if(fMbin==0) {rIndexForTPNMomRes=fRMax-6;}// 10 fm with EW (fRMax should be 11 for normal running) |
1810 | else if(fMbin==1) {rIndexForTPNMomRes=fRMax-7;} | |
1811 | else if(fMbin<=3) {rIndexForTPNMomRes=fRMax-8;} | |
1812 | else if(fMbin<=5) {rIndexForTPNMomRes=fRMax-9;} | |
1813 | else {rIndexForTPNMomRes=fRMax-10;} | |
90814457 | 1814 | |
cd12341d | 1815 | ////////////////////////////////////////////////// |
1816 | fEDbin=0;// Extra Dimension bin (Kt, (Kt-Psi),....) | |
1817 | ////////////////////////////////////////////////// | |
1818 | ||
20d52fd9 | 1819 | |
654866df | 1820 | |
cd12341d | 1821 | ((TH1F*)fOutputList->FindObject("fEvents1"))->Fill(fMbin+1); |
1822 | ((TProfile*)fOutputList->FindObject("fAvgMult"))->Fill(fMbin+1., pionCount); | |
1823 | ||
1824 | //////////////////////////////////// | |
1825 | // Add event to buffer if > 0 tracks | |
1826 | if(myTracks > 0){ | |
1827 | fEC[zbin][fMbin]->FIFOShift(); | |
1828 | (fEvt) = fEC[zbin][fMbin]->fEvtStr; | |
1829 | (fEvt)->fNtracks = myTracks; | |
1830 | (fEvt)->fFillStatus = 1; | |
1831 | for(Int_t i=0; i<myTracks; i++) (fEvt)->fTracks[i] = fTempStruct[i]; | |
1832 | if(fMCcase){ | |
1833 | (fEvt)->fMCarraySize = mcArray->GetEntriesFast(); | |
1834 | for(Int_t i=0; i<mcArray->GetEntriesFast(); i++) { | |
1835 | AliAODMCParticle *tempMCTrack = (AliAODMCParticle*)mcArray->At(i); | |
1836 | (fEvt)->fMCtracks[i].fPx = tempMCTrack->Px(); | |
1837 | (fEvt)->fMCtracks[i].fPy = tempMCTrack->Py(); | |
1838 | (fEvt)->fMCtracks[i].fPz = tempMCTrack->Pz(); | |
1839 | (fEvt)->fMCtracks[i].fPtot = sqrt(pow(tempMCTrack->Px(),2)+pow(tempMCTrack->Py(),2)+pow(tempMCTrack->Pz(),2)); | |
1840 | } | |
1841 | } | |
1842 | } | |
1843 | ||
6903e04b | 1844 | |
cd12341d | 1845 | |
1846 | Float_t qinv12=0, qinv13=0, qinv23=0; | |
1847 | Float_t qout=0, qside=0, qlong=0; | |
1848 | Float_t qoutMC=0, qsideMC=0, qlongMC=0; | |
df2ce8e1 | 1849 | Float_t firstQ=0, secondQ=0, thirdQ=0; |
1850 | Float_t firstQMC=0, secondQMC=0, thirdQMC=0; | |
6903e04b | 1851 | Float_t firstKt=0, secondKt=0, thirdKt=0; |
cd12341d | 1852 | Float_t transK12=0, rapK12=0, transK3=0; |
1853 | Int_t transKbin=0, rapKbin=0; | |
05db4376 | 1854 | Float_t q3=0, q3MC=0; |
cd12341d | 1855 | Int_t ch1=0, ch2=0, ch3=0; |
1856 | Short_t key1=0, key2=0, key3=0; | |
1857 | Int_t bin1=0, bin2=0, bin3=0; | |
1858 | Float_t pVect1[4]={0}; | |
1859 | Float_t pVect2[4]={0}; | |
1860 | Float_t pVect3[4]={0}; | |
1861 | Float_t pVect1MC[4]={0}; | |
1862 | Float_t pVect2MC[4]={0}; | |
5e3e77d6 | 1863 | Float_t pVect3MC[4]={0}; |
cd12341d | 1864 | Int_t index1=0, index2=0, index3=0; |
1865 | Float_t weight12=0, weight13=0, weight23=0; | |
1866 | Float_t weight12Err=0, weight13Err=0, weight23Err=0; | |
1867 | Float_t weight12CC=0, weight13CC=0, weight23CC=0; | |
1868 | Float_t weightTotal=0;//, weightTotalErr=0; | |
5e3e77d6 | 1869 | Float_t qinv12MC=0, qinv13MC=0, qinv23MC=0; |
20d52fd9 | 1870 | //Float_t Qsum1v1=0, Qsum2=0, Qsum3v1=0, Qsum1v2=0, Qsum3v2=0; |
1871 | //Float_t Qsum1v1MC=0, Qsum2MC=0, Qsum3v1MC=0, Qsum1v2MC=0, Qsum3v2MC=0; | |
90814457 | 1872 | // |
cd12341d | 1873 | AliAODMCParticle *mcParticle1=0x0; |
1874 | AliAODMCParticle *mcParticle2=0x0; | |
1875 | ||
1876 | ||
1877 | if(fPdensityPairCut){ | |
1878 | //////////////////// | |
1879 | Int_t pairCountSE=0, pairCountME=0; | |
1880 | Int_t normPairCount[2]={0}; | |
1881 | Int_t numOtherPairs1[2][fMultLimit]; | |
1882 | Int_t numOtherPairs2[2][fMultLimit]; | |
1883 | Bool_t exitCode=kFALSE; | |
1884 | Int_t tempNormFillCount[2][2][2][10][5]; | |
1885 | ||
1886 | ||
1887 | // reset to defaults | |
1888 | for(Int_t i=0; i<fMultLimit; i++) { | |
1889 | fPairLocationSE[i]->Set(fMultLimit,fDefaultsInt); | |
1890 | fPairLocationME[i]->Set(fMultLimit,fDefaultsInt); | |
1891 | ||
1892 | // Normalization Utilities | |
1893 | fOtherPairLocation1[0][i]->Set(fMultLimit,fDefaultsInt); | |
1894 | fOtherPairLocation1[1][i]->Set(fMultLimit,fDefaultsInt); | |
1895 | fOtherPairLocation2[0][i]->Set(fMultLimit,fDefaultsInt); | |
1896 | fOtherPairLocation2[1][i]->Set(fMultLimit,fDefaultsInt); | |
1897 | fNormPairSwitch[0][i]->Set(fMultLimit,fDefaultsCharMult); | |
1898 | fNormPairSwitch[1][i]->Set(fMultLimit,fDefaultsCharMult); | |
1899 | fNormPairSwitch[2][i]->Set(fMultLimit,fDefaultsCharMult); | |
1900 | numOtherPairs1[0][i]=0; | |
1901 | numOtherPairs1[1][i]=0; | |
1902 | numOtherPairs2[0][i]=0; | |
1903 | numOtherPairs2[1][i]=0; | |
1904 | ||
1905 | // Track Merging/Splitting Utilities | |
1906 | fPairSplitCut[0][i]->Set(fMultLimit,fDefaultsCharMult);// P11 | |
1907 | fPairSplitCut[1][i]->Set(fMultLimit,fDefaultsCharMult);// P12 | |
1908 | fPairSplitCut[2][i]->Set(fMultLimit,fDefaultsCharMult);// P13 | |
1909 | fPairSplitCut[3][i]->Set(fMultLimit,fDefaultsCharMult);// P23 | |
1910 | } | |
1911 | ||
1912 | // Reset the temp Normalization counters | |
1913 | for(Int_t i=0; i<2; i++){// Charge1 | |
1914 | for(Int_t j=0; j<2; j++){// Charge2 | |
1915 | for(Int_t k=0; k<2; k++){// Charge3 | |
1916 | for(Int_t l=0; l<10; l++){// FillIndex (species Combination) | |
1917 | for(Int_t m=0; m<5; m++){// Term (Cumulant term) | |
1918 | tempNormFillCount[i][j][k][l][m] = 0; | |
1919 | } | |
1920 | } | |
1921 | } | |
1922 | } | |
1923 | } | |
1924 | ||
1925 | ||
1926 | /////////////////////////////////////////////////////// | |
1927 | // Start the pairing process | |
1928 | // P11 pairing | |
1929 | // 1st Particle | |
20d52fd9 | 1930 | |
cd12341d | 1931 | for (Int_t i=0; i<myTracks; i++) { |
1932 | ||
1933 | Int_t en2=0; | |
1934 | ||
1935 | // 2nd particle | |
1936 | for (Int_t j=i+1; j<(fEvt+en2)->fNtracks; j++) { | |
1937 | ||
1938 | key1 = (fEvt)->fTracks[i].fKey; | |
1939 | key2 = (fEvt+en2)->fTracks[j].fKey; | |
1940 | Short_t fillIndex2 = FillIndex2part(key1+key2); | |
1941 | Short_t qCutBin = SetQcutBin(fillIndex2); | |
1942 | Short_t normBin = SetNormBin(fillIndex2); | |
1943 | pVect1[0]=(fEvt)->fTracks[i].fEaccepted; pVect2[0]=(fEvt+en2)->fTracks[j].fEaccepted; | |
1944 | pVect1[1]=(fEvt)->fTracks[i].fP[0]; pVect2[1]=(fEvt+en2)->fTracks[j].fP[0]; | |
1945 | pVect1[2]=(fEvt)->fTracks[i].fP[1]; pVect2[2]=(fEvt+en2)->fTracks[j].fP[1]; | |
1946 | pVect1[3]=(fEvt)->fTracks[i].fP[2]; pVect2[3]=(fEvt+en2)->fTracks[j].fP[2]; | |
654866df | 1947 | |
cd12341d | 1948 | // |
1949 | ||
1950 | qinv12 = GetQinv(fillIndex2, pVect1, pVect2); | |
1951 | GetQosl(pVect1, pVect2, qout, qside, qlong); | |
1952 | transK12 = sqrt(pow(pVect1[1]+pVect2[1],2) + pow(pVect1[2]+pVect2[2],2))/2.; | |
3eebc801 | 1953 | |
1954 | ||
654866df | 1955 | // |
1956 | ||
cd12341d | 1957 | /////////////////////////////// |
1958 | ch1 = Int_t(((fEvt)->fTracks[i].fCharge + 1)/2.); | |
1959 | ch2 = Int_t(((fEvt+en2)->fTracks[j].fCharge + 1)/2.); | |
1960 | SetFillBins2(fillIndex2, key1, key2, ch1, ch2, bin1, bin2); | |
1961 | ||
e29e02c1 | 1962 | if(fMCcase && ch1==ch2 && fMbin==0 && qinv12<0.2){ |
1963 | ////////////////////////// | |
1964 | // pad-row method testing | |
1965 | Float_t coeff = (5)*0.2*(0.18/1.2);// 5 to evaluate at 1.0m in TPC | |
1966 | Float_t phi1 = (fEvt)->fTracks[i].fPhi - asin((fEvt)->fTracks[i].fCharge*(0.1*fBfield)*coeff/(fEvt)->fTracks[i].fPt); | |
1967 | if(phi1 > 2*PI) phi1 -= 2*PI; | |
1968 | if(phi1 < 0) phi1 += 2*PI; | |
1969 | Float_t phi2 = (fEvt+en2)->fTracks[j].fPhi - asin((fEvt+en2)->fTracks[j].fCharge*(0.1*fBfield)*coeff/(fEvt+en2)->fTracks[j].fPt); | |
1970 | if(phi2 > 2*PI) phi2 -= 2*PI; | |
1971 | if(phi2 < 0) phi2 += 2*PI; | |
1972 | Float_t deltaphi = phi1 - phi2; | |
1973 | if(deltaphi > PI) deltaphi -= PI; | |
1974 | if(deltaphi < -PI) deltaphi += PI; | |
1975 | ||
1976 | Int_t ncl1 = (fEvt)->fTracks[i].fClusterMap.GetNbits(); | |
1977 | Int_t ncl2 = (fEvt+en2)->fTracks[j].fClusterMap.GetNbits(); | |
1978 | Float_t sumCls = 0; Float_t sumSha = 0; Float_t sumQ = 0; | |
1979 | Double_t shfrac = 0; //Double_t qfactor = 0; | |
1980 | for(Int_t imap = 0; imap < ncl1 && imap < ncl2; imap++) { | |
1981 | if ((fEvt)->fTracks[i].fClusterMap.TestBitNumber(imap) && (fEvt+en2)->fTracks[j].fClusterMap.TestBitNumber(imap)) {// Both clusters | |
1982 | if ((fEvt)->fTracks[i].fSharedMap.TestBitNumber(imap) && (fEvt+en2)->fTracks[j].fSharedMap.TestBitNumber(imap)) { // Shared | |
1983 | sumQ++; | |
1984 | sumCls+=2; | |
1985 | sumSha+=2;} | |
1986 | else {sumQ--; sumCls+=2;} | |
1987 | } | |
1988 | else if ((fEvt)->fTracks[i].fClusterMap.TestBitNumber(imap) || (fEvt+en2)->fTracks[j].fClusterMap.TestBitNumber(imap)) {// Non shared | |
1989 | sumQ++; | |
1990 | sumCls++;} | |
1991 | } | |
1992 | if (sumCls>0) { | |
1993 | //qfactor = sumQ*1.0/sumCls; | |
1994 | shfrac = sumSha*1.0/sumCls; | |
1995 | } | |
1996 | if(fabs(deltaphi)<0.07 && fabs((fEvt)->fTracks[i].fEta-(fEvt+en2)->fTracks[j].fEta) < 0.03){ | |
1997 | ((TH3D*)fOutputList->FindObject("fPairsPadRowNum"))->Fill(transK12, shfrac, qinv12); | |
1998 | } | |
1999 | ||
cd12341d | 2000 | for(Int_t rstep=0; rstep<10; rstep++){ |
e29e02c1 | 2001 | coeff = (rstep)*0.2*(0.18/1.2); |
2002 | phi1 = (fEvt)->fTracks[i].fPhi - asin((fEvt)->fTracks[i].fCharge*(0.1*fBfield)*coeff/(fEvt)->fTracks[i].fPt); | |
cd12341d | 2003 | if(phi1 > 2*PI) phi1 -= 2*PI; |
2004 | if(phi1 < 0) phi1 += 2*PI; | |
e29e02c1 | 2005 | phi2 = (fEvt+en2)->fTracks[j].fPhi - asin((fEvt+en2)->fTracks[j].fCharge*(0.1*fBfield)*coeff/(fEvt+en2)->fTracks[j].fPt); |
cd12341d | 2006 | if(phi2 > 2*PI) phi2 -= 2*PI; |
2007 | if(phi2 < 0) phi2 += 2*PI; | |
e29e02c1 | 2008 | deltaphi = phi1 - phi2; |
cd12341d | 2009 | if(deltaphi > PI) deltaphi -= PI; |
2010 | if(deltaphi < -PI) deltaphi += PI; | |
e29e02c1 | 2011 | |
2012 | if(fabs((fEvt)->fTracks[i].fEta-(fEvt+en2)->fTracks[j].fEta) < 0.03){ | |
2013 | ((TH3F*)fOutputList->FindObject("fPairsShareFracDPhiNum"))->Fill(rstep, shfrac, deltaphi); | |
2014 | } | |
2015 | //if(shfrac < 0.05){ | |
cd12341d | 2016 | ((TH3F*)fOutputList->FindObject("fPairsDetaDPhiNum"))->Fill(rstep, (fEvt)->fTracks[i].fEta-(fEvt+en2)->fTracks[j].fEta, deltaphi); |
e29e02c1 | 2017 | //} |
cd12341d | 2018 | } |
e29e02c1 | 2019 | |
2020 | ||
2021 | }// MCcase and pair selection | |
20d52fd9 | 2022 | |
cd12341d | 2023 | // Pair Splitting/Merging cut |
e29e02c1 | 2024 | if(qinv12 < fQLowerCut) continue;// remove unwanted low-q pairs (also a type of track splitting/merging cut) |
3ee47b58 | 2025 | if(ch1 == ch2 && !fGeneratorOnly){ |
cd12341d | 2026 | if(!AcceptPair((fEvt)->fTracks[i], (fEvt+en2)->fTracks[j])) { |
2027 | fPairSplitCut[0][i]->AddAt('1',j); | |
2028 | ((TH1F*)fOutputList->FindObject("fRejectedPairs"))->Fill(qinv12); | |
2029 | continue; | |
2030 | } | |
2031 | } | |
e29e02c1 | 2032 | |
cd12341d | 2033 | // HIJING tests |
2034 | if(fMCcase && fillIndex2==0){ | |
2035 | ||
2036 | // Check that label does not exceed stack size | |
2037 | if((fEvt)->fTracks[i].fLabel < (fEvt)->fMCarraySize && (fEvt+en2)->fTracks[j].fLabel < (fEvt+en2)->fMCarraySize){ | |
2038 | pVect1MC[0]=sqrt(pow((fEvt)->fMCtracks[abs((fEvt)->fTracks[i].fLabel)].fPtot,2)+pow(fTrueMassPi,2)); | |
2039 | pVect2MC[0]=sqrt(pow((fEvt+en2)->fMCtracks[abs((fEvt+en2)->fTracks[j].fLabel)].fPtot,2)+pow(fTrueMassPi,2)); | |
2040 | pVect1MC[1]=(fEvt)->fMCtracks[abs((fEvt)->fTracks[i].fLabel)].fPx; pVect2MC[1]=(fEvt+en2)->fMCtracks[abs((fEvt+en2)->fTracks[j].fLabel)].fPx; | |
2041 | pVect1MC[2]=(fEvt)->fMCtracks[abs((fEvt)->fTracks[i].fLabel)].fPy; pVect2MC[2]=(fEvt+en2)->fMCtracks[abs((fEvt+en2)->fTracks[j].fLabel)].fPy; | |
2042 | pVect1MC[3]=(fEvt)->fMCtracks[abs((fEvt)->fTracks[i].fLabel)].fPz; pVect2MC[3]=(fEvt+en2)->fMCtracks[abs((fEvt+en2)->fTracks[j].fLabel)].fPz; | |
2043 | qinv12MC = GetQinv(fillIndex2, pVect1MC, pVect2MC); | |
2044 | GetQosl(pVect1MC, pVect2MC, qoutMC, qsideMC, qlongMC); | |
2045 | if(qinv12<0.1 && ch1==ch2) { | |
2046 | ((TProfile*)fOutputList->FindObject("fQsmearMean"))->Fill(1.,qinv12-qinv12MC); | |
2047 | ((TProfile*)fOutputList->FindObject("fQsmearSq"))->Fill(1.,1000.*pow(qinv12-qinv12MC,2)); | |
2048 | ((TH1D*)fOutputList->FindObject("fQDist"))->Fill(qinv12-qinv12MC); | |
2049 | } | |
3ee47b58 | 2050 | //cout<<pVect1[0]<<" "<<pVect1MC[0]<<" : "<<pVect1[1]<<" "<<pVect1MC[1]<<" : "<<pVect1[2]<<" "<<pVect1MC[2]<<" : "<<pVect1[3]<<" "<<pVect1MC[3]<<" : "<<endl; |
3eebc801 | 2051 | //if(transK12 <= 0.35) fEDbin=0; |
2052 | //else fEDbin=1; | |
2053 | ||
df2ce8e1 | 2054 | /*for(Int_t rIter=0; rIter<fRVALUES; rIter++){// 3fm to 8fm + 1 Therminator setting |
cd12341d | 2055 | for(Int_t myDampIt=0; myDampIt<kNDampValues; myDampIt++){ |
2056 | Int_t denIndex = rIter*kNDampValues + myDampIt; | |
05db4376 | 2057 | Float_t WInput = MCWeight(ch1,ch2, rIter+kRmin, myDampIt, qinv12MC); |
cd12341d | 2058 | Charge1[bin1].Charge2[bin2].SC[fillIndex2].MB[fMbin].EDB[fEDbin].TwoPT[0].fIdeal->Fill(denIndex, qinv12MC, WInput); |
2059 | Charge1[bin1].Charge2[bin2].SC[fillIndex2].MB[fMbin].EDB[fEDbin].TwoPT[1].fIdeal->Fill(denIndex, qinv12MC); | |
2060 | Charge1[bin1].Charge2[bin2].SC[fillIndex2].MB[fMbin].EDB[fEDbin].TwoPT[0].fSmeared->Fill(denIndex, qinv12, WInput); | |
2061 | Charge1[bin1].Charge2[bin2].SC[fillIndex2].MB[fMbin].EDB[fEDbin].TwoPT[1].fSmeared->Fill(denIndex, qinv12); | |
2062 | } | |
df2ce8e1 | 2063 | }*/ |
3eebc801 | 2064 | //fEDbin=0; |
2065 | ||
fa109294 | 2066 | mcParticle1 = (AliAODMCParticle*)mcArray->At(abs((fEvt)->fTracks[i].fLabel)); |
2067 | mcParticle2 = (AliAODMCParticle*)mcArray->At(abs((fEvt+en2)->fTracks[j].fLabel)); | |
2068 | ||
cd12341d | 2069 | //HIJING resonance test |
2070 | if(ch1 != ch2){ | |
cd12341d | 2071 | ((TH1F*)fOutputList->FindObject("fAllOSPairs"))->Fill(fMbin+1, qinv12); |
fa109294 | 2072 | if(abs(mcParticle1->GetPdgCode())==211 && abs(mcParticle2->GetPdgCode())==211){// Pions |
cd12341d | 2073 | if(mcParticle1->GetMother() == mcParticle2->GetMother() && mcParticle1->GetMother() >=0){ |
2074 | ((TH1F*)fOutputList->FindObject("fResonanceOSPairs"))->Fill(fMbin+1, qinv12); | |
2075 | } | |
2076 | } | |
2077 | } | |
e29e02c1 | 2078 | // secondary contamination |
2079 | if(abs(mcParticle1->GetPdgCode())==211 && abs(mcParticle2->GetPdgCode())==211){ | |
2080 | if(ch1==ch2) { | |
2081 | ((TH3D*)fOutputList->FindObject("fAllSCPionPairs"))->Fill(fMbin+1, transK12, qinv12); | |
2082 | if(!mcParticle1->IsSecondaryFromWeakDecay() && !mcParticle2->IsSecondaryFromWeakDecay()) { | |
2083 | ((TH3D*)fOutputList->FindObject("fPrimarySCPionPairs"))->Fill(fMbin+1, transK12, qinv12); | |
2084 | } | |
2085 | }else{ | |
2086 | ((TH3D*)fOutputList->FindObject("fAllMCPionPairs"))->Fill(fMbin+1, transK12, qinv12); | |
2087 | if(!mcParticle1->IsSecondaryFromWeakDecay() && !mcParticle2->IsSecondaryFromWeakDecay()) { | |
2088 | ((TH3D*)fOutputList->FindObject("fPrimaryMCPionPairs"))->Fill(fMbin+1, transK12, qinv12); | |
2089 | } | |
2090 | } | |
2091 | } | |
2092 | ||
6903e04b | 2093 | 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 |
2094 | 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 | 2095 | // pion purity |
2096 | Charge1[bin1].Charge2[bin2].SC[fillIndex2].MB[fMbin].EDB[fEDbin].TwoPT[en2].fPIDpurityDen->Fill(transK12, qinv12); | |
2097 | if(abs(mcParticle1->GetPdgCode())==211 && abs(mcParticle2->GetPdgCode())==211){// Pions | |
2098 | Charge1[bin1].Charge2[bin2].SC[fillIndex2].MB[fMbin].EDB[fEDbin].TwoPT[en2].fPIDpurityNum->Fill(transK12, qinv12); | |
2099 | } | |
2100 | ||
cd12341d | 2101 | }// label check 2 |
2102 | }// MC case | |
a05cda99 | 2103 | |
cd12341d | 2104 | ////////////////////////////////////////// |
2105 | // 2-particle term | |
2106 | Charge1[bin1].Charge2[bin2].SC[fillIndex2].MB[fMbin].EDB[fEDbin].TwoPT[en2].fExplicit2->Fill(transK12, qinv12); | |
5e3e77d6 | 2107 | Charge1[bin1].Charge2[bin2].SC[fillIndex2].MB[fMbin].EDB[fEDbin].TwoPT[en2].fExplicit2QW->Fill(transK12, qinv12, qinv12); |
704f2481 | 2108 | Charge1[bin1].Charge2[bin2].SC[fillIndex2].MB[fMbin].EDB[fEDbin].TwoPT[en2].fAvgP->Fill(transK12, qinv12, (fEvt)->fTracks[i].fMom); |
2109 | Charge1[bin1].Charge2[bin2].SC[fillIndex2].MB[fMbin].EDB[fEDbin].TwoPT[en2].fAvgP->Fill(transK12, qinv12, (fEvt+en2)->fTracks[j].fMom); | |
fa109294 | 2110 | |
cd12341d | 2111 | // osl frame |
fa109294 | 2112 | if(fillIndex2==0){ |
cd12341d | 2113 | if((transK12 > 0.2) && (transK12 < 0.3)){ |
2114 | Charge1[bin1].Charge2[bin2].SC[fillIndex2].MB[fMbin].EDB[fEDbin].TwoPT[en2].OSL_ktbin[0].fExplicit2OSL->Fill(fabs(qout), fabs(qside), fabs(qlong)); | |
2115 | Charge1[bin1].Charge2[bin2].SC[fillIndex2].MB[fMbin].EDB[fEDbin].TwoPT[en2].OSL_ktbin[0].fExplicit2OSLQW->Fill(fabs(qout), fabs(qside), fabs(qlong), qinv12); | |
2116 | } | |
2117 | if((transK12 > 0.6) && (transK12 < 0.7)){ | |
2118 | Charge1[bin1].Charge2[bin2].SC[fillIndex2].MB[fMbin].EDB[fEDbin].TwoPT[en2].OSL_ktbin[1].fExplicit2OSL->Fill(fabs(qout), fabs(qside), fabs(qlong)); | |
2119 | Charge1[bin1].Charge2[bin2].SC[fillIndex2].MB[fMbin].EDB[fEDbin].TwoPT[en2].OSL_ktbin[1].fExplicit2OSLQW->Fill(fabs(qout), fabs(qside), fabs(qlong), qinv12); | |
2120 | } | |
2121 | } | |
5e3e77d6 | 2122 | |
cd12341d | 2123 | ////////////////////////////////////////// |
2124 | if(fTabulatePairs){ | |
2125 | if(fillIndex2==0 && bin1==bin2){ | |
2126 | rapK12 = 0; | |
2127 | transKbin=-1; rapKbin=-1; | |
654866df | 2128 | |
2129 | for(Int_t kIt=0; kIt<fKbinsT; kIt++) {if(transK12 < (fKmiddleT[kIt] + fKstepT[kIt]/2.)) {transKbin = kIt; break;}} | |
2130 | for(Int_t kIt=0; kIt<fKbinsY; kIt++) {if(rapK12 < (fKmiddleY[kIt] + fKstepY[kIt]/2.)) {rapKbin = kIt; break;}} | |
cd12341d | 2131 | if((transKbin<0) || (rapKbin<0)) {cout<<"problem!!!!!!!!!!!!!!!!!!!!!!!!!!!!"<<endl; continue;} |
654866df | 2132 | if((transKbin>=fKbinsT) || (rapKbin>=fKbinsY)) {cout<<"problem!!!!!!!!!!!!!!!!!!!!!!!!!!!!"<<endl; continue;} |
2133 | Float_t WInput = 1.0; | |
2134 | if(fGenerateSignal) { | |
6903e04b | 2135 | WInput = MCWeight(ch1,ch2, fRMax, fFixedLambdaBinr3, qinv12, transK12); |
baba9c2d | 2136 | //WInput = MCWeight(ch1,ch2, fRMax, fFixedLambdaBinr3, qinv12MC); |
3ee47b58 | 2137 | //cout<<qinv12<<" "<<qinv12MC<<endl; |
2f00662e | 2138 | KT[transKbin].KY[rapKbin].MB[fMbin].EDB[fEDbin].TwoPT[en2].fExplicit2ThreeD->Fill(fabs(qout), fabs(qside), fabs(qlong), WInput); |
654866df | 2139 | }else KT[transKbin].KY[rapKbin].MB[fMbin].EDB[fEDbin].TwoPT[en2].fExplicit2ThreeD->Fill(fabs(qout), fabs(qside), fabs(qlong)); |
2140 | ||
cd12341d | 2141 | continue; |
2142 | } | |
2143 | } | |
2144 | ||
2145 | ||
2146 | // exit out of loop if there are too many pairs | |
654866df | 2147 | if(pairCountSE >= kPairLimit) {exitCode=kTRUE; continue;}// Too many SE pairs |
cd12341d | 2148 | if(exitCode) continue; |
5e3e77d6 | 2149 | |
cd12341d | 2150 | ////////////////////////// |
2151 | // Enforce the Qcut | |
2152 | if(qinv12 <= fQcut[qCutBin]) { | |
5e3e77d6 | 2153 | |
cd12341d | 2154 | /////////////////////////// |
2155 | // particle 1 | |
2156 | (fEvt)->fPairsSE[pairCountSE].fP1[0] = (fEvt)->fTracks[i].fP[0]; | |
2157 | (fEvt)->fPairsSE[pairCountSE].fP1[1] = (fEvt)->fTracks[i].fP[1]; | |
2158 | (fEvt)->fPairsSE[pairCountSE].fP1[2] = (fEvt)->fTracks[i].fP[2]; | |
2159 | (fEvt)->fPairsSE[pairCountSE].fE1 = (fEvt)->fTracks[i].fEaccepted; | |
2160 | (fEvt)->fPairsSE[pairCountSE].fCharge1 = (fEvt)->fTracks[i].fCharge; | |
2161 | (fEvt)->fPairsSE[pairCountSE].fIndex1 = i; | |
2162 | (fEvt)->fPairsSE[pairCountSE].fKey1 = key1; | |
2163 | (fEvt)->fPairsSE[pairCountSE].fLabel1 = (fEvt)->fTracks[i].fLabel; | |
2164 | if(fMCcase && ((fEvt)->fTracks[i].fLabel < (fEvt)->fMCarraySize)){ | |
2165 | (fEvt)->fPairsSE[pairCountSE].fP1MC[0] = (fEvt)->fMCtracks[abs((fEvt)->fTracks[i].fLabel)].fPx; | |
2166 | (fEvt)->fPairsSE[pairCountSE].fP1MC[1] = (fEvt)->fMCtracks[abs((fEvt)->fTracks[i].fLabel)].fPy; | |
2167 | (fEvt)->fPairsSE[pairCountSE].fP1MC[2] = (fEvt)->fMCtracks[abs((fEvt)->fTracks[i].fLabel)].fPz; | |
5e3e77d6 | 2168 | } |
cd12341d | 2169 | // particle 2 |
2170 | (fEvt)->fPairsSE[pairCountSE].fP2[0] = (fEvt+en2)->fTracks[j].fP[0]; | |
2171 | (fEvt)->fPairsSE[pairCountSE].fP2[1] = (fEvt+en2)->fTracks[j].fP[1]; | |
2172 | (fEvt)->fPairsSE[pairCountSE].fP2[2] = (fEvt+en2)->fTracks[j].fP[2]; | |
2173 | (fEvt)->fPairsSE[pairCountSE].fE2 = (fEvt+en2)->fTracks[j].fEaccepted; | |
2174 | (fEvt)->fPairsSE[pairCountSE].fCharge2 = (fEvt+en2)->fTracks[j].fCharge; | |
2175 | (fEvt)->fPairsSE[pairCountSE].fIndex2 = j; | |
2176 | (fEvt)->fPairsSE[pairCountSE].fKey2 = key2; | |
2177 | (fEvt)->fPairsSE[pairCountSE].fLabel2 = (fEvt+en2)->fTracks[j].fLabel; | |
2178 | if(fMCcase && ((fEvt+en2)->fTracks[j].fLabel < (fEvt+en2)->fMCarraySize)){ | |
2179 | (fEvt)->fPairsSE[pairCountSE].fP2MC[0] = (fEvt+en2)->fMCtracks[abs((fEvt+en2)->fTracks[j].fLabel)].fPx; | |
2180 | (fEvt)->fPairsSE[pairCountSE].fP2MC[1] = (fEvt+en2)->fMCtracks[abs((fEvt+en2)->fTracks[j].fLabel)].fPy; | |
2181 | (fEvt)->fPairsSE[pairCountSE].fP2MC[2] = (fEvt+en2)->fMCtracks[abs((fEvt+en2)->fTracks[j].fLabel)].fPz; | |
2182 | } | |
5e3e77d6 | 2183 | |
cd12341d | 2184 | (fEvt)->fPairsSE[pairCountSE].fQinv = qinv12; |
2185 | ||
2186 | fPairLocationSE[i]->AddAt(pairCountSE,j); | |
2187 | ||
2188 | pairCountSE++; | |
2189 | ||
2190 | } | |
2191 | ||
2192 | ||
2193 | ///////////////////////////////////////////////////////// | |
2194 | // Normalization Region | |
2195 | ||
2196 | if((qinv12 >= fNormQcutLow[normBin]) && (qinv12 < fNormQcutHigh[normBin])){ | |
2197 | // particle 1 | |
2198 | fNormPairs[en2][normPairCount[en2]].fCharge1 = (fEvt)->fTracks[i].fCharge; | |
2199 | fNormPairs[en2][normPairCount[en2]].fIndex1 = i; | |
2200 | fNormPairs[en2][normPairCount[en2]].fKey1 = (fEvt)->fTracks[i].fKey; | |
2201 | // particle 2 | |
2202 | fNormPairs[en2][normPairCount[en2]].fCharge2 = (fEvt+en2)->fTracks[j].fCharge; | |
2203 | fNormPairs[en2][normPairCount[en2]].fIndex2 = j; | |
2204 | fNormPairs[en2][normPairCount[en2]].fKey2 = (fEvt+en2)->fTracks[j].fKey; | |
2205 | ||
2206 | ||
2207 | //other past pairs with particle j | |
2208 | for(Int_t pastpair=0; pastpair<numOtherPairs2[0][j]; pastpair++){ | |
2209 | Int_t locationOtherPair = fOtherPairLocation2[0][j]->At(pastpair); | |
2210 | if(locationOtherPair < 0) continue;// no pair there | |
2211 | Int_t indexOther1 = i; | |
2212 | Int_t indexOther2 = fNormPairs[0][ locationOtherPair ].fIndex1; | |
2213 | ||
2214 | // Both possible orderings of other indexes | |
2215 | if( (fNormPairSwitch[0][indexOther1]->At(indexOther2)=='1') || (fNormPairSwitch[0][indexOther2]->At(indexOther1)=='1')) { | |
2216 | ||
2217 | // 1 and 2 are from SE | |
2218 | ch3 = Int_t((fNormPairs[0][ locationOtherPair ].fCharge1 + 1)/2.); | |
2219 | key3 = fNormPairs[0][ locationOtherPair ].fKey1; | |
2220 | Short_t fillIndex3 = FillIndex3part(key1+key2+key3); | |
2221 | SetFillBins3(fillIndex3, key1, key2, key3, ch1, ch2, ch3, 0, bin1, bin2, bin3, fDummyB, fDummyB, fDummyB); | |
2222 | ||
2223 | tempNormFillCount[bin1][bin2][bin3][fillIndex3][0]++; | |
2224 | } | |
2225 | ||
2226 | }// pastpair P11 loop | |
2227 | ||
2228 | ||
2229 | fNormPairSwitch[en2][i]->AddAt('1',j); | |
2230 | fOtherPairLocation1[en2][i]->AddAt(normPairCount[en2], numOtherPairs1[en2][i]);// location of otherpair with i as 1st particle | |
2231 | fOtherPairLocation2[en2][j]->AddAt(normPairCount[en2], numOtherPairs2[en2][j]);// location of otherpair with j as 2nd particle | |
2232 | ||
2233 | numOtherPairs1[en2][i]++; | |
2234 | numOtherPairs2[en2][j]++; | |
2235 | ||
2236 | ||
2237 | normPairCount[en2]++; | |
2238 | if(normPairCount[en2] >= kNormPairLimit) exitCode=kTRUE; | |
2239 | ||
2240 | }// Norm Region | |
2241 | ||
2242 | }// j particle | |
2243 | }// i particle | |
2244 | ||
20d52fd9 | 2245 | |
cd12341d | 2246 | |
2247 | ////////////////////////////////////////////// | |
2248 | // P12 pairing | |
2249 | // 1st Particle | |
2250 | for (Int_t i=0; i<myTracks; i++) { | |
2251 | ||
2252 | Int_t en2=1; | |
2253 | ||
2254 | // 2nd particle | |
2255 | for (Int_t j=0; j<(fEvt+en2)->fNtracks; j++) { | |
2256 | ||
2257 | key1 = (fEvt)->fTracks[i].fKey; | |
2258 | key2 = (fEvt+en2)->fTracks[j].fKey; | |
2259 | Short_t fillIndex2 = FillIndex2part(key1+key2); | |
2260 | Short_t qCutBin = SetQcutBin(fillIndex2); | |
2261 | Short_t normBin = SetNormBin(fillIndex2); | |
2262 | pVect1[0]=(fEvt)->fTracks[i].fEaccepted; pVect2[0]=(fEvt+en2)->fTracks[j].fEaccepted; | |
2263 | pVect1[1]=(fEvt)->fTracks[i].fP[0]; pVect2[1]=(fEvt+en2)->fTracks[j].fP[0]; | |
2264 | pVect1[2]=(fEvt)->fTracks[i].fP[1]; pVect2[2]=(fEvt+en2)->fTracks[j].fP[1]; | |
2265 | pVect1[3]=(fEvt)->fTracks[i].fP[2]; pVect2[3]=(fEvt+en2)->fTracks[j].fP[2]; | |
654866df | 2266 | |
cd12341d | 2267 | qinv12 = GetQinv(fillIndex2, pVect1, pVect2); |
2268 | GetQosl(pVect1, pVect2, qout, qside, qlong); | |
2269 | transK12 = sqrt(pow(pVect1[1]+pVect2[1],2) + pow(pVect1[2]+pVect2[2],2))/2.; | |
3eebc801 | 2270 | //if(transK12 <= 0.35) fEDbin=0; |
2271 | //else fEDbin=1; | |
2272 | ||
2f00662e | 2273 | |
cd12341d | 2274 | |
2275 | /////////////////////////////// | |
2276 | ch1 = Int_t(((fEvt)->fTracks[i].fCharge + 1)/2.); | |
2277 | ch2 = Int_t(((fEvt+en2)->fTracks[j].fCharge + 1)/2.); | |
2278 | SetFillBins2(fillIndex2, key1, key2, ch1, ch2, bin1, bin2); | |
2279 | ||
df2ce8e1 | 2280 | if(fMCcase){ |
2281 | if((fEvt)->fTracks[i].fLabel < (fEvt)->fMCarraySize && (fEvt+en2)->fTracks[j].fLabel < (fEvt+en2)->fMCarraySize){ | |
2282 | pVect1MC[0]=sqrt(pow((fEvt)->fMCtracks[abs((fEvt)->fTracks[i].fLabel)].fPtot,2)+pow(fTrueMassPi,2)); | |
2283 | pVect2MC[0]=sqrt(pow((fEvt+en2)->fMCtracks[abs((fEvt+en2)->fTracks[j].fLabel)].fPtot,2)+pow(fTrueMassPi,2)); | |
2284 | pVect1MC[1]=(fEvt)->fMCtracks[abs((fEvt)->fTracks[i].fLabel)].fPx; pVect2MC[1]=(fEvt+en2)->fMCtracks[abs((fEvt+en2)->fTracks[j].fLabel)].fPx; | |
2285 | pVect1MC[2]=(fEvt)->fMCtracks[abs((fEvt)->fTracks[i].fLabel)].fPy; pVect2MC[2]=(fEvt+en2)->fMCtracks[abs((fEvt+en2)->fTracks[j].fLabel)].fPy; | |
2286 | pVect1MC[3]=(fEvt)->fMCtracks[abs((fEvt)->fTracks[i].fLabel)].fPz; pVect2MC[3]=(fEvt+en2)->fMCtracks[abs((fEvt+en2)->fTracks[j].fLabel)].fPz; | |
2287 | qinv12MC = GetQinv(fillIndex2, pVect1MC, pVect2MC); | |
2288 | // | |
e29e02c1 | 2289 | |
df2ce8e1 | 2290 | for(Int_t rIter=0; rIter<fRVALUES; rIter++){ |
2291 | for(Int_t myDampIt=0; myDampIt<kNDampValues; myDampIt++){ | |
2292 | Int_t denIndex = rIter*kNDampValues + myDampIt; | |
6903e04b | 2293 | Float_t WInput = MCWeight(ch1,ch2, rIter+kRmin, myDampIt, qinv12MC, 0.); |
df2ce8e1 | 2294 | Charge1[bin1].Charge2[bin2].SC[fillIndex2].MB[fMbin].EDB[fEDbin].TwoPT[0].fIdeal->Fill(denIndex, qinv12MC, WInput); |
2295 | Charge1[bin1].Charge2[bin2].SC[fillIndex2].MB[fMbin].EDB[fEDbin].TwoPT[1].fIdeal->Fill(denIndex, qinv12MC); | |
2296 | Charge1[bin1].Charge2[bin2].SC[fillIndex2].MB[fMbin].EDB[fEDbin].TwoPT[0].fSmeared->Fill(denIndex, qinv12, WInput); | |
2297 | Charge1[bin1].Charge2[bin2].SC[fillIndex2].MB[fMbin].EDB[fEDbin].TwoPT[1].fSmeared->Fill(denIndex, qinv12); | |
2298 | } | |
2299 | } | |
e29e02c1 | 2300 | |
df2ce8e1 | 2301 | |
2302 | ///////////////////////////////////////////////////// | |
bd1011c2 | 2303 | if(!fTabulatePairs && qinv12 <= fQcut[qCutBin]) {// 3-particle MRC |
2304 | ||
f72089ee | 2305 | // 3-particle MRC |
2306 | Short_t fillIndex3 = 0; | |
2307 | key1=1; key2=1; key3=1; | |
2308 | Int_t en3 = 2; | |
2309 | ||
2310 | for (Int_t k=0; k<(fEvt+en3)->fNtracks; k++) { | |
2311 | if((fEvt+en3)->fTracks[k].fLabel < (fEvt+en3)->fMCarraySize){ | |
2312 | ch3 = Int_t(((fEvt+en3)->fTracks[k].fCharge + 1)/2.); | |
2313 | pVect3[0]=(fEvt+en3)->fTracks[k].fEaccepted; | |
2314 | pVect3[1]=(fEvt+en3)->fTracks[k].fP[0]; | |
2315 | pVect3[2]=(fEvt+en3)->fTracks[k].fP[1]; | |
2316 | pVect3[3]=(fEvt+en3)->fTracks[k].fP[2]; | |
2317 | qinv13 = GetQinv(0, pVect1, pVect3); | |
2318 | qinv23 = GetQinv(0, pVect2, pVect3); | |
2319 | ||
a05cda99 | 2320 | if(qinv13 > fQcut[qCutBin] || qinv23 > fQcut[qCutBin]) continue; |
df2ce8e1 | 2321 | |
a05cda99 | 2322 | |
2323 | pVect3MC[0]=sqrt(pow((fEvt+en3)->fMCtracks[abs((fEvt+en3)->fTracks[k].fLabel)].fPtot,2)+pow(fTrueMassPi,2)); | |
2324 | pVect3MC[1]=(fEvt+en3)->fMCtracks[abs((fEvt+en3)->fTracks[k].fLabel)].fPx; | |
2325 | pVect3MC[2]=(fEvt+en3)->fMCtracks[abs((fEvt+en3)->fTracks[k].fLabel)].fPy; | |
2326 | pVect3MC[3]=(fEvt+en3)->fMCtracks[abs((fEvt+en3)->fTracks[k].fLabel)].fPz; | |
2327 | qinv13MC = GetQinv(0, pVect1MC, pVect3MC); | |
2328 | qinv23MC = GetQinv(0, pVect2MC, pVect3MC); | |
2329 | ||
2330 | ||
2331 | q3MC = sqrt(pow(qinv12MC,2)+pow(qinv13MC,2)+pow(qinv23MC,2)); | |
e29e02c1 | 2332 | transK3 = sqrt( pow(pVect1[1]+pVect2[1]+pVect3[1],2) + pow(pVect1[2]+pVect2[2]+pVect3[2],2))/3.; |
a05cda99 | 2333 | |
e29e02c1 | 2334 | |
a05cda99 | 2335 | // |
2336 | // 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. | |
2337 | Bool_t fill2=kFALSE, fill3=kFALSE, fill4=kFALSE; | |
2338 | SetFillBins3(fillIndex3, key1, key2, key3, ch1, ch2, ch3, 1, bin1, bin2, bin3, fill2, fill3, fill4); | |
2339 | ||
2340 | ||
2341 | for(Int_t jj=1; jj<=5; jj++){// term loop | |
df2ce8e1 | 2342 | |
a05cda99 | 2343 | if(jj==2) {if(!fill2) continue;}//12 |
2344 | if(jj==3) {if(!fill3) continue;}//13 | |
2345 | if(jj==4) {if(!fill4) continue;}//23 | |
2346 | ||
2347 | Float_t WInput=1.0; | |
2348 | Double_t K3=1.0; | |
2349 | ArrangeQs(fillIndex3, key1, key2, key3, ch1, ch2, ch3, qinv12, qinv13, qinv23, 1, jj, firstQ, secondQ, thirdQ); | |
2350 | ArrangeQs(fillIndex3, key1, key2, key3, ch1, ch2, ch3, qinv12MC, qinv13MC, qinv23MC, 1, jj, firstQMC, secondQMC, thirdQMC); | |
2351 | ||
2352 | if(ch1==ch2 && ch1==ch3){// same charge | |
6903e04b | 2353 | WInput = MCWeight3D(kTRUE, jj, fFixedLambdaBinMomRes, firstQMC, secondQMC, thirdQMC, 0., 0., 0.); |
a05cda99 | 2354 | if(jj==1) { |
2355 | K3 = FSICorrelationTherm2(+1,+1, firstQMC)*FSICorrelationTherm2(+1,+1, secondQMC)*FSICorrelationTherm2(+1,+1, thirdQMC);// GRS | |
2356 | ((TH1D*)fOutputList->FindObject("fMCWeight3DTerm1SC"))->Fill(q3MC, WInput); | |
2357 | ((TH1D*)fOutputList->FindObject("fMCWeight3DTerm1SCden"))->Fill(q3MC); | |
2358 | }else if(jj!=5){ | |
2359 | ((TH1D*)fOutputList->FindObject("fMCWeight3DTerm2SC"))->Fill(q3MC, WInput); | |
2360 | ((TH1D*)fOutputList->FindObject("fMCWeight3DTerm2SCden"))->Fill(q3MC); | |
2361 | } | |
2362 | }else {// mixed charge | |
2363 | if(bin1==bin2) { | |
6903e04b | 2364 | WInput = MCWeight3D(kFALSE, jj, fFixedLambdaBinMomRes, firstQMC, secondQMC, thirdQMC, 0., 0., 0.); |
a05cda99 | 2365 | if(jj==1) K3 = FSICorrelationTherm2(+1,+1, firstQMC)*FSICorrelationTherm2(+1,-1, secondQMC)*FSICorrelationTherm2(+1,-1, thirdQMC);// GRS |
2366 | }else { | |
6903e04b | 2367 | if(jj==1 || jj==5) WInput = MCWeight3D(kFALSE, jj, fFixedLambdaBinMomRes, thirdQMC, secondQMC, firstQMC, 0., 0., 0.);// thirdQMC is ss |
2368 | else WInput = MCWeight3D(kFALSE, 6-jj, fFixedLambdaBinMomRes, thirdQMC, secondQMC, firstQMC, 0., 0., 0.); | |
a05cda99 | 2369 | |
2370 | if(jj==1) K3 = FSICorrelationTherm2(+1,+1, thirdQMC)*FSICorrelationTherm2(+1,-1, secondQMC)*FSICorrelationTherm2(+1,-1, firstQMC);// GRS | |
2371 | } | |
2372 | if(jj==1){ | |
2373 | ((TH1D*)fOutputList->FindObject("fMCWeight3DTerm1MC"))->Fill(q3MC, WInput); | |
2374 | ((TH1D*)fOutputList->FindObject("fMCWeight3DTerm1MCden"))->Fill(q3MC); | |
df2ce8e1 | 2375 | }else{ |
a05cda99 | 2376 | if(bin1==bin2){ |
2377 | if(jj==2){ | |
2378 | ((TH1D*)fOutputList->FindObject("fMCWeight3DTerm2MC"))->Fill(q3MC, WInput); | |
2379 | ((TH1D*)fOutputList->FindObject("fMCWeight3DTerm2MCden"))->Fill(q3MC); | |
2380 | }else if(jj==3){ | |
2381 | ((TH1D*)fOutputList->FindObject("fMCWeight3DTerm3MC"))->Fill(q3MC, WInput); | |
2382 | ((TH1D*)fOutputList->FindObject("fMCWeight3DTerm3MCden"))->Fill(q3MC); | |
2383 | }else if(jj==4){ | |
2384 | ((TH1D*)fOutputList->FindObject("fMCWeight3DTerm4MC"))->Fill(q3MC, WInput); | |
2385 | ((TH1D*)fOutputList->FindObject("fMCWeight3DTerm4MCden"))->Fill(q3MC); | |
2386 | }else{} | |
2387 | }else{ | |
2388 | if(jj==2){ | |
2389 | ((TH1D*)fOutputList->FindObject("fMCWeight3DTerm4MC"))->Fill(q3MC, WInput); | |
2390 | ((TH1D*)fOutputList->FindObject("fMCWeight3DTerm4MCden"))->Fill(q3MC); | |
2391 | }else if(jj==3){ | |
2392 | ((TH1D*)fOutputList->FindObject("fMCWeight3DTerm3MC"))->Fill(q3MC, WInput); | |
2393 | ((TH1D*)fOutputList->FindObject("fMCWeight3DTerm3MCden"))->Fill(q3MC); | |
2394 | }else if(jj==4){ | |
2395 | ((TH1D*)fOutputList->FindObject("fMCWeight3DTerm2MC"))->Fill(q3MC, WInput); | |
2396 | ((TH1D*)fOutputList->FindObject("fMCWeight3DTerm2MCden"))->Fill(q3MC); | |
2397 | }else{} | |
2398 | } | |
2399 | ||
df2ce8e1 | 2400 | } |
df2ce8e1 | 2401 | } |
6903e04b | 2402 | |
a05cda99 | 2403 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[jj-1].fIdeal->Fill(firstQMC, secondQMC, thirdQMC, WInput); |
2404 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[jj-1].fSmeared->Fill(firstQ, secondQ, thirdQ, WInput); | |
2405 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[jj-1].fQW12->Fill(firstQMC, secondQMC, thirdQMC, WInput*firstQMC); | |
2406 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[jj-1].fQW13->Fill(firstQMC, secondQMC, thirdQMC, WInput*secondQMC); | |
df2ce8e1 | 2407 | if(jj==1){ |
a05cda99 | 2408 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[jj-1].fSumK3->Fill(firstQMC, secondQMC, thirdQMC, WInput/K3); |
2409 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[jj-1].fEnK3->Fill(firstQMC, secondQMC, thirdQMC, WInput); | |
df2ce8e1 | 2410 | } |
a05cda99 | 2411 | |
20d52fd9 | 2412 | /*if(ch1==ch2 && ch1==ch3){ |
df2ce8e1 | 2413 | if(jj==1){ |
a05cda99 | 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==2) { | |
2417 | FourVectProdTerms(pVect1, pVect2, pVect3, Qsum1v1, Qsum2, Qsum3v1, Qsum1v2, Qsum3v2);// 4-vector product sums | |
2418 | FourVectProdTerms(pVect1MC, pVect2MC, pVect3MC, Qsum1v1MC, Qsum2MC, Qsum3v1MC, Qsum1v2MC, Qsum3v2MC);// 4-vector product sums | |
2419 | }else if(jj==3){ | |
2420 | FourVectProdTerms(pVect1, pVect3, pVect2, Qsum1v1, Qsum2, Qsum3v1, Qsum1v2, Qsum3v2);// 4-vector product sums | |
2421 | FourVectProdTerms(pVect1MC, pVect3MC, pVect2MC, Qsum1v1MC, Qsum2MC, Qsum3v1MC, Qsum1v2MC, Qsum3v2MC);// 4-vector product sums | |
2422 | }else if(jj==4) { | |
2423 | FourVectProdTerms(pVect3, pVect1, pVect2, Qsum1v1, Qsum2, Qsum3v1, Qsum1v2, Qsum3v2);// 4-vector product sums | |
2424 | FourVectProdTerms(pVect3MC, pVect1MC, pVect2MC, Qsum1v1MC, Qsum2MC, Qsum3v1MC, Qsum1v2MC, Qsum3v2MC);// 4-vector product sums | |
2425 | }else { | |
2426 | FourVectProdTerms(pVect1, pVect2, pVect3, Qsum1v1, Qsum2, Qsum3v1, Qsum1v2, Qsum3v2);// 4-vector product sums | |
2427 | FourVectProdTerms(pVect1MC, pVect2MC, pVect3MC, Qsum1v1MC, Qsum2MC, Qsum3v1MC, Qsum1v2MC, Qsum3v2MC);// 4-vector product sums | |
df2ce8e1 | 2428 | } |
a05cda99 | 2429 | |
2430 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[jj-1].f4VectProd1TermsIdeal->Fill(Qsum1v1MC, Qsum2MC, Qsum3v1MC, WInput); | |
2431 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[jj-1].f4VectProd1TermsSmeared->Fill(Qsum1v1, Qsum2, Qsum3v1, WInput); | |
2432 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[jj-1].f4VectProd2TermsIdeal->Fill(Qsum1v2MC, Qsum2MC, Qsum3v2MC, WInput); | |
2433 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[jj-1].f4VectProd2TermsSmeared->Fill(Qsum1v2, Qsum2, Qsum3v2, WInput); | |
2434 | if(jj==1){ | |
2435 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[jj-1].f4VectProd1Q3W->Fill(Qsum1v1MC, Qsum2MC, Qsum3v1MC, WInput*q3); | |
2436 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[jj-1].f4VectProd2Q3W->Fill(Qsum1v2MC, Qsum2MC, Qsum3v2MC, WInput*q3); | |
2437 | } | |
2438 | // | |
2439 | if(qinv12MC > fQLowerCut && qinv13MC > fQLowerCut && qinv23MC > fQLowerCut){ | |
2440 | // does not really matter if MC or real data triplets are used to average 1/K3...but better to use umsmeared values | |
2441 | if(jj==1){ | |
2442 | WInput = MCWeight3D(kTRUE, 1, 25, firstQMC, secondQMC, thirdQMC);// pure 3-pion (lambda=1) | |
2443 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[jj-1].f4VectProd1TermsSumK3->Fill(Qsum1v1MC, Qsum2MC, Qsum3v1MC, WInput/K3); | |
2444 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[jj-1].f4VectProd2TermsSumK3->Fill(Qsum1v2MC, Qsum2MC, Qsum3v2MC, WInput/K3); | |
2445 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[jj-1].f4VectProd1TermsEnK3->Fill(Qsum1v1MC, Qsum2MC, Qsum3v1MC, WInput); | |
2446 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[jj-1].f4VectProd2TermsEnK3->Fill(Qsum1v2MC, Qsum2MC, Qsum3v2MC, WInput); | |
2447 | }if(jj>1 && jj<=4){ | |
2448 | Float_t InteractingQ=qinv12MC; | |
2449 | Double_t K2 = FSICorrelationTherm2(+1,+1, InteractingQ);// K2 from Therminator source | |
2450 | WInput = MCWeight3D(kTRUE, jj, 25, firstQMC, secondQMC, thirdQMC);// pure 2-pion (lambda=1) | |
2451 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[jj-1].f4VectProd1TermsSumK2->Fill(Qsum1v1MC, Qsum2MC, Qsum3v1MC, WInput/K2); | |
2452 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[jj-1].f4VectProd2TermsSumK2->Fill(Qsum1v2MC, Qsum2MC, Qsum3v2MC, WInput/K2); | |
2453 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[jj-1].f4VectProd1TermsEnK2->Fill(Qsum1v1MC, Qsum2MC, Qsum3v1MC, WInput); | |
2454 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[jj-1].f4VectProd2TermsEnK2->Fill(Qsum1v2MC, Qsum2MC, Qsum3v2MC, WInput); | |
2455 | } | |
2456 | } | |
2457 | ||
2458 | }// same charges | |
20d52fd9 | 2459 | */ |
a05cda99 | 2460 | }// jj |
2461 | }// MCarray check, 3rd particle | |
f72089ee | 2462 | }// 3rd particle |
a05cda99 | 2463 | |
f72089ee | 2464 | }// TabulatePairs Check |
a05cda99 | 2465 | |
2466 | }// MCarray check, 1st and 2nd particle | |
f72089ee | 2467 | |
a05cda99 | 2468 | // reset key's and fill bins (they were altered for 3 particle MRC calculation) |
2469 | key1 = (fEvt)->fTracks[i].fKey; | |
2470 | key2 = (fEvt+en2)->fTracks[j].fKey; | |
2471 | SetFillBins2(fillIndex2, key1, key2, ch1, ch2, bin1, bin2); | |
2472 | ||
e29e02c1 | 2473 | |
2474 | if(ch1==ch2 && fMbin==0 && qinv12<0.2){ | |
2475 | ////////////////////////// | |
2476 | // pad-row method testing | |
2477 | Float_t coeff = (5)*0.2*(0.18/1.2);// 5 to evaluate at 1.0m in TPC | |
2478 | Float_t phi1 = (fEvt)->fTracks[i].fPhi - asin((fEvt)->fTracks[i].fCharge*(0.1*fBfield)*coeff/(fEvt)->fTracks[i].fPt); | |
2479 | if(phi1 > 2*PI) phi1 -= 2*PI; | |
2480 | if(phi1 < 0) phi1 += 2*PI; | |
2481 | Float_t phi2 = (fEvt+en2)->fTracks[j].fPhi - asin((fEvt+en2)->fTracks[j].fCharge*(0.1*fBfield)*coeff/(fEvt+en2)->fTracks[j].fPt); | |
2482 | if(phi2 > 2*PI) phi2 -= 2*PI; | |
2483 | if(phi2 < 0) phi2 += 2*PI; | |
2484 | Float_t deltaphi = phi1 - phi2; | |
2485 | if(deltaphi > PI) deltaphi -= PI; | |
2486 | if(deltaphi < -PI) deltaphi += PI; | |
2487 | ||
2488 | Int_t ncl1 = (fEvt)->fTracks[i].fClusterMap.GetNbits(); | |
2489 | Int_t ncl2 = (fEvt+en2)->fTracks[j].fClusterMap.GetNbits(); | |
2490 | Float_t sumCls = 0; Float_t sumSha = 0; Float_t sumQ = 0; | |
2491 | Double_t shfrac = 0; //Double_t qfactor = 0; | |
2492 | for(Int_t imap = 0; imap < ncl1 && imap < ncl2; imap++) { | |
2493 | if ((fEvt)->fTracks[i].fClusterMap.TestBitNumber(imap) && (fEvt+en2)->fTracks[j].fClusterMap.TestBitNumber(imap)) {// Both clusters | |
2494 | if ((fEvt)->fTracks[i].fSharedMap.TestBitNumber(imap) && (fEvt+en2)->fTracks[j].fSharedMap.TestBitNumber(imap)) { // Shared | |
2495 | sumQ++; | |
2496 | sumCls+=2; | |
2497 | sumSha+=2;} | |
2498 | else {sumQ--; sumCls+=2;} | |
2499 | } | |
2500 | else if ((fEvt)->fTracks[i].fClusterMap.TestBitNumber(imap) || (fEvt+en2)->fTracks[j].fClusterMap.TestBitNumber(imap)) {// Non shared | |
2501 | sumQ++; | |
2502 | sumCls++;} | |
2503 | } | |
2504 | if (sumCls>0) { | |
2505 | //qfactor = sumQ*1.0/sumCls; | |
2506 | shfrac = sumSha*1.0/sumCls; | |
2507 | } | |
2508 | if(fabs(deltaphi)<0.07 && fabs((fEvt)->fTracks[i].fEta-(fEvt+en2)->fTracks[j].fEta) < 0.03){ | |
2509 | ((TH3D*)fOutputList->FindObject("fPairsPadRowDen"))->Fill(transK12, shfrac, qinv12); | |
2510 | } | |
2511 | ||
df2ce8e1 | 2512 | for(Int_t rstep=0; rstep<10; rstep++){ |
e29e02c1 | 2513 | coeff = (rstep)*0.2*(0.18/1.2); |
df2ce8e1 | 2514 | // propagate through B field to r=1.2m |
e29e02c1 | 2515 | phi1 = (fEvt)->fTracks[i].fPhi - asin((fEvt)->fTracks[i].fCharge*(0.1*fBfield)*coeff/(fEvt)->fTracks[i].fPt); |
df2ce8e1 | 2516 | if(phi1 > 2*PI) phi1 -= 2*PI; |
2517 | if(phi1 < 0) phi1 += 2*PI; | |
e29e02c1 | 2518 | phi2 = (fEvt+en2)->fTracks[j].fPhi - asin((fEvt+en2)->fTracks[j].fCharge*(0.1*fBfield)*coeff/(fEvt+en2)->fTracks[j].fPt); |
df2ce8e1 | 2519 | if(phi2 > 2*PI) phi2 -= 2*PI; |
2520 | if(phi2 < 0) phi2 += 2*PI; | |
e29e02c1 | 2521 | deltaphi = phi1 - phi2; |
df2ce8e1 | 2522 | if(deltaphi > PI) deltaphi -= PI; |
2523 | if(deltaphi < -PI) deltaphi += PI; | |
e29e02c1 | 2524 | |
2525 | if(fabs((fEvt)->fTracks[i].fEta-(fEvt+en2)->fTracks[j].fEta) < 0.03){ | |
2526 | ((TH3F*)fOutputList->FindObject("fPairsShareFracDPhiDen"))->Fill(rstep, shfrac, deltaphi); | |
2527 | } | |
2528 | //if(shfrac < 0.05){ | |
df2ce8e1 | 2529 | ((TH3F*)fOutputList->FindObject("fPairsDetaDPhiDen"))->Fill(rstep, (fEvt)->fTracks[i].fEta-(fEvt+en2)->fTracks[j].fEta, deltaphi); |
e29e02c1 | 2530 | //} |
df2ce8e1 | 2531 | } |
e29e02c1 | 2532 | |
2533 | ||
2534 | ||
2535 | ||
2536 | }// desired pair selection | |
df2ce8e1 | 2537 | |
e29e02c1 | 2538 | |
2539 | ||
df2ce8e1 | 2540 | }// fMCcase |
2541 | ||
e29e02c1 | 2542 | |
2543 | ||
df2ce8e1 | 2544 | if(qinv12 < fQLowerCut) continue;// remove unwanted low-q pairs (also a type of track splitting cut) |
3ee47b58 | 2545 | if(ch1 == ch2 && !fGeneratorOnly){ |
cd12341d | 2546 | if(!AcceptPair((fEvt)->fTracks[i], (fEvt+en2)->fTracks[j])) { |
2547 | fPairSplitCut[1][i]->AddAt('1',j); | |
2548 | continue; | |
2549 | } | |
2550 | } | |
2551 | ||
2552 | ////////////////////////////////////////// | |
2553 | // 2-particle term | |
2554 | Charge1[bin1].Charge2[bin2].SC[fillIndex2].MB[fMbin].EDB[fEDbin].TwoPT[en2].fExplicit2->Fill(transK12, qinv12); | |
5e3e77d6 | 2555 | Charge1[bin1].Charge2[bin2].SC[fillIndex2].MB[fMbin].EDB[fEDbin].TwoPT[en2].fExplicit2QW->Fill(transK12, qinv12, qinv12); |
2556 | ||
cd12341d | 2557 | // osl frame |
fa109294 | 2558 | if(fillIndex2==0){ |
2559 | if((transK12 > 0.2) && (transK12 < 0.3)){ | |
cd12341d | 2560 | Charge1[bin1].Charge2[bin2].SC[fillIndex2].MB[fMbin].EDB[fEDbin].TwoPT[en2].OSL_ktbin[0].fExplicit2OSL->Fill(fabs(qout), fabs(qside), fabs(qlong)); |
2561 | Charge1[bin1].Charge2[bin2].SC[fillIndex2].MB[fMbin].EDB[fEDbin].TwoPT[en2].OSL_ktbin[0].fExplicit2OSLQW->Fill(fabs(qout), fabs(qside), fabs(qlong), qinv12); | |
2562 | } | |
2563 | if((transK12 > 0.6) && (transK12 < 0.7)){ | |
2564 | Charge1[bin1].Charge2[bin2].SC[fillIndex2].MB[fMbin].EDB[fEDbin].TwoPT[en2].OSL_ktbin[1].fExplicit2OSL->Fill(fabs(qout), fabs(qside), fabs(qlong)); | |
2565 | Charge1[bin1].Charge2[bin2].SC[fillIndex2].MB[fMbin].EDB[fEDbin].TwoPT[en2].OSL_ktbin[1].fExplicit2OSLQW->Fill(fabs(qout), fabs(qside), fabs(qlong), qinv12); | |
2566 | } | |
2567 | } | |
2568 | ////////////////////////////////////////// | |
2569 | if(fTabulatePairs){ | |
2570 | if(fillIndex2==0 && bin1==bin2){ | |
2571 | rapK12 = 0; | |
2572 | transKbin=-1; rapKbin=-1; | |
654866df | 2573 | |
2574 | for(Int_t kIt=0; kIt<fKbinsT; kIt++) {if(transK12 < (fKmiddleT[kIt] + fKstepT[kIt]/2.)) {transKbin = kIt; break;}} | |
2575 | for(Int_t kIt=0; kIt<fKbinsY; kIt++) {if(rapK12 < (fKmiddleY[kIt] + fKstepY[kIt]/2.)) {rapKbin = kIt; break;}} | |
cd12341d | 2576 | if((transKbin<0) || (rapKbin<0)) {cout<<"problem!!!!!!!!!!!!!!!!!!!!!!!!!!!!"<<endl; continue;} |
654866df | 2577 | if((transKbin>=fKbinsT) || (rapKbin>=fKbinsY)) {cout<<"problem!!!!!!!!!!!!!!!!!!!!!!!!!!!!"<<endl; continue;} |
2578 | ||
2f00662e | 2579 | if(fGenerateSignal) KT[transKbin].KY[rapKbin].MB[fMbin].EDB[fEDbin].TwoPT[en2].fExplicit2ThreeD->Fill(fabs(qout), fabs(qside), fabs(qlong)); |
654866df | 2580 | else KT[transKbin].KY[rapKbin].MB[fMbin].EDB[fEDbin].TwoPT[en2].fExplicit2ThreeD->Fill(fabs(qout), fabs(qside), fabs(qlong)); |
2581 | ||
cd12341d | 2582 | continue; |
2583 | } | |
2584 | } | |
2585 | ||
2586 | ||
654866df | 2587 | if(pairCountME >= 2*kPairLimit) {exitCode=kTRUE; continue;}// Too many SE pairs |
cd12341d | 2588 | if(exitCode) continue; |
2589 | ||
2590 | if(qinv12 <= fQcut[qCutBin]) { | |
2591 | /////////////////////////// | |
2592 | ||
2593 | // particle 1 | |
2594 | (fEvt)->fPairsME[pairCountME].fP1[0] = (fEvt)->fTracks[i].fP[0]; | |
2595 | (fEvt)->fPairsME[pairCountME].fP1[1] = (fEvt)->fTracks[i].fP[1]; | |
2596 | (fEvt)->fPairsME[pairCountME].fP1[2] = (fEvt)->fTracks[i].fP[2]; | |
2597 | (fEvt)->fPairsME[pairCountME].fE1 = (fEvt)->fTracks[i].fEaccepted; | |
2598 | (fEvt)->fPairsME[pairCountME].fCharge1 = (fEvt)->fTracks[i].fCharge; | |
2599 | (fEvt)->fPairsME[pairCountME].fIndex1 = i; | |
2600 | (fEvt)->fPairsME[pairCountME].fKey1 = key1; | |
2601 | (fEvt)->fPairsME[pairCountME].fLabel1 = (fEvt)->fTracks[i].fLabel; | |
2602 | if(fMCcase && ((fEvt)->fTracks[i].fLabel < (fEvt)->fMCarraySize)){ | |
2603 | (fEvt)->fPairsME[pairCountME].fP1MC[0] = (fEvt)->fMCtracks[abs((fEvt)->fTracks[i].fLabel)].fPx; | |
2604 | (fEvt)->fPairsME[pairCountME].fP1MC[1] = (fEvt)->fMCtracks[abs((fEvt)->fTracks[i].fLabel)].fPy; | |
2605 | (fEvt)->fPairsME[pairCountME].fP1MC[2] = (fEvt)->fMCtracks[abs((fEvt)->fTracks[i].fLabel)].fPz; | |
2606 | } | |
2607 | // particle 2 | |
2608 | (fEvt)->fPairsME[pairCountME].fP2[0] = (fEvt+en2)->fTracks[j].fP[0]; | |
2609 | (fEvt)->fPairsME[pairCountME].fP2[1] = (fEvt+en2)->fTracks[j].fP[1]; | |
2610 | (fEvt)->fPairsME[pairCountME].fP2[2] = (fEvt+en2)->fTracks[j].fP[2]; | |
2611 | (fEvt)->fPairsME[pairCountME].fE2 = (fEvt+en2)->fTracks[j].fEaccepted; | |
2612 | (fEvt)->fPairsME[pairCountME].fCharge2 = (fEvt+en2)->fTracks[j].fCharge; | |
2613 | (fEvt)->fPairsME[pairCountME].fIndex2 = j; | |
2614 | (fEvt)->fPairsME[pairCountME].fKey2 = key2; | |
2615 | (fEvt)->fPairsME[pairCountME].fLabel2 = (fEvt+en2)->fTracks[j].fLabel; | |
2616 | if(fMCcase && ((fEvt+en2)->fTracks[j].fLabel < (fEvt+en2)->fMCarraySize)){ | |
2617 | (fEvt)->fPairsME[pairCountME].fP2MC[0] = (fEvt+en2)->fMCtracks[abs((fEvt+en2)->fTracks[j].fLabel)].fPx; | |
2618 | (fEvt)->fPairsME[pairCountME].fP2MC[1] = (fEvt+en2)->fMCtracks[abs((fEvt+en2)->fTracks[j].fLabel)].fPy; | |
2619 | (fEvt)->fPairsME[pairCountME].fP2MC[2] = (fEvt+en2)->fMCtracks[abs((fEvt+en2)->fTracks[j].fLabel)].fPz; | |
2620 | } | |
2621 | ||
2622 | (fEvt)->fPairsME[pairCountME].fQinv = qinv12; | |
2623 | ||
2624 | fPairLocationME[i]->AddAt(Int_t(pairCountME),j); | |
2625 | ||
2626 | pairCountME++; | |
2627 | ||
2628 | } | |
2629 | ||
2630 | if((qinv12 >= fNormQcutLow[normBin]) && (qinv12 < fNormQcutHigh[normBin])){ | |
2631 | // particle 1 | |
2632 | fNormPairs[en2][normPairCount[en2]].fCharge1 = (fEvt)->fTracks[i].fCharge; | |
2633 | fNormPairs[en2][normPairCount[en2]].fIndex1 = i; | |
2634 | fNormPairs[en2][normPairCount[en2]].fKey1 = (fEvt)->fTracks[i].fKey; | |
2635 | // particle 2 | |
2636 | fNormPairs[en2][normPairCount[en2]].fCharge2 = (fEvt+en2)->fTracks[j].fCharge; | |
2637 | fNormPairs[en2][normPairCount[en2]].fIndex2 = j; | |
2638 | fNormPairs[en2][normPairCount[en2]].fKey2 = (fEvt+en2)->fTracks[j].fKey; | |
2639 | ||
2640 | //other past pairs in P11 with particle i | |
2641 | for(Int_t pastpairP11=0; pastpairP11<numOtherPairs2[0][i]; pastpairP11++){// past pair in P11 with i as 1st and 2nd particle | |
2642 | Int_t locationOtherPairP11 = fOtherPairLocation2[0][i]->At(pastpairP11);// i is 2nd particle | |
2643 | if(locationOtherPairP11 < 0) continue;// no pair there | |
2644 | Int_t indexOther1P11 = fNormPairs[0][ locationOtherPairP11 ].fIndex1; | |
2645 | ||
2646 | //Check other past pairs in P12 | |
2647 | if( (fNormPairSwitch[1][indexOther1P11]->At(j)=='0')) continue; | |
2648 | ||
2649 | // 1 and 3 are from SE | |
2650 | ch3 = Int_t((fNormPairs[0][ locationOtherPairP11 ].fCharge1 + 1)/2.);// charge of second particle in P11 | |
2651 | key3 = fNormPairs[0][ locationOtherPairP11 ].fKey1; | |
2652 | Short_t fillIndex3 = FillIndex3part(key1+key2+key3); | |
2653 | Bool_t fill2=kFALSE, fill3=kFALSE, fill4=kFALSE; | |
2654 | SetFillBins3(fillIndex3, key1, key2, key3, ch1, ch2, ch3, 2, bin1, bin2, bin3, fill2, fill3, fill4); | |
2655 | ||
2656 | ||
2657 | if(fill2) tempNormFillCount[bin1][bin2][bin3][fillIndex3][1]++; | |
2658 | if(fill3) tempNormFillCount[bin1][bin2][bin3][fillIndex3][2]++; | |
2659 | if(fill4) tempNormFillCount[bin1][bin2][bin3][fillIndex3][3]++; | |
2660 | ||
2661 | ||
2662 | }// P11 loop | |
2663 | ||
2664 | ||
2665 | fNormPairSwitch[en2][i]->AddAt('1',j); | |
2666 | fOtherPairLocation1[en2][i]->AddAt(normPairCount[en2], numOtherPairs1[en2][i]);// location of otherpair with i as 1st particle | |
2667 | fOtherPairLocation2[en2][j]->AddAt(normPairCount[en2], numOtherPairs2[en2][j]);// location of otherpair with j as 2nd particle | |
2668 | ||
2669 | numOtherPairs1[en2][i]++; | |
2670 | numOtherPairs2[en2][j]++; | |
2671 | ||
2672 | normPairCount[en2]++; | |
2673 | if(normPairCount[en2] >= kNormPairLimit) exitCode=kTRUE; | |
2674 | ||
2675 | }// Norm Region | |
2676 | ||
2677 | ||
2678 | } | |
2679 | } | |
20d52fd9 | 2680 | |
cd12341d | 2681 | |
2682 | /////////////////////////////////////// | |
2683 | // P13 pairing (just for Norm counting of term5) | |
2684 | for (Int_t i=0; i<myTracks; i++) { | |
2685 | ||
2686 | // exit out of loop if there are too many pairs | |
2687 | // dont bother with this loop if exitCode is set. | |
2688 | if(exitCode) break; | |
2689 | ||
2690 | // 2nd particle | |
2691 | Int_t en2=2; | |
2692 | ||
2693 | for (Int_t j=0; j<(fEvt+en2)->fNtracks; j++) { | |
2694 | ||
2695 | key1 = (fEvt)->fTracks[i].fKey; | |
2696 | key2 = (fEvt+en2)->fTracks[j].fKey; | |
2697 | Short_t fillIndex2 = FillIndex2part(key1+key2); | |
2698 | Short_t normBin = SetNormBin(fillIndex2); | |
2699 | pVect1[0]=(fEvt)->fTracks[i].fEaccepted; pVect2[0]=(fEvt+en2)->fTracks[j].fEaccepted; | |
2700 | pVect1[1]=(fEvt)->fTracks[i].fP[0]; pVect2[1]=(fEvt+en2)->fTracks[j].fP[0]; | |
2701 | pVect1[2]=(fEvt)->fTracks[i].fP[1]; pVect2[2]=(fEvt+en2)->fTracks[j].fP[1]; | |
2702 | pVect1[3]=(fEvt)->fTracks[i].fP[2]; pVect2[3]=(fEvt+en2)->fTracks[j].fP[2]; | |
2703 | ||
2704 | qinv12 = GetQinv(fillIndex2, pVect1, pVect2); | |
2705 | ||
2706 | if(qinv12 < fQLowerCut) continue;// remove unwanted low-q pairs (also a type of track splitting cut) | |
2707 | ||
2708 | ch1 = Int_t(((fEvt)->fTracks[i].fCharge + 1)/2.); | |
2709 | ch2 = Int_t(((fEvt+en2)->fTracks[j].fCharge + 1)/2.); | |
2710 | ||
3ee47b58 | 2711 | if(ch1 == ch2 && !fGeneratorOnly){ |
cd12341d | 2712 | if(!AcceptPair((fEvt)->fTracks[i], (fEvt+en2)->fTracks[j])) { |
2713 | fPairSplitCut[2][i]->AddAt('1',j); | |
2714 | continue; | |
2715 | } | |
2716 | } | |
2717 | ||
2718 | ///////////////////////////////////////////////////////// | |
2719 | // Normalization Region | |
2720 | ||
2721 | if((qinv12 >= fNormQcutLow[normBin]) && (qinv12 < fNormQcutHigh[normBin])){ | |
2722 | ||
2723 | fNormPairSwitch[en2][i]->AddAt('1',j); | |
2724 | ||
2725 | }// Norm Region | |
2726 | } | |
2727 | } | |
2728 | ||
2729 | ||
20d52fd9 | 2730 | |
cd12341d | 2731 | /////////////////////////////////////// |
2732 | // P23 pairing (just for Norm counting of term5) | |
2733 | Int_t en1=1; | |
2734 | for (Int_t i=0; i<(fEvt+en1)->fNtracks; i++) { | |
2735 | ||
2736 | // exit out of loop if there are too many pairs | |
2737 | // dont bother with this loop if exitCode is set. | |
2738 | if(exitCode) break; | |
2739 | ||
2740 | // 2nd event | |
2741 | Int_t en2=2; | |
2742 | // 2nd particle | |
2743 | for (Int_t j=0; j<(fEvt+en2)->fNtracks; j++) { | |
2744 | ||
2745 | if(exitCode) break; | |
2746 | ||
2747 | key1 = (fEvt+en1)->fTracks[i].fKey; | |
2748 | key2 = (fEvt+en2)->fTracks[j].fKey; | |
2749 | Short_t fillIndex2 = FillIndex2part(key1+key2); | |
2750 | Short_t normBin = SetNormBin(fillIndex2); | |
2751 | pVect1[0]=(fEvt+en1)->fTracks[i].fEaccepted; pVect2[0]=(fEvt+en2)->fTracks[j].fEaccepted; | |
2752 | pVect1[1]=(fEvt+en1)->fTracks[i].fP[0]; pVect2[1]=(fEvt+en2)->fTracks[j].fP[0]; | |
2753 | pVect1[2]=(fEvt+en1)->fTracks[i].fP[1]; pVect2[2]=(fEvt+en2)->fTracks[j].fP[1]; | |
2754 | pVect1[3]=(fEvt+en1)->fTracks[i].fP[2]; pVect2[3]=(fEvt+en2)->fTracks[j].fP[2]; | |
2755 | ||
2756 | qinv12 = GetQinv(fillIndex2, pVect1, pVect2); | |
2757 | ||
2758 | if(qinv12 < fQLowerCut) continue;// remove unwanted low-q pairs (also a type of track splitting cut) | |
2759 | ||
2760 | /////////////////////////////// | |
2761 | ch1 = Int_t(((fEvt+en1)->fTracks[i].fCharge + 1)/2.); | |
2762 | ch2 = Int_t(((fEvt+en2)->fTracks[j].fCharge + 1)/2.); | |
2763 | ||
3ee47b58 | 2764 | if(ch1 == ch2 && !fGeneratorOnly){ |
cd12341d | 2765 | if(!AcceptPair((fEvt+en1)->fTracks[i], (fEvt+en2)->fTracks[j])) { |
2766 | fPairSplitCut[3][i]->AddAt('1',j); | |
2767 | continue; | |
2768 | } | |
2769 | } | |
2770 | ||
2771 | if((qinv12 < fNormQcutLow[normBin]) || (qinv12 >= fNormQcutHigh[normBin])) continue; | |
2772 | ||
2773 | Int_t index1P23 = i; | |
2774 | Int_t index2P23 = j; | |
2775 | ||
2776 | for(Int_t pastpairP12=0; pastpairP12<numOtherPairs2[1][index1P23]; pastpairP12++){// loop in P12 with i as 2nd particle | |
2777 | Int_t locationOtherPairP12 = fOtherPairLocation2[1][index1P23]->At(pastpairP12); | |
2778 | if(locationOtherPairP12 < 0) continue; // no pair there | |
2779 | Int_t index1P12 = fNormPairs[1][ locationOtherPairP12 ].fIndex1; | |
2780 | ||
2781 | ||
2782 | //Check other past pair status in P13 | |
2783 | if( (fNormPairSwitch[2][index1P12]->At(index2P23)=='0')) continue; | |
2784 | ||
2785 | // all from different event | |
2786 | ch3 = Int_t((fNormPairs[1][ locationOtherPairP12 ].fCharge1 + 1)/2.);// charge of first particle in P12 | |
2787 | key3 = fNormPairs[1][ locationOtherPairP12 ].fKey1; | |
2788 | Short_t fillIndex3 = FillIndex3part(key1+key2+key3); | |
2789 | SetFillBins3(fillIndex3, key1, key2, key3, ch1, ch2, ch3, 3, bin1, bin2, bin3, fDummyB, fDummyB, fDummyB); | |
2790 | ||
2791 | tempNormFillCount[bin1][bin2][bin3][fillIndex3][4]++; | |
2792 | } | |
2793 | } | |
2794 | } | |
2795 | ||
2796 | ||
2797 | ||
2798 | ||
2799 | /////////////////////////////////////////////////// | |
2800 | // Do not use pairs from events with too many pairs | |
2801 | if(exitCode) { | |
2802 | cout<<"SE or ME or Norm PairCount too large. Discarding all pairs and skipping event"<<endl; | |
2803 | (fEvt)->fNpairsSE = 0; | |
2804 | (fEvt)->fNpairsME = 0; | |
2805 | ((TH1F*)fOutputList->FindObject("fRejectedEvents"))->Fill(fMbin+1); | |
2806 | return;// Skip event | |
2807 | }else{ | |
2808 | (fEvt)->fNpairsSE = pairCountSE; | |
2809 | (fEvt)->fNpairsME = pairCountME; | |
2810 | ((TH1F*)fOutputList->FindObject("fEvents2"))->Fill(fMbin+1); | |
2811 | } | |
2812 | /////////////////////////////////////////////////// | |
2813 | ||
cd12341d | 2814 | |
2815 | //cout<<"pairCountSE = "<<pairCountSE<<" pairCountME = "<<pairCountME<<endl; | |
b6e5ec54 | 2816 | //cout<<"Start Main analysis"<<endl; |
cd12341d | 2817 | |
2818 | /////////////////////////////////////////////////////////////////////// | |
2819 | /////////////////////////////////////////////////////////////////////// | |
2820 | /////////////////////////////////////////////////////////////////////// | |
2821 | // | |
2822 | // | |
5e3e77d6 | 2823 | // Start the Main Correlation Analysis |
cd12341d | 2824 | // |
2825 | // | |
2826 | /////////////////////////////////////////////////////////////////////// | |
2827 | ||
f5df8b1d | 2828 | |
654866df | 2829 | |
cd12341d | 2830 | ///////////////////////////////////////////////////////// |
2831 | // Skip 3-particle part if Tabulate6DPairs is set to true | |
2832 | if(fTabulatePairs) return; | |
2833 | ///////////////////////////////////////////////////////// | |
2834 | ||
2835 | // Set the Normalization counters | |
2836 | for(Int_t termN=0; termN<5; termN++){ | |
2837 | ||
2838 | if(termN==0){ | |
2839 | if((fEvt)->fNtracks ==0) continue; | |
2840 | }else if(termN<4){ | |
2841 | if((fEvt)->fNtracks ==0) continue; | |
2842 | if((fEvt+1)->fNtracks ==0) continue; | |
2843 | }else { | |
2844 | if((fEvt)->fNtracks ==0) continue; | |
2845 | if((fEvt+1)->fNtracks ==0) continue; | |
2846 | if((fEvt+2)->fNtracks ==0) continue; | |
2847 | } | |
654866df | 2848 | |
cd12341d | 2849 | for(Int_t sc=0; sc<kSCLimit3; sc++){ |
2850 | ||
2851 | for(Int_t c1=0; c1<2; c1++){ | |
2852 | for(Int_t c2=0; c2<2; c2++){ | |
2853 | for(Int_t c3=0; c3<2; c3++){ | |
2854 | ||
2855 | if(sc==0 || sc==6 || sc==9){// Identical species | |
2856 | if( (c1+c2+c3)==1) {if(c1!=0 || c2!=0 || c3!=1) continue;} | |
2857 | if( (c1+c2+c3)==2) {if(c1!=0) continue;} | |
2858 | }else if(sc!=5){ | |
2859 | if( (c1+c2)==1) {if(c1!=0) continue;} | |
2860 | }else {}// do nothing for pi-k-p case | |
2861 | Charge1[c1].Charge2[c2].Charge3[c3].SC[sc].MB[fMbin].EDB[fEDbin].ThreePT[termN].fNorm3->Fill(0.,tempNormFillCount[c1][c2][c3][sc][termN]); | |
2862 | } | |
2863 | } | |
2864 | } | |
2865 | } | |
2866 | } | |
2867 | ||
2868 | ||
2869 | ||
2870 | ///////////////////////////////////////////// | |
2871 | // Calculate Pair-Cut Correlations | |
2872 | for(Int_t en1case=0; en1case<2; en1case++){// limit at 2 (normal) | |
2873 | ||
2874 | Int_t nump1=0; | |
2875 | if(en1case==0) nump1 = (fEvt)->fNpairsSE; | |
2876 | if(en1case==1) nump1 = (fEvt)->fNpairsME; | |
2877 | ||
2878 | // 1st pair | |
2879 | for(Int_t p1=0; p1<nump1; p1++){ | |
2880 | ||
2881 | if(en1case==0){ | |
2882 | ch1 = Int_t(((fEvt)->fPairsSE[p1].fCharge1 + 1)/2.); | |
2883 | ch2 = Int_t(((fEvt)->fPairsSE[p1].fCharge2 + 1)/2.); | |
2884 | pVect1[0] = (fEvt)->fPairsSE[p1].fE1; pVect2[0] = (fEvt)->fPairsSE[p1].fE2; | |
2885 | pVect1[1] = (fEvt)->fPairsSE[p1].fP1[0]; pVect2[1] = (fEvt)->fPairsSE[p1].fP2[0]; | |
2886 | pVect1[2] = (fEvt)->fPairsSE[p1].fP1[1]; pVect2[2] = (fEvt)->fPairsSE[p1].fP2[1]; | |
2887 | pVect1[3] = (fEvt)->fPairsSE[p1].fP1[2]; pVect2[3] = (fEvt)->fPairsSE[p1].fP2[2]; | |
2888 | index1 = (fEvt)->fPairsSE[p1].fIndex1; index2 = (fEvt)->fPairsSE[p1].fIndex2; | |
2889 | key1 = (fEvt)->fPairsSE[p1].fKey1; key2 = (fEvt)->fPairsSE[p1].fKey2; | |
cd12341d | 2890 | qinv12 = (fEvt)->fPairsSE[p1].fQinv; |
2f00662e | 2891 | // |
2892 | pVect1MC[1] = (fEvt)->fPairsSE[p1].fP1MC[0]; pVect2MC[1] = (fEvt)->fPairsSE[p1].fP2MC[0]; | |
2893 | pVect1MC[2] = (fEvt)->fPairsSE[p1].fP1MC[1]; pVect2MC[2] = (fEvt)->fPairsSE[p1].fP2MC[1]; | |
2894 | pVect1MC[3] = (fEvt)->fPairsSE[p1].fP1MC[2]; pVect2MC[3] = (fEvt)->fPairsSE[p1].fP2MC[2]; | |
2895 | pVect1MC[0] = sqrt(pow(pVect1MC[1],2)+pow(pVect1MC[2],2)+pow(pVect1MC[3],2)+pow(fTrueMassPi,2)); | |
2896 | pVect2MC[0] = sqrt(pow(pVect2MC[1],2)+pow(pVect2MC[2],2)+pow(pVect2MC[3],2)+pow(fTrueMassPi,2)); | |
cd12341d | 2897 | } |
2898 | if(en1case==1){ | |
2899 | ch1 = Int_t(((fEvt)->fPairsME[p1].fCharge1 + 1)/2.); | |
2900 | ch2 = Int_t(((fEvt)->fPairsME[p1].fCharge2 + 1)/2.); | |
2901 | pVect1[0] = (fEvt)->fPairsME[p1].fE1; pVect2[0] = (fEvt)->fPairsME[p1].fE2; | |
2902 | pVect1[1] = (fEvt)->fPairsME[p1].fP1[0]; pVect2[1] = (fEvt)->fPairsME[p1].fP2[0]; | |
2903 | pVect1[2] = (fEvt)->fPairsME[p1].fP1[1]; pVect2[2] = (fEvt)->fPairsME[p1].fP2[1]; | |
2904 | pVect1[3] = (fEvt)->fPairsME[p1].fP1[2]; pVect2[3] = (fEvt)->fPairsME[p1].fP2[2]; | |
2905 | index1 = (fEvt)->fPairsME[p1].fIndex1; index2 = (fEvt)->fPairsME[p1].fIndex2; | |
2906 | key1 = (fEvt)->fPairsME[p1].fKey1; key2 = (fEvt)->fPairsME[p1].fKey2; | |
cd12341d | 2907 | qinv12 = (fEvt)->fPairsME[p1].fQinv; |
2f00662e | 2908 | // |
2909 | pVect1MC[1] = (fEvt)->fPairsME[p1].fP1MC[0]; pVect2MC[1] = (fEvt)->fPairsME[p1].fP2MC[0]; | |
2910 | pVect1MC[2] = (fEvt)->fPairsME[p1].fP1MC[1]; pVect2MC[2] = (fEvt)->fPairsME[p1].fP2MC[1]; | |
2911 | pVect1MC[3] = (fEvt)->fPairsME[p1].fP1MC[2]; pVect2MC[3] = (fEvt)->fPairsME[p1].fP2MC[2]; | |
2912 | pVect1MC[0] = sqrt(pow(pVect1MC[1],2)+pow(pVect1MC[2],2)+pow(pVect1MC[3],2)+pow(fTrueMassPi,2)); | |
2913 | pVect2MC[0] = sqrt(pow(pVect2MC[1],2)+pow(pVect2MC[2],2)+pow(pVect2MC[3],2)+pow(fTrueMassPi,2)); | |
cd12341d | 2914 | } |
2f00662e | 2915 | |
140107fb | 2916 | |
cd12341d | 2917 | // en2 buffer |
2918 | for(Int_t en2=0; en2<3; en2++){ | |
2919 | ////////////////////////////////////// | |
2920 | ||
2921 | Bool_t skipcase=kTRUE; | |
2922 | Short_t config=-1, part=-1; | |
2923 | if(en1case==0 && en2==0) {skipcase=kFALSE; config=1; part=0;}// P11T1 | |
2924 | if(en1case==0 && en2==1) {skipcase=kFALSE; config=2; part=1;}// P11T2 | |
2925 | if(en1case==1 && en2==0) {skipcase=kFALSE; config=2; part=2;}// P12T1 | |
2926 | if(en1case==1 && en2==2) {skipcase=kFALSE; config=3; part=3;}// P12T3 | |
2927 | ||
2928 | if(skipcase) continue; | |
2929 | ||
2930 | ||
2931 | // 3-particle terms | |
2932 | // 3rd particle | |
2933 | for(Int_t k=0; k<(fEvt+en2)->fNtracks; k++){ | |
2934 | index3 = k; | |
2935 | ||
2936 | ||
2937 | // remove auto-correlations and duplicate triplets | |
2938 | if(config==1){ | |
2939 | if( index1 == index3) continue; | |
2940 | if( index2 == index3) continue; | |
2941 | if(fPairSplitCut[0][index1]->At(index2)=='1') continue;// Track splitting/merging | |
2942 | ||
2943 | // skip the switched off triplets | |
2944 | if(fTripletSkip1[fPairLocationSE[index1]->At(index2)]->At(index3)=='1') { | |
2945 | fTripletSkip1[fPairLocationSE[index1]->At(index2)]->AddAt('0',index3);// Reset | |
2946 | continue; | |
2947 | } | |
2948 | /////////////////////////////// | |
2949 | // Turn off 1st possible degenerate triplet | |
2950 | if(index1 < index3){// verify correct id ordering ( index1 < k ) | |
2951 | if(fPairLocationSE[index1]->At(index3) >= 0){ | |
2952 | fTripletSkip1[fPairLocationSE[index1]->At(index3)]->AddAt('1',index2); | |
2953 | } | |
2954 | if(fPairSplitCut[0][index1]->At(index3)=='1') continue;// Track splitting/merging | |
2955 | }else {// or k < index1 | |
2956 | if(fPairLocationSE[index3]->At(index1) >= 0){ | |
2957 | fTripletSkip1[fPairLocationSE[index3]->At(index1)]->AddAt('1',index2); | |
2958 | } | |
2959 | if(fPairSplitCut[0][index3]->At(index1)=='1') continue;// Track splitting/merging | |
2960 | } | |
2961 | // turn off 2nd possible degenerate triplet | |
2962 | if(index2 < index3){// verify correct id ordering (index2 < k) | |
2963 | if(fPairLocationSE[index2]->At(index3) >= 0){ | |
2964 | fTripletSkip1[fPairLocationSE[index2]->At(index3)]->AddAt('1',index1); | |
2965 | } | |
2966 | if(fPairSplitCut[0][index2]->At(index3)=='1') continue;// Track splitting/merging | |
2967 | }else {// or k < index2 | |
2968 | if(fPairLocationSE[index3]->At(index2) >= 0){ | |
2969 | fTripletSkip1[fPairLocationSE[index3]->At(index2)]->AddAt('1',index1); | |
2970 | } | |
2971 | if(fPairSplitCut[0][index3]->At(index2)=='1') continue;// Track splitting/merging | |
2972 | } | |
2973 | ||
2974 | }// end config 1 | |
2975 | ||
2976 | if(config==2 && part==1){// SE pair and third particle from next event. P11T2 | |
2977 | /////////////////////////////// | |
2978 | // Turn off 1st possible degenerate triplet | |
2979 | if(fPairLocationME[index1]->At(index3) >= 0){ | |
2980 | fTripletSkip2[fPairLocationME[index1]->At(index3)]->AddAt('1',index2); | |
2981 | } | |
2982 | ||
2983 | // turn off 2nd possible degenerate triplet | |
2984 | if(fPairLocationME[index2]->At(index3) >= 0){ | |
2985 | fTripletSkip2[fPairLocationME[index2]->At(index3)]->AddAt('1',index1); | |
2986 | } | |
2987 | ||
2988 | if(fPairSplitCut[0][index1]->At(index2)=='1') continue;// Track splitting/merging | |
2989 | if(fPairSplitCut[1][index1]->At(index3)=='1') continue;// Track splitting/merging | |
2990 | if(fPairSplitCut[1][index2]->At(index3)=='1') continue;// Track splitting/merging | |
2991 | }// end config 2 part 1 | |
2992 | ||
2993 | if(config==2 && part==2){// P12T1 | |
2994 | if( index1 == index3) continue; | |
2995 | ||
2996 | // skip the switched off triplets | |
2997 | if(fTripletSkip2[fPairLocationME[index1]->At(index2)]->At(index3)=='1') { | |
2998 | fTripletSkip2[fPairLocationME[index1]->At(index2)]->AddAt('0',index3);// Reset | |
2999 | continue; | |
3000 | } | |
3001 | // turn off another possible degenerate | |
3002 | if(fPairLocationME[index3]->At(index2) >= 0){ | |
3003 | fTripletSkip2[fPairLocationME[index3]->At(index2)]->AddAt('1',index1); | |
3004 | }// end config 2 part 2 | |
3005 | ||
3006 | if(fPairSplitCut[1][index1]->At(index2)=='1') continue;// Track splitting/merging | |
3007 | if(index1 < index3) {if(fPairSplitCut[0][index1]->At(index3)=='1') continue;}// Track splitting/merging | |
3008 | else {if(fPairSplitCut[0][index3]->At(index1)=='1') continue;}// Track splitting/merging | |
3009 | if(fPairSplitCut[1][index3]->At(index2)=='1') continue;// Track splitting/merging | |
3010 | } | |
3011 | if(config==3){// P12T3 | |
3012 | if(fPairSplitCut[1][index1]->At(index2)=='1') continue;// Track splitting/merging | |
3013 | if(fPairSplitCut[2][index1]->At(index3)=='1') continue;// Track splitting/merging | |
3014 | if(fPairSplitCut[3][index2]->At(index3)=='1') continue;// Track splitting/merging | |
3015 | }// end config 3 | |
3016 | ||
3017 | ||
5e3e77d6 | 3018 | |
cd12341d | 3019 | ch3 = Int_t(((fEvt+en2)->fTracks[k].fCharge + 1)/2.); |
3020 | key3 = (fEvt+en2)->fTracks[k].fKey; | |
3021 | Short_t fillIndex3 = FillIndex3part(key1+key2+key3); | |
3022 | Short_t fillIndex13 = FillIndex2part(key1+key3); | |
3023 | Short_t fillIndex23 = FillIndex2part(key2+key3); | |
3024 | Short_t qCutBin13 = SetQcutBin(fillIndex13); | |
3025 | Short_t qCutBin23 = SetQcutBin(fillIndex23); | |
3026 | pVect3[0] = (fEvt+en2)->fTracks[k].fEaccepted; | |
3027 | pVect3[1] = (fEvt+en2)->fTracks[k].fP[0]; | |
3028 | pVect3[2] = (fEvt+en2)->fTracks[k].fP[1]; | |
3029 | pVect3[3] = (fEvt+en2)->fTracks[k].fP[2]; | |
654866df | 3030 | qinv13 = GetQinv(fillIndex13, pVect1, pVect3); |
3031 | qinv23 = GetQinv(fillIndex23, pVect2, pVect3); | |
3032 | ||
3033 | if(qinv13 < fQLowerCut) continue; | |
3034 | if(qinv23 < fQLowerCut) continue; | |
3035 | if(qinv13 > fQcut[qCutBin13]) continue; | |
3036 | if(qinv23 > fQcut[qCutBin23]) continue; | |
3037 | ||
6903e04b | 3038 | Float_t Kt12=sqrt( pow(pVect1[1]+pVect2[1],2) + pow(pVect1[2]+pVect2[2],2))/2.; |
3039 | Float_t Kt13=sqrt( pow(pVect1[1]+pVect3[1],2) + pow(pVect1[2]+pVect3[2],2))/2.; | |
3040 | Float_t Kt23=sqrt( pow(pVect2[1]+pVect3[1],2) + pow(pVect2[2]+pVect3[2],2))/2.; | |
140107fb | 3041 | |
2f00662e | 3042 | if(fMCcase){ |
3043 | pVect3MC[1] = (fEvt+en2)->fMCtracks[abs((fEvt+en2)->fTracks[k].fLabel)].fPx; | |
3044 | pVect3MC[2] = (fEvt+en2)->fMCtracks[abs((fEvt+en2)->fTracks[k].fLabel)].fPy; | |
3045 | pVect3MC[3] = (fEvt+en2)->fMCtracks[abs((fEvt+en2)->fTracks[k].fLabel)].fPz; | |
3046 | pVect3MC[0] = sqrt(pow(pVect3MC[1],2)+pow(pVect3MC[2],2)+pow(pVect3MC[3],2)+pow(fTrueMassPi,2)); | |
3047 | qinv12MC = GetQinv(0, pVect1MC, pVect2MC); | |
3048 | qinv13MC = GetQinv(0, pVect1MC, pVect3MC); | |
3049 | qinv23MC = GetQinv(0, pVect2MC, pVect3MC); | |
3050 | } | |
3051 | ||
140107fb | 3052 | |
654866df | 3053 | |
5e3e77d6 | 3054 | // if all three pair cuts are the same then the case (config=2 && term=2) never reaches here. |
3055 | ||
cd12341d | 3056 | q3 = sqrt(pow(qinv12,2) + pow(qinv13,2) + pow(qinv23,2)); |
3057 | transK3 = sqrt( pow(pVect1[1]+pVect2[1]+pVect3[1],2) + pow(pVect1[2]+pVect2[2]+pVect3[2],2))/3.; | |
576f89a7 | 3058 | if(fEDbins>1){ |
3059 | if(transK3<0.3) fEDbin=0; | |
3060 | else fEDbin=1; | |
3061 | } | |
df2ce8e1 | 3062 | firstQ=0; secondQ=0; thirdQ=0; |
e29e02c1 | 3063 | |
140107fb | 3064 | |
5e3e77d6 | 3065 | // |
fa109294 | 3066 | |
5e3e77d6 | 3067 | // |
cd12341d | 3068 | if(config==1) {// 123 |
3069 | SetFillBins3(fillIndex3, key1, key2, key3, ch1, ch2, ch3, 0, bin1, bin2, bin3, fDummyB, fDummyB, fDummyB); | |
fa109294 | 3070 | |
cd12341d | 3071 | if(fillIndex3 <= 2){ |
3072 | ArrangeQs(fillIndex3, key1, key2, key3, ch1, ch2, ch3, qinv12, qinv13, qinv23, 0, 1, firstQ, secondQ, thirdQ); | |
6903e04b | 3073 | ArrangeQs(fillIndex3, key1, key2, key3, ch1, ch2, ch3, Kt12, Kt13, Kt23, 0, 1, firstKt, secondKt, thirdKt); |
2f00662e | 3074 | if(fillIndex3==0 && fMCcase) ArrangeQs(fillIndex3, key1, key2, key3, ch1, ch2, ch3, qinv12MC, qinv13MC, qinv23MC, 0, 1, firstQMC, secondQMC, thirdQMC); |
654866df | 3075 | Float_t WInput = 1.0; |
6903e04b | 3076 | if(fGenerateSignal && ch1==ch2 && ch1==ch3) WInput = MCWeight3D(kTRUE, 1, fFixedLambdaBinr3, firstQ, secondQ, thirdQ, firstKt, secondKt, thirdKt); |
baba9c2d | 3077 | //if(fGenerateSignal && ch1==ch2 && ch1==ch3) WInput = MCWeight3D(kTRUE, 1, fFixedLambdaBinr3, firstQMC, secondQMC, thirdQMC); |
654866df | 3078 | //// |
3079 | ||
3080 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[0].fTerms3->Fill(firstQ, secondQ, thirdQ, WInput); | |
6903e04b | 3081 | |
654866df | 3082 | //// |
5e3e77d6 | 3083 | // |
3084 | if(fillIndex3==0 && ch1==ch2 && ch1==ch3 && fMCcase==kFALSE){ | |
baba9c2d | 3085 | ((TH3D*)fOutputList->FindObject("fKt3DistTerm1"))->Fill(fMbin+1, transK3, q3); |
6903e04b | 3086 | if(q3<0.06){ |
3087 | Float_t pt1=sqrt(pow(pVect1[1],2)+pow(pVect1[2],2)); | |
3088 | Float_t pt2=sqrt(pow(pVect2[1],2)+pow(pVect2[2],2)); | |
3089 | Float_t pt3=sqrt(pow(pVect3[1],2)+pow(pVect3[2],2)); | |
3090 | ((TProfile2D*)fOutputList->FindObject("fKtTripletAvg"))->Fill(fMbin+1, fEDbin, pt1); | |
3091 | ((TProfile2D*)fOutputList->FindObject("fKtTripletAvg"))->Fill(fMbin+1, fEDbin, pt2); | |
3092 | ((TProfile2D*)fOutputList->FindObject("fKtTripletAvg"))->Fill(fMbin+1, fEDbin, pt3); | |
3093 | } | |
baba9c2d | 3094 | /*FourVectProdTerms(pVect1, pVect2, pVect3, Qsum1v1, Qsum2, Qsum3v1, Qsum1v2, Qsum3v2);// 4-vector product sums |
90814457 | 3095 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[0].f4VectProd1Terms->Fill(Qsum1v1, Qsum2, Qsum3v1); |
3096 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[0].f4VectProd2Terms->Fill(Qsum1v2, Qsum2, Qsum3v2); | |
baba9c2d | 3097 | */ |
5e3e77d6 | 3098 | } |
e29e02c1 | 3099 | |
cd12341d | 3100 | } |
3101 | ||
3102 | }else if(config==2){// 12, 13, 23 | |
5e3e77d6 | 3103 | |
cd12341d | 3104 | Bool_t fill2=kFALSE, fill3=kFALSE, fill4=kFALSE; |
3105 | SetFillBins3(fillIndex3, key1, key2, key3, ch1, ch2, ch3, part, bin1, bin2, bin3, fill2, fill3, fill4); | |
3106 | ||
3107 | // loop over terms 2-4 | |
5e3e77d6 | 3108 | for(Int_t jj=2; jj<5; jj++){ |
3109 | if(jj==2) {if(!fill2) continue;}//12 | |
3110 | if(jj==3) {if(!fill3) continue;}//13 | |
3111 | if(jj==4) {if(!fill4) continue;}//23 | |
cd12341d | 3112 | |
3113 | if(fillIndex3 <= 2){ | |
5e3e77d6 | 3114 | ArrangeQs(fillIndex3, key1, key2, key3, ch1, ch2, ch3, qinv12, qinv13, qinv23, part, jj, firstQ, secondQ, thirdQ); |
6903e04b | 3115 | ArrangeQs(fillIndex3, key1, key2, key3, ch1, ch2, ch3, Kt12, Kt13, Kt23, part, jj, firstKt, secondKt, thirdKt); |
2f00662e | 3116 | if(fillIndex3==0 && fMCcase) ArrangeQs(fillIndex3, key1, key2, key3, ch1, ch2, ch3, qinv12MC, qinv13MC, qinv23MC, part, jj, firstQMC, secondQMC, thirdQMC); |
654866df | 3117 | Float_t WInput = 1.0; |
6903e04b | 3118 | if(fGenerateSignal && ch1==ch2 && ch1==ch3) WInput = MCWeight3D(kTRUE, jj, fFixedLambdaBinr3, firstQ, secondQ, thirdQ, firstKt, secondKt, thirdKt); |
baba9c2d | 3119 | //if(fGenerateSignal && ch1==ch2 && ch1==ch3) WInput = MCWeight3D(kTRUE, jj, fFixedLambdaBinr3, firstQMC, secondQMC, thirdQMC); |
654866df | 3120 | //// |
3121 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[jj-1].fTerms3->Fill(firstQ, secondQ, thirdQ, WInput); | |
3122 | //// | |
baba9c2d | 3123 | /*if(fillIndex3==0 && ch1==ch2 && ch1==ch3){ |
90814457 | 3124 | if(part==1){// P11T2 |
3125 | if(jj==2) { | |
3126 | FourVectProdTerms(pVect1, pVect2, pVect3, Qsum1v1, Qsum2, Qsum3v1, Qsum1v2, Qsum3v2);// 4-vector product sums | |
90814457 | 3127 | }if(jj==3){ |
3128 | FourVectProdTerms(pVect1, pVect3, pVect2, Qsum1v1, Qsum2, Qsum3v1, Qsum1v2, Qsum3v2);// 4-vector product sums | |
90814457 | 3129 | }if(jj==4) { |
3130 | FourVectProdTerms(pVect3, pVect1, pVect2, Qsum1v1, Qsum2, Qsum3v1, Qsum1v2, Qsum3v2);// 4-vector product sums | |
90814457 | 3131 | } |
3132 | }else{// P12T1 | |
3133 | if(jj==2) { | |
3134 | FourVectProdTerms(pVect1, pVect3, pVect2, Qsum1v1, Qsum2, Qsum3v1, Qsum1v2, Qsum3v2);// 4-vector product sums | |
90814457 | 3135 | }if(jj==3) { |
3136 | FourVectProdTerms(pVect1, pVect2, pVect3, Qsum1v1, Qsum2, Qsum3v1, Qsum1v2, Qsum3v2);// 4-vector product sums | |
90814457 | 3137 | }if(jj==4) { |
3138 | FourVectProdTerms(pVect2, pVect1, pVect3, Qsum1v1, Qsum2, Qsum3v1, Qsum1v2, Qsum3v2);// 4-vector product sums | |
90814457 | 3139 | } |
3140 | } | |
3141 | if(!fMCcase){ | |
3142 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[jj-1].f4VectProd1Terms->Fill(Qsum1v1, Qsum2, Qsum3v1); | |
3143 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[jj-1].f4VectProd2Terms->Fill(Qsum1v2, Qsum2, Qsum3v2); | |
fa109294 | 3144 | } |
baba9c2d | 3145 | }*/ |
e29e02c1 | 3146 | |
cd12341d | 3147 | } |
3148 | } | |
5e3e77d6 | 3149 | |
cd12341d | 3150 | }else {// config 3: All particles from different events |
cd12341d | 3151 | |
704f2481 | 3152 | // "enhancement" differs from 1.0 only when Qinv goes over fQcut |
3153 | //Float_t enhancement=1.0; | |
3154 | //Int_t nUnderCut=0; | |
3155 | //if(qinv13<fQcut[qCutBin13]) nUnderCut++; | |
3156 | //if(qinv23<fQcut[qCutBin23]) nUnderCut++; | |
3157 | //if(nUnderCut==0) enhancement = (1+1+1)/1.;// 1 LowQ pair | |
3158 | //if(nUnderCut==1) enhancement = (1+2)/2.;// 2 LowQ pair | |
3159 | //if(nUnderCut==2) enhancement = 1.;// 3 LowQ pair | |
cd12341d | 3160 | |
3161 | SetFillBins3(fillIndex3, key1, key2, key3, ch1, ch2, ch3, 3, bin1, bin2, bin3, fDummyB, fDummyB, fDummyB); | |
90814457 | 3162 | |
140107fb | 3163 | if(ch1==ch2 && ch1==ch3 && fillIndex3==0) { |
baba9c2d | 3164 | //FourVectProdTerms(pVect1, pVect2, pVect3, Qsum1v1, Qsum2, Qsum3v1, Qsum1v2, Qsum3v2);// 4-vector product sums |
df2ce8e1 | 3165 | if(!fMCcase) ((TH3D*)fOutputList->FindObject("fKt3DistTerm5"))->Fill(fMbin+1, transK3, q3); |
140107fb | 3166 | } |
cd12341d | 3167 | |
3168 | if(fillIndex3 <= 2){ | |
3169 | ArrangeQs(fillIndex3, key1, key2, key3, ch1, ch2, ch3, qinv12, qinv13, qinv23, part, 5, firstQ, secondQ, thirdQ); | |
6903e04b | 3170 | ArrangeQs(fillIndex3, key1, key2, key3, ch1, ch2, ch3, Kt12, Kt13, Kt23, part, 5, firstKt, secondKt, thirdKt); |
704f2481 | 3171 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[4].fTerms3->Fill(firstQ, secondQ, thirdQ); |
baba9c2d | 3172 | /*if(fillIndex3==0 && ch1==ch2 && ch1==ch3 && fMCcase==kFALSE){ |
90814457 | 3173 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[4].f4VectProd1Terms->Fill(Qsum1v1, Qsum2, Qsum3v1); |
3174 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[4].f4VectProd2Terms->Fill(Qsum1v2, Qsum2, Qsum3v2); | |
baba9c2d | 3175 | }*/ |
cd12341d | 3176 | } |
baba9c2d | 3177 | |
cd12341d | 3178 | if(fillIndex3 !=0) continue;// only calculate TPN for pi-pi-pi |
3179 | if(ch1!=ch2 || ch1!=ch3) continue;// only calcualte TPN for ss | |
5e3e77d6 | 3180 | |
90814457 | 3181 | |
2f00662e | 3182 | GetWeight(pVect1, pVect2, weight12, weight12Err); |
3183 | GetWeight(pVect1, pVect3, weight13, weight13Err); | |
3184 | GetWeight(pVect2, pVect3, weight23, weight23Err); | |
3185 | ||
5e027bd6 | 3186 | if(sqrt(fabs(weight12*weight13*weight23)) > 1.0) { |
3187 | if(fMbin==0 && bin1==0) { | |
3188 | ((TH3F*)fOutputList->FindObject("fTPNRejects1"))->Fill(qinv12, qinv13, qinv23, sqrt(fabs(weight12*weight13*weight23))); | |
3189 | } | |
3190 | continue;// weight should never be larger than 1 | |
3191 | } | |
46b217b3 | 3192 | |
2f00662e | 3193 | |
5fc49f8c | 3194 | Float_t myDamp = fDampStart + (fDampStep)*fFixedLambdaBinr3;// lambdabin=0.52 for v1 draft, 0.7 is more realistic |
fa109294 | 3195 | Int_t denIndex = 0; |
f9a5e67a | 3196 | Int_t momResIndex = rIndexForTPNMomRes*kNDampValues + fFixedLambdaBinMomRes;// lambdabin=0.52 for v1 draft, 0.4 is more realistic |
90814457 | 3197 | |
704f2481 | 3198 | Float_t coulCorr12 = FSICorrelationTherm2(+1,+1, qinv12); |
3199 | Float_t coulCorr13 = FSICorrelationTherm2(+1,+1, qinv13); | |
3200 | Float_t coulCorr23 = FSICorrelationTherm2(+1,+1, qinv23); | |
d60cf3cf | 3201 | if(coulCorr12 < 0.1 || coulCorr13 < 0.1 || coulCorr23 < 0.1) {// Safety check |
3202 | if(fMbin==0 && bin1==0) { | |
5e027bd6 | 3203 | ((TH3F*)fOutputList->FindObject("fTPNRejects2"))->Fill(qinv12, qinv13, qinv23, sqrt(fabs(weight12*weight13*weight23))); |
d60cf3cf | 3204 | } |
3205 | continue; | |
3206 | } | |
704f2481 | 3207 | Float_t MomResCorr12=1.0, MomResCorr13=1.0, MomResCorr23=1.0; |
5fc49f8c | 3208 | if(!fGenerateSignal && !fMCcase) { |
704f2481 | 3209 | Int_t momBin12 = fMomResC2->GetYaxis()->FindBin(qinv12); |
3210 | Int_t momBin13 = fMomResC2->GetYaxis()->FindBin(qinv13); | |
3211 | Int_t momBin23 = fMomResC2->GetYaxis()->FindBin(qinv23); | |
3212 | if(momBin12 >= kQbins) momBin12 = kQbins-1; | |
3213 | if(momBin13 >= kQbins) momBin13 = kQbins-1; | |
3214 | if(momBin23 >= kQbins) momBin23 = kQbins-1; | |
3215 | MomResCorr12 = fMomResC2->GetBinContent(momResIndex+1, momBin12); | |
3216 | MomResCorr13 = fMomResC2->GetBinContent(momResIndex+1, momBin13); | |
3217 | MomResCorr23 = fMomResC2->GetBinContent(momResIndex+1, momBin23); | |
3ee47b58 | 3218 | |
d60cf3cf | 3219 | if(MomResCorr12 > 1.2 || MomResCorr13 > 1.2 || MomResCorr23 > 1.2) {// Safety check |
3220 | if(fMbin==0 && bin1==0) { | |
5e027bd6 | 3221 | ((TH3F*)fOutputList->FindObject("fTPNRejects3"))->Fill(qinv12, qinv13, qinv23, sqrt(fabs(weight12*weight13*weight23))); |
d60cf3cf | 3222 | } |
3223 | continue; | |
3224 | } | |
704f2481 | 3225 | } |
3226 | weight12CC = ((weight12+1)*MomResCorr12 - myDamp*coulCorr12 - (1-myDamp)); | |
3227 | weight12CC /= coulCorr12*myDamp; | |
3228 | weight13CC = ((weight13+1)*MomResCorr13 - myDamp*coulCorr13 - (1-myDamp)); | |
3229 | weight13CC /= coulCorr13*myDamp; | |
3230 | weight23CC = ((weight23+1)*MomResCorr23 - myDamp*coulCorr23 - (1-myDamp)); | |
3231 | weight23CC /= coulCorr23*myDamp; | |
3232 | ||
3233 | if(weight12CC < 0 || weight13CC < 0 || weight23CC < 0) { | |
3234 | if(fMbin==0 && bin1==0) { | |
3235 | weightTotal = sqrt(fabs(weight12CC*weight13CC*weight23CC)); | |
5e027bd6 | 3236 | ((TH3F*)fOutputList->FindObject("fTPNRejects4"))->Fill(qinv12, qinv13, qinv23, weightTotal); |
704f2481 | 3237 | } |
3238 | continue;// C2^QS can never be less than unity | |
3239 | } | |
3240 | ||
3241 | ///////////////////////////////////////////////////// | |
3242 | weightTotal = sqrt(weight12CC*weight13CC*weight23CC); | |
3243 | ///////////////////////////////////////////////////// | |
baba9c2d | 3244 | |
704f2481 | 3245 | if(weightTotal > 1.5) { |
3246 | if(fMbin==0 && bin1==0) { | |
5e027bd6 | 3247 | ((TH3F*)fOutputList->FindObject("fTPNRejects5"))->Fill(qinv12, qinv13, qinv23, weightTotal); |
704f2481 | 3248 | } |
3249 | continue;// C2^QS never be greater than 1.0 in theory. Can be slightly larger than 1.0 with fluctuations | |
3250 | } | |
baba9c2d | 3251 | |
3252 | ||
704f2481 | 3253 | |
3254 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[4].DT[denIndex].fTwoPartNorm->Fill(qinv12, qinv13, qinv23, weightTotal); | |
3255 | ||
baba9c2d | 3256 | //Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[4].DT[denIndex].f4VectProd1TwoPartNorm->Fill(Qsum1v1, Qsum2, Qsum3v1, weightTotal); |
3257 | //Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[4].DT[denIndex].f4VectProd2TwoPartNorm->Fill(Qsum1v2, Qsum2, Qsum3v2, weightTotal); | |
e29e02c1 | 3258 | |
90814457 | 3259 | |
704f2481 | 3260 | // Save cpu time and memory by skipping r3 denominator calculation below. den errors are negligible compared to num errors. |
3261 | /* | |
3262 | if(weightTotal > 0.0001){// tiny numbers cause a Float_ting point exception below | |
3263 | weightTotalErr = pow((weight12Err*coulCorr12)*weight13CC*weight23CC,2); | |
3264 | weightTotalErr += pow(weight12CC*(weight13Err*coulCorr13)*weight23CC,2); | |
3265 | weightTotalErr += pow(weight12CC*weight13CC*(weight23Err*coulCorr23),2); | |
3266 | weightTotalErr /= pow(2*weightTotal,2); | |
3267 | ||
3268 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[4].TwoPartNormErr->Fill(denIndex, q3, weightTotalErr); | |
3269 | } | |
3270 | */ | |
3271 | ||
cd12341d | 3272 | |
3273 | ||
baba9c2d | 3274 | }// config 3 |
cd12341d | 3275 | }// end 3rd particle |
3276 | }// en2 | |
3277 | ||
3278 | ||
fa109294 | 3279 | }// p1 |
3280 | }//en1 | |
cd12341d | 3281 | |
cd12341d | 3282 | /////////////////// |
3283 | }// end of PdensityPairs | |
3284 | ||
fa109294 | 3285 | |
cd12341d | 3286 | |
3287 | ||
3288 | ||
3289 | ||
3290 | ||
3291 | //////////////////////////////////////////////////////// | |
3292 | // Pdensity Method with Explicit Loops | |
3293 | if(fPdensityExplicitLoop){ | |
3294 | ||
3295 | //////////////////////////////////// | |
3296 | // 2nd, 3rd, and 4th order Correlations | |
3297 | ||
3298 | // First Particle | |
3299 | for (Int_t i=0; i<myTracks; i++) { | |
3300 | ch1 = Int_t( ((fEvt)->fTracks[i].fCharge + 1)/2. ); | |
3301 | pVect1[0] = (fEvt)->fTracks[i].fEaccepted; | |
3302 | pVect1[1] = (fEvt)->fTracks[i].fP[0]; | |
3303 | pVect1[2] = (fEvt)->fTracks[i].fP[1]; | |
3304 | pVect1[3] = (fEvt)->fTracks[i].fP[2]; | |
3305 | key1 = (fEvt)->fTracks[i].fKey; | |
3306 | ||
3307 | // Second Event | |
3308 | for(Int_t en2=0; en2<fEventsToMix+1; en2++){ | |
3309 | Int_t startbin2=0; | |
3310 | if(en2==0) startbin2=i+1; | |
3311 | ||
3312 | // Second Particle | |
3313 | for (Int_t j=startbin2; j<(fEvt+en2)->fNtracks; j++) { | |
3314 | ch2 = Int_t( ((fEvt+en2)->fTracks[j].fCharge + 1)/2. ); | |
3315 | pVect2[0] = (fEvt+en2)->fTracks[j].fEaccepted; | |
3316 | pVect2[1] = (fEvt+en2)->fTracks[j].fP[0]; | |
3317 | pVect2[2] = (fEvt+en2)->fTracks[j].fP[1]; | |
3318 | pVect2[3] = (fEvt+en2)->fTracks[j].fP[2]; | |
3319 | key2 = (fEvt+en2)->fTracks[j].fKey; | |
3320 | ||
3321 | Short_t fillIndex12 = FillIndex2part(key1+key2); | |
3322 | qinv12 = GetQinv(fillIndex12, pVect1, pVect2); | |
3323 | ||
3324 | if(qinv12 < fQLowerCut) continue; | |
3325 | ||
3326 | ||
3327 | // 2-particle part is filled always during pair creator | |
3328 | ||
3329 | // Third Event | |
3330 | for(Int_t en3=en2; en3<fEventsToMix+1; en3++){ | |
3331 | Int_t startbin3=0; | |
3332 | if(en3==en2) startbin3=j+1; | |
3333 | else startbin3=0; | |
3334 | ||
3335 | ||
3336 | // Third Particle | |
3337 | for (Int_t k=startbin3; k<(fEvt+en3)->fNtracks; k++) { | |
3338 | ch3 = Int_t( ((fEvt+en3)->fTracks[k].fCharge + 1)/2. ); | |
3339 | pVect3[0] = (fEvt+en3)->fTracks[k].fEaccepted; | |
3340 | pVect3[1] = (fEvt+en3)->fTracks[k].fP[0]; | |
3341 | pVect3[2] = (fEvt+en3)->fTracks[k].fP[1]; | |
3342 | pVect3[3] = (fEvt+en3)->fTracks[k].fP[2]; | |
3343 | key3 = (fEvt+en3)->fTracks[k].fKey; | |
3344 | ||
3345 | Short_t fillIndex3 = FillIndex3part(key1+key2+key3); | |
3346 | Short_t fillIndex13 = FillIndex2part(key1+key3); | |
3347 | qinv13 = GetQinv(fillIndex13, pVect1, pVect3); | |
3348 | Short_t fillIndex23 = FillIndex2part(key2+key3); | |
3349 | qinv23 = GetQinv(fillIndex23, pVect2, pVect3); | |
3350 | ||
3351 | ||
3352 | if(qinv13 < fQLowerCut) continue; | |
3353 | if(qinv23 < fQLowerCut) continue; | |
3354 | ||
3355 | ||
3356 | q3 = sqrt(pow(qinv12,2) + pow(qinv13,2) + pow(qinv23,2)); | |
3357 | ||
3358 | Short_t normBin12 = SetNormBin(fillIndex12); | |
3359 | Short_t normBin13 = SetNormBin(fillIndex13); | |
3360 | Short_t normBin23 = SetNormBin(fillIndex23); | |
3361 | ||
3362 | ||
3363 | if(en3==0 && en2==0) {// 123 | |
3364 | SetFillBins3(fillIndex3, key1, key2, key3, ch1, ch2, ch3, 0, bin1, bin2, bin3, fDummyB, fDummyB, fDummyB); | |
3365 | ||
3366 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[0].fExplicit3->Fill(q3);// 123 | |
3367 | ||
3368 | if((qinv12>=fNormQcutLow[normBin12]) && (qinv13>=fNormQcutLow[normBin13]) && (qinv23>=fNormQcutLow[normBin23])) { | |
3369 | if((qinv12<fNormQcutHigh[normBin12]) && (qinv13<fNormQcutHigh[normBin13]) && (qinv23<fNormQcutHigh[normBin23])) { | |
3370 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[0].fNormEx3->Fill(0.); | |
3371 | } | |
3372 | } | |
3373 | ||
3374 | }else if((en2==0 && en3==1) ) {// 12-3, 13-2, 23-1 | |
3375 | Float_t gFact=1; | |
3376 | ||
3377 | Bool_t fill2=kFALSE, fill3=kFALSE, fill4=kFALSE; | |
3378 | SetFillBins3(fillIndex3, key1, key2, key3, ch1, ch2, ch3, 1, bin1, bin2, bin3, fill2, fill3, fill4); | |
3379 | ||
3380 | ||
3381 | if(fill2){ | |
3382 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[1].fExplicit3->Fill(q3, gFact);// 12 | |
3383 | if((qinv12>=fNormQcutLow[normBin12]) && (qinv13>=fNormQcutLow[normBin13]) && (qinv23>=fNormQcutLow[normBin23])) { | |
3384 | if((qinv12<fNormQcutHigh[normBin12]) && (qinv13<fNormQcutHigh[normBin13]) && (qinv23<fNormQcutHigh[normBin23])) { | |
3385 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[1].fNormEx3->Fill(0.); | |
3386 | } | |
3387 | } | |
3388 | } | |
3389 | if(fill3){ | |
3390 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[2].fExplicit3->Fill(q3, gFact);// 12 | |
3391 | if((qinv12>=fNormQcutLow[normBin12]) && (qinv13>=fNormQcutLow[normBin13]) && (qinv23>=fNormQcutLow[normBin23])) { | |
3392 | if((qinv12<fNormQcutHigh[normBin12]) && (qinv13<fNormQcutHigh[normBin13]) && (qinv23<fNormQcutHigh[normBin23])) { | |
3393 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[2].fNormEx3->Fill(0.); | |
3394 | } | |
3395 | } | |
3396 | } | |
3397 | if(fill4){ | |
3398 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[3].fExplicit3->Fill(q3, gFact);// 12 | |
3399 | if((qinv12>=fNormQcutLow[normBin12]) && (qinv13>=fNormQcutLow[normBin13]) && (qinv23>=fNormQcutLow[normBin23])) { | |
3400 | if((qinv12<fNormQcutHigh[normBin12]) && (qinv13<fNormQcutHigh[normBin13]) && (qinv23<fNormQcutHigh[normBin23])) { | |
3401 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[3].fNormEx3->Fill(0.); | |
3402 | } | |
3403 | } | |
3404 | } | |
3405 | ||
3406 | }else if(en2==1 && en3==2){// all uncorrelated events | |
3407 | SetFillBins3(fillIndex3, key1, key2, key3, ch1, ch2, ch3, 3, bin1, bin2, bin3, fDummyB, fDummyB, fDummyB); | |
3408 | ||
3409 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[4].fExplicit3->Fill(q3); | |
3410 | if((qinv12>=fNormQcutLow[normBin12]) && (qinv13>=fNormQcutLow[normBin13]) && (qinv23>=fNormQcutLow[normBin23])) { | |
3411 | if((qinv12<fNormQcutHigh[normBin12]) && (qinv13<fNormQcutHigh[normBin13]) && (qinv23<fNormQcutHigh[normBin23])) { | |
3412 | Charge1[bin1].Charge2[bin2].Charge3[bin3].SC[fillIndex3].MB[fMbin].EDB[fEDbin].ThreePT[4].fNormEx3->Fill(0.); | |
3413 | } | |
3414 | } | |
3415 | Short_t qCutBin12 = SetQcutBin(fillIndex12); | |
3416 | Short_t qCutBin13 = SetQcutBin(fillIndex13); | |
3417 | Short_t qCutBin23 = SetQcutBin(fillIndex23); | |
3418 | ||
3419 | if( (qinv12 < fQcut[qCutBin12]) || (qinv13 < fQcut[qCutBin13]) || (qinv23 < fQcut[qCutBin23])){ | |
3420 | ||
3421 | Int_t nUnderCut=0; | |
3422 | if(qinv12<fQcut[qCutBin12]) nUnderCut++; | |
3423 | if(qinv13<fQcut[qCutBin13]) nUnderCut++; | |
3424 | if(qinv23<fQcut[qCutBin23]) nUnderCut++; | |
3425 | ||
3426 | } | |
3427 | ||
3428 | }else {} | |
3429 | ||
3430 | ||
3431 | }// 3rd particle | |
3432 | }// 3rd event | |
3433 | ||
3434 | }// 2nd particle | |
3435 | }// 2nd event | |
3436 | ||
3437 | }// 1st particle | |
3438 | ||
3439 | ||
3440 | ||
3441 | ||
3442 | }// End of PdensityExplicit | |
3443 | ||
3444 | ||
3445 | ||
3446 | ||
3447 | // Post output data. | |
3448 | PostData(1, fOutputList); | |
3449 | ||
3450 | } | |
3451 | //________________________________________________________________________ | |
3452 | void AliChaoticity::Terminate(Option_t *) | |
3453 | { | |
3454 | // Called once at the end of the query | |
3455 | ||
3456 | cout<<"Done"<<endl; | |
3457 | ||
3458 | } | |
3459 | //________________________________________________________________________ | |
3460 | Bool_t AliChaoticity::AcceptPair(AliChaoticityTrackStruct first, AliChaoticityTrackStruct second) | |
3461 | { | |
e29e02c1 | 3462 | |
3463 | if(fabs(first.fEta-second.fEta) > fMinSepPairEta) return kTRUE; | |
cd12341d | 3464 | |
3465 | // propagate through B field to r=1m | |
5e3e77d6 | 3466 | Float_t phi1 = first.fPhi - asin(first.fCharge*(0.1*fBfield)*0.15/first.fPt);// 0.15 for D=1m |
cd12341d | 3467 | if(phi1 > 2*PI) phi1 -= 2*PI; |
3468 | if(phi1 < 0) phi1 += 2*PI; | |
5e3e77d6 | 3469 | Float_t phi2 = second.fPhi - asin(second.fCharge*(0.1*fBfield)*0.15/second.fPt);// 0.15 for D=1m |
cd12341d | 3470 | if(phi2 > 2*PI) phi2 -= 2*PI; |
3471 | if(phi2 < 0) phi2 += 2*PI; | |
3472 | ||
3473 | Float_t deltaphi = phi1 - phi2; | |
3474 | if(deltaphi > PI) deltaphi -= 2*PI; | |
3475 | if(deltaphi < -PI) deltaphi += 2*PI; | |
3476 | deltaphi = fabs(deltaphi); | |
3477 | ||
e29e02c1 | 3478 | if(deltaphi < fMinSepPairPhi) return kFALSE;// Min Separation |
3479 | ||
cd12341d | 3480 | |
3481 | // propagate through B field to r=1.6m | |
5e3e77d6 | 3482 | phi1 = first.fPhi - asin(first.fCharge*(0.1*fBfield)*0.24/first.fPt);// mine. 0.24 for D=1.6m |
cd12341d | 3483 | if(phi1 > 2*PI) phi1 -= 2*PI; |
3484 | if(phi1 < 0) phi1 += 2*PI; | |
5e3e77d6 | 3485 | phi2 = second.fPhi - asin(second.fCharge*(0.1*fBfield)*0.24/second.fPt);// mine. 0.24 for D=1.6m |
cd12341d | 3486 | if(phi2 > 2*PI) phi2 -= 2*PI; |
3487 | if(phi2 < 0) phi2 += 2*PI; | |
3488 | ||
3489 | deltaphi = phi1 - phi2; | |
3490 | if(deltaphi > PI) deltaphi -= 2*PI; | |
3491 | if(deltaphi < -PI) deltaphi += 2*PI; | |
3492 | deltaphi = fabs(deltaphi); | |
3493 | ||
e29e02c1 | 3494 | if(deltaphi < fMinSepPairPhi) return kFALSE;// Min Separation |
3495 | ||
3496 | ||
cd12341d | 3497 | |
3498 | // | |
46b217b3 | 3499 | |
cd12341d | 3500 | Int_t ncl1 = first.fClusterMap.GetNbits(); |
3501 | Int_t ncl2 = second.fClusterMap.GetNbits(); | |
3502 | Int_t sumCls = 0; Int_t sumSha = 0; Int_t sumQ = 0; | |
3503 | Double_t shfrac = 0; Double_t qfactor = 0; | |
3504 | for(Int_t imap = 0; imap < ncl1 && imap < ncl2; imap++) { | |
3505 | if (first.fClusterMap.TestBitNumber(imap) && second.fClusterMap.TestBitNumber(imap)) {// Both clusters | |
3506 | if (first.fSharedMap.TestBitNumber(imap) && second.fSharedMap.TestBitNumber(imap)) { // Shared | |
3507 | sumQ++; | |
3508 | sumCls+=2; | |
3509 | sumSha+=2;} | |
3510 | else {sumQ--; sumCls+=2;} | |
3511 | } | |
3512 | else if (first.fClusterMap.TestBitNumber(imap) || second.fClusterMap.TestBitNumber(imap)) {// Non shared | |
3513 | sumQ++; | |
3514 | sumCls++;} | |
3515 | } | |
3516 | if (sumCls>0) { | |
3517 | qfactor = sumQ*1.0/sumCls; | |
3518 | shfrac = sumSha*1.0/sumCls; | |
3519 | } | |
e29e02c1 | 3520 | |
cd12341d | 3521 | if(qfactor > fShareQuality || shfrac > fShareFraction) return kFALSE; |
46b217b3 | 3522 | |
cd12341d | 3523 | |
3524 | return kTRUE; | |
5e3e77d6 | 3525 | |
cd12341d | 3526 | |
3527 | } | |
3528 | //________________________________________________________________________ | |
3529 | Float_t AliChaoticity::GamovFactor(Int_t chargeBin1, Int_t chargeBin2, Float_t qinv) | |
3530 | { | |
3531 | Float_t arg = G_Coeff/qinv; | |
3532 | ||
3533 | if(chargeBin1==chargeBin2) return (exp(arg)-1)/(arg); | |
3534 | else {return (exp(-arg)-1)/(-arg);} | |
3535 | ||
3536 | } | |
3537 | //________________________________________________________________________ | |
3538 | void AliChaoticity::Shuffle(Int_t *iarr, Int_t i1, Int_t i2) | |
3539 | { | |
3540 | Int_t j, k; | |
3541 | Int_t a = i2 - i1; | |
3542 | for (Int_t i = i1; i < i2+1; i++) { | |
3543 | j = (Int_t) (gRandom->Rndm() * a); | |
3544 | k = iarr[j]; | |
3545 | iarr[j] = iarr[i]; | |
3546 | iarr[i] = k; | |
3547 | } | |
3548 | } | |
3549 | //________________________________________________________________________ | |
3550 | Short_t AliChaoticity::FillIndex2part(Short_t key){ | |
3551 | ||
3552 | if(key==2) return 0;// pi-pi | |
3553 | else if(key==11) return 1;// pi-k | |
3554 | else if(key==101) return 2;// pi-p | |
3555 | else if(key==20) return 3;// k-k | |
3556 | else if(key==110) return 4;// k-p | |
3557 | else return 5;// p-p | |
3558 | } | |
3559 | //________________________________________________________________________ | |
3560 | Short_t AliChaoticity::FillIndex3part(Short_t key){ | |
3561 | ||
3562 | if(key==3) return 0;// pi-pi-pi | |
3563 | else if(key==12) return 1;// pi-pi-k | |
3564 | else if(key==21) return 2;// k-k-pi | |
3565 | else if(key==102) return 3;// pi-pi-p | |
3566 | else if(key==201) return 4;// p-p-pi | |
3567 | else if(key==111) return 5;// pi-k-p | |
3568 | else if(key==30) return 6;// k-k-k | |
3569 | else if(key==120) return 7;// k-k-p | |
3570 | else if(key==210) return 8;// p-p-k | |
3571 | else return 9;// p-p-p | |
3572 | ||
3573 | } | |
3574 | //________________________________________________________________________ | |
3575 | Short_t AliChaoticity::SetQcutBin(Short_t fi){// fi=FillIndex | |
3576 | if(fi <= 2) return 0; | |
3577 | else if(fi==3) return 1; | |
3578 | else return 2; | |
3579 | } | |
3580 | //________________________________________________________________________ | |
3581 | Short_t AliChaoticity::SetNormBin(Short_t fi){// fi=FillIndex | |
3582 | if(fi==0) return 0; | |
3583 | else if(fi <= 2) return 1; | |
3584 | else return 2; | |
3585 | } | |
3586 | //________________________________________________________________________ | |
3587 | void AliChaoticity::SetFillBins2(Short_t fi, Short_t key1, Short_t key2, Int_t c1, Int_t c2, Int_t &b1, Int_t &b2){ | |
3588 | ||
3589 | if(fi==0 || fi==3 || fi==5){// Identical species | |
3590 | if((c1+c2)==1) {b1=0; b2=1;}// Re-assign to merge degenerate histos | |
3591 | else {b1=c1; b2=c2;} | |
3592 | }else {// Mixed species | |
3593 | if(key1 < key2) { b1=c1; b2=c2;} | |
3594 | else {b1=c2; b2=c1;} | |
3595 | } | |
3596 | ||
3597 | } | |
3598 | //________________________________________________________________________ | |
3599 | 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){ | |
3600 | ||
3601 | ||
3602 | // seSS, seSK, SE_keysum only used to determine which terms to fill (only used for terms 2-4) | |
df2ce8e1 | 3603 | // part only matters for terms 2-4 |
cd12341d | 3604 | Bool_t seSS=kFALSE; |
3605 | Bool_t seSK=kFALSE; | |
3606 | Short_t seKeySum=0;// only used for pi-k-p case | |
3607 | if(part==1) {// default case (irrelevant for term 1 and term 5) | |
3608 | if(c1==c2) seSS=kTRUE; | |
3609 | if(key1==key2) seSK=kTRUE; | |
3610 | seKeySum = key1+key2; | |
3611 | } | |
3612 | if(part==2){ | |
3613 | if(c1==c3) seSS=kTRUE; | |
3614 | if(key1==key3) seSK=kTRUE; | |
3615 | seKeySum = key1+key3; | |
3616 | } | |
3617 | ||
3618 | ||
3619 | // fill2, fill3, fill4 are only used for Cumulant Terms 2,3,4 | |
3620 | ||
3621 | if(fi==0 || fi==6 || fi==9){// Identical species | |
3622 | if( (c1+c2+c3)==1) { | |
3623 | b1=0; b2=0; b3=1;// Re-assign to merge degenerate histos | |
3624 | // | |
3625 | if(seSS) fill2=kTRUE; | |
3626 | else {fill3=kTRUE; fill4=kTRUE;} | |
3627 | // | |
3628 | }else if( (c1+c2+c3)==2) { | |
3629 | b1=0; b2=1; b3=1; | |
3630 | // | |
3631 | if(!seSS) {fill2=kTRUE; fill3=kTRUE;} | |
3632 | else fill4=kTRUE; | |
3633 | // | |
3634 | }else { | |
3635 | b1=c1; b2=c2; b3=c3; | |
3636 | fill2=kTRUE; fill3=kTRUE; fill4=kTRUE; | |
3637 | } | |
3638 | }else if(fi != 5){// all the rest except pi-k-p | |
3639 | if(key1==key2){ | |
3640 | b3=c3; | |
3641 | if( (c1+c2)==1) {b1=0; b2=1;} | |
3642 | else {b1=c1; b2=c2;} | |
3643 | }else if(key1==key3){ | |
3644 | b3=c2; | |
3645 | if( (c1+c3)==1) {b1=0; b2=1;} | |
3646 | else {b1=c1; b2=c3;} | |
3647 | }else {// Key2==Key3 | |
3648 | b3=c1; | |
3649 | if( (c2+c3)==1) {b1=0; b2=1;} | |
3650 | else {b1=c2; b2=c3;} | |
3651 | } | |
3652 | ////////////////////////////// | |
3653 | if(seSK) fill2=kTRUE;// Same keys from Same Event | |
3654 | else {// Different keys from Same Event | |
3655 | if( (c1+c2+c3)==1) { | |
3656 | if(b3==0) { | |
3657 | if(seSS) fill3=kTRUE; | |
3658 | else fill4=kTRUE; | |
3659 | }else{fill3=kTRUE; fill4=kTRUE;}// b3=1 so fill both | |
3660 | }else if( (c1+c2+c3)==2) { | |
3661 | if(b3==1) { | |
3662 | if(seSS) fill4=kTRUE; | |
3663 | else fill3=kTRUE; | |
3664 | }else{fill3=kTRUE; fill4=kTRUE;}// b3=0 so fill both | |
3665 | }else{fill3=kTRUE; fill4=kTRUE;}// all same charge so fill both | |
3666 | } | |
3667 | ///////////////////////////// | |
3668 | }else {// pi-k-p (no charge ordering applies since all are unique) | |
3669 | if(key1==1){ | |
3670 | if(key2==10) {b1=c1; b2=c2; b3=c3;}// pi-k-p | |
3671 | else {b1=c1; b2=c3; b3=c2;}// pi-p-k | |
3672 | }else if(key1==10){ | |
3673 | if(key2==1) {b1=c2; b2=c1; b3=c3;}// k-pi-p | |
3674 | else {b1=c3; b2=c1; b3=c2;}// k-p-pi | |
3675 | }else {// key1==100 | |
3676 | if(key2==1) {b1=c2; b2=c3; b3=c1;}// p-pi-k | |
3677 | else {b1=c3; b2=c2; b3=c1;}// p-k-pi | |
3678 | } | |
3679 | //////////////////////////////////// | |
3680 | if(seKeySum==11) fill2=kTRUE; | |
3681 | else if(seKeySum==101) fill3=kTRUE; | |
3682 | else fill4=kTRUE; | |
3683 | //////////////////////////////////// | |
3684 | } | |
3685 | ||
3686 | } | |
3687 | //________________________________________________________________________ | |
3688 | 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){ | |
3689 | ||
3690 | // for terms 2-4: start by setting q12(part 1) or q13(part 2) | |
3691 | if(fi==0 || fi==6 || fi==9){// Identical species | |
3692 | if( (c1+c2+c3)==1) {// fQ=ss, sQ=os, tQ=os | |
3693 | if(term==1 || term==5){ | |
3694 | if(c1==c2) {fQ=q12; sQ=q13; tQ=q23;} | |
3695 | else if(c1==c3) {fQ=q13; sQ=q12; tQ=q23;} | |
3696 | else {fQ=q23; sQ=q12; tQ=q13;} | |
3697 | }else if(term==2 && part==1){ | |
3698 | fQ=q12; sQ=q13; tQ=q23; | |
3699 | }else if(term==2 && part==2){ | |
3700 | fQ=q13; sQ=q12; tQ=q23; | |
3701 | }else if(term==3 && part==1){ | |
3702 | sQ=q12; | |
3703 | if(c1==c3) {fQ=q13; tQ=q23;} | |
3704 | else {fQ=q23; tQ=q13;} | |
3705 | }else if(term==3 && part==2){ | |
3706 | sQ=q13; | |
3707 | if(c1==c2) {fQ=q12; tQ=q23;} | |
3708 | else {fQ=q23; tQ=q12;} | |
3709 | }else if(term==4 && part==1){ | |
3710 | tQ=q12; | |
3711 | if(c1==c3) {fQ=q13; sQ=q23;} | |
3712 | else {fQ=q23; sQ=q13;} | |
3713 | }else if(term==4 && part==2){ | |
3714 | tQ=q13; | |
3715 | if(c1==c2) {fQ=q12; sQ=q23;} | |
3716 | else {fQ=q23; sQ=q12;} | |
3717 | }else cout<<"problem!!!!!!!!!!!!!"<<endl; | |
3718 | }else if( (c1+c2+c3)==2) {// fQ=os, sQ=os, tQ=ss | |
3719 | if(term==1 || term==5){ | |
3720 | if(c1==c2) {tQ=q12; sQ=q13; fQ=q23;} | |
3721 | else if(c1==c3) {tQ=q13; sQ=q12; fQ=q23;} | |
3722 | else {tQ=q23; sQ=q12; fQ=q13;} | |
3723 | }else if(term==2 && part==1){ | |
3724 | fQ=q12; | |
3725 | if(c1==c3) {tQ=q13; sQ=q23;} | |
3726 | else {tQ=q23; sQ=q13;} | |
3727 | }else if(term==2 && part==2){ | |
3728 | fQ=q13; | |
3729 | if(c1==c2) {tQ=q12; sQ=q23;} | |
3730 | else {tQ=q23; sQ=q12;} | |
3731 | }else if(term==3 && part==1){ | |
3732 | sQ=q12; | |
3733 | if(c1==c3) {tQ=q13; fQ=q23;} | |
3734 | else {tQ=q23; fQ=q13;} | |
3735 | }else if(term==3 && part==2){ | |
3736 | sQ=q13; | |
3737 | if(c1==c2) {tQ=q12; fQ=q23;} | |
3738 | else {tQ=q23; fQ=q12;} | |
3739 | }else if(term==4 && part==1){ | |
3740 | tQ=q12; sQ=q13; fQ=q23; | |
3741 | }else if(term==4 && part==2){ | |
3742 | tQ=q13; sQ=q12; fQ=q23; | |
3743 | }else cout<<"problem!!!!!!!!!!!!!"<<endl; | |
3744 | }else {// fQ=ss, sQ=ss, tQ=ss | |
3745 | if(term==1 || term==5) {fQ=q12; sQ=q13; tQ=q23;} | |
3746 | else if(term==2 && part==1) {fQ=q12; sQ=q13; tQ=q23;} | |
3747 | else if(term==2 && part==2) {fQ=q13; sQ=q12; tQ=q23;} | |
3748 | else if(term==3 && part==1) {sQ=q12; fQ=q13; tQ=q23;} | |
3749 | else if(term==3 && part==2) {sQ=q13; fQ=q12; tQ=q23;} | |
3750 | else if(term==4 && part==1) {tQ=q12; fQ=q13; sQ=q23;} | |
3751 | else if(term==4 && part==2) {tQ=q13; fQ=q12; sQ=q23;} | |
3752 | } | |
3753 | }else if(fi != 5){// all the rest except pi-k-p | |
3754 | if(key1==key2){ | |
3755 | fQ=q12; | |
3756 | if(c1==c2){ | |
3757 | // cases not explicity shown below are not possible | |
3758 | if(term==1 || term==5) {sQ=q13; tQ=q23;} | |
3759 | else if(term==2 && part==1) {sQ=q13; tQ=q23;} | |
3760 | else if(term==3 && part==2) {sQ=q13; tQ=q23;} | |
3761 | else if(term==4 && part==2) {tQ=q13; sQ=q23;} | |
3762 | else cout<<"problem!!!!!!!!!!!!!"<<endl; | |
3763 | }else if(c3==0){ | |
3764 | if(c1==c3) {sQ=q13; tQ=q23;} | |
3765 | else {sQ=q23; tQ=q13;} | |
3766 | }else {//c3==1 | |
3767 | if(c1==c3) {tQ=q13; sQ=q23;} | |
3768 | else {tQ=q23; sQ=q13;} | |
3769 | } | |
3770 | }else if(key1==key3){ | |
3771 | fQ=q13; | |
3772 | if(c1==c3){ | |
3773 | // cases not explicity shown below are not possible | |
3774 | if(term==1 || term==5) {sQ=q12; tQ=q23;} | |
3775 | else if(term==2 && part==2) {sQ=q12; tQ=q23;} | |
3776 | else if(term==3 && part==1) {sQ=q12; tQ=q23;} | |
3777 | else if(term==4 && part==1) {tQ=q12; sQ=q23;} | |
3778 | else cout<<"problem!!!!!!!!!!!!!!!!!!!!!!"<<endl; | |
3779 | }else if(c2==0){ | |
3780 | if(c1==c2) {sQ=q12; tQ=q23;} | |
3781 | else {sQ=q23; tQ=q12;} | |
3782 | }else {//c2==1 | |
3783 | if(c1==c2) {tQ=q12; sQ=q23;} | |
3784 | else {tQ=q23; sQ=q12;} | |
3785 | } | |
3786 | }else {// key2==key3 | |
3787 | fQ=q23; | |
3788 | if(c2==c3){ | |
3789 | // cases not explicity shown below are not possible | |
3790 | if(term==1 || term==5) {sQ=q12; tQ=q13;} | |
3791 | else if(term==3 && part==1) {sQ=q12; tQ=q13;} | |
3792 | else if(term==3 && part==2) {sQ=q13; tQ=q12;} | |
3793 | else if(term==4 && part==1) {tQ=q12; sQ=q13;} | |
3794 | else if(term==4 && part==2) {tQ=q13; sQ=q12;} | |
3795 | else cout<<"problem!!!!!!!!!!!!!!!!!!!!!!"<<endl; | |
3796 | }else if(c1==0){ | |
3797 | if(c1==c2) {sQ=q12; tQ=q13;} | |
3798 | else {sQ=q13; tQ=q12;} | |
3799 | }else {//c1==1 | |
3800 | if(c1==c2) {tQ=q12; sQ=q13;} | |
3801 | else {tQ=q13; sQ=q12;} | |
3802 | } | |
3803 | } | |
3804 | }else {// pi-k-p | |
3805 | if(key1==1){ | |
3806 | if(key2==10) {fQ=q12; sQ=q13; tQ=q23;}// pi-k-p | |
3807 | else {fQ=q13; sQ=q12; tQ=q23;}// pi-p-k | |
3808 | }else if(key1==10){ | |
3809 | if(key2==1) {fQ=q12; sQ=q23; tQ=q13;}// k-pi-p | |
3810 | else {fQ=q13; sQ=q23; tQ=q12;}// k-p-pi | |
3811 | }else {// key1==100 | |
3812 | if(key2==1) {fQ=q23; sQ=q12; tQ=q13;}// p-pi-k | |
3813 | else {fQ=q23; sQ=q13; tQ=q12;}// p-k-pi | |
3814 | } | |
3815 | ||
3816 | } | |
3817 | ||
3818 | ||
3819 | } | |
3820 | //________________________________________________________________________ | |
3821 | Float_t AliChaoticity::GetQinv(Short_t fi, Float_t track1[], Float_t track2[]){ | |
3822 | ||
3823 | Float_t qinv=1.0; | |
3824 | ||
3825 | if(fi==0 || fi==3 || fi==5){// identical masses | |
3826 | 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)); | |
3827 | }else{// different masses | |
3828 | Float_t px = track1[1] + track2[1]; | |
3829 | Float_t py = track1[2] + track2[2]; | |
3830 | Float_t pz = track1[3] + track2[3]; | |
3831 | Float_t pSquared = pow(track1[0]+track2[0],2) - px*px - py*py - pz*pz; | |
3832 | Float_t deltaDOTsum = (track1[0]-track2[0])*(track1[0]+track2[0]); | |
3833 | deltaDOTsum -= (track1[1]-track2[1])*px + (track1[2]-track2[2])*py + (track1[3]-track2[3])*pz; | |
3834 | ||
3835 | qinv = pow( (track1[1]-track2[1]) - deltaDOTsum*px/(pSquared),2); | |
3836 | qinv += pow( (track1[2]-track2[2]) - deltaDOTsum*py/(pSquared),2); | |
3837 | qinv += pow( (track1[3]-track2[3]) - deltaDOTsum*pz/(pSquared),2); | |
3838 | qinv -= pow( (track1[0]-track2[0]) - deltaDOTsum*(track1[0]+track2[0])/(pSquared),2); | |
3839 | qinv = sqrt(qinv); | |
3840 | } | |
3841 | ||
3842 | return qinv; | |
3843 | ||
3844 | } | |
3845 | //________________________________________________________________________ | |
3846 | void AliChaoticity::GetQosl(Float_t track1[], Float_t track2[], Float_t& qout, Float_t& qside, Float_t& qlong){ | |
3847 | ||
3848 | Float_t p0 = track1[0] + track2[0]; | |
3849 | Float_t px = track1[1] + track2[1]; | |
3850 | Float_t py = track1[2] + track2[2]; | |
3851 | Float_t pz = track1[3] + track2[3]; | |
3852 | ||
3853 | Float_t mt = sqrt(p0*p0 - pz*pz); | |
3854 | Float_t pt = sqrt(px*px + py*py); | |
3855 | ||
3856 | Float_t v0 = track1[0] - track2[0]; | |
3857 | Float_t vx = track1[1] - track2[1]; | |
3858 | Float_t vy = track1[2] - track2[2]; | |
3859 | Float_t vz = track1[3] - track2[3]; | |
3860 | ||
3861 | qout = (px*vx + py*vy)/pt; | |
3862 | qside = (px*vy - py*vx)/pt; | |
3863 | qlong = (p0*vz - pz*v0)/mt; | |
3864 | } | |
3865 | //________________________________________________________________________ | |
654866df | 3866 | void AliChaoticity::SetWeightArrays(Bool_t legoCase, TH3F *histos[AliChaoticity::fKbinsT][AliChaoticity::fCentBins]){ |
3867 | ||
90814457 | 3868 | if(legoCase){ |
3869 | cout<<"LEGO call to SetWeightArrays"<<endl; | |
704f2481 | 3870 | |
654866df | 3871 | for(Int_t tKbin=0; tKbin<fKbinsT; tKbin++){ |
3872 | for(Int_t mb=0; mb<fCentBins; mb++){ | |
f5df8b1d | 3873 | fNormWeight[tKbin][mb] = (TH3F*)histos[tKbin][mb]->Clone(); |
3874 | fNormWeight[tKbin][mb]->SetDirectory(0); | |
90814457 | 3875 | } |
3876 | } | |
f5df8b1d | 3877 | |
90814457 | 3878 | }else{ |
3879 | ||
3880 | TFile *wFile = new TFile("WeightFile.root","READ"); | |
3881 | if(!wFile->IsOpen()) {cout<<"No Weight File!!!!!!!!!!"<<endl; return;} | |
3882 | else cout<<"Good Weight File Found!"<<endl; | |
3883 | ||
654866df | 3884 | for(Int_t tKbin=0; tKbin<fKbinsT; tKbin++){ |
3885 | for(Int_t mb=0; mb<fCentBins; mb++){ | |
f5df8b1d | 3886 | |
3887 | TString *name = new TString("Weight_Kt_"); | |
3888 | *name += tKbin; | |
3889 | name->Append("_Ky_0"); | |
3890 | name->Append("_M_"); | |
3891 | *name += mb; | |
3892 | name->Append("_ED_0"); | |
3893 | ||
f5df8b1d | 3894 | |
3895 | fNormWeight[tKbin][mb] = (TH3F*)wFile->Get(name->Data()); | |
3896 | fNormWeight[tKbin][mb]->SetDirectory(0); | |
3897 | ||
3898 | ||
f5df8b1d | 3899 | }//mb |
90814457 | 3900 | }//kt |
3901 | ||
3902 | wFile->Close(); | |
3903 | } | |
f5df8b1d | 3904 | |
5e3e77d6 | 3905 | cout<<"Done reading weight file"<<endl; |
cd12341d | 3906 | |
3907 | } | |
3908 | //________________________________________________________________________ | |
2f00662e | 3909 | void AliChaoticity::GetWeight(Float_t track1[], Float_t track2[], Float_t& wgt, Float_t& wgtErr){ |
cd12341d | 3910 | |
2f00662e | 3911 | Float_t kt=sqrt( pow(track1[1]+track2[1],2) + pow(track1[2]+track2[2],2))/2.; |
cd12341d | 3912 | // |
3913 | Float_t qOut=0,qSide=0,qLong=0; | |
3914 | GetQosl(track1, track2, qOut, qSide, qLong); | |
3915 | qOut = fabs(qOut); | |
3916 | qSide = fabs(qSide); | |
3917 | qLong = fabs(qLong); | |
3eebc801 | 3918 | Float_t wd=0, xd=0, yd=0, zd=0; |
3ee47b58 | 3919 | //Float_t qinvtemp=GetQinv(0,track1, track2); |
cd12341d | 3920 | // |
3921 | ||
2f00662e | 3922 | if(kt < fKmeanT[0]) {fKtIndexL=0; fKtIndexH=1;} |
3923 | else if(kt >= fKmeanT[fKbinsT-1]) {fKtIndexL=fKbinsT-2; fKtIndexH=fKbinsT-1;} | |
cd12341d | 3924 | else { |
654866df | 3925 | for(Int_t i=0; i<fKbinsT-1; i++){ |
f5df8b1d | 3926 | if((kt >= fKmeanT[i]) && (kt < fKmeanT[i+1])) {fKtIndexL=i; fKtIndexH=i+1; break;} |
cd12341d | 3927 | } |
3928 | } | |
2f00662e | 3929 | wd = (kt-fKmeanT[fKtIndexL])/(fKmeanT[fKtIndexH]-fKmeanT[fKtIndexL]); |
cd12341d | 3930 | // |
3931 | ///////// | |
3eebc801 | 3932 | if(qOut < fQmean[0]) {fQoIndexL=0; fQoIndexH=0; xd=0;} |
a05cda99 | 3933 | else if(qOut >= fQmean[kQbinsWeights-1]) {fQoIndexL=kQbinsWeights-1; fQoIndexH=kQbinsWeights-1; xd=1;} |
cd12341d | 3934 | else { |
3eebc801 | 3935 | for(Int_t i=0; i<kQbinsWeights-1; i++){ |
f5df8b1d | 3936 | if((qOut >= fQmean[i]) && (qOut < fQmean[i+1])) {fQoIndexL=i; fQoIndexH=i+1; break;} |
cd12341d | 3937 | } |
3eebc801 | 3938 | xd = (qOut-fQmean[fQoIndexL])/(fQmean[fQoIndexH]-fQmean[fQoIndexL]); |
cd12341d | 3939 | } |
3940 | // | |
3eebc801 | 3941 | if(qSide < fQmean[0]) {fQsIndexL=0; fQsIndexH=0; yd=0;} |
a05cda99 | 3942 | else if(qSide >= fQmean[kQbinsWeights-1]) {fQsIndexL=kQbinsWeights-1; fQsIndexH=kQbinsWeights-1; yd=1;} |
cd12341d | 3943 | else { |
3944 | for(Int_t i=0; i<kQbinsWeights-1; i++){ | |
f5df8b1d | 3945 | if((qSide >= fQmean[i]) && (qSide < fQmean[i+1])) {fQsIndexL=i; fQsIndexH=i+1; break;} |
cd12341d | 3946 | } |
3eebc801 | 3947 | yd = (qSide-fQmean[fQsIndexL])/(fQmean[fQsIndexH]-fQmean[fQsIndexL]); |
cd12341d | 3948 | } |
3949 | // | |
3eebc801 | 3950 | if(qLong < fQmean[0]) {fQlIndexL=0; fQlIndexH=0; zd=0;} |
a05cda99 | 3951 | else if(qLong >= fQmean[kQbinsWeights-1]) {fQlIndexL=kQbinsWeights-1; fQlIndexH=kQbinsWeights-1; zd=1;} |
cd12341d | 3952 | else { |
3953 | for(Int_t i=0; i<kQbinsWeights-1; i++){ | |
f5df8b1d | 3954 | if((qLong >= fQmean[i]) && (qLong < fQmean[i+1])) {fQlIndexL=i; fQlIndexH=i+1; break;} |
cd12341d | 3955 | } |
3eebc801 | 3956 | zd = (qLong-fQmean[fQlIndexL])/(fQmean[fQlIndexH]-fQmean[fQlIndexL]); |
cd12341d | 3957 | } |
3958 | // | |
3959 | ||
f5df8b1d | 3960 | |
3eebc801 | 3961 | //Float_t min = fNormWeight[fKtIndexL][fMbin]->GetBinContent(fQoIndexH+1,fQsIndexH+1,fQlIndexH+1); |
f5df8b1d | 3962 | Float_t minErr = fNormWeight[fKtIndexL][fMbin]->GetBinError(fQoIndexH+1,fQsIndexH+1,fQlIndexH+1); |
3eebc801 | 3963 | /* |
cd12341d | 3964 | Float_t deltaW=0; |
3965 | // kt | |
f5df8b1d | 3966 | deltaW += (fNormWeight[fKtIndexH][fMbin]->GetBinContent(fQoIndexH+1, fQsIndexH+1, fQlIndexH+1) - min)*(kt-fKmeanT[fKtIndexL])/((fKstepT[fKtIndexL]+fKstepT[fKtIndexH])/2.); |
cd12341d | 3967 | // Qo |
f5df8b1d | 3968 | deltaW += (fNormWeight[fKtIndexL][fMbin]->GetBinContent(fQoIndexL+1, fQsIndexH+1, fQlIndexH+1) - min)*(qOut-fQmean[fQoIndexL])/fQstepWeights; |
cd12341d | 3969 | // Qs |
f5df8b1d | 3970 | deltaW += (fNormWeight[fKtIndexL][fMbin]->GetBinContent(fQoIndexH+1, fQsIndexL+1, fQlIndexH+1) - min)*(qSide-fQmean[fQsIndexL])/fQstepWeights; |
cd12341d | 3971 | // Ql |
f5df8b1d | 3972 | deltaW += (fNormWeight[fKtIndexL][fMbin]->GetBinContent(fQoIndexH+1, fQsIndexH+1, fQlIndexL+1) - min)*(qLong-fQmean[fQlIndexL])/fQstepWeights; |
cd12341d | 3973 | // |
3974 | wgt = min + deltaW; | |
3eebc801 | 3975 | */ |
cd12341d | 3976 | |
3eebc801 | 3977 | |
3978 | // | |
3979 | // w interpolation (kt) | |
3980 | 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; | |
3981 | 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; | |
3982 | 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; | |
3983 | 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; | |
3984 | 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; | |
3985 | 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; | |
3986 | 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; | |
3987 | 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; | |
3988 | // x interpolation (qOut) | |
3989 | Float_t c00 = c000*(1-xd) + c100*xd; | |
3990 | Float_t c10 = c010*(1-xd) + c110*xd; | |
3991 | Float_t c01 = c001*(1-xd) + c101*xd; | |
3992 | Float_t c11 = c011*(1-xd) + c111*xd; | |
3993 | // y interpolation (qSide) | |
3994 | Float_t c0 = c00*(1-yd) + c10*yd; | |
3995 | Float_t c1 = c01*(1-yd) + c11*yd; | |
3996 | // z interpolation (qLong) | |
3997 | wgt = (c0*(1-zd) + c1*zd); | |
46b217b3 | 3998 | |
cd12341d | 3999 | //// |
4000 | ||
4001 | // Denominator errors negligible compared to numerator so do not waste cpu time below. | |
3eebc801 | 4002 | //Float_t deltaWErr=0; |
cd12341d | 4003 | // Kt |
4004 | /* | |
f5df8b1d | 4005 | deltaWErr += (fNormWeight[fKtIndexH][fMbin]->GetBinContent(fQoIndexH+1, fQsIndexH+1, fQlIndexH+1) - minErr)*(kt-fKmeanT[fKtIndexL])/((fKstepT[fKtIndexL]+fKstepT[fKtIndexH])/2.); |
cd12341d | 4006 | // Qo |
f5df8b1d | 4007 | deltaWErr += (fNormWeight[fKtIndexL][fMbin]->GetBinContent(fQoIndexL+1, fQsIndexH+1, fQlIndexH+1) - minErr)*(qOut-fQmean[fQoIndexL])/fQstepWeights; |
cd12341d | 4008 | // Qs |
f5df8b1d | 4009 | deltaWErr += (fNormWeight[fKtIndexL][fMbin]->GetBinContent(fQoIndexH+1, fQsIndexL+1, fQlIndexH+1) - minErr)*(qSide-fQmean[fQsIndexL])/fQstepWeights; |
cd12341d | 4010 | // Ql |
f5df8b1d | 4011 | deltaWErr += (fNormWeight[fKtIndexL][fMbin]->GetBinContent(fQoIndexH+1, fQsIndexH+1, fQlIndexL+1) - minErr)*(qLong-fQmean[fQlIndexL])/fQstepWeights; |
cd12341d | 4012 | */ |
3eebc801 | 4013 | wgtErr = minErr; |
cd12341d | 4014 | |
4015 | ||
cd12341d | 4016 | } |
4017 | //________________________________________________________________________ | |
6903e04b | 4018 | Float_t AliChaoticity::MCWeight(Int_t charge1, Int_t charge2, Int_t r, Int_t dampIndex, Float_t qinv, Float_t k12){ |
cd12341d | 4019 | |
05db4376 | 4020 | Float_t radius = Float_t(r)/0.19733;// convert to GeV (starts at 5 fm, was 3 fm) |
6903e04b | 4021 | Float_t r12=radius*(1-k12/2.0); |
dbcaf506 | 4022 | |
cd12341d | 4023 | Float_t myDamp = fDampStart + (fDampStep)*dampIndex; |
654866df | 4024 | Float_t coulCorr12 = FSICorrelationTherm2(charge1, charge2, qinv); |
cd12341d | 4025 | if(charge1==charge2){ |
6903e04b | 4026 | Float_t arg=qinv*r12; |
05db4376 | 4027 | Float_t EW = 1 + kappa3/(6.*pow(2.,1.5))*(8.*pow(arg,3) - 12.*arg); |
4028 | EW += kappa4/(24.*pow(2.,2))*(16.*pow(arg,4) -48.*pow(arg,2) + 12); | |
6903e04b | 4029 | return ((1-myDamp) + myDamp*(1 + exp(-pow(qinv*r12,2))*pow(EW,2))*coulCorr12); |
cd12341d | 4030 | }else { |
5e3e77d6 | 4031 | return ((1-myDamp) + myDamp*coulCorr12); |
cd12341d | 4032 | } |
4033 | ||
4034 | } | |
654866df | 4035 | //________________________________________________________________________ |
05db4376 | 4036 | 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 | 4037 | |
05db4376 | 4038 | Float_t radiusOut = Float_t(r)/0.19733;// convert to GeV (starts at 5 fm, was 3 fm) |
654866df | 4039 | Float_t radiusSide = radiusOut; |
4040 | Float_t radiusLong = radiusOut; | |
4041 | Float_t myDamp = fDampStart + (fDampStep)*dampIndex; | |
4042 | Float_t coulCorr12 = FSICorrelationTherm2(charge1, charge2, qinv); | |
4043 | if(charge1==charge2){ | |
4044 | return ((1-myDamp) + myDamp*(1 + exp(-pow(qo*radiusOut,2)) * exp(-pow(qs*radiusSide,2)) * exp(-pow(ql*radiusLong,2)))*coulCorr12); | |
4045 | }else { | |
4046 | return ((1-myDamp) + myDamp*coulCorr12); | |
4047 | } | |
4048 | ||
4049 | } | |
4050 | ||
cd12341d | 4051 | //________________________________________________________________________ |
6903e04b | 4052 | 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 | 4053 | if(term==5) return 1.0; |
5e3e77d6 | 4054 | |
6903e04b | 4055 | Float_t radius=fRMax; |
4056 | radius /= 0.19733; | |
4057 | Float_t r12=radius*(1-k12/2.0); | |
4058 | Float_t r13=radius*(1-k13/2.0); | |
4059 | Float_t r23=radius*(1-k23/2.0); | |
f9a5e67a | 4060 | //if(fMbin<=1) {} |
4061 | //else if(fMbin<=3) {radius = radius-1;} | |
4062 | //else if(fMbin<=5) {radius = radius-2;} | |
4063 | //else {radius = radius-3;} | |
4064 | ||
6903e04b | 4065 | |
cd12341d | 4066 | Float_t myDamp = fDampStart + (fDampStep)*dampIndex; |
4067 | Float_t fc = sqrt(myDamp); | |
b3316be6 | 4068 | |
5e3e77d6 | 4069 | if(SameCharge){// all three of the same charge |
90814457 | 4070 | Float_t coulCorr12 = FSICorrelationTherm2(+1,+1, q12);// K2 |
4071 | Float_t coulCorr13 = FSICorrelationTherm2(+1,+1, q13);// K2 | |
4072 | Float_t coulCorr23 = FSICorrelationTherm2(+1,+1, q23);// K2 | |
6903e04b | 4073 | Float_t arg12=q12*r12; |
4074 | Float_t arg13=q13*r13; | |
4075 | Float_t arg23=q23*r23; | |
05db4376 | 4076 | Float_t EW12 = 1 + kappa3/(6.*pow(2.,1.5))*(8.*pow(arg12,3) - 12.*arg12); |
4077 | EW12 += kappa4/(24.*pow(2.,2))*(16.*pow(arg12,4) -48.*pow(arg12,2) + 12); | |
4078 | Float_t EW13 = 1 + kappa3/(6.*pow(2.,1.5))*(8.*pow(arg13,3) - 12.*arg13); | |
4079 | EW13 += kappa4/(24.*pow(2.,2))*(16.*pow(arg13,4) -48.*pow(arg13,2) + 12); | |
4080 | Float_t EW23 = 1 + kappa3/(6.*pow(2.,1.5))*(8.*pow(arg23,3) - 12.*arg23); | |
4081 | EW23 += kappa4/(24.*pow(2.,2))*(16.*pow(arg23,4) -48.*pow(arg23,2) + 12); | |
5e3e77d6 | 4082 | if(term==1){ |
6903e04b | 4083 | 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); |
4084 | 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 | 4085 | Float_t w123 = pow(1-fc,3) + 3*fc*pow(1-fc,2); |
6903e04b | 4086 | w123 += pow(fc,2)*(1-fc)*(1+exp(-pow(q12*r12,2))*pow(EW12,2))*coulCorr12; |
4087 | w123 += pow(fc,2)*(1-fc)*(1+exp(-pow(q13*r13,2))*pow(EW13,2))*coulCorr13; | |
4088 | w123 += pow(fc,2)*(1-fc)*(1+exp(-pow(q23*r23,2))*pow(EW23,2))*coulCorr23; | |
baba9c2d | 4089 | w123 += pow(fc,3)*c3QS*coulCorr12*coulCorr13*coulCorr23; |
5e3e77d6 | 4090 | return w123; |
4091 | }else if(term==2){ | |
6903e04b | 4092 | return ((1-myDamp) + myDamp*(1 + exp(-pow(q12*r12,2))*pow(EW12,2))*coulCorr12); |
5e3e77d6 | 4093 | }else if(term==3){ |
6903e04b | 4094 | return ((1-myDamp) + myDamp*(1 + exp(-pow(q13*r13,2))*pow(EW13,2))*coulCorr13); |
5e3e77d6 | 4095 | }else if(term==4){ |
6903e04b | 4096 | return ((1-myDamp) + myDamp*(1 + exp(-pow(q23*r23,2))*pow(EW23,2))*coulCorr23); |
5e3e77d6 | 4097 | }else return 1.0; |
4098 | ||
4099 | }else{// mixed charge case pair 12 always treated as ss | |
90814457 | 4100 | Float_t coulCorr12 = FSICorrelationTherm2(+1,+1, q12);// K2 ss |
4101 | Float_t coulCorr13 = FSICorrelationTherm2(+1,-1, q13);// K2 os | |
4102 | Float_t coulCorr23 = FSICorrelationTherm2(+1,-1, q23);// K2 os | |
6903e04b | 4103 | Float_t arg12=q12*r12; |
05db4376 | 4104 | Float_t EW12 = 1 + kappa3/(6.*pow(2.,1.5))*(8.*pow(arg12,3) - 12.*arg12); |
4105 | EW12 += kappa4/(24.*pow(2.,2))*(16.*pow(arg12,4) -48.*pow(arg12,2) + 12); | |
5e3e77d6 | 4106 | if(term==1){ |
6903e04b | 4107 | Float_t c3QS = 1 + exp(-pow(q12*r12,2))*pow(EW12,2); |
5e3e77d6 | 4108 | Float_t w123 = pow(1-fc,3) + 3*fc*pow(1-fc,2); |
6903e04b | 4109 | w123 += pow(fc,2)*(1-fc)*(1+exp(-pow(q12*r12,2))*pow(EW12,2))*coulCorr12; |
5e3e77d6 | 4110 | w123 += pow(fc,2)*(1-fc)*coulCorr13; |
4111 | w123 += pow(fc,2)*(1-fc)*coulCorr23; | |
baba9c2d | 4112 | w123 += pow(fc,3)*c3QS*coulCorr12*coulCorr13*coulCorr23; |
5e3e77d6 | 4113 | return w123; |
4114 | }else if(term==2){ | |
6903e04b | 4115 | return ((1-myDamp) + myDamp*(1 + exp(-pow(q12*r12,2))*pow(EW12,2))*coulCorr12); |
5e3e77d6 | 4116 | }else if(term==3){ |
4117 | return ((1-myDamp) + myDamp*coulCorr13); | |
4118 | }else if(term==4){ | |
4119 | return ((1-myDamp) + myDamp*coulCorr23); | |
4120 | }else return 1.0; | |
4121 | } | |
4122 | ||
cd12341d | 4123 | } |
4124 | //________________________________________________________________________ | |
90814457 | 4125 | void AliChaoticity::SetMomResCorrections(Bool_t legoCase, TH2D *temp2D){ |
5e3e77d6 | 4126 | |
4127 | ||
4128 | if(legoCase){ | |
90814457 | 4129 | cout<<"LEGO call to SetMomResCorrections"<<endl; |
5e3e77d6 | 4130 | fMomResC2 = (TH2D*)temp2D->Clone(); |
5e3e77d6 | 4131 | fMomResC2->SetDirectory(0); |
5e3e77d6 | 4132 | }else { |
4133 | TFile *momResFile = new TFile("MomResFile.root","READ"); | |
4134 | if(!momResFile->IsOpen()) { | |
4135 | cout<<"No momentum resolution file found"<<endl; | |
4136 | AliFatal("No momentum resolution file found. Kill process."); | |
4137 | }else {cout<<"Good Momentum Resolution File Found!"<<endl;} | |
4138 | ||
4139 | TH2D *temp2D2 = (TH2D*)momResFile->Get("MomResHisto_pp"); | |
5e3e77d6 | 4140 | fMomResC2 = (TH2D*)temp2D2->Clone(); |
5e3e77d6 | 4141 | fMomResC2->SetDirectory(0); |
90814457 | 4142 | |
5e3e77d6 | 4143 | momResFile->Close(); |
4144 | } | |
cd12341d | 4145 | |
704f2481 | 4146 | // fMomResC2->GetBinContent(1,5) should be ~1.007 |
4147 | if(fMomResC2->GetBinContent(1,5) > 1.2) AliFatal("AliChaoticity: SetMomResCorrections Problem");// Additional Safety check | |
4148 | if(fMomResC2->GetBinContent(1,5) < 0.95) AliFatal("AliChaoticity: SetMomResCorrections Problem");// Additional Safety check | |
4149 | ||
4150 | for(Int_t bx=1; bx<=fMomResC2->GetNbinsX(); bx++){ | |
4151 | for(Int_t by=1; by<=fMomResC2->GetNbinsX(); by++){ | |
4152 | if(fMomResC2->GetBinContent(bx,by) > 1.5) fMomResC2->SetBinContent(bx,by, 1.5);// Maximum is ~1.02 | |
4153 | if(fMomResC2->GetBinContent(bx,by) < 0.95) fMomResC2->SetBinContent(bx,by, 0.95);// Minimum is ~0.98 | |
4154 | } | |
4155 | } | |
4156 | ||
5e3e77d6 | 4157 | cout<<"Done reading momentum resolution file"<<endl; |
4158 | } | |
4159 | //________________________________________________________________________ | |
baba9c2d | 4160 | void AliChaoticity::SetFSICorrelations(Bool_t legoCase, TH2D *temp2DTherm[2], TH3D *temp3Dos[6], TH3D *temp3Dss[6]){ |
5e3e77d6 | 4161 | // read in 2-particle and 3-particle FSI correlations = K2 & K3 |
4162 | // 2-particle input histo from file is binned in qinv. 3-particle in qinv of each pair | |
4163 | if(legoCase){ | |
c4980714 | 4164 | cout<<"LEGO call to SetFSICorrelations"<<endl; |
baba9c2d | 4165 | fFSI2SS = (TH2D*)temp2DTherm[0]->Clone(); |
4166 | fFSI2OS = (TH2D*)temp2DTherm[1]->Clone(); | |
5e3e77d6 | 4167 | // |
baba9c2d | 4168 | fFSI2SS->SetDirectory(0); |
4169 | fFSI2OS->SetDirectory(0); | |
90814457 | 4170 | |
4171 | for(Int_t CB=0; CB<6; CB++) { | |
4172 | fFSIOmega0OS[CB] = (TH3D*)temp3Dos[CB]->Clone(); | |
4173 | fFSIOmega0SS[CB] = (TH3D*)temp3Dss[CB]->Clone(); | |
4174 | // | |
4175 | fFSIOmega0OS[CB]->SetDirectory(0); | |
4176 | fFSIOmega0SS[CB]->SetDirectory(0); | |
4177 | } | |
5e3e77d6 | 4178 | }else { |
c4980714 | 4179 | cout<<"non LEGO call to SetFSICorrelations"<<endl; |
5e3e77d6 | 4180 | TFile *fsifile = new TFile("KFile.root","READ"); |
4181 | if(!fsifile->IsOpen()) { | |
4182 | cout<<"No FSI file found"<<endl; | |
4183 | AliFatal("No FSI file found. Kill process."); | |
4184 | }else {cout<<"Good FSI File Found!"<<endl;} | |
4185 | ||
90814457 | 4186 | TH2D *temphisto2ThermSS = (TH2D*)fsifile->Get("K2ssT"); |
4187 | TH2D *temphisto2ThermOS = (TH2D*)fsifile->Get("K2osT"); | |
4188 | TH3D *temphisto3OS[6]; | |
ae9b34d1 | 4189 | TH3D *temphisto3SS[6]; |
4190 | for(Int_t CB=0; CB<6; CB++) { | |
90814457 | 4191 | TString *nameK3SS = new TString("K3ss_"); |
4192 | *nameK3SS += CB; | |
4193 | temphisto3SS[CB] = (TH3D*)fsifile->Get(nameK3SS->Data()); | |
4194 | // | |
4195 | TString *nameK3OS = new TString("K3os_"); | |
4196 | *nameK3OS += CB; | |
4197 | temphisto3OS[CB] = (TH3D*)fsifile->Get(nameK3OS->Data()); | |
ae9b34d1 | 4198 | } |
4199 | ||
baba9c2d | 4200 | fFSI2SS = (TH2D*)temphisto2ThermSS->Clone(); |
4201 | fFSI2OS = (TH2D*)temphisto2ThermOS->Clone(); | |
4202 | fFSI2SS->SetDirectory(0); | |
4203 | fFSI2OS->SetDirectory(0); | |
4204 | ||
90814457 | 4205 | for(Int_t CB=0; CB<6; CB++) { |
4206 | fFSIOmega0SS[CB] = (TH3D*)temphisto3SS[CB]->Clone(); | |
4207 | fFSIOmega0OS[CB] = (TH3D*)temphisto3OS[CB]->Clone(); | |
4208 | fFSIOmega0SS[CB]->SetDirectory(0); | |
4209 | fFSIOmega0OS[CB]->SetDirectory(0); | |
4210 | } | |
4211 | // | |
4212 | ||
5e3e77d6 | 4213 | fsifile->Close(); |
cd12341d | 4214 | } |
baba9c2d | 4215 | |
4216 | // fFSI2SS->GetBinContent(1,2) should be ~0.32 | |
4217 | if(fFSI2SS->GetBinContent(1,2) > 1.0) AliFatal("AliChaoticity: SetFSICorrelations Problem");// Additional Safety check | |
4218 | if(fFSI2SS->GetBinContent(1,2) < 0.1) AliFatal("AliChaoticity: SetFSICorrelations Problem");// Additional Safety check | |
4219 | ||
4220 | for(Int_t ii=1; ii<=fFSI2SS->GetNbinsX(); ii++){ | |
4221 | for(Int_t jj=1; jj<=fFSI2SS->GetNbinsY(); jj++){ | |
4222 | if(fFSI2SS->GetBinContent(ii,jj) > 1.0) fFSI2SS->SetBinContent(ii,jj, 1.0); | |
4223 | if(fFSI2OS->GetBinContent(ii,jj) > 10.0) fFSI2OS->SetBinContent(ii,jj, 10.0); | |
704f2481 | 4224 | // |
baba9c2d | 4225 | if(fFSI2SS->GetBinContent(ii,jj) < 0.05) fFSI2SS->SetBinContent(ii,jj, 0.05); |
4226 | if(fFSI2OS->GetBinContent(ii,jj) < 0.9) fFSI2OS->SetBinContent(ii,jj, 0.9); | |
704f2481 | 4227 | } |
4228 | } | |
4229 | ||
5e3e77d6 | 4230 | cout<<"Done reading FSI file"<<endl; |
cd12341d | 4231 | } |
4232 | //________________________________________________________________________ | |
90814457 | 4233 | Float_t AliChaoticity::FSICorrelationTherm2(Int_t charge1, Int_t charge2, Float_t qinv){ |
4234 | // returns 2-particle Coulomb correlations = K2 | |
baba9c2d | 4235 | Int_t qbinL = fFSI2SS->GetYaxis()->FindBin(qinv-fFSI2SS->GetYaxis()->GetBinWidth(1)/2.); |
5e3e77d6 | 4236 | Int_t qbinH = qbinL+1; |
4237 | if(qbinL <= 0) return 1.0; | |
baba9c2d | 4238 | if(qbinH > fFSI2SS->GetNbinsY()) return 1.0; |
5e3e77d6 | 4239 | |
4240 | Float_t slope=0; | |
4241 | if(charge1==charge2){ | |
baba9c2d | 4242 | slope = fFSI2SS->GetBinContent(fFSIbin+1, qbinL) - fFSI2SS->GetBinContent(fFSIbin+1, qbinH); |
4243 | slope /= fFSI2SS->GetYaxis()->GetBinCenter(qbinL) - fFSI2SS->GetYaxis()->GetBinCenter(qbinH); | |
4244 | return (slope*(qinv - fFSI2SS->GetYaxis()->GetBinCenter(qbinL)) + fFSI2SS->GetBinContent(fFSIbin+1, qbinL)); | |
5e3e77d6 | 4245 | }else { |
baba9c2d | 4246 | slope = fFSI2OS->GetBinContent(fFSIbin+1, qbinL) - fFSI2OS->GetBinContent(fFSIbin+1, qbinH); |
4247 | slope /= fFSI2OS->GetYaxis()->GetBinCenter(qbinL) - fFSI2OS->GetYaxis()->GetBinCenter(qbinH); | |
4248 | return (slope*(qinv - fFSI2OS->GetYaxis()->GetBinCenter(qbinL)) + fFSI2OS->GetBinContent(fFSIbin+1, qbinL)); | |
cd12341d | 4249 | } |
4250 | } | |
4251 | //________________________________________________________________________ | |
5e3e77d6 | 4252 | Double_t AliChaoticity::FSICorrelationOmega0(Bool_t SameCharge, Double_t Q12, Double_t Q13, Double_t Q23){ |
5e3e77d6 | 4253 | // returns 3d 3-particle Coulomb Correlation = K3 |
ae9b34d1 | 4254 | Int_t Q12bin = fFSIOmega0SS[fFSIbin]->GetXaxis()->FindBin(Q12); |
4255 | Int_t Q13bin = fFSIOmega0SS[fFSIbin]->GetZaxis()->FindBin(Q13); | |
4256 | Int_t Q23bin = fFSIOmega0SS[fFSIbin]->GetYaxis()->FindBin(Q23); | |
baba9c2d | 4257 | Int_t index12L = int(fabs(Q12 - fFSI2SS->GetYaxis()->GetBinWidth(1)/2.)/(fFSI2SS->GetYaxis()->GetBinWidth(1))); |
0e58bc53 | 4258 | Int_t index12H = index12L+1; |
baba9c2d | 4259 | Int_t index13L = int(fabs(Q13 - fFSI2SS->GetYaxis()->GetBinWidth(1)/2.)/(fFSI2SS->GetYaxis()->GetBinWidth(1))); |
0e58bc53 | 4260 | Int_t index13H = index13L+1; |
baba9c2d | 4261 | Int_t index23L = int(fabs(Q23 - fFSI2SS->GetYaxis()->GetBinWidth(1)/2.)/(fFSI2SS->GetYaxis()->GetBinWidth(1))); |
0e58bc53 | 4262 | Int_t index23H = index23L+1; |
4263 | ||
5e3e77d6 | 4264 | if(SameCharge){ |
ae9b34d1 | 4265 | if(fFSIOmega0SS[fFSIbin]->GetBinContent(Q12bin, Q23bin, Q13bin) <=0) return 1.0; |
0e58bc53 | 4266 | Double_t base = fFSIOmega0SS[fFSIbin]->GetBinContent(index12L+1, index23L+1, index13L+1); |
4267 | Double_t InterPolated = 0; | |
4268 | Double_t slope12 = fFSIOmega0SS[fFSIbin]->GetBinContent(index12H+1, index23L+1, index13L+1); | |
4269 | slope12 -= base; | |
4270 | slope12 /= fFSIOmega0SS[fFSIbin]->GetXaxis()->GetBinWidth(1); | |
4271 | InterPolated += slope12*fabs(Q12 - fFSIOmega0SS[fFSIbin]->GetXaxis()->GetBinCenter(index12L+1)); | |
4272 | Double_t slope23 = fFSIOmega0SS[fFSIbin]->GetBinContent(index12L+1, index23H+1, index13L+1); | |
4273 | slope23 -= base; | |
4274 | slope23 /= fFSIOmega0SS[fFSIbin]->GetYaxis()->GetBinWidth(1); | |
4275 | InterPolated += slope23*fabs(Q23 - fFSIOmega0SS[fFSIbin]->GetYaxis()->GetBinCenter(index23L+1)); | |
4276 | Double_t slope13 = fFSIOmega0SS[fFSIbin]->GetBinContent(index12L+1, index23L+1, index13H+1); | |
4277 | slope13 -= base; | |
4278 | slope13 /= fFSIOmega0SS[fFSIbin]->GetZaxis()->GetBinWidth(1); | |
4279 | InterPolated += slope13*fabs(Q13 - fFSIOmega0SS[fFSIbin]->GetZaxis()->GetBinCenter(index13L+1)); | |
4280 | if( (base+InterPolated) <= 0) return 1.0; | |
4281 | return (base+InterPolated); | |
4282 | ||
4283 | }else{// mixed charge. Q12 is always designated as the same-charge pair | |
90814457 | 4284 | if(fFSIOmega0OS[fFSIbin]->GetBinContent(Q12bin, Q23bin, Q13bin) <=0) return 1.0; |
0e58bc53 | 4285 | Double_t base = fFSIOmega0OS[fFSIbin]->GetBinContent(index12L+1, index23H+1, index13H+1); |
4286 | Double_t InterPolated = 0; | |
4287 | Double_t slope12 = fFSIOmega0OS[fFSIbin]->GetBinContent(index12H+1, index23H+1, index13H+1); | |
4288 | slope12 -= base; | |
4289 | slope12 /= fFSIOmega0OS[fFSIbin]->GetXaxis()->GetBinWidth(1); | |
4290 | InterPolated += slope12*fabs(Q12 - fFSIOmega0OS[fFSIbin]->GetXaxis()->GetBinCenter(index12L+1)); | |
4291 | Double_t slope23 = fFSIOmega0OS[fFSIbin]->GetBinContent(index12L+1, index23L+1, index13H+1); | |
4292 | slope23 -= base; | |
4293 | slope23 /= fFSIOmega0OS[fFSIbin]->GetYaxis()->GetBinWidth(1); | |
4294 | InterPolated += slope23*fabs(Q23 - fFSIOmega0OS[fFSIbin]->GetYaxis()->GetBinCenter(index23L+1)); | |
4295 | Double_t slope13 = fFSIOmega0OS[fFSIbin]->GetBinContent(index12L+1, index23H+1, index13L+1); | |
4296 | slope13 -= base; | |
4297 | slope13 /= fFSIOmega0OS[fFSIbin]->GetZaxis()->GetBinWidth(1); | |
4298 | InterPolated += slope13*fabs(Q13 - fFSIOmega0OS[fFSIbin]->GetZaxis()->GetBinCenter(index13L+1)); | |
4299 | if( (base+InterPolated) <= 0) return 1.0; | |
4300 | return (base+InterPolated); | |
4301 | ||
5e3e77d6 | 4302 | } |
cd12341d | 4303 | } |
90814457 | 4304 | //________________________________________________________________________ |
4305 | 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){ | |
4306 | QS1v1 = (pV1[0]-pV2[0])*(pV2[1]-pV3[1]) - (pV1[1]-pV2[1])*(pV2[0]-pV3[0]); | |
4307 | QS1v1 += (pV1[0]-pV2[0])*(pV2[2]-pV3[2]) - (pV1[2]-pV2[2])*(pV2[0]-pV3[0]); | |
4308 | QS1v1 += (pV1[0]-pV2[0])*(pV2[3]-pV3[3]) - (pV1[3]-pV2[3])*(pV2[0]-pV3[0]); | |
4309 | QS2 = (pV1[1]-pV2[1])*(pV2[2]-pV3[2]) - (pV1[2]-pV2[2])*(pV2[1]-pV3[1]); | |
4310 | QS3v1 = (pV1[1]-pV2[1])*(pV2[3]-pV3[3]) - (pV1[3]-pV2[3])*(pV2[1]-pV3[1]); | |
4311 | QS3v1 += (pV1[2]-pV2[2])*(pV2[3]-pV3[3]) - (pV1[3]-pV2[3])*(pV2[2]-pV3[2]); | |
4312 | // | |
4313 | QS1v2 = (pV1[0]-pV2[0])*(pV2[1]-pV3[1]) - (pV1[1]-pV2[1])*(pV2[0]-pV3[0]); | |
4314 | QS1v2 += (pV1[0]-pV2[0])*(pV2[2]-pV3[2]) - (pV1[2]-pV2[2])*(pV2[0]-pV3[0]); | |
4315 | QS3v2 = (pV1[1]-pV2[1])*(pV2[3]-pV3[3]) - (pV1[3]-pV2[3])*(pV2[1]-pV3[1]); | |
4316 | QS3v2 += (pV1[0]-pV2[0])*(pV2[3]-pV3[3]) - (pV1[3]-pV2[3])*(pV2[0]-pV3[0]); | |
4317 | QS3v2 += (pV1[2]-pV2[2])*(pV2[3]-pV3[3]) - (pV1[3]-pV2[3])*(pV2[2]-pV3[2]); | |
4318 | } | |
4319 | //________________________________________________________________________ |