18 #include "StFlowReCentMaker.h"
19 #include "StFlowMaker/StFlowMaker.h"
20 #include "StFlowMaker/StFlowEvent.h"
21 #include "StFlowMaker/StFlowConstants.h"
22 #include "StFlowMaker/StFlowSelection.h"
23 #include "PhysicalConstants.h"
27 #include "TOrdCollection.h"
28 #include "StMessMgr.h"
29 #define PR(x) cout << "##### FlowReCent: " << (#x) << " = " << (x) << endl;
42 StFlowReCentMaker::~StFlowReCentMaker() {
53 if (pFlowMaker) pFlowEvent = pFlowMaker->FlowEventPointer();
54 if (pFlowEvent && pFlowSelect->Select(pFlowEvent)) {
55 FillEventHistograms();
57 gMessMgr->Info(
"##### FlowReCent: FlowEvent pointer null");
60 if (Debug()) StMaker::PrintInfo();
67 Int_t StFlowReCentMaker::Init() {
71 for (
int n = 1; n < nCens; n++) {
72 fileName =
new TString(
"flowReCent");
74 fileName->Append(
".root");
75 reCentFile[n] =
new TFile(fileName->Data(),
"RECREATE");
83 for (
int n = 1; n < nCens; n++) {
87 for (
int k = 0; k < Flow::nSels; k++) {
90 for (
int j = 0; j < Flow::nHars; j++) {
93 histTitle =
new TString(
"FlowReCentX_Sel");
97 hist[k].histCen[n].histHar[j].mHistReCentX =
new TProfile(histTitle->Data(),
98 histTitle->Data(), 3, 0.5, 3.5);
99 hist[k].histCen[n].histHar[j].mHistReCentX->SetXTitle(
"FTPCE, FTPCW, TPCE, TPCW");
100 hist[k].histCen[n].histHar[j].mHistReCentX->SetYTitle(
"<cos n #phi>");
103 histTitle =
new TString(
"FlowReCentY_Sel");
105 *histTitle +=
"_Har";
107 hist[k].histCen[n].histHar[j].mHistReCentY =
new TProfile(histTitle->Data(),
108 histTitle->Data(), 3, 0.5, 3.5);
109 hist[k].histCen[n].histHar[j].mHistReCentY->SetXTitle(
"FTPCE, FTPCW, TPCE, TPCW");
110 hist[k].histCen[n].histHar[j].mHistReCentY->SetYTitle(
"<sin n #phi>");
117 gMessMgr->SetLimit(
"##### FlowReCent", 2);
118 gMessMgr->Info(
"##### FlowReCent: $Id: StFlowReCentMaker.cxx,v 1.1 2009/11/24 19:29:15 posk Exp $");
120 return StMaker::Init();
125 void StFlowReCentMaker::FillEventHistograms() {
129 int n = pFlowEvent->Centrality();
134 for (
int k = 0; k < Flow::nSels; k++) {
135 pFlowSelect->SetSelection(k);
136 for (
int j = 0; j < Flow::nHars; j++) {
137 pFlowSelect->SetHarmonic(j);
138 qReCent = pFlowEvent->ReCentEPPar(pFlowSelect,
"FTPCE");
139 if (qReCent.X()) hist[k].histCen[n].histHar[j].mHistReCentX->Fill(1., qReCent.X());
140 if (qReCent.Y()) hist[k].histCen[n].histHar[j].mHistReCentY->Fill(1., qReCent.Y());
141 qReCent = pFlowEvent->ReCentEPPar(pFlowSelect,
"FTPCW");
142 if (qReCent.X()) hist[k].histCen[n].histHar[j].mHistReCentX->Fill(2., qReCent.X());
143 if (qReCent.Y()) hist[k].histCen[n].histHar[j].mHistReCentY->Fill(2., qReCent.Y());
144 qReCent = pFlowEvent->ReCentEPPar(pFlowSelect,
"TPCE");
145 if (qReCent.X()) hist[k].histCen[n].histHar[j].mHistReCentX->Fill(3., qReCent.X());
146 if (qReCent.Y()) hist[k].histCen[n].histHar[j].mHistReCentY->Fill(3., qReCent.Y());
147 qReCent = pFlowEvent->ReCentEPPar(pFlowSelect,
"TPCW");
148 if (qReCent.X()) hist[k].histCen[n].histHar[j].mHistReCentX->Fill(4., qReCent.X());
149 if (qReCent.Y()) hist[k].histCen[n].histHar[j].mHistReCentY->Fill(4., qReCent.Y());
160 TOrdCollection* reCentHistNames[nCens];
161 for (
int n = 1; n < nCens; n++) {
162 reCentHistNames[n] =
new TOrdCollection(Flow::nSels * Flow::nHars * 2);
165 cout << endl <<
"##### ReCent Maker:" << endl;
168 for (
int n = 1; n < nCens; n++) {
169 for (
int k = 0; k < Flow::nSels; k++) {
170 for (
int j = 0; j < Flow::nHars; j++) {
171 reCentHistNames[n]->AddLast(hist[k].histCen[n].histHar[j].mHistReCentX);
172 reCentHistNames[n]->AddLast(hist[k].histCen[n].histHar[j].mHistReCentY);
180 for (
int n = 1; n < nCens; n++) {
182 reCentHistNames[n]->Write();
183 reCentFile[n]->Close();
184 delete reCentHistNames[n];