2 #include "calculateCumulant.h"
4 void calculateCumulant(
const char* histFileName){
12 TString xLabel =
"Pseudorapidity";
13 if (isPidFlow) { xLabel =
"Rapidity"; }
16 TFile* f =
new TFile(histFileName,
"UPDATE");
20 TProfile2D** mHistCumul2D;
21 TProfile** mHistCumulEta;
22 TProfile** mHistCumulPt;
24 TProfile2D* mHistCumulMix2D;
25 TProfile* mHistCumulMixEta;
26 TProfile* mHistCumulMixPt;
41 Double_t mCumulIntegG0[nCumulIntegOrders*nCumulInteg_qMax];
45 TH1D* mHistMeanWgtSqrSum;
47 Double_t mCumulIntegG0Mix[nCumulMixHar_pMax*nCumulMixHar_qMax];
49 TH1D** mHistCumulIntegG0Sum;
50 TH1D** mHistCumulIntegG0MixSum;
55 TProfile** mHistCumul;
58 TProfile* mHistCumulMix;
61 struct histFullHars histFullHar[nHars];
64 struct histFulls histFull[nSels];
73 for (
int k = 0; k < nSels; k++) {
75 sprintf(countSels,
"%d",k+1);
77 histFull[k].mHistCumul =
new TProfile*[nCumulDiffOrders];
78 histFull[k].mHist_v =
new TH1D*[nCumulDiffOrders];
80 for (
int ord = 0; ord < nCumulDiffOrders; ord++) {
81 char theCumulOrderChar[2];
82 sprintf(theCumulOrderChar,
"%d",(ord+1)*2);
83 histTitle =
new TString(
"Flow_Cumul_Order");
84 histTitle->Append(*theCumulOrderChar);
85 histTitle->Append(
"_Sel");
86 histTitle->Append(*countSels);
87 histFull[k].mHistCumul[ord] = (TProfile *)f->Get(histTitle->Data());
90 histTitle =
new TString(
"Flow_Cumul_v_Order");
91 histTitle->Append(*theCumulOrderChar);
92 histTitle->Append(
"_Sel");
93 histTitle->Append(*countSels);
94 histFull[k].mHist_v[ord] =
95 new TH1D(*(histFull[k].mHistCumul[ord]->ProjectionX(histTitle->Data(),
"e")));
96 histFull[k].mHist_v[ord]->SetTitle(histTitle->Data());
97 histFull[k].mHist_v[ord]->SetXTitle(
"harmonic");
98 histFull[k].mHist_v[ord]->SetYTitle(
"v (%)");
99 if (ord>0) histFull[k].mHist_v[ord]->Scale(1./profScale);
107 histTitle =
new TString(
"Flow_CumulMix");
108 histTitle->Append(
"_Sel");
109 histTitle->Append(*countSels);
110 histFull[k].mHistCumulMix = (TProfile *)f->Get(histTitle->Data());
114 histTitle =
new TString(
"Flow_CumulMix_v_Sel");
115 histTitle->Append(*countSels);
116 histFull[k].mHistMix_v =
117 new TH1D(*(histFull[k].mHistCumulMix->ProjectionX(histTitle->Data(),
"e")));
118 histFull[k].mHistMix_v->SetTitle(histTitle->Data());
119 histFull[k].mHistMix_v->SetXTitle(
"place for v1 from mixed harmonic");
120 histFull[k].mHistMix_v->SetYTitle(
"v (%)");
121 histFull[k].mHistMix_v->Scale(1./profScale);
129 for (
int j = 0; j < nHars; j++) {
131 sprintf(countHars,
"%d",j+1);
133 histFull[k].histFullHar[j].mHistCumul2D =
134 new TProfile2D*[nCumulDiffOrders];
135 histFull[k].histFullHar[j].mHistCumulEta =
136 new TProfile*[nCumulDiffOrders];
137 histFull[k].histFullHar[j].mHistCumulPt =
138 new TProfile*[nCumulDiffOrders];
140 histFull[k].histFullHar[j].mHist_v2D =
141 new TH2D*[nCumulDiffOrders];
142 histFull[k].histFullHar[j].mHist_vEta =
143 new TH1D*[nCumulDiffOrders];
144 histFull[k].histFullHar[j].mHist_vPt =
145 new TH1D*[nCumulDiffOrders];
151 histTitle =
new TString(
"Flow_CumulMix2D");
152 histTitle->Append(
"_Sel");
153 histTitle->Append(*countSels);
154 histTitle->Append(
"_Har");
155 histTitle->Append(*countHars);
156 histFull[k].histFullHar[j].mHistCumulMix2D =
157 (TProfile2D *)f->Get(histTitle->Data());
162 histTitle =
new TString(
"Flow_CumulMixEta");
163 histTitle->Append(
"_Sel");
164 histTitle->Append(*countSels);
165 histTitle->Append(
"_Har");
166 histTitle->Append(*countHars);
167 histFull[k].histFullHar[j].mHistCumulMixEta =
168 (TProfile *)f->Get(histTitle->Data());
171 histTitle =
new TString(
"Flow_CumulMixPt");
172 histTitle->Append(
"_Sel");
173 histTitle->Append(*countSels);
174 histTitle->Append(
"_Har");
175 histTitle->Append(*countHars);
176 histFull[k].histFullHar[j].mHistCumulMixPt =
177 (TProfile *)f->Get(histTitle->Data());
182 histFull[k].histFullHar[j].mHistCumulIntegG0MixSum =
183 new TH1D*[nCumulMixHar_pMax*nCumulMixHar_qMax];
186 for (
int pq = 0; pq < nCumulMixHar_pMax*nCumulMixHar_qMax ; pq++) {
187 int pIndex = (pq/nCumulMixHar_qMax);
188 int qIndex = pq%nCumulMixHar_qMax;
192 sprintf(pIndexChar,
"%d",pIndex);
193 sprintf(qIndexChar,
"%d",qIndex);
195 histTitle =
new TString(
"Flow_CumulIntegG0MixSum");
196 histTitle->Append(
"_GenFunIdxp");
197 histTitle->Append(*pIndexChar);
198 histTitle->Append(
"_GenFunIdxq");
199 histTitle->Append(*qIndexChar);
200 histTitle->Append(
"_Sel");
201 histTitle->Append(*countSels);
202 histTitle->Append(
"_Har");
203 histTitle->Append(*countHars);
204 histFull[k].histFullHar[j].mHistCumulIntegG0MixSum[pq]=
205 (TH1D *)f->Get(histTitle->Data());
208 histFull[k].histFullHar[j].mCumulIntegG0Mix[pq] = 0.;
218 for (
int ord = 0; ord < nCumulDiffOrders; ord++) {
219 char theCumulOrderChar[2];
220 sprintf(theCumulOrderChar,
"%d",(ord+1)*2);
222 histTitle =
new TString(
"Flow_Cumul2D_Order");
223 histTitle->Append(*theCumulOrderChar);
224 histTitle->Append(
"_Sel");
225 histTitle->Append(*countSels);
226 histTitle->Append(
"_Har");
227 histTitle->Append(*countHars);
228 histFull[k].histFullHar[j].mHistCumul2D[ord] =
229 (TProfile2D *)f->Get(histTitle->Data());
232 histTitle =
new TString(
"Flow_CumulEta_Order");
233 histTitle->Append(*theCumulOrderChar);
234 histTitle->Append(
"_Sel");
235 histTitle->Append(*countSels);
236 histTitle->Append(
"_Har");
237 histTitle->Append(*countHars);
238 histFull[k].histFullHar[j].mHistCumulEta[ord]=
239 (TProfile *)f->Get(histTitle->Data());
243 histTitle =
new TString(
"Flow_CumulPt_Order");
244 histTitle->Append(*theCumulOrderChar);
245 histTitle->Append(
"_Sel");
246 histTitle->Append(*countSels);
247 histTitle->Append(
"_Har");
248 histTitle->Append(*countHars);
249 histFull[k].histFullHar[j].mHistCumulPt[ord] =
250 (TProfile *)f->Get(histTitle->Data());
256 histFull[k].histFullHar[j].mHistCumulIntegG0Sum =
257 new TH1D*[nCumulIntegOrders*nCumulInteg_qMax];
259 for (
int pq = 0; pq < nCumulIntegOrders*nCumulInteg_qMax; pq++) {
260 int cumulIndex = (pq/nCumulInteg_qMax) + 1;
262 int qIndex = pq%(nCumulInteg_qMax);
265 char theCumulOrderChar[2];
266 char qIndexOrderChar[2];
267 sprintf(theCumulOrderChar,
"%d",cumulIndex*2);
268 sprintf(qIndexOrderChar,
"%d",qIndex);
270 histTitle =
new TString(
"Flow_CumulIntegG0Sum_Order");
271 histTitle->Append(*theCumulOrderChar);
272 histTitle->Append(
"_GenFunIdx");
273 histTitle->Append(*qIndexOrderChar);
274 histTitle->Append(
"_Sel");
275 histTitle->Append(*countSels);
276 histTitle->Append(
"_Har");
277 histTitle->Append(*countHars);
278 histFull[k].histFullHar[j].mHistCumulIntegG0Sum[pq] =
279 (TH1D *)f->Get(histTitle->Data());
282 histFull[k].histFullHar[j].mCumulIntegG0[pq] = 0.;
289 histTitle =
new TString(
"Flow_CumulMultSum_Sel");
290 histTitle->Append(*countSels);
291 histTitle->Append(
"_Har");
292 histTitle->Append(*countHars);
293 histFull[k].histFullHar[j].mHistMultSum =
294 (TH1D *)f->Get(histTitle->Data());
298 histTitle =
new TString(
"Flow_CumulNEvent_Sel");
299 histTitle->Append(*countSels);
300 histTitle->Append(
"_Har");
301 histTitle->Append(*countHars);
302 histFull[k].histFullHar[j].mHistNEvent =
303 (TH1D *)f->Get(histTitle->Data());
307 histTitle =
new TString(
"Flow_CumulMeanWgtSqrSum_Sel");
308 histTitle->Append(*countSels);
309 histTitle->Append(
"_Har");
310 histTitle->Append(*countHars);
311 histFull[k].histFullHar[j].mHistMeanWgtSqrSum =
312 (TH1D *)f->Get(histTitle->Data());
324 for (
int k = 0; k < nSels; k++) {
327 sprintf(countSels,
"%d",k+1);
329 double meanIntegV[nHars];
330 double meanIntegV2[nHars];
331 double meanIntegV3[nHars];
332 double meanIntegV4[nHars];
333 double cumulInteg1[nHars];
334 double cumulInteg2[nHars];
335 double cumulInteg3[nHars];
341 double cumulIntegMix[nHars];
342 double meanIntegVMix[nHars];
344 for (
int j = 0; j < nHars; j++) {
352 cumulIntegMix[j] = 0.;
353 meanIntegVMix[j] = 0.;
356 for (
int j = 0; j < nHars; j++) {
360 sprintf(countHars,
"%d",j+1);
362 cout<<
" ========== Sel"<<k+1<<
" Har"<<j+1<<
" ==========="<<endl;
364 cout<<
" event # "<<histFull[k].histFullHar[j].mHistNEvent->GetBinContent(1)<<endl;
367 histFull[k].histFullHar[j].mHistMultSum->GetBinContent(1)/
368 histFull[k].histFullHar[j].mHistNEvent->GetBinContent(1);
370 cout<<
"mAvMult Sel"<<k<<
" har"<<j<<
" "<<mAvMult<<endl;
373 double CpInteg[nCumulIntegOrders];
375 for (
int pq = 0; pq < nCumulIntegOrders; pq ++) CpInteg[pq] = 0.;
376 for (
int pq = 0; pq < nCumulIntegOrders*nCumulInteg_qMax; pq++) {
378 int theCumulOrder = (pq/nCumulInteg_qMax) + 1;
380 histFull[k].histFullHar[j].mCumulIntegG0[pq] =
381 histFull[k].histFullHar[j].mHistCumulIntegG0Sum[pq]->GetBinContent(1)/
382 histFull[k].histFullHar[j].mHistNEvent->GetBinContent(1);
387 CpInteg[theCumulOrder-1] +=
388 (log(histFull[k].histFullHar[j].mCumulIntegG0[pq]) /
389 ((float)nCumulInteg_qMax));
391 CpInteg[theCumulOrder-1] +=
392 (mAvMult*(pow(histFull[k].histFullHar[j].mCumulIntegG0[pq], 1./mAvMult) -1.) /
393 float(nCumulInteg_qMax));
399 (3.*CpInteg[1-1] - (3./2.)*CpInteg[2-1] + (1./3.)*CpInteg[3-1]) / r0Sq;
401 cumulInteg2[j] = ((-10.*CpInteg[1-1]) + (8.*CpInteg[2-1]) -
402 (2.*CpInteg[3-1])) / (r0Sq*r0Sq);
404 cumulInteg3[j] = ( (18.*CpInteg[1-1]) - (18.*CpInteg[2-1]) + (6.*CpInteg[3-1]))
408 for (
int ord = 0; ord < nCumulDiffOrders; ord++) {
409 char theCumulOrderChar[2];
410 sprintf(theCumulOrderChar,
"%d",(ord+1)*2);
414 histTitle =
new TString(
"Flow_Cumul_vEta_Order");
415 histTitle->Append(*theCumulOrderChar);
416 histTitle->Append(
"_Sel");
417 histTitle->Append(*countSels);
418 histTitle->Append(
"_Har");
419 histTitle->Append(*countHars);
420 histFull[k].histFullHar[j].mHist_vEta[ord] =
421 new TH1D(*(histFull[k].histFullHar[j].mHistCumulEta[ord]->
422 ProjectionX(histTitle->Data(),
"e")));
423 histFull[k].histFullHar[j].mHist_vEta[ord]->SetTitle(histTitle->Data());
424 histFull[k].histFullHar[j].mHist_vEta[ord]->SetXTitle((
char*)xLabel.Data());
425 histFull[k].histFullHar[j].mHist_vEta[ord]->SetYTitle(
"v (%)");
426 if (ord>0) histFull[k].histFullHar[j].mHist_vEta[ord]->Scale(1./profScale);
429 histTitle =
new TString(
"Flow_Cumul_vPt_Order");
430 histTitle->Append(*theCumulOrderChar);
431 histTitle->Append(
"_Sel");
432 histTitle->Append(*countSels);
433 histTitle->Append(
"_Har");
434 histTitle->Append(*countHars);
442 histTitle2 =
new TString(
"Flow_Cumul2D_Order");
443 histTitle2->Append(*theCumulOrderChar);
444 histTitle2->Append(
"_Sel");
445 histTitle2->Append(*countSels);
446 histTitle2->Append(
"_Har");
447 histTitle2->Append(*countHars);
449 histFull[k].histFullHar[j].mHist_vPt[ord] =
452 new TH1D(*(histFull[k].histFullHar[j].mHistCumulPt[ord]->ProjectionX(histTitle->Data(),
"e")));
453 histFull[k].histFullHar[j].mHist_vPt[ord]->SetTitle(histTitle->Data());
454 histFull[k].histFullHar[j].mHist_vPt[ord]->SetName(histTitle->Data());
455 histFull[k].histFullHar[j].mHist_vPt[ord]->SetXTitle(
"Pt (GeV)");
456 histFull[k].histFullHar[j].mHist_vPt[ord]->SetYTitle(
"v (%)");
457 if (ord>0) histFull[k].histFullHar[j].mHist_vPt[ord]->Scale(1./profScale);
464 histTitle =
new TString(
"Flow_Cumul_v2D_Order");
465 histTitle->Append(*theCumulOrderChar);
466 histTitle->Append(
"_Sel");
467 histTitle->Append(*countSels);
468 histTitle->Append(
"_Har");
469 histTitle->Append(*countHars);
470 histFull[k].histFullHar[j].mHist_v2D[ord] =
471 new TH2D(*(histFull[k].histFullHar[j].mHistCumul2D[ord]->
472 ProjectionXY(histTitle->Data(),
"e")));
473 histFull[k].histFullHar[j].mHist_v2D[ord]->SetTitle(histTitle->Data());
474 histFull[k].histFullHar[j].mHist_v2D[ord]->SetXTitle((
char*)xLabel.Data());
475 histFull[k].histFullHar[j].mHist_v2D[ord]->SetYTitle(
"Pt (GeV)");
476 histFull[k].histFullHar[j].mHist_v2D[ord]->SetZTitle(
"v (%)");
477 if (ord>0) histFull[k].histFullHar[j].mHist_v2D[ord]->Scale(1./profScale);
486 meanIntegV[j] = (cumulInteg1[j]>0.) ? sqrt(cumulInteg1[j]) : 1.;
487 meanIntegV2[j] = (cumulInteg1[j]>0.) ? cumulInteg1[j] : 1.;
488 meanIntegV3[j] = (cumulInteg2[j]<0.) ? pow(-1.*cumulInteg2[j], 3./4.) : 1.;
489 meanIntegV4[j] = (cumulInteg2[j]<0.) ? -1.*cumulInteg2[j] : 1.;
496 histFull[k].histFullHar[j].mHist_v2D[0]->Scale(1./(meanIntegV[j]*perCent));
497 histFull[k].histFullHar[j].mHist_v2D[1]->Scale(-1./(meanIntegV3[j]*perCent));
498 histFull[k].histFullHar[j].mHist_vEta[0]->Scale(1./(meanIntegV[j]*perCent));
499 histFull[k].histFullHar[j].mHist_vEta[1]->Scale(-1./(meanIntegV3[j]*perCent));
500 histFull[k].histFullHar[j].mHist_vPt[0]->Scale(1./(meanIntegV[j]*perCent));
501 histFull[k].histFullHar[j].mHist_vPt[1]->Scale(-1./(meanIntegV3[j]*perCent));
503 histFull[k].histFullHar[j].mHist_v2D[0]->Scale(1./(meanIntegV2[j]*perCent));
504 histFull[k].histFullHar[j].mHist_v2D[1]->Scale(-0.5/(meanIntegV4[j]*perCent));
505 histFull[k].histFullHar[j].mHist_vEta[0]->Scale(1./(meanIntegV2[j]*perCent));
506 histFull[k].histFullHar[j].mHist_vEta[1]->Scale(-0.5/(meanIntegV4[j]*perCent) );
507 histFull[k].histFullHar[j].mHist_vPt[0]->Scale(1./(meanIntegV2[j]*perCent));
508 histFull[k].histFullHar[j].mHist_vPt[1]->Scale(-0.5/(meanIntegV4[j]*perCent));
511 if (cumulInteg1[j]<0.) {
512 cout<<
" Sel"<<k+1<<
", <V**2> less than zero ! v"<<j+1<<
" from 2 particle correlation failed."<<endl;
513 histFull[k].histFullHar[j].mHist_v2D[0]->Reset();
514 histFull[k].histFullHar[j].mHist_vEta[0]->Reset();
515 histFull[k].histFullHar[j].mHist_vPt[0]->Reset();
519 if (-1.*cumulInteg2[j]<0.) {
520 cout<<
" Sel"<<k+1<<
", <V**4> less than zero ! v"<<j+1<<
" from 4 particle correlation failed."<<endl;
521 histFull[k].histFullHar[j].mHist_v2D[1]->Reset();
522 histFull[k].histFullHar[j].mHist_vEta[1]->Reset();
523 histFull[k].histFullHar[j].mHist_vPt[1]->Reset();
534 for (
int j = 0; j < nHars; j++) {
536 if (j != 0)
continue;
539 sprintf(countHars,
"%d",j+1);
541 cout<<
" ========== Sel"<<k+1<<
" Har"<<j+1<<
" ===== v1{3} ======"<<endl;
544 histFull[k].histFullHar[j].mHistMultSum->GetBinContent(1)/
545 histFull[k].histFullHar[j].mHistNEvent->GetBinContent(1);
549 double mAveMeanWgtSqr =
550 histFull[k].histFullHar[j].mHistMeanWgtSqrSum->GetBinContent(1)/
551 histFull[k].histFullHar[j].mHistNEvent->GetBinContent(1);
553 cout<<
" histFull[k].histFullHar[j].mHistMeanWgtSqrSum->GetBinContent(1) "<<histFull[k].histFullHar[j].mHistMeanWgtSqrSum->GetBinContent(1)<<endl;
554 cout<<
" histFull[k].histFullHar[j].mHistNEvent->GetBinContent(1) "<<histFull[k].histFullHar[j].mHistNEvent->GetBinContent(1)<<endl;
557 double CpqMix[nCumulMixHar_pMax][nCumulMixHar_qMax];
558 for (
int pq = 0; pq < nCumulMixHar_pMax*nCumulMixHar_qMax; pq++) {
559 int pIndex = pq/nCumulMixHar_qMax;
560 int qIndex = pq%nCumulMixHar_qMax;
564 histFull[k].histFullHar[j].mCumulIntegG0Mix[pq] =
565 histFull[k].histFullHar[j].mHistCumulIntegG0MixSum[pq]->GetBinContent(1)/
566 histFull[k].histFullHar[j].mHistNEvent->GetBinContent(1);
569 CpqMix[pIndex][qIndex]=mAvMult*(pow(histFull[k].histFullHar[j].mCumulIntegG0Mix[pq], 1./mAvMult) -1.);
574 double CpxMix[nCumulMixHar_pMax];
575 double CpyMix[nCumulMixHar_pMax];
578 for (
int p =0; p<nCumulMixHar_pMax; p++){
579 CpxMix[p] = (1./(4.*r0Mix))*(CpqMix[p][0] - CpqMix[p][2]);
580 CpyMix[p] = (1./(4.*r0Mix))*(CpqMix[p][3] - CpqMix[p][1]);
585 cumulIntegMix[j] = (1./(4.*r0Mix*r0Mix))*(
586 CpxMix[0]-CpyMix[1]-CpxMix[2]+CpyMix[3]
587 +CpxMix[4]-CpyMix[5]-CpxMix[6]+CpyMix[7]);
590 double tempMeanV = pow(-1.*cumulInteg2[1]*mAveMeanWgtSqr*mAveMeanWgtSqr,1./4.);
594 cout<<
"mAveMeanWgtSqr "<<mAveMeanWgtSqr<<endl;
595 cout<<
" cmumulInteg2[1] "<<cumulInteg2[1]<<endl;
596 cout<<
" tempMeanV "<<tempMeanV<<endl;
597 double tempMeanVMixSq = cumulIntegMix[j]/tempMeanV;
611 histTitle =
new TString(
"Flow_CumulMix_v2D_Sel");
612 histTitle->Append(*countSels);
613 histTitle->Append(
"_Har");
614 histTitle->Append(*countHars);
615 histFull[k].histFullHar[j].mHistMix_v2D =
616 new TH2D(*(histFull[k].histFullHar[j].mHistCumulMix2D->
617 ProjectionXY(histTitle->Data(),
"e")));
618 histFull[k].histFullHar[j].mHistMix_v2D->SetTitle(histTitle->Data());
619 histFull[k].histFullHar[j].mHistMix_v2D->SetXTitle((
char*)xLabel.Data());
620 histFull[k].histFullHar[j].mHistMix_v2D->SetYTitle(
"Pt (GeV)");
621 histFull[k].histFullHar[j].mHistMix_v2D->SetZTitle(
"v (%)");
622 histFull[k].histFullHar[j].mHistMix_v2D->Scale(1./profScale);
628 histTitle =
new TString(
"Flow_CumulMix_vEta_Sel");
629 histTitle->Append(*countSels);
630 histTitle->Append(
"_Har");
631 histTitle->Append(*countHars);
632 histFull[k].histFullHar[j].mHistMix_vEta =
633 new TH1D(*(histFull[k].histFullHar[j].mHistCumulMixEta->
634 ProjectionX(histTitle->Data(),
"e")));
635 histFull[k].histFullHar[j].mHistMix_vEta->SetTitle(histTitle->Data());
636 histFull[k].histFullHar[j].mHistMix_vEta->SetXTitle((
char*)xLabel.Data());
637 histFull[k].histFullHar[j].mHistMix_vEta->SetYTitle(
"v (%)");
638 histFull[k].histFullHar[j].mHistMix_vEta->Scale(1./profScale);
647 histTitle =
new TString(
"Flow_CumulMix_vPt_Sel");
648 histTitle->Append(*countSels);
649 histTitle->Append(
"_Har");
650 histTitle->Append(*countHars);
654 histTitle2 =
new TString(
"Flow_CumulMix2D_Sel");
655 histTitle2->Append(*countSels);
656 histTitle2->Append(
"_Har");
657 histTitle2->Append(*countHars);
662 histFull[k].histFullHar[j].mHistMix_vPt =
664 new TH1D(*(histFull[k].histFullHar[j].mHistCumulMixPt->ProjectionX(histTitle->Data(),
"e")));
666 histFull[k].histFullHar[j].mHistMix_vPt->SetTitle(histTitle->Data());
667 histFull[k].histFullHar[j].mHistMix_vPt->SetXTitle(
"Pt (GeV)");
668 histFull[k].histFullHar[j].mHistMix_vPt->SetYTitle(
"v (%)");
669 histFull[k].histFullHar[j].mHistMix_vPt->Scale(1./profScale);
676 if (tempMeanVMixSq>0.){
677 meanIntegVMix[j] = sqrt(tempMeanVMixSq);
679 histFull[k].histFullHar[j].mHistMix_v2D->Scale(1./(tempMeanV*meanIntegVMix[j]*perCent));
680 histFull[k].histFullHar[j].mHistMix_vEta->Scale(1./(tempMeanV*meanIntegVMix[j]*perCent));
681 histFull[k].histFullHar[j].mHistMix_vPt->Scale(1./(tempMeanV*meanIntegVMix[j]*perCent));
682 histFull[k].mHistMix_v->Scale(1./(tempMeanV*meanIntegVMix[j]*perCent));
684 histFull[k].histFullHar[j].mHistMix_v2D->Reset();
685 histFull[k].histFullHar[j].mHistMix_vEta->Reset();
686 histFull[k].histFullHar[j].mHistMix_vPt->Reset();
687 histFull[k].mHistMix_v->Reset();
688 cout<<
"### <wgt*v1>**2 = "<<tempMeanVMixSq<<
" < 0. 3-part mixed har ana. failed "<<endl;
700 TH1D* histOfMeanIntegV =
new TH1D(*(histFull[k].mHist_v[0]));
701 histOfMeanIntegV->Reset();
703 TH1D* histOfMeanIntegV3 =
new TH1D(*(histFull[k].mHist_v[1]));
704 histOfMeanIntegV3->Reset();
706 for (
int j = 1; j < nHars+1; j++) {
707 histOfMeanIntegV->SetBinContent(j, 1./(meanIntegV[j-1]*perCent));
708 histOfMeanIntegV->SetBinError(j,0.);
709 histOfMeanIntegV3->SetBinContent(j, -1./(meanIntegV3[j-1]*perCent));
710 histOfMeanIntegV3->SetBinError(j,0.);
712 histFull[k].mHist_v[0]->Multiply(histOfMeanIntegV);
713 histFull[k].mHist_v[1]->Multiply(histOfMeanIntegV3);
716 for (
int ord = 0; ord < nCumulDiffOrders; ord++){
717 for (
int j=0; j<histFull[k].mHist_v[ord]->GetNbinsX(); j++) {
718 if ( !(histFull[k].mHist_v[ord]->GetBinContent(j) < FLT_MAX &&
719 histFull[k].mHist_v[ord]->GetBinContent(j) > -1.*FLT_MAX) ) {
720 histFull[k].mHist_v[ord]->SetBinContent(j,0.);
721 histFull[k].mHist_v[ord]->SetBinError(j,0.);
726 for (
int j = 1; j < nHars+1; j++) {
727 if (histFull[k].mHist_v[0]->GetBinContent(j)< FLT_MAX &&
728 histFull[k].mHist_v[0]->GetBinContent(j)> -1.*FLT_MAX)
729 cout <<
"##### 2-part v" << j <<
" = ("
730 << histFull[k].mHist_v[0]->GetBinContent(j)
731 <<
" +/- "<< histFull[k].mHist_v[0]->GetBinError(j)<<
" )"<<endl;
732 if (histFull[k].mHist_v[1]->GetBinContent(j)< FLT_MAX &&
733 histFull[k].mHist_v[1]->GetBinContent(j)> -1.*FLT_MAX)
734 cout <<
"##### 4-part v" << j <<
" = ("
735 << histFull[k].mHist_v[1]->GetBinContent(j)
736 <<
" +/- "<< histFull[k].mHist_v[1]->GetBinError(j)<<
" )"<<endl;
739 delete histOfMeanIntegV;
740 delete histOfMeanIntegV3;
744 TH1D* histOfMeanIntegV2 =
new TH1D(*(histFull[k].mHist_v[0]));
745 histOfMeanIntegV2->Reset();
747 TH1D* histOfMeanIntegV4 =
new TH1D(*(histFull[k].mHist_v[1]));
748 histOfMeanIntegV4->Reset();
750 for (
int j = 1; j < nHars+1; j++) {
751 histOfMeanIntegV2->SetBinContent(j, 1./(meanIntegV2[j-1]*perCent));
752 histOfMeanIntegV2->SetBinError(j,0.);
753 histOfMeanIntegV4->SetBinContent(j, -0.5/(meanIntegV4[j-1]*perCent));
754 histOfMeanIntegV4->SetBinError(j,0.);
756 histFull[k].mHist_v[0]->Multiply(histOfMeanIntegV2);
757 histFull[k].mHist_v[1]->Multiply(histOfMeanIntegV4);
760 for (
int ord = 0; ord < nCumulDiffOrders; ord++){
761 for (
int j=0; j<histFull[k].mHist_v[ord]->GetNbinsX(); j++) {
762 if ( !(histFull[k].mHist_v[ord]->GetBinContent(j) < FLT_MAX &&
763 histFull[k].mHist_v[ord]->GetBinContent(j) > -1.*FLT_MAX) ){
764 histFull[k].mHist_v[ord]->SetBinContent(j,0.);
765 histFull[k].mHist_v[ord]->SetBinError(j,0.);
770 for (
int j = 1; j < nHars+1; j++) {
772 if (histFull[k].mHist_v[0]->GetBinContent(j)< FLT_MAX &&
773 histFull[k].mHist_v[0]->GetBinContent(j)> -1.*FLT_MAX)
774 cout <<
"##### 2-part v" << j <<
" = ("
775 << histFull[k].mHist_v[0]->GetBinContent(j)
776 <<
") +/- "<< histFull[k].mHist_v[0]->GetBinError(j)<<endl;
777 if (histFull[k].mHist_v[1]->GetBinContent(j)< FLT_MAX &&
778 histFull[k].mHist_v[1]->GetBinContent(j)> -1.*FLT_MAX)
779 cout <<
"##### 4-part v" << j <<
" = ("
780 << histFull[k].mHist_v[1]->GetBinContent(j)
781 <<
") +/- "<< histFull[k].mHist_v[1]->GetBinError(j)<<endl;
784 delete histOfMeanIntegV2;
785 delete histOfMeanIntegV4;
796 for (
int k = 0; k < nSels; k++) {
798 for (
int ord = 0; ord < nCumulDiffOrders; ord++) {
799 histFull[k].mHist_v[ord]->Write(histFull[k].mHist_v[ord]->GetTitle(),TObject::kOverwrite | TObject::kSingleKey);
802 histFull[k].mHistMix_v->Write(histFull[k].mHistMix_v->GetTitle(),TObject::kOverwrite | TObject::kSingleKey);
805 for (
int j = 0; j < nHars; j++) {
806 cout<<
" writting ........................."<<endl;
807 for (
int ord = 0; ord < nCumulDiffOrders; ord++){
808 histFull[k].histFullHar[j].mHist_v2D[ord]->Write(histFull[k].histFullHar[j].mHist_v2D[ord]->GetTitle(),TObject::kOverwrite | TObject::kSingleKey);
809 histFull[k].histFullHar[j].mHist_vEta[ord]->Write(histFull[k].histFullHar[j].mHist_vEta[ord]->GetTitle(),TObject::kOverwrite | TObject::kSingleKey);
810 histFull[k].histFullHar[j].mHist_vPt[ord]->Write(histFull[k].histFullHar[j].mHist_vPt[ord]->GetTitle(),TObject::kOverwrite | TObject::kSingleKey);
815 cout<<
" j "<<j<<
" k "<<k<<endl;
816 cout<<
" histFull[k].histFullHar[j].mHistMix_v2D "<<histFull[k].histFullHar[j].mHistMix_v2D->GetTitle()<<endl;
818 (histFull[k].histFullHar[j].mHistMix_v2D)->Write((histFull[k].histFullHar[j].mHistMix_v2D)->GetTitle(),TObject::kOverwrite | TObject::kSingleKey);
819 (histFull[k].histFullHar[j].mHistMix_vEta)->Write((histFull[k].histFullHar[j].mHistMix_vEta)->GetTitle(),TObject::kOverwrite | TObject::kSingleKey);
820 (histFull[k].histFullHar[j].mHistMix_vPt)->Write((histFull[k].histFullHar[j].mHistMix_vPt)->GetTitle(),TObject::kOverwrite | TObject::kSingleKey);