26 #include "StFlowCumulantMaker.h"
27 #include "StFlowMaker/StFlowMaker.h"
28 #include "StFlowMaker/StFlowEvent.h"
29 #include "StFlowMaker/StFlowConstants.h"
30 #include "StFlowMaker/StFlowSelection.h"
32 #include "PhysicalConstants.h"
33 #include "SystemOfUnits.h"
36 #include "TObjString.h"
41 #include "TProfile2D.h"
42 #include "TOrdCollection.h"
43 #include "StMessMgr.h"
46 #define PR(x) cout << "##### FlowCumulantAnalysis: " << (#x) << " = " << (x) << endl;
58 StFlowCumulantMaker::StFlowCumulantMaker(
const Char_t* name,
60 StMaker(name), MakerName(name) {
67 StFlowCumulantMaker::~StFlowCumulantMaker() {
78 if (pFlowMaker) pFlowEvent = pFlowMaker->FlowEventPointer();
79 if (pFlowEvent && pFlowSelect->Select(pFlowEvent)) {
81 FillEventHistograms();
82 if (pFlowEvent) FillParticleHistograms();
83 if (Debug()) StMaker::PrintInfo();
85 gMessMgr->Info(
"##### FlowCumulantMaker: FlowEvent pointer null");
93 Int_t StFlowCumulantMaker::Init() {
96 float ptMaxPart = Flow::ptMaxPart;
97 if (pFlowSelect->PtMaxPart()) {
98 ptMaxPart = pFlowSelect->PtMaxPart();
101 nPtBinsPart = Flow::nPtBinsPart;
102 if (pFlowSelect->PtBinsPart()) {
103 nPtBinsPart = pFlowSelect->PtBinsPart();
106 xLabel =
"Pseudorapidity";
107 if (strlen(pFlowSelect->PidPart()) != 0) { xLabel =
"Rapidity"; }
119 bool noDenomFileWarned = kFALSE;
122 for (
int k = 0; k < Flow::nSels; k++) {
125 histFull[k].mHistCumul =
new TProfile*[Flow::nCumulDiffOrders];
129 histTitle =
new TString(
"Flow_CumulMix");
130 histTitle->Append(
"_Sel");
132 histFull[k].mHistCumulMix =
133 new TProfile(histTitle->Data(), histTitle->Data(), Flow::nHars, 0.5,
134 (float)(Flow::nHars) + 0.5, -1.*FLT_MAX, FLT_MAX,
"");
135 histFull[k].mHistCumulMix->SetXTitle(
"place for saving mixed cumulant");
139 for (
int ord = 0; ord < Flow::nCumulDiffOrders; ord++) {
140 char theCumulOrder[2];
141 sprintf(theCumulOrder,
"%d",(ord+1)*2);
142 histTitle =
new TString(
"Flow_Cumul_Order");
143 *histTitle->Append(*theCumulOrder);
144 histTitle->Append(
"_Sel");
146 histFull[k].mHistCumul[ord] =
147 new TProfile(histTitle->Data(), histTitle->Data(), Flow::nHars, 0.5,
148 (float)(Flow::nHars) + 0.5, -1.*FLT_MAX, FLT_MAX,
"");
149 histFull[k].mHistCumul[ord]->SetXTitle(
"harmonic");
154 for (
int j = 0; j < Flow::nHars; j++) {
156 histTitle =
new TString(
"Flow_CumulMultSum_Sel");
158 histTitle->Append(
"_Har");
160 histFull[k].histFullHar[j].mHistMultSum =
161 new TH1D(histTitle->Data(),histTitle->Data(),1,0.,1.);
164 histTitle =
new TString(
"Flow_CumulMeanWgtSqrSum_Sel");
166 histTitle->Append(
"_Har");
168 histFull[k].histFullHar[j].mHistMeanWgtSqrSum =
169 new TH1D(histTitle->Data(),histTitle->Data(),1,0.,1.);
173 histTitle =
new TString(
"Flow_CumulNEvent_Sel");
175 histTitle->Append(
"_Har");
177 histFull[k].histFullHar[j].mHistNEvent =
178 new TH1D(histTitle->Data(),histTitle->Data(),1,0.,1.);
195 histFull[k].histFullHar[j].mHistCumul2D =
196 new TProfile2D*[Flow::nCumulDiffOrders];
197 histFull[k].histFullHar[j].mHistCumulEta =
198 new TProfile*[Flow::nCumulDiffOrders];
199 histFull[k].histFullHar[j].mHistCumulPt =
200 new TProfile*[Flow::nCumulDiffOrders];
203 for (
int ord = 0; ord < Flow::nCumulDiffOrders; ord++) {
204 char theCumulOrder[2];
205 sprintf(theCumulOrder,
"%d",(ord+1)*2);
207 histTitle =
new TString(
"Flow_Cumul2D_Order");
208 histTitle->Append(*theCumulOrder);
209 histTitle->Append(
"_Sel");
211 histTitle->Append(
"_Har");
213 histFull[k].histFullHar[j].mHistCumul2D[ord] =
214 new TProfile2D(histTitle->Data(),histTitle->Data(), mNEtaBins,
215 mEtaMin, mEtaMax, nPtBinsPart, Flow::ptMin,
216 ptMaxPart, -1.*FLT_MAX, FLT_MAX,
"");
217 histFull[k].histFullHar[j].mHistCumul2D[ord]->SetXTitle((
char*)xLabel.Data());
218 histFull[k].histFullHar[j].mHistCumul2D[ord]->SetYTitle(
"Pt (GeV/c)");
221 histTitle =
new TString(
"Flow_CumulEta_Order");
222 histTitle->Append(*theCumulOrder);
223 histTitle->Append(
"_Sel");
225 histTitle->Append(
"_Har");
227 histFull[k].histFullHar[j].mHistCumulEta[ord] =
228 new TProfile(histTitle->Data(),histTitle->Data(), mNEtaBins,
229 mEtaMin, mEtaMax, -1.*FLT_MAX, FLT_MAX,
"");
230 histFull[k].histFullHar[j].mHistCumulEta[ord]->SetXTitle((
char*)xLabel.Data());
233 histTitle =
new TString(
"Flow_CumulPt_Order");
234 histTitle->Append(*theCumulOrder);
235 histTitle->Append(
"_Sel");
237 histTitle->Append(
"_Har");
239 histFull[k].histFullHar[j].mHistCumulPt[ord] =
240 new TProfile(histTitle->Data(), histTitle->Data(), nPtBinsPart,
241 Flow::ptMin, ptMaxPart, -1.*FLT_MAX, FLT_MAX,
"");
242 histFull[k].histFullHar[j].mHistCumulPt[ord]->SetXTitle(
"Pt (GeV/c)");
249 histTitle =
new TString(
"Flow_CumulMix2D");
250 histTitle->Append(
"_Sel");
252 histTitle->Append(
"_Har");
254 histFull[k].histFullHar[j].mHistCumulMix2D =
255 new TProfile2D(histTitle->Data(),histTitle->Data(), Flow::nEtaBins,
256 Flow::etaMin, Flow::etaMax, nPtBinsPart, Flow::ptMin,
257 ptMaxPart, -1.*FLT_MAX, FLT_MAX,
"");
258 histFull[k].histFullHar[j].mHistCumulMix2D->SetXTitle((
char*)xLabel.Data());
259 histFull[k].histFullHar[j].mHistCumulMix2D->SetYTitle(
"Pt (GeV)");
263 histTitle =
new TString(
"Flow_CumulMixEta");
264 histTitle->Append(
"_Sel");
266 histTitle->Append(
"_Har");
268 histFull[k].histFullHar[j].mHistCumulMixEta =
269 new TProfile(histTitle->Data(),histTitle->Data(), Flow::nEtaBins,
270 Flow::etaMin, Flow::etaMax, -1.*FLT_MAX, FLT_MAX,
"");
271 histFull[k].histFullHar[j].mHistCumulMixEta->SetXTitle((
char*)xLabel.Data());
275 histTitle =
new TString(
"Flow_CumulMixPt");
276 histTitle->Append(
"_Sel");
278 histTitle->Append(
"_Har");
280 histFull[k].histFullHar[j].mHistCumulMixPt =
281 new TProfile(histTitle->Data(), histTitle->Data(), nPtBinsPart,
282 Flow::ptMin, ptMaxPart, -1.*FLT_MAX, FLT_MAX,
"");
283 histFull[k].histFullHar[j].mHistCumulMixPt->SetXTitle(
"Pt (GeV)");
287 histFull[k].histFullHar[j].mCumulG0Denom =
288 new TProfile*[Flow::nCumulDiffOrders*Flow::nCumulDiff_qMax];
291 for (
int pq = 0; pq < Flow::nCumulDiffOrders*Flow::nCumulDiff_qMax; pq++) {
293 TString* histTitleIntegDenom;
295 int cumulIndex = (pq/Flow::nCumulDiff_qMax) + 1;
297 int qIndex = pq%Flow::nCumulDiff_qMax;
300 char theCumulOrderChar[2];
301 char qIndexOrderChar[2];
302 sprintf(theCumulOrderChar,
"%d",cumulIndex*2);
303 sprintf(qIndexOrderChar,
"%d",qIndex);
305 histTitle =
new TString(
"Flow_CumulDenom_Order");
306 histTitle->Append(*theCumulOrderChar);
307 histTitle->Append(
"_GenFcnqIdx");
308 histTitle->Append(*qIndexOrderChar);
309 histTitle->Append(
"_Sel");
311 histTitle->Append(
"_Har");
313 histFull[k].histFullHar[j].mCumulG0Denom[pq] =
314 new TProfile(histTitle->Data(),histTitle->Data(), 1,0., 1., -1.*FLT_MAX, FLT_MAX,
"");
315 histFull[k].histFullHar[j].mCumulG0Denom[pq]->SetYTitle(
"<G>");
316 histTitleIntegDenom =
new TString(histTitle->Data());
321 TFile f(
"denominator.root",
"R");
325 TProfile* tempDenomProfile =
326 dynamic_cast<TProfile*
>(f.Get(histTitleIntegDenom->Data()));
327 if (!tempDenomProfile) {
328 cout <<
"##### FlowCumulantAnalysis: can not find " <<
329 histTitleIntegDenom->Data() << endl;
332 delete histTitleIntegDenom;
334 histFull[k].histFullHar[j].mCumulG0DenomRead[pq]
335 = tempDenomProfile->GetBinContent(1);
341 if(!noDenomFileWarned) {
342 gMessMgr->Info(
"##### FlowCumulantAnalysis:denominator.root is not present, assumming this run is just for producing denominator.root. That means cumulant flow result in flow.cumulant.root is nonsense for this run. ");
343 noDenomFileWarned = kTRUE;
345 histFull[k].histFullHar[j].mCumulG0DenomRead[pq] = 1.;
349 double theTempPhi = twopi*((double)qIndex) /
350 ((double)Flow::nCumulDiff_qMax);
351 double theRz = r0*::sqrt((
double)cumulIndex);
352 histFull[k].histFullHar[j].mDiffXz[pq] = theRz*cos(theTempPhi);
353 histFull[k].histFullHar[j].mDiffYz[pq] = theRz*sin(theTempPhi);
357 histFull[k].histFullHar[j].mCumulG0MixDenom =
358 new TProfile*[Flow::nCumulMixHar_pMax*Flow::nCumulMixHar_qMax];
360 histFull[k].histFullHar[j].mHistCumulIntegG0MixSum =
361 new TH1D*[Flow::nCumulMixHar_pMax*Flow::nCumulMixHar_qMax];
364 for (
int pq = 0; pq < Flow::nCumulMixHar_pMax*Flow::nCumulMixHar_qMax ; pq++) {
367 TString* histTitleIntegDenomMix;
369 int pIndex = (pq/Flow::nCumulMixHar_qMax);
370 int qIndex = pq%Flow::nCumulMixHar_qMax;
374 sprintf(pIndexChar,
"%d",pIndex);
375 sprintf(qIndexChar,
"%d",qIndex);
378 histTitle =
new TString(
"Flow_CumulMixDenom");
379 histTitle->Append(
"_GenFunIdxp");
380 histTitle->Append(*pIndexChar);
381 histTitle->Append(
"_GenFunIdxq");
382 histTitle->Append(*qIndexChar);
383 histTitle->Append(
"_Sel");
385 histTitle->Append(
"_Har");
387 histFull[k].histFullHar[j].mCumulG0MixDenom[pq] =
388 new TProfile(histTitle->Data(),histTitle->Data(), 1,0., 1., -1.*FLT_MAX, FLT_MAX,
"");
389 histFull[k].histFullHar[j].mCumulG0MixDenom[pq]->SetYTitle(
"<G>");
390 histTitleIntegDenomMix =
new TString(histTitle->Data());
394 histTitle =
new TString(
"Flow_CumulIntegG0MixSum");
395 histTitle->Append(
"_GenFunIdxp");
396 histTitle->Append(*pIndexChar);
397 histTitle->Append(
"_GenFunIdxq");
398 histTitle->Append(*qIndexChar);
399 histTitle->Append(
"_Sel");
401 histTitle->Append(
"_Har");
403 histFull[k].histFullHar[j].mHistCumulIntegG0MixSum[pq] =
404 new TH1D(histTitle->Data(),histTitle->Data(),1,0.,1.);
408 histFull[k].histFullHar[j].mCumulIntegG0Mix[pq] = 0.;
411 TFile f(
"denominator.root",
"R");
415 TProfile* tempDenomMixProfile =
416 dynamic_cast<TProfile*
>(f.Get(histTitleIntegDenomMix->Data()));
417 if (!tempDenomMixProfile) {
418 cout <<
"##### FlowCumulantAnalysis: can not find " <<
419 histTitleIntegDenomMix->Data() << endl;
422 delete histTitleIntegDenomMix;
424 histFull[k].histFullHar[j].mCumulG0MixDenomRead[pq]
425 = tempDenomMixProfile->GetBinContent(1);
431 if(!noDenomFileWarned) {
432 gMessMgr->Info(
"##### FlowCumulantAnalysis:denominator.root is not present, assumming this run is just for producing denominator.root. That means cumulant flow result with mixed harmonics in flow.cumulant.root is nonsense for this run. ");
433 noDenomFileWarned = kTRUE;
435 histFull[k].histFullHar[j].mCumulG0MixDenomRead[pq] = 1.;
442 for (
int p = 0; p < Flow::nCumulMixHar_pMax; p++){
443 histFull[k].histFullHar[j].mMixX1z[p]=r0Mix*cos( pi*((
double)p)/4. );
444 histFull[k].histFullHar[j].mMixY1z[p]=r0Mix*sin( pi*((
double)p)/4. );
447 for (
int q = 0; q < Flow::nCumulMixHar_qMax; q++){
448 histFull[k].histFullHar[j].mMixX2z[q]=r0Mix*cos( pi*((
double)q)/2. );
449 histFull[k].histFullHar[j].mMixY2z[q]=r0Mix*sin( pi*((
double)q)/2. );
455 histFull[k].histFullHar[j].mHistCumulIntegG0Sum =
456 new TH1D*[Flow::nCumulIntegOrders*Flow::nCumulInteg_qMax];
458 for (
int pq = 0; pq < Flow::nCumulIntegOrders*Flow::nCumulInteg_qMax; pq++) {
459 int cumulIndex = (pq/Flow::nCumulInteg_qMax) + 1;
461 int qIndex = pq%(Flow::nCumulInteg_qMax);
464 char theCumulOrderChar[2];
465 char qIndexOrderChar[2];
466 sprintf(theCumulOrderChar,
"%d",cumulIndex*2);
467 sprintf(qIndexOrderChar,
"%d",qIndex);
469 double theTempPhi = twopi*((double)qIndex) /
470 ((double)Flow::nCumulInteg_qMax);
471 double theRz = r0*::sqrt((
double)cumulIndex);
472 histFull[k].histFullHar[j].mIntegXz[pq] = theRz*cos(theTempPhi);
473 histFull[k].histFullHar[j].mIntegYz[pq] = theRz*sin(theTempPhi);
475 histFull[k].histFullHar[j].mCumulIntegG0[pq] = 0.;
477 histTitle =
new TString(
"Flow_CumulIntegG0Sum_Order");
478 histTitle->Append(*theCumulOrderChar);
479 histTitle->Append(
"_GenFunIdx");
480 histTitle->Append(*qIndexOrderChar);
481 histTitle->Append(
"_Sel");
483 histTitle->Append(
"_Har");
485 histFull[k].histFullHar[j].mHistCumulIntegG0Sum[pq] =
486 new TH1D(histTitle->Data(),histTitle->Data(),1,0.,1.);
491 histFull[k].histFullHar[j].mMultSum = 0.;
492 histFull[k].histFullHar[j].mNEvent = 0;
493 histFull[k].histFullHar[j].mMeanWgtSqrSum = 0.;
498 gMessMgr->SetLimit(
"##### FlowCumulantAnalysis", 2);
499 gMessMgr->Info(
"##### FlowCumulantAnalysis: $Id: StFlowCumulantMaker.cxx,v 1.22 2006/02/22 19:12:29 posk Exp $");
501 return StMaker::Init();
506 void StFlowCumulantMaker::FillFromFlowEvent() {
509 for (
int k = 0; k < Flow::nSels; k++) {
510 pFlowSelect->SetSelection(k);
511 for (
int j = 0; j < Flow::nHars; j++) {
512 pFlowSelect->SetHarmonic(j);
513 pFlowSelect->SetSubevent(-1);
516 mMult[k][j] = pFlowEvent->Mult(pFlowSelect);
517 mSqrtOfSumWgtSqr[k][j] = ::sqrt(pFlowEvent->SumWeightSquare(pFlowSelect));
525 void StFlowCumulantMaker::FillEventHistograms() {
528 for (
int k = 0; k < Flow::nSels; k++) {
529 pFlowSelect->SetSelection(k);
530 for (
int j = 0; j < Flow::nHars; j++) {
531 pFlowSelect->SetHarmonic(j);
533 histFull[k].histFullHar[j].mMultSum += (float)mMult[k][j];
534 histFull[k].histFullHar[j].mNEvent++;
535 histFull[k].histFullHar[j].mMeanWgtSqrSum +=
536 (mSqrtOfSumWgtSqr[k][j]*mSqrtOfSumWgtSqr[k][j])/(
float)mMult[k][j];
539 for (
int pq = 0; pq < Flow::nCumulIntegOrders*Flow::nCumulInteg_qMax; pq++) {
540 histFull[k].histFullHar[j].mCumulIntegG0[pq] +=
541 pFlowEvent->G_New( pFlowSelect,
542 histFull[k].histFullHar[j].mIntegXz[pq],
543 histFull[k].histFullHar[j].mIntegYz[pq] );
546 for (
int pq = 0; pq < Flow::nCumulMixHar_pMax*Flow::nCumulMixHar_qMax ; pq++) {
547 int pIndex = pq/Flow::nCumulMixHar_qMax;
548 int qIndex = pq%Flow::nCumulMixHar_qMax;
550 histFull[k].histFullHar[j].mCumulIntegG0Mix[pq] +=
551 pFlowEvent->G_Mix( pFlowSelect,
552 histFull[k].histFullHar[j].mMixX1z[pIndex],
553 histFull[k].histFullHar[j].mMixY1z[pIndex],
554 histFull[k].histFullHar[j].mMixX2z[qIndex],
555 histFull[k].histFullHar[j].mMixY2z[qIndex] );
565 void StFlowCumulantMaker::FillParticleHistograms() {
569 StFlowTrackCollection* pFlowTracks = pFlowEvent->TrackCollection();
570 StFlowTrackIterator itr;
578 double* evtG[Flow::nSels][Flow::nHars];
579 double* theCrossterm[Flow::nSels][Flow::nHars];
581 double* evtGMix[Flow::nSels][Flow::nHars];
582 double* theCrosstermMix[Flow::nSels][Flow::nHars];
584 for (
int k = 0; k < Flow::nSels; k++) {
585 for (
int j = 0; j < Flow::nHars; j++) {
587 new double[Flow::nCumulDiffOrders*Flow::nCumulDiff_qMax];
589 new double[Flow::nCumulDiffOrders*Flow::nCumulDiff_qMax];
591 new double[Flow::nCumulMixHar_pMax*Flow::nCumulMixHar_qMax];
592 theCrosstermMix[k][j] =
593 new double[Flow::nCumulMixHar_pMax*Flow::nCumulMixHar_qMax];
597 for (
int k = 0; k < Flow::nSels; k++) {
598 for (
int j = 0; j < Flow::nHars; j++) {
599 pFlowSelect->SetSelection(k);
600 pFlowSelect->SetHarmonic(j);
603 for (
int pq = 0; pq < Flow::nCumulDiffOrders*Flow::nCumulDiff_qMax; pq++) {
606 (pFlowEvent->G_New( pFlowSelect,
607 histFull[k].histFullHar[j].mDiffXz[pq],
608 histFull[k].histFullHar[j].mDiffYz[pq] )) ;
609 theCrossterm[k][j][pq] =evtG[k][j][pq];
610 histFull[k].histFullHar[j].mCumulG0Denom[pq]->Fill(0.5,evtG[k][j][pq]);
613 for (
int pq = 0; pq < Flow::nCumulMixHar_pMax*Flow::nCumulMixHar_qMax ; pq++) {
614 int pIndex = pq/Flow::nCumulMixHar_qMax;
615 int qIndex = pq%Flow::nCumulMixHar_qMax;
618 pFlowEvent->G_Mix( pFlowSelect,
619 histFull[k].histFullHar[j].mMixX1z[pIndex],
620 histFull[k].histFullHar[j].mMixY1z[pIndex],
621 histFull[k].histFullHar[j].mMixX2z[qIndex],
622 histFull[k].histFullHar[j].mMixY2z[qIndex] );
623 theCrosstermMix[k][j][pq] =evtGMix[k][j][pq];
624 histFull[k].histFullHar[j].mCumulG0MixDenom[pq]->Fill(0.5,evtGMix[k][j][pq]);
630 for (itr = pFlowTracks->begin(); itr != pFlowTracks->end(); itr++) {
633 float phi = pFlowTrack->Phi();
634 if (phi < 0.) phi += twopi;
635 float eta = pFlowTrack->Eta();
636 float pt = pFlowTrack->Pt();
638 for (
int k = 0; k < Flow::nSels; k++) {
639 pFlowSelect->SetSelection(k);
640 double cumuTemp[Flow::nCumulDiffOrders];
641 double cumuTempFlip[Flow::nCumulDiffOrders];
643 double cumuTempMixFlip;
646 double phiWgtRaw = 1.;
648 for (
int j = 0; j < Flow::nHars; j++) {
649 bool oddHar = (j+1) % 2;
650 pFlowSelect->SetHarmonic(j);
651 order = (double)(j+1);
653 if (pFlowSelect->Select(pFlowTrack)) {
655 phiWgt = pFlowEvent->Weight(k, j, pFlowTrack);
659 if (pFlowSelect->SelectPart(pFlowTrack)) {
662 (strlen(pFlowSelect->PidPart()) != 0) ? pFlowTrack->Y() : eta;
664 double Dp[Flow::nCumulDiffOrders];
665 for (
int pq = 0; pq < Flow::nCumulDiffOrders; pq++) {
668 for (
int pq = 0; pq < Flow::nCumulDiffOrders*Flow::nCumulDiff_qMax; pq++) {
669 int theCumulOrder = (pq/Flow::nCumulDiff_qMax) + 1;
671 int qIndex = pq%(Flow::nCumulDiff_qMax);
675 double theCoeff = ::pow(r0*::sqrt(
double(theCumulOrder)),
double(m_M)) /
676 float(Flow::nCumulDiff_qMax);
677 double theCosTerm = cos(twopi*
float(qIndex)*
float(m_M) /
678 float(Flow::nCumulDiff_qMax));
679 double theSinTerm = sin(twopi*
float(qIndex)*
float(m_M) /
680 float(Flow::nCumulDiff_qMax));
682 if ( (pFlowSelect->SelectPart(pFlowTrack)) &&
683 (pFlowSelect->Select(pFlowTrack)) ) {
685 theCrossterm[k][j][pq] = evtG[k][j][pq] /
686 (1. + (phiWgt/mMult[k][j]) *
687 (2.*histFull[k].histFullHar[j].mDiffXz[pq]*cos(phi*order) +
688 2.*histFull[k].histFullHar[j].mDiffYz[pq]*sin(phi * order) ) );
694 double theXpq = (theCrossterm[k][j][pq]*cos(
float(m_M) * order * phi)) /
695 histFull[k].histFullHar[j].mCumulG0DenomRead[pq];
696 double theYpq = (theCrossterm[k][j][pq]*sin(
float(m_M) * order * phi)) /
697 histFull[k].histFullHar[j].mCumulG0DenomRead[pq];
699 Dp[theCumulOrder-1] +=
700 theCoeff*(theCosTerm*theXpq + theSinTerm*theYpq);
709 double DpxMix[Flow::nCumulMixHar_pMax];
710 double DpyMix[Flow::nCumulMixHar_pMax];
712 double DpqxMix[Flow::nCumulMixHar_pMax][Flow::nCumulMixHar_qMax];
713 double DpqyMix[Flow::nCumulMixHar_pMax][Flow::nCumulMixHar_qMax];
716 for (
int p = 0; p < Flow::nCumulMixHar_pMax; p++) {
717 DpxMix[p] = 0.; DpyMix[p] = 0.;}
719 for (
int pq = 0; pq < Flow::nCumulMixHar_pMax*Flow::nCumulMixHar_qMax; pq++) {
721 int pIndex = pq/Flow::nCumulMixHar_qMax;
722 int qIndex = pq%Flow::nCumulMixHar_qMax;
724 if ( (pFlowSelect->SelectPart(pFlowTrack)) &&
725 (pFlowSelect->Select(pFlowTrack)) ) {
727 double etaWgt = (oddHar) ? ( (eta>0) ? (pFlowEvent->EtaAbsWgtValue(eta)) : (-1.*(pFlowEvent->EtaAbsWgtValue(eta))) ) : 1.;
729 double ptWgt = pFlowEvent->PtAbsWgtValue(pt);
731 double detectorV1Wgt = 1.;
733 if (pFlowTrack->TopologyMap().hasHitInDetector(kTpcId) ||
734 (pFlowTrack->TopologyMap().data(0) == 0 &&
735 pFlowTrack->TopologyMap().data(1) == 0)) {
737 detectorV1Wgt =pFlowEvent->V1TPCDetctWgtG_Mix(k);
738 }
else if (pFlowTrack->TopologyMap().trackFtpcEast() ) {
739 detectorV1Wgt =pFlowEvent->V1FtpcEastDetctWgtG_Mix(k);
740 }
else if (pFlowTrack->TopologyMap().trackFtpcWest() ) {
741 detectorV1Wgt =pFlowEvent->V1FtpcWestDetctWgtG_Mix(k);
745 double detectorV2Wgt = 1.;
747 if (pFlowTrack->TopologyMap().hasHitInDetector(kTpcId) ||
748 (pFlowTrack->TopologyMap().data(0) == 0 &&
749 pFlowTrack->TopologyMap().data(1) == 0)) {
751 detectorV2Wgt =pFlowEvent->V2TPCDetctWgtG_Mix(k);
752 }
else if (pFlowTrack->TopologyMap().trackFtpcEast() ) {
753 detectorV2Wgt =pFlowEvent->V2FtpcEastDetctWgtG_Mix(k);
754 }
else if (pFlowTrack->TopologyMap().trackFtpcWest() ) {
755 detectorV2Wgt =pFlowEvent->V2FtpcWestDetctWgtG_Mix(k);
759 theCrosstermMix[k][j][pq] = evtGMix[k][j][pq] /
760 (1. + (phiWgtRaw*etaWgt*detectorV1Wgt/mMult[k][j]) *
761 (2.* histFull[k].histFullHar[j].mMixX1z[pIndex] * cos(phi * order) +
762 2.* histFull[k].histFullHar[j].mMixY1z[pIndex] * sin(phi * order) )
763 + (phiWgtRaw*ptWgt*detectorV2Wgt/mMult[k][j]) *
764 (2.* histFull[k].histFullHar[j].mMixX2z[qIndex] * cos(phi * order*2.) +
765 2.* histFull[k].histFullHar[j].mMixY2z[qIndex] * sin(phi * order*2.) ) );
771 DpqxMix[pIndex][qIndex] = theCrosstermMix[k][j][pq] * cos(order * phi)/
772 histFull[k].histFullHar[j].mCumulG0MixDenomRead[pq];
773 DpqyMix[pIndex][qIndex] = theCrosstermMix[k][j][pq] * sin(order * phi)/
774 histFull[k].histFullHar[j].mCumulG0MixDenomRead[pq];
779 for (
int p=0; p< Flow::nCumulMixHar_pMax; p++){
780 DpxMix[p]=(1./(4.*r0Mix))*( DpqxMix[p][0]-DpqxMix[p][2]+DpqyMix[p][1]-DpqyMix[p][3]);
781 DpyMix[p]=(1./(4.*r0Mix))*( DpqyMix[p][0]-DpqyMix[p][2]+DpqxMix[p][3]-DpqxMix[p][1]);
785 cumuTempMix = (1./(4.*r0Mix))*(DpxMix[0]-DpyMix[2]-DpxMix[4]+DpyMix[6]);
787 cumuTempMixFlip = cumuTempMix;
789 if (eta < 0 && oddHar) {
790 cumuTempMixFlip *= -1.;
794 histFull[k].histFullHar[j].mHistCumulMix2D->
795 Fill(yOrEta, pt, cumuTempMix*profScale);
796 histFull[k].histFullHar[j].mHistCumulMixEta->
797 Fill(yOrEta, cumuTempMix*profScale);
798 histFull[k].histFullHar[j].mHistCumulMixPt->
799 Fill(pt, cumuTempMixFlip*profScale);
801 histFull[k].mHistCumulMix->Fill(order,cumuTempMixFlip*profScale);
809 cumuTemp[0] = ((2.*Dp[1-1])-(0.5*Dp[2-1]))/r0Sq;
810 cumuTemp[1] = ((-2.*Dp[1-1])+Dp[2-1])/(r0Sq*r0Sq);
812 cumuTemp[0] = ((4.*Dp[1-1])-(0.5*Dp[2-1]))/(r0Sq*r0Sq);
813 cumuTemp[1] = ((-6.*Dp[1-1])+(1.5*Dp[2-1]))/(r0Sq*r0Sq*r0Sq);
816 cumuTempFlip[0] = cumuTemp[0];
817 cumuTempFlip[1] = cumuTemp[1];
818 if (eta < 0 && oddHar) {
819 cumuTempFlip[0] *= -1.;
820 cumuTempFlip[1] *= -1.;
823 for (
int ord = 0; ord < Flow::nCumulDiffOrders; ord++) {
824 histFull[k].histFullHar[j].mHistCumul2D[ord]->
825 Fill(yOrEta, pt, ((ord>0) ? cumuTemp[ord]*profScale : cumuTemp[ord]));
826 histFull[k].histFullHar[j].mHistCumulEta[ord]->
827 Fill(yOrEta, ((ord>0) ? cumuTemp[ord]*profScale : cumuTemp[ord]));
828 histFull[k].histFullHar[j].mHistCumulPt[ord]->
829 Fill(pt, ((ord>0) ? cumuTempFlip[ord]*profScale : cumuTempFlip[ord]));
832 for (
int ord = 0; ord < Flow::nCumulDiffOrders; ord++)
833 histFull[k].mHistCumul[ord]->Fill(order, ((ord>0) ? cumuTempFlip[ord]*profScale : cumuTempFlip[ord]) );
847 TOrdCollection* XpqYpqDenomNames =
new TOrdCollection(Flow::nSels*Flow::nHars);
848 TOrdCollection* savedHistNames =
new TOrdCollection(Flow::nSels*Flow::nHars*Flow::nCumulDiffOrders);
850 cout << endl <<
"##### Cumulant Maker:" << endl;
851 for (
int k = 0; k < Flow::nSels; k++) {
853 cout <<
"##### selection "<< k+1 <<
" #### "<<endl;
856 histFull[k].mHist_v =
new TH1D*[Flow::nCumulDiffOrders];
858 for (
int ord = 0; ord < Flow::nCumulDiffOrders; ord++) {
859 char theCumulOrder[2];
860 sprintf(theCumulOrder,
"%d",(ord+1)*2);
862 histTitle =
new TString(
"Flow_Cumul_v_Order");
863 histTitle->Append(*theCumulOrder);
864 histTitle->Append(
"_Sel");
866 histFull[k].mHist_v[ord] =
867 new TH1D(*(histFull[k].mHistCumul[ord]->ProjectionX(histTitle->Data(),
"e")));
868 histFull[k].mHist_v[ord]->SetTitle(histTitle->Data());
869 histFull[k].mHist_v[ord]->SetXTitle(
"harmonic");
870 histFull[k].mHist_v[ord]->SetYTitle(
"v (%)");
872 if (ord>0) histFull[k].mHist_v[ord]->Scale(1./profScale);
873 savedHistNames->AddLast(histFull[k].mHist_v[ord]);
877 histTitle =
new TString(
"Flow_CumulMix_v_Sel");
879 histFull[k].mHistMix_v =
880 new TH1D(*(histFull[k].mHistCumulMix->ProjectionX(histTitle->Data(),
"e")));
881 histFull[k].mHistMix_v->SetTitle(histTitle->Data());
882 histFull[k].mHistMix_v->SetXTitle(
"place for v1 from mixed harmonic");
883 histFull[k].mHistMix_v->SetYTitle(
"v (%)");
886 histFull[k].mHistMix_v->Scale(1./profScale);
887 savedHistNames->AddLast(histFull[k].mHistMix_v);
891 double meanIntegV[Flow::nHars];
892 double meanIntegV2[Flow::nHars];
893 double meanIntegV3[Flow::nHars];
894 double meanIntegV4[Flow::nHars];
895 double cumulInteg1[Flow::nHars];
896 double cumulInteg2[Flow::nHars];
897 double cumulInteg3[Flow::nHars];
899 double cumulIntegMix[Flow::nHars];
900 double meanIntegVMix[Flow::nHars];
902 for (
int j = 0; j < Flow::nHars; j++) {
910 cumulIntegMix[j] = 0.;
911 meanIntegVMix[j] = 0.;
914 for (
int j = 0; j < Flow::nHars; j++) {
917 float(histFull[k].histFullHar[j].mMultSum)/
918 (float(histFull[k].histFullHar[j].mNEvent));
920 histFull[k].histFullHar[j].mHistMultSum->
921 SetBinContent(1,
double(histFull[k].histFullHar[j].mMultSum));
922 histFull[k].histFullHar[j].mHistNEvent->
923 SetBinContent(1,
double(histFull[k].histFullHar[j].mNEvent));
924 histFull[k].histFullHar[j].mHistMeanWgtSqrSum->
925 SetBinContent(1,
double(histFull[k].histFullHar[j].mMeanWgtSqrSum));
927 double CpInteg[Flow::nCumulIntegOrders];
929 for (
int pq = 0; pq < Flow::nCumulIntegOrders; pq ++) CpInteg[pq] = 0.;
930 for (
int pq = 0; pq < Flow::nCumulIntegOrders*Flow::nCumulInteg_qMax; pq++) {
931 int theCumulOrder = (pq/Flow::nCumulInteg_qMax) + 1;
936 histFull[k].histFullHar[j].mHistCumulIntegG0Sum[pq]->
937 SetBinContent(1,histFull[k].histFullHar[j].mCumulIntegG0[pq]);
941 histFull[k].histFullHar[j].mCumulIntegG0[pq] /=
942 float(histFull[k].histFullHar[j].mNEvent);
944 CpInteg[theCumulOrder-1] +=
945 (mAvMult*(::pow(histFull[k].histFullHar[j].mCumulIntegG0[pq], 1./mAvMult) -1.) /
946 float(Flow::nCumulInteg_qMax));
951 for (
int pq = 0; pq < Flow::nCumulDiffOrders*Flow::nCumulDiff_qMax; pq++) {
952 XpqYpqDenomNames->AddLast(histFull[k].histFullHar[j].mCumulG0Denom[pq]);
956 (3.*CpInteg[1-1] - (3./2.)*CpInteg[2-1] + (1./3.)*CpInteg[3-1]) / r0Sq;
958 cumulInteg2[j] = ((-10.*CpInteg[1-1]) + (8.*CpInteg[2-1]) -
959 (2.*CpInteg[3-1])) / (r0Sq*r0Sq);
961 cumulInteg3[j] = ( (18.*CpInteg[1-1]) - (18.*CpInteg[2-1]) + (6.*CpInteg[3-1]))
965 histFull[k].histFullHar[j].mHist_v2D =
new TH2D*[Flow::nCumulDiffOrders];
966 histFull[k].histFullHar[j].mHist_vEta =
new TH1D*[Flow::nCumulDiffOrders];
967 histFull[k].histFullHar[j].mHist_vPt =
new TH1D*[Flow::nCumulDiffOrders];
969 for (
int ord = 0; ord < Flow::nCumulDiffOrders; ord++) {
970 char theCumulOrder[2];
971 sprintf(theCumulOrder,
"%d",(ord+1)*2);
973 histTitle =
new TString(
"Flow_Cumul_v2D_Order");
974 histTitle->Append(*theCumulOrder);
975 histTitle->Append(
"_Sel");
977 histTitle->Append(
"_Har");
979 histFull[k].histFullHar[j].mHist_v2D[ord] =
980 new TH2D(*(histFull[k].histFullHar[j].mHistCumul2D[ord]->
981 ProjectionXY(histTitle->Data(),
"e")));
982 histFull[k].histFullHar[j].mHist_v2D[ord]->SetTitle(histTitle->Data());
983 histFull[k].histFullHar[j].mHist_v2D[ord]->SetXTitle((
char*)xLabel.Data());
984 histFull[k].histFullHar[j].mHist_v2D[ord]->SetYTitle(
"Pt (GeV/c)");
985 histFull[k].histFullHar[j].mHist_v2D[ord]->SetZTitle(
"v (%)");
988 if (ord>0) histFull[k].histFullHar[j].mHist_v2D[ord]->Scale(1./profScale);
990 histTitle =
new TString(
"Flow_Cumul_vEta_Order");
991 histTitle->Append(*theCumulOrder);
992 histTitle->Append(
"_Sel");
994 histTitle->Append(
"_Har");
996 histFull[k].histFullHar[j].mHist_vEta[ord] =
997 new TH1D(*(histFull[k].histFullHar[j].mHistCumulEta[ord]->
998 ProjectionX(histTitle->Data(),
"e")));
999 histFull[k].histFullHar[j].mHist_vEta[ord]->SetTitle(histTitle->Data());
1000 histFull[k].histFullHar[j].mHist_vEta[ord]->SetXTitle((
char*)xLabel.Data());
1001 histFull[k].histFullHar[j].mHist_vEta[ord]->SetYTitle(
"v (%)");
1004 if (ord>0) histFull[k].histFullHar[j].mHist_vEta[ord]->Scale(1./profScale);
1006 histTitle =
new TString(
"Flow_Cumul_vPt_Order");
1007 histTitle->Append(*theCumulOrder);
1008 histTitle->Append(
"_Sel");
1010 histTitle->Append(
"_Har");
1012 histFull[k].histFullHar[j].mHist_vPt[ord] =
1013 new TH1D(*(histFull[k].histFullHar[j].mHistCumulPt[ord]->
1014 ProjectionX(histTitle->Data(),
"e")));
1015 histFull[k].histFullHar[j].mHist_vPt[ord]->SetTitle(histTitle->Data());
1016 histFull[k].histFullHar[j].mHist_vPt[ord]->SetXTitle(
"Pt (GeV/c)");
1017 histFull[k].histFullHar[j].mHist_vPt[ord]->SetYTitle(
"v (%)");
1020 if (ord>0) histFull[k].histFullHar[j].mHist_vPt[ord]->Scale(1./profScale);
1025 meanIntegV[j] = ::sqrt(cumulInteg1[j]);
1026 meanIntegV2[j] = cumulInteg1[j];
1027 meanIntegV3[j] = ::pow(-1.*cumulInteg2[j], 3./4.);
1028 meanIntegV4[j] = -1.*cumulInteg2[j];
1030 if (meanIntegV2[j]<0.) cout<<
" Sel"<<k+1<<
", <V**2> less than zero ! v"
1031 <<j+1<<
" from 2 particle correlation failed."<<endl;
1032 if (meanIntegV4[j]<0.) cout<<
" Sel"<<k+1<<
", <V**4> less than zero ! v"
1033 <<j+1<<
" from 4 particle correlation failed."<<endl;
1037 histFull[k].histFullHar[j].mHist_v2D[0]->Scale(1./(meanIntegV[j]*perCent));
1038 histFull[k].histFullHar[j].mHist_v2D[1]->Scale(-1./(meanIntegV3[j]*perCent));
1039 histFull[k].histFullHar[j].mHist_vEta[0]->Scale(1./(meanIntegV[j]*perCent));
1040 histFull[k].histFullHar[j].mHist_vEta[1]->Scale(-1./(meanIntegV3[j]*perCent));
1041 histFull[k].histFullHar[j].mHist_vPt[0]->Scale(1./(meanIntegV[j]*perCent));
1042 histFull[k].histFullHar[j].mHist_vPt[1]->Scale(-1./(meanIntegV3[j]*perCent));
1043 }
else if (m_M==2) {
1044 histFull[k].histFullHar[j].mHist_v2D[0]->Scale(1./(meanIntegV2[j]*perCent));
1045 histFull[k].histFullHar[j].mHist_v2D[1]->Scale(-0.5/(meanIntegV4[j]*perCent));
1046 histFull[k].histFullHar[j].mHist_vEta[0]->Scale(1./(meanIntegV2[j]*perCent));
1047 histFull[k].histFullHar[j].mHist_vEta[1]->Scale(-0.5/(meanIntegV4[j]*perCent) );
1048 histFull[k].histFullHar[j].mHist_vPt[0]->Scale(1./(meanIntegV2[j]*perCent));
1049 histFull[k].histFullHar[j].mHist_vPt[1]->Scale(-0.5/(meanIntegV4[j]*perCent));
1052 for (
int ord = 0; ord < Flow::nCumulDiffOrders; ord++) {
1053 savedHistNames->AddLast(histFull[k].histFullHar[j].mHist_v2D[ord]);
1054 savedHistNames->AddLast(histFull[k].histFullHar[j].mHist_vEta[ord]);
1055 savedHistNames->AddLast(histFull[k].histFullHar[j].mHist_vPt[ord]);
1062 for (
int j = 0; j < Flow::nHars; j++) {
1063 if (j != 0)
continue;
1066 float(histFull[k].histFullHar[j].mMultSum)/
1067 (float(histFull[k].histFullHar[j].mNEvent));
1069 double mAveMeanWgtSqr =
1070 float(histFull[k].histFullHar[j].mMeanWgtSqrSum)/
1071 (float(histFull[k].histFullHar[j].mNEvent));
1073 double CpqMix[Flow::nCumulMixHar_pMax][Flow::nCumulMixHar_qMax];
1074 for (
int pq = 0; pq < Flow::nCumulMixHar_pMax*Flow::nCumulMixHar_qMax; pq++) {
1075 int pIndex = pq/Flow::nCumulMixHar_qMax;
1076 int qIndex = pq%Flow::nCumulMixHar_qMax;
1078 histFull[k].histFullHar[j].mHistCumulIntegG0MixSum[pq]->
1079 SetBinContent(1,histFull[k].histFullHar[j].mCumulIntegG0Mix[pq]);
1080 histFull[k].histFullHar[j].mCumulIntegG0Mix[pq] /=
1081 float(histFull[k].histFullHar[j].mNEvent);
1083 CpqMix[pIndex][qIndex]=mAvMult*(pow(histFull[k].histFullHar[j].mCumulIntegG0Mix[pq], 1./mAvMult) -1.);
1087 double CpxMix[Flow::nCumulMixHar_pMax];
1088 double CpyMix[Flow::nCumulMixHar_pMax];
1090 for (
int p =0; p<Flow::nCumulMixHar_pMax; p++){
1091 CpxMix[p] = (1./(4.*r0Mix))*(CpqMix[p][0] - CpqMix[p][2]);
1092 CpyMix[p] = (1./(4.*r0Mix))*(CpqMix[p][3] - CpqMix[p][1]);
1095 cumulIntegMix[j] = (1./(4.*r0Mix*r0Mix))*(
1096 CpxMix[0]-CpyMix[1]-CpxMix[2]+CpyMix[3]
1097 +CpxMix[4]-CpyMix[5]-CpxMix[6]+CpyMix[7]);
1100 double tempMeanV = pow(-1.*cumulInteg2[1]*mAveMeanWgtSqr*mAveMeanWgtSqr,1./4.);
1101 double tempMeanVMixSq = cumulIntegMix[j]/tempMeanV;
1103 if (tempMeanVMixSq>0.)
1104 meanIntegVMix[j] = sqrt(tempMeanVMixSq);
1105 else cout<<
"### <wgt*v1>**2 = "<<tempMeanVMixSq<<
" < 0. failed "<<endl;
1108 histTitle =
new TString(
"Flow_CumulMix_v2D_Sel");
1110 histTitle->Append(
"_Har");
1112 histFull[k].histFullHar[j].mHistMix_v2D =
1113 new TH2D(*(histFull[k].histFullHar[j].mHistCumulMix2D->
1114 ProjectionXY(histTitle->Data(),
"e")));
1115 histFull[k].histFullHar[j].mHistMix_v2D->SetTitle(histTitle->Data());
1116 histFull[k].histFullHar[j].mHistMix_v2D->SetXTitle((
char*)xLabel.Data());
1117 histFull[k].histFullHar[j].mHistMix_v2D->SetYTitle(
"Pt (GeV)");
1118 histFull[k].histFullHar[j].mHistMix_v2D->SetZTitle(
"v (%)");
1121 histFull[k].histFullHar[j].mHistMix_v2D->Scale(1./profScale);
1123 histTitle =
new TString(
"Flow_CumulMix_vEta_Sel");
1125 histTitle->Append(
"_Har");
1127 histFull[k].histFullHar[j].mHistMix_vEta =
1128 new TH1D(*(histFull[k].histFullHar[j].mHistCumulMixEta->
1129 ProjectionX(histTitle->Data(),
"e")));
1130 histFull[k].histFullHar[j].mHistMix_vEta->SetTitle(histTitle->Data());
1131 histFull[k].histFullHar[j].mHistMix_vEta->SetXTitle((
char*)xLabel.Data());
1132 histFull[k].histFullHar[j].mHistMix_vEta->SetYTitle(
"v (%)");
1135 histFull[k].histFullHar[j].mHistMix_vEta->Scale(1./profScale);
1138 histTitle =
new TString(
"Flow_CumulMix_vPt_Sel");
1140 histTitle->Append(
"_Har");
1142 histFull[k].histFullHar[j].mHistMix_vPt =
1143 new TH1D(*(histFull[k].histFullHar[j].mHistCumulMixPt->
1144 ProjectionX(histTitle->Data(),
"e")));
1145 histFull[k].histFullHar[j].mHistMix_vPt->SetTitle(histTitle->Data());
1146 histFull[k].histFullHar[j].mHistMix_vPt->SetXTitle(
"Pt (GeV)");
1147 histFull[k].histFullHar[j].mHistMix_vPt->SetYTitle(
"v (%)");
1150 histFull[k].histFullHar[j].mHistMix_vPt->Scale(1./profScale);
1152 histFull[k].histFullHar[j].mHistMix_v2D->Scale(1./(tempMeanV*meanIntegVMix[j]*perCent));
1153 histFull[k].histFullHar[j].mHistMix_vEta->Scale(1./(tempMeanV*meanIntegVMix[j]*perCent));
1154 histFull[k].histFullHar[j].mHistMix_vPt->Scale(1./(tempMeanV*meanIntegVMix[j]*perCent));
1155 histFull[k].mHistMix_v->Scale(1./(tempMeanV*meanIntegVMix[j]*perCent));
1157 savedHistNames->AddLast(histFull[k].histFullHar[j].mHistMix_v2D);
1158 savedHistNames->AddLast(histFull[k].histFullHar[j].mHistMix_vEta);
1159 savedHistNames->AddLast(histFull[k].histFullHar[j].mHistMix_vPt);
1160 savedHistNames->AddLast(histFull[k].mHistMix_v);
1168 TH1D* histOfMeanIntegV =
new TH1D(*(histFull[k].mHist_v[0]));
1169 histOfMeanIntegV->Reset();
1171 TH1D* histOfMeanIntegV3 =
new TH1D(*(histFull[k].mHist_v[1]));
1172 histOfMeanIntegV3->Reset();
1174 for (
int j = 1; j < Flow::nHars+1; j++) {
1175 histOfMeanIntegV->SetBinContent(j, 1./(meanIntegV[j-1]*perCent));
1176 histOfMeanIntegV->SetBinError(j,0.);
1177 histOfMeanIntegV3->SetBinContent(j, -1./(meanIntegV3[j-1]*perCent));
1178 histOfMeanIntegV3->SetBinError(j,0.);
1180 histFull[k].mHist_v[0]->Multiply(histOfMeanIntegV);
1181 histFull[k].mHist_v[1]->Multiply(histOfMeanIntegV3);
1184 for (
int ord = 0; ord < Flow::nCumulDiffOrders; ord++){
1185 for (
int j=0; j<histFull[k].mHist_v[ord]->GetNbinsX(); j++) {
1186 if ( !(histFull[k].mHist_v[ord]->GetBinContent(j) < FLT_MAX &&
1187 histFull[k].mHist_v[ord]->GetBinContent(j) > -1.*FLT_MAX) ) {
1188 histFull[k].mHist_v[ord]->SetBinContent(j,0.);
1189 histFull[k].mHist_v[ord]->SetBinError(j,0.);
1194 for (
int j = 1; j < Flow::nHars+1; j++) {
1195 cout <<
"##### 2-part v" << j <<
" = ("
1196 << histFull[k].mHist_v[0]->GetBinContent(j)
1197 <<
" +/- "<< histFull[k].mHist_v[0]->GetBinError(j)<<
" )"<<endl;
1198 cout <<
"##### 4-part v" << j <<
" = ("
1199 << histFull[k].mHist_v[1]->GetBinContent(j)
1200 <<
" +/- "<< histFull[k].mHist_v[1]->GetBinError(j)<<
" )"<<endl;
1203 delete histOfMeanIntegV;
1204 delete histOfMeanIntegV3;
1206 }
else if (m_M==2) {
1208 TH1D* histOfMeanIntegV2 =
new TH1D(*(histFull[k].mHist_v[0]));
1209 histOfMeanIntegV2->Reset();
1211 TH1D* histOfMeanIntegV4 =
new TH1D(*(histFull[k].mHist_v[1]));
1212 histOfMeanIntegV4->Reset();
1214 for (
int j = 1; j < Flow::nHars+1; j++) {
1215 histOfMeanIntegV2->SetBinContent(j, 1./(meanIntegV2[j-1]*perCent));
1216 histOfMeanIntegV2->SetBinError(j,0.);
1217 histOfMeanIntegV4->SetBinContent(j, -0.5/(meanIntegV4[j-1]*perCent));
1218 histOfMeanIntegV4->SetBinError(j,0.);
1220 histFull[k].mHist_v[0]->Multiply(histOfMeanIntegV2);
1221 histFull[k].mHist_v[1]->Multiply(histOfMeanIntegV4);
1224 for (
int ord = 0; ord < Flow::nCumulDiffOrders; ord++){
1225 for (
int j=0; j<histFull[k].mHist_v[ord]->GetNbinsX(); j++) {
1226 if ( !(histFull[k].mHist_v[ord]->GetBinContent(j) < FLT_MAX &&
1227 histFull[k].mHist_v[ord]->GetBinContent(j) > -1.*FLT_MAX) ){
1228 histFull[k].mHist_v[ord]->SetBinContent(j,0.);
1229 histFull[k].mHist_v[ord]->SetBinError(j,0.);
1234 for (
int j = 1; j < Flow::nHars+1; j++) {
1235 cout <<
"##### 2-part v" << j <<
" = ("
1236 << histFull[k].mHist_v[0]->GetBinContent(j)
1237 <<
") +/- "<< histFull[k].mHist_v[0]->GetBinError(j)<<endl;
1238 cout <<
"##### 4-part v" << j <<
" = ("
1239 << histFull[k].mHist_v[1]->GetBinContent(j)
1240 <<
") +/- "<< histFull[k].mHist_v[1]->GetBinError(j)<<endl;
1243 delete histOfMeanIntegV2;
1244 delete histOfMeanIntegV4;
1247 for (
int ord = 0; ord < Flow::nCumulDiffOrders; ord++)
1248 savedHistNames->AddLast(histFull[k].mHist_v[ord]);
1255 TFile histFile(
"flow.cumulant.root",
"RECREATE");
1256 for (
int k = 0; k < Flow::nSels; k++) {
1257 for (
int j = 0; j < Flow::nHars; j++) {
1258 for (
int pq = 0; pq < Flow::nCumulMixHar_pMax*Flow::nCumulMixHar_qMax ; pq++) {
1259 XpqYpqDenomNames->AddLast(histFull[k].histFullHar[j].mCumulG0MixDenom[pq]);
1264 TVectorD* cumulConstants =
new TVectorD(30);
1265 (*cumulConstants)(0)=
double(Flow::nHars);
1266 (*cumulConstants)(1)=
double(Flow::nSels);
1267 (*cumulConstants)(2)=
double(Flow::nSubs);
1268 (*cumulConstants)(3)=
double(Flow::nPhiBins);
1269 (*cumulConstants)(4)=
double(Flow::nPhiBinsFtpc);
1270 (*cumulConstants)(5)=
double(mNEtaBins);
1271 (*cumulConstants)(6)=
double(nPtBinsPart);
1272 (*cumulConstants)(7)=
double(Flow::nCumulIntegOrders);
1273 (*cumulConstants)(8)=
double(Flow::nCumulInteg_qMax);
1274 (*cumulConstants)(9)=
double(Flow::nCumulDiffOrders);
1275 (*cumulConstants)(10)=
double(Flow::nCumulDiff_qMax);
1276 (*cumulConstants)(11)=
double(Flow::nCumulMixHar_pMax);
1277 (*cumulConstants)(12)=
double(Flow::nCumulMixHar_qMax);
1278 (*cumulConstants)(13)=r0;
1279 (*cumulConstants)(14)=m_M;
1280 (*cumulConstants)(15)=(strlen(pFlowSelect->PidPart()) != 0) ? 1 : 0;
1281 (*cumulConstants)(16)=r0Mix;
1282 (*cumulConstants)(17)=
double(profScale);
1284 cumulConstants->Write(
"CumulConstants",TObject::kOverwrite | TObject::kSingleKey);
1285 savedHistNames->AddLast(cumulConstants);
1287 TObjString* cumulMethodTag =
new TObjString(
"cumulNew" );
1288 cumulMethodTag->Write(
"CumulMethodTag",TObject::kOverwrite | TObject::kSingleKey);
1289 savedHistNames->AddLast(cumulMethodTag);
1291 savedHistNames->Write();
1296 TFile XpqYpqDenomNewFile(
"denominatorNew.root",
"RECREATE");
1297 XpqYpqDenomNames->Write();
1298 XpqYpqDenomNewFile.Close();
1299 delete XpqYpqDenomNames;
1308 void StFlowCumulantMaker::SetHistoRanges(Bool_t ftpc_included) {
1310 if (ftpc_included) {
1311 mEtaMin = Flow::etaMin;
1312 mEtaMax = Flow::etaMax;
1313 mNEtaBins = Flow::nEtaBins;
1316 mEtaMin = Flow::etaMinTpcOnly;
1317 mEtaMax = Flow::etaMaxTpcOnly;
1318 mNEtaBins = Flow::nEtaBinsTpcOnly;