StFlowPhiWgtMaker.cxx 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601
  1. ////////////////////////////////////////////////////////////////////////////
  2. //
  3. // $Id: StFlowPhiWgtMaker.cxx,v 1.7 2004/12/09 23:47:09 posk Exp $
  4. //
  5. // Authors: Art Poskanzer and Jamie Dunlop, May 2003
  6. //
  7. ////////////////////////////////////////////////////////////////////////////
  8. //
  9. // Description: Maker to produce PhiWgt files for odd and even harmonics
  10. // using StFlowEvent
  11. //
  12. ////////////////////////////////////////////////////////////////////////////
  13. #include <Stiostream.h>
  14. #include <stdlib.h>
  15. #include <math.h>
  16. #include "StMaker.h"
  17. #include "StFlowPhiWgtMaker.h"
  18. #include "StFlowMaker/StFlowMaker.h"
  19. #include "StFlowMaker/StFlowEvent.h"
  20. #include "StFlowMaker/StFlowConstants.h"
  21. #include "StFlowMaker/StFlowSelection.h"
  22. #include "PhysicalConstants.h"
  23. #include "TFile.h"
  24. #include "TString.h"
  25. #include "TH1.h"
  26. #include "TOrdCollection.h"
  27. #include "StMessMgr.h"
  28. #include "TText.h"
  29. #define PR(x) cout << "##### FlowPhiWgt: " << (#x) << " = " << (x) << endl;
  30. ClassImp(StFlowPhiWgtMaker)
  31. //-----------------------------------------------------------------------
  32. StFlowPhiWgtMaker::StFlowPhiWgtMaker(const Char_t* name): StMaker(name),
  33. MakerName(name) {
  34. pFlowSelect = new StFlowSelection();
  35. }
  36. //-----------------------------------------------------------------------
  37. StFlowPhiWgtMaker::~StFlowPhiWgtMaker() {
  38. }
  39. //-----------------------------------------------------------------------
  40. Int_t StFlowPhiWgtMaker::Make() {
  41. // Make histograms
  42. // Get a pointer to StFlowEvent
  43. StFlowMaker* pFlowMaker = NULL;
  44. pFlowMaker = (StFlowMaker*)GetMaker("Flow");
  45. if (pFlowMaker) pFlowEvent = pFlowMaker->FlowEventPointer();
  46. if (pFlowEvent && pFlowSelect->Select(pFlowEvent)) { // event selected
  47. FillParticleHistograms(); // fill particle histograms
  48. } else {
  49. gMessMgr->Info("##### FlowPhiWgt: FlowEvent pointer null");
  50. return kStOK;
  51. }
  52. if (Debug()) StMaker::PrintInfo();
  53. return kStOK;
  54. }
  55. //-----------------------------------------------------------------------
  56. Int_t StFlowPhiWgtMaker::Init() {
  57. // Create the files
  58. TString* fileName;
  59. for (int n = 1; n < nCens; n++) {
  60. fileName = new TString("flowPhiWgt");
  61. *fileName += n;
  62. fileName->Append(".root");
  63. phiWgtFile[n] = new TFile(fileName->Data(), "RECREATE");
  64. delete fileName;
  65. }
  66. // Book histograms
  67. const float phiMin = 0.;
  68. const float phiMax = twopi;
  69. TString* histTitle;
  70. //ZDCSMD Phi Weight
  71. mHistZDCSMDPsiWgtEast = new TH1F("Flow_ZDCSMDPsiWgtEast","Flow_ZDCSMDPsiWgtEast",
  72. Flow::zdcsmd_nPsiBins,-twopi/2.,twopi/2.);
  73. mHistZDCSMDPsiWgtWest = new TH1F("Flow_ZDCSMDPsiWgtWest","Flow_ZDCSMDPsiWgtWest",
  74. Flow::zdcsmd_nPsiBins,-twopi/2.,twopi/2.);
  75. // for each centrality
  76. for (int n = 1; n < nCens; n++) {
  77. phiWgtFile[n]->cd(); // each file is a directory
  78. // for each selection
  79. for (int k = 0; k < Flow::nSels; k++) {
  80. // for each harmonic
  81. for (int j = 0; j < 2; j++) {
  82. // Phi lab
  83. // Tpc (FarEast)
  84. histTitle = new TString("Flow_Phi_FarEast_Sel");
  85. *histTitle += k+1;
  86. histTitle->Append("_Har");
  87. *histTitle += j+1;
  88. hist[k].histCen[n].histHar[j].mHistPhiFarEast =
  89. new TH1D(histTitle->Data(), histTitle->Data(), Flow::nPhiBins, phiMin, phiMax);
  90. hist[k].histCen[n].histHar[j].mHistPhiFarEast->SetXTitle
  91. ("Azimuthal Angles (rad)");
  92. hist[k].histCen[n].histHar[j].mHistPhiFarEast->SetYTitle("Counts");
  93. delete histTitle;
  94. // Tpc (East)
  95. histTitle = new TString("Flow_Phi_East_Sel");
  96. *histTitle += k+1;
  97. histTitle->Append("_Har");
  98. *histTitle += j+1;
  99. hist[k].histCen[n].histHar[j].mHistPhiEast =
  100. new TH1D(histTitle->Data(), histTitle->Data(), Flow::nPhiBins, phiMin, phiMax);
  101. hist[k].histCen[n].histHar[j].mHistPhiEast->SetXTitle
  102. ("Azimuthal Angles (rad)");
  103. hist[k].histCen[n].histHar[j].mHistPhiEast->SetYTitle("Counts");
  104. delete histTitle;
  105. // Tpc (West)
  106. histTitle = new TString("Flow_Phi_West_Sel");
  107. *histTitle += k+1;
  108. histTitle->Append("_Har");
  109. *histTitle += j+1;
  110. hist[k].histCen[n].histHar[j].mHistPhiWest =
  111. new TH1D(histTitle->Data(), histTitle->Data(), Flow::nPhiBins, phiMin, phiMax);
  112. hist[k].histCen[n].histHar[j].mHistPhiWest->SetXTitle
  113. ("Azimuthal Angles (rad)");
  114. hist[k].histCen[n].histHar[j].mHistPhiWest->SetYTitle("Counts");
  115. delete histTitle;
  116. // Tpc (FarWest)
  117. histTitle = new TString("Flow_Phi_FarWest_Sel");
  118. *histTitle += k+1;
  119. histTitle->Append("_Har");
  120. *histTitle += j+1;
  121. hist[k].histCen[n].histHar[j].mHistPhiFarWest =
  122. new TH1D(histTitle->Data(), histTitle->Data(), Flow::nPhiBins, phiMin, phiMax);
  123. hist[k].histCen[n].histHar[j].mHistPhiFarWest->SetXTitle
  124. ("Azimuthal Angles (rad)");
  125. hist[k].histCen[n].histHar[j].mHistPhiFarWest->SetYTitle("Counts");
  126. delete histTitle;
  127. // Ftpc (FarEast)
  128. histTitle = new TString("Flow_Phi_FtpcFarEast_Sel");
  129. *histTitle += k+1;
  130. histTitle->Append("_Har");
  131. *histTitle += j+1;
  132. hist[k].histCen[n].histHar[j].mHistPhiFtpcFarEast =
  133. new TH1D(histTitle->Data(), histTitle->Data(), Flow::nPhiBinsFtpc, phiMin, phiMax);
  134. hist[k].histCen[n].histHar[j].mHistPhiFtpcFarEast->SetXTitle
  135. ("Azimuthal Angles (rad)");
  136. hist[k].histCen[n].histHar[j].mHistPhiFtpcFarEast->SetYTitle("Counts");
  137. delete histTitle;
  138. // Ftpc (East)
  139. histTitle = new TString("Flow_Phi_FtpcEast_Sel");
  140. *histTitle += k+1;
  141. histTitle->Append("_Har");
  142. *histTitle += j+1;
  143. hist[k].histCen[n].histHar[j].mHistPhiFtpcEast =
  144. new TH1D(histTitle->Data(), histTitle->Data(), Flow::nPhiBinsFtpc, phiMin, phiMax);
  145. hist[k].histCen[n].histHar[j].mHistPhiFtpcEast->SetXTitle
  146. ("Azimuthal Angles (rad)");
  147. hist[k].histCen[n].histHar[j].mHistPhiFtpcEast->SetYTitle("Counts");
  148. delete histTitle;
  149. // Ftpc (West)
  150. histTitle = new TString("Flow_Phi_FtpcWest_Sel");
  151. *histTitle += k+1;
  152. histTitle->Append("_Har");
  153. *histTitle += j+1;
  154. hist[k].histCen[n].histHar[j].mHistPhiFtpcWest =
  155. new TH1D(histTitle->Data(), histTitle->Data(), Flow::nPhiBinsFtpc, phiMin, phiMax);
  156. hist[k].histCen[n].histHar[j].mHistPhiFtpcWest->SetXTitle
  157. ("Azimuthal Angles (rad)");
  158. hist[k].histCen[n].histHar[j].mHistPhiFtpcWest->SetYTitle("Counts");
  159. delete histTitle;
  160. // Ftpc (FarWest)
  161. histTitle = new TString("Flow_Phi_FtpcFarWest_Sel");
  162. *histTitle += k+1;
  163. histTitle->Append("_Har");
  164. *histTitle += j+1;
  165. hist[k].histCen[n].histHar[j].mHistPhiFtpcFarWest =
  166. new TH1D(histTitle->Data(), histTitle->Data(), Flow::nPhiBinsFtpc, phiMin, phiMax);
  167. hist[k].histCen[n].histHar[j].mHistPhiFtpcFarWest->SetXTitle
  168. ("Azimuthal Angles (rad)");
  169. hist[k].histCen[n].histHar[j].mHistPhiFtpcFarWest->SetYTitle("Counts");
  170. delete histTitle;
  171. // PhiWgt new
  172. // Tpc (FarEast)
  173. histTitle = new TString("Flow_Phi_Weight_FarEast_Sel");
  174. *histTitle += k+1;
  175. histTitle->Append("_Har");
  176. *histTitle += j+1;
  177. hist[k].histCen[n].histHar[j].mHistPhiWgtFarEast =
  178. new TH1D(histTitle->Data(), histTitle->Data(), Flow::nPhiBins, phiMin, phiMax);
  179. hist[k].histCen[n].histHar[j].mHistPhiWgtFarEast->Sumw2();
  180. hist[k].histCen[n].histHar[j].mHistPhiWgtFarEast->SetXTitle
  181. ("Azimuthal Angles (rad)");
  182. hist[k].histCen[n].histHar[j].mHistPhiWgtFarEast->SetYTitle("PhiWgt");
  183. delete histTitle;
  184. // Tpc (East)
  185. histTitle = new TString("Flow_Phi_Weight_East_Sel");
  186. *histTitle += k+1;
  187. histTitle->Append("_Har");
  188. *histTitle += j+1;
  189. hist[k].histCen[n].histHar[j].mHistPhiWgtEast =
  190. new TH1D(histTitle->Data(), histTitle->Data(), Flow::nPhiBins, phiMin, phiMax);
  191. hist[k].histCen[n].histHar[j].mHistPhiWgtEast->Sumw2();
  192. hist[k].histCen[n].histHar[j].mHistPhiWgtEast->SetXTitle
  193. ("Azimuthal Angles (rad)");
  194. hist[k].histCen[n].histHar[j].mHistPhiWgtEast->SetYTitle("PhiWgt");
  195. delete histTitle;
  196. // Tpc (West)
  197. histTitle = new TString("Flow_Phi_Weight_West_Sel");
  198. *histTitle += k+1;
  199. histTitle->Append("_Har");
  200. *histTitle += j+1;
  201. hist[k].histCen[n].histHar[j].mHistPhiWgtWest =
  202. new TH1D(histTitle->Data(), histTitle->Data(), Flow::nPhiBins, phiMin, phiMax);
  203. hist[k].histCen[n].histHar[j].mHistPhiWgtWest->Sumw2();
  204. hist[k].histCen[n].histHar[j].mHistPhiWgtWest->SetXTitle
  205. ("Azimuthal Angles (rad)");
  206. hist[k].histCen[n].histHar[j].mHistPhiWgtWest->SetYTitle("PhiWgt");
  207. delete histTitle;
  208. // Tpc (FarWest)
  209. histTitle = new TString("Flow_Phi_Weight_FarWest_Sel");
  210. *histTitle += k+1;
  211. histTitle->Append("_Har");
  212. *histTitle += j+1;
  213. hist[k].histCen[n].histHar[j].mHistPhiWgtFarWest =
  214. new TH1D(histTitle->Data(), histTitle->Data(), Flow::nPhiBins, phiMin, phiMax);
  215. hist[k].histCen[n].histHar[j].mHistPhiWgtFarWest->Sumw2();
  216. hist[k].histCen[n].histHar[j].mHistPhiWgtFarWest->SetXTitle
  217. ("Azimuthal Angles (rad)");
  218. hist[k].histCen[n].histHar[j].mHistPhiWgtFarWest->SetYTitle("PhiWgt");
  219. delete histTitle;
  220. // Ftpc (FarEast)
  221. histTitle = new TString("Flow_Phi_Weight_FtpcFarEast_Sel");
  222. *histTitle += k+1;
  223. histTitle->Append("_Har");
  224. *histTitle += j+1;
  225. hist[k].histCen[n].histHar[j].mHistPhiWgtFtpcFarEast =
  226. new TH1D(histTitle->Data(), histTitle->Data(), Flow::nPhiBinsFtpc, phiMin, phiMax);
  227. hist[k].histCen[n].histHar[j].mHistPhiWgtFtpcFarEast->Sumw2();
  228. hist[k].histCen[n].histHar[j].mHistPhiWgtFtpcFarEast->SetXTitle
  229. ("Azimuthal Angles (rad)");
  230. hist[k].histCen[n].histHar[j].mHistPhiWgtFtpcFarEast->SetYTitle("PhiWgt");
  231. delete histTitle;
  232. // Ftpc (East)
  233. histTitle = new TString("Flow_Phi_Weight_FtpcEast_Sel");
  234. *histTitle += k+1;
  235. histTitle->Append("_Har");
  236. *histTitle += j+1;
  237. hist[k].histCen[n].histHar[j].mHistPhiWgtFtpcEast =
  238. new TH1D(histTitle->Data(), histTitle->Data(), Flow::nPhiBinsFtpc, phiMin, phiMax);
  239. hist[k].histCen[n].histHar[j].mHistPhiWgtFtpcEast->Sumw2();
  240. hist[k].histCen[n].histHar[j].mHistPhiWgtFtpcEast->SetXTitle
  241. ("Azimuthal Angles (rad)");
  242. hist[k].histCen[n].histHar[j].mHistPhiWgtFtpcEast->SetYTitle("PhiWgt");
  243. delete histTitle;
  244. // Ftpc (West)
  245. histTitle = new TString("Flow_Phi_Weight_FtpcWest_Sel");
  246. *histTitle += k+1;
  247. histTitle->Append("_Har");
  248. *histTitle += j+1;
  249. hist[k].histCen[n].histHar[j].mHistPhiWgtFtpcWest =
  250. new TH1D(histTitle->Data(), histTitle->Data(), Flow::nPhiBinsFtpc, phiMin, phiMax);
  251. hist[k].histCen[n].histHar[j].mHistPhiWgtFtpcWest->Sumw2();
  252. hist[k].histCen[n].histHar[j].mHistPhiWgtFtpcWest->SetXTitle
  253. ("Azimuthal Angles (rad)");
  254. hist[k].histCen[n].histHar[j].mHistPhiWgtFtpcWest->SetYTitle("PhiWgt");
  255. delete histTitle;
  256. // Ftpc (FarWest)
  257. histTitle = new TString("Flow_Phi_Weight_FtpcFarWest_Sel");
  258. *histTitle += k+1;
  259. histTitle->Append("_Har");
  260. *histTitle += j+1;
  261. hist[k].histCen[n].histHar[j].mHistPhiWgtFtpcFarWest =
  262. new TH1D(histTitle->Data(), histTitle->Data(), Flow::nPhiBinsFtpc, phiMin, phiMax);
  263. hist[k].histCen[n].histHar[j].mHistPhiWgtFtpcFarWest->Sumw2();
  264. hist[k].histCen[n].histHar[j].mHistPhiWgtFtpcFarWest->SetXTitle
  265. ("Azimuthal Angles (rad)");
  266. hist[k].histCen[n].histHar[j].mHistPhiWgtFtpcFarWest->SetYTitle("PhiWgt");
  267. delete histTitle;
  268. }
  269. }
  270. }
  271. gMessMgr->SetLimit("##### FlowPhiWgt", 2);
  272. gMessMgr->Info("##### FlowPhiWgt: $Id: StFlowPhiWgtMaker.cxx,v 1.7 2004/12/09 23:47:09 posk Exp $");
  273. return StMaker::Init();
  274. }
  275. //-----------------------------------------------------------------------
  276. void StFlowPhiWgtMaker::FillParticleHistograms() {
  277. // Fill histograms with event quantities
  278. mHistZDCSMDPsiWgtEast->Fill(pFlowEvent->ZDCSMD_PsiEst());
  279. mHistZDCSMDPsiWgtWest->Fill(pFlowEvent->ZDCSMD_PsiWst());
  280. // Fill histograms from the particles
  281. // Centrality and vertex of this event
  282. int iCen = pFlowEvent->Centrality();
  283. if (!iCen) { return; } // skip centrality = 0
  284. Float_t vertexZ = pFlowEvent->VertexPos().z();
  285. // Initialize Iterator
  286. StFlowTrackCollection* pFlowTracks = pFlowEvent->TrackCollection();
  287. StFlowTrackIterator itr;
  288. for (itr = pFlowTracks->begin(); itr != pFlowTracks->end(); itr++) {
  289. StFlowTrack* pFlowTrack = *itr;
  290. float phi = pFlowTrack->Phi();
  291. if (phi < 0.) phi += twopi;
  292. float eta = pFlowTrack->Eta();
  293. float pt = pFlowTrack->Pt();
  294. float zFirstPoint = 0.;
  295. float zLastPoint = 0.;
  296. if (pFlowEvent->FirstLastPoints()) {
  297. zFirstPoint = pFlowTrack->ZFirstPoint();
  298. zLastPoint = pFlowTrack->ZLastPoint();
  299. }
  300. StTrackTopologyMap map = pFlowTrack->TopologyMap();
  301. for (int k = 0; k < Flow::nSels; k++) {
  302. pFlowSelect->SetSelection(k);
  303. for (int j = 0; j < 2; j++) {
  304. bool oddHar = (j+1) % 2;
  305. pFlowSelect->SetHarmonic(j);
  306. if (pFlowSelect->Select(pFlowTrack)) {
  307. // Get detID
  308. Bool_t kTpcFarEast = kFALSE;
  309. Bool_t kTpcEast = kFALSE;
  310. Bool_t kTpcWest = kFALSE;
  311. Bool_t kTpcFarWest = kFALSE;
  312. Bool_t kFtpcFarEast = kFALSE;
  313. Bool_t kFtpcEast = kFALSE;
  314. Bool_t kFtpcWest = kFALSE;
  315. Bool_t kFtpcFarWest = kFALSE;
  316. if (map.hasHitInDetector(kTpcId) || (map.data(0) == 0 && map.data(1) == 0)) {
  317. // Tpc track, or TopologyMap not available
  318. // Set TpcEast and West
  319. if (pFlowEvent->FirstLastPoints()) {
  320. if (zFirstPoint > 0. && zLastPoint > 0.) {
  321. kTpcFarWest = kTRUE;
  322. } else if (zFirstPoint > 0. && zLastPoint < 0.) {
  323. kTpcWest = kTRUE;
  324. } else if (zFirstPoint < 0. && zLastPoint > 0.) {
  325. kTpcEast = kTRUE;
  326. } else {
  327. kTpcFarEast = kTRUE;
  328. }
  329. } else {
  330. if (eta > 0. && vertexZ > 0.) {
  331. kTpcFarWest = kTRUE;
  332. } else if (eta > 0. && vertexZ < 0.) {
  333. kTpcWest = kTRUE;
  334. } else if (eta < 0. && vertexZ > 0.) {
  335. kTpcEast = kTRUE;
  336. } else {
  337. kTpcFarEast = kTRUE;
  338. }
  339. }
  340. } else if (map.trackFtpcEast()) {
  341. if (vertexZ > 0.) {
  342. kFtpcEast = kTRUE;
  343. } else { // vertexZ < 0.
  344. kFtpcFarEast = kTRUE;
  345. }
  346. } else if (map.trackFtpcWest()) {
  347. if (vertexZ > 0.) {
  348. kFtpcFarWest = kTRUE;
  349. } else { // vertexZ < 0.
  350. kFtpcWest = kTRUE;
  351. }
  352. }
  353. // Calculate weights for filling histograms
  354. float wt = 1.;
  355. if (pFlowEvent->PtWgt()) {
  356. wt *= (pt < pFlowEvent->PtWgtSaturation()) ? pt : pFlowEvent->PtWgtSaturation(); // pt weighting going constant
  357. }
  358. float etaAbs = fabs(eta);
  359. if (pFlowEvent->EtaWgt() && oddHar && etaAbs > 1.) { wt *= etaAbs; }
  360. // Fill histograms
  361. if (kFtpcFarEast) {
  362. hist[k].histCen[iCen].histHar[j].mHistPhiFtpcFarEast->Fill(phi,wt);
  363. } else if (kFtpcEast) {
  364. hist[k].histCen[iCen].histHar[j].mHistPhiFtpcEast->Fill(phi,wt);
  365. } else if (kFtpcWest) {
  366. hist[k].histCen[iCen].histHar[j].mHistPhiFtpcWest->Fill(phi,wt);
  367. } else if (kFtpcFarWest) {
  368. hist[k].histCen[iCen].histHar[j].mHistPhiFtpcFarWest->Fill(phi,wt);
  369. } else if (kTpcFarEast){
  370. hist[k].histCen[iCen].histHar[j].mHistPhiFarEast->Fill(phi,wt);
  371. } else if (kTpcEast){
  372. hist[k].histCen[iCen].histHar[j].mHistPhiEast->Fill(phi,wt);
  373. } else if (kTpcWest){
  374. hist[k].histCen[iCen].histHar[j].mHistPhiWest->Fill(phi,wt);
  375. } else if (kTpcFarWest){
  376. hist[k].histCen[iCen].histHar[j].mHistPhiFarWest->Fill(phi,wt);
  377. }
  378. }
  379. }
  380. }
  381. }
  382. }
  383. //-----------------------------------------------------------------------
  384. Int_t StFlowPhiWgtMaker::Finish() {
  385. // Outputs phiWgt values
  386. // PhiWgt histogram collections
  387. TOrdCollection* phiWgtHistNames[nCens];
  388. for (int n = 1; n < nCens; n++) {
  389. phiWgtHistNames[n] = new TOrdCollection(Flow::nSels*2 + 2);
  390. }
  391. cout << endl << "##### PhiWgt Maker:" << endl;
  392. for (int n = 1; n < nCens; n++) {
  393. for (int k = 0; k < Flow::nSels; k++) {
  394. for (int j = 0; j < 2; j++) {
  395. // Calculate PhiWgt
  396. double meanFarEast = hist[k].histCen[n].histHar[j].mHistPhiFarEast->
  397. Integral() / (double)Flow::nPhiBins;
  398. double meanEast = hist[k].histCen[n].histHar[j].mHistPhiEast->
  399. Integral() / (double)Flow::nPhiBins;
  400. double meanWest = hist[k].histCen[n].histHar[j].mHistPhiWest->
  401. Integral() / (double)Flow::nPhiBins;
  402. double meanFarWest = hist[k].histCen[n].histHar[j].mHistPhiFarWest->
  403. Integral() / (double)Flow::nPhiBins;
  404. double meanFtpcFarEast = hist[k].histCen[n].histHar[j].mHistPhiFtpcFarEast->
  405. Integral() / (double)Flow::nPhiBinsFtpc;
  406. double meanFtpcEast = hist[k].histCen[n].histHar[j].mHistPhiFtpcEast->
  407. Integral() / (double)Flow::nPhiBinsFtpc;
  408. double meanFtpcWest = hist[k].histCen[n].histHar[j].mHistPhiFtpcWest->
  409. Integral() / (double)Flow::nPhiBinsFtpc;
  410. double meanFtpcFarWest = hist[k].histCen[n].histHar[j].mHistPhiFtpcFarWest->
  411. Integral() / (double)Flow::nPhiBinsFtpc;
  412. // Tpc
  413. for (int i = 0; i < Flow::nPhiBins; i++) {
  414. hist[k].histCen[n].histHar[j].mHistPhiWgtFarEast->
  415. SetBinContent(i+1,meanFarEast);
  416. hist[k].histCen[n].histHar[j].mHistPhiWgtFarEast->
  417. SetBinError(i+1, 0.);
  418. hist[k].histCen[n].histHar[j].mHistPhiWgtEast->
  419. SetBinContent(i+1, meanEast);
  420. hist[k].histCen[n].histHar[j].mHistPhiWgtEast->
  421. SetBinError(i+1, 0.);
  422. hist[k].histCen[n].histHar[j].mHistPhiWgtWest->
  423. SetBinContent(i+1, meanWest);
  424. hist[k].histCen[n].histHar[j].mHistPhiWgtWest->
  425. SetBinError(i+1, 0.);
  426. hist[k].histCen[n].histHar[j].mHistPhiWgtFarWest->
  427. SetBinContent(i+1,meanFarWest);
  428. hist[k].histCen[n].histHar[j].mHistPhiWgtFarWest->
  429. SetBinError(i+1, 0.);
  430. }
  431. // Ftpc
  432. for (int i = 0; i < Flow::nPhiBinsFtpc; i++) {
  433. hist[k].histCen[n].histHar[j].mHistPhiWgtFtpcFarEast->
  434. SetBinContent(i+1, meanFtpcFarEast);
  435. hist[k].histCen[n].histHar[j].mHistPhiWgtFtpcFarEast->
  436. SetBinError(i+1, 0.);
  437. hist[k].histCen[n].histHar[j].mHistPhiWgtFtpcEast->
  438. SetBinContent(i+1, meanFtpcEast);
  439. hist[k].histCen[n].histHar[j].mHistPhiWgtFtpcEast->
  440. SetBinError(i+1, 0.);
  441. hist[k].histCen[n].histHar[j].mHistPhiWgtFtpcWest->
  442. SetBinContent(i+1, meanFtpcWest);
  443. hist[k].histCen[n].histHar[j].mHistPhiWgtFtpcWest->
  444. SetBinError(i+1, 0.);
  445. hist[k].histCen[n].histHar[j].mHistPhiWgtFtpcFarWest->
  446. SetBinContent(i+1, meanFtpcFarWest);
  447. hist[k].histCen[n].histHar[j].mHistPhiWgtFtpcFarWest->
  448. SetBinError(i+1, 0.);
  449. }
  450. // Tpc
  451. hist[k].histCen[n].histHar[j].mHistPhiWgtFarEast->
  452. Divide(hist[k].histCen[n].histHar[j].mHistPhiFarEast);
  453. phiWgtHistNames[n]->AddLast(hist[k].histCen[n].histHar[j].mHistPhiWgtFarEast);
  454. hist[k].histCen[n].histHar[j].mHistPhiWgtEast->
  455. Divide(hist[k].histCen[n].histHar[j].mHistPhiEast);
  456. phiWgtHistNames[n]->AddLast(hist[k].histCen[n].histHar[j].mHistPhiWgtEast);
  457. hist[k].histCen[n].histHar[j].mHistPhiWgtWest->
  458. Divide(hist[k].histCen[n].histHar[j].mHistPhiWest);
  459. phiWgtHistNames[n]->AddLast(hist[k].histCen[n].histHar[j].mHistPhiWgtWest);
  460. hist[k].histCen[n].histHar[j].mHistPhiWgtFarWest->
  461. Divide(hist[k].histCen[n].histHar[j].mHistPhiFarWest);
  462. phiWgtHistNames[n]->AddLast(hist[k].histCen[n].histHar[j].mHistPhiWgtFarWest);
  463. // Ftpc
  464. hist[k].histCen[n].histHar[j].mHistPhiWgtFtpcFarEast->
  465. Divide(hist[k].histCen[n].histHar[j].mHistPhiFtpcFarEast);
  466. phiWgtHistNames[n]->AddLast(hist[k].histCen[n].histHar[j].mHistPhiWgtFtpcFarEast);
  467. hist[k].histCen[n].histHar[j].mHistPhiWgtFtpcEast->
  468. Divide(hist[k].histCen[n].histHar[j].mHistPhiFtpcEast);
  469. phiWgtHistNames[n]->AddLast(hist[k].histCen[n].histHar[j].mHistPhiWgtFtpcEast);
  470. hist[k].histCen[n].histHar[j].mHistPhiWgtFtpcWest->
  471. Divide(hist[k].histCen[n].histHar[j].mHistPhiFtpcWest);
  472. phiWgtHistNames[n]->AddLast(hist[k].histCen[n].histHar[j].mHistPhiWgtFtpcWest);
  473. hist[k].histCen[n].histHar[j].mHistPhiWgtFtpcFarWest->
  474. Divide(hist[k].histCen[n].histHar[j].mHistPhiFtpcFarWest);
  475. phiWgtHistNames[n]->AddLast(hist[k].histCen[n].histHar[j].mHistPhiWgtFtpcFarWest);
  476. }
  477. }
  478. phiWgtHistNames[n]->AddLast(mHistZDCSMDPsiWgtEast);
  479. phiWgtHistNames[n]->AddLast(mHistZDCSMDPsiWgtWest);
  480. }
  481. //GetHistList()->ls();
  482. // Make text object
  483. TText* textInfo = 0;
  484. if (pFlowEvent->FirstLastPoints()) {
  485. char chInfo[400];
  486. sprintf(chInfo, "%s%d%s%d%s", " pt weight= ", pFlowEvent->PtWgt(),
  487. ", eta weight= ", pFlowEvent->EtaWgt(), "\n");
  488. textInfo = new TText(0,0,chInfo);
  489. }
  490. // Write PhiWgt histograms
  491. for (int n = 1; n < nCens; n++) {
  492. phiWgtFile[n]->cd();
  493. if (pFlowEvent->FirstLastPoints()) { textInfo->Write("info"); }
  494. phiWgtHistNames[n]->Write();
  495. phiWgtFile[n]->Close();
  496. delete phiWgtHistNames[n];
  497. }
  498. if (pFlowEvent->FirstLastPoints()) delete textInfo;
  499. delete pFlowSelect;
  500. return StMaker::Finish();
  501. }
  502. //-----------------------------------------------------------------------
  503. ////////////////////////////////////////////////////////////////////////////
  504. //
  505. // $Log: StFlowPhiWgtMaker.cxx,v $
  506. // Revision 1.7 2004/12/09 23:47:09 posk
  507. // Minor changes in code formatting.
  508. // Added hist for TPC primary dca to AnalysisMaker.
  509. //
  510. // Revision 1.6 2004/12/07 23:10:22 posk
  511. // Only odd and even phiWgt hists. If the old phiWgt file contains more than
  512. // two harmonics, only the first two are read. Now writes only the first two.
  513. //
  514. // Revision 1.5 2004/08/24 20:22:40 oldi
  515. // Minor modifications to avoid compiler warnings.
  516. //
  517. // Revision 1.4 2004/05/31 20:09:25 oldi
  518. // PicoDst format changed (Version 7) to hold ZDC SMD information.
  519. // Trigger cut modified to comply with TriggerCollections.
  520. // Centrality definition for 62 GeV data introduced.
  521. // Minor bug fixes.
  522. //
  523. // Revision 1.3 2003/09/02 17:58:11 perev
  524. // gcc 3.2 updates + WarnOff
  525. //
  526. // Revision 1.2 2003/07/30 22:01:55 oldi
  527. // PtWgtSaturation parameter introduced.
  528. //
  529. // Revision 1.1 2003/05/16 20:44:49 posk
  530. // First commit of StFlowPhiWgtMaker
  531. //
  532. //
  533. ////////////////////////////////////////////////////////////////////////////