4 #include "StRoot/StEStructPool/Fluctuations/StEStructSigAnal.h"
37 int mnCents, mnPts, mnPtCents, mnx, mny;
38 double iEta, iPhi, sigN, sigPt, error;
43 void plotCentrality(
int iCent,
int ptBin=0,
int print=0 );
44 void plotType(
char *pType,
int ptBin=0,
int print=0 );
45 void centralityMults(
int N0,
int print=0 );
46 void multiplicity(
int N0,
int print=0 );
47 void pt(
int P0,
int print=0 );
48 void deltaSigma2(
int print=0 );
49 void exportForMatlab();
50 void importFromMatlab();
54 int getNX(
int nCent );
55 int getNY(
int nCent );
57 void plotMCInfo(
int print=0 );
58 void plotBinaryCollisions(
int print=0 );
59 void plotParticipants(
int print=0 );
63 postProcess::postProcess(
char *dir ) {
64 gStyle->SetPadTopMargin(0.2);
65 gStyle->SetPadLeftMargin(0.15);
66 gStyle->SetCanvasColor(0);
67 gStyle->SetTitleBorderSize(0);
68 gStyle->SetTitleBorderSize(0);
69 gStyle->SetPadBorderSize(0);
70 gStyle->SetTitleColor(0);
71 gStyle->SetTitleFillColor(0);
72 gStyle->SetOptStat(0);
73 gStyle->SetPalette(1);
74 gStyle->SetTitleX(0.2);
75 gStyle->SetTitleH(0.08);
76 gStyle->SetPadBorderMode(0);
92 postProcess::~postProcess() {
104 void postProcess::createSigmas() {
107 sprintf(buffer,
"%s/data/Data.root",mDir);
112 msigA->fillHistograms();
113 sprintf(buffer,
"%s/data/Sigmas.root",mDir);
114 TFile *out =
new TFile(buffer,
"RECREATE");
115 msigA->writeHistograms(out);
118 void postProcess::plotCentrality(
int iCent,
int ptBin,
int print ) {
120 printf(
"I don't understand the meaning of centrality = %i\n",iCent);
124 sprintf(buffer,
"%s/data/Sigmas.root",mDir);
128 mFile =
new TFile(buffer);
134 printf(
"You asked for pt bin %i. There are only %i available.\n",ptBin, mnPts);
139 nCents = getNCents();
143 nCents = getNPtCents();
147 if (iCent >= nCents) {
148 printf(
"You asked for centrality %i. There are only %i available (and we start counting at 0).\n",iCent, nCents);
152 char *type[] = {
"NSig",
"NDel",
"NPlus",
"NMinus",
"NPlusMinus",
153 "PSig",
"PDel",
"PPlus",
"PMinus",
"PPlusMinus",
154 "PNSig",
"PNDel",
"PNPlus",
"PNMinus",
"PNPlusMinus",
156 char *index[] = {
"",
"",
"",
"",
"",
157 "1",
"1",
"1",
"1",
"1",
158 "1",
"1",
"1",
"1",
"1",
160 int order[] = {1, 4, 7, 10, 13, 2, 5, 8, 11, 14, 3, 6, 9, 12, 15};
164 mCan =
new TCanvas(
"c",
"c",3*250,5*250);
166 }
else if (strcmp(mCanType,
"plotCentrality")) {
167 mCan->SetWindowSize(3*250,5*250);
171 mCanType =
"plotCentrality";
174 for (
int iT=0;iT<15;iT++) {
177 sprintf( hist,
"%s%s_%i", type[iT], index[iT], iCent );
179 sprintf( hist,
"%s%s_%i_%i", type[iT], index[iT], iCent, ptBin-1 );
181 tmp = (TH2D *) gDirectory->Get(hist);
182 double val0 = tmp->GetBinContent(1,1);
183 double val1 = tmp->GetBinContent(24,16);
190 sprintf(buffer,
"%s, centrality %i",type[iT],iCent);
192 sprintf(buffer,
"%s, centrality %i, pt Bin %i",type[iT],iCent,ptBin-1);
194 tmp->SetTitle(buffer);
195 TAxis *x = tmp->GetXaxis();
196 TAxis *y = tmp->GetYaxis();
197 TAxis *z = tmp->GetZaxis();
198 x->SetTitleSize(0.07);
200 x->SetTitleOffset(1);
201 x->SetNdivisions(505);
202 x->SetLabelSize(0.05);
203 x->SetTitle(
"#delta_{#phi}");
204 y->SetTitleSize(0.07);
205 y->SetTitleOffset(1);
207 y->SetNdivisions(505);
208 y->SetLabelSize(0.05);
209 y->SetTitle(
"#delta_{#eta}");
210 z->SetTitleSize(0.07);
211 z->SetTitleOffset(0.6);
212 z->SetTitleColor(13);
213 z->SetNdivisions(505);
214 z->SetLabelSize(0.05);
219 sprintf(buffer,
"%s/txt/centrality%i.eps",mDir,iCent);
221 sprintf(buffer,
"%s/txt/centrality%i_ptBin%i.eps",mDir,iCent,ptBin-1);
226 void postProcess::plotType(
char *pType,
int ptBin,
int print ) {
227 char *type[] = {
"NSig",
"NDel",
"NPlus",
"NMinus",
"NPlusMinus",
228 "PSig",
"PDel",
"PPlus",
"PMinus",
"PPlusMinus",
229 "PNSig",
"PNDel",
"PNPlus",
"PNMinus",
"PNPlusMinus",
231 char *index[] = {
"",
"",
"",
"",
"",
232 "1",
"1",
"1",
"1",
"1",
233 "1",
"1",
"1",
"1",
"1",
237 for (iT=0;iT<16;iT++) {
238 if (!strcmp(pType,type[iT])) {
244 printf(
"I didn't understand type of %s.\n",pType);
248 sprintf(buffer,
"%s/data/Sigmas.root",mDir);
252 mFile =
new TFile(buffer);
256 printf(
"I only found %i ptBins. You asked for number %i\n",mnPts,ptBin);
262 nCents = getNCents();
266 nCents = getNPtCents();
273 mCan =
new TCanvas(
"c",
"c",nx*250,ny*250);
274 mCan->Divide(mnx,mny);
275 }
else if (strcmp(mCanType,
"plotType") || nx != mnx || ny != mny) {
276 mCan->SetWindowSize(nx*250,ny*250);
282 mCanType =
"plotType";
285 for (
int iB=0;iB<nCents;iB++) {
288 sprintf( hist,
"%s%s_%i", pType, index[iT], iB );
290 sprintf( hist,
"%s%s_%i_%i", pType, index[iT], iB, ptBin-1 );
292 tmp = (TH2D *) gDirectory->Get(hist);
293 double val0 = tmp->GetBinContent(1,1);
294 double val1 = tmp->GetBinContent(24,16);
301 sprintf(buffer,
"%s, centrality %i",pType,iB);
303 sprintf(buffer,
"%s, centrality %i, pt Bin %i",pType,iB,ptBin-1);
305 tmp->SetTitle(buffer);
306 TAxis *x = tmp->GetXaxis();
307 TAxis *y = tmp->GetYaxis();
308 TAxis *z = tmp->GetZaxis();
309 x->SetTitleSize(0.07);
311 x->SetTitleOffset(1);
312 x->SetNdivisions(505);
313 x->SetLabelSize(0.05);
314 x->SetTitle(
"#delta_{#phi}");
315 y->SetTitleSize(0.07);
316 y->SetTitleOffset(1);
318 y->SetNdivisions(505);
319 y->SetLabelSize(0.05);
320 y->SetTitle(
"#delta_{#eta}");
321 z->SetTitleSize(0.07);
322 z->SetTitleOffset(0.6);
323 z->SetTitleColor(13);
324 z->SetNdivisions(505);
325 z->SetLabelSize(0.05);
330 sprintf(buffer,
"%s/txt/%s.eps",mDir,pType);
332 sprintf(buffer,
"%s/txt/%s_%i.eps",mDir,pType,ptBin-1);
337 void postProcess::centralityMults(
int N0,
int print ) {
339 sprintf(buffer,
"%s/QA/QA.root",mDir);
343 mFile =
new TFile(buffer);
347 for (
int iB=0;iB<100;iB++) {
348 sprintf(buffer,
"multNSum_%i", iB );
349 if (gDirectory->Get(buffer)) {
356 for (
int iB=0;iB<100;iB++) {
357 sprintf(buffer,
"multNSum_%i_0", iB );
358 if (gDirectory->Get(buffer)) {
364 mnx = getNX(mnCents+1);
365 mny = getNY(mnCents+1);
374 TH1F *tmp = (TH1F *) gDirectory->Get(
"multNSum_0");
375 nBar[0] = tmp->GetMean();
376 num[0] = (int) tmp->GetEntries();
377 TH1F *mult = (TH1F *) tmp->Clone();
378 TH1F *mult34 = (TH1F *) tmp->Clone();
379 TH1F *multLow = (TH1F *) tmp->Clone();
380 TH1F *mult34Low = (TH1F *) tmp->Clone();
381 TH1F *multHigh = (TH1F *) tmp->Clone();
382 TH1F *mult34High = (TH1F *) tmp->Clone();
384 for (
int i=1;i<mnCents;i++) {
385 sprintf(buffer,
"multNSum_%i",i);
386 TH1F *tmp = (TH1F *) gDirectory->Get(buffer);
387 nBar[i] = tmp->GetMean();
388 num[i] = (int) tmp->GetEntries();
391 for (
int i=1;i<mnPtCents;i++) {
392 sprintf(buffer,
"multNSum_%i_0",i);
393 tmp = (TH1F *) gDirectory->Get(buffer);
395 sprintf(buffer,
"multNSum_%i_1",i);
396 tmp = (TH1F *) gDirectory->Get(buffer);
400 for (
int i=1;i<=mult->GetNbinsX();i++) {
401 float val = pow(i+0.0,0.75) * mult->GetBinContent(i);
402 mult34->SetBinContent(i,val);
403 val = pow(i+0.0,0.75) * multLow->GetBinContent(i);
404 mult34Low->SetBinContent(i,val);
405 val = pow(i+0.0,0.75) * multHigh->GetBinContent(i);
406 mult34High->SetBinContent(i,val);
410 char outFileName[1024];
411 sprintf( outFileName,
"%s/txt/NBar.txt", mDir );
412 out = fopen(outFileName,
"w");
414 for (
int i=0;i<mnCents;i++) {
415 fprintf(out,
"Centrality %i has mean multiplicity of %f with %i events\n",i,nBar[i],num[i]);
420 mCan =
new TCanvas(
"c",
"c",mnx*250,mny*250);
421 mCan->Divide(mnx,mny);
422 }
else if (strcmp(mCanType,
"centralityMults")) {
423 mCan->SetWindowSize(mnx*250,mny*250);
425 mCan->Divide(mnx,mny);
427 mCanType =
"centralityMults";
429 for (
int i=0;i<mnCents;i++) {
431 sprintf(buffer,
"multNSum_%i",i);
432 tmp = (TH1F *) gDirectory->Get(buffer);
433 tmp->SetAxisRange(0,N0);
434 tmp->SetLineColor(1);
435 sprintf(buffer,
"centrality bin %i",i);
436 tmp->SetTitle(buffer);
438 if (mnPtCents == mnCents) {
439 sprintf(buffer,
"multNSum_%i_0",i);
440 tmp = (TH1F *) gDirectory->Get(buffer);
441 tmp->SetAxisRange(0,N0);
442 tmp->SetLineColor(2);
445 sprintf(buffer,
"multNSum_%i_1",i);
446 TH1F *tmp = (TH1F *) gDirectory->Get(buffer);
447 sprintf(buffer,
"centrality bin %i",i);
448 tmp->SetTitle(buffer);
449 tmp->SetAxisRange(0,N0);
450 tmp->SetLineColor(3);
455 mult34Low->SetAxisRange(0,N0);
456 mult34Low->SetLineColor(3);
457 mult34Low->SetTitle(
"m^3/4*dN/dm");
459 mult34High->SetAxisRange(0,N0);
460 mult34High->SetLineColor(2);
461 mult34High->Draw(
"same");
463 mult34->SetTitle(
"m^3/4*dN/dm");
464 mult34->SetAxisRange(0,N0);
465 mult34->SetLineColor(1);
466 mult34->Draw(
"same");
469 sprintf(buffer,
"%s/txt/MultBins.eps",mDir);
473 void postProcess::multiplicity(
int N0,
int print ) {
475 sprintf(buffer,
"%s/data/Data.root",mDir);
479 mFile =
new TFile(buffer);
482 mult = (TH1F *) gDirectory->Get(
"Multiplicity");
483 mult34 = (TH1F *) mult->Clone();
484 TAxis *x = mult->GetXaxis();
485 TAxis *y = mult->GetYaxis();
487 y->SetTitle(
"#frac{dN}{dM}");
488 x = mult34->GetXaxis();
489 y = mult34->GetYaxis();
491 y->SetTitle(
"#frac{dN}{dM} * M^{3/4}");
492 y->SetTitleOffset(1.75);
495 char outFileName[1024];
496 sprintf( outFileName,
"%s/txt/Multiplicities.txt", mDir );
497 out = fopen(outFileName,
"w");
498 for (
int i=1;i<=mult->GetNbinsX();i++) {
499 float val = pow(i+0.0,0.75) * mult->GetBinContent(i);
500 mult34->SetBinContent(i,val);
501 fprintf(out,
"%i %f\n",i,mult->GetBinContent(i));
506 mCan =
new TCanvas(
"c",
"c",800,400);
508 }
else if (strcmp(mCanType,
"multiplicity")) {
509 mCan->SetWindowSize(800,400);
513 mCanType =
"multiplicity";
517 mult->SetAxisRange(0,N0);
518 mult->SetTitle(
"Multiplicity");
521 mult34->SetAxisRange(0,N0);
522 mult34->SetTitle(
"Multiplicity");
525 sprintf(buffer,
"%s/txt/Multiplicity.eps",mDir);
529 void postProcess::pt(
int P0,
int print ) {
531 sprintf(buffer,
"%s/data/Data.root",mDir);
535 mFile =
new TFile(buffer);
538 pt = (TH1F *) gDirectory->Get(
"Pt");
539 pt34 = (TH1F *) pt->Clone();
540 TAxis *x = pt->GetXaxis();
541 TAxis *y = pt->GetYaxis();
542 x->SetTitle(
"P_{#perp}");
543 y->SetTitle(
"#frac{dN}{dP_{#perp}}");
544 x = pt34->GetXaxis();
545 y = pt34->GetYaxis();
546 x->SetTitle(
"P_{#perp}");
547 y->SetTitle(
"#frac{dN}{dP_{#perp}} * P_{#perp}^{3/4}");
548 y->SetTitleOffset(1.75);
551 char outFileName[1024];
552 sprintf( outFileName,
"%s/txt/Pt.txt", mDir );
553 out = fopen(outFileName,
"w");
554 for (
int i=1;i<=pt->GetNbinsX();i++) {
555 float val = pow(i+0.0,0.75) * pt->GetBinContent(i);
556 pt34->SetBinContent(i,val);
557 fprintf(out,
"%i %f\n",i,pt->GetBinContent(i));
562 mCan =
new TCanvas(
"c",
"c",800,400);
565 if (!mCanType || strcmp(mCanType,
"pt")) {
566 mCan->SetWindowSize(800,400);
574 pt->SetAxisRange(0,P0);
578 pt34->SetAxisRange(0,P0);
579 pt34->SetTitle(
"Pt");
582 sprintf(buffer,
"%s/txt/Pt.eps",mDir);
586 void postProcess::deltaSigma2(
int print ) {
588 sprintf(buffer,
"%s/data/Sigmas.root",mDir);
592 mFile =
new TFile(buffer);
596 mnCents = getNCents();
597 mnx = getNX(mnCents);
598 mny = getNY(mnCents);
601 char outFileName[1024];
602 sprintf( outFileName,
"%s/txt/NBar.txt", mDir );
603 out = fopen(outFileName,
"a+");
610 for (
int iB=0;iB<mnCents;iB++) {
611 sprintf(hist,
"SptHat_%i", iB );
612 pthat = (TH2D *) gDirectory->Get(hist);
613 fprintf(out,
" Centrality %i has ptHat of %f\n",iB,pthat->GetBinContent(24,16));
618 for (
int iB=0;iB<mnCents;iB++) {
619 sprintf(hist,
"PptHat_%i", iB );
620 pthat = (TH2D *) gDirectory->Get(hist);
621 fprintf(out,
" Centrality %i has ptHat+ of %f\n",iB,pthat->GetBinContent(24,16));
626 for (
int iB=0;iB<mnCents;iB++) {
627 sprintf(hist,
"MptHat_%i", iB );
628 pthat = (TH2D *) gDirectory->Get(hist);
629 fprintf(out,
" Centrality %i has ptHat- of %f\n",iB,pthat->GetBinContent(24,16));
635 for (
int iB=0;iB<mnCents;iB++) {
636 sprintf(hist,
"SsigPtHat_%i", iB );
637 pthat = (TH2D *) gDirectory->Get(hist);
638 fprintf(out,
" Centrality %i has sigma_{hat_p_perp} of %f\n",iB,sqrt(pthat->GetBinContent(24,16)));
644 if (!mCanType || strcmp(mCanType,
"deltaSigma2")) {
645 mCan =
new TCanvas(
"c",
"c",mnx*250,mny*250);
646 mCan->SetWindowPosition(1,1);
647 mCan->Divide(mnx,mny);
648 mCanType =
"deltaSigma2";
651 for (
int iB=0;iB<mnCents;iB++) {
652 sprintf(hist,
"PSig1_%i", iB );
653 psig = (TH2D *) gDirectory->Get(hist);
655 TAxis *x = psig->GetXaxis();
656 TAxis *y = psig->GetYaxis();
657 TAxis *z = psig->GetZaxis();
658 x->SetTitleSize(0.075);
660 x->SetTitleOffset(1);
661 x->SetNdivisions(505);
662 x->SetLabelSize(0.05);
663 x->SetTitle(
"#delta_{#phi}");
664 y->SetTitleSize(0.075);
665 y->SetTitleOffset(1);
667 y->SetNdivisions(505);
668 y->SetLabelSize(0.05);
669 y->SetTitle(
"#delta_{#eta}");
670 z->SetTitleSize(0.08);
671 z->SetTitleOffset(0.6);
672 z->SetTitleColor(13);
673 z->SetNdivisions(505);
674 z->SetLabelSize(0.05);
675 sprintf(title,
"#Delta#sigma^{2}, bin %i",iB);
676 psig->SetTitle(title);
682 sprintf(buffer,
"%s/txt/Deltasigma2.eps",mDir);
686 void postProcess::exportForMatlab() {
688 sprintf( buffer,
"%s/data/Sigmas.root", mDir );
692 mFile =
new TFile(buffer);
694 char *measName[] = {
"NSig",
"PSig",
"PNSig",
695 "NDel",
"PDel",
"PNDel",
696 "NPlus",
"PPlus",
"PNPlus",
697 "NMinus",
"PMinus",
"PNMinus",
698 "NPlusMinus",
"PPlusMinus",
"PNPlusMinus",
"PNMinusPlus"};
699 char *outName[] = {
"N_CI",
"P_CI",
"PN_CI",
700 "N_CD",
"P_CD",
"PN_CD",
701 "N_Plus",
"P_Plus",
"PN_Plus",
702 "N_Minus",
"P_Minus",
"PN_Minus",
703 "N_PlusMinus",
"P_PlusMinus",
"PN_PlusMinus",
"PN_MinusPlus"};
704 char *index[] = {
"",
"1",
"1",
710 char *ptRange[] = {
"0.15-0.5",
"0.5-2.0"};
713 char outFileName[1024];
716 int nCents, nPtCents, nPts;
717 nCents = getNCents();
718 nPtCents = getNPtCents();
722 centName[0] =
"b0-3";
723 }
else if (2 == nCents) {
724 centName[0] =
"50-100";
725 centName[1] =
"0-50";
726 }
else if (4 == nCents) {
727 centName[0] =
"0-25";
728 centName[1] =
"25-50";
729 centName[2] =
"50-75";
730 centName[3] =
"75-100";
731 }
else if (5 == nCents) {
735 centName[3] =
"10-12";
736 centName[4] =
"13-24";
737 }
else if (6 == nCents) {
738 centName[0] =
"1-17";
739 centName[1] =
"17-33";
740 centName[2] =
"33-50";
741 centName[3] =
"50-67";
742 centName[4] =
"67-83";
743 centName[5] =
"83-100";
744 }
else if (7 == nCents) {
745 centName[0] =
"80-100";
746 centName[1] =
"64-80";
747 centName[2] =
"48-64";
748 centName[3] =
"32-48";
749 centName[4] =
"16-32";
750 centName[5] =
"8-16";
752 }
else if (11 == nCents) {
753 centName[0] =
"90-100";
754 centName[1] =
"80-90";
755 centName[2] =
"70-80";
756 centName[3] =
"60-70";
757 centName[4] =
"50-60";
758 centName[5] =
"40-50";
759 centName[6] =
"30-40";
760 centName[7] =
"20-30";
761 centName[8] =
"10-20";
762 centName[9] =
"5-10";
763 centName[10] =
"0-5";
765 for (
int iD=0;iD<16;iD++) {
766 for (
int iC=0;iC<nCents;iC++) {
767 sprintf( outFileName,
"%s/txt/fluct_%s_%s.txt", mDir, outName[iD], centName[iC] );
768 sprintf(buffer,
"%s%s_%i", measName[iD], index[iD], iC );
769 out = fopen(outFileName,
"w");
770 hist = (TH2D *) gDirectory->Get(buffer);
771 for (
int n=1;n<=hist->GetNbinsX();n++) {
772 for (
int m=1;m<=hist->GetNbinsY();m++) {
773 fprintf(out,
"%f\n",hist->GetBinContent(n,m));
778 sprintf( outFileName,
"%s/txt/fluct_%s_%s_err.txt", mDir, outName[iD], centName[iC] );
779 sprintf(buffer,
"%sErrors_%i", measName[iD], iC );
780 out = fopen(outFileName,
"w");
781 hist = (TH2D *) gDirectory->Get(buffer);
782 for (
int n=1;n<=hist->GetNbinsX();n++) {
783 for (
int m=1;m<=hist->GetNbinsY();m++) {
784 fprintf(out,
"%f\n",hist->GetBinContent(n,m));
791 centName[0] =
"b0-3";
792 }
else if (2 == nPtCents) {
793 centName[0] =
"50-100";
794 centName[1] =
"0-50";
795 }
else if (4 == nPtCents) {
796 centName[0] =
"0-25";
797 centName[1] =
"25-50";
798 centName[2] =
"50-75";
799 centName[3] =
"75-100";
800 }
else if (5 == nPtCents) {
804 centName[3] =
"10-12";
805 centName[4] =
"13-24";
806 }
else if (6 == nCents) {
807 centName[0] =
"1-17";
808 centName[1] =
"17-33";
809 centName[2] =
"33-50";
810 centName[3] =
"50-67";
811 centName[4] =
"67-83";
812 centName[5] =
"83-100";
813 }
else if (7 == nPtCents) {
814 centName[0] =
"80-100";
815 centName[1] =
"64-80";
816 centName[2] =
"48-64";
817 centName[3] =
"32-48";
818 centName[4] =
"16-32";
819 centName[5] =
"8-16";
821 }
else if (11 == nPtCents) {
822 centName[0] =
"90-100";
823 centName[1] =
"80-90";
824 centName[2] =
"70-80";
825 centName[3] =
"60-70";
826 centName[4] =
"50-60";
827 centName[5] =
"40-50";
828 centName[6] =
"30-40";
829 centName[7] =
"20-30";
830 centName[8] =
"10-20";
831 centName[9] =
"5-10";
832 centName[10] =
"0-5";
834 for (
int iD=0;iD<16;iD++) {
835 for (
int iC=0;iC<nPtCents;iC++) {
836 for (
int iP=0;iP<nPts;iP++) {
837 sprintf( outFileName,
"%s/txt/fluct_%s_%s_%s.txt", mDir, outName[iD], centName[iC], ptRange[iP] );
838 sprintf(buffer,
"%s%s_%i_%i", measName[iD], index[iD], iC, iP );
839 out = fopen(outFileName,
"w");
840 hist = (TH2D *) gDirectory->Get(buffer);
841 for (
int n=1;n<=hist->GetNbinsX();n++) {
842 for (
int m=1;m<=hist->GetNbinsY();m++) {
843 fprintf(out,
"%f\n",hist->GetBinContent(n,m));
848 sprintf( outFileName,
"%s/txt/fluct_%s_%s_%s_err.txt", mDir, outName[iD], centName[iC], ptRange[iP] );
849 sprintf(buffer,
"%sErrors_%i_%i", measName[iD], iC, iP );
850 out = fopen(outFileName,
"w");
851 hist = (TH2D *) gDirectory->Get(buffer);
852 for (
int n=1;n<=hist->GetNbinsX();n++) {
853 for (
int m=1;m<=hist->GetNbinsY();m++) {
854 fprintf(out,
"%f\n",hist->GetBinContent(n,m));
862 void postProcess::importFromMatlab() {
864 int postProcess::getNCents () {
867 for (
int iB=0;iB<100;iB++) {
868 sprintf(hist,
"NSig_%i", iB );
869 if (gDirectory->Get(hist)) {
877 int postProcess::getNPtCents () {
880 for (
int iC=0;iC<100;iC++) {
881 sprintf(hist,
"NSig_%i_0", iC );
882 if (gDirectory->Get(hist)) {
890 int postProcess::getNPts () {
893 for (
int iP=0;iP<100;iP++) {
894 sprintf(hist,
"NSig_0_%i", iP );
895 if (gDirectory->Get(hist)) {
903 int postProcess::getNX(
int nCent ) {
907 }
else if (nCent < 7) {
909 }
else if (nCent < 13) {
916 int postProcess::getNY(
int nCent ) {
920 }
else if (nCent < 5) {
922 }
else if (nCent < 10) {
931 void postProcess::plotMCInfo(
int print ) {
933 sprintf(buffer,
"%s/QA/QA.root",mDir);
937 mFile =
new TFile(buffer);
939 if (!mCanType || strcmp(mCanType,
"plotMCInfo")) {
940 mCan =
new TCanvas(
"c",
"c",2*400,2*400);
941 mCan->SetWindowPosition(1,1);
943 mCanType =
"plotMCInfo";
950 hist = (TH1D *) gDirectory->Get(
"impact");
951 x = hist->GetXaxis();
952 y = hist->GetYaxis();
953 x->SetTitleSize(0.075);
955 x->SetTitleOffset(1);
956 x->SetNdivisions(505);
957 x->SetLabelSize(0.05);
959 y->SetTitleSize(0.075);
960 y->SetTitleOffset(1);
962 y->SetNdivisions(505);
963 y->SetLabelSize(0.05);
964 y->SetTitle(
"Events");
965 hist->SetTitle(
"Impact Parameter");
969 hist = (TH1D *) gDirectory->Get(
"binary");
970 x = hist->GetXaxis();
971 y = hist->GetYaxis();
972 x->SetTitleSize(0.075);
974 x->SetTitleOffset(1);
975 x->SetNdivisions(505);
976 x->SetLabelSize(0.05);
977 x->SetTitle(
"Number");
978 y->SetTitleSize(0.075);
979 y->SetTitleOffset(1);
981 y->SetNdivisions(505);
982 y->SetLabelSize(0.05);
983 y->SetTitle(
"Events");
984 hist->SetTitle(
"Binary collisions");
989 hist = (TH1D *) gDirectory->Get(
"participant");
990 x = hist->GetXaxis();
991 y = hist->GetYaxis();
992 x->SetTitleSize(0.075);
994 x->SetTitleOffset(1);
995 x->SetNdivisions(505);
996 x->SetLabelSize(0.05);
997 x->SetTitle(
"Number");
998 y->SetTitleSize(0.075);
999 y->SetTitleOffset(1);
1000 y->SetTitleColor(1);
1001 y->SetNdivisions(505);
1002 y->SetLabelSize(0.05);
1003 y->SetTitle(
"Events");
1004 hist->SetTitle(
"Participants");
1010 sprintf(buffer,
"%s/txt/MCInfo.eps",mDir);
1011 mCan->Print(buffer);
1014 void postProcess::plotBinaryCollisions(
int print ) {
1016 sprintf(buffer,
"%s/QA/QA.root",mDir);
1020 mFile =
new TFile(buffer);
1023 mnCents = getNCents();
1024 mnx = getNX(mnCents+1);
1025 mny = getNY(mnCents+1);
1028 (strcmp(mCanType,
"plotBinaryCollisions") &&
1029 strcmp(mCanType,
"plotParticipants"))) {
1030 mCan =
new TCanvas(
"c",
"c",mnx*250,mny*250);
1031 mCan->SetWindowPosition(1,1);
1033 mCanType =
"plotBinaryCollisions";
1038 for (
int iB=0;iB<mnCents;iB++) {
1039 sprintf(buffer,
"binary_%i", iB );
1040 bin = (TH1D *) gDirectory->Get(buffer);
1042 TAxis *x = bin->GetXaxis();
1043 TAxis *y = bin->GetYaxis();
1044 x->SetTitleSize(0.075);
1045 x->SetTitleColor(1);
1046 x->SetTitleOffset(1);
1047 x->SetNdivisions(505);
1048 x->SetLabelSize(0.05);
1049 x->SetTitle(
"binary collisions");
1050 y->SetTitleSize(0.075);
1051 y->SetTitleOffset(1);
1052 y->SetTitleColor(1);
1053 y->SetNdivisions(505);
1054 y->SetLabelSize(0.05);
1055 y->SetTitle(
"Events");
1056 sprintf(buffer,
"impact class %i",iB);
1057 bin->SetTitle(buffer);
1064 sprintf(buffer,
"%s/txt/binaryCollisions.eps",mDir);
1065 mCan->Print(buffer);
1068 void postProcess::plotParticipants(
int print ) {
1070 sprintf(buffer,
"%s/QA/QA.root",mDir);
1074 mFile =
new TFile(buffer);
1077 mnCents = getNCents();
1078 mnx = getNX(mnCents+1);
1079 mny = getNY(mnCents+1);
1082 (strcmp(mCanType,
"plotBinaryCollisions") &&
1083 strcmp(mCanType,
"plotParticipants"))) {
1084 mCan =
new TCanvas(
"c",
"c",mnx*250,mny*250);
1085 mCan->SetWindowPosition(1,1);
1087 mCanType =
"plotBinaryCollisions";
1091 for (
int iB=0;iB<mnCents;iB++) {
1092 sprintf(buffer,
"participant_%i", iB );
1093 par = (TH1D *) gDirectory->Get(buffer);
1095 TAxis *x = par->GetXaxis();
1096 TAxis *y = par->GetYaxis();
1097 x->SetTitleSize(0.075);
1098 x->SetTitleColor(1);
1099 x->SetTitleOffset(1);
1100 x->SetNdivisions(505);
1101 x->SetLabelSize(0.05);
1102 x->SetTitle(
"participants");
1103 y->SetTitleSize(0.075);
1104 y->SetTitleOffset(1);
1105 y->SetTitleColor(1);
1106 y->SetNdivisions(505);
1107 y->SetLabelSize(0.05);
1108 y->SetTitle(
"Events");
1109 sprintf(buffer,
"impact class %i",iB);
1110 par->SetTitle(buffer);
1117 sprintf(buffer,
"%s/txt/participants.eps",mDir);
1118 mCan->Print(buffer);
1121 void postProcess::exportMCInfo() {
1123 sprintf(buffer,
"%s/QA/QA.root",mDir);
1127 mFile =
new TFile(buffer);
1130 mnCents = getNCents();
1135 char outFileName[1024];
1137 for (
int iC=0;iC<mnCents;iC++) {
1138 sprintf( outFileName,
"%s/txt/binaryCollisions_%i.txt", mDir, iC );
1139 out = fopen(outFileName,
"w");
1140 sprintf(buffer,
"binary_%i", iC );
1141 hist = (TH1D *) gDirectory->Get(buffer);
1142 for (
int n=1;n<=hist->GetNbinsX();n++) {
1143 fprintf(out,
"%i %6.f\n", n, hist->GetBinContent(n));
1147 sprintf( outFileName,
"%s/txt/participants_%i.txt", mDir, iC );
1148 out = fopen(outFileName,
"w");
1149 sprintf(buffer,
"participant_%i", iC );
1150 hist = (TH1D *) gDirectory->Get(buffer);
1151 for (
int n=1;n<=hist->GetNbinsX();n++) {
1152 fprintf(out,
"%i %6.f\n", n, hist->GetBinContent(n));
1157 sprintf( outFileName,
"%s/txt/impactParameter.txt", mDir );
1158 out = fopen(outFileName,
"w");
1159 hist = (TH1D *) gDirectory->Get(
"impact");
1160 for (
int n=1;n<=hist->GetNbinsX();n++) {
1161 fprintf(out,
"%8.4f %6.f\n",hist->GetBinCenter(n), hist->GetBinContent(n));