StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StFlowAnalysisMaker.cxx
1 //
3 // $Id: StFlowAnalysisMaker.cxx,v 1.103 2011/07/25 15:54:42 posk Exp $
4 //
5 // Authors: Raimond Snellings and Art Poskanzer, LBNL, Aug 1999
6 // FTPC added by Markus Oldenburg, MPI, Dec 2000
7 //
9 //
10 // Description: Maker to analyze Flow using StFlowEvent
11 //
13 
14 #include <Stiostream.h>
15 #include <stdlib.h>
16 #include <math.h>
17 #include "StMaker.h"
18 #include "StFlowAnalysisMaker.h"
19 #include "StFlowMaker/StFlowMaker.h"
20 #include "StFlowMaker/StFlowEvent.h"
21 #include "StFlowMaker/StFlowConstants.h"
22 #include "StFlowMaker/StFlowSelection.h"
23 #include "StFlowMaker/StFlowCutEvent.h"
24 #include "StEnumerations.h"
25 #include "PhysicalConstants.h"
26 #include "SystemOfUnits.h"
27 #include "TVector2.h"
28 #include "TFile.h"
29 #include "TString.h"
30 #include "TH1.h"
31 #include "TH2.h"
32 #include "TH3.h"
33 #include "TProfile.h"
34 #include "TProfile2D.h"
35 #include "TOrdCollection.h"
36 #include "StMessMgr.h"
37 #include "TMath.h"
38 #include "TText.h"
39 #include "TF1.h"
40 #define PR(x) cout << "##### FlowAnalysis: " << (#x) << " = " << (x) << endl;
41 
42 ClassImp(StFlowAnalysisMaker)
43 
44 //-----------------------------------------------------------------------
45 
46 StFlowAnalysisMaker::StFlowAnalysisMaker(const Char_t* name): StMaker(name),
47  MakerName(name) {
48  pFlowSelect = new StFlowSelection();
49  SetHistoRanges();
50  SetPtRange_for_vEta(0., 0.);
51  SetEtaRange_for_vPt(0., 0.);
52 }
53 
55  const StFlowSelection& flowSelect) :
56  StMaker(name), MakerName(name) {
57  pFlowSelect = new StFlowSelection(flowSelect); //copy constructor
58  SetHistoRanges();
59  SetPtRange_for_vEta(0., 0.);
60  SetEtaRange_for_vPt(0., 0.);
61 }
62 
63 //-----------------------------------------------------------------------
64 
65 StFlowAnalysisMaker::~StFlowAnalysisMaker() {
66 }
67 
68 //-----------------------------------------------------------------------
69 
71  // Make histograms
72 
73  // Get another pointer to StFlowEvent
74  pFlowMaker = NULL;
75  pFlowMaker = (StFlowMaker*)GetMaker("Flow");
76  if (pFlowMaker) pFlowEvent = pFlowMaker->FlowEventPointer();
77  if (pFlowEvent && pFlowSelect->Select(pFlowEvent)) { // event selected
78  if (FillFromFlowEvent()) { // get event quantities
79  FillEventHistograms(); // fill from FlowEvent
80  FillParticleHistograms(); // fill particle histograms
81  } else {
82  gMessMgr->Info("##### FlowAnalysis: Event psi = 0");
83  }
84  } else {
85  gMessMgr->Info("##### FlowAnalysis: FlowEvent pointer null");
86  return kStOK;
87  }// selected events
88 
89  if (Debug()) StMaker::PrintInfo();
90 
91  return kStOK;
92 }
93 
94 //-----------------------------------------------------------------------
95 
96 Int_t StFlowAnalysisMaker::Init() {
97  // Book histograms
98 
99  StFlowMaker* pFlowMaker = NULL;
100  pFlowMaker = (StFlowMaker*)GetMaker("Flow");
101  Bool_t reCentCalc = pFlowMaker->ReCentCalc();
102 
103  float ptMaxPart = Flow::ptMaxPart;
104  if (pFlowSelect->PtMaxPart()) {
105  ptMaxPart = pFlowSelect->PtMaxPart();
106  }
107  int nPtBinsPart = Flow::nPtBinsPart;
108  if (pFlowSelect->PtBinsPart()) {
109  nPtBinsPart = pFlowSelect->PtBinsPart();
110  }
111  xLabel = "Pseudorapidity";
112  if (strlen(pFlowSelect->PidPart()) != 0) { xLabel = "Rapidity"; }
113 
114  const float triggerMin = -0.5;
115  const float triggerMax = 10.5;
116  const float chargeMin = -2.5;
117  const float chargeMax = 2.5;
118  const float dcaMin = 0.;
119  const float dcaMax = 0.3;
120  const float glDcaMax = 3.6;
121  const float chi2Min = 0.;
122  const float chi2Max = 5.;
123  const float fitPtsMinTpc = -0.5;
124  const float fitPtsMaxTpc = 60.5;
125  const float maxPtsMinTpc = -0.5;
126  const float maxPtsMaxTpc = 60.5;
127  const float fitPtsMinFtpc = -0.5;
128  const float fitPtsMaxFtpc = 12.5;
129  const float maxPtsMinFtpc = -0.5;
130  const float maxPtsMaxFtpc = 12.5;
131  const float fitOverMaxMin = 0.;
132  const float fitOverMaxMax = 1.2;
133  const float origMultMin = 0.;
134  const float origMultMax = 3000.;
135  const float MultEtaMin = 0.;
136  const float MultEtaMax = 1000.;
137  const float totalMultMin = 0.;
138  const float totalMultMax = 2000.;
139  const float corrMultMin = 0.;
140  const float corrMultMax = 2000.;
141  const float multOverOrigMin = 0.;
142  const float multOverOrigMax = 1.;
143  const float vertexZMin =-100.5;
144  const float vertexZMax = 100.5;
145  const float vertexXYMin = -1.;
146  const float vertexXYMax = 1.;
147  const float QXYMin = -0.5;
148  const float QXYMax = 0.5;
149  const float etaSymZMin = -1.15;
150  const float etaSymZMax = 1.15;
151  const float etaSymMin = -6.;
152  const float etaSymMax = 6.;
153  const float phiMin = 0.;
154  const float phiMax = twopi;
155  const float psiMin = 0.;
156  const float psiMax = twopi;
157  const float multMin = 0.;
158  const float multMax = 2000.;
159  const float qMin = 0.;
160  const float pidMin = -10.;
161  const float pidMax = 10.;
162  const float centMin = -0.5;
163  const float centMax = 9.5;
164  const float pMin = -2.5;
165  const float pMax = 1.5;
166  const float dEdxMax = 0.00004;
167  const float qMax = 3.5;
168 
169  enum { nTriggerBins = 11,
170  nChargeBins = 50,
171  nDcaBins = 60,
172  nChi2Bins = 50,
173  nFitPtsBinsTpc = 61,
174  nFitPtsBinsFtpc = 13,
175  nMaxPtsBinsTpc = 61,
176  nMaxPtsBinsFtpc = 13,
177  nFitOverMaxBins = 40,
178  nOrigMultBins = 60,
179  nMultEtaBins = 50,
180  nTotalMultBins = 40,
181  nMultOverOrigBins = 50,
182  nMultPartBins = 40,
183  nVertexZBins = 51,
184  nVertexXYBins = 50,
185  nQXYBins = 50,
186  nEtaSymBins = 45,
187  nPhi3DBins = 18,
188  nPsiBins = 36,
189  nMultBins = 40,
190  nPidBins = 50,
191  nCentBins = 10,
192  nDedxBins = 200,
193  nMomenBins = 200,
194  n_qBins = 50
195  };
196 
197  // Trigger
198  mHistTrigger = new TH1F("Flow_Trigger", "Flow_Trigger",
199  nTriggerBins, triggerMin, triggerMax);
200  mHistTrigger->SetXTitle("Trig: 0 mb+cen, 1 mb, 2 central, 3 laser, 10 other");
201  mHistTrigger->SetYTitle("Counts");
202 
203  // Charge
204  // Ftpc
205  mHistChargeFtpc = new TH1F("Flow_Charge_Ftpc", "Flow_Charge_Ftpc",
206  nChargeBins, chargeMin, chargeMax);
207  mHistChargeFtpc->SetXTitle("Charge");
208  mHistChargeFtpc->SetYTitle("Counts");
209 
210  // Distance of closest approach
211  // Tpc
212  mHistDcaTpc = new TH1F("Flow_Dca_Tpc", "Flow_Dca_Tpc",
213  nDcaBins, dcaMin, dcaMax);
214  mHistDcaTpc->SetXTitle("Track dca to Vertex (cm)");
215  mHistDcaTpc->SetYTitle("Counts");
216 
217  // Ftpc
218  mHistDcaFtpc = new TH1F("Flow_Dca_Ftpc", "Flow_Dca_Ftpc",
219  nDcaBins, dcaMin, dcaMax);
220  mHistDcaFtpc->SetXTitle("Track dca to Vertex (cm)");
221  mHistDcaFtpc->SetYTitle("Counts");
222 
223 
224  // Distance of closest approach for global tracks
225  // Tpc
226  mHistDcaGlobalTpc = new TH1F("Flow_DcaGlobal_Tpc", "Flow_DcaGlobal_Tpc",
227  nDcaBins, dcaMin, glDcaMax);
228  mHistDcaGlobalTpc->SetXTitle("Global Track dca (cm)");
229  mHistDcaGlobalTpc->SetYTitle("Counts");
230 
231  // Ftpc
232  mHistDcaGlobalFtpc = new TH1F("Flow_DcaGlobal_Ftpc", "Flow_DcaGlobal_Ftpc",
233  nDcaBins, dcaMin, glDcaMax);
234  mHistDcaGlobalFtpc->SetXTitle("Global Track dca (cm)");
235  mHistDcaGlobalFtpc->SetYTitle("Counts");
236 
237 
238  // Chi2
239  // Tpc
240  mHistChi2Tpc = new TH1F("Flow_Chi2_Tpc", "Flow_Chi2_Tpc",
241  nChi2Bins, chi2Min, chi2Max);
242  mHistChi2Tpc->SetXTitle("Chi square per df");
243  mHistChi2Tpc->SetYTitle("Counts");
244 
245  // Ftpc
246  mHistChi2Ftpc = new TH1F("Flow_Chi2_Ftpc", "Flow_Chi2_Ftpc",
247  nChi2Bins, chi2Min, chi2Max);
248  mHistChi2Ftpc->SetXTitle("Chi square per df");
249  mHistChi2Ftpc->SetYTitle("Counts");
250 
251 
252  // FitPts
253  // Tpc
254  mHistFitPtsTpc = new TH1F("Flow_FitPts_Tpc", "Flow_FitPts_Tpc",
255  nFitPtsBinsTpc, fitPtsMinTpc, fitPtsMaxTpc);
256  mHistFitPtsTpc->SetXTitle("Fit Points");
257  mHistFitPtsTpc->SetYTitle("Counts");
258 
259  // Ftpc
260  mHistFitPtsFtpc = new TH1F("Flow_FitPts_Ftpc", "Flow_FitPts_Ftpc",
261  nFitPtsBinsFtpc, fitPtsMinFtpc, fitPtsMaxFtpc);
262  mHistFitPtsFtpc->SetXTitle("Fit Points");
263  mHistFitPtsFtpc->SetYTitle("Counts");
264 
265 
266  // MaxPts
267  // Tpc
268  mHistMaxPtsTpc = new TH1F("Flow_MaxPts_Tpc ", "Flow_MaxPts_Tpc ",
269  nMaxPtsBinsTpc , maxPtsMinTpc , maxPtsMaxTpc );
270  mHistMaxPtsTpc ->SetXTitle("Max Points");
271  mHistMaxPtsTpc ->SetYTitle("Counts");
272 
273  // Ftpc
274  mHistMaxPtsFtpc = new TH1F("Flow_MaxPts_Ftpc", "Flow_MaxPts_Ftpc",
275  nMaxPtsBinsFtpc, maxPtsMinFtpc, maxPtsMaxFtpc);
276  mHistMaxPtsFtpc->SetXTitle("Max Points");
277  mHistMaxPtsFtpc->SetYTitle("Counts");
278 
279 
280  // FitOverMax
281  // Tpc
282  mHistFitOverMaxTpc = new TH1F("Flow_FitOverMax_Tpc", "Flow_FitOverMax_Tpc",
283  nFitOverMaxBins, fitOverMaxMin, fitOverMaxMax);
284  mHistFitOverMaxTpc->SetXTitle("Fit Points / Max Points");
285  mHistFitOverMaxTpc->SetYTitle("Counts");
286 
287  // Ftpc
288  mHistFitOverMaxFtpc = new TH1F("Flow_FitOverMax_Ftpc", "Flow_FitOverMax_Ftpc",
289  nFitOverMaxBins, fitOverMaxMin, fitOverMaxMax);
290  mHistFitOverMaxFtpc->SetXTitle("Fit Points / Max Points");
291  mHistFitOverMaxFtpc->SetYTitle("Counts");
292 
293 
294  // OrigMult
295  mHistOrigMult = new TH1F("Flow_OrigMult", "Flow_OrigMult",
296  nOrigMultBins, origMultMin, origMultMax);
297  mHistOrigMult->SetXTitle("Original Mult");
298  mHistOrigMult->SetYTitle("Counts");
299 
300  // MultEta
301  mHistMultEta = new TH1F("Flow_MultEta", "Flow_MultEta",
302  nMultEtaBins, MultEtaMin, MultEtaMax);
303  mHistMultEta->SetXTitle("Mult for Centrality");
304  mHistMultEta->SetYTitle("Counts");
305 
306  // Mult
307  mHistMult = new TH1F("Flow_Mult", "Flow_Mult",
308  nTotalMultBins, totalMultMin, totalMultMax);
309  mHistMult->SetXTitle("Mult");
310  mHistMult->SetYTitle("Counts");
311 
312  // MultOverOrig
313  mHistMultOverOrig = new TH1F("Flow_MultOverOrig", "Flow_MultOverOrig",
314  nMultOverOrigBins, multOverOrigMin, multOverOrigMax);
315  mHistMultOverOrig->SetXTitle("Mult / Orig. Mult");
316  mHistMultOverOrig->SetYTitle("Counts");
317 
318  // Mult correlated with the event planes
319  mHistMultPart = new TH1F("Flow_MultPart", "Flow_MultPart",
320  nMultPartBins, corrMultMin, corrMultMax);
321  mHistMultPart->SetXTitle("Mult of Correlated Particles");
322  mHistMultPart->SetYTitle("Counts");
323 
324  // VertexZ
325  mHistVertexZ = new TH1F("Flow_VertexZ", "Flow_VertexZ",
326  nVertexZBins, vertexZMin, vertexZMax);
327  mHistVertexZ->SetXTitle("Vertex Z (cm)");
328  mHistVertexZ->SetYTitle("Counts");
329 
330  // VertexXY
331  mHistVertexXY2D = new TH2F("Flow_VertexXY2D", "Flow_VertexXY2D",
332  nVertexXYBins, vertexXYMin, vertexXYMax,
333  nVertexXYBins, vertexXYMin, vertexXYMax);
334  mHistVertexXY2D->SetXTitle("Vertex X (cm)");
335  mHistVertexXY2D->SetYTitle("Vertex Y (cm)");
336 
337  // EtaSym vs. Vertex Z Tpc
338  mHistEtaSymVerZ2DTpc = new TH2F("Flow_EtaSymVerZ2D_Tpc", "Flow_EtaSymVerZ2D_Tpc",
339  nVertexZBins, vertexZMin, vertexZMax, nEtaSymBins, etaSymZMin, etaSymZMax);
340  mHistEtaSymVerZ2DTpc->SetXTitle("Vertex Z (cm)");
341  mHistEtaSymVerZ2DTpc->SetYTitle("Eta Symmetry");
342 
343  // EtaSym vs. Vertex Z Ftpc
344  mHistEtaSymVerZ2DFtpc = new TH2F("Flow_EtaSymVerZ2D_Ftpc", "Flow_EtaSymVerZ2D_Ftpc",
345  nVertexZBins, vertexZMin, vertexZMax, nEtaSymBins, etaSymZMin, etaSymZMax);
346  mHistEtaSymVerZ2DFtpc->SetXTitle("Vertex Z (cm)");
347  mHistEtaSymVerZ2DFtpc->SetYTitle("Eta Symmetry");
348 
349  // EtaSym Tpc
350  mHistEtaSymTpc = new TH1F("Flow_EtaSym_Tpc", "Flow_EtaSym_Tpc",
351  nEtaSymBins, etaSymMin, etaSymMax);
352  mHistEtaSymTpc->SetXTitle("Eta Symmetry Ratio TPC");
353  mHistEtaSymTpc->SetYTitle("Counts");
354 
355  // EtaSym Ftpc
356  mHistEtaSymFtpc = new TH1F("Flow_EtaSym_Ftpc", "Flow_EtaSym_Ftpc",
357  nEtaSymBins, etaSymMin, etaSymMax);
358  mHistEtaSymFtpc->SetXTitle("Eta Symmetry Ratio FTPC");
359  mHistEtaSymFtpc->SetYTitle("Counts");
360 
361  // EtaPtPhi
362  mHistEtaPtPhi3D = new TH3F("Flow_EtaPtPhi3D", "Flow_EtaPtPhi3D",
363  mNEtaBins, mEtaMin, mEtaMax, Flow::nPtBins, Flow::ptMin,
364  Flow::ptMax, nPhi3DBins, phiMin, phiMax);
365  mHistEtaPtPhi3D->SetXTitle("Eta");
366  mHistEtaPtPhi3D->SetYTitle("Pt (GeV/c)");
367  mHistEtaPtPhi3D->SetZTitle("Phi (rad)");
368 
369  // Yield for all particles
370  mHistYieldAll2D = new TH2D("Flow_YieldAll2D", "Flow_YieldAll2D",
371  mNEtaBins, mEtaMin, mEtaMax, Flow::nPtBins, Flow::ptMin,
372  Flow::ptMax);
373  mHistYieldAll2D->Sumw2();
374  mHistYieldAll2D->SetXTitle("Pseudorapidty");
375  mHistYieldAll2D->SetYTitle("Pt (GeV/c)");
376 
377  // Yield for particles correlated with the event plane
378  mHistYieldPart2D = new TH2D("Flow_YieldPart2D", "Flow_YieldPart2D",
379  mNEtaBins, mEtaMin, mEtaMax, nPtBinsPart, Flow::ptMin,
380  ptMaxPart);
381  mHistYieldPart2D->Sumw2();
382  mHistYieldPart2D->SetXTitle((char*)xLabel.Data());
383  mHistYieldPart2D->SetYTitle("Pt (GeV/c)");
384 
385  // Mean Eta in each bin
386  mHistBinEta = new TProfile("Flow_Bin_Eta", "Flow_Bin_Eta",
387  mNEtaBins, mEtaMin, mEtaMax, mEtaMin, mEtaMax, "");
388  mHistBinEta->SetXTitle((char*)xLabel.Data());
389  mHistBinEta->SetYTitle("<Eta>");
390 
391  // Mean Pt in each bin
392  mHistBinPt = new TProfile("Flow_Bin_Pt", "Flow_Bin_Pt",
393  nPtBinsPart, Flow::ptMin, ptMaxPart, Flow::ptMin, ptMaxPart, "");
394  mHistBinPt->SetXTitle("Pt (GeV/c)");
395  mHistBinPt->SetYTitle("<Pt> (GeV/c)");
396 
397  // PID pi+
398  mHistPidPiPlus = new TH1F("Flow_PidPiPlus", "Flow_PidPiPlus",
399  nPidBins, pidMin, pidMax);
400  mHistPidPiPlus->SetXTitle("(PID - Mean) / Resolution");
401  mHistPidPiPlus->SetYTitle("Counts");
402 
403  // PID pi-
404  mHistPidPiMinus = new TH1F("Flow_PidPiMinus", "Flow_PidPiMinus",
405  nPidBins, pidMin, pidMax);
406  mHistPidPiMinus->SetXTitle("(PID - Mean) / Resolution");
407  mHistPidPiMinus->SetYTitle("Counts");
408 
409  // PID proton
410  mHistPidProton = new TH1F("Flow_PidProton", "Flow_PidProton",
411  nPidBins, pidMin, pidMax);
412  mHistPidProton->SetXTitle("(PID - Mean) / Resolution");
413  mHistPidProton->SetYTitle("Counts");
414 
415  // PID anti proton
416  mHistPidAntiProton = new TH1F("Flow_PidAntiProton", "Flow_PidAntiProton",
417  nPidBins, pidMin, pidMax);
418  mHistPidAntiProton->SetXTitle("(PID - Mean) / Resolution");
419  mHistPidAntiProton->SetYTitle("Counts");
420 
421  // PID Kplus
422  mHistPidKplus = new TH1F("Flow_PidKplus", "Flow_PidKplus",
423  nPidBins, pidMin, pidMax);
424  mHistPidKplus->SetXTitle("(PID - Mean) / Resolution");
425  mHistPidKplus->SetYTitle("Counts");
426 
427  // PID Kminus
428  mHistPidKminus = new TH1F("Flow_PidKminus", "Flow_PidKminus",
429  nPidBins, pidMin, pidMax);
430  mHistPidKminus->SetXTitle("(PID - Mean) / Resolution");
431  mHistPidKminus->SetYTitle("Counts");
432 
433  // PID deuteron
434  mHistPidDeuteron = new TH1F("Flow_PidDeuteron", "Flow_PidDeuteron",
435  nPidBins, pidMin, pidMax);
436  mHistPidDeuteron->SetXTitle("(PID - Mean) / Resolution");
437  mHistPidDeuteron->SetYTitle("Counts");
438 
439  // PID anti deuteron
440  mHistPidAntiDeuteron = new TH1F("Flow_PidAntiDeuteron",
441  "Flow_PidAntiDeuteron",
442  nPidBins, pidMin, pidMax);
443  mHistPidAntiDeuteron->SetXTitle("(PID - Mean) / Resolution");
444  mHistPidAntiDeuteron->SetYTitle("Counts");
445 
446  // PID electron
447  mHistPidElectron = new TH1F("Flow_PidElectron", "Flow_PidElectron",
448  nPidBins, pidMin, pidMax);
449  mHistPidElectron->SetXTitle("(PID - Mean) / Resolution");
450  mHistPidElectron->SetYTitle("Counts");
451 
452  // PID positron
453  mHistPidPositron = new TH1F("Flow_PidPositron", "Flow_PidPositron",
454  nPidBins, pidMin, pidMax);
455  mHistPidPositron->SetXTitle("(PID - Mean) / Resolution");
456  mHistPidPositron->SetYTitle("Counts");
457 
458  // PID pi+ selected
459  mHistPidPiPlusPart = new TH1F("Flow_PidPiPlusPart",
460  "Flow_PidPiPlusPart",
461  nPidBins, pidMin, pidMax);
462  mHistPidPiPlusPart->SetXTitle("(PID - Mean) / Resolution");
463  mHistPidPiPlusPart->SetYTitle("Counts");
464 
465  // PID pi- selected
466  mHistPidPiMinusPart = new TH1F("Flow_PidPiMinusPart",
467  "Flow_PidPiMinusPart",
468  nPidBins, pidMin, pidMax);
469  mHistPidPiMinusPart->SetXTitle("(PID - Mean) / Resolution");
470  mHistPidPiMinusPart->SetYTitle("Counts");
471 
472  // PID proton selected
473  mHistPidProtonPart = new TH1F("Flow_PidProtonPart",
474  "Flow_PidProtonPart",
475  nPidBins, pidMin, pidMax);
476  mHistPidProtonPart->SetXTitle("(PID - Mean) / Resolution");
477  mHistPidProtonPart->SetYTitle("Counts");
478 
479  // PID anti proton selected
480  mHistPidAntiProtonPart = new TH1F("Flow_PidAntiProtonPart",
481  "Flow_PidAntiProtonPart",
482  nPidBins, pidMin, pidMax);
483  mHistPidAntiProtonPart->SetXTitle("(PID - Mean) / Resolution");
484  mHistPidAntiProtonPart->SetYTitle("Counts");
485 
486  // PID Kplus selected
487  mHistPidKplusPart = new TH1F("Flow_PidKplusPart",
488  "Flow_PidKplusPart",
489  nPidBins, pidMin, pidMax);
490  mHistPidKplusPart->SetXTitle("(PID - Mean) / Resolution");
491  mHistPidKplusPart->SetYTitle("Counts");
492 
493  // PID Kminus selected
494  mHistPidKminusPart = new TH1F("Flow_PidKminusPart",
495  "Flow_PidKminusPart",
496  nPidBins, pidMin, pidMax);
497  mHistPidKminusPart->SetXTitle("(PID - Mean) / Resolution");
498  mHistPidKminusPart->SetYTitle("Counts");
499 
500  // PID deuteron selected
501  mHistPidDeuteronPart = new TH1F("Flow_PidDeuteronPart",
502  "Flow_PidDeuteronPart",
503  nPidBins, pidMin, pidMax);
504  mHistPidDeuteronPart->SetXTitle("(PID - Mean) / Resolution");
505  mHistPidDeuteronPart->SetYTitle("Counts");
506 
507  // PID anti deuteron selected
508  mHistPidAntiDeuteronPart = new TH1F("Flow_PidAntiDeuteronPart",
509  "Flow_PidAntiDeuteronPart",
510  nPidBins, pidMin, pidMax);
511  mHistPidAntiDeuteronPart->SetXTitle("(PID - Mean) / Resolution");
512  mHistPidAntiDeuteronPart->SetYTitle("Counts");
513 
514  // PID electron selected
515  mHistPidElectronPart = new TH1F("Flow_PidElectronPart",
516  "Flow_PidElectronPart",
517  nPidBins, pidMin, pidMax);
518  mHistPidElectronPart->SetXTitle("(PID - Mean) / Resolution");
519  mHistPidElectronPart->SetYTitle("Counts");
520 
521  // PID positron selected
522  mHistPidPositronPart = new TH1F("Flow_PidPositronPart",
523  "Flow_PidPositronPart",
524  nPidBins, pidMin, pidMax);
525  mHistPidPositronPart->SetXTitle("(PID - Mean) / Resolution");
526  mHistPidPositronPart->SetYTitle("Counts");
527 
528  // PID multiplicities selected
529  mHistPidMult = new TProfile("Flow_PidMult", "Flow_PidMult",
530  13, 0.5, 13.5, 0., 10000., "");
531  mHistPidMult->SetXTitle("all, h+, h-, pi+, pi-, pr+, pr-, K+, K-, d+, d-, e-, e+");
532  mHistPidMult->SetYTitle("Multiplicity");
533 
534  // Centrality
535  mHistCent = new TH1F("Flow_Cent", "Flow_Cent",
536  nCentBins, centMin, centMax);
537  mHistCent->SetXTitle("Centrality Bin");
538  mHistCent->SetYTitle("Counts");
539 
540  // CTB versus ZDC
541  mHistCTBvsZDC2D = new TH2F("Flow_CTBvsZDC2D", "Flow_CTBvsZDC2D",
542  125, 0, 500,
543  125, 0, 40000);
544  mHistCTBvsZDC2D->SetXTitle("ZDC sum");
545  mHistCTBvsZDC2D->SetYTitle("CTB sum");
546 
547  // MeanDedxPos
548  mHistMeanDedxPos2D = new TH2F("Flow_MeanDedxPos2D",
549  "Flow_MeanDedxPos2D",
550  nMomenBins, pMin, pMax,
551  nDedxBins, 0, dEdxMax);
552  mHistMeanDedxPos2D->SetXTitle("log(momentum) (GeV/c)");
553  mHistMeanDedxPos2D->SetYTitle("mean dEdx");
554 
555  // MeanDedxNeg
556  mHistMeanDedxNeg2D = new TH2F("Flow_MeanDedxNeg2D",
557  "Flow_MeanDedxNeg2D",
558  nMomenBins, pMin, pMax,
559  nDedxBins, 0, dEdxMax);
560  mHistMeanDedxNeg2D->SetXTitle("log(momentum) (GeV/c)");
561  mHistMeanDedxNeg2D->SetYTitle("mean dEdx");
562 
563  // MeanDedx PiPlus
564  mHistMeanDedxPiPlus2D = new TH2F("Flow_MeanDedxPiPlus2D",
565  "Flow_MeanDedxPiPlus2D",
566  nMomenBins, pMin, pMax,
567  nDedxBins, 0, dEdxMax);
568  mHistMeanDedxPiPlus2D->SetXTitle("log(momentum) (GeV/c)");
569  mHistMeanDedxPiPlus2D->SetYTitle("mean dEdx");
570 
571  // MeanDedxPiMinus
572  mHistMeanDedxPiMinus2D = new TH2F("Flow_MeanDedxPiMinus2D",
573  "Flow_MeanDedxPiMinus2D",
574  nMomenBins, pMin, pMax,
575  nDedxBins, 0, dEdxMax);
576  mHistMeanDedxPiMinus2D->SetXTitle("log(momentum) (GeV/c)");
577  mHistMeanDedxPiMinus2D->SetYTitle("mean dEdx");
578 
579  // MeanDedxProton
580  mHistMeanDedxProton2D = new TH2F("Flow_MeanDedxProton2D",
581  "Flow_MeanDedxProton2D",
582  nMomenBins, pMin, pMax,
583  nDedxBins, 0, dEdxMax);
584  mHistMeanDedxProton2D->SetXTitle("log(momentum) (GeV/c)");
585  mHistMeanDedxProton2D->SetYTitle("mean dEdx");
586 
587  // MeanDedxPbar
588  mHistMeanDedxPbar2D = new TH2F("Flow_MeanDedxPbar2D",
589  "Flow_MeanDedxPbar2D",
590  nMomenBins, pMin, pMax,
591  nDedxBins, 0, dEdxMax);
592  mHistMeanDedxPbar2D->SetXTitle("log(momentum) (GeV/c)");
593  mHistMeanDedxPbar2D->SetYTitle("mean dEdx");
594 
595  // MeanDedxKplus
596  mHistMeanDedxKplus2D = new TH2F("Flow_MeanDedxKplus2D",
597  "Flow_MeanDedxKplus2D",
598  nMomenBins, pMin, pMax,
599  nDedxBins, 0, dEdxMax);
600  mHistMeanDedxKplus2D->SetXTitle("log(momentum) (GeV/c)");
601  mHistMeanDedxKplus2D->SetYTitle("mean dEdx");
602 
603  // MeanDedxKminus
604  mHistMeanDedxKminus2D = new TH2F("Flow_MeanDedxKminus2D",
605  "Flow_MeanDedxKminus2D",
606  nMomenBins, pMin, pMax,
607  nDedxBins, 0, dEdxMax);
608  mHistMeanDedxKminus2D->SetXTitle("log(momentum) (GeV/c)");
609  mHistMeanDedxKminus2D->SetYTitle("mean dEdx");
610 
611  // MeanDedxDeuteron
612  mHistMeanDedxDeuteron2D = new TH2F("Flow_MeanDedxDeuteron2D",
613  "Flow_MeanDedxDeuteron2D",
614  nMomenBins, pMin, pMax,
615  nDedxBins, 0, dEdxMax);
616  mHistMeanDedxDeuteron2D->SetXTitle("log(momentum) (GeV/c)");
617  mHistMeanDedxDeuteron2D->SetYTitle("mean dEdx");
618 
619  // MeanDedxAntiDeuteron
620  mHistMeanDedxAntiDeuteron2D = new TH2F("Flow_MeanDedxAntiDeuteron2D",
621  "Flow_MeanDedxAntiDeuteron2D",
622  nMomenBins, pMin, pMax,
623  nDedxBins, 0, dEdxMax);
624  mHistMeanDedxAntiDeuteron2D->SetXTitle("log(momentum) (GeV/c)");
625  mHistMeanDedxAntiDeuteron2D->SetYTitle("mean dEdx");
626 
627  // MeanDedxElectron
628  mHistMeanDedxElectron2D = new TH2F("Flow_MeanDedxElectron2D",
629  "Flow_MeanDedxElectron2D",
630  nMomenBins, pMin, pMax,
631  nDedxBins, 0, dEdxMax);
632  mHistMeanDedxElectron2D->SetXTitle("log(momentum) (GeV/c)");
633  mHistMeanDedxElectron2D->SetYTitle("mean dEdx");
634 
635  // MeanDedxPositron
636  mHistMeanDedxPositron2D = new TH2F("Flow_MeanDedxPositron2D",
637  "Flow_MeanDedxPositron2D",
638  nMomenBins, pMin, pMax,
639  nDedxBins, 0, dEdxMax);
640  mHistMeanDedxPositron2D->SetXTitle("log(momentum) (GeV/c)");
641  mHistMeanDedxPositron2D->SetYTitle("mean dEdx");
642 
643  // ZDCSMD test
644  mZDC_SMD_west_vert = new TH1F("Flow_ZDC_SMD_west_vert","Flow_ZDC_SMD_west_vert",7,0.5,7.5);
645  mZDC_SMD_east_vert = new TH1F("Flow_ZDC_SMD_east_vert","Flow_ZDC_SMD_east_vert",7,0.5,7.5);
646  mZDC_SMD_west_hori = new TH1F("Flow_ZDC_SMD_west_hori","Flow_ZDC_SMD_west_hori",8,0.5,8.5);
647  mZDC_SMD_east_hori = new TH1F("Flow_ZDC_SMD_east_hori","Flow_ZDC_SMD_east_hori",8,0.5,8.5);
648  mHistZDCSMDPsiWgtEast = new TH1D("Flow_ZDCSMDPsiWgtEast","Flow_ZDCSMDPsiWgtEast",
649  Flow::zdcsmd_nPsiBins,-twopi/2.,twopi/2.);
650  mHistZDCSMDPsiWgtWest = new TH1D("Flow_ZDCSMDPsiWgtWest","Flow_ZDCSMDPsiWgtWest",
651  Flow::zdcsmd_nPsiBins,-twopi/2.,twopi/2.);
652  mHistZDCSMDPsiWgtTest = new TH1D("Flow_ZDCSMDPsiWgtTest","Flow_ZDCSMDPsiWgtTest",
653  Flow::zdcsmd_nPsiBins,0.,twopi);
654  mHistZDCSMDPsiWgtFull = new TH1D("Flow_ZDCSMDPsiWgtFull","Flow_ZDCSMDPsiWgtFull",
655  Flow::zdcsmd_nPsiBins,0.,twopi);
656  mHistZDCSMDPsiCorTest = new TH1D("Flow_ZDCSMDPsiCorTest","Flow_ZDCSMDPsiCorTest",
657  Flow::zdcsmd_nPsiBins,-twopi/2.,twopi/2.);
658  mHistZDCSMDPsiCorFull = new TH1D("Flow_ZDCSMDPsiCorFull","Flow_ZDCSMDPsiWgtFull",
659  Flow::zdcsmd_nPsiBins,-twopi/2.,twopi/2.);
660  TString* histTitle;
661  for (int i = 0; i < Flow::nSels * Flow::nSubs; i++) {
662 
663  // for sub-events
664  for (int j = 0; j < Flow::nHars; j++) {
665  float order = (float)(j + 1);
666 
667  // event planes
668  histTitle = new TString("Flow_Psi_Subs");
669  *histTitle += i+1;
670  histTitle->Append("_Har");
671  *histTitle += j+1;
672  histSub[i].histSubHar[j].mHistPsiSubs = new TH1F(histTitle->Data(),
673  histTitle->Data(), nPsiBins, psiMin, (psiMax / order));
674  histSub[i].histSubHar[j].mHistPsiSubs->Sumw2();
675  histSub[i].histSubHar[j].mHistPsiSubs->SetXTitle
676  ("Event Plane Angle (rad)");
677  histSub[i].histSubHar[j].mHistPsiSubs->SetYTitle("Counts");
678  delete histTitle;
679  }
680  }
681 
682  for (int k = 0; k < Flow::nSels; k++) {
683 
684  // for each selection
685 
686  // cos(n*delta_Psi)
687  histTitle = new TString("Flow_Cos_Sel");
688  *histTitle += k+1;
689  histFull[k].mHistCos = new TProfile(histTitle->Data(), histTitle->Data(),
690  Flow::nHars, 0.5, (float)(Flow::nHars) + 0.5, -1., 1., "");
691  histFull[k].mHistCos->SetXTitle("Harmonic");
692  histFull[k].mHistCos->SetYTitle("<cos(n*delta_Psi)>");
693  delete histTitle;
694 
695  // resolution
696  histTitle = new TString("Flow_Res_Sel");
697  *histTitle += k+1;
698  histFull[k].mHistRes = new TH1F(histTitle->Data(), histTitle->Data(),
699  Flow::nHars, 0.5, (float)(Flow::nHars) + 0.5);
700  histFull[k].mHistRes->SetXTitle("Harmonic");
701  histFull[k].mHistRes->SetYTitle("Resolution");
702  delete histTitle;
703 
704  // vObs
705  histTitle = new TString("Flow_vObs_Sel");
706  *histTitle += k+1;
707  histFull[k].mHist_vObs = new TProfile(histTitle->Data(), histTitle->Data(),
708  Flow::nHars, 0.5, (float)(Flow::nHars) + 0.5, -1000., 1000., "");
709  histFull[k].mHist_vObs->SetXTitle("Harmonic");
710  histFull[k].mHist_vObs->SetYTitle("vObs (%)");
711  delete histTitle;
712 
713  // for each harmonic
714  for (int j = 0; j < Flow::nHars; j++) {
715  float order = (float)(j+1);
716 
717  // multiplicity
718  histTitle = new TString("Flow_Mul_Sel");
719  *histTitle += k+1;
720  histTitle->Append("_Har");
721  *histTitle += j+1;
722  histFull[k].histFullHar[j].mHistMult = new TH1F(histTitle->Data(),
723  histTitle->Data(), nMultBins, multMin, multMax);
724  histFull[k].histFullHar[j].mHistMult->SetXTitle("Multiplicity");
725  histFull[k].histFullHar[j].mHistMult->SetYTitle("Counts");
726  delete histTitle;
727 
728  // event plane
729  histTitle = new TString("Flow_Psi_Sel");
730  *histTitle += k+1;
731  histTitle->Append("_Har");
732  *histTitle += j+1;
733  histFull[k].histFullHar[j].mHistPsi = new TH1F(histTitle->Data(),
734  histTitle->Data(), nPsiBins, psiMin, psiMax / order);
735  histFull[k].histFullHar[j].mHistPsi->Sumw2();
736  histFull[k].histFullHar[j].mHistPsi->SetXTitle
737  ("Event Plane Angle (rad)");
738  histFull[k].histFullHar[j].mHistPsi->SetYTitle("Counts");
739  delete histTitle;
740 
741  // phi lab
742  histTitle = new TString("Flow_PhiLab_Sel");
743  *histTitle += k+1;
744  histTitle->Append("_Har");
745  *histTitle += j+1;
746  histFull[k].histFullHar[j].mHistPhiLab = new TH1F(histTitle->Data(),
747  histTitle->Data(), Flow::nPhiBins, phiMin, phiMax);
748  histFull[k].histFullHar[j].mHistPhiLab->SetXTitle("Particle Lab Angle (rad)");
749  histFull[k].histFullHar[j].mHistPhiLab->SetYTitle("Counts");
750  histFull[k].histFullHar[j].mHistPhiLab->Sumw2(); // for scale
751  delete histTitle;
752 
753  // Recenter
754  histTitle = new TString("FlowReCentX_Sel");
755  *histTitle += k+1;
756  *histTitle += "_Har";
757  *histTitle += j+1;
758  histFull[k].histFullHar[j].mHistReCentX = new TProfile(histTitle->Data(),
759  histTitle->Data(), 3, 0.5, 3.5);
760  histFull[k].histFullHar[j].mHistReCentX->SetXTitle("FTPCE, FTPCW, TPCE, TPCW");
761  histFull[k].histFullHar[j].mHistReCentX->SetYTitle("<cos n #phi>");
762  delete histTitle;
763 
764  histTitle = new TString("FlowReCentY_Sel");
765  *histTitle += k+1;
766  *histTitle += "_Har";
767  *histTitle += j+1;
768  histFull[k].histFullHar[j].mHistReCentY = new TProfile(histTitle->Data(),
769  histTitle->Data(), 3, 0.5, 3.5);
770  histFull[k].histFullHar[j].mHistReCentY->SetXTitle("FTPCE, FTPCW, TPCE, TPCW");
771  histFull[k].histFullHar[j].mHistReCentY->SetYTitle("<sin n #phi>");
772  delete histTitle;
773 
774  // Recentered, for printing, not plotting
775  histTitle = new TString("FlowQreCent_Sel");
776  *histTitle += k+1;
777  *histTitle += "_Har";
778  *histTitle += j+1;
779  histFull[k].histFullHar[j].mHistQreCent = new TProfile(histTitle->Data(),
780  histTitle->Data(), 2, 0.5, 2.5);
781  histFull[k].histFullHar[j].mHistQreCent->SetXTitle("X, Y");
782  histFull[k].histFullHar[j].mHistQreCent->SetYTitle("<Q_{n}/M>");
783 
784  // QXY
785  histTitle = new TString("Flow_QXY2D_Sel");
786  *histTitle += k+1;
787  histTitle->Append("_Har");
788  *histTitle += j+1;
789  histFull[k].histFullHar[j].mHistQXY2D = new TH2D(histTitle->Data(), histTitle->Data(),
790  nQXYBins, QXYMin, QXYMax, nQXYBins, QXYMin, QXYMax);
791  histFull[k].histFullHar[j].mHistQXY2D->SetXTitle("Q_X/M");
792  histFull[k].histFullHar[j].mHistQXY2D->SetYTitle("Q_Y/M");
793  delete histTitle;
794 
795  // QSubXY for k=0 subevents
796  histTitle = new TString("Flow_QFTPCSubXY2D_Sel");
797  *histTitle += k+1;
798  histTitle->Append("_Har");
799  *histTitle += j+1;
800  histFull[k].histFullHar[j].mHistQFTPCSubXY2D = new TH2D(histTitle->Data(), histTitle->Data(),
801  nQXYBins, QXYMin*2., QXYMax*2., nQXYBins, QXYMin*2., QXYMax*2.);
802  histFull[k].histFullHar[j].mHistQFTPCSubXY2D->SetXTitle("QSub_X/M");
803  histFull[k].histFullHar[j].mHistQFTPCSubXY2D->SetYTitle("QSub_Y/M");
804  delete histTitle;
805 
806  // QSubXY for k=1 subevents
807  histTitle = new TString("Flow_QTPCSubXY2D_Sel");
808  *histTitle += k+1;
809  histTitle->Append("_Har");
810  *histTitle += j+1;
811  histFull[k].histFullHar[j].mHistQTPCSubXY2D = new TH2D(histTitle->Data(), histTitle->Data(),
812  nQXYBins, QXYMin*2., QXYMax*2., nQXYBins, QXYMin*2., QXYMax*2.);
813  histFull[k].histFullHar[j].mHistQTPCSubXY2D->SetXTitle("QSub_X/M");
814  histFull[k].histFullHar[j].mHistQTPCSubXY2D->SetYTitle("QSub_Y/M");
815  delete histTitle;
816 
817  // event plane difference of two selections
818  histTitle = new TString("Flow_Psi_Diff_Sel");
819  *histTitle += k+1;
820  histTitle->Append("_Har");
821  *histTitle += j+1;
822 
823  if (k == 0 ) {
824  Int_t my_order = 1;
825  if (j == 1) {
826  my_order = 2;
827  }
828  histFull[k].histFullHar[j].mHistPsi_Diff = new TH1F(histTitle->Data(),
829  histTitle->Data(), nPsiBins, -psiMax/my_order/2., psiMax/my_order/2.);
830  } else {
831  histFull[k].histFullHar[j].mHistPsi_Diff = new TH1F(histTitle->Data(),
832  histTitle->Data(), nPsiBins, -psiMax/2., psiMax/2.);
833  }
834 
835  if (k == 0) {
836  if (j == 0) {
837  histFull[k].histFullHar[j].mHistPsi_Diff->SetXTitle
838  ("#Psi_{1,Sel1} - #Psi_{1,Sel2}(rad)");
839  } else if (j == 1) {
840  histFull[k].histFullHar[j].mHistPsi_Diff->SetXTitle
841  ("#Psi_{2,Sel1} - #Psi_{2,Sel2}(rad)");
842  }
843  } else if (k == 1) {
844  if (j == 0) {
845  histFull[k].histFullHar[j].mHistPsi_Diff->SetXTitle
846  ("#Psi_{1,Sel1} - #Psi_{2,Sel2}(rad)");
847  } else if (j == 1) {
848  histFull[k].histFullHar[j].mHistPsi_Diff->SetXTitle
849  ("#Psi_{1,Sel1} - #Psi_{2,Sel1}(rad)");
850  }
851  }
852 
853  histFull[k].histFullHar[j].mHistPsi_Diff->SetYTitle("Counts");
854  delete histTitle;
855 
856  // correlation of sub-event planes
857  histTitle = new TString("Flow_Psi_Sub_Corr_Sel");
858  *histTitle += k+1;
859  histTitle->Append("_Har");
860  *histTitle += j+1;
861  histFull[k].histFullHar[j].mHistPsiSubCorr = new TH1F(histTitle->Data(),
862  histTitle->Data(), nPsiBins, psiMin, psiMax / order);
863  histFull[k].histFullHar[j].mHistPsiSubCorr->Sumw2();
864  histFull[k].histFullHar[j].mHistPsiSubCorr->SetXTitle
865  ("Sub-Event Correlation (rad)");
866  histFull[k].histFullHar[j].mHistPsiSubCorr->SetYTitle("Counts");
867  delete histTitle;
868 
869  // correlation of sub-event planes of different order
870  histTitle = new TString("Flow_Psi_Sub_Corr_Diff_Sel");
871  *histTitle += k+1;
872  histTitle->Append("_Har");
873  *histTitle += j+1;
874  histFull[k].histFullHar[j].mHistPsiSubCorrDiff = new
875  TH1F(histTitle->Data(), histTitle->Data(), nPsiBins, psiMin,
876  psiMax / (order+1.));
877  histFull[k].histFullHar[j].mHistPsiSubCorrDiff->Sumw2();
878  histFull[k].histFullHar[j].mHistPsiSubCorrDiff->SetXTitle
879  ("Sub-Event Correlation (rad)");
880  histFull[k].histFullHar[j].mHistPsiSubCorrDiff->SetYTitle("Counts");
881  delete histTitle;
882 
883  // q
884  histTitle = new TString("Flow_q_Sel");
885  *histTitle += k+1;
886  histTitle->Append("_Har");
887  *histTitle += j+1;
888  histFull[k].histFullHar[j].mHist_q = new TH1F(histTitle->Data(),
889  histTitle->Data(), n_qBins, qMin, qMax);
890  histFull[k].histFullHar[j].mHist_q->Sumw2();
891  histFull[k].histFullHar[j].mHist_q->SetXTitle("q = |Q|/sqrt(Mult)");
892  histFull[k].histFullHar[j].mHist_q->SetYTitle("Counts");
893  delete histTitle;
894 
895  // particle-plane azimuthal correlation
896  histTitle = new TString("Flow_Phi_Corr_Sel");
897  *histTitle += k+1;
898  histTitle->Append("_Har");
899  *histTitle += j+1;
900  histFull[k].histFullHar[j].mHistPhiCorr = new TH1F(histTitle->Data(),
901  histTitle->Data(), Flow::nPhiBins, phiMin, phiMax / order);
902  histFull[k].histFullHar[j].mHistPhiCorr->Sumw2();
903  histFull[k].histFullHar[j].mHistPhiCorr->
904  SetXTitle("Particle-Plane Correlation (rad)");
905  histFull[k].histFullHar[j].mHistPhiCorr->SetYTitle("Counts");
906  delete histTitle;
907 
908  // Yield(eta,pt)
909  histTitle = new TString("Flow_Yield2D_Sel");
910  *histTitle += k+1;
911  histTitle->Append("_Har");
912  *histTitle += j+1;
913  histFull[k].histFullHar[j].mHistYield2D = new TH2D(histTitle->Data(),
914  histTitle->Data(), mNEtaBins, mEtaMin, mEtaMax,
915  Flow::nPtBins, Flow::ptMin, Flow::ptMax);
916  histFull[k].histFullHar[j].mHistYield2D->Sumw2();
917  histFull[k].histFullHar[j].mHistYield2D->SetXTitle("Pseudorapidty");
918  histFull[k].histFullHar[j].mHistYield2D->SetYTitle("Pt (GeV/c)");
919  delete histTitle;
920 
921  // Flow observed
922  histTitle = new TString("Flow_vObs2D_Sel");
923  *histTitle += k+1;
924  histTitle->Append("_Har");
925  *histTitle += j+1;
926  histFull[k].histFullHar[j].mHist_vObs2D = new TProfile2D(histTitle->Data(),
927  histTitle->Data(), mNEtaBins, mEtaMin, mEtaMax, nPtBinsPart,
928  Flow::ptMin, ptMaxPart, -1000., 1000., "");
929  histFull[k].histFullHar[j].mHist_vObs2D->SetXTitle((char*)xLabel.Data());
930  histFull[k].histFullHar[j].mHist_vObs2D->SetYTitle("Pt (GeV/c)");
931  delete histTitle;
932 
933  // Flow observed profiles
934  histTitle = new TString("Flow_vObsEta_Sel");
935  *histTitle += k+1;
936  histTitle->Append("_Har");
937  *histTitle += j+1;
938  histFull[k].histFullHar[j].mHist_vObsEta = new TProfile(histTitle->Data(),
939  histTitle->Data(), mNEtaBins, mEtaMin, mEtaMax, -1000., 1000., "");
940  histFull[k].histFullHar[j].mHist_vObsEta->SetXTitle((char*)xLabel.Data());
941  histFull[k].histFullHar[j].mHist_vObsEta->SetYTitle("v (%)");
942  delete histTitle;
943 
944  histTitle = new TString("Flow_vObsPt_Sel");
945  *histTitle += k+1;
946  histTitle->Append("_Har");
947  *histTitle += j+1;
948  histFull[k].histFullHar[j].mHist_vObsPt = new TProfile(histTitle->Data(),
949  histTitle->Data(), nPtBinsPart, Flow::ptMin, ptMaxPart, -1000., 1000., "");
950  histFull[k].histFullHar[j].mHist_vObsPt->SetXTitle("Pt (GeV/c)");
951  histFull[k].histFullHar[j].mHist_vObsPt->SetYTitle("v (%)");
952  delete histTitle;
953  }
954 
955  // for two harmonics
956  for (int j = 0; j < 2; j++) {
957 
958  // Phi lab
959  // Tpc (FarEast)
960  histTitle = new TString("Flow_Phi_FarEast_Sel");
961  *histTitle += k+1;
962  histTitle->Append("_Har");
963  *histTitle += j+1;
964  histFull[k].histTwoHar[j].mHistPhiFarEast = new TH1D(histTitle->Data(),
965  histTitle->Data(), Flow::nPhiBins, phiMin, phiMax);
966  histFull[k].histTwoHar[j].mHistPhiFarEast->SetXTitle
967  ("Azimuthal Angles (rad)");
968  histFull[k].histTwoHar[j].mHistPhiFarEast->SetYTitle("Counts");
969  delete histTitle;
970 
971  // Tpc (East)
972  histTitle = new TString("Flow_Phi_East_Sel");
973  *histTitle += k+1;
974  histTitle->Append("_Har");
975  *histTitle += j+1;
976  histFull[k].histTwoHar[j].mHistPhiEast = new TH1D(histTitle->Data(),
977  histTitle->Data(), Flow::nPhiBins, phiMin, phiMax);
978  histFull[k].histTwoHar[j].mHistPhiEast->SetXTitle
979  ("Azimuthal Angles (rad)");
980  histFull[k].histTwoHar[j].mHistPhiEast->SetYTitle("Counts");
981  delete histTitle;
982 
983  // Tpc (West)
984  histTitle = new TString("Flow_Phi_West_Sel");
985  *histTitle += k+1;
986  histTitle->Append("_Har");
987  *histTitle += j+1;
988  histFull[k].histTwoHar[j].mHistPhiWest = new TH1D(histTitle->Data(),
989  histTitle->Data(), Flow::nPhiBins, phiMin, phiMax);
990  histFull[k].histTwoHar[j].mHistPhiWest->SetXTitle
991  ("Azimuthal Angles (rad)");
992  histFull[k].histTwoHar[j].mHistPhiWest->SetYTitle("Counts");
993  delete histTitle;
994 
995  // Tpc (FarWest)
996  histTitle = new TString("Flow_Phi_FarWest_Sel");
997  *histTitle += k+1;
998  histTitle->Append("_Har");
999  *histTitle += j+1;
1000  histFull[k].histTwoHar[j].mHistPhiFarWest = new TH1D(histTitle->Data(),
1001  histTitle->Data(), Flow::nPhiBins, phiMin, phiMax);
1002  histFull[k].histTwoHar[j].mHistPhiFarWest->SetXTitle
1003  ("Azimuthal Angles (rad)");
1004  histFull[k].histTwoHar[j].mHistPhiFarWest->SetYTitle("Counts");
1005  delete histTitle;
1006 
1007  // Ftpc (FarEast)
1008  histTitle = new TString("Flow_Phi_FtpcFarEast_Sel");
1009  *histTitle += k+1;
1010  histTitle->Append("_Har");
1011  *histTitle += j+1;
1012  histFull[k].histTwoHar[j].mHistPhiFtpcFarEast = new TH1D(histTitle->Data(),
1013  histTitle->Data(), Flow::nPhiBinsFtpc, phiMin, phiMax);
1014  histFull[k].histTwoHar[j].mHistPhiFtpcFarEast->SetXTitle
1015  ("Azimuthal Angles (rad)");
1016  histFull[k].histTwoHar[j].mHistPhiFtpcFarEast->SetYTitle("Counts");
1017  delete histTitle;
1018 
1019  // Ftpc (East)
1020  histTitle = new TString("Flow_Phi_FtpcEast_Sel");
1021  *histTitle += k+1;
1022  histTitle->Append("_Har");
1023  *histTitle += j+1;
1024  histFull[k].histTwoHar[j].mHistPhiFtpcEast = new TH1D(histTitle->Data(),
1025  histTitle->Data(), Flow::nPhiBinsFtpc, phiMin, phiMax);
1026  histFull[k].histTwoHar[j].mHistPhiFtpcEast->SetXTitle
1027  ("Azimuthal Angles (rad)");
1028  histFull[k].histTwoHar[j].mHistPhiFtpcEast->SetYTitle("Counts");
1029  delete histTitle;
1030 
1031  // Ftpc (West)
1032  histTitle = new TString("Flow_Phi_FtpcWest_Sel");
1033  *histTitle += k+1;
1034  histTitle->Append("_Har");
1035  *histTitle += j+1;
1036  histFull[k].histTwoHar[j].mHistPhiFtpcWest = new TH1D(histTitle->Data(),
1037  histTitle->Data(), Flow::nPhiBinsFtpc, phiMin, phiMax);
1038  histFull[k].histTwoHar[j].mHistPhiFtpcWest->SetXTitle
1039  ("Azimuthal Angles (rad)");
1040  histFull[k].histTwoHar[j].mHistPhiFtpcWest->SetYTitle("Counts");
1041  delete histTitle;
1042 
1043  // Ftpc (FarWest)
1044  histTitle = new TString("Flow_Phi_FtpcFarWest_Sel");
1045  *histTitle += k+1;
1046  histTitle->Append("_Har");
1047  *histTitle += j+1;
1048  histFull[k].histTwoHar[j].mHistPhiFtpcFarWest = new TH1D(histTitle->Data(),
1049  histTitle->Data(), Flow::nPhiBinsFtpc, phiMin, phiMax);
1050  histFull[k].histTwoHar[j].mHistPhiFtpcFarWest->SetXTitle
1051  ("Azimuthal Angles (rad)");
1052  histFull[k].histTwoHar[j].mHistPhiFtpcFarWest->SetYTitle("Counts");
1053  delete histTitle;
1054 
1055  // PhiWgt
1056  // Tpc (FarEast)
1057  histTitle = new TString("Flow_Phi_Weight_FarEast_Sel");
1058  *histTitle += k+1;
1059  histTitle->Append("_Har");
1060  *histTitle += j+1;
1061  histFull[k].histTwoHar[j].mHistPhiWgtFarEast = new TH1D(histTitle->Data(),
1062  histTitle->Data(), Flow::nPhiBins, phiMin, phiMax);
1063  histFull[k].histTwoHar[j].mHistPhiWgtFarEast->Sumw2();
1064  histFull[k].histTwoHar[j].mHistPhiWgtFarEast->SetXTitle
1065  ("Azimuthal Angles (rad)");
1066  histFull[k].histTwoHar[j].mHistPhiWgtFarEast->SetYTitle("PhiWgt");
1067  delete histTitle;
1068 
1069  // Tpc (East)
1070  histTitle = new TString("Flow_Phi_Weight_East_Sel");
1071  *histTitle += k+1;
1072  histTitle->Append("_Har");
1073  *histTitle += j+1;
1074  histFull[k].histTwoHar[j].mHistPhiWgtEast = new TH1D(histTitle->Data(),
1075  histTitle->Data(), Flow::nPhiBins, phiMin, phiMax);
1076  histFull[k].histTwoHar[j].mHistPhiWgtEast->Sumw2();
1077  histFull[k].histTwoHar[j].mHistPhiWgtEast->SetXTitle
1078  ("Azimuthal Angles (rad)");
1079  histFull[k].histTwoHar[j].mHistPhiWgtEast->SetYTitle("PhiWgt");
1080  delete histTitle;
1081 
1082  // Tpc (West)
1083  histTitle = new TString("Flow_Phi_Weight_West_Sel");
1084  *histTitle += k+1;
1085  histTitle->Append("_Har");
1086  *histTitle += j+1;
1087  histFull[k].histTwoHar[j].mHistPhiWgtWest = new TH1D(histTitle->Data(),
1088  histTitle->Data(), Flow::nPhiBins, phiMin, phiMax);
1089  histFull[k].histTwoHar[j].mHistPhiWgtWest->Sumw2();
1090  histFull[k].histTwoHar[j].mHistPhiWgtWest->SetXTitle
1091  ("Azimuthal Angles (rad)");
1092  histFull[k].histTwoHar[j].mHistPhiWgtWest->SetYTitle("PhiWgt");
1093  delete histTitle;
1094 
1095  // Tpc (FarWest)
1096  histTitle = new TString("Flow_Phi_Weight_FarWest_Sel");
1097  *histTitle += k+1;
1098  histTitle->Append("_Har");
1099  *histTitle += j+1;
1100  histFull[k].histTwoHar[j].mHistPhiWgtFarWest = new TH1D(histTitle->Data(),
1101  histTitle->Data(), Flow::nPhiBins, phiMin, phiMax);
1102  histFull[k].histTwoHar[j].mHistPhiWgtFarWest->Sumw2();
1103  histFull[k].histTwoHar[j].mHistPhiWgtFarWest->SetXTitle
1104  ("Azimuthal Angles (rad)");
1105  histFull[k].histTwoHar[j].mHistPhiWgtFarWest->SetYTitle("PhiWgt");
1106  delete histTitle;
1107 
1108  // Ftpc (FarEast)
1109  histTitle = new TString("Flow_Phi_Weight_FtpcFarEast_Sel");
1110  *histTitle += k+1;
1111  histTitle->Append("_Har");
1112  *histTitle += j+1;
1113  histFull[k].histTwoHar[j].mHistPhiWgtFtpcFarEast = new TH1D(histTitle->Data(),
1114  histTitle->Data(), Flow::nPhiBinsFtpc, phiMin, phiMax);
1115  histFull[k].histTwoHar[j].mHistPhiWgtFtpcFarEast->Sumw2();
1116  histFull[k].histTwoHar[j].mHistPhiWgtFtpcFarEast->SetXTitle
1117  ("Azimuthal Angles (rad)");
1118  histFull[k].histTwoHar[j].mHistPhiWgtFtpcFarEast->SetYTitle("PhiWgt");
1119  delete histTitle;
1120 
1121  // Ftpc (East)
1122  histTitle = new TString("Flow_Phi_Weight_FtpcEast_Sel");
1123  *histTitle += k+1;
1124  histTitle->Append("_Har");
1125  *histTitle += j+1;
1126  histFull[k].histTwoHar[j].mHistPhiWgtFtpcEast = new TH1D(histTitle->Data(),
1127  histTitle->Data(), Flow::nPhiBinsFtpc, phiMin, phiMax);
1128  histFull[k].histTwoHar[j].mHistPhiWgtFtpcEast->Sumw2();
1129  histFull[k].histTwoHar[j].mHistPhiWgtFtpcEast->SetXTitle
1130  ("Azimuthal Angles (rad)");
1131  histFull[k].histTwoHar[j].mHistPhiWgtFtpcEast->SetYTitle("PhiWgt");
1132  delete histTitle;
1133 
1134  // Ftpc (West)
1135  histTitle = new TString("Flow_Phi_Weight_FtpcWest_Sel");
1136  *histTitle += k+1;
1137  histTitle->Append("_Har");
1138  *histTitle += j+1;
1139  histFull[k].histTwoHar[j].mHistPhiWgtFtpcWest = new TH1D(histTitle->Data(),
1140  histTitle->Data(), Flow::nPhiBinsFtpc, phiMin, phiMax);
1141  histFull[k].histTwoHar[j].mHistPhiWgtFtpcWest->Sumw2();
1142  histFull[k].histTwoHar[j].mHistPhiWgtFtpcWest->SetXTitle
1143  ("Azimuthal Angles (rad)");
1144  histFull[k].histTwoHar[j].mHistPhiWgtFtpcWest->SetYTitle("PhiWgt");
1145  delete histTitle;
1146 
1147  // Ftpc (FarWest)
1148  histTitle = new TString("Flow_Phi_Weight_FtpcFarWest_Sel");
1149  *histTitle += k+1;
1150  histTitle->Append("_Har");
1151  *histTitle += j+1;
1152  histFull[k].histTwoHar[j].mHistPhiWgtFtpcFarWest = new TH1D(histTitle->Data(),
1153  histTitle->Data(), Flow::nPhiBinsFtpc, phiMin, phiMax);
1154  histFull[k].histTwoHar[j].mHistPhiWgtFtpcFarWest->Sumw2();
1155  histFull[k].histTwoHar[j].mHistPhiWgtFtpcFarWest->SetXTitle
1156  ("Azimuthal Angles (rad)");
1157  histFull[k].histTwoHar[j].mHistPhiWgtFtpcFarWest->SetYTitle("PhiWgt");
1158  delete histTitle;
1159 
1160 
1161  // Phi lab flattened
1162  // Tpc (FarEast)
1163  histTitle = new TString("Flow_Phi_Flat_FarEast_Sel");
1164  *histTitle += k+1;
1165  histTitle->Append("_Har");
1166  *histTitle += j+1;
1167  histFull[k].histTwoHar[j].mHistPhiFlatFarEast = new TH1D(histTitle->Data(),
1168  histTitle->Data(), Flow::nPhiBins, phiMin, phiMax);
1169  histFull[k].histTwoHar[j].mHistPhiFlatFarEast->SetXTitle
1170  ("Azimuthal Angles (rad)");
1171  histFull[k].histTwoHar[j].mHistPhiFlatFarEast->SetYTitle("Counts");
1172  delete histTitle;
1173 
1174  // Tpc (East)
1175  histTitle = new TString("Flow_Phi_Flat_East_Sel");
1176  *histTitle += k+1;
1177  histTitle->Append("_Har");
1178  *histTitle += j+1;
1179  histFull[k].histTwoHar[j].mHistPhiFlatEast = new TH1D(histTitle->Data(),
1180  histTitle->Data(), Flow::nPhiBins, phiMin, phiMax);
1181  histFull[k].histTwoHar[j].mHistPhiFlatEast->SetXTitle
1182  ("Azimuthal Angles (rad)");
1183  histFull[k].histTwoHar[j].mHistPhiFlatEast->SetYTitle("Counts");
1184  delete histTitle;
1185 
1186  // Tpc (West)
1187  histTitle = new TString("Flow_Phi_Flat_West_Sel");
1188  *histTitle += k+1;
1189  histTitle->Append("_Har");
1190  *histTitle += j+1;
1191  histFull[k].histTwoHar[j].mHistPhiFlatWest = new TH1D(histTitle->Data(),
1192  histTitle->Data(), Flow::nPhiBins, phiMin, phiMax);
1193  histFull[k].histTwoHar[j].mHistPhiFlatWest->SetXTitle
1194  ("Azimuthal Angles (rad)");
1195  histFull[k].histTwoHar[j].mHistPhiFlatWest->SetYTitle("Counts");
1196  delete histTitle;
1197 
1198  // Tpc (FarWest)
1199  histTitle = new TString("Flow_Phi_Flat_FarWest_Sel");
1200  *histTitle += k+1;
1201  histTitle->Append("_Har");
1202  *histTitle += j+1;
1203  histFull[k].histTwoHar[j].mHistPhiFlatFarWest = new TH1D(histTitle->Data(),
1204  histTitle->Data(), Flow::nPhiBins, phiMin, phiMax);
1205  histFull[k].histTwoHar[j].mHistPhiFlatFarWest->SetXTitle
1206  ("Azimuthal Angles (rad)");
1207  histFull[k].histTwoHar[j].mHistPhiFlatFarWest->SetYTitle("Counts");
1208  delete histTitle;
1209 
1210  // Ftpc (FarEast)
1211  histTitle = new TString("Flow_Phi_Flat_FtpcFarEast_Sel");
1212  *histTitle += k+1;
1213  histTitle->Append("_Har");
1214  *histTitle += j+1;
1215  histFull[k].histTwoHar[j].mHistPhiFlatFtpcFarEast = new TH1D(histTitle->Data(),
1216  histTitle->Data(), Flow::nPhiBinsFtpc, phiMin, phiMax);
1217  histFull[k].histTwoHar[j].mHistPhiFlatFtpcFarEast->SetXTitle
1218  ("Azimuthal Angles (rad)");
1219  histFull[k].histTwoHar[j].mHistPhiFlatFtpcFarEast->SetYTitle("Counts");
1220  delete histTitle;
1221 
1222  // Ftpc (East)
1223  histTitle = new TString("Flow_Phi_Flat_FtpcEast_Sel");
1224  *histTitle += k+1;
1225  histTitle->Append("_Har");
1226  *histTitle += j+1;
1227  histFull[k].histTwoHar[j].mHistPhiFlatFtpcEast = new TH1D(histTitle->Data(),
1228  histTitle->Data(), Flow::nPhiBinsFtpc, phiMin, phiMax);
1229  histFull[k].histTwoHar[j].mHistPhiFlatFtpcEast->SetXTitle
1230  ("Azimuthal Angles (rad)");
1231  histFull[k].histTwoHar[j].mHistPhiFlatFtpcEast->SetYTitle("Counts");
1232  delete histTitle;
1233 
1234  // Ftpc (West)
1235  histTitle = new TString("Flow_Phi_Flat_FtpcWest_Sel");
1236  *histTitle += k+1;
1237  histTitle->Append("_Har");
1238  *histTitle += j+1;
1239  histFull[k].histTwoHar[j].mHistPhiFlatFtpcWest = new TH1D(histTitle->Data(),
1240  histTitle->Data(), Flow::nPhiBinsFtpc, phiMin, phiMax);
1241  histFull[k].histTwoHar[j].mHistPhiFlatFtpcWest->SetXTitle
1242  ("Azimuthal Angles (rad)");
1243  histFull[k].histTwoHar[j].mHistPhiFlatFtpcWest->SetYTitle("Counts");
1244  delete histTitle;
1245 
1246  // Ftpc (FarWest)
1247  histTitle = new TString("Flow_Phi_Flat_FtpcFarWest_Sel");
1248  *histTitle += k+1;
1249  histTitle->Append("_Har");
1250  *histTitle += j+1;
1251  histFull[k].histTwoHar[j].mHistPhiFlatFtpcFarWest = new TH1D(histTitle->Data(),
1252  histTitle->Data(), Flow::nPhiBinsFtpc, phiMin, phiMax);
1253  histFull[k].histTwoHar[j].mHistPhiFlatFtpcFarWest->SetXTitle
1254  ("Azimuthal Angles (rad)");
1255  histFull[k].histTwoHar[j].mHistPhiFlatFtpcFarWest->SetYTitle("Counts");
1256  delete histTitle;
1257 
1258  }
1259  }
1260 
1261  // Calculate recenter paramerters?
1262  TFile fileReCent("flow.reCentAna.root","R");
1263  if (reCentCalc) {
1264  gMessMgr->Info("##### FlowAnalysis: Calc reCent Pars");
1265  mCalcReCentPars = kTRUE;
1266  } else {
1267  mCalcReCentPars = kFALSE;
1268  }
1269 
1270  gMessMgr->SetLimit("##### FlowAnalysis", 2);
1271  gMessMgr->Info("##### FlowAnalysis: $Id: StFlowAnalysisMaker.cxx,v 1.103 2011/07/25 15:54:42 posk Exp $");
1272 
1273  return StMaker::Init();
1274 }
1275 
1276 //-----------------------------------------------------------------------
1277 
1278 Bool_t StFlowAnalysisMaker::FillFromFlowEvent() {
1279  // Get event quantities from StFlowEvent
1280 
1281  Bool_t kRETURN;
1282 
1283  for (int k = 0; k < Flow::nSels; k++) {
1284  pFlowSelect->SetSelection(k);
1285  for (int j = 0; j < Flow::nHars; j++) {
1286  pFlowSelect->SetHarmonic(j);
1287  for (int n = 0; n < Flow::nSubs; n++) {
1288  pFlowSelect->SetSubevent(n);
1289  int i = Flow::nSels*k + n;
1290  // sub-event quantities already recentered
1291  mQSub[i][j] = pFlowEvent->Q(pFlowSelect);
1292  mPsiSub[i][j] = pFlowEvent->Psi(pFlowSelect);
1293  mMultSub[i][j] = pFlowEvent->Mult(pFlowSelect);
1294  if (mMultSub[i][j] < 3.) kRETURN = kFALSE; // to eliminate multSub < 3
1295  if (mQSub[i][j].Mod()==0.) kRETURN = kFALSE; // to eliminate psiSub=0
1296  }//subs
1297 
1298  pFlowSelect->SetSubevent(-1);
1299  // full event quantities already recentered
1300  mQ[k][j] = pFlowEvent->Q(pFlowSelect);
1301  mPsi[k][j] = pFlowEvent->Psi(pFlowSelect);
1302  m_q[k][j] = pFlowEvent->q(pFlowSelect);
1303  mMult[k][j] = pFlowEvent->Mult(pFlowSelect);
1304  if (mQ[k][j].Mod()==0.) kRETURN = kFALSE; // to eliminate psi=0
1305  }//full
1306  }
1307  mZDCSMD_e_PsiWgt = pFlowEvent->ZDCSMD_PsiWgtEast();
1308  mZDCSMD_w_PsiWgt = pFlowEvent->ZDCSMD_PsiWgtWest();
1309  mZDCSMD_f_PsiWgt = (pFlowEvent->UseZDCSMD()) ? pFlowEvent->ZDCSMD_PsiWgtFull():1.;
1310  mFlowWeight = (pFlowEvent->UseZDCSMD()) ? mZDCSMD_e_PsiWgt*mZDCSMD_w_PsiWgt*mZDCSMD_f_PsiWgt:1.;
1311 
1312  return kRETURN;
1313 }
1314 
1315 //-----------------------------------------------------------------------
1316 
1317 void StFlowAnalysisMaker::FillEventHistograms() {
1318  // Fill histograms with event quantities
1319 
1320  // trigger
1321  unsigned int triggers = StFlowCutEvent::TriggersFound();
1322  mHistTrigger->Fill(triggers);
1323 
1324  // no selections: OrigMult, MultEta, Centrality, TotalMult, PartMult, MultOverOrig, VertexZ, VertexXY
1325  int origMult = pFlowEvent->OrigMult();
1326  mHistOrigMult ->Fill((float)origMult);
1327  mHistMultEta ->Fill((float)pFlowEvent->MultEta());
1328  int cent = pFlowEvent->Centrality();
1329  mHistCent ->Fill((float)cent);
1330  int totalMult = pFlowEvent->TrackCollection()->size();
1331  mHistMult ->Fill((float)totalMult);
1332  UInt_t partMult = pFlowEvent->MultPart(pFlowSelect);
1333  mHistMultPart ->Fill((float)partMult);
1334  if (origMult) mHistMultOverOrig->Fill((float)totalMult / (float)origMult);
1335 
1336  StThreeVectorF vertex = pFlowEvent->VertexPos();
1337  mHistVertexZ ->Fill(vertex.z());
1338  mHistVertexXY2D->Fill(vertex.x(), vertex.y());
1339 
1340  mHistCTBvsZDC2D->Fill(pFlowEvent->ZDCe() + pFlowEvent->ZDCw(), pFlowEvent->CTB());
1341 
1342  //ZDCSMD test
1343  for(int strip=1; strip<9; strip++) {
1344  mZDC_SMD_west_hori->Fill(strip,pFlowEvent->ZDCSMD(1,1,strip));
1345  mZDC_SMD_east_hori->Fill(strip,pFlowEvent->ZDCSMD(0,1,strip));
1346  if(strip==8) continue;
1347  mZDC_SMD_west_vert->Fill(strip,pFlowEvent->ZDCSMD(1,0,strip));
1348  mZDC_SMD_east_vert->Fill(strip,pFlowEvent->ZDCSMD(0,0,strip));
1349  }
1350  mHistZDCSMDPsiWgtEast->Fill(pFlowEvent->ZDCSMD_PsiEst());
1351  mHistZDCSMDPsiWgtWest->Fill(pFlowEvent->ZDCSMD_PsiWst());
1352  mHistZDCSMDPsiWgtTest->Fill(mPsi[0][0]);
1353  mHistZDCSMDPsiWgtFull->Fill(mPsi[0][0],mFlowWeight/mZDCSMD_f_PsiWgt);
1354  mHistZDCSMDPsiCorTest->Fill(pFlowEvent->ZDCSMD_PsiCorr());
1355  mHistZDCSMDPsiCorFull->Fill(pFlowEvent->ZDCSMD_PsiCorr(),mFlowWeight/mZDCSMD_f_PsiWgt);
1356 
1357  // sub-event Psi_Subs
1358  for (int k = 0; k < Flow::nSels; k++) {
1359  for (int j = 0; j < Flow::nHars; j++) {
1360  for (int n = 0; n < Flow::nSubs; n++) {
1361  int i = Flow::nSels*k + n;
1362  if(mPsiSub[i][j]) { histSub[i].histSubHar[j].mHistPsiSubs->Fill(mPsiSub[i][j]); }
1363  if (mQSub[i][j].Mod() && mMultSub[i][j]) {
1364  if (k==0) { // FTPC
1365  double QSubx = mQSub[i][j].X() / (double)mMultSub[i][j];
1366  double QSuby = mQSub[i][j].Y() / (double)mMultSub[i][j];
1367  histFull[n].histFullHar[j].mHistQFTPCSubXY2D->Fill(QSubx,QSuby);
1368  } else if (k==1) { // TPC
1369  double QSubx = mQSub[i][j].X() / (double)mMultSub[i][j];
1370  double QSuby = mQSub[i][j].Y() / (double)mMultSub[i][j];
1371  histFull[n].histFullHar[j].mHistQTPCSubXY2D->Fill(QSubx,QSuby);
1372  }
1373  }
1374  }
1375  }
1376  }
1377 
1378  // full event Psi, PsiSubCorr, PsiSubCorrDiff, cos, mult, q, reCent
1379  for (int k = 0; k < Flow::nSels; k++) {
1380  pFlowSelect->SetSelection(k);
1381  for (int j = 0; j < Flow::nHars; j++) {
1382  pFlowSelect->SetHarmonic(j);
1383  float order = (float)(j+1);
1384 
1385  if (mPsi[k][j]) {
1386  histFull[k].histFullHar[j].mHistPsi->Fill(mPsi[k][j]);
1387  //histFull[k].histFullHar[j].mHistPsi->Fill(mPsi[k][j],mQ[k][j].Mod());
1388  }
1389  if (mQ[k][j].Mod() && mMult[k][j]) {
1390  double Qx = mQ[k][j].X() / (double)mMult[k][j];
1391  double Qy = mQ[k][j].Y() / (double)mMult[k][j];
1392  histFull[k].histFullHar[j].mHistQXY2D->Fill(Qx,Qy);
1393  }
1394  if (mPsi[0][j] && mPsi[1][j]) {
1395  if (k < 2 && j < 2) {
1396  if (k == 0) {
1397  float psi1 = mPsi[0][j];
1398  float psi2 = mPsi[1][j];
1399  float diff = psi1 - psi2;
1400  if (diff < -twopi/2./(j+1)) {
1401  diff += twopi/(j+1);
1402  } else if (diff > +twopi/2./(j+1)) {
1403  diff -= twopi/(j+1);
1404  }
1405  histFull[k].histFullHar[j].mHistPsi_Diff->Fill(diff);
1406  } else if (k == 1) {
1407  float psi1 = 0.;
1408  float psi2 = 0.;
1409  if (j == 0) {
1410  psi1 = mPsi[0][0];
1411  psi2 = mPsi[1][1];
1412  } else if (j == 1) {
1413  psi1 = mPsi[0][0];
1414  psi2 = mPsi[0][1];
1415  }
1416  float diff = psi1 - psi2;
1417  diff = (TMath::Abs(diff) > twopi/2.) ? ((diff > 0.) ? -(twopi - diff) :
1418  -(diff + twopi)) : diff;
1419  histFull[k].histFullHar[j].mHistPsi_Diff->Fill(diff);
1420  }
1421  }
1422  }
1423 
1424  if (mPsiSub[Flow::nSels*k][j] != 0. && mPsiSub[Flow::nSels*k+1][j] != 0.) {
1425  float psiSubCorr;
1426  if(pFlowEvent->UseZDCSMD()) {
1427  psiSubCorr = pFlowEvent->ZDCSMD_PsiCorr();
1428  }
1429  else if (mV1Ep1Ep2 == kFALSE || order != 1) { // normal case
1430  psiSubCorr = mPsiSub[Flow::nSels*k][j] - mPsiSub[Flow::nSels*k+1][j];
1431  }
1432  else { // mV1Ep1Ep2 == kTRUE && order == 1
1433  psiSubCorr = mPsiSub[Flow::nSels*k][0] + mPsiSub[Flow::nSels*k+1][0] - 2.*mPsi[k][1];
1434  }
1435  histFull[k].mHistCos->Fill(order, (float)cos(order * psiSubCorr),mFlowWeight/mZDCSMD_f_PsiWgt);
1436  if (psiSubCorr < 0.) psiSubCorr += twopi / order;
1437  if (psiSubCorr > twopi / order) psiSubCorr -= twopi / order; // for v1Ep1Ep2 which gives -twopi < psiSubCorr < 2.*twopi
1438  histFull[k].histFullHar[j].mHistPsiSubCorr->Fill(psiSubCorr,mFlowWeight/mZDCSMD_f_PsiWgt);
1439  }
1440 
1441  if (j < Flow::nHars - 1) { // subevents of different harmonics
1442  int j1 = 0, j2 = 0;
1443  float psiSubCorrDiff;
1444  if (j==0) {
1445  j1 = 1, j2 = 2;
1446  } else if (j==1) {
1447  j1 = 1, j2 = 3;
1448  } else if (j==2) {
1449  j1 = 2, j2 = 4;
1450  }
1451  psiSubCorrDiff = fmod((double)mPsiSub[Flow::nSels*k][j1-1],
1452  twopi/(double)j2) - fmod((double)mPsiSub[Flow::nSels*k+1][j2-1],
1453  twopi/(double)j2);
1454  if (psiSubCorrDiff < 0.) psiSubCorrDiff += twopi/(float)j2;
1455  if (psiSubCorrDiff) { histFull[k].histFullHar[j].mHistPsiSubCorrDiff->Fill(psiSubCorrDiff); }
1456  psiSubCorrDiff = fmod((double)mPsiSub[Flow::nSels*k][j2-1],
1457  twopi/(double)j2) - fmod((double)mPsiSub[Flow::nSels*k+1][j1-1],
1458  twopi/(double)j2);
1459  if (psiSubCorrDiff < 0.) psiSubCorrDiff += twopi/(float)j2;
1460  if (psiSubCorrDiff) { histFull[k].histFullHar[j].mHistPsiSubCorrDiff->Fill(psiSubCorrDiff); }
1461  }
1462 
1463  histFull[k].histFullHar[j].mHistMult->Fill((float)mMult[k][j]);
1464  if (m_q[k][j]) { histFull[k].histFullHar[j].mHist_q->Fill(m_q[k][j]); }
1465 
1466  if (mCalcReCentPars) {
1467  // calculate recentering parameters, fill 4 bins
1468  TVector2 qReCent;
1469  qReCent = pFlowEvent->ReCentEPPar(pFlowSelect,"FTPCE");
1470  if (qReCent.X()) histFull[k].histFullHar[j].mHistReCentX->Fill(1., qReCent.X());
1471  if (qReCent.Y()) histFull[k].histFullHar[j].mHistReCentY->Fill(1., qReCent.Y());
1472  qReCent = pFlowEvent->ReCentEPPar(pFlowSelect,"FTPCW");
1473  if (qReCent.X()) histFull[k].histFullHar[j].mHistReCentX->Fill(2., qReCent.X());
1474  if (qReCent.Y()) histFull[k].histFullHar[j].mHistReCentY->Fill(2., qReCent.Y());
1475  qReCent = pFlowEvent->ReCentEPPar(pFlowSelect,"TPCE");
1476  if (qReCent.X()) histFull[k].histFullHar[j].mHistReCentX->Fill(3., qReCent.X());
1477  if (qReCent.Y()) histFull[k].histFullHar[j].mHistReCentY->Fill(3., qReCent.Y());
1478  qReCent = pFlowEvent->ReCentEPPar(pFlowSelect,"TPCW");
1479  if (qReCent.X()) histFull[k].histFullHar[j].mHistReCentX->Fill(4., qReCent.X());
1480  if (qReCent.Y()) histFull[k].histFullHar[j].mHistReCentY->Fill(4., qReCent.Y());
1481  }
1482  }
1483  }
1484 }
1485 
1486 //-----------------------------------------------------------------------
1487 
1488 void StFlowAnalysisMaker::FillParticleHistograms() {
1489  // Fill histograms from the particles
1490 
1491  float etaSymPosTpcN = 0.;
1492  float etaSymNegTpcN = 0.;
1493  float etaSymPosFtpcN = 0.;
1494  float etaSymNegFtpcN = 0.;
1495  float hPlusN = 0.;
1496  float hMinusN = 0.;
1497  float piPlusN = 0.;
1498  float piMinusN = 0.;
1499  float protonN = 0.;
1500  float pbarN = 0.;
1501  float kMinusN = 0.;
1502  float kPlusN = 0.;
1503  float deuteronN = 0.;
1504  float dbarN = 0.;
1505  float electronN = 0.;
1506  float positronN = 0.;
1507 
1508  // Initialize Iterator
1509  StFlowTrackCollection* pFlowTracks = pFlowEvent->TrackCollection();
1510  StFlowTrackIterator itr;
1511 
1512  for (itr = pFlowTracks->begin(); itr != pFlowTracks->end(); itr++) {
1513  StFlowTrack* pFlowTrack = *itr;
1514 
1515  float phi = pFlowTrack->Phi();
1516  if (phi < 0.) phi += twopi;
1517  float eta = pFlowTrack->Eta();
1518  float zFirstPoint = 0.;
1519  float zLastPoint = 0.;
1520  if (pFlowEvent->FirstLastPoints()) {
1521  zFirstPoint = pFlowTrack->ZFirstPoint();
1522  zLastPoint = pFlowTrack->ZLastPoint();
1523  }
1524  float pt = pFlowTrack->Pt();
1525  int charge = pFlowTrack->Charge();
1526  float dca = pFlowTrack->Dca();
1527  float dcaGlobal = pFlowTrack->DcaGlobal();
1528  float chi2 = pFlowTrack->Chi2();
1529  int fitPts = pFlowTrack->FitPts();
1530  int maxPts = pFlowTrack->MaxPts();
1531  Char_t pid[10];
1532  strcpy(pid, pFlowTrack->Pid());
1533  float totalp = pFlowTrack->P();
1534  float logp = ::log(totalp);
1535  float dEdx = pFlowTrack->Dedx();
1536  StTrackTopologyMap map = pFlowTrack->TopologyMap();
1537 
1538  // no selections: Charge, Dca, DcaGlobal, Chi2, FitPts, MaxPts, FitOverMax, PID
1539 
1540  // distinguish between Tpc and Ftpc
1541  if (map.trackFtpcEast() || map.trackFtpcWest()) {
1542  mHistChargeFtpc ->Fill((float)charge);
1543  mHistDcaFtpc ->Fill(dca);
1544  mHistDcaGlobalFtpc->Fill(dcaGlobal);
1545  mHistChi2Ftpc ->Fill(chi2);
1546  mHistFitPtsFtpc ->Fill((float)fitPts);
1547  mHistMaxPtsFtpc ->Fill((float)maxPts);
1548  if (maxPts) mHistFitOverMaxFtpc->Fill((float)fitPts/(float)maxPts);
1549  }
1550 
1551  else { // Tpc track or otherwise!!!
1552 
1553  // For PID multiplicites
1554  if (strcmp(pid, "pi+") == 0) piPlusN++;
1555  if (strcmp(pid, "pi-") == 0) piMinusN++;
1556  if (strcmp(pid, "pr+") == 0) protonN++;
1557  if (strcmp(pid, "pr-") == 0) pbarN++;
1558  if (strcmp(pid, "k+") == 0) kPlusN++;
1559  if (strcmp(pid, "k-") == 0) kMinusN++;
1560  if (strcmp(pid, "d+") == 0) deuteronN++;
1561  if (strcmp(pid, "d-") == 0) dbarN++;
1562  if (strcmp(pid, "e-") == 0) electronN++;
1563  if (strcmp(pid, "e+") == 0) positronN++;
1564 
1565  mHistDcaTpc ->Fill(dca);
1566  mHistDcaGlobalTpc->Fill(dcaGlobal);
1567  mHistChi2Tpc ->Fill(chi2);
1568  mHistFitPtsTpc ->Fill((float)fitPts);
1569  mHistMaxPtsTpc ->Fill((float)maxPts);
1570  if (maxPts) mHistFitOverMaxTpc->Fill((float)fitPts/(float)maxPts);
1571 
1572  if (charge == 1) {
1573  hPlusN++;
1574  mHistMeanDedxPos2D->Fill(logp, dEdx);
1575  float piPlus = pFlowTrack->PidPiPlus();
1576  mHistPidPiPlus->Fill(piPlus);
1577  if (strcmp(pid, "pi+") == 0) {
1578  mHistMeanDedxPiPlus2D->Fill(logp, dEdx);
1579  mHistPidPiPlusPart->Fill(piPlus);
1580  }
1581  float kplus = pFlowTrack->PidKaonPlus();
1582  mHistPidKplus->Fill(kplus);
1583  if (strcmp(pid, "k+") == 0) {
1584  mHistMeanDedxKplus2D->Fill(logp, dEdx);
1585  mHistPidKplusPart->Fill(kplus);
1586  }
1587  float proton = pFlowTrack->PidProton();
1588  mHistPidProton->Fill(proton);
1589  if (strcmp(pid, "pr+") == 0) {
1590  mHistMeanDedxProton2D->Fill(logp, dEdx);
1591  mHistPidProtonPart->Fill(proton);
1592  }
1593  float deuteron = pFlowTrack->PidDeuteron();
1594  mHistPidDeuteron->Fill(deuteron);
1595  if (strcmp(pid, "d+") == 0) {
1596  mHistMeanDedxDeuteron2D->Fill(logp, dEdx);
1597  mHistPidDeuteronPart->Fill(deuteron);
1598  }
1599  float positron = pFlowTrack->PidPositron();
1600  mHistPidPositron->Fill(positron);
1601  if (strcmp(pid, "e+") == 0) {
1602  mHistMeanDedxPositron2D->Fill(logp, dEdx);
1603  mHistPidPositronPart->Fill(positron);
1604  }
1605  } else if (charge == -1) {
1606  hMinusN++;
1607  mHistMeanDedxNeg2D->Fill(logp, dEdx);
1608  float piMinus = pFlowTrack->PidPiMinus();
1609  mHistPidPiMinus->Fill(piMinus);
1610  if (strcmp(pid, "pi-") == 0) {
1611  mHistMeanDedxPiMinus2D->Fill(logp, dEdx);
1612  mHistPidPiMinusPart->Fill(piMinus);
1613  }
1614  float kminus = pFlowTrack->PidKaonMinus();
1615  mHistPidKminus->Fill(kminus);
1616  if (strcmp(pid, "k-") == 0) {
1617  mHistMeanDedxKminus2D->Fill(logp, dEdx);
1618  mHistPidKminusPart->Fill(kminus);
1619  }
1620  float antiproton = pFlowTrack->PidAntiProton();
1621  mHistPidAntiProton->Fill(antiproton);
1622  if (strcmp(pid, "pr-") == 0) {
1623  mHistMeanDedxPbar2D->Fill(logp, dEdx);
1624  mHistPidAntiProtonPart->Fill(antiproton);
1625  }
1626  float antideuteron = pFlowTrack->PidAntiDeuteron();
1627  mHistPidAntiDeuteron->Fill(antideuteron);
1628  if (strcmp(pid, "d-") == 0) {
1629  mHistMeanDedxAntiDeuteron2D->Fill(logp, dEdx);
1630  mHistPidAntiDeuteronPart->Fill(antideuteron);
1631  }
1632  float electron = pFlowTrack->PidElectron();
1633  mHistPidElectron->Fill(electron);
1634  if (strcmp(pid, "e-") == 0) {
1635  mHistMeanDedxElectron2D->Fill(logp, dEdx);
1636  mHistPidElectronPart->Fill(electron);
1637  }
1638  }
1639  }//all tracks
1640 
1641  // Yield3D, Yield2D, BinEta, BinPt
1642  mHistEtaPtPhi3D->Fill(eta, pt, phi);
1643  mHistYieldAll2D->Fill(eta, pt);
1644  if (pFlowSelect->SelectPart(pFlowTrack)) {
1645  if (strlen(pFlowSelect->PidPart()) != 0) {
1646  float rapidity = pFlowTrack->Y();
1647  mHistBinEta->Fill(rapidity, rapidity);
1648  mHistYieldPart2D->Fill(rapidity, pt);
1649  } else {
1650  mHistBinEta->Fill(eta, eta);
1651  mHistYieldPart2D->Fill(eta, pt);
1652  }
1653  mHistBinPt->Fill(pt, pt);
1654  }//particles correlated with the EP
1655 
1656  // For Eta symmetry
1657  // Tpc
1658  if (map.hasHitInDetector(kTpcId)) {
1659  (eta > 0.) ? etaSymPosTpcN++ : etaSymNegTpcN++;
1660  }
1661  // Ftpc
1662  else if (map.trackFtpcEast() || map.trackFtpcWest()) {
1663  (eta > 0.) ? etaSymPosFtpcN++ : etaSymNegFtpcN++;
1664  }
1665 
1666  TVector2 Q, reCent;
1667  Double_t mult;
1668  // Get the angle of the Event Plane
1669  for (int k = 0; k < Flow::nSels; k++) {
1670  pFlowSelect->SetSelection(k);
1671  for (int j = 0; j < Flow::nHars; j++) {
1672  bool oddHar = (j+1) % 2;
1673  pFlowSelect->SetHarmonic(j);
1674  double order = (double)(j+1);
1675  double orderEP = order;
1676  float psi_i = 0., psi_2 = 0.;
1677  if (pFlowEvent->EtaSubs()) { // particles with the other subevent
1678  int i = Flow::nSels*k;
1679  psi_i = (eta > 0.) ? mPsiSub[i+1][j] : mPsiSub[i][j];
1680  } else if (pFlowEvent->RanSubs()) { // particles with the other subevent
1681  int i = Flow::nSels*k;
1682  if (pFlowTrack->Select(j,k,0)) {
1683  psi_i = mPsiSub[i+1][j];
1684  } else if (pFlowTrack->Select(j,k,1)) {
1685  psi_i = mPsiSub[i][j];
1686  } else { // neither
1687  int r = (eta > 0.) ? 1 : 0;
1688  psi_i = mPsiSub[i+r][j]; // random
1689  }
1690  } else if (order > 3. && !oddHar) { // 4, 6, etc
1691  psi_i = mPsi[k][1]; // 2nd harmomic event plane
1692  if (psi_i > twopi/order) psi_i -= twopi/order; // ???
1693  if (psi_i > twopi/order) psi_i -= twopi/order;
1694  } else {
1695  psi_i = mPsi[k][j];
1696  } // full EP
1697 
1698  if (pFlowSelect->Select(pFlowTrack)) { // particles used for the EP
1699 
1700  histFull[k].histFullHar[j].mHistYield2D->Fill(eta, pt);
1701 
1702  // Get phiWgt and reCent from files
1703  double phiWgt = pFlowEvent->PhiWeight(k, j, pFlowTrack);
1704  TVector2 reCent = pFlowEvent->ReCentEP(k, j, pFlowTrack);
1705 
1706  if (pFlowMaker->PhiWgtCalc() && j < 2) { // only first two harmonics for phiWgt
1707 
1708  // Get detID
1709  StDetectorId detId;
1710  Bool_t kTpcFarEast = kFALSE;
1711  Bool_t kTpcEast = kFALSE;
1712  Bool_t kTpcWest = kFALSE;
1713  Bool_t kTpcFarWest = kFALSE;
1714  Bool_t kFtpcFarEast = kFALSE;
1715  Bool_t kFtpcEast = kFALSE;
1716  Bool_t kFtpcWest = kFALSE;
1717  Bool_t kFtpcFarWest = kFALSE;
1718  if (map.hasHitInDetector(kTpcId) || (map.data(0) == 0 && map.data(1) == 0)) {
1719  // Tpc track, or TopologyMap not available
1720  detId = kTpcId;
1721  // Set TpcEast and West
1722  if (pFlowEvent->FirstLastPoints()) {
1723  if (zFirstPoint > 0. && zLastPoint > 0.) {
1724  kTpcFarWest = kTRUE;
1725  } else if (zFirstPoint > 0. && zLastPoint < 0.) {
1726  kTpcWest = kTRUE;
1727  } else if (zFirstPoint < 0. && zLastPoint > 0.) {
1728  kTpcEast = kTRUE;
1729  } else {
1730  kTpcFarEast = kTRUE;
1731  }
1732  } else {
1733  Float_t vertexZ = pFlowEvent->VertexPos().z();
1734  if (eta > 0. && vertexZ > 0.) {
1735  kTpcFarWest = kTRUE;
1736  } else if (eta > 0. && vertexZ < 0.) {
1737  kTpcWest = kTRUE;
1738  } else if (eta < 0. && vertexZ > 0.) {
1739  kTpcEast = kTRUE;
1740  } else {
1741  kTpcFarEast = kTRUE;
1742  }
1743  }
1744  } else if (map.trackFtpcEast()) { // FTPC track
1745  detId = kFtpcEastId; // eta < 0.
1746  Float_t vertexZ = pFlowEvent->VertexPos().z();
1747  if (vertexZ > 0.) {
1748  kFtpcEast = kTRUE;
1749  } else { // vertexZ < 0.
1750  kFtpcFarEast = kTRUE;
1751  }
1752  } else if (map.trackFtpcWest()) {
1753  detId = kFtpcWestId; // eta > 0.
1754  Float_t vertexZ = pFlowEvent->VertexPos().z();
1755  if (vertexZ > 0.) {
1756  kFtpcFarWest = kTRUE;
1757  } else { // vertexZ > 0.
1758  kFtpcWest = kTRUE;
1759  }
1760  } else {
1761  detId = kUnknownId;
1762  }
1763 
1764  // Calculate weights for filling histograms
1765  float wt = 1.;
1766  if (pFlowEvent->PtWgt()) { // pt wgt
1767  wt *= (pt < pFlowEvent->PtWgtSaturation()) ? pt :
1768  pFlowEvent->PtWgtSaturation(); // pt weighting going constant
1769  }
1770  float etaAbs = fabs(eta); // etaWgt, eta > 1.
1771  //if (pFlowEvent->EtaWgt() && oddHar && etaAbs > 1.) { wt *= etaAbs; }
1772  if (pFlowEvent->EtaWgt() && j==0 && etaAbs > 1.) { wt *= etaAbs; }
1773 
1774  // Fill histograms with selections
1775  if (kFtpcFarEast) {
1776  histFull[k].histTwoHar[j].mHistPhiFtpcFarEast->Fill(phi,wt);
1777  } else if (kFtpcEast) {
1778  histFull[k].histTwoHar[j].mHistPhiFtpcEast->Fill(phi,wt);
1779  } else if (kFtpcWest) {
1780  histFull[k].histTwoHar[j].mHistPhiFtpcWest->Fill(phi,wt);
1781  } else if (kFtpcFarWest) {
1782  histFull[k].histTwoHar[j].mHistPhiFtpcFarWest->Fill(phi,wt);
1783  } else if (kTpcFarEast){
1784  histFull[k].histTwoHar[j].mHistPhiFarEast->Fill(phi,wt);
1785  } else if (kTpcEast){
1786  histFull[k].histTwoHar[j].mHistPhiEast->Fill(phi,wt);
1787  } else if (kTpcWest){
1788  histFull[k].histTwoHar[j].mHistPhiWest->Fill(phi,wt);
1789  } else if (kTpcFarWest){
1790  histFull[k].histTwoHar[j].mHistPhiFarWest->Fill(phi,wt);
1791  }
1792 
1793  // Which flat hist?
1794  if (pFlowEvent->FirstLastPoints() && !pFlowEvent->FirstLastPhiWgt()) {
1795  kTpcFarEast = kFALSE;
1796  kTpcEast = kFALSE;
1797  kTpcWest = kFALSE;
1798  kTpcFarWest = kFALSE;
1799  Float_t vertexZ = pFlowEvent->VertexPos().z();
1800  if (eta > 0. && vertexZ > 0.) {
1801  kTpcFarWest = kTRUE;
1802  } else if (eta > 0. && vertexZ < 0.) {
1803  kTpcWest = kTRUE;
1804  } else if (eta < 0. && vertexZ > 0.) {
1805  kTpcEast = kTRUE;
1806  } else {
1807  kTpcFarEast = kTRUE;
1808  }
1809  }
1810 
1811  //if (oddHar && eta < 0.) phiWgt /= -1.; // only for flat hists
1812  if (j==0 && eta < 0.) phiWgt /= -1.; // only for flat hists
1813  // Fill Flat histograms
1814  if (kFtpcFarEast) {
1815  histFull[k].histTwoHar[j].mHistPhiFlatFtpcFarEast->Fill(phi, phiWgt);
1816  } else if (kFtpcEast) {
1817  histFull[k].histTwoHar[j].mHistPhiFlatFtpcEast->Fill(phi, phiWgt);
1818  } else if (kFtpcWest) {
1819  histFull[k].histTwoHar[j].mHistPhiFlatFtpcWest->Fill(phi, phiWgt);
1820  } else if (kFtpcFarWest) {
1821  histFull[k].histTwoHar[j].mHistPhiFlatFtpcFarWest->Fill(phi, phiWgt);
1822  } else if (kTpcFarEast) {
1823  histFull[k].histTwoHar[j].mHistPhiFlatFarEast->Fill(phi, phiWgt);
1824  } else if (kTpcEast) {
1825  histFull[k].histTwoHar[j].mHistPhiFlatEast->Fill(phi, phiWgt);
1826  } else if (kTpcWest) {
1827  histFull[k].histTwoHar[j].mHistPhiFlatWest->Fill(phi, phiWgt);
1828  } else if (kTpcFarWest) {
1829  histFull[k].histTwoHar[j].mHistPhiFlatFarWest->Fill(phi, phiWgt);
1830  }
1831  if (j==0 && eta < 0.) phiWgt *= -1.; // restore value
1832  }
1833 
1834  // Remove autocorrelations with full EP
1835  if (!pFlowEvent->EtaSubs() && !pFlowEvent->RanSubs()) {
1836  TVector2 Q_i;
1837  if (order > 3. && !oddHar) { // 2nd harmonic event plane
1838  orderEP = 2;
1839  }
1840  double Qx = phiWgt * cos(orderEP * phi) - reCent.X();
1841  double Qy = phiWgt * sin(orderEP * phi) - reCent.Y();
1842  Q_i.Set(Qx, Qy);
1843  TVector2 mQ_i = mQ[k][j] - Q_i;
1844  psi_i = mQ_i.Phi() / orderEP;
1845  if (psi_i < 0.) psi_i += twopi / orderEP;
1846  }
1847  }//particles used for the EP
1848 
1849  // Remove autocorrelations of the 2nd order 'particles' which were used for v1{EP1,EP2}.
1850  if (mV1Ep1Ep2 == kTRUE && order == 1) {
1851  StFlowSelection usedForPsi2 = *pFlowSelect;
1852  usedForPsi2.SetHarmonic(1);
1853  usedForPsi2.SetSubevent(-1);
1854  if (usedForPsi2.Select(pFlowTrack)) {
1855  TVector2 Q_i;
1856  double phiWgt = pFlowEvent->PhiWeight(k, 1, pFlowTrack);
1857  TVector2 reCent = pFlowEvent->ReCentEP(k, 1, pFlowTrack);
1858  double Qx = phiWgt * cos(2 * phi) - reCent.X();
1859  double Qy = phiWgt * sin(2 * phi) - reCent.Y();
1860  Q_i.Set(Qx, Qy);
1861  TVector2 mQ_i = mQ[k][1] - Q_i;
1862  psi_2 = mQ_i.Phi() / 2.;
1863  if (psi_2 < 0.) psi_2 += twopi / 2.;
1864  }
1865  else { // particle was not used for Psi2
1866  psi_2 = mPsi[k][1];
1867  }
1868  }
1869 
1870  // test recentering of Q per particle
1871  mult = (double)(pFlowEvent->Mult(pFlowSelect));
1872  if (mult > 0.) {
1873  histFull[k].histFullHar[j].mHistQreCent->Fill(1., mQ[k][j].X()/mult);
1874  histFull[k].histFullHar[j].mHistQreCent->Fill(2., mQ[k][j].Y()/mult);
1875  }
1876 
1877  // Calculate v for all particles selected for correlation analysis
1878  if (pFlowSelect->SelectPart(pFlowTrack)) { // particles correlated with the EP
1879  float v;
1880  if (pFlowEvent->UseZDCSMD()) {
1881  v = cos(order *(phi-mQ[k][1].Phi()))/perCent;
1882  }
1883  else if (mV1Ep1Ep2 == kFALSE || order != 1) {
1884  v = cos(order * (phi - psi_i))/perCent; // normal method
1885  }
1886  else { // mV1Ep1Ep2 == kTRUE && order == 1
1887  v = cos(phi + psi_i - 2.*psi_2)/perCent;
1888  }
1889  float vFlip = v;
1890  if (eta < 0 && j==0) vFlip *= -1; // for 1st harmonic only
1891  if (strlen(pFlowSelect->PidPart()) != 0) { // pid, fill rapidity
1892  float rapidity = pFlowTrack->Y();
1893  histFull[k].histFullHar[j].mHist_vObs2D->Fill(rapidity, pt, v,mFlowWeight);
1894 
1895  if (mPtRange_for_vEta[1] > mPtRange_for_vEta[0]) { // cut is used
1896  if (pt < mPtRange_for_vEta[1] && pt >= mPtRange_for_vEta[0]) {
1897  // check cut range, fill if in range
1898  histFull[k].histFullHar[j].mHist_vObsEta->Fill(rapidity, v,mFlowWeight);
1899  }
1900  }
1901  else { // cut is not used, fill in any case
1902  histFull[k].histFullHar[j].mHist_vObsEta->Fill(rapidity, v, mFlowWeight);
1903  }
1904 
1905  } else { // no pid, fill eta
1906  histFull[k].histFullHar[j].mHist_vObs2D->Fill(eta, pt, v,mFlowWeight);
1907 
1908  if (mPtRange_for_vEta[1] > mPtRange_for_vEta[0]) { // cut is used
1909  if (pt < mPtRange_for_vEta[1] && pt >= mPtRange_for_vEta[0]) {
1910  // check cut range, fill if in range
1911  histFull[k].histFullHar[j].mHist_vObsEta->Fill(eta, v, mFlowWeight);
1912  }
1913  }
1914  else { // cut is not used, fill in any case
1915  histFull[k].histFullHar[j].mHist_vObsEta->Fill(eta, v, mFlowWeight);
1916  }
1917  }
1918 
1919  if (mEtaRange_for_vPt[1] > mEtaRange_for_vPt[0]) { // cut is used
1920  if (TMath::Abs(eta) < mEtaRange_for_vPt[1] && TMath::Abs(eta) >= mEtaRange_for_vPt[0]) {
1921  // check cut range, fill if in range
1922  histFull[k].histFullHar[j].mHist_vObsPt->Fill(pt, vFlip, mFlowWeight);
1923  }
1924  }
1925  else { // cut is not used, fill in any case
1926  histFull[k].histFullHar[j].mHist_vObsPt->Fill(pt, vFlip,mFlowWeight);
1927  }
1928 
1929  // v_
1930  Bool_t etaPtNoCut = kTRUE;
1931  if (mPtRange_for_vEta[1] > mPtRange_for_vEta[0] &&
1932  (pt < mPtRange_for_vEta[0] || pt >= mPtRange_for_vEta[1])) {
1933  etaPtNoCut = kFALSE;
1934  }
1935  if (mEtaRange_for_vPt[1] > mEtaRange_for_vPt[0] &&
1936  (TMath::Abs(eta) < mEtaRange_for_vPt[0] ||
1937  TMath::Abs(eta) >= mEtaRange_for_vPt[1])) {
1938  etaPtNoCut = kFALSE;
1939  }
1940  if (etaPtNoCut) histFull[k].mHist_vObs->Fill(order, vFlip,mFlowWeight);
1941 
1942  // PhiLab and Correlation of Phi of all particles with Psi
1943  if (mPsi[k][j]) {
1944  histFull[k].histFullHar[j].mHistPhiLab->Fill(phi);
1945  histFull[k].histFullHar[j].mHistPhiLab->Fill(phi);
1946  float phi_i = phi;
1947  if (eta < 0 && j==0) {
1948  phi_i += pi; // backward particle and 1st harmonic
1949  if (phi_i > twopi) phi_i -= twopi;
1950  }
1951  float dPhi = phi_i - psi_i;
1952  if (dPhi < 0.) dPhi += twopi;
1953  histFull[k].histFullHar[j].mHistPhiCorr->
1954  Fill(fmod((double)dPhi, twopi / order));
1955  }
1956  }//particles correlated with the EP
1957  }
1958  }
1959  }
1960 
1961  // EtaSym
1962  float etaSymTpc = (etaSymPosTpcN - etaSymNegTpcN) / (etaSymPosTpcN + etaSymNegTpcN);
1963  float etaSymFtpc = (etaSymPosFtpcN - etaSymNegFtpcN) / (etaSymPosFtpcN + etaSymNegFtpcN);
1964 
1965  StThreeVectorF vertex = pFlowEvent->VertexPos();
1966  Float_t vertexZ = vertex.z();
1967  mHistEtaSymVerZ2DTpc ->Fill(vertexZ , etaSymTpc);
1968  mHistEtaSymVerZ2DFtpc->Fill(vertexZ , etaSymFtpc);
1969 
1970  // Tpc
1971  float etaSymZInterceptTpc = 0.00023; // new values introduced for 200 GeV
1972  float etaSymZSlopeTpc = -0.00394; // data based on full statistics
1973  etaSymTpc -= (etaSymZInterceptTpc + etaSymZSlopeTpc * vertexZ); // corrected for acceptance
1974  etaSymTpc *= ::sqrt((etaSymPosTpcN + etaSymNegTpcN)); // corrected for statistics
1975  mHistEtaSymTpc->Fill(etaSymTpc);
1976 
1977  // Ftpc
1978  float etaSymZInterceptFtpc = -0.0077; // values for the FTPC based on 200 GeV data with
1979  float etaSymZSlopeFtpc = 0.0020; // all sectors and 'bad runs' (323-325) excluded
1980  etaSymFtpc -= (etaSymZInterceptFtpc + etaSymZSlopeFtpc * vertexZ); // corrected for acceptance
1981  etaSymFtpc *= ::sqrt((etaSymPosFtpcN + etaSymNegFtpcN)); // corrected for statistics
1982  mHistEtaSymFtpc->Fill(etaSymFtpc);
1983 
1984  // PID multiplicities
1985  float totalMult = (float)pFlowEvent->TrackCollection()->size();
1986  mHistPidMult->Fill(1., totalMult);
1987  mHistPidMult->Fill(2., hPlusN);
1988  mHistPidMult->Fill(3., hMinusN);
1989  mHistPidMult->Fill(4., piPlusN);
1990  mHistPidMult->Fill(5., piMinusN);
1991  mHistPidMult->Fill(6., protonN);
1992  mHistPidMult->Fill(7., pbarN);
1993  mHistPidMult->Fill(8., kPlusN);
1994  mHistPidMult->Fill(9., kMinusN);
1995  mHistPidMult->Fill(10., deuteronN);
1996  mHistPidMult->Fill(11., dbarN);
1997  mHistPidMult->Fill(12., electronN);
1998  mHistPidMult->Fill(13., positronN);
1999 
2000 }
2001 
2002 //-----------------------------------------------------------------------
2003 
2004 static Double_t resEventPlane(double chi) {
2005  // Calculates the event plane resolution as a function of chi
2006 
2007  double con = 0.626657; // sqrt(pi/2)/2
2008  double arg = chi * chi / 4.;
2009 
2010  Double_t res = con * chi * exp(-arg) * (TMath::BesselI0(arg) +
2011  TMath::BesselI1(arg));
2012 
2013  return res;
2014 }
2015 
2016 //-----------------------------------------------------------------------
2017 
2018 static Double_t resEventPlaneK2(double chi) {
2019  // Calculates the event plane resolution as a function of chi
2020  // for the case k=2.
2021 
2022  double con = 0.626657; // sqrt(pi/2)/2
2023  double arg = chi * chi / 4.;
2024 
2025  double besselOneHalf = ::sqrt(arg/halfpi) * sinh(arg)/arg;
2026  double besselThreeHalfs = ::sqrt(arg/halfpi) * (cosh(arg)/arg - sinh(arg)/(arg*arg));
2027  Double_t res = con * chi * exp(-arg) * (besselOneHalf + besselThreeHalfs);
2028 
2029  return res;
2030 }
2031 
2032 //-----------------------------------------------------------------------
2033 
2034 static Double_t resEventPlaneK3(double chi) {
2035  // Calculates the event plane resolution as a function of chi
2036  // for the case k=3.
2037 
2038  double con = 0.626657; // sqrt(pi/2)/2
2039  double arg = chi * chi / 4.;
2040 
2041  Double_t res = con * chi * exp(-arg) * (TMath::BesselI1(arg) +
2042  TMath::BesselI(2, arg));
2043 
2044  return res;
2045 }
2046 
2047 //-----------------------------------------------------------------------
2048 
2049 static Double_t resEventPlaneK4(double chi) {
2050  // Calculates the event plane resolution as a function of chi
2051  // for the case k=4.
2052 
2053  double con = 0.626657; // sqrt(pi/2)/2
2054  double arg = chi * chi / 4.;
2055 
2056  double besselOneHalf = ::sqrt(arg/halfpi) * sinh(arg)/arg;
2057  double besselThreeHalfs = ::sqrt(arg/halfpi) * (cosh(arg)/arg - sinh(arg)/(arg*arg));
2058  double besselFiveHalfs = besselOneHalf - 3*besselThreeHalfs/arg;
2059 
2060  Double_t res = con * chi * exp(-arg) * (besselThreeHalfs + besselFiveHalfs);
2061 
2062  return res;
2063 }
2064 
2065 //-----------------------------------------------------------------------
2066 
2067 Double_t chi(double res) {
2068  // Calculates chi from the event plane resolution
2069 
2070  double chi = 2.0;
2071  double delta = 1.0;
2072 
2073  for (int i = 0; i < 20; i++) {
2074  while(resEventPlane(chi) < res) {chi += delta;}
2075  delta = delta / 2.;
2076  while(resEventPlane(chi) > res) {chi -= delta;}
2077  delta = delta / 2.;
2078  }
2079 
2080  return chi;
2081 }
2082 
2083 //-----------------------------------------------------------------------
2084 
2086  // Calculates resolution and mean flow values
2087  // Outputs phiWgt and reCent values
2088 
2089  cout << endl << "##### Analysis Maker:" << endl;
2090  TString* histTitle;
2091 
2092  // PhiWgt histogram collection
2093  TOrdCollection* phiWgtHistNames = new TOrdCollection(Flow::nSels*Flow::nHars+3);
2094 
2095  // If mCalcReCentPars write out the recentering parameters and print the recentered values
2096  TOrdCollection* savedHistReCentNames = new TOrdCollection(Flow::nSels * Flow::nHars * 2);
2097  if (mCalcReCentPars) {
2098  Float_t reCentX, reCentY;
2099  cout << "ReCentered Q vector per particle:" << endl;
2100  for (int k = 0; k < Flow::nSels; k++) {
2101  for (int j = 0; j < Flow::nHars; j++) {
2102  savedHistReCentNames->AddLast(histFull[k].histFullHar[j].mHistReCentX);
2103  savedHistReCentNames->AddLast(histFull[k].histFullHar[j].mHistReCentY);
2104  reCentX = histFull[k].histFullHar[j].mHistQreCent->GetBinContent(1);
2105  reCentY = histFull[k].histFullHar[j].mHistQreCent->GetBinContent(2);
2106  cout << setprecision(3) << "Sel = " << k+1 << ", Har = " << j+1 << " : reCentedQ_x = "
2107  << reCentX << ",\t reCentedQ_y = " << reCentY << endl;
2108  }
2109  }
2110  }
2111  cout << endl;
2112 
2113  // Calculate resolution from sqrt(mHistCos)
2114  double cosPair[Flow::nSels][Flow::nHars];
2115  double cosPairErr[Flow::nSels][Flow::nHars];
2116  double content;
2117  double error;
2118  double totalError;
2119  for (int k = 0; k < Flow::nSels; k++) {
2120  // Create the 1D v histogram
2121  histTitle = new TString("Flow_v_Sel");
2122  *histTitle += k+1;
2123  histFull[k].mHist_v =
2124  histFull[k].mHist_vObs->ProjectionX(histTitle->Data());
2125  histFull[k].mHist_v->SetTitle(histTitle->Data());
2126  histFull[k].mHist_v->SetXTitle("Harmonic");
2127  histFull[k].mHist_v->SetYTitle("v (%)");
2128  delete histTitle;
2129  AddHist(histFull[k].mHist_v);
2130 
2131  for (int j = 0; j < Flow::nHars; j++) {
2132  double order = (double)(j+1);
2133  cosPair[k][j] = histFull[k].mHistCos->GetBinContent(j+1);
2134  cosPairErr[k][j] = histFull[k].mHistCos->GetBinError(j+1);
2135 
2136  if (pFlowEvent->UseZDCSMD()) { // ZDCSMD used to determine RP resolution
2137  double ZDCSMD_deltaResSub = 0.005,ZDCSMD_mResDelta=0.;
2138  double ZDCSMD_resSub = (histFull[k].mHistCos->GetBinContent(1)>0.) ?
2139  ::sqrt(histFull[k].mHistCos->GetBinContent(1)) : 0.;
2140  double ZDCSMD_resSubErr = (histFull[k].mHistCos->GetBinContent(1)>0.) ?
2141  histFull[k].mHistCos->GetBinError(1)/(2.*ZDCSMD_resSub) : 0.;
2142  double ZDCSMD_chiSub = chi(ZDCSMD_resSub);
2143  double ZDCSMD_chiSubDelta = chi((ZDCSMD_resSub+ZDCSMD_deltaResSub));
2144  if (j==0) {
2145  mRes[k][j] = resEventPlane(::sqrt(2.) * ZDCSMD_chiSub);
2146  ZDCSMD_mResDelta = resEventPlane(::sqrt(2.) * ZDCSMD_chiSubDelta);
2147  }
2148  if (j==1) {
2149  mRes[k][j] = resEventPlaneK2(::sqrt(2.) * ZDCSMD_chiSub);
2150  ZDCSMD_mResDelta = resEventPlaneK2(::sqrt(2.) * ZDCSMD_chiSubDelta);
2151  }
2152  if (j==2) {
2153  mRes[k][j] = resEventPlaneK3(::sqrt(2.) * ZDCSMD_chiSub);
2154  ZDCSMD_mResDelta = resEventPlaneK3(::sqrt(2.) * ZDCSMD_chiSubDelta);
2155  }
2156  if (j==3) {
2157  mRes[k][j] = resEventPlaneK4(::sqrt(2.) * ZDCSMD_chiSub);
2158  ZDCSMD_mResDelta = resEventPlaneK4(::sqrt(2.) * ZDCSMD_chiSubDelta);
2159  }
2160  mResErr[k][j] = ZDCSMD_resSubErr * fabs ((double)mRes[k][j]
2161  - ZDCSMD_mResDelta) / ZDCSMD_deltaResSub;
2162 
2163  }//UseZDCSMD
2164  else {
2165  if (cosPair[k][j] > 0.) {
2166  double resSub, resSubErr;
2167  double res2, res2error;
2168  if (mV1Ep1Ep2 == kTRUE && order == 1) { // mixed harmonics
2169  // calculate resolution of second order event plane first
2170  if (histFull[k].mHistCos->GetBinContent(2) > 0.) {
2171  if (histFull[k].mHistCos->GetBinContent(2) > 0.92) { // resolution saturates
2172  res2 = 0.99;
2173  res2error = 0.007;
2174  } else {
2175  double deltaRes2Sub = 0.005; // differential for the error propagation
2176  double res2Sub = ::sqrt(histFull[k].mHistCos->GetBinContent(2));
2177  double res2SubErr = histFull[k].mHistCos->GetBinError(2) / (2. * res2Sub);
2178  double chiSub2 = chi(res2Sub);
2179  double chiSub2Delta = chi(res2Sub + deltaRes2Sub);
2180  res2 = resEventPlane(::sqrt(2.) * chiSub2); // full event plane res.
2181  double mRes2Delta = resEventPlane(::sqrt(2.) * chiSub2Delta);
2182  res2error = res2SubErr * fabs((double)res2 - mRes2Delta)
2183  / deltaRes2Sub;
2184  }
2185  } else { // neg. corr.
2186  res2 = 0.;
2187  res2error = 0.;
2188  }
2189  // now put everything together with first order event plane
2190  mRes[k][j] = ::sqrt(cosPair[k][0]*res2);
2191  mResErr[k][j] = 1./(2.*mRes[k][j])*::sqrt(res2*res2*cosPairErr[k][0]*cosPairErr[k][0]
2192  + cosPair[k][0]*cosPair[k][0]*res2error*res2error); // Gaussian error propagation
2193  if (!pFlowEvent->EtaSubs()) {
2194  // correct to full event plane resolution
2195  // 1st order res for k=1 is small and linear
2196  mRes[k][j] *= ::sqrt(2.);
2197  mResErr[k][j] *= ::sqrt(2.);
2198  }
2199  } else if (pFlowEvent->EtaSubs() || pFlowEvent->RanSubs()) { // sub res only
2200  resSub = ::sqrt(cosPair[k][j]);
2201  resSubErr = cosPairErr[k][j] / (2. * resSub);
2202  mRes[k][j] = resSub;
2203  mResErr[k][j] = resSubErr;
2204  } else if (order==4. || order==6.|| order==8.) { // 2nd harmonic event plane
2205  double deltaResSub = 0.005; // differential for the error propagation
2206  double resSub = ::sqrt(cosPair[k][1]);
2207  double resSubErr = cosPairErr[k][1] / (2. * resSub);
2208  double chiSub = chi(resSub);
2209  double chiSubDelta = chi(resSub + deltaResSub);
2210  double mResDelta;
2211  if (order==4.) {
2212  mRes[k][j] = resEventPlaneK2(::sqrt(2.) * chiSub); // full event plane res.
2213  mResDelta = resEventPlaneK2(::sqrt(2.) * chiSubDelta);
2214  } else if (order==6.) {
2215  mRes[k][j] = resEventPlaneK3(::sqrt(2.) * chiSub); // full event plane res.
2216  mResDelta = resEventPlaneK3(::sqrt(2.) * chiSubDelta);
2217  } else {
2218  mRes[k][j] = resEventPlaneK4(::sqrt(2.) * chiSub); // full event plane res.
2219  mResDelta = resEventPlaneK4(::sqrt(2.) * chiSubDelta);
2220  }
2221  mResErr[k][j] = resSubErr * fabs((double)mRes[k][j] - mResDelta) / deltaResSub;
2222  } else { //normal case
2223  if (cosPair[k][j] > 0.92) { // resolution saturates
2224  mRes[k][j] = 0.99;
2225  mResErr[k][j] = 0.007;
2226  } else {
2227  double deltaResSub = 0.005; // differential for the error propagation
2228  double resSub = ::sqrt(cosPair[k][j]);
2229  double resSubErr = cosPairErr[k][j] / (2. * resSub);
2230  double chiSub = chi(resSub);
2231  double chiSubDelta = chi(resSub + deltaResSub);
2232  mRes[k][j] = resEventPlane(::sqrt(2.) * chiSub); // full event plane res.
2233  double mResDelta = resEventPlane(::sqrt(2.) * chiSubDelta);
2234  mResErr[k][j] = resSubErr * fabs((double)mRes[k][j] - mResDelta)
2235  / deltaResSub;
2236  }
2237  }
2238  } else { // subevent correlation must be positive
2239  mRes[k][j] = 0.;
2240  mResErr[k][j] = 0.;
2241  }
2242  }//else :standard way if(!pFlowEvent->UseZDCSMD())
2243  histFull[k].mHistRes->SetBinContent(j+1, mRes[k][j]);
2244  histFull[k].mHistRes->SetBinError(j+1, mResErr[k][j]);
2245 
2246  // Create the v 2D histogram
2247  histTitle = new TString("Flow_v2D_Sel");
2248  *histTitle += k+1;
2249  histTitle->Append("_Har");
2250  *histTitle += j+1;
2251  histFull[k].histFullHar[j].mHist_v2D =
2252  histFull[k].histFullHar[j].mHist_vObs2D->ProjectionXY(histTitle->Data());
2253  histFull[k].histFullHar[j].mHist_v2D->SetTitle(histTitle->Data());
2254  histFull[k].histFullHar[j].mHist_v2D->SetXTitle((char*)xLabel.Data());
2255  histFull[k].histFullHar[j].mHist_v2D->SetYTitle("Pt (GeV/c)");
2256  histFull[k].histFullHar[j].mHist_v2D->SetZTitle("v (%)");
2257  delete histTitle;
2258  AddHist(histFull[k].histFullHar[j].mHist_v2D);
2259 
2260  // Create the 1D v histograms
2261  histTitle = new TString("Flow_vEta_Sel");
2262  *histTitle += k+1;
2263  histTitle->Append("_Har");
2264  *histTitle += j+1;
2265  histFull[k].histFullHar[j].mHist_vEta =
2266  histFull[k].histFullHar[j].mHist_vObsEta->ProjectionX(histTitle->Data());
2267  histFull[k].histFullHar[j].mHist_vEta->SetTitle(histTitle->Data());
2268  histFull[k].histFullHar[j].mHist_vEta->SetXTitle((char*)xLabel.Data());
2269  histFull[k].histFullHar[j].mHist_vEta->SetYTitle("v (%)");
2270  delete histTitle;
2271  AddHist(histFull[k].histFullHar[j].mHist_vEta);
2272 
2273  TString* histTitle = new TString("Flow_vPt_Sel");
2274  *histTitle += k+1;
2275  histTitle->Append("_Har");
2276  *histTitle += j+1;
2277  histFull[k].histFullHar[j].mHist_vPt =
2278  histFull[k].histFullHar[j].mHist_vObsPt->ProjectionX(histTitle->Data());
2279  histFull[k].histFullHar[j].mHist_vPt->SetTitle(histTitle->Data());
2280  histFull[k].histFullHar[j].mHist_vPt->SetXTitle("Pt (GeV/c)");
2281  histFull[k].histFullHar[j].mHist_vPt->SetYTitle("v (%)");
2282  delete histTitle;
2283  AddHist(histFull[k].histFullHar[j].mHist_vPt);
2284 
2285  // Calulate v = vObs / Resolution
2286  if (mRes[k][j]) {
2287  cout << endl << "##### Resolution of the " << j+1 << "th harmonic = " <<
2288  mRes[k][j] << " +/- " << mResErr[k][j] << endl;
2289  // The systematic error of the resolution is not folded in.
2290  histFull[k].histFullHar[j].mHist_v2D-> Scale(1. / mRes[k][j]);
2291  histFull[k].histFullHar[j].mHist_vEta->Scale(1. / mRes[k][j]);
2292  histFull[k].histFullHar[j].mHist_vPt ->Scale(1. / mRes[k][j]);
2293  content = histFull[k].mHist_v->GetBinContent(j+1);
2294  content /= mRes[k][j];
2295  histFull[k].mHist_v->SetBinContent(j+1, content);
2296  // The systematic error of the resolution is folded in.
2297  error = histFull[k].mHist_v->GetBinError(j+1);
2298  error /= mRes[k][j];
2299  totalError = fabs(content) * ::sqrt((error/content)*(error/content) +
2300  (mResErr[k][j]/mRes[k][j])*(mResErr[k][j]/mRes[k][j]));
2301  histFull[k].mHist_v->SetBinError(j+1, totalError);
2302 
2303  // Calculate non-flatness correction
2304  TF1* funcCosSin = new TF1("funcCosSin",
2305  "[3]*(1.+[0]*2./100.*cos([2]*x)+[1]*2./100.*sin([2]*x))", 0., twopi);
2306  //funcCosSin->SetParNames("100*cos", "100*sin", "har");
2307  funcCosSin->SetParameters(0, 0, j+1); // initial values
2308  funcCosSin->SetParLimits(2, 1, 1); // har is fixed
2309  histFull[k].histFullHar[j].mHistPhiLab->Fit("funcCosSin","Q,N");
2310  Double_t cosParLab = funcCosSin->GetParameter(0);
2311  Double_t sinParLab = funcCosSin->GetParameter(1);
2312  histFull[k].histFullHar[j].mHistPsi->Fit("funcCosSin","Q,N");
2313  Double_t cosParEP = funcCosSin->GetParameter(0);
2314  Double_t sinParEP = funcCosSin->GetParameter(1);
2315  cout << "100*cosLab = " << cosParLab << ", 100*sinLab = " << sinParLab << endl;
2316  cout << "100*cosEP = " << cosParEP << ", 100*sinEP = " << sinParEP << endl;
2317  delete funcCosSin;
2318  float nonflat = (cosParEP*cosParLab + sinParEP*sinParLab)/mRes[k][j]/100.;
2319  cout << "nonflat = " << nonflat << endl;
2320 
2321  cout << "##### v" << j+1 << "= (" << content << " +/- " << error << ")%" << endl;
2322  cout << "##### v" << j+1 << "= (" << content - nonflat << " (with nonflat corr.) +/- "
2323  << totalError << " (with syst.) )%" << endl;
2324  histFull[k].mHist_v->SetBinContent(j+1, content - nonflat);
2325 
2326 
2327  } else {
2328  cout << "##### Resolution of the " << j+1 << "th harmonic was zero."
2329  << endl;
2330  histFull[k].histFullHar[j].mHist_v2D-> Reset();
2331  histFull[k].histFullHar[j].mHist_vEta->Reset();
2332  histFull[k].histFullHar[j].mHist_vPt ->Reset();
2333  histFull[k].mHist_v->SetBinContent(j+1, 0.);
2334  histFull[k].mHist_v->SetBinError(j+1, 0.);
2335  }//v
2336 
2337  // Calculate PhiWgt
2338  if (pFlowMaker->PhiWgtCalc()) {
2339  if (j < 2) {
2340  double meanFarEast = histFull[k].histTwoHar[j].mHistPhiFarEast->Integral()
2341  / (double)Flow::nPhiBins;
2342  double meanEast = histFull[k].histTwoHar[j].mHistPhiEast->Integral()
2343  / (double)Flow::nPhiBins;
2344  double meanWest = histFull[k].histTwoHar[j].mHistPhiWest->Integral()
2345  / (double)Flow::nPhiBins;
2346  double meanFarWest = histFull[k].histTwoHar[j].mHistPhiFarWest->Integral()
2347  / (double)Flow::nPhiBins;
2348  double meanFtpcFarEast = histFull[k].histTwoHar[j].mHistPhiFtpcFarEast->Integral()
2349  / (double)Flow::nPhiBinsFtpc;
2350  double meanFtpcEast = histFull[k].histTwoHar[j].mHistPhiFtpcEast->Integral()
2351  / (double)Flow::nPhiBinsFtpc;
2352  double meanFtpcWest = histFull[k].histTwoHar[j].mHistPhiFtpcWest->Integral()
2353  / (double)Flow::nPhiBinsFtpc;
2354  double meanFtpcFarWest = histFull[k].histTwoHar[j].mHistPhiFtpcFarWest->Integral()
2355  / (double)Flow::nPhiBinsFtpc;
2356 
2357  // Tpc
2358  for (int i = 0; i < Flow::nPhiBins; i++) {
2359  histFull[k].histTwoHar[j].mHistPhiWgtFarEast->SetBinContent(i+1,meanFarEast);
2360  histFull[k].histTwoHar[j].mHistPhiWgtFarEast->SetBinError(i+1, 0.);
2361  histFull[k].histTwoHar[j].mHistPhiWgtEast ->SetBinContent(i+1, meanEast);
2362  histFull[k].histTwoHar[j].mHistPhiWgtEast ->SetBinError(i+1, 0.);
2363  histFull[k].histTwoHar[j].mHistPhiWgtWest ->SetBinContent(i+1, meanWest);
2364  histFull[k].histTwoHar[j].mHistPhiWgtWest ->SetBinError(i+1, 0.);
2365  histFull[k].histTwoHar[j].mHistPhiWgtFarWest->SetBinContent(i+1,meanFarWest);
2366  histFull[k].histTwoHar[j].mHistPhiWgtFarWest->SetBinError(i+1, 0.);
2367  }
2368 
2369  // Ftpc
2370  for (int i = 0; i < Flow::nPhiBinsFtpc; i++) {
2371  histFull[k].histTwoHar[j].mHistPhiWgtFtpcFarEast->SetBinContent(i+1,meanFtpcFarEast);
2372  histFull[k].histTwoHar[j].mHistPhiWgtFtpcFarEast->SetBinError(i+1, 0.);
2373  histFull[k].histTwoHar[j].mHistPhiWgtFtpcEast ->SetBinContent(i+1,meanFtpcEast);
2374  histFull[k].histTwoHar[j].mHistPhiWgtFtpcEast ->SetBinError(i+1, 0.);
2375  histFull[k].histTwoHar[j].mHistPhiWgtFtpcWest ->SetBinContent(i+1,meanFtpcWest);
2376  histFull[k].histTwoHar[j].mHistPhiWgtFtpcWest ->SetBinError(i+1, 0.);
2377  histFull[k].histTwoHar[j].mHistPhiWgtFtpcFarWest->SetBinContent(i+1,meanFtpcFarWest);
2378  histFull[k].histTwoHar[j].mHistPhiWgtFtpcFarWest->SetBinError(i+1, 0.);
2379  }
2380 
2381  // Tpc
2382  histFull[k].histTwoHar[j].mHistPhiWgtFarEast->
2383  Divide(histFull[k].histTwoHar[j].mHistPhiFarEast);
2384  phiWgtHistNames->AddLast(histFull[k].histTwoHar[j].mHistPhiWgtFarEast);
2385  histFull[k].histTwoHar[j].mHistPhiWgtEast->
2386  Divide(histFull[k].histTwoHar[j].mHistPhiEast);
2387  phiWgtHistNames->AddLast(histFull[k].histTwoHar[j].mHistPhiWgtEast);
2388  histFull[k].histTwoHar[j].mHistPhiWgtWest->
2389  Divide(histFull[k].histTwoHar[j].mHistPhiWest);
2390  phiWgtHistNames->AddLast(histFull[k].histTwoHar[j].mHistPhiWgtWest);
2391  histFull[k].histTwoHar[j].mHistPhiWgtFarWest->
2392  Divide(histFull[k].histTwoHar[j].mHistPhiFarWest);
2393  phiWgtHistNames->AddLast(histFull[k].histTwoHar[j].mHistPhiWgtFarWest);
2394 
2395  // Ftpc
2396  histFull[k].histTwoHar[j].mHistPhiWgtFtpcFarEast->
2397  Divide(histFull[k].histTwoHar[j].mHistPhiFtpcFarEast);
2398  phiWgtHistNames->AddLast(histFull[k].histTwoHar[j].mHistPhiWgtFtpcFarEast);
2399  histFull[k].histTwoHar[j].mHistPhiWgtFtpcEast->
2400  Divide(histFull[k].histTwoHar[j].mHistPhiFtpcEast);
2401  phiWgtHistNames->AddLast(histFull[k].histTwoHar[j].mHistPhiWgtFtpcEast);
2402  histFull[k].histTwoHar[j].mHistPhiWgtFtpcWest->
2403  Divide(histFull[k].histTwoHar[j].mHistPhiFtpcWest);
2404  phiWgtHistNames->AddLast(histFull[k].histTwoHar[j].mHistPhiWgtFtpcWest);
2405  histFull[k].histTwoHar[j].mHistPhiWgtFtpcFarWest->
2406  Divide(histFull[k].histTwoHar[j].mHistPhiFtpcFarWest);
2407  phiWgtHistNames->AddLast(histFull[k].histTwoHar[j].mHistPhiWgtFtpcFarWest);
2408  }
2409  }//phiWgt
2410  }
2411  }
2412  phiWgtHistNames->AddLast(mHistZDCSMDPsiWgtEast);
2413  phiWgtHistNames->AddLast(mHistZDCSMDPsiWgtWest);
2414  TFile* pPhiWgtFile = new TFile("flowPhiWgt.hist.root", "READ");
2415  if (pPhiWgtFile->IsOpen())
2416  { phiWgtHistNames->AddLast(mHistZDCSMDPsiWgtFull); }
2417 
2418  // Write all histograms
2419  TFile histFile("flow.hist.root", "RECREATE");
2420  //GetHistList()->ls();
2421  GetHistList()->Write();
2422  histFile.Close();
2423 
2424  // Write PhiWgt histograms preceded by documenting text
2425  if (pFlowMaker->PhiWgtCalc()) {
2426  TFile phiWgtNewFile("flowPhiWgtNew.hist.root", "RECREATE");
2427  TText* textInfo = 0;
2428  if (pFlowEvent->FirstLastPoints()) {
2429  char chInfo[400];
2430  sprintf(chInfo, "%s%d%s%d%s", " pt weight= ", pFlowEvent->PtWgt(),
2431  ", eta weight= ", pFlowEvent->EtaWgt(), "\n");
2432  textInfo = new TText(0,0,chInfo);
2433  textInfo->Write("info");
2434  }
2435  phiWgtNewFile.cd();
2436  phiWgtHistNames->Write();
2437  phiWgtNewFile.Close();
2438  if (pFlowEvent->FirstLastPoints()) delete textInfo;
2439  }
2440  delete phiWgtHistNames;
2441 
2442  // Write reCent values
2443  if (mCalcReCentPars) {
2444  TFile fileReCent("flow.reCentAnaNew.root", "RECREATE");
2445  fileReCent.cd();
2446  savedHistReCentNames->Write();
2447  fileReCent.Close();
2448  }
2449  delete savedHistReCentNames;
2450 
2451  delete pFlowSelect;
2452 
2453  return StMaker::Finish();
2454 }
2455 
2456 //-----------------------------------------------------------------------
2457 
2458 void StFlowAnalysisMaker::SetHistoRanges(Bool_t ftpc_included) {
2459 
2460  if (ftpc_included) {
2461  mEtaMin = Flow::etaMin;
2462  mEtaMax = Flow::etaMax;
2463  mNEtaBins = Flow::nEtaBins;
2464  }
2465  else {
2466  mEtaMin = Flow::etaMinTpcOnly;
2467  mEtaMax = Flow::etaMaxTpcOnly;
2468  mNEtaBins = Flow::nEtaBinsTpcOnly;
2469  }
2470 
2471  return;
2472 }
2473 
2474 //------------------------------------------------------------------------
2475 
2476 void StFlowAnalysisMaker::SetPtRange_for_vEta(Float_t lo, Float_t hi) {
2477 
2478  // Sets the pt range for the v(eta) histograms.
2479 
2480  mPtRange_for_vEta[0] = lo;
2481  mPtRange_for_vEta[1] = hi;
2482 
2483  return;
2484 }
2485 
2486 //------------------------------------------------------------------------
2487 
2488 void StFlowAnalysisMaker::SetEtaRange_for_vPt(Float_t lo, Float_t hi) {
2489 
2490  // Sets the |eta| range for the v(pt) histograms.
2491 
2492  mEtaRange_for_vPt[0] = lo;
2493  mEtaRange_for_vPt[1] = hi;
2494 
2495  return;
2496 }
2497 
2498 //------------------------------------------------------------------------
2499 
2500 void StFlowAnalysisMaker::SetV1Ep1Ep2(Bool_t v1Ep1Ep2) {
2501 
2502  // Switches the v_1{EP1,EP2} calculation on/off.
2503 
2504  mV1Ep1Ep2 = v1Ep1Ep2;
2505 
2506  return;
2507 }
2508 
2509 
2511 //
2512 // $Log: StFlowAnalysisMaker.cxx,v $
2513 // Revision 1.103 2011/07/25 15:54:42 posk
2514 // Added correction for non-flatness of event plane.
2515 //
2516 // Revision 1.102 2011/03/10 18:56:20 posk
2517 // Added histogram for laboratory azimuthal distribution of particles.
2518 //
2519 // Revision 1.101 2010/09/30 19:28:09 posk
2520 // Instead of reversing the weight for negative pseudrapidity for odd harmonics,
2521 // it is now done only for the first harmonic.
2522 // Recentering is now done for all harmonics.
2523 //
2524 // Revision 1.100 2010/02/15 12:01:58 canson
2525 // Changed mHistCTBvsZDC2D from filling with ZDC_e + ZDC_e to filling with ZDC_e + ZDC_w
2526 //
2527 // Revision 1.99 2009/11/24 19:29:11 posk
2528 // Added reCenter to remove acceptance correlations as an option instead of phiWgt.
2529 //
2530 // Revision 1.98 2007/07/13 22:18:29 posk
2531 // Method chi() revised by Wang Gang: "With this modification,
2532 // it will give good results not only for realistic resolutions, but also
2533 // for res=1 and res=0."
2534 //
2535 // Revision 1.97 2007/02/06 19:00:39 posk
2536 // In Lee Yang Zeros method, introduced recentering of Q vector.
2537 // Reactivated eta symmetry cut.
2538 //
2539 // Revision 1.96 2006/07/10 21:03:48 posk
2540 // For profile histograms of v, changed the limits to -1000, 1000.
2541 //
2542 // Revision 1.95 2006/02/22 19:36:21 posk
2543 // Minor updates.
2544 //
2545 // Revision 1.94 2005/08/26 19:00:15 posk
2546 // plot style back to bold
2547 //
2548 // Revision 1.93 2005/08/05 20:13:35 posk
2549 // Improved first guess for qDist fit.
2550 //
2551 // Revision 1.92 2005/02/11 23:17:14 posk
2552 // Fixed trigger histogram.
2553 //
2554 // Revision 1.91 2005/02/08 22:37:53 posk
2555 // Fixed trigger histogram for year=4.
2556 //
2557 // Revision 1.90 2004/12/20 19:41:24 aihong
2558 // crashes when run without ZDCSMD. bug fixed
2559 //
2560 // Revision 1.89 2004/12/17 22:33:35 aihong
2561 // add in full Psi weight for ZDC SMD and fix a few bugs, done by Gang
2562 //
2563 // Revision 1.88 2004/12/09 23:47:05 posk
2564 // Minor changes in code formatting.
2565 // Added hist for TPC primary dca to AnalysisMaker.
2566 //
2567 // Revision 1.87 2004/12/07 23:10:19 posk
2568 // Only odd and even phiWgt hists. If the old phiWgt file contains more than
2569 // two harmonics, only the first two are read. Now writes only the first two.
2570 //
2571 // Revision 1.86 2004/08/24 20:22:36 oldi
2572 // Minor modifications to avoid compiler warnings.
2573 //
2574 // Revision 1.85 2004/08/18 00:18:59 oldi
2575 // Several changes were necessary to comply with latest changes of MuDsts and StEvent:
2576 //
2577 // nHits, nFitPoints, nMaxPoints
2578 // -----------------------------
2579 // From now on
2580 // - the fit points used in StFlowMaker are the fit points within the TPC xor FTPC (vertex excluded).
2581 // - the max. possible points used in StFlowMAker are the max. possible points within the TPC xor FTPC (vertex excluded).
2582 // - the number of points (nHits; not used for analyses so far) are the total number of points on a track, i. e.
2583 // TPC + SVT + SSD + FTPCeast + FTPCwest [reading from HBT event gives a warning, but it seems like nobody uses it anyhow].
2584 // - The fit/max plot (used to be (fit-1)/max) was updated accordingly.
2585 // - The default cuts for fit points were changed (only for the FTPC, since TPC doesn't set default cuts).
2586 // - All these changes are backward compatible, as long as you change your cuts for the fit points by 1 (the vertex used to
2587 // be included and is not included anymore). In other words, your results won't depend on old or new MuDst, StEvent,
2588 // PicoDsts as long as you use the new flow software (together with the latest MuDst and StEvent software version).
2589 // - For backward compatibility reasons the number of fit points which is written out to the flowpicoevent.root file
2590 // includes the vertex. It is subtracted internally while reading back the pico files. This is completely hidden from the
2591 // user.
2592 //
2593 // zFirstPoint
2594 // -----------
2595 // The positions of the first point of tracks which have points in the TPC can lie outside of the TPC (the tracks can start in
2596 // the SVT or SSD now). In this case, the first point of the track is obtained by extrapolating the track helix to the inner
2597 // radius of the TPC.
2598 //
2599 // Revision 1.84 2004/05/31 20:09:22 oldi
2600 // PicoDst format changed (Version 7) to hold ZDC SMD information.
2601 // Trigger cut modified to comply with TriggerCollections.
2602 // Centrality definition for 62 GeV data introduced.
2603 // Minor bug fixes.
2604 //
2605 // Revision 1.83 2004/05/05 21:13:47 aihong
2606 // Gang's code for ZDC-SMD added
2607 //
2608 // Revision 1.82 2004/03/11 18:00:03 posk
2609 // Added Random Subs analysis method.
2610 //
2611 // Revision 1.81 2003/12/12 02:34:40 oldi
2612 // Removal of some major bugs in the v1{EP1,EP2} method.
2613 //
2614 // Revision 1.80 2003/12/09 01:40:15 oldi
2615 // Removed 'inline' of some functions to cope with new compiler.
2616 //
2617 // Revision 1.79 2003/11/14 20:00:40 oldi
2618 // Implementation of v1{EP1,EP2}. This method is set to be the default for v1 now!
2619 // Minor code clean-ups.
2620 //
2621 // Revision 1.78 2003/09/02 17:58:10 perev
2622 // gcc 3.2 updates + WarnOff
2623 //
2624 // Revision 1.77 2003/08/26 21:10:10 posk
2625 // Calculates v8 if nHars=8.
2626 //
2627 // Revision 1.76 2003/08/06 20:54:06 oldi
2628 // Introduction of possibility to exclude pt ranges for v(eta) and eta regions
2629 // for v(pt) histograms. Default behavior stays the same (all available tracks
2630 // are included in v(pt) and v(eta)).
2631 //
2632 // Revision 1.75 2003/07/30 22:08:25 oldi
2633 // Several code fixes for EtaSym plots introduced (esp. the acceptance correction
2634 // is done now for 200 GeV data and for the FTPCs as well).
2635 // PtWgtSaturation parameter introduced.
2636 //
2637 // Revision 1.74 2003/07/07 21:58:16 posk
2638 // Made units of momentum GeV/c instead of GeV.
2639 //
2640 // Revision 1.73 2003/06/27 21:25:41 posk
2641 // v4 and v6 are with repect to the 2nd harmonic event plane.
2642 //
2643 // Revision 1.72 2003/05/16 20:44:46 posk
2644 // First commit of StFlowPhiWgtMaker
2645 //
2646 // Revision 1.71 2003/05/06 21:33:04 posk
2647 // Removed some histograms.
2648 //
2649 // Revision 1.70 2003/05/06 18:38:05 posk
2650 // Removed StFlowTagMaker.
2651 //
2652 // Revision 1.69 2003/01/16 16:02:27 posk
2653 // Some plotting changes.
2654 //
2655 // Revision 1.68 2003/01/10 16:40:16 oldi
2656 // Several changes to comply with FTPC tracks:
2657 // - Switch to include/exclude FTPC tracks introduced.
2658 // The same switch changes the range of the eta histograms.
2659 // - Eta symmetry plots for FTPC tracks added and separated from TPC plots.
2660 // - PhiWgts and related histograms for FTPC tracks split in FarEast, East,
2661 // West, FarWest (depending on vertex.z()).
2662 // - Psi_Diff plots for 2 different selections and the first 2 harmonics added.
2663 // - Cut to exclude mu-events with no primary vertex introduced.
2664 // (This is possible for UPC events and FTPC tracks.)
2665 // - Global DCA cut for FTPC tracks added.
2666 // - Global DCA cuts for event plane selection separated for TPC and FTPC tracks.
2667 // - Charge cut for FTPC tracks added.
2668 //
2669 // Revision 1.67 2003/01/08 19:28:07 posk
2670 // PhiWgt hists sorted on sign of z of first and last points.
2671 //
2672 // Revision 1.66 2002/10/28 19:45:52 posk
2673 // Eliminate events with Psi=0.
2674 //
2675 // Revision 1.65 2002/06/15 23:03:56 posk
2676 // Changed Fit/Max histogram to (Fit - 1)/Max.
2677 //
2678 // Revision 1.64 2002/05/23 18:57:08 posk
2679 // changed label on MultHist histogram
2680 //
2681 // Revision 1.63 2002/05/21 18:42:15 posk
2682 // Kirill's correction to minBias.C for bins with one count.
2683 //
2684 // Revision 1.62 2002/02/13 22:31:27 posk
2685 // Pt Weight now also weights Phi Weight. Added Eta Weught, default=FALSE.
2686 //
2687 // Revision 1.61 2002/01/31 01:09:10 posk
2688 // *** empty log message ***
2689 //
2690 // Revision 1.60 2002/01/14 23:42:21 posk
2691 // Renamed ScalerProd histograms. Moved print commands to FlowMaker::Finish().
2692 //
2693 // Revision 1.59 2001/12/18 19:27:06 posk
2694 // "proton" and "antiproton" replaced by "pr+" and "pr-".
2695 //
2696 // Revision 1.58 2001/12/11 22:03:41 posk
2697 // Four sets of phiWgt histograms.
2698 // StFlowMaker StFlowEvent::PhiWeight() changes.
2699 // Cumulant histogram names changed.
2700 //
2701 // Revision 1.57 2001/11/13 22:47:17 posk
2702 // Documentation updated. Fit to q function moved to macro.
2703 //
2704 // Revision 1.56 2001/11/10 01:09:05 posk
2705 // Moved some constants into StFlowConstants.
2706 //
2707 // Revision 1.55 2001/11/09 21:14:33 posk
2708 // Switched from CERNLIB to TMath. Using global dca instead of dca.
2709 //
2710 // Revision 1.54 2001/08/02 20:42:01 snelling
2711 // removed hist title conflict
2712 //
2713 // Revision 1.53 2001/08/02 17:41:49 snelling
2714 // Added trigger histogram
2715 //
2716 // Revision 1.52 2001/05/22 20:10:55 posk
2717 // Changed dEdx graphs.
2718 //
2719 // Revision 1.51 2001/04/25 17:43:24 perev
2720 // HPcorrs
2721 //
2722 // Revision 1.50 2001/04/03 17:46:06 oldi
2723 // Bug fix that excluded FTPC tracks from the determination of the reaction plane.
2724 //
2725 // Revision 1.49 2000/12/12 15:01:10 posk
2726 // Put log comments at end of file.
2727 //
2728 // Revision 1.48 2000/12/10 02:02:01 oldi
2729 // A new member (StTrackTopologyMap mTopology) was added to StFlowPicoTrack.
2730 // The evaluation of either a track originates from the FTPC or not is
2731 // unambiguous now. The evaluation itself is easily extendible for other
2732 // detectors (e.g. SVT+TPC). Old flowpicoevent.root files are treated as if
2733 // they contain TPC tracks only (backward compatibility).
2734 //
2735 // Revision 1.47 2000/12/08 17:04:09 oldi
2736 // Phi weights for both FTPCs included.
2737 //
2738 // Revision 1.43 2000/09/22 22:01:38 posk
2739 // Doubly integrated v now contains resolution error.
2740 //
2741 // Revision 1.42 2000/09/16 22:23:04 snelling
2742 // Auto magically switch to rapidity when identified particles are used
2743 //
2744 // Revision 1.41 2000/09/15 22:52:53 posk
2745 // Added Pt weighting for event plane calculation.
2746 //
2747 // Revision 1.40 2000/09/12 01:31:00 snelling
2748 // Added pid histograms for e- e+ and dbar
2749 //
2750 // Revision 1.39 2000/09/07 17:02:45 snelling
2751 // Made the hist file standard root compatible
2752 //
2753 // Revision 1.38 2000/09/05 16:12:12 snelling
2754 // Added the new particles to the pid histogram
2755 //
2756 // Revision 1.37 2000/08/31 18:50:29 posk
2757 // Added plotCen.C to plot from a series of files with different centralities.
2758 //
2759 // Revision 1.36 2000/08/12 20:20:13 posk
2760 // More centrality bins.
2761 //
2762 // Revision 1.35 2000/08/09 21:38:59 snelling
2763 // Added monitor histograms
2764 //
2765 // Revision 1.34 2000/08/01 21:51:18 posk
2766 // Added doubly integrated v.
2767 //
2768 // Revision 1.33 2000/07/12 17:49:37 posk
2769 // Changed EtaSym plots.
2770 //
2771 // Revision 1.32 2000/06/30 14:51:18 posk
2772 // Using MessageMgr. Added graph for Eta Symmetry vs. Vertex Z.
2773 //
2774 // Revision 1.31 2000/06/01 18:29:56 posk
2775 // When resolution=0 reset histograms.
2776 //
2777 // Revision 1.30 2000/05/26 21:25:20 posk
2778 // Use TProfile2D class and profile projection methods.
2779 // Correction needed for >2 subevents.
2780 //
2781 // Revision 1.27 2000/04/13 22:34:13 posk
2782 // Resolution correction is now made.
2783 //
2784 // Revision 1.26 2000/03/28 23:25:36 posk
2785 // Allow multiple instances.
2786 //
2787 // Revision 1.25 2000/03/21 00:24:43 posk
2788 // Added GetCVS and changed some plot names.
2789 //
2790 // Revision 1.24 2000/03/15 23:32:03 posk
2791 // Added StFlowSelection.
2792 //
2793 // Revision 1.23 2000/03/02 22:55:32 posk
2794 // Changed header file extensions from .hh to .h .
2795 //
2796 // Revision 1.22 2000/02/29 21:55:12 posk
2797 // Removed static const int& statements.
2798 //
2799 // Revision 1.21 2000/02/18 23:44:52 posk
2800 // Added PID and centrality.
2801 //
2802 // Revision 1.20 2000/02/10 01:47:30 snelling
2803 // Make changes for HP compiler
2804 //
2805 // Revision 1.19 2000/02/04 16:26:41 posk
2806 // Added correct calculation of event plane resolution for large flow.
2807 //
2808 // Revision 1.15 2000/01/14 01:35:52 snelling
2809 // changed include path ../FlowMaker/ to FlowMaker/
2810 //
2811 // Revision 1.14 2000/01/14 01:13:34 snelling
2812 // modified spt (sum pt) to mpt (mean pt) because FlowTag changed
2813 //
2814 // Revision 1.11 1999/12/04 00:15:39 posk
2815 // Works with StFlowEvent which works with the new StEvent
2816 //
2817 // Revision 1.10 1999/11/24 18:14:05 posk
2818 // Now reads event quantities with StFlowEvent methods
2819 //
2820 // Revision 1.8 1999/11/05 00:02:02 posk
2821 // Changed the flow vector, Q, to a TVector2.
2822 //
2823 // Revision 1.7 1999/10/05 16:54:07 posk
2824 // Added getPhiWeight method for making the event plane isotropic.
2825 //
2826 // Revision 1.6 1999/09/24 01:23:06 fisyak
2827 // Reduced Include Path
2828 //
2829 // Revision 1.4 1999/09/03 01:05:59 fisyak
2830 // replace iostream/stdlib by Stiostream.h/stdlib.h
2831 //
2832 // Revision 1.3 1999/08/24 18:02:37 posk
2833 // Calculates event plane resolution.
2834 // Added macros for plotting histograms.
2835 //
2836 // Revision 1.1.1.1 1999/08/09 19:50:37 posk
2837 //
2838 // Revision 1.0 1999/08/02
2839 //
StFlowAnalysisMaker(const Char_t *name="FlowAnalysis")
Default constructor.
Definition: Stypes.h:40
virtual Int_t Finish()
Definition: StMaker.cxx:776