00001
00002
00003
00004
00005
00006
00008
00009
00010
00011
00013
00014 #include <Stiostream.h>
00015 #include <stdlib.h>
00016 #include <math.h>
00017 #include "StMaker.h"
00018 #include "StFlowReCentMaker.h"
00019 #include "StFlowMaker/StFlowMaker.h"
00020 #include "StFlowMaker/StFlowEvent.h"
00021 #include "StFlowMaker/StFlowConstants.h"
00022 #include "StFlowMaker/StFlowSelection.h"
00023 #include "PhysicalConstants.h"
00024 #include "TFile.h"
00025 #include "TString.h"
00026 #include "TProfile.h"
00027 #include "TOrdCollection.h"
00028 #include "StMessMgr.h"
00029 #define PR(x) cout << "##### FlowReCent: " << (#x) << " = " << (x) << endl;
00030
00031 ClassImp(StFlowReCentMaker)
00032
00033
00034
00035 StFlowReCentMaker::StFlowReCentMaker(const Char_t* name): StMaker(name),
00036 MakerName(name) {
00037 pFlowSelect = new StFlowSelection();
00038 }
00039
00040
00041
00042 StFlowReCentMaker::~StFlowReCentMaker() {
00043 }
00044
00045
00046
00047 Int_t StFlowReCentMaker::Make() {
00048
00049
00050
00051 StFlowMaker* pFlowMaker = NULL;
00052 pFlowMaker = (StFlowMaker*)GetMaker("Flow");
00053 if (pFlowMaker) pFlowEvent = pFlowMaker->FlowEventPointer();
00054 if (pFlowEvent && pFlowSelect->Select(pFlowEvent)) {
00055 FillEventHistograms();
00056 } else {
00057 gMessMgr->Info("##### FlowReCent: FlowEvent pointer null");
00058 return kStOK;
00059 }
00060 if (Debug()) StMaker::PrintInfo();
00061
00062 return kStOK;
00063 }
00064
00065
00066
00067 Int_t StFlowReCentMaker::Init() {
00068
00069
00070 TString* fileName;
00071 for (int n = 1; n < nCens; n++) {
00072 fileName = new TString("flowReCent");
00073 *fileName += n;
00074 fileName->Append(".root");
00075 reCentFile[n] = new TFile(fileName->Data(), "RECREATE");
00076 delete fileName;
00077 }
00078
00079
00080 TString* histTitle;
00081
00082
00083 for (int n = 1; n < nCens; n++) {
00084 reCentFile[n]->cd();
00085
00086
00087 for (int k = 0; k < Flow::nSels; k++) {
00088
00089
00090 for (int j = 0; j < Flow::nHars; j++) {
00091
00092
00093 histTitle = new TString("FlowReCentX_Sel");
00094 *histTitle += k+1;
00095 *histTitle += "_Har";
00096 *histTitle += j+1;
00097 hist[k].histCen[n].histHar[j].mHistReCentX = new TProfile(histTitle->Data(),
00098 histTitle->Data(), 3, 0.5, 3.5);
00099 hist[k].histCen[n].histHar[j].mHistReCentX->SetXTitle("FTPCE, FTPCW, TPCE, TPCW");
00100 hist[k].histCen[n].histHar[j].mHistReCentX->SetYTitle("<cos n #phi>");
00101 delete histTitle;
00102
00103 histTitle = new TString("FlowReCentY_Sel");
00104 *histTitle += k+1;
00105 *histTitle += "_Har";
00106 *histTitle += j+1;
00107 hist[k].histCen[n].histHar[j].mHistReCentY = new TProfile(histTitle->Data(),
00108 histTitle->Data(), 3, 0.5, 3.5);
00109 hist[k].histCen[n].histHar[j].mHistReCentY->SetXTitle("FTPCE, FTPCW, TPCE, TPCW");
00110 hist[k].histCen[n].histHar[j].mHistReCentY->SetYTitle("<sin n #phi>");
00111 delete histTitle;
00112
00113 }
00114 }
00115 }
00116
00117 gMessMgr->SetLimit("##### FlowReCent", 2);
00118 gMessMgr->Info("##### FlowReCent: $Id: StFlowReCentMaker.cxx,v 1.1 2009/11/24 19:29:15 posk Exp $");
00119
00120 return StMaker::Init();
00121 }
00122
00123
00124
00125 void StFlowReCentMaker::FillEventHistograms() {
00126
00127
00128
00129 int n = pFlowEvent->Centrality();
00130 if (!n) { return; }
00131
00132
00133 TVector2 qReCent;
00134 for (int k = 0; k < Flow::nSels; k++) {
00135 pFlowSelect->SetSelection(k);
00136 for (int j = 0; j < Flow::nHars; j++) {
00137 pFlowSelect->SetHarmonic(j);
00138 qReCent = pFlowEvent->ReCentEPPar(pFlowSelect,"FTPCE");
00139 if (qReCent.X()) hist[k].histCen[n].histHar[j].mHistReCentX->Fill(1., qReCent.X());
00140 if (qReCent.Y()) hist[k].histCen[n].histHar[j].mHistReCentY->Fill(1., qReCent.Y());
00141 qReCent = pFlowEvent->ReCentEPPar(pFlowSelect,"FTPCW");
00142 if (qReCent.X()) hist[k].histCen[n].histHar[j].mHistReCentX->Fill(2., qReCent.X());
00143 if (qReCent.Y()) hist[k].histCen[n].histHar[j].mHistReCentY->Fill(2., qReCent.Y());
00144 qReCent = pFlowEvent->ReCentEPPar(pFlowSelect,"TPCE");
00145 if (qReCent.X()) hist[k].histCen[n].histHar[j].mHistReCentX->Fill(3., qReCent.X());
00146 if (qReCent.Y()) hist[k].histCen[n].histHar[j].mHistReCentY->Fill(3., qReCent.Y());
00147 qReCent = pFlowEvent->ReCentEPPar(pFlowSelect,"TPCW");
00148 if (qReCent.X()) hist[k].histCen[n].histHar[j].mHistReCentX->Fill(4., qReCent.X());
00149 if (qReCent.Y()) hist[k].histCen[n].histHar[j].mHistReCentY->Fill(4., qReCent.Y());
00150 }
00151 }
00152 }
00153
00154
00155
00156 Int_t StFlowReCentMaker::Finish() {
00157
00158
00159
00160 TOrdCollection* reCentHistNames[nCens];
00161 for (int n = 1; n < nCens; n++) {
00162 reCentHistNames[n] = new TOrdCollection(Flow::nSels * Flow::nHars * 2);
00163 }
00164
00165 cout << endl << "##### ReCent Maker:" << endl;
00166
00167
00168 for (int n = 1; n < nCens; n++) {
00169 for (int k = 0; k < Flow::nSels; k++) {
00170 for (int j = 0; j < Flow::nHars; j++) {
00171 reCentHistNames[n]->AddLast(hist[k].histCen[n].histHar[j].mHistReCentX);
00172 reCentHistNames[n]->AddLast(hist[k].histCen[n].histHar[j].mHistReCentY);
00173 }
00174 }
00175 }
00176
00177 GetHistList()->ls();
00178
00179
00180 for (int n = 1; n < nCens; n++) {
00181 reCentFile[n]->cd();
00182 reCentHistNames[n]->Write();
00183 reCentFile[n]->Close();
00184 delete reCentHistNames[n];
00185 }
00186
00187 delete pFlowSelect;
00188
00189 return StMaker::Finish();
00190 }
00191
00192
00193
00195
00196
00197
00198
00199
00200
00201