StFlowAnalysisMaker.cxx 115 KB

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