25 #include "StFlowDirectCumulantMaker.h"
26 #include "StFlowMaker/StFlowMaker.h"
27 #include "StFlowMaker/StFlowEvent.h"
28 #include "StFlowMaker/StFlowConstants.h"
29 #include "StFlowMaker/StFlowSelection.h"
30 #include "PhysicalConstants.h"
31 #include "SystemOfUnits.h"
35 #include "StMessMgr.h"
36 #define PR(x) cout << "##### FlowAnalysis: " << (#x) << " = " << (x) << endl;
48 StMaker(name), MakerName(name) {
52 StFlowDirectCumulantMaker::~StFlowDirectCumulantMaker() {
62 if (pFlowMaker) pFlowEvent = pFlowMaker->FlowEventPointer();
64 int runID = pFlowEvent->RunID();
68 if (Mweights[0][0] != 1.) {
69 gMessMgr->Info(
"##### FlowDirCumulant: Setting Multiplicity Weights to 1");
71 for(
int i=0; i<30; i++){
73 for(
int j=0; j<1000; j++){
86 gMessMgr->Info(
"##### FlowDirCumulant: FlowEvent pointer null");
90 if (Debug()) StMaker::PrintInfo();
96 Int_t StFlowDirectCumulantMaker::Init() {
98 cout << endl <<
"StFlowDirectCumulantMaker::Init()" << endl;
119 const int ptbins = Flow::PTBINS - 1;
121 for(
int term=0; term<Flow::TERMS; term++){
122 for(
int type=0; type<Flow::TYPES; type++){
123 for(
int phase=0; phase<Flow::PHASES; phase++){
124 for(
int species=0; species<Flow::SPECIES; species++){
126 name =
new TString(
"Term_");
129 if(type==0) name->Append(
"_D");
130 else name->Append(
"_I");
132 if(phase==0) name->Append(
"_cos_");
133 else name->Append(
"_sin_");
137 Term[term].Type[type].Phase[phase].Species[species].Sum_Singles =
new TH2D(name->Data(),
"Correlation Sum",Flow::nCents,.5,Flow::nCents+0.5,ptbins,0.05,ptbins/10.+0.05);
138 Term[term].Type[type].Phase[phase].Species[species].Sum_Singles->GetXaxis()->SetTitle(
"Centrality bin");
139 Term[term].Type[type].Phase[phase].Species[species].Sum_Singles->GetYaxis()->SetTitle(
"p_{t} bin/10");
142 Term[term].Type[type].Phase[phase].Species[species].Sum_Squares =
new TH2D(name->Data(),
"Squares Sum",Flow::nCents,.5,Flow::nCents+0.5,ptbins,0.05,ptbins/10.+0.05);
143 Term[term].Type[type].Phase[phase].Species[species].Sum_Squares->GetXaxis()->SetTitle(
"Centrality bin");
144 Term[term].Type[type].Phase[phase].Species[species].Sum_Squares->GetYaxis()->SetTitle(
"p_{t} bin/10");
151 for(
int species=0; species<Flow::SPECIES; species++){
152 name =
new TString(
"Cent_Pt_yields_");
154 Entries[species].cent_yields =
new TH2D(name->Data(),
"Pt_spectrum",Flow::nCents,.5,Flow::nCents+0.5,ptbins,0.05,ptbins/10.+0.05);
155 Entries[species].cent_yields->GetXaxis()->SetTitle(
"Centrality bin");
156 Entries[species].cent_yields->GetYaxis()->SetTitle(
"p_{t} bin");
159 Event_counter =
new TH1D(
"Event_counter",
"Event_counter",Flow::nCents,0.5,Flow::nCents+0.5);
160 Event_counterWeighted =
new TH1D(
"Event_counterWeighted",
"Event_counterWeighted",Flow::nCents,0.5,Flow::nCents+0.5);
161 Event_counterWeighted->Sumw2();
163 gMessMgr->SetLimit(
"##### FlowDirCumu", 2);
164 gMessMgr->Info(
"##### FlowDirCumu: $Id: StFlowDirectCumulantMaker.cxx,v 1.2 2010/06/10 16:33:53 posk Exp $");
166 return StMaker::Init();
170 void StFlowDirectCumulantMaker::GetMweights() {
173 TFile* WeightFile =
new TFile(
"M_WeightsY7.root",
"READ");
175 if(WeightFile->IsOpen()) {
176 for(
int i=0; i<30; i++){
177 for(
int j=0; j<1000; j++){
179 Mweights[i][j] = ((TH2D*)WeightFile->Get(
"Weights"))->GetBinContent(i+1,j+1);
185 gMessMgr->Info(
"##### FlowDirCumulant: No year 7 Multiplicity Weights");
186 for(
int i=0; i<30; i++){
187 for(
int j=0; j<1000; j++){
195 void StFlowDirectCumulantMaker::FillParticleArrays() {
198 grefmult = pFlowEvent->MultEta();
202 for(
int i=0; i<30; i++){
203 if( (vertex[2] > (2*i-30)) && (vertex[2] < (2*(i+1)-30)) ){
212 for(
int i=0; i<Flow::PTBINS; i++) {
213 pt_bin_counter_p[i]=0;
217 StFlowTrackCollection* pFlowTracks_primary = pFlowEvent->TrackCollection();
218 StFlowTrackIterator itr;
222 for (itr = pFlowTracks_primary->begin(); itr != pFlowTracks_primary->end(); itr++) {
226 phi_p[p_count] = pFlowTrack->Phi();
227 if(phi_p[p_count] < 0.) phi_p[p_count] += twopi;
228 id_p[p_count] = pFlowTrack->id();
229 pt_p[p_count] = pFlowTrack->Pt();
231 weights_p[p_count] = 1.0;
232 if (pFlowEvent->PtWgt()) {
233 weights_p[p_count] *= (pt_p[p_count] < pFlowEvent->PtWgtSaturation()) ? pt_p[p_count] :
234 pFlowEvent->PtWgtSaturation();
237 if(pt_p[p_count] <= .2 ) { ptbin_p[p_count] = 1;
goto ptbin; }
238 else if(pt_p[p_count] <= .4 ) { ptbin_p[p_count] = 3;
goto ptbin; }
239 else if(pt_p[p_count] <= .6 ) { ptbin_p[p_count] = 5;
goto ptbin; }
240 else if(pt_p[p_count] <= .8 ) { ptbin_p[p_count] = 7;
goto ptbin; }
241 else if(pt_p[p_count] <= 1.0) { ptbin_p[p_count] = 9;
goto ptbin; }
242 else if(pt_p[p_count] <= 1.2) { ptbin_p[p_count] =11;
goto ptbin; }
243 else if(pt_p[p_count] <= 1.4) { ptbin_p[p_count] =13;
goto ptbin; }
244 else if(pt_p[p_count] <= 1.6) { ptbin_p[p_count] =15;
goto ptbin; }
245 else if(pt_p[p_count] <= 1.8) { ptbin_p[p_count] =17;
goto ptbin; }
246 else if(pt_p[p_count] <= 2.0) { ptbin_p[p_count] =19;
goto ptbin; }
247 else if(pt_p[p_count] <= 2.2) { ptbin_p[p_count] =21;
goto ptbin; }
248 else if(pt_p[p_count] <= 2.4) { ptbin_p[p_count] =23;
goto ptbin; }
249 else if(pt_p[p_count] <= 2.6) { ptbin_p[p_count] =25;
goto ptbin; }
250 else if(pt_p[p_count] <= 2.8) { ptbin_p[p_count] =27;
goto ptbin; }
251 else if(pt_p[p_count] <= 3.2) { ptbin_p[p_count] =30;
goto ptbin; }
252 else if(pt_p[p_count] <= 3.6) { ptbin_p[p_count] =34;
goto ptbin; }
253 else if(pt_p[p_count] <= 4.0) { ptbin_p[p_count] =38;
goto ptbin; }
254 else if(pt_p[p_count] <= 4.4) { ptbin_p[p_count] =42;
goto ptbin; }
255 else if(pt_p[p_count] <= 4.8) { ptbin_p[p_count] =46;
goto ptbin; }
256 else if(pt_p[p_count] <= 5.2) { ptbin_p[p_count] =50;
goto ptbin; }
257 else if(pt_p[p_count] <= 5.6) { ptbin_p[p_count] =54;
goto ptbin; }
258 else if(pt_p[p_count] <= 6.0) { ptbin_p[p_count] =58;
goto ptbin; }
259 else { ptbin_p[p_count] =60; }
262 pt_bin_counter_p[ptbin_p[p_count]]++;
264 if(p_count == Flow::MAXMULT) {
265 gMessMgr->Info(
"##### FlowDirCumulant: MAXMULT not big enough");
273 void StFlowDirectCumulantMaker::CalculateTerms() {
276 if(p_count < 4)
return;
279 CalculateSumTerms(kTRUE);
280 CalculateCorrelationsIntegrated();
283 CalculateSumTerms(kFALSE);
284 CalculateCorrelationsDifferential();
289 void StFlowDirectCumulantMaker::CalculateSumTerms(
bool integrated) {
302 for(
int species=0; species<Flow::SPECIES; species++){
306 for(
int one=0; one<max; one++){
309 phi_one = phi_p[one];
310 ptbin_one = ptbin_p[one];
312 if(integrated == kTRUE) W_one = weights_p[one];
315 sum_1_cos_diff[species][ptbin_one] += cos(2*phi_one)*W_one;
316 sum_1_sin_diff[species][ptbin_one] += sin(2*phi_one)*W_one;
317 sum_2_cos_diff[species][ptbin_one] += cos(-2*phi_one)*W_one;
318 sum_2_sin_diff[species][ptbin_one] += sin(-2*phi_one)*W_one;
320 sum_1_cos_full[species] += cos(2*phi_one)*W_one;
321 sum_1_sin_full[species] += sin(2*phi_one)*W_one;
322 sum_2_cos_full[species] += cos(-2*phi_one)*W_one;
323 sum_2_sin_full[species] += sin(-2*phi_one)*W_one;
325 for(
int two=0; two<p_count; two++){
328 if(integrated == kTRUE || species==0) {
if(id_p[two] == id_one)
continue;}
329 W_two = weights_p[two];
331 sum_3_cos_diff[species][ptbin_one][ptbin_p[two]] += cos(2*(phi_one-phi_p[two]))*W_one*W_two;
332 sum_3_sin_diff[species][ptbin_one][ptbin_p[two]] += sin(2*(phi_one-phi_p[two]))*W_one*W_two;
334 sum_4_cos_diff[species][ptbin_one][ptbin_p[two]] += cos(2*(phi_one-phi_p[two]))*cos(2*(phi_one-phi_p[two]))*W_one*W_two*W_one*W_two;
335 sum_4_sin_diff[species][ptbin_one][ptbin_p[two]] += sin(2*(phi_one-phi_p[two]))*sin(2*(phi_one-phi_p[two]))*W_one*W_two*W_one*W_two;
337 sum_5_cos_diff[species][ptbin_one][ptbin_p[two]] += cos(2*(phi_one-phi_p[two]))*cos(2*phi_p[two])*W_one*W_two*W_two;
338 sum_5_sin_diff[species][ptbin_one][ptbin_p[two]] += sin(2*(phi_one-phi_p[two]))*sin(2*phi_p[two])*W_one*W_two*W_two;
340 sum_6_cos_sin_diff[species][ptbin_one][ptbin_p[two]] += cos(2*(phi_one-phi_p[two]))*sin(2*phi_p[two])*W_one*W_two*W_two;
341 sum_6_sin_cos_diff[species][ptbin_one][ptbin_p[two]] += sin(2*(phi_one-phi_p[two]))*cos(2*phi_p[two])*W_one*W_two*W_two;
343 sum_7_diff[species][ptbin_one][ptbin_p[two]] += cos(2*(phi_one-phi_p[two]))*cos(2*phi_p[two])*cos(2*phi_one)*W_one*W_two*W_one*W_two;
345 sum_8_diff[species][ptbin_one][ptbin_p[two]] += cos(2*(phi_one-phi_p[two]))*cos(2*phi_p[two])*cos(2*phi_p[two])*W_one*W_two*W_two*W_two;
347 sum_9_diff[species][ptbin_one][ptbin_p[two]] += cos(2*(phi_one-phi_p[two]))*sin(2*phi_p[two])*sin(-2*phi_one)*W_one*W_two*W_one*W_two;
349 sum_10_diff[species][ptbin_one][ptbin_p[two]] += cos(2*(phi_one-phi_p[two]))*sin(2*phi_p[two])*sin(-2*phi_p[two])*W_one*W_two*W_two*W_two;
351 sum_11_cos_diff[species][ptbin_one][ptbin_p[two]] += cos(2*(phi_one+phi_p[two]))*W_one*W_two;
352 sum_11_sin_diff[species][ptbin_one][ptbin_p[two]] += sin(2*(phi_one+phi_p[two]))*W_one*W_two;
357 int min_bin=0, max_bin=0;
358 for(
int ptbin1=0; ptbin1<Flow::PTBINS; ptbin1++){
360 if(integrated == kTRUE) {min_bin=0; max_bin=Flow::PTBINS;}
361 else {min_bin = ptbin1; max_bin = ptbin1+1;}
363 for(
int ptbin2=min_bin; ptbin2<max_bin; ptbin2++){
365 if(integrated == kTRUE) {
if(species==0)
if(ptbin1==ptbin2)
continue;}
367 for(
int ptbin3=0; ptbin3<Flow::PTBINS; ptbin3++){
369 if(species==0)
if(ptbin1==ptbin3)
continue;
371 sum_3_cos[species][ptbin1] += sum_3_cos_diff[species][ptbin2][ptbin3];
372 sum_3_sin[species][ptbin1] += sum_3_sin_diff[species][ptbin2][ptbin3];
374 sum_4_cos[species][ptbin1] += sum_4_cos_diff[species][ptbin2][ptbin3];
375 sum_4_sin[species][ptbin1] += sum_4_sin_diff[species][ptbin2][ptbin3];
377 sum_5_cos[species][ptbin1] += sum_5_cos_diff[species][ptbin2][ptbin3];
378 sum_5_sin[species][ptbin1] += sum_5_sin_diff[species][ptbin2][ptbin3];
380 sum_6_cos_sin[species][ptbin1] += sum_6_cos_sin_diff[species][ptbin2][ptbin3];
381 sum_6_sin_cos[species][ptbin1] += sum_6_sin_cos_diff[species][ptbin2][ptbin3];
383 sum_7[species][ptbin1] += sum_7_diff[species][ptbin2][ptbin3];
385 sum_8[species][ptbin1] += sum_8_diff[species][ptbin2][ptbin3];
387 sum_9[species][ptbin1] += sum_9_diff[species][ptbin2][ptbin3];
389 sum_10[species][ptbin1] += sum_10_diff[species][ptbin2][ptbin3];
391 sum_11_cos[species][ptbin1] += sum_11_cos_diff[species][ptbin2][ptbin3];
392 sum_11_sin[species][ptbin1] += sum_11_sin_diff[species][ptbin2][ptbin3];
397 if(integrated == kTRUE){
398 sum_3_cos_reference[species][ptbin1] = sum_3_cos[species][ptbin1];
399 sum_3_sin_reference[species][ptbin1] = sum_3_sin[species][ptbin1];
401 sum_11_cos_reference[species][ptbin1] = sum_11_cos[species][ptbin1];
402 sum_11_sin_reference[species][ptbin1] = sum_11_sin[species][ptbin1];
405 sum_1_cos[species][ptbin1] = sum_1_cos_full[species] - sum_1_cos_diff[species][ptbin1];
406 sum_1_sin[species][ptbin1] = sum_1_sin_full[species] - sum_1_sin_diff[species][ptbin1];
407 sum_2_cos[species][ptbin1] = sum_2_cos_full[species] - sum_2_cos_diff[species][ptbin1];
408 sum_2_sin[species][ptbin1] = sum_2_sin_full[species] - sum_2_sin_diff[species][ptbin1];
410 sum_1_cos_reference[species][ptbin1] = sum_1_cos_full[species] - sum_1_cos_diff[species][ptbin1];
411 sum_1_sin_reference[species][ptbin1] = sum_1_sin_full[species] - sum_1_sin_diff[species][ptbin1];
412 sum_2_cos_reference[species][ptbin1] = sum_2_cos_full[species] - sum_2_cos_diff[species][ptbin1];
413 sum_2_sin_reference[species][ptbin1] = sum_2_sin_full[species] - sum_2_sin_diff[species][ptbin1];
416 sum_1_cos[species][ptbin1] = sum_1_cos_full[species];
417 sum_1_sin[species][ptbin1] = sum_1_sin_full[species];
418 sum_2_cos[species][ptbin1] = sum_2_cos_full[species];
419 sum_2_sin[species][ptbin1] = sum_2_sin_full[species];
421 sum_1_cos_reference[species][ptbin1] = sum_1_cos_full[species];
422 sum_1_sin_reference[species][ptbin1] = sum_1_sin_full[species];
423 sum_2_cos_reference[species][ptbin1] = sum_2_cos_full[species];
424 sum_2_sin_reference[species][ptbin1] = sum_2_sin_full[species];
428 sum_1_cos[species][ptbin1] = sum_1_cos_diff[species][ptbin1];
429 sum_1_sin[species][ptbin1] = sum_1_sin_diff[species][ptbin1];
430 sum_2_cos[species][ptbin1] = sum_2_cos_diff[species][ptbin1];
431 sum_2_sin[species][ptbin1] = sum_2_sin_diff[species][ptbin1];
441 void StFlowDirectCumulantMaker::Combinations(Bool_t integrated,
int species,
int counter) {
450 if(integrated==kTRUE) {
452 ref_combos_4 = (p_count-pt_bin_counter_p[counter])*(p_count-pt_bin_counter_p[counter]-1)*(p_count-pt_bin_counter_p[counter]-2);
453 ref_combos_4 *=(p_count-pt_bin_counter_p[counter]-3);
454 ref_combos_3 = (p_count-pt_bin_counter_p[counter])*(p_count-pt_bin_counter_p[counter]-1)*(p_count-pt_bin_counter_p[counter]-2);
455 ref_combos_2 = (p_count-pt_bin_counter_p[counter])*(p_count-pt_bin_counter_p[counter]-1);
456 ref_combos_1 = (p_count-pt_bin_counter_p[counter]);
457 ref_combos_0 = (p_count-pt_bin_counter_p[counter]);
462 ref_combos_4 = pt_bin_counter_p[counter]*(p_count-pt_bin_counter_p[counter])*(p_count-pt_bin_counter_p[counter]-1);
463 ref_combos_4 *= (p_count-pt_bin_counter_p[counter]-2);
464 ref_combos_3 = pt_bin_counter_p[counter]*(p_count-pt_bin_counter_p[counter])*(p_count-pt_bin_counter_p[counter]-1);
465 ref_combos_2 = pt_bin_counter_p[counter]*(p_count-pt_bin_counter_p[counter]);
466 ref_combos_1 = pt_bin_counter_p[counter];
467 ref_combos_0 = (p_count-pt_bin_counter_p[counter]);
474 void StFlowDirectCumulantMaker::CalculateCorrelationsDifferential() {
480 for(
int species=0; species<Flow::SPECIES; species++){
482 for(
int ptbin=0; ptbin<Flow::PTBINS; ptbin++){
484 Combinations(kFALSE,species,ptbin);
486 if(ref_combos_4 == 0)
continue;
487 if(ref_combos_3 == 0)
continue;
488 if(ref_combos_2 == 0)
continue;
489 if(ref_combos_1 == 0)
continue;
490 if(ref_combos_0 == 0)
continue;
492 Cumulant_Terms[TERM1][DIF][COS][species][ptbin] = sum_3_cos[species][ptbin]*sum_3_cos_reference[species][ptbin];
493 Cumulant_Terms[TERM1][DIF][COS][species][ptbin] -= 2*(sum_5_cos[species][ptbin]*sum_2_cos_reference[species][ptbin] - sum_8[species][ptbin]);
494 Cumulant_Terms[TERM1][DIF][COS][species][ptbin] += 2*(sum_6_cos_sin[species][ptbin]*sum_2_sin_reference[species][ptbin] - sum_10[species][ptbin]);
495 Cumulant_Terms[TERM1][DIF][COS][species][ptbin] /= double(ref_combos_4);
497 Cumulant_Terms[TERM2][DIF][COS][species][ptbin] = sum_3_cos[species][ptbin]/double(ref_combos_2);
498 Cumulant_Terms[TERM2][DIF][SIN][species][ptbin] = sum_3_sin[species][ptbin]/double(ref_combos_2);
500 Cumulant_Terms[TERM4][DIF][COS][species][ptbin] = sum_1_cos[species][ptbin]/double(ref_combos_1);
501 Cumulant_Terms[TERM4][DIF][SIN][species][ptbin] = sum_1_sin[species][ptbin]/double(ref_combos_1);
503 Cumulant_Terms[TERM7][DIF][COS][species][ptbin] = ((sum_3_cos[species][ptbin]*sum_2_cos_reference[species][ptbin] - sum_5_cos[species][ptbin]));
504 Cumulant_Terms[TERM7][DIF][COS][species][ptbin] -= (sum_3_sin[species][ptbin]*sum_2_sin_reference[species][ptbin] + sum_5_sin[species][ptbin]);
505 Cumulant_Terms[TERM7][DIF][COS][species][ptbin] /= double(ref_combos_3);
507 Cumulant_Terms[TERM7][DIF][SIN][species][ptbin] = (sum_3_sin[species][ptbin]*sum_2_cos_reference[species][ptbin]) + (sum_3_cos[species][ptbin]*sum_2_sin_reference[species][ptbin]);
508 Cumulant_Terms[TERM7][DIF][SIN][species][ptbin] -= (sum_6_sin_cos[species][ptbin] - sum_6_cos_sin[species][ptbin]);
509 Cumulant_Terms[TERM7][DIF][SIN][species][ptbin] /= double(ref_combos_3);
511 Cumulant_Terms[TERM9][DIF][COS][species][ptbin] = ((sum_3_cos[species][ptbin]*sum_1_cos_reference[species][ptbin] - sum_5_cos[species][ptbin]));
512 Cumulant_Terms[TERM9][DIF][COS][species][ptbin] -= (sum_3_sin[species][ptbin]*sum_1_sin_reference[species][ptbin] - sum_5_sin[species][ptbin]);
513 Cumulant_Terms[TERM9][DIF][COS][species][ptbin] /= double(ref_combos_3);
515 Cumulant_Terms[TERM9][DIF][SIN][species][ptbin] = (sum_3_sin[species][ptbin]*sum_1_cos_reference[species][ptbin]) + (sum_3_cos[species][ptbin]*sum_1_sin_reference[species][ptbin]);
516 Cumulant_Terms[TERM9][DIF][SIN][species][ptbin] -= (sum_6_sin_cos[species][ptbin] + sum_6_cos_sin[species][ptbin]);
517 Cumulant_Terms[TERM9][DIF][SIN][species][ptbin] /= double(ref_combos_3);
519 Cumulant_Terms[TERM10][DIF][COS][species][ptbin] = sum_11_cos[species][ptbin]/double(ref_combos_2);
520 Cumulant_Terms[TERM10][DIF][SIN][species][ptbin] = sum_11_sin[species][ptbin]/double(ref_combos_2);
527 void StFlowDirectCumulantMaker::CalculateCorrelationsIntegrated() {
533 for(
int species=0; species<Flow::SPECIES; species++){
535 for(
int ptbin=0; ptbin<Flow::PTBINS; ptbin++){
537 Combinations(kTRUE,species,ptbin);
539 if(ref_combos_4 == 0)
continue;
540 if(ref_combos_3 == 0)
continue;
541 if(ref_combos_2 == 0)
continue;
542 if(ref_combos_1 == 0)
continue;
543 if(ref_combos_0 == 0)
continue;
545 Cumulant_Terms[TERM1][INT][COS][species][ptbin] = sum_3_cos[species][ptbin]*sum_3_cos[species][ptbin] - 2*sum_4_cos[species][ptbin];
546 Cumulant_Terms[TERM1][INT][COS][species][ptbin] -= 4*((sum_5_cos[species][ptbin]*sum_2_cos[species][ptbin] - sum_8[species][ptbin] - sum_7[species][ptbin]) - (sum_6_cos_sin[species][ptbin]*sum_2_sin[species][ptbin] - sum_10[species][ptbin] - sum_9[species][ptbin]));
547 Cumulant_Terms[TERM1][INT][COS][species][ptbin] /= double(ref_combos_4);
549 Cumulant_Terms[TERM2][INT][COS][species][ptbin] = sum_3_cos[species][ptbin]/double(ref_combos_2);
550 Cumulant_Terms[TERM2][INT][SIN][species][ptbin] = sum_3_sin[species][ptbin]/double(ref_combos_2);
551 Cumulant_Terms[TERM3][INT][COS][species][ptbin] = sum_3_cos[species][ptbin]/double(ref_combos_2);
552 Cumulant_Terms[TERM3][INT][SIN][species][ptbin] = sum_3_sin[species][ptbin]/double(ref_combos_2);
554 Cumulant_Terms[TERM4][INT][COS][species][ptbin] = sum_1_cos[species][ptbin]/double(ref_combos_1);
555 Cumulant_Terms[TERM4][INT][SIN][species][ptbin] = sum_1_sin[species][ptbin]/double(ref_combos_1);
557 Cumulant_Terms[TERM5][INT][COS][species][ptbin] = (sum_3_cos[species][ptbin]*sum_2_cos[species][ptbin] - sum_3_sin[species][ptbin]*sum_2_sin[species][ptbin]);
558 Cumulant_Terms[TERM5][INT][COS][species][ptbin] -= 2*(sum_5_cos[species][ptbin]);
559 Cumulant_Terms[TERM5][INT][COS][species][ptbin] /= double(ref_combos_3);
560 Cumulant_Terms[TERM5][INT][SIN][species][ptbin] = (sum_3_cos[species][ptbin]*sum_2_sin[species][ptbin] + sum_3_sin[species][ptbin]*sum_2_cos[species][ptbin]);
562 Cumulant_Terms[TERM5][INT][SIN][species][ptbin] += 2*(sum_6_cos_sin[species][ptbin]);
563 Cumulant_Terms[TERM5][INT][SIN][species][ptbin] /= double(ref_combos_3);
565 Cumulant_Terms[TERM6][INT][COS][species][ptbin] = sum_1_cos[species][ptbin]/double(ref_combos_1);
566 Cumulant_Terms[TERM6][INT][SIN][species][ptbin] = sum_1_sin[species][ptbin]/double(ref_combos_1);
568 Cumulant_Terms[TERM7][INT][COS][species][ptbin] = Cumulant_Terms[TERM5][INT][COS][species][ptbin];
569 Cumulant_Terms[TERM7][INT][SIN][species][ptbin] = Cumulant_Terms[TERM5][INT][SIN][species][ptbin];
571 Cumulant_Terms[TERM8][INT][COS][species][ptbin] = sum_2_cos[species][ptbin]/double(ref_combos_1);
572 Cumulant_Terms[TERM8][INT][SIN][species][ptbin] = sum_2_sin[species][ptbin]/double(ref_combos_1);
574 Cumulant_Terms[TERM9][INT][COS][species][ptbin] = ((sum_3_cos[species][ptbin]*sum_1_cos[species][ptbin] - 2*sum_5_cos[species][ptbin]));
575 Cumulant_Terms[TERM9][INT][COS][species][ptbin] -= (sum_3_sin[species][ptbin]*sum_1_sin[species][ptbin]);
576 Cumulant_Terms[TERM9][INT][COS][species][ptbin] /= double(ref_combos_3);
577 Cumulant_Terms[TERM9][INT][SIN][species][ptbin] = ((sum_3_cos[species][ptbin]*sum_1_sin[species][ptbin] - 2*sum_6_cos_sin[species][ptbin]));
578 Cumulant_Terms[TERM9][INT][SIN][species][ptbin] += (sum_3_sin[species][ptbin]*sum_1_cos[species][ptbin]);
579 Cumulant_Terms[TERM9][INT][SIN][species][ptbin] /= double(ref_combos_3);
581 Cumulant_Terms[TERM10][INT][COS][species][ptbin] = sum_11_cos[species][ptbin]/double(ref_combos_2);
582 Cumulant_Terms[TERM10][INT][SIN][species][ptbin] = sum_11_sin[species][ptbin]/double(ref_combos_2);
590 void StFlowDirectCumulantMaker::Fill_Histograms() {
593 Event_counter->Fill(pFlowEvent->Centrality());
594 if (Mweights[zbin-1][grefmult-1] < 12.2) {
595 Event_counterWeighted->Fill(pFlowEvent->Centrality(), Mweights[zbin-1][grefmult-1]);
598 for(
int ptbin=0; ptbin<Flow::PTBINS; ptbin++){
599 for(
int species=0; species<Flow::SPECIES; species++){
601 double the_pt = double(
double(ptbin)/10.);
602 if(ptbin == Flow::PTBINS-1) Combinations(kTRUE,species,ptbin);
603 else Combinations(kFALSE,species,ptbin);
605 if(ref_combos_4 == 0)
continue;
606 if(ref_combos_3 == 0)
continue;
607 if(ref_combos_2 == 0)
continue;
608 if(ref_combos_1 == 0)
continue;
609 if(ref_combos_0 == 0)
continue;
611 if(Mweights[zbin-1][grefmult-1] > 12.2)
continue;
612 double PF = ref_combos_1*Mweights[zbin-1][grefmult-1];
614 for(
int phase=0; phase<Flow::PHASES; phase++){
615 for(
int type=0; type<Flow::TYPES; type++){
616 for(
int term=0; term<Flow::TERMS; term++){
617 if(fabs(Cumulant_Terms[term][type][phase][species][ptbin]) < 1.) {
618 Term[term].Type[type].Phase[phase].Species[species].Sum_Singles->Fill(pFlowEvent->Centrality(),the_pt, PF*Cumulant_Terms[term][type][phase][species][ptbin]);
620 Term[term].Type[type].Phase[phase].Species[species].Sum_Squares->Fill(pFlowEvent->Centrality(),the_pt, PF*pow(Cumulant_Terms[term][type][phase][species][ptbin],2));
627 Entries[species].cent_yields->Fill(pFlowEvent->Centrality(), the_pt, ref_combos_1*Mweights[zbin-1][grefmult-1]);
634 void StFlowDirectCumulantMaker::ClearTerms() {
637 for(
int species=0; species<Flow::SPECIES; species++){
639 sum_1_cos_full[species]=0;
640 sum_1_sin_full[species]=0;
641 sum_2_cos_full[species]=0;
642 sum_2_sin_full[species]=0;
644 for(
int ptbin1=0; ptbin1<Flow::PTBINS; ptbin1++){
646 for(
int ptbin2=0; ptbin2<Flow::PTBINS; ptbin2++){
648 sum_1_cos_diff[species][ptbin1]=0, sum_1_sin_diff[species][ptbin1]=0;
649 sum_2_cos_diff[species][ptbin1]=0, sum_2_sin_diff[species][ptbin1]=0;
650 sum_3_cos_diff[species][ptbin1][ptbin2]=0, sum_3_sin_diff[species][ptbin1][ptbin2]=0;
651 sum_4_cos_diff[species][ptbin1][ptbin2]=0, sum_4_sin_diff[species][ptbin1][ptbin2]=0;
652 sum_5_cos_diff[species][ptbin1][ptbin2]=0, sum_5_sin_diff[species][ptbin1][ptbin2]=0;
653 sum_6_cos_sin_diff[species][ptbin1][ptbin2]=0, sum_6_sin_cos_diff[species][ptbin1][ptbin2]=0;
654 sum_7_diff[species][ptbin1][ptbin2]=0, sum_8_diff[species][ptbin1][ptbin2]=0, sum_9_diff[species][ptbin1][ptbin2]=0, sum_10_diff[species][ptbin1][ptbin2]=0;
655 sum_11_cos_diff[species][ptbin1][ptbin2]=0, sum_11_sin_diff[species][ptbin1][ptbin2]=0;
657 sum_1_cos[species][ptbin1]=0, sum_1_sin[species][ptbin1]=0;
658 sum_2_cos[species][ptbin1]=0, sum_2_sin[species][ptbin1]=0;
659 sum_3_cos[species][ptbin1]=0, sum_3_sin[species][ptbin1]=0;
660 sum_4_cos[species][ptbin1]=0, sum_4_sin[species][ptbin1]=0;
661 sum_5_cos[species][ptbin1]=0, sum_5_sin[species][ptbin1]=0;
662 sum_6_cos_sin[species][ptbin1]=0, sum_6_sin_cos[species][ptbin1]=0;
663 sum_7[species][ptbin1]=0, sum_8[species][ptbin1]=0, sum_9[species][ptbin1]=0, sum_10[species][ptbin1]=0;
664 sum_11_cos[species][ptbin1]=0, sum_11_sin[species][ptbin1]=0;
677 cout << endl <<
"##### Direct Cumulant Maker:" << endl;
680 const char *flowname =
"flow.dirCumulant.root";
681 TFile histFile(flowname,
"RECREATE");
683 GetHistList()->Write();
StFlowDirectCumulantMaker(const Char_t *name="FlowDirectCumulant")
Default constructor.