00001
00002
00003
00004
00005
00006
00007
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00023
00024 #include <Stiostream.h>
00025 #include <stdlib.h>
00026 #include <math.h>
00027 #include "StMaker.h"
00028 #include "StFlowLeeYangZerosMaker.h"
00029 #include "StFlowMaker/StFlowMaker.h"
00030 #include "StFlowMaker/StFlowEvent.h"
00031 #include "StFlowMaker/StFlowConstants.h"
00032 #include "StFlowMaker/StFlowSelection.h"
00033 #include "StEnumerations.h"
00034 #include "PhysicalConstants.h"
00035 #include "SystemOfUnits.h"
00036 #include "TVector2.h"
00037 #include "TFile.h"
00038 #include "TString.h"
00039 #include "TH1.h"
00040 #include "TProfile.h"
00041 #include "TProfile2D.h"
00042 #include "TOrdCollection.h"
00043 #include "StMessMgr.h"
00044 #include "TMath.h"
00045 #include "TComplex.h"
00046
00047 #define PR(x) cout << "##### FlowLYZ: " << (#x) << " = " << (x) << endl;
00048
00049 ClassImp(StFlowLeeYangZerosMaker)
00050
00051 Bool_t StFlowLeeYangZerosMaker::mV1Mixed = kTRUE;
00052
00053
00054
00055 StFlowLeeYangZerosMaker::StFlowLeeYangZerosMaker(const Char_t* name): StMaker(name),
00056 MakerName(name) {
00057 pFlowSelect = new StFlowSelection();
00058 SetHistoRanges();
00059 SetPtRange_for_vEta(0., 0.);
00060 SetEtaRange_for_vPt(0., 0.);
00061 }
00062
00063 StFlowLeeYangZerosMaker::StFlowLeeYangZerosMaker(const Char_t* name,
00064 const StFlowSelection& flowSelect) :
00065 StMaker(name), MakerName(name) {
00066 pFlowSelect = new StFlowSelection(flowSelect);
00067 SetHistoRanges();
00068 SetPtRange_for_vEta(0., 0.);
00069 SetEtaRange_for_vPt(0., 0.);
00070 }
00071
00072
00073
00074 StFlowLeeYangZerosMaker::~StFlowLeeYangZerosMaker() {
00075 }
00076
00077
00078
00079 Int_t StFlowLeeYangZerosMaker::Make() {
00080
00081
00082
00083 StFlowMaker* pFlowMaker = NULL;
00084 pFlowMaker = (StFlowMaker*)GetMaker("Flow");
00085 if (pFlowMaker) pFlowEvent = pFlowMaker->FlowEventPointer();
00086 if (pFlowEvent && pFlowSelect->Select(pFlowEvent)) {
00087 if (FillFromFlowEvent()) {
00088 if (!mFirstPass) { FillParticleHistograms(); }
00089 } else {
00090 gMessMgr->Info("##### FlowLeeYangZero: Event Q = 0");
00091 }
00092 } else {
00093 gMessMgr->Info("##### FlowLeeYangZero: FlowEvent pointer null");
00094 return kStOK;
00095 }
00096
00097 if (Debug()) StMaker::PrintInfo();
00098
00099 return kStOK;
00100 }
00101
00102
00103
00104 Int_t StFlowLeeYangZerosMaker::Init() {
00105
00106
00107
00108
00109
00110
00111
00112 float ptMaxPart = Flow::ptMaxPart;
00113 if (pFlowSelect->PtMaxPart()) {
00114 ptMaxPart = pFlowSelect->PtMaxPart();
00115 }
00116
00117 mPtBinsPart = Flow::nPtBinsPart;
00118 if (pFlowSelect->PtBinsPart()) {
00119 mPtBinsPart = pFlowSelect->PtBinsPart();
00120 }
00121 xLabel = "Pseudorapidity";
00122 if (strlen(pFlowSelect->PidPart()) != 0) { xLabel = "Rapidity"; }
00123
00124 StFlowMaker* pFlowMaker = NULL;
00125 pFlowMaker = (StFlowMaker*)GetMaker("Flow");
00126 Bool_t reCentCalc = pFlowMaker->ReCentCalc();
00127
00128 const float multMin = 0.;
00129 const float multMax = 2000.;
00130
00131 enum { nMultBins = 200
00132 };
00133
00134 TString* histTitle;
00135 mZeroPass = kFALSE;
00136 mFirstPass = kFALSE;
00137 mV1Mixed = kTRUE;
00138
00139
00140
00141
00142 Double_t rBinArray[Flow::nRBins+1];
00143 Double_t meanBinWidth = Flow::rMax / Flow::nRBins;
00144
00145 Double_t F = 8.;
00146 Double_t initialBinWidth = meanBinWidth / F;
00147 Double_t eps = 2. * meanBinWidth * (1. - 1./F) / (double)(Flow::nRBins-1);
00148 rBinArray[0]= 0.;
00149
00150
00151
00152 Double_t binWidth = initialBinWidth;
00153 for (int rBin = 1; rBin < Flow::nRBins+1; rBin++) {
00154 rBinArray[rBin] = rBinArray[rBin-1] + binWidth;
00155
00156 binWidth += eps;
00157 }
00158
00159
00160 mHistYieldPartPt = new TH1D("FlowLYZ_YieldPartPt", "FlowLYZ_YieldPartPt", mPtBinsPart,
00161 Flow::ptMin, ptMaxPart);
00162 mHistYieldPartPt->SetXTitle("Pt (GeV/c)");
00163
00164 mHistYieldPartEta = new TH1D("FlowLYZ_YieldPartEta", "FlowLYZ_YieldPartEta", mNEtaBins,
00165 mEtaMin, mEtaMax);
00166 mHistYieldPartEta->SetXTitle((char*)xLabel.Data());
00167
00168
00169 mHistMult = new TH1F("FlowLYZ_Mult", "FlowLYZ_Mult", nMultBins, multMin, multMax);
00170 mHistMult->SetXTitle("Multiplicity");
00171 mHistMult->SetYTitle("Counts");
00172
00173 mNEvents = 0;
00174
00175
00176 for (int Ntheta = 0; Ntheta < Flow::nTheta; Ntheta++) {
00177 mV1neum[Ntheta](0., 0.);
00178 }
00179
00180
00181 for (int k = 0; k < Flow::nSels; k++) {
00182
00183
00184 histTitle = new TString("FlowProLYZ_V_Sel");
00185 *histTitle += k+1;
00186 histFull[k].mHistPro_V = new TProfile(histTitle->Data(), histTitle->Data(),
00187 Flow::nHars, 0.5, (float)(Flow::nHars) + 0.5, -1000., 1000.);
00188 histFull[k].mHistPro_V->SetXTitle("Harmonic");
00189 histFull[k].mHistPro_V->SetYTitle("mean V_{n}");
00190 delete histTitle;
00191
00192
00193 histTitle = new TString("FlowProLYZ_vr0_Sel");
00194 *histTitle += k+1;
00195 histFull[k].mHistPro_vr0 = new TProfile(histTitle->Data(), histTitle->Data(),
00196 Flow::nHars, 0.5, (float)(Flow::nHars) + 0.5, -100., 100.);
00197 histFull[k].mHistPro_vr0->SetXTitle("Harmonic");
00198 histFull[k].mHistPro_vr0->SetYTitle("v from r0 (%)");
00199 delete histTitle;
00200
00201
00202 histTitle = new TString("FlowLYZ_v_Sel");
00203 *histTitle += k+1;
00204 histFull[k].mHist_v = new TH1F(histTitle->Data(), histTitle->Data(),
00205 Flow::nHars, 0.5, (float)(Flow::nHars) + 0.5);
00206 histFull[k].mHist_v->SetXTitle("Harmonic");
00207 histFull[k].mHist_v->SetYTitle("v (%)");
00208 delete histTitle;
00209
00210
00211 for (int j = 0; j < Flow::nHars; j++) {
00212 mQ[k][j].Set(0.,0.);
00213 mQ2[k][j] = 0.;
00214
00215
00216 histTitle = new TString("FlowProLYZ_vEta_Sel");
00217 *histTitle += k+1;
00218 *histTitle += "_Har";
00219 *histTitle += j+1;
00220 histFull[k].histFullHar[j].mHistPro_vEta = new TProfile(histTitle->Data(),
00221 histTitle->Data(), mNEtaBins, mEtaMin, mEtaMax, -1000., 1000.);
00222 histFull[k].histFullHar[j].mHistPro_vEta->SetXTitle((char*)xLabel.Data());
00223 histFull[k].histFullHar[j].mHistPro_vEta->SetYTitle("v (%)");
00224 delete histTitle;
00225
00226 histTitle = new TString("FlowProLYZ_vPt_Sel");
00227 *histTitle += k+1;
00228 *histTitle += "_Har";
00229 *histTitle += j+1;
00230 histFull[k].histFullHar[j].mHistPro_vPt = new TProfile(histTitle->Data(),
00231 histTitle->Data(), mPtBinsPart, Flow::ptMin, ptMaxPart, -1000., 1000.);
00232 histFull[k].histFullHar[j].mHistPro_vPt->SetXTitle("Pt (GeV/c)");
00233 histFull[k].histFullHar[j].mHistPro_vPt->SetYTitle("v (%)");
00234 delete histTitle;
00235
00236
00237 for (Int_t Ntheta = 0; Ntheta < Flow::nTheta; Ntheta++) {
00238
00239
00240 histTitle = new TString("FlowLYZ_Gtheta");
00241 *histTitle += Ntheta;
00242 *histTitle += "_Sel";
00243 *histTitle += k+1;
00244 *histTitle += "_Har";
00245 *histTitle += j+1;
00246 histFull[k].histFullHar[j].histTheta[Ntheta].mHistGtheta = new TH1D(histTitle->Data(),
00247 histTitle->Data(), Flow::nRBins, rBinArray);
00248 histFull[k].histFullHar[j].histTheta[Ntheta].mHistGtheta->SetXTitle("r");
00249 histFull[k].histFullHar[j].histTheta[Ntheta].mHistGtheta->SetYTitle("|G^{#theta}(ir)|^{2}");
00250 delete histTitle;
00251
00252
00253 histTitle = new TString("FlowReGtheta");
00254 *histTitle += Ntheta;
00255 *histTitle += "_Sel";
00256 *histTitle += k+1;
00257 *histTitle += "_Har";
00258 *histTitle += j+1;
00259 histFull[k].histFullHar[j].histTheta[Ntheta].mHistProReGtheta = new TProfile(histTitle->Data(),
00260 histTitle->Data(), Flow::nRBins, rBinArray);
00261 histFull[k].histFullHar[j].histTheta[Ntheta].mHistProReGtheta->SetXTitle("r");
00262 histFull[k].histFullHar[j].histTheta[Ntheta].mHistProReGtheta->SetYTitle("Re(G^{#theta}(ir))");
00263 delete histTitle;
00264
00265
00266 histTitle = new TString("FlowImGtheta");
00267 *histTitle += Ntheta;
00268 *histTitle += "_Sel";
00269 *histTitle += k+1;
00270 *histTitle += "_Har";
00271 *histTitle += j+1;
00272 histFull[k].histFullHar[j].histTheta[Ntheta].mHistProImGtheta = new TProfile(histTitle->Data(),
00273 histTitle->Data(), Flow::nRBins, rBinArray);
00274 histFull[k].histFullHar[j].histTheta[Ntheta].mHistProImGtheta->SetXTitle("r");
00275 histFull[k].histFullHar[j].histTheta[Ntheta].mHistProImGtheta->SetYTitle("Im(G^{#theta}(ir))");
00276 delete histTitle;
00277
00278
00279 histTitle = new TString("FlowReNumer2D");
00280 *histTitle += Ntheta;
00281 *histTitle += "_Sel";
00282 *histTitle += k+1;
00283 *histTitle += "_Har";
00284 *histTitle += j+1;
00285 histFull[k].histFullHar[j].histTheta[Ntheta].mHistReNumer2D = new TProfile2D(histTitle->Data(),
00286 histTitle->Data(), 2, mEtaMin, mEtaMax, mPtBinsPart, Flow::ptMin, ptMaxPart);
00287 histFull[k].histFullHar[j].histTheta[Ntheta].mHistReNumer2D->SetXTitle((char*)xLabel.Data());
00288 histFull[k].histFullHar[j].histTheta[Ntheta].mHistReNumer2D->SetYTitle("Pt (GeV/c)");
00289 delete histTitle;
00290
00291
00292 histTitle = new TString("FlowReNumerEta");
00293 *histTitle += Ntheta;
00294 *histTitle += "_Sel";
00295 *histTitle += k+1;
00296 *histTitle += "_Har";
00297 *histTitle += j+1;
00298 histFull[k].histFullHar[j].histTheta[Ntheta].mHistReNumerEta = new TProfile(histTitle->Data(),
00299 histTitle->Data(), mNEtaBins, mEtaMin, mEtaMax);
00300 histFull[k].histFullHar[j].histTheta[Ntheta].mHistReNumerEta->SetXTitle((char*)xLabel.Data());
00301 histFull[k].histFullHar[j].histTheta[Ntheta].mHistReNumerEta->SetYTitle("v (%)");
00302 delete histTitle;
00303
00304
00305 histTitle = new TString("FlowImNumer2D");
00306 *histTitle += Ntheta;
00307 *histTitle += "_Sel";
00308 *histTitle += k+1;
00309 *histTitle += "_Har";
00310 *histTitle += j+1;
00311 histFull[k].histFullHar[j].histTheta[Ntheta].mHistImNumer2D = new TProfile2D(histTitle->Data(),
00312 histTitle->Data(), 2, mEtaMin, mEtaMax, mPtBinsPart, Flow::ptMin, ptMaxPart);
00313 histFull[k].histFullHar[j].histTheta[Ntheta].mHistImNumer2D->SetXTitle((char*)xLabel.Data());
00314 histFull[k].histFullHar[j].histTheta[Ntheta].mHistImNumer2D->SetYTitle("Pt (GeV/c)");
00315 delete histTitle;
00316
00317
00318 histTitle = new TString("FlowImNumerEta");
00319 *histTitle += Ntheta;
00320 *histTitle += "_Sel";
00321 *histTitle += k+1;
00322 *histTitle += "_Har";
00323 *histTitle += j+1;
00324 histFull[k].histFullHar[j].histTheta[Ntheta].mHistImNumerEta = new TProfile(histTitle->Data(),
00325 histTitle->Data(), mNEtaBins, mEtaMin, mEtaMax);
00326 histFull[k].histFullHar[j].histTheta[Ntheta].mHistImNumerEta->SetXTitle((char*)xLabel.Data());
00327 histFull[k].histFullHar[j].histTheta[Ntheta].mHistImNumerEta->SetYTitle("v (%)");
00328 delete histTitle;
00329
00330 }
00331
00332
00333 TString *histTitleVtheta;
00334 histTitle = new TString("FlowProLYZ_Vtheta_Sel");
00335 *histTitle += k+1;
00336 *histTitle += "_Har";
00337 *histTitle += j+1;
00338 histFull[k].histFullHar[j].mHistPro_Vtheta = new TProfile(histTitle->Data(),
00339 histTitle->Data(), Flow::nTheta, -0.5, Flow::nTheta-0.5, -1000., 1000.);
00340 histFull[k].histFullHar[j].mHistPro_Vtheta->SetXTitle("#theta");
00341 histFull[k].histFullHar[j].mHistPro_Vtheta->SetYTitle("V_{n}^{#theta}");
00342 histTitleVtheta = new TString(histTitle->Data());
00343 delete histTitle;
00344
00345
00346 histTitle = new TString("FlowReDenom_Sel");
00347 *histTitle += k+1;
00348 *histTitle += "_Har";
00349 *histTitle += j+1;
00350 histFull[k].histFullHar[j].mHistReDenom = new TProfile(histTitle->Data(),
00351 histTitle->Data(), Flow::nTheta, -0.5, Flow::nTheta-0.5);
00352 histFull[k].histFullHar[j].mHistReDenom->SetXTitle("#theta");
00353 histFull[k].histFullHar[j].mHistReDenom->SetYTitle("Re(Q^{#theta}e^{ir_{0}^{#theta}Q^{#theta}})");
00354 delete histTitle;
00355
00356
00357 histTitle = new TString("FlowImDenom_Sel");
00358 *histTitle += k+1;
00359 *histTitle += "_Har";
00360 *histTitle += j+1;
00361 histFull[k].histFullHar[j].mHistImDenom = new TProfile(histTitle->Data(),
00362 histTitle->Data(), Flow::nTheta, -0.5, Flow::nTheta-0.5);
00363 histFull[k].histFullHar[j].mHistImDenom->SetXTitle("#theta");
00364 histFull[k].histFullHar[j].mHistImDenom->SetYTitle("Im(Q^{#theta}e^{ir_{0}^{#theta}Q^{#theta}})");
00365 delete histTitle;
00366
00367
00368 histTitle = new TString("FlowCentX_Sel");
00369 *histTitle += k+1;
00370 *histTitle += "_Har";
00371 *histTitle += j+1;
00372 histFull[k].histFullHar[j].mHistCentX = new TProfile(histTitle->Data(),
00373 histTitle->Data(), 3, 0.5, 3.5);
00374 histFull[k].histFullHar[j].mHistCentX->SetXTitle("TPCE, TPCW, TPC");
00375 histFull[k].histFullHar[j].mHistCentX->SetYTitle("<cos n #phi>");
00376 delete histTitle;
00377
00378 histTitle = new TString("FlowCentY_Sel");
00379 *histTitle += k+1;
00380 *histTitle += "_Har";
00381 *histTitle += j+1;
00382 histFull[k].histFullHar[j].mHistCentY = new TProfile(histTitle->Data(),
00383 histTitle->Data(), 3, 0.5, 3.5);
00384 histFull[k].histFullHar[j].mHistCentY->SetXTitle("TPCE, TPCW, TPC");
00385 histFull[k].histFullHar[j].mHistCentY->SetYTitle("<sin n #phi>");
00386 delete histTitle;
00387
00388 histTitle = new TString("FlowQCent_Sel");
00389 *histTitle += k+1;
00390 *histTitle += "_Har";
00391 *histTitle += j+1;
00392 histFull[k].histFullHar[j].mHistQCent = new TProfile(histTitle->Data(),
00393 histTitle->Data(), 2, 0.5, 2.5);
00394 histFull[k].histFullHar[j].mHistQCent->SetXTitle("X, Y");
00395 histFull[k].histFullHar[j].mHistQCent->SetYTitle("<Q_{n}/M>");
00396 delete histTitle;
00397
00398
00399 histTitle = new TString("FlowProLYZ_r0theta_Sel");
00400 *histTitle += k+1;
00401 *histTitle += "_Har";
00402 *histTitle += j+1;
00403 histFull[k].histFullHar[j].mHistPro_r0theta = new TProfile(histTitle->Data(),
00404 histTitle->Data(), Flow::nTheta, -0.5, Flow::nTheta-0.5, 0., 2.);
00405 histFull[k].histFullHar[j].mHistPro_r0theta->SetXTitle("#theta");
00406 histFull[k].histFullHar[j].mHistPro_r0theta->SetYTitle("r_{0}^{#theta}");
00407 delete histTitle;
00408
00409 if (j > 1) continue;
00410 TString *histTitleForReadIn;
00411 histTitleForReadIn = new TString("FlowLYZ_r0theta_Sel");
00412 *histTitle += k+1;
00413 *histTitle += "_Har";
00414 *histTitle += j+1;
00415
00416
00417 TFile fileZeroPass("flow.reCent.root","R");
00418 if (fileZeroPass.IsOpen() || !reCentCalc) {
00419
00420
00421 TFile fileFirstPass("flow.firstPassLYZ.root","R");
00422 if (fileFirstPass.IsOpen()) {
00423 gMessMgr->Info("##### FlowLeeYangZero: Second Pass");
00424
00425 TH1D* tempHist =
00426 dynamic_cast<TH1D*>(fileFirstPass.Get(histTitleForReadIn->Data()));
00427 if (!tempHist) {
00428 cout << "##### FlowLeeYangZeros: dynamic cast can't find " <<
00429 histTitleForReadIn->Data() << endl;
00430 return kFALSE;
00431 } else if (tempHist->GetNbinsX() != Flow::nTheta) {
00432 cout << "##### FlowLeeYangZeros: nTheta of 1st pass not equal to 2nd pass" <<
00433 endl;
00434 PR(tempHist->GetNbinsX());
00435 PR(Flow::nTheta);
00436 return kStFatal;
00437 }
00438 delete histTitleForReadIn;
00439
00440 for (Int_t Ntheta = 0; Ntheta < Flow::nTheta; Ntheta++) {
00441 mr0theta[k][j][Ntheta] = tempHist->GetBinContent(Ntheta+1);
00442 mr0theta[k][j+2][Ntheta] = tempHist->GetBinContent(Ntheta+1);
00443
00444 }
00445 fileFirstPass.Close();
00446 } else {
00447 gMessMgr->Info("##### FlowLeeYangZero: First Pass");
00448 mFirstPass = kTRUE;
00449 }
00450 } else {
00451 gMessMgr->Info("##### FlowLeeYangZero: Zero Pass");
00452 mZeroPass = kTRUE;
00453 }
00454 }
00455 }
00456
00457 gMessMgr->SetLimit("##### FlowLeeYangZero", 5);
00458 gMessMgr->Info("##### FlowLeeYangZero: $Id: StFlowLeeYangZerosMaker.cxx,v 1.6 2009/11/24 19:29:13 posk Exp $");
00459
00460 return StMaker::Init();
00461 }
00462
00463
00464
00465 Bool_t StFlowLeeYangZerosMaker::FillFromFlowEvent() {
00466
00467
00468
00469
00470 mMult = (int)pFlowEvent->MultPart(pFlowSelect);
00471 mHistMult->Fill((float)mMult);
00472
00473 mNEvents++;
00474
00475 TVector2 Q, q;
00476 Float_t theta, theta1, order, r0;
00477 TComplex expo, denom, Gtheta;
00478 Double_t Qtheta, cosTheta12, mult;
00479 Int_t m;
00480
00481 for (int k = 0; k < Flow::nSels; k++) {
00482 pFlowSelect->SetSelection(k);
00483 for (int j = 0; j < Flow::nHars; j++) {
00484 m = 1;
00485 pFlowSelect->SetHarmonic(j);
00486 if (j==2) {
00487 m = 3;
00488 pFlowSelect->SetHarmonic(0);
00489 } else if (j==3) {
00490 m = 2;
00491 pFlowSelect->SetHarmonic(1);
00492 }
00493 order = (double)((j+1)/m);
00494
00495 if (mZeroPass) {
00496
00497 q = pFlowEvent->ReCentPar(pFlowSelect,"TPCE");
00498 histFull[k].histFullHar[j].mHistCentX->Fill(1., q.X());
00499 histFull[k].histFullHar[j].mHistCentY->Fill(1., q.Y());
00500 q = pFlowEvent->ReCentPar(pFlowSelect,"TPCW");
00501 histFull[k].histFullHar[j].mHistCentX->Fill(2., q.X());
00502 histFull[k].histFullHar[j].mHistCentY->Fill(2., q.Y());
00503 q = pFlowEvent->ReCentPar(pFlowSelect,"TPC");
00504 histFull[k].histFullHar[j].mHistCentX->Fill(3., q.X());
00505 histFull[k].histFullHar[j].mHistCentY->Fill(3., q.Y());
00506
00507 continue;;
00508 }
00509
00510
00511 Q = pFlowEvent->QPart(pFlowSelect);
00512 if (Q.Mod() == 0.) return kFALSE;
00513 mQ[k][j] += Q;
00514 mQ2[k][j] += Q.Mod2();
00515
00516 if (!mZeroPass) {
00517
00518 mult = (double)(pFlowEvent->MultPart(pFlowSelect));
00519 histFull[k].histFullHar[j].mHistQCent->Fill(1., Q.X()/mult);
00520 histFull[k].histFullHar[j].mHistQCent->Fill(2., Q.Y()/mult);
00521 }
00522
00523
00524 for (int Ntheta = 0; Ntheta < Flow::nTheta; Ntheta++) {
00525 theta = ((float)Ntheta / (float)Flow::nTheta) * TMath::Pi()/order;
00526 if (j<=1) {
00527 mQtheta[k][j][Ntheta] = pFlowEvent->Qtheta(pFlowSelect, theta);
00528 } else {
00529 mQtheta[k][j][Ntheta] = mQtheta[k][j-2][Ntheta];
00530 }
00531 Qtheta = mQtheta[k][j][Ntheta];
00532
00533 if (mFirstPass && j<=1) {
00534
00535 for (int rBin = 1; rBin < Flow::nRBins; rBin++) {
00536 Float_t r = histFull[k].histFullHar[j].histTheta[Ntheta].mHistGtheta->GetBinCenter(rBin);
00537 if (!k) {
00538 expo(0., r * Qtheta);
00539 Gtheta = TComplex::Exp(expo);
00540 } else if (!mV1Mixed || j) {
00541 Gtheta = pFlowEvent->Grtheta(pFlowSelect, r, theta);
00542 if (Gtheta.Rho2() > 1000.) { break; }
00543 }
00544 histFull[k].histFullHar[j].histTheta[Ntheta].mHistProReGtheta->Fill(r, Gtheta.Re());
00545 histFull[k].histFullHar[j].histTheta[Ntheta].mHistProImGtheta->Fill(r, Gtheta.Im());
00546 }
00547 } else if (!mFirstPass) {
00548
00549 r0 = mr0theta[k][j][Ntheta];
00550 if (!k) {
00551 expo(0., r0 * Qtheta);
00552 denom = Qtheta * TComplex::Exp(expo);
00553 } else {
00554 mGr0theta[k][j][Ntheta] = pFlowEvent->Grtheta(pFlowSelect, r0, theta);
00555 denom = mGr0theta[k][j][Ntheta] *
00556 pFlowEvent->Gder_r0theta(pFlowSelect, r0, theta);
00557 }
00558 histFull[k].histFullHar[j].mHistReDenom->Fill(Ntheta, denom.Re());
00559 histFull[k].histFullHar[j].mHistImDenom->Fill(Ntheta, denom.Im());
00560 }
00561 }
00562 }
00563 }
00564
00565
00566
00567 if (!mFirstPass && mV1Mixed) {
00568 for (int Ntheta = 0; Ntheta < Flow::nTheta; Ntheta++) {
00569 theta = ((float)Ntheta / (float)Flow::nTheta) * TMath::Pi()/2.;
00570 r0 = mr0theta[1][1][Ntheta];
00571 TComplex theta1Term(0.,0.);
00572 for (int Ntheta1 = 0; Ntheta1 < Flow::nTheta1; Ntheta1++) {
00573 theta1 = ((float)Ntheta1 / (float)Flow::nTheta1) * 2. * TMath::Pi();
00574 cosTheta12 = cos(2.*(theta1 - theta));
00575 mGV1r0theta[Ntheta1][Ntheta] = pFlowEvent->GV1r0theta(pFlowSelect, r0, theta1, theta);
00576 theta1Term += (cosTheta12 * mGV1r0theta[Ntheta1][Ntheta]);
00577
00578 }
00579 mV1neum[Ntheta] += (theta1Term / (double)Flow::nTheta1);
00580
00581 }
00582 }
00583
00584
00585 return kTRUE;
00586 }
00587
00588
00589
00590 void StFlowLeeYangZerosMaker::FillParticleHistograms() {
00591
00592
00593
00594
00595 StFlowTrackCollection* pFlowTracks = pFlowEvent->TrackCollection();
00596 StFlowTrackIterator itr;
00597
00598 Float_t theta, theta1, phi, eta, pt, m, r0;
00599 TVector2 reCent, reCent2, reCent1;
00600 Double_t order, wgt, wgt2, cosTerm, reCentTheta, reCentTheta2, reCentTheta1;
00601 TComplex expo, numer, cosTermComp;
00602 for (itr = pFlowTracks->begin(); itr != pFlowTracks->end(); itr++) {
00603 StFlowTrack* pFlowTrack = *itr;
00604
00605 phi = pFlowTrack->Phi();
00606 if (phi < 0.) phi += twopi;
00607 eta = pFlowTrack->Eta();
00608 pt = pFlowTrack->Pt();
00609
00610
00611 if (pFlowSelect->SelectPart(pFlowTrack)) {
00612 if (mPtRange_for_vEta[1] > mPtRange_for_vEta[0]) {
00613 if (pt < mPtRange_for_vEta[1] && pt >= mPtRange_for_vEta[0]) {
00614 mHistYieldPartEta->Fill(eta);
00615 }
00616 } else {
00617 mHistYieldPartEta->Fill(eta);
00618 }
00619
00620
00621
00622
00623
00624
00625 if (mEtaRange_for_vPt[1] > mEtaRange_for_vPt[0]) {
00626 if (TMath::Abs(eta) < mEtaRange_for_vPt[1] && TMath::Abs(eta) >= mEtaRange_for_vPt[0]) {
00627 mHistYieldPartPt->Fill(pt);
00628 }
00629 } else {
00630 mHistYieldPartPt->Fill(pt);
00631 }
00632 }
00633
00634 for (int k = 0; k < Flow::nSels; k++) {
00635 pFlowSelect->SetSelection(k);
00636 for (int j = 0; j < Flow::nHars; j++) {
00637 m = 1.;
00638 pFlowSelect->SetHarmonic(j);
00639 if (j==2) { m = 3.; }
00640 else if (j==3) { m = 2.; }
00641 order = (double)(j+1)/m;
00642
00643
00644 if (pFlowSelect->SelectPart(pFlowTrack)) {
00645 reCent = pFlowEvent->ReCent(k, j, pFlowTrack);
00646 for (int Ntheta = 0; Ntheta < Flow::nTheta; Ntheta++) {
00647 theta = ((float)Ntheta / (float)Flow::nTheta) * TMath::Pi()/order;
00648 reCentTheta = reCent.X() * cos(m*order*theta) + reCent.Y() * sin(m*order*theta);
00649 r0 = mr0theta[k][j][Ntheta];
00650 if (!k) {
00651 expo(0., r0 * mQtheta[k][j][Ntheta]);
00652 numer = (cos(m*order*(phi - theta)) - reCentTheta) * TComplex::Exp(expo);
00653 } else {
00654 wgt = pFlowEvent->Weight(k, j, pFlowTrack);
00655 if (!j && mV1Mixed) {
00656 theta = ((float)Ntheta / (float)Flow::nTheta) * TMath::Pi()/2.;
00657 r0 = mr0theta[k][1][Ntheta];
00658 wgt2 = pFlowEvent->Weight(k, 1, pFlowTrack);
00659 reCent2 = pFlowEvent->ReCent(k, 1, pFlowTrack);
00660 reCentTheta2 = reCent2.X() * cos(2.*theta) + reCent2.Y() * sin(2.*theta);
00661 double Gim2 = r0 * wgt2 * (cos(2*(phi - theta)) - reCentTheta2);
00662 TComplex theta1Term(0.,0.);
00663 for (int Ntheta1 = 0; Ntheta1 < Flow::nTheta1; Ntheta1++) {
00664 theta1 = ((float)Ntheta1 / (float)Flow::nTheta1) * 2. * TMath::Pi();
00665 reCentTheta1 = reCent.X() * cos(1.*theta1) + reCent.Y() * sin(1.*theta1);
00666 double Gim1 = r0 * Flow::epsV1 * wgt * (cos(phi - theta1) - reCentTheta1);
00667 TComplex Gr0denom(1., Gim1+Gim2);
00668 TComplex Gr0neum(0., r0 * Flow::epsV1 * (cos(phi - theta1)) - reCentTheta1);
00669 TComplex Gder_r0theta = mGV1r0theta[Ntheta1][Ntheta] * Gr0neum / Gr0denom;
00670 Double_t cosTheta12 = cos(2.*(theta1 - theta));
00671 theta1Term += (cosTheta12 * Gder_r0theta);
00672 }
00673 numer = theta1Term / (double)Flow::nTheta1;
00674 } else if (j==2 && mV1Mixed) {
00675 numer = 0.;
00676 } else {
00677 cosTerm = cos(m*order*(phi - theta)) - reCentTheta;
00678 cosTermComp(1., r0*cosTerm);
00679 numer = mGr0theta[k][j][Ntheta] * cosTerm / cosTermComp;
00680 }
00681 }
00682
00683 if (mPtRange_for_vEta[1] > mPtRange_for_vEta[0]) {
00684 if (pt < mPtRange_for_vEta[1] && pt >= mPtRange_for_vEta[0]) {
00685 histFull[k].histFullHar[j].histTheta[Ntheta].mHistReNumerEta->Fill(eta, numer.Re());
00686 histFull[k].histFullHar[j].histTheta[Ntheta].mHistImNumerEta->Fill(eta, numer.Im());
00687 }
00688 }
00689 else {
00690 histFull[k].histFullHar[j].histTheta[Ntheta].mHistReNumerEta->Fill(eta, numer.Re());
00691 histFull[k].histFullHar[j].histTheta[Ntheta].mHistImNumerEta->Fill(eta, numer.Im());
00692 }
00693
00694 if (mEtaRange_for_vPt[1] > mEtaRange_for_vPt[0]) {
00695 if (TMath::Abs(eta) < mEtaRange_for_vPt[1] && TMath::Abs(eta) >= mEtaRange_for_vPt[0]) {
00696 histFull[k].histFullHar[j].histTheta[Ntheta].mHistReNumer2D->Fill(eta, pt, numer.Re());
00697 histFull[k].histFullHar[j].histTheta[Ntheta].mHistImNumer2D->Fill(eta, pt, numer.Im());
00698 }
00699 }
00700 else {
00701 histFull[k].histFullHar[j].histTheta[Ntheta].mHistReNumer2D->Fill(eta, pt, numer.Re());
00702 histFull[k].histFullHar[j].histTheta[Ntheta].mHistImNumer2D->Fill(eta, pt, numer.Im());
00703 }
00704
00705 }
00706 }
00707 }
00708 }
00709 }
00710
00711
00712 }
00713
00714
00715
00716 Int_t StFlowLeeYangZerosMaker::Finish() {
00717
00718
00719
00720
00721
00722 TOrdCollection* savedHistNames = new TOrdCollection(Flow::nSels * Flow::nHars);
00723 TOrdCollection* savedHistFirstPassNames = new TOrdCollection(Flow::nSels * Flow::nTheta * 3);
00724 TOrdCollection* savedHistZeroPassNames = new TOrdCollection(Flow::nSels * Flow::nHars * 2);
00725 TString* histTitle;
00726
00727 cout << endl << "##### LeeYangZeros Maker:" << endl;
00728
00729 Float_t reCentX, reCentY;
00730 if (mFirstPass) { cout << "Test of recentering of Q vector per particle:" << endl; }
00731 for (int k = 0; k < Flow::nSels; k++) {
00732 for (int j = 0; j < Flow::nHars; j++) {
00733 if (mZeroPass) {
00734 reCentX = histFull[k].histFullHar[j].mHistCentX->GetBinContent(3);
00735 reCentY = histFull[k].histFullHar[j].mHistCentY->GetBinContent(3);
00736 cout << setprecision(3) << "Sel = " << k+1 << ", Har = " << j+1 << " : reCent_x = " << reCentX
00737 << ", reCent_y = " << reCentY << endl;
00738 reCentX = histFull[k].histFullHar[j].mHistCentX->GetBinContent(1);
00739 reCentY = histFull[k].histFullHar[j].mHistCentY->GetBinContent(1);
00740 cout << setprecision(3) << "Sel = " << k+1 << ", Har = " << j+1 << " : reCentE_x = " << reCentX
00741 << ", reCentE_y = " << reCentY << endl;
00742 reCentX = histFull[k].histFullHar[j].mHistCentX->GetBinContent(2);
00743 reCentY = histFull[k].histFullHar[j].mHistCentY->GetBinContent(2);
00744 cout << setprecision(3) << "Sel = " << k+1 << ", Har = " << j+1 << " : reCentW_x = " << reCentX
00745 << ", reCentW_y = " << reCentY << endl;
00746 savedHistZeroPassNames->AddLast(histFull[k].histFullHar[j].mHistCentX);
00747 savedHistZeroPassNames->AddLast(histFull[k].histFullHar[j].mHistCentY);
00748 } else if (mFirstPass) {
00749 reCentX = histFull[k].histFullHar[j].mHistQCent->GetBinContent(1);
00750 reCentY = histFull[k].histFullHar[j].mHistQCent->GetBinContent(2);
00751 cout << setprecision(3) << "Sel = " << k+1 << ", Har = " << j+1 << " : reCentedQ_x = " << reCentX
00752 << ", reCentedQ_y = " << reCentY << endl;
00753 savedHistFirstPassNames->AddLast(histFull[k].histFullHar[j].mHistQCent);
00754 } else {
00755 savedHistNames->AddLast(histFull[k].histFullHar[j].mHistQCent);
00756 }
00757 }
00758 }
00759 cout << endl;
00760 if (mZeroPass) {
00761 TFile fileZeroPass("flow.reCent.root", "RECREATE");
00762 fileZeroPass.cd();
00763 savedHistZeroPassNames->Write();
00764 fileZeroPass.Close();
00765 delete savedHistZeroPassNames;
00766 delete pFlowSelect;
00767
00768 return StMaker::Finish();
00769 }
00770
00771 cout << "integrated flow: (errors just show variation with theta)" << endl;
00772
00773 Float_t reG, imG, reNumer, imNumer, reDenom, imDenom, reDiv;
00774 TComplex Gtheta, denom, numer, div;
00775 TComplex i = TComplex::I();
00776 Float_t mult = mHistMult->GetMean();
00777 Float_t _v, vErr, Vtheta, V, V1SqTheta, V1Sq, yield, eta, pt;
00778 Double_t r0, yieldSum, vSum, err2Sum, Glast, G0, Gnext, GnextNext, v1DiffConst;
00779 Float_t Xlast, X0, Xnext, sigma2, chi;
00780 Float_t BesselRatio[3] = {1., 1.202, 2.69};
00781 Int_t m, v2Sign;
00782 Bool_t etaPtNoCut;
00783 Double_t T, B, F;
00784 if (!mFirstPass) {
00785 Int_t etaBins = mHistYieldPartEta->GetNbinsX();
00786 T = mHistYieldPartEta->Integral(0, etaBins+1);
00787 B = mHistYieldPartEta->Integral(0, etaBins/2);
00788 F = mHistYieldPartEta->Integral(etaBins/2+1, etaBins+1);
00789
00790 }
00791
00792 int rBins = Flow::nRBins;
00793 for (int k = 0; k < Flow::nSels; k++) {
00794 for (int j = 0; j < Flow::nHars; j++) {
00795 bool oddHar = (j+1) % 2;
00796 m = 1;
00797 if (j==2) { m = 3; }
00798 else if (j==3) { m = 2; }
00799 if (mFirstPass && j<=1) {
00800 for (int Ntheta = 0; Ntheta < Flow::nTheta; Ntheta++) {
00801 for (int rBin = 1; rBin <= rBins; rBin++) {
00802
00803
00804
00805 reG = histFull[k].histFullHar[j].histTheta[Ntheta].mHistProReGtheta->GetBinContent(rBin);
00806 imG = histFull[k].histFullHar[j].histTheta[Ntheta].mHistProImGtheta->GetBinContent(rBin);
00807 Gtheta(reG, imG);
00808 histFull[k].histFullHar[j].histTheta[Ntheta].mHistGtheta->SetBinContent(rBin, Gtheta.Rho2());
00809 }
00810
00811 r0 = histFull[k].histFullHar[j].histTheta[Ntheta].mHistGtheta->GetXaxis()->
00812 GetBinCenter(rBins);
00813 for (int N = 2; N < rBins-1; N++) {
00814 G0 = histFull[k].histFullHar[j].histTheta[Ntheta].mHistGtheta->GetBinContent(N);
00815 Gnext = histFull[k].histFullHar[j].histTheta[Ntheta].mHistGtheta->GetBinContent(N+1);
00816 GnextNext = histFull[k].histFullHar[j].histTheta[Ntheta].mHistGtheta->GetBinContent(N+2);
00817
00818 if (Gnext > G0 && GnextNext > G0) {
00819 Glast = histFull[k].histFullHar[j].histTheta[Ntheta].mHistGtheta->GetBinContent(N-1);
00820 Xlast = histFull[k].histFullHar[j].histTheta[Ntheta].mHistGtheta->GetBinCenter(N-1);
00821 X0 = histFull[k].histFullHar[j].histTheta[Ntheta].mHistGtheta->GetBinCenter(N);
00822 Xnext = histFull[k].histFullHar[j].histTheta[Ntheta].mHistGtheta->GetBinCenter(N+1);
00823 if (X0 < 0.005) break;
00824 r0 = X0;
00825 r0 -= ((X0 - Xlast)*(X0 - Xlast)*(G0 - Gnext) - (X0 - Xnext)*(X0 - Xnext)*(G0 - Glast)) /
00826 (2.*((X0 - Xlast)*(G0 - Gnext) - (X0 - Xnext)*(G0 - Glast)));
00827
00828 break;
00829 }
00830 }
00831 histFull[k].histFullHar[j].mHistPro_r0theta->Fill(Ntheta, r0);
00832 Vtheta = Flow::j01 / r0;
00833 histFull[k].histFullHar[j].mHistPro_Vtheta->Fill(Ntheta, Vtheta);
00834 _v = (m==1) ? Vtheta / mult : 0.;
00835 histFull[k].mHistPro_vr0->Fill(j+1, _v/perCent);
00836
00837 savedHistFirstPassNames->AddLast(histFull[k].histFullHar[j].histTheta[Ntheta].mHistGtheta);
00838
00839
00840
00841 histTitle = new TString("FlowReGtheta");
00842 *histTitle += Ntheta;
00843 *histTitle += "_Sel";
00844 *histTitle += k+1;
00845 *histTitle += "_Har";
00846 *histTitle += j+1;
00847 histFull[k].histFullHar[j].histTheta[Ntheta].mHistReGtheta =
00848 histFull[k].histFullHar[j].histTheta[Ntheta].mHistProReGtheta->ProjectionX(histTitle->Data());
00849 histFull[k].histFullHar[j].histTheta[Ntheta].mHistReGtheta->SetTitle(histTitle->Data());
00850 histFull[k].histFullHar[j].histTheta[Ntheta].mHistReGtheta->SetXTitle("r");
00851 histFull[k].histFullHar[j].histTheta[Ntheta].mHistReGtheta->SetYTitle("Re(G^{#theta}(ir))");
00852 delete histTitle;
00853 savedHistFirstPassNames->AddLast(histFull[k].histFullHar[j].histTheta[Ntheta].mHistReGtheta);
00854
00855 histTitle = new TString("FlowImGtheta");
00856 *histTitle += Ntheta;
00857 *histTitle += "_Sel";
00858 *histTitle += k+1;
00859 *histTitle += "_Har";
00860 *histTitle += j+1;
00861 histFull[k].histFullHar[j].histTheta[Ntheta].mHistImGtheta =
00862 histFull[k].histFullHar[j].histTheta[Ntheta].mHistProImGtheta->ProjectionX(histTitle->Data());
00863 histFull[k].histFullHar[j].histTheta[Ntheta].mHistImGtheta->SetTitle(histTitle->Data());
00864 histFull[k].histFullHar[j].histTheta[Ntheta].mHistImGtheta->SetXTitle("r");
00865 histFull[k].histFullHar[j].histTheta[Ntheta].mHistImGtheta->SetYTitle("Im(G^{#theta}(ir))");
00866 delete histTitle;
00867 savedHistFirstPassNames->AddLast(histFull[k].histFullHar[j].histTheta[Ntheta].mHistImGtheta);
00868
00869 }
00870
00871 } else if (!mFirstPass) {
00872
00873 V1Sq = 0.;
00874 for (int Ntheta = 0; Ntheta < Flow::nTheta; Ntheta++) {
00875
00876 if (k && !j && mV1Mixed) {
00877 mV1neum[Ntheta] /= mNEvents;
00878
00879 r0 = mr0theta[1][1][Ntheta];
00880 reDenom = histFull[k].histFullHar[1].mHistReDenom->GetBinContent(Ntheta+1);
00881 imDenom = histFull[k].histFullHar[1].mHistImDenom->GetBinContent(Ntheta+1);
00882 denom(reDenom,imDenom);
00883 div = mV1neum[Ntheta] / denom;
00884 reDiv = div.Re();
00885 V1SqTheta = -8. * Flow::j01 / (Flow::epsV1*Flow::epsV1) / TMath::Power(r0,3.) * reDiv;
00886 V1Sq += V1SqTheta;
00887 if (!isnan(V1SqTheta) && V1SqTheta != 0.) {
00888 Vtheta = TMath::Sqrt(fabs(V1SqTheta));
00889 }
00890 } else {
00891 Vtheta = Flow::j01 / mr0theta[k][j][Ntheta];
00892 }
00893 histFull[k].mHistPro_V->Fill(j+1, Vtheta);
00894 _v = (m==1) ? Vtheta / mult : 0.;
00895 histFull[k].mHistPro_vr0->Fill(j+1, _v/perCent);
00896
00897 }
00898
00899 if (k && !j && mV1Mixed) {
00900 V1Sq /= Flow::nTheta;
00901 v2Sign = (int)(V1Sq / fabs(V1Sq));
00902 cout << "The sign of v2 is " << v2Sign << endl;
00903
00904 V = TMath::Sqrt(fabs(V1Sq));
00905
00906 v1DiffConst = -4. * Flow::j01 * (double)v2Sign / V / (Flow::epsV1*Flow::epsV1) /
00907 TMath::Power(r0,3.);
00908 }
00909
00910
00911
00912 for (int Ntheta = 0; Ntheta < Flow::nTheta; Ntheta++) {
00913
00914 if (k && !j && mV1Mixed) {
00915 reDenom = histFull[k].histFullHar[1].mHistReDenom->GetBinContent(Ntheta+1);
00916 imDenom = histFull[k].histFullHar[1].mHistImDenom->GetBinContent(Ntheta+1);
00917 denom(reDenom,imDenom);
00918 } else {
00919 reDenom = histFull[k].histFullHar[j].mHistReDenom->GetBinContent(Ntheta+1);
00920 imDenom = histFull[k].histFullHar[j].mHistImDenom->GetBinContent(Ntheta+1);
00921 denom(reDenom,imDenom);
00922 denom *= TComplex::Power(i, m-1);
00923 Vtheta = Flow::j01 / mr0theta[k][j][Ntheta];
00924 }
00925
00926
00927 int etaMax = histFull[k].histFullHar[j].histTheta[Ntheta].mHistReNumerEta->GetNbinsX();
00928 for (int binEta = 1; binEta <= etaMax; binEta++) {
00929 eta = histFull[k].histFullHar[j].histTheta[Ntheta].mHistReNumerEta->GetXaxis()->
00930 GetBinCenter(binEta);
00931
00932 reNumer = histFull[k].histFullHar[j].histTheta[Ntheta].mHistReNumerEta->
00933 GetBinContent(binEta);
00934 imNumer = histFull[k].histFullHar[j].histTheta[Ntheta].mHistImNumerEta->
00935 GetBinContent(binEta);
00936 numer(reNumer,imNumer);
00937
00938 reDiv = (numer / denom).Re();
00939 if (!isnan(reDiv) && reDiv != 0.) {
00940 if (k && !j && mV1Mixed) {
00941 _v = v1DiffConst * reDiv /perCent;
00942 } else {
00943 _v = BesselRatio[m-1] * reDiv * Vtheta /perCent;
00944 }
00945 histFull[k].histFullHar[j].mHistPro_vEta->Fill(eta, _v);
00946
00947 }
00948 }
00949
00950
00951 Float_t v[2];
00952 int etaMax2D = histFull[k].histFullHar[j].histTheta[Ntheta].mHistReNumer2D->
00953 GetNbinsX();
00954 for (int binPt = 1; binPt <= mPtBinsPart; binPt++) {
00955 pt = histFull[k].histFullHar[j].histTheta[Ntheta].mHistReNumer2D->GetYaxis()->
00956 GetBinCenter(binPt);
00957 for (int binEta = 1; binEta <= etaMax2D; binEta++) {
00958 eta = histFull[k].histFullHar[j].histTheta[Ntheta].mHistReNumer2D->GetXaxis()->
00959 GetBinCenter(binEta);
00960
00961 reNumer = histFull[k].histFullHar[j].histTheta[Ntheta].mHistReNumer2D->
00962 GetBinContent(binEta, binPt);
00963 imNumer = histFull[k].histFullHar[j].histTheta[Ntheta].mHistImNumer2D->
00964 GetBinContent(binEta, binPt);
00965 numer(reNumer,imNumer);
00966
00967 reDiv = (numer / denom).Re();
00968 if (k && !j && mV1Mixed) {
00969 v[binEta-1] = v1DiffConst * reDiv /perCent;
00970 } else {
00971 v[binEta-1] = BesselRatio[m-1] * reDiv * Vtheta /perCent;
00972 }
00973 }
00974 if (!isnan(reDiv) && reDiv != 0.) {
00975 if (oddHar) {
00976 _v = (F * v[1] - B * v[0]) / T;
00977 } else {
00978 _v = (B * v[0] + F * v[1]) / T;
00979 }
00980 histFull[k].histFullHar[j].mHistPro_vPt->Fill(pt, _v);
00981 }
00982 }
00983
00984 }
00985
00986 }
00987
00988 if (j <=1) {
00989
00990 mQ[k][j] /= (float)mNEvents;
00991 mQ2[k][j] /= (float)mNEvents;
00992
00993 V = histFull[k].mHistPro_V->GetBinContent(j+1);
00994 sigma2 = mQ2[k][j] - TMath::Power(mQ[k][j].X(), 2.) - TMath::Power(mQ[k][j].Y(), 2.)
00995 - TMath::Power(V, 2.);
00996
00997 chi = V / TMath::Sqrt(sigma2);
00998
00999
01000 _v = histFull[k].mHistPro_vr0->GetBinContent(j+1);
01001 vErr = histFull[k].mHistPro_vr0->GetBinError(j+1);
01002 if (k && !j && mV1Mixed) {
01003 if (!mFirstPass) {
01004 cout << setprecision(3) << "Sel = " << k+1 << ": v" << j+1 << " from r0 = (" << _v <<
01005 " +/- " << vErr << ") %"<< " from mixed harmonics" << endl;
01006 }
01007 } else if (mFirstPass) {
01008 cout << setprecision(3) << "Sel = " << k+1 << ": v" << j+1 << " from r0 = (" << _v <<
01009 " +/- " << vErr << ") %" << endl;
01010 } else {
01011 cout << setprecision(3) << "Sel = " << k+1 << ": v" << j+1 << " from r0 = (" << _v <<
01012 " +/- " << vErr << ") % chiJYO = " << chi << endl;
01013 }
01014 }
01015
01016
01017
01018 if (mFirstPass && j<=1) {
01019
01020 histTitle = new TString("FlowLYZ_r0theta_Sel");
01021 *histTitle += k+1;
01022 *histTitle += "_Har";
01023 *histTitle += j+1;
01024 histFull[k].histFullHar[j].mHist_r0theta =
01025 histFull[k].histFullHar[j].mHistPro_r0theta->ProjectionX(histTitle->Data());
01026 histFull[k].histFullHar[j].mHist_r0theta->SetTitle(histTitle->Data());
01027 histFull[k].histFullHar[j].mHist_r0theta->SetXTitle("#theta");
01028 histFull[k].histFullHar[j].mHist_r0theta->SetYTitle("r_{0}^{#theta}");
01029 delete histTitle;
01030 savedHistFirstPassNames->AddLast(histFull[k].histFullHar[j].mHist_r0theta);
01031
01032 histTitle = new TString("FlowLYZ_Vtheta_Sel");
01033 *histTitle += k+1;
01034 *histTitle += "_Har";
01035 *histTitle += j+1;
01036 histFull[k].histFullHar[j].mHist_Vtheta =
01037 histFull[k].histFullHar[j].mHistPro_Vtheta->ProjectionX(histTitle->Data());
01038 histFull[k].histFullHar[j].mHist_Vtheta->SetTitle(histTitle->Data());
01039 histFull[k].histFullHar[j].mHist_Vtheta->SetXTitle("#theta");
01040 histFull[k].histFullHar[j].mHist_Vtheta->SetYTitle("V_{n}^{#theta}");
01041 delete histTitle;
01042 savedHistFirstPassNames->AddLast(histFull[k].histFullHar[j].mHist_Vtheta);
01043
01044 } else if (!mFirstPass) {
01045
01046 histTitle = new TString("FlowLYZ_vEta_Sel");
01047 *histTitle += k+1;
01048 *histTitle += "_Har";
01049 *histTitle += j+1;
01050 histFull[k].histFullHar[j].mHist_vEta =
01051 histFull[k].histFullHar[j].mHistPro_vEta->ProjectionX(histTitle->Data());
01052 histFull[k].histFullHar[j].mHist_vEta->SetTitle(histTitle->Data());
01053 histFull[k].histFullHar[j].mHist_vEta->SetXTitle((char*)xLabel.Data());
01054 histFull[k].histFullHar[j].mHist_vEta->SetYTitle("v (%)");
01055 delete histTitle;
01056 savedHistNames->AddLast(histFull[k].histFullHar[j].mHist_vEta);
01057
01058 histTitle = new TString("FlowLYZ_vPt_Sel");
01059 *histTitle += k+1;
01060 *histTitle += "_Har";
01061 *histTitle += j+1;
01062 histFull[k].histFullHar[j].mHist_vPt =
01063 histFull[k].histFullHar[j].mHistPro_vPt->ProjectionX(histTitle->Data());
01064 histFull[k].histFullHar[j].mHist_vPt->SetTitle(histTitle->Data());
01065 histFull[k].histFullHar[j].mHist_vPt->SetXTitle("Pt (GeV/c)");
01066 histFull[k].histFullHar[j].mHist_vPt->SetYTitle("v (%)");
01067 delete histTitle;
01068 savedHistNames->AddLast(histFull[k].histFullHar[j].mHist_vPt);
01069
01070
01071
01072
01073 yieldSum = 0.;
01074 vSum = 0.;
01075 err2Sum = 0.;
01076 for (int bin=1; bin<=mNEtaBins; bin++) {
01077 etaPtNoCut = kTRUE;
01078 eta = histFull[k].histFullHar[j].mHistPro_vEta->GetBinCenter(bin);
01079 if (mEtaRange_for_vPt[1] > mEtaRange_for_vPt[0] &&
01080 (TMath::Abs(eta) < mEtaRange_for_vPt[0] ||
01081 TMath::Abs(eta) >= mEtaRange_for_vPt[1])) {
01082 etaPtNoCut = kFALSE;
01083 }
01084 _v = histFull[k].histFullHar[j].mHistPro_vEta->GetBinContent(bin);
01085 if (_v != 0. && etaPtNoCut) {
01086 yield = mHistYieldPartEta->GetBinContent(bin);
01087 yieldSum += yield;
01088 if (oddHar && eta < 0.) { _v *= -1.; }
01089 vSum += yield * _v;
01090 vErr = histFull[k].histFullHar[j].mHistPro_vEta->GetBinError(bin);
01091 err2Sum += yield*vErr * yield*vErr;
01092 }
01093 }
01094 if (yieldSum) {
01095 _v = vSum / yieldSum;
01096 vErr = TMath::Sqrt(err2Sum) / yieldSum;
01097 cout << setprecision(3) << "Sel = " << k+1 << ": v" << j+1 << " from eta= (" << _v <<
01098 " +/- " << vErr << ") %" << endl;
01099 }
01100
01101
01102 yieldSum = 0.;
01103 vSum = 0.;
01104 err2Sum = 0.;
01105 for (int bin=1; bin<=mPtBinsPart; bin++) {
01106 etaPtNoCut = kTRUE;
01107 pt = histFull[k].histFullHar[j].mHistPro_vPt->GetBinCenter(bin);
01108 if (mPtRange_for_vEta[1] > mPtRange_for_vEta[0] &&
01109 (pt < mPtRange_for_vEta[0] || pt >= mPtRange_for_vEta[1])) {
01110 etaPtNoCut = kFALSE;
01111 }
01112 _v = histFull[k].histFullHar[j].mHistPro_vPt->GetBinContent(bin);
01113 if (_v != 0. && etaPtNoCut) {
01114 yield = mHistYieldPartPt->GetBinContent(bin);
01115 yieldSum += yield;
01116 vSum += yield * _v;
01117 vErr = histFull[k].histFullHar[j].mHistPro_vPt->GetBinError(bin);
01118 err2Sum += yield*vErr * yield*vErr;
01119 }
01120 }
01121 if (yieldSum) {
01122 _v = vSum / yieldSum;
01123 vErr = TMath::Sqrt(err2Sum) / yieldSum;
01124 histFull[k].mHist_v->SetBinContent(j+1, _v);
01125 histFull[k].mHist_v->SetBinError(j+1, vErr);
01126 cout << setprecision(3) << "Sel = " << k+1 << ": v" << j+1 << " from pt = (" << _v <<
01127 " +/- " << vErr << ") %" << endl;
01128 }
01129
01130 }
01131
01132 }
01133
01134 histTitle = new TString("FlowLYZ_vr0_Sel");
01135 *histTitle += k+1;
01136 histFull[k].mHist_vr0 =
01137 histFull[k].mHistPro_vr0->ProjectionX(histTitle->Data());
01138 histFull[k].mHist_vr0->SetTitle(histTitle->Data());
01139 histFull[k].mHist_vr0->SetXTitle("Harmonic");
01140 histFull[k].mHist_vr0->SetYTitle("v from r_{0} (%)");
01141 delete histTitle;
01142 savedHistFirstPassNames->AddLast(histFull[k].mHist_vr0);
01143 savedHistNames->AddLast(histFull[k].mHist_vr0);
01144
01145 if (!mFirstPass) {
01146
01147
01148 histTitle = new TString("FlowLYZ_V_Sel");
01149 *histTitle += k+1;
01150 histFull[k].mHist_V =
01151 histFull[k].mHistPro_V->ProjectionX(histTitle->Data());
01152 histFull[k].mHist_V->SetTitle(histTitle->Data());
01153 histFull[k].mHist_V->SetXTitle("Harmonic");
01154 histFull[k].mHist_V->SetYTitle("mean V_{n}");
01155 delete histTitle;
01156 savedHistNames->AddLast(histFull[k].mHist_V);
01157
01158 savedHistNames->AddLast(histFull[k].mHist_v);
01159 }
01160
01161 }
01162
01163
01164
01165 TFile fileFirstPassNew("flow.firstPassLYZNew.root", "RECREATE");
01166 TFile histFile("flow.LeeYangZeros.root", "RECREATE");
01167 if (mFirstPass) {
01168 savedHistFirstPassNames->AddLast(mHistMult);
01169 fileFirstPassNew.cd();
01170 savedHistFirstPassNames->Write();
01171 histFile.cd();
01172 savedHistFirstPassNames->Write();
01173 } else {
01174 histFile.cd();
01175 savedHistNames->AddLast(mHistMult);
01176 savedHistNames->AddLast(mHistYieldPartPt);
01177 savedHistNames->AddLast(mHistYieldPartEta);
01178 savedHistNames->Write();
01179 }
01180 fileFirstPassNew.Close();
01181 histFile.Close();
01182
01183 delete savedHistNames;
01184 delete savedHistFirstPassNames;
01185 delete pFlowSelect;
01186
01187
01188
01189
01190
01191
01192 return StMaker::Finish();
01193 }
01194
01195
01196
01197 void StFlowLeeYangZerosMaker::SetHistoRanges(Bool_t ftpc_included) {
01198
01199 if (ftpc_included) {
01200 mEtaMin = Flow::etaMin;
01201 mEtaMax = Flow::etaMax;
01202 mNEtaBins = Flow::nEtaBins;
01203 }
01204 else {
01205 mEtaMin = Flow::etaMinTpcOnly;
01206 mEtaMax = Flow::etaMaxTpcOnly;
01207 mNEtaBins = Flow::nEtaBinsTpcOnly;
01208 }
01209
01210 return;
01211 }
01212
01213
01214
01215 inline void StFlowLeeYangZerosMaker::SetPtRange_for_vEta(Float_t lo, Float_t hi) {
01216
01217
01218
01219 mPtRange_for_vEta[0] = lo;
01220 mPtRange_for_vEta[1] = hi;
01221
01222 return;
01223 }
01224
01225
01226
01227 inline void StFlowLeeYangZerosMaker::SetEtaRange_for_vPt(Float_t lo, Float_t hi) {
01228
01229
01230
01231 mEtaRange_for_vPt[0] = lo;
01232 mEtaRange_for_vPt[1] = hi;
01233
01234 return;
01235 }
01236
01237