FlowANA.C 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128
  1. #define FlowANA_cxx
  2. #include "FlowANA.h"
  3. #include "TH1.h"
  4. #include "TH2.h"
  5. #include "TProfile.h"
  6. #include "TFile.h"
  7. #include "TNtuple.h"
  8. #include "TStyle.h"
  9. #include "TCanvas.h"
  10. #include "TMath.h"
  11. #include "TRandom3.h"
  12. #include "TVector3.h"
  13. #include "TDatabasePDG.h"
  14. #include <iostream>
  15. #include <fstream>
  16. #include <vector>
  17. #include <cstdlib>
  18. #include <sstream>
  19. #include <string>
  20. #include <cmath>
  21. using namespace std;
  22. //List of histograms and Ntuples....
  23. static const int neta = 9;
  24. static const int ndet = 5;
  25. static const int ncent = 8;
  26. static const int nth = 3;
  27. static const int npid = 4;
  28. // List of MPD based cuts
  29. static const float MpdPtMin = 0.;
  30. static const float MpdPtMax = 3.;
  31. static const float MpdEtaMin = -1.5;
  32. static const float MpdEtaGap = 0.05;
  33. static const float MpdEtaMax = 1.5;
  34. // List of STAR based cuts (for 7.7 GeV)
  35. static const float StarVtxZ = 70.;
  36. static const float StarPtMin = 0.2;
  37. static const float StarPtMax = 2.0;
  38. static const float StarEtaMin = -1.;
  39. static const float StarEtaMax = 1.;
  40. static const float StarEtaGap = 0.05;
  41. static const float StarProtonPtMin = 0.4;
  42. static const float StarProtonPtMax = 2.0;
  43. static const float StarPionPtMin = 0.2;
  44. static const float StarPionPMax = 1.6;
  45. static const int npt = 10; // 0.5 - 3.6 GeV/c - number of pT bins
  46. static const double bin_w[10]={0.2,0.4,0.6,0.8,1.0,1.2,1.4,1.8,2.3,2.8};
  47. static const float maxpt = 4.0; // max pt
  48. static const float minpt = 0.2; // min pt
  49. TH1F *hpt[ncent][npt][npid];
  50. TH1F *hv2[ndet][ncent][npt][npid];
  51. TH1F *hv1[ndet][ncent][npt][npid];
  52. TH1F *hv22[ndet][npt][npid];
  53. TH1F *hv12[ndet][npt][npid];
  54. TProfile *pv2[ndet][ncent][npid];
  55. TProfile *pv22[ndet][npid];
  56. TProfile *pv1[ndet][ncent][npid];
  57. TProfile *pv12[ndet][npid];
  58. TProfile *pv1_y[ndet][ncent][npid];
  59. TProfile *pv12_y[ndet][npid];
  60. TH1F *H_Qw[neta];
  61. TH1F *H_EP[nth][neta];
  62. TH1F *H_Qv[nth][neta];
  63. TH1F *H_QvX[nth][neta];
  64. TH1F *H_QvY[nth][neta];
  65. TH1F *H_Phi[nth][neta];
  66. TH1F *HRes[nth][ndet][ncent];
  67. // for centrality determination
  68. TH1F *href1; // PHENIX BBC
  69. TH1F *href2; // PHENIX RXN
  70. TH1F *href3; // STAR TPC
  71. TH1F *href4; // STAR ntracks>2
  72. TH1F *href5; // STAR ntracks>4
  73. TH1F *hbimp; // impact parameter
  74. TH1F *hbimp2; // impact parameter
  75. TH1F *hbimp3; // impact parameter
  76. TH1F *hbimp4; // impact parameter
  77. TH1F *hbimp5; // impact parameter
  78. TH1F *h2pt;
  79. TH1F *h2eta;
  80. TH1F *h2phi;
  81. TH1F *h2phis;
  82. TH1F *h2phirp;
  83. static const double MYPI=3.141592654;
  84. TFile *d_outfile;
  85. void FlowANA::Loop()
  86. {
  87. if (fChain == 0) return;
  88. Int_t nentries = Int_t(fChain->GetEntries());
  89. Int_t nbytes = 0, nb = 0;
  90. for (Int_t jentry=0; jentry<nentries;jentry++) {
  91. Int_t ientry = LoadTree(jentry); //in case of a TChain, ientry is the entry number in the current file
  92. nb = fChain->GetEntry(jentry); nbytes += nb;
  93. if(jentry%1000==0) cout << "Event [" << jentry << "/" << nentries << "]" <<endl;// event counter
  94. ana_event(jentry,ientry);
  95. }
  96. }
  97. void FlowANA::ana_init(const char *outfile) {
  98. book_hist(outfile);
  99. gRandom->SetSeed( (unsigned int)time(NULL) );
  100. }
  101. void FlowANA::loop_a_file(const char *file) {
  102. TFile *treefile = TFile::Open(file);
  103. TTree *tree = (TTree*)treefile->Get("mctree"); // put the name of the TTree
  104. if(tree == 0) {
  105. cout <<"htree is not found in "<<file<<endl;
  106. treefile->Close();
  107. return;
  108. }
  109. cout << file <<" is opened"<<endl;
  110. Init(tree);
  111. Loop();
  112. treefile->Close();
  113. cout <<"one file processed"<<endl;
  114. }
  115. void FlowANA::ana_end() {
  116. d_outfile->cd();
  117. for( int ieta=0; ieta<neta; ieta++ ){
  118. H_Qw[ieta]->Write();
  119. }
  120. for( int ith=0; ith<3; ith++ ){
  121. for( int ieta=0; ieta<neta; ieta++ ){
  122. H_EP[ith][ieta]->Write();
  123. H_Qv[ith][ieta]->Write();
  124. H_QvX[ith][ieta]->Write();
  125. H_QvY[ith][ieta]->Write();
  126. H_Phi[ith][ieta]->Write();
  127. }
  128. }
  129. for( int ith=0; ith<3; ith++ ){
  130. for( int idet=0; idet<ndet; idet++ ){
  131. for( int icent=0; icent<ncent; icent++ ){
  132. HRes[ith][idet][icent]->Write();
  133. }
  134. }
  135. }
  136. for( int icent=0; icent<ncent; icent++ ){
  137. for( int ipt=0; ipt<npt-1; ipt++ ){
  138. for( int id=0; id<npid; id++ ){
  139. hpt[icent][ipt][id]->Write();
  140. }
  141. }
  142. }
  143. for( int idet=0; idet<ndet; idet++ ){
  144. for( int icent=0; icent<ncent; icent++ ){
  145. for( int ipt=0; ipt<npt-1; ipt++ ){
  146. for( int id=0; id<npid; id++ ){
  147. hv2[idet][icent][ipt][id]->Write();
  148. hv1[idet][icent][ipt][id]->Write();
  149. }
  150. }
  151. }
  152. }
  153. for( int idet=0; idet<ndet; idet++ ){
  154. for( int icent=0; icent<ncent; icent++ ){
  155. for( int id=0; id<npid; id++ ){
  156. pv2[idet][icent][id]->Write();
  157. pv1[idet][icent][id]->Write();
  158. pv1_y[idet][icent][id]->Write();
  159. }
  160. }
  161. }
  162. for( int idet=0; idet<ndet; idet++ ){
  163. for( int id=0; id<npid; id++ ){
  164. pv22[idet][id]->Write();
  165. pv12[idet][id]->Write();
  166. pv12_y[idet][id]->Write();
  167. }
  168. }
  169. for( int idet=0; idet<ndet; idet++ ){
  170. for( int ipt=0; ipt<npt-1; ipt++ ){
  171. for( int id=0; id<npid; id++ ){
  172. hv22[idet][ipt][id]->Write();
  173. hv12[idet][ipt][id]->Write();
  174. }
  175. }
  176. }
  177. h2pt->Write();
  178. h2eta->Write();
  179. h2phis->Write();
  180. h2phi->Write();
  181. h2phirp->Write();
  182. href1->Write();
  183. href2->Write();
  184. href3->Write();
  185. href4->Write();
  186. href5->Write();
  187. hbimp->Write();
  188. hbimp2->Write();
  189. hbimp3->Write();
  190. hbimp4->Write();
  191. hbimp5->Write();
  192. d_outfile->Close();
  193. } // end of ana_end
  194. void FlowANA::book_hist(const char *outfile) {
  195. d_outfile = new TFile(outfile,"recreate");
  196. h2eta = new TH1F("h2eta","eta distribution",200,-7,7);
  197. h2pt = new TH1F("h2pt","pt distribution",200,0,10.0);
  198. href1 = new TH1F("href1","Centrality by BBC (PHENIX)",1000,0,1000);
  199. href2 = new TH1F("href2","Centrality by BBC (PHENIX)",1000,0,1000);
  200. href3 = new TH1F("href3","Centrality by TPC (STAR)",1000,0,1000);
  201. href4 = new TH1F("href4","Centrality by TPC (STAR), ntracks >1",1000,0,1000);
  202. href5 = new TH1F("href5","Centrality by TPC (STAR), ntracks >2",1000,0,1000);
  203. hbimp2 = new TH1F("hbimp2","Imact Parameter",180,0,18);
  204. hbimp3 = new TH1F("hbimp3","Imact Parameter",180,0,18);
  205. hbimp4 = new TH1F("hbimp4","Imact Parameter",180,0,18);
  206. hbimp5 = new TH1F("hbimp5","Imact Parameter",180,0,18);
  207. hbimp = new TH1F("hbimp","Imact Parameter",180,0,18);
  208. h2phi = new TH1F("h2phi","azim. angle", 100, -TMath::Pi(), TMath::Pi()+2.*TMath::Pi()/100 );
  209. h2phis = new TH1F("h2phis","azim. angle (|eta| <0.5)", 100, -TMath::Pi(), TMath::Pi()+2.*TMath::Pi()/100 );
  210. h2phirp = new TH1F("h2phirp","azim. angle", 100, -TMath::Pi(), TMath::Pi()+2.*TMath::Pi()/100 );
  211. for( int ieta=0; ieta<neta; ieta++ ) H_Qw[ieta] = new TH1F( Form("H_Qw_%d",ieta), Form("H_Qw_%d",ieta), 100, 0, 1000 );
  212. for( int ith=0; ith<3; ith++ ){
  213. for( int ieta=0; ieta<neta; ieta++ ){
  214. H_EP[ith][ieta] = new TH1F( Form("H_EP_%d_%d",ith,ieta), Form("H_EP_%d_%d",ith,ieta), 372, -TMath::Pi()/(ith+1.)-0.1, TMath::Pi()/(ith+1.)+0.10 );
  215. H_Phi[ith][ieta] = new TH1F( Form("H_Phi_%d_%d",ith,ieta), Form("H_Phi_%d_%d",ith,ieta), 372, -TMath::Pi()/(ith+1.)-0.1, TMath::Pi()/(ith+1.)+0.10 );
  216. H_Qv[ith][ieta] = new TH1F( Form("H_Qv_%d_%d",ith,ieta), Form("H_Qv_%d_%d",ith,ieta), 100, 0, 10 );
  217. H_QvX[ith][ieta] = new TH1F( Form("H_QvX_%d_%d",ith,ieta), Form("H_QvX_%d_%d",ith,ieta), 200, -10, 10 );
  218. H_QvY[ith][ieta] = new TH1F( Form("H_QvY_%d_%d",ith,ieta), Form("H_QvY_%d_%d",ith,ieta), 200, -10, 10 );
  219. }
  220. }
  221. for( int ith=0; ith<3; ith++ ){
  222. for( int idet=0; idet<ndet; idet++ ){
  223. for( int icent=0; icent<ncent; icent++ ){
  224. HRes[ith][idet][icent] = new TH1F( Form("HRes_%d_%d_%d",ith,idet,icent), Form("HRes_%d_%d_%d",ith,idet,icent), 100, -10, 10 );
  225. }
  226. }
  227. }
  228. for( int idet=0; idet<ndet; idet++ ){
  229. for( int icent=0; icent<ncent; icent++ ){
  230. for( int ipt=0; ipt<npt-1; ipt++ ){
  231. for( int id=0; id<npid; id++ ){
  232. hv2[idet][icent][ipt][id] = new TH1F( Form("hv2_%d_%d_%d_%d",idet,icent,ipt,id), Form("hv2_%d_%d_%d_%d",idet,icent,ipt,id), 400, -10, 10 );
  233. hv1[idet][icent][ipt][id] = new TH1F( Form("hv1_%d_%d_%d_%d",idet,icent,ipt,id), Form("hv1_%d_%d_%d_%d",idet,icent,ipt,id), 400, -10, 10 );
  234. }
  235. }
  236. }
  237. }
  238. for( int idet=0; idet<ndet; idet++ ){
  239. for( int icent=0; icent<ncent; icent++ ){
  240. for( int id=0; id<npid; id++ ){
  241. pv2[idet][icent][id] = new TProfile( Form("pv2_%d_%d_%d",idet,icent,id), Form("pv2_%d_%d_%d",idet,icent,id), 50, 0., 5. );
  242. pv1[idet][icent][id] = new TProfile( Form("pv1_%d_%d_%d",idet,icent,id), Form("pv1_%d_%d_%d",idet,icent,id), 50, 0., 5. );
  243. pv1_y[idet][icent][id] = new TProfile( Form("pv1_y_%d_%d_%d",idet,icent,id), Form("pv1_y_%d_%d_%d",idet,icent,id), 100, -5., 5. );
  244. }
  245. }
  246. }
  247. for( int idet=0; idet<ndet; idet++ ){
  248. for( int ipt=0; ipt<npt-1; ipt++ ){
  249. for( int id=0; id<npid; id++ ){
  250. hv22[idet][ipt][id] = new TH1F( Form("hv22_%d_%d_%d",idet,ipt,id), Form("hv22_%d_%d_%d",idet,ipt,id), 400, -10, 10 );
  251. hv12[idet][ipt][id] = new TH1F( Form("hv12_%d_%d_%d",idet,ipt,id), Form("hv12_%d_%d_%d",idet,ipt,id), 400, -10, 10 );
  252. }
  253. }
  254. }
  255. for( int idet=0; idet<ndet; idet++ ){
  256. for( int id=0; id<npid; id++ ){
  257. pv22[idet][id] = new TProfile( Form("pv22_%d_%d",idet,id), Form("pv22_%d_%d",idet,id), 50, 0., 5. );
  258. pv12[idet][id] = new TProfile( Form("pv12_%d_%d",idet,id), Form("pv12_%d_%d",idet,id), 50, 0., 5. );
  259. pv12_y[idet][id] = new TProfile( Form("pv12_y_%d_%d",idet,id), Form("pv12_y_%d_%d",idet,id), 100, -5., 5. );
  260. }
  261. }
  262. for( int icent=0; icent<ncent; icent++ ){
  263. for( int ipt=0; ipt<npt-1; ipt++ ){
  264. for( int id=0; id<npid; id++ ){
  265. hpt[icent][ipt][id] = new TH1F( Form("hpt_%d_%d_%d",icent,ipt,id), Form("hpt_%d_%d_%d",icent,ipt,id), 400, 0, 10 );
  266. }
  267. }
  268. }
  269. }
  270. // Analysis for each event !!!!
  271. void FlowANA::ana_event(int jentry, int ientry) {
  272. //float phiRP = gRandom->Uniform(0, 2.*TMath::Pi());
  273. // float phiRP = gRandom->Uniform(-1.0*TMath::Pi(),TMath::Pi());
  274. //h2phirp->Fill(phiRP);
  275. // centrality cut and vertex +/- 30 cm cut
  276. /*
  277. if(cent>0&&cent<=80){
  278. if(centrality<=5) mycent=0;
  279. else if(centrality<=10) mycent=1;
  280. else if(centrality<=15) mycent=2;
  281. else if(centrality<=20) mycent=3;
  282. else if(centrality<=25) mycent=4;
  283. else if(centrality<=30) mycent=5;
  284. else if(centrality<=35) mycent=6;
  285. else if(centrality<=40) mycent=7;
  286. else if(centrality<=45) mycent=8;
  287. else if(centrality<=50) mycent=9;
  288. else if(centrality<=55) mycent=10;
  289. else mycent=11;
  290. */
  291. //if(ientry%100000==0) cout << ientry <<endl;// event counter
  292. float sumQxy[3][9][2] = {{{0}}}; //[ith][eta][x,y]
  293. //float sumQxyFull[3][2] = {{{0}}};
  294. float multQv[9] = {0}; //[eta]
  295. float fhcalFullEP_x = 0.;
  296. float fhcalFullEP_y = 0.;
  297. float fhcalFullEP_phi = 0.;
  298. hbimp->Fill(bimp);
  299. double refMult1 = 0;
  300. double refMult2 = 0;
  301. double Nch_L = 0;
  302. double Nch_R = 0;
  303. double Nch_L2 = 0;
  304. double Nch_R2 = 0;
  305. for(int itrk=0;itrk<nh;itrk++) { //track loop
  306. float pt = sqrt( TMath::Power(momx[itrk], 2.0 ) + TMath::Power(momy[itrk], 2.0 ) );
  307. float oldphi = atan2( momy[itrk], momx[itrk] );
  308. float phi=oldphi;
  309. float the = atan2( pt, momz[itrk] );//atan2(pt/pz)
  310. float eta = -log( tan( 0.5 * the ) );
  311. float ch;
  312. if (TDatabasePDG::Instance()->GetParticle(pdg[itrk]))
  313. ch = 1./3.*TDatabasePDG::Instance()->GetParticle(pdg[itrk])->Charge();
  314. else ch = -999.;
  315. // phi += phiRP;
  316. // float px = pt * cos(phi);
  317. // float py = pt * sin(phi);
  318. // pt = sqrt( TMath::Power(px, 2.0 ) + TMath::Power(py, 2.0 ) );
  319. h2pt->Fill(pt);
  320. h2eta->Fill(eta);
  321. h2phi->Fill(oldphi);
  322. h2phis->Fill(phi);
  323. if( pt>0.1 && fabs(eta)<0.5 ) refMult1++;
  324. if( pt>0.0 && fabs(eta)<0.5 ) refMult2++;
  325. if(eta >= 3.1 && eta <= 4.0) Nch_R++;
  326. if(eta >= -4.0 && eta <= -3.1) Nch_L++;
  327. //if( pt<0.15 || pt>2. ) continue;
  328. if ( pt<MpdPtMin || pt>MpdPtMax ) continue;
  329. //if ( pt<StarPtMin || pt>StarPtMax ) continue;
  330. int fEta = -1;
  331. // TPC plane
  332. if( eta>-1 && eta<-0.1 ) fEta = 0; // TPC East
  333. if( eta>0.1 && eta<1 ) fEta = 1; // TPC West
  334. if( fabs(eta)<0.1 ) fEta = 2; // TPC Mid
  335. // RXN plane
  336. if( eta>-3.0 && eta<-1.0 ) fEta = 3; // RXN East
  337. if( eta>1.0 && eta<3.0 ) fEta = 4; // RXN West
  338. // BBC plane
  339. //if( eta>-5 && eta<-3 ) fEta = 5; //East
  340. //if( eta>3.0 && eta<5 ) fEta = 6; //West
  341. // FHCal plane
  342. if( eta>-5.0 && eta<-2.0 ) fEta = 7; //East
  343. if( eta>2.0 && eta<5.0 ) fEta = 8; //West
  344. // BBC plane - first harmonic
  345. //if( eta>-5.0 && eta<-3.3 ) fEta = 7; //East
  346. //if( eta>3.3 && eta<5.0 ) fEta = 8; //West
  347. // if( fabs(eta)>1.1 && fabs(eta)<2.9 ) fEta = 7; // RXN combined
  348. //if( fabs(eta)>3.0 && fabs(eta)<5.0 ) fEta = 8; // BBC combined
  349. if( fEta>-1. ) H_Phi[0][fEta]->Fill( phi );
  350. if ( fEta < 3 && (ch == 0 || ch == -999.)) continue;
  351. if( fEta>-1. ){
  352. for( int ith=0; ith<3; ith++ ){
  353. if (fEta < 7){
  354. sumQxy[ith][fEta][0] += pt * cos( (ith+2.0) * phi );
  355. sumQxy[ith][fEta][1] += pt * sin( (ith+2.0) * phi );
  356. }else{
  357. if (fEta == 7){
  358. sumQxy[ith][fEta][0] += -1. * pt * cos( (ith+1.0) * phi );
  359. sumQxy[ith][fEta][1] += -1. * pt * sin( (ith+1.0) * phi );
  360. }
  361. if (fEta == 8){
  362. sumQxy[ith][fEta][0] += 1. * pt * cos( (ith+1.0) * phi );
  363. sumQxy[ith][fEta][1] += 1. * pt * sin( (ith+1.0) * phi );
  364. }
  365. }
  366. //if(fEta == 7 || fEta == 8){
  367. // sumQxyFull[ith][0] += pt * cos( (ith+1.0) * phi );
  368. // sumQxyFull[ith][1] += pt * sin( (ith+1.0) * phi );
  369. //}
  370. }
  371. multQv[fEta]++;
  372. }// end of eta selection
  373. }// end of track loop
  374. if(Nch_L >= 1 && Nch_R >= 1){
  375. href1 -> Fill(Nch_L + Nch_R);
  376. }
  377. if(Nch_L >= 2 && Nch_R >= 2){
  378. href2 -> Fill(Nch_L + Nch_R);
  379. hbimp2->Fill(bimp);
  380. }
  381. if(refMult1>0){
  382. href3 -> Fill(refMult1);
  383. hbimp3->Fill(bimp);
  384. }
  385. if(refMult2>0){
  386. href4 -> Fill(refMult1);
  387. hbimp4->Fill(bimp);
  388. }
  389. if(refMult1>2){
  390. href5 -> Fill(refMult1);
  391. hbimp5->Fill(bimp);
  392. }
  393. float sumLR=Nch_L + Nch_R;
  394. // int fCent = GetCentrality10_RefMult( refMult1 );// STAR def
  395. //if( fCent<0 ) cout << fCent << endl;
  396. // int fCent = GetCentrality10_RefMultPHENIX(sumLR);
  397. int fCent = GetCentrality10_Bimp(bimp);
  398. //int fCent = GetCentrality10_BimpExp(bimp);
  399. float fEP[3][9]; //[ith][eta]
  400. float fQv[3][9]; //[ith][eta]
  401. float fQvX[3][9]; //[ith][eta]
  402. float fQvY[3][9]; //[ith][eta]
  403. for( int ith=0; ith<3; ith++ ){ // flow harmonic loop
  404. for( int ieta=0; ieta<9; ieta++ ){ // ep detector gap
  405. if( multQv[ieta]>5 ){ // multiplicity > 5
  406. if( ieta<7 )
  407. {
  408. fEP[ith][ieta] = atan2( sumQxy[ith][ieta][1], sumQxy[ith][ieta][0] ) / ( ith + 2.0 );
  409. fEP[ith][ieta] = atan2( sin( (ith+2.0)*fEP[ith][ieta] ), cos( (ith+2.0)*fEP[ith][ieta] ) );
  410. fEP[ith][ieta] /= ( ith + 2.0 );
  411. }else{
  412. fEP[ith][ieta] = atan2( sumQxy[ith][ieta][1], sumQxy[ith][ieta][0] ) / ( ith + 1.0 );
  413. fEP[ith][ieta] = atan2( sin( (ith+1.0)*fEP[ith][ieta] ), cos( (ith+1.0)*fEP[ith][ieta] ) );
  414. fEP[ith][ieta] /= ( ith + 1.0 );
  415. }
  416. fQv[ith][ieta] = sqrt( TMath::Power( sumQxy[ith][ieta][0],2.0)+TMath::Power( sumQxy[ith][ieta][1], 2.0))/sqrt( multQv[ieta]);
  417. fQvX[ith][ieta] = sumQxy[ith][ieta][0] / sqrt( multQv[ieta]);
  418. fQvY[ith][ieta] = sumQxy[ith][ieta][1] / sqrt( multQv[ieta]);
  419. H_Qw[ieta]->Fill( multQv[ieta] );
  420. }else{
  421. fEP[ith][ieta] = -9999;
  422. fQv[ith][ieta] = -9999;
  423. fQvX[ith][ieta] = -9999;
  424. fQvY[ith][ieta] = -9999;
  425. }// end of mult cut selection
  426. } // end of loop on EP detectors
  427. } // end of flow harmonic loop
  428. fhcalFullEP_x = sumQxy[0][7][0] + sumQxy[0][8][0];
  429. fhcalFullEP_y = sumQxy[0][7][1] + sumQxy[0][8][1];
  430. fhcalFullEP_phi = atan2( fhcalFullEP_y, fhcalFullEP_x );
  431. for( int ith=0; ith<3; ith++ ){ // harmonic loop
  432. for( int ieta=0; ieta<9; ieta++ ){// eta EP detector loop
  433. if( fEP[ith][ieta]>-9000 ){ // EP reconstructed
  434. H_EP[ith][ieta]->Fill( fEP[ith][ieta] );
  435. H_Qv[ith][ieta]->Fill( fQv[ith][ieta] );
  436. H_QvX[ith][ieta]->Fill( fQvX[ith][ieta] );
  437. H_QvY[ith][ieta]->Fill( fQvY[ith][ieta] );
  438. }// end of EP reconstructed
  439. }// end of eta loop
  440. }// end of harm loop
  441. //Resolution
  442. for( int ith=0; ith<3; ith++ ){
  443. for( int icb=0; icb<4; icb++ ){
  444. double psi1, psi2, fq1, fq2, HarmStart=2.;
  445. if ( icb==0 ){ psi1 = fEP[ith][0]; psi2 = fEP[ith][1]; fq1 = fQv[ith][0]; fq2 = fQv[ith][1]; } // TPC.E-TPC.W
  446. else if( icb==1 ){ psi1 = fEP[ith][3]; psi2 = fEP[ith][4]; fq1 = fQv[ith][3]; fq2 = fQv[ith][4]; } // RXN.E-RXN.W
  447. else if( icb==2 ){ psi1 = fEP[ith][5]; psi2 = fEP[ith][6]; fq1 = fQv[ith][5]; fq2 = fQv[ith][6]; } // BBC.E-BBC.W
  448. else { psi1 = fEP[ith][7]; psi2 = fEP[ith][8]; fq1 = fQv[ith][7]; fq2 = fQv[ith][8]; HarmStart=1.; } // FHCal.E-FHCal.W
  449. if( psi1<-9000 || psi2<-9000 ) continue;
  450. if( fq1<0 || fq2<0 ) continue;
  451. double dPsi = ( ith + HarmStart ) * ( psi1 - psi2 );
  452. dPsi = atan2( sin(dPsi), cos(dPsi) );
  453. if(fCent>-1&&fCent<ncent){
  454. HRes[ith][icb][fCent]->Fill(cos(dPsi) );
  455. }
  456. }
  457. }
  458. // refmult star
  459. //float res2tpc[6]={0.503463,0.71591,0.749962,0.708934,0.61689,0.475386};
  460. //float res2rxn[6]={0.547883,0.791309,0.824213,0.793991,0.709638,0.561604};
  461. //float res2bbc[6]={0.252904,0.377894,0.401809,0.366931,0.300508,0.223784};
  462. // phenix ala cent
  463. // float res2tpc[6]={0.482228,0.704061,0.749667,0.7259,0.655706,0.541163};
  464. //float res2rxn[6]={ 0.526791,0.780304,0.824815,0.806745,0.746894,0.634004};
  465. //float res2bbc[6]={0.241286,0.375359,0.40532,0.384438,0.326188,0.250811};
  466. //float res2tpc[6]={0.493507,0.716751,0.748541,0.709883,0.623788,0.491104};
  467. //float res2rxn[6]={0.540663,0.793812,0.82354,0.794412,0.714603,0.579696};
  468. //float res2bbc[6]={0.248559,0.383837,0.40206,0.373202,0.299496,0.2273};
  469. //float res2fhcal[6]={0.38477,0.577671,0.601972,0.555919,0.46528,0.339993};
  470. // 11.5 gev
  471. //
  472. //float res2tpc[6] = {0.323761,0.434068,0.433521,0.383028,0.307532,0.250556};
  473. //float res2rxn[6] = {0.212259,0.333732,0.340171,0.303697,0.247778,0.206723};
  474. //float res2bbc[6] = {1,1,1,1,1,1};
  475. //float res2fhcal[6] = {0.219457,0.37629,0.417876,0.39807,0.340169,0.271286};
  476. // 7.7 gev
  477. //
  478. float res2tpc[8] = {0.215422,0.319671,0.321595,0.286121,0.230794,0.187664,0.169983,0.180262};
  479. float res2rxn[8] = {0.174276,0.278904,0.284986,0.235424,0.182337,0.145134,0.136635,0.154262};
  480. float res2bbc[8] = {0,0,0,0,0,0,0,0};
  481. float res2fhcal[8] = {0.21303,0.451618,0.525957,0.527378,0.486444,0.413006,0.317347,0.220505};
  482. float res2fhcalFull[8] = {0.367834,0.654836,0.721327,0.722506,0.687191,0.61634,0.508214,0.378717};
  483. float res1fhcalFull[8] = {0.710235,0.887721,0.915807,0.916269,0.901899,0.869522,0.809946,0.719049};
  484. if(fCent>=0&&fCent<ncent){
  485. float phiRP = 0.; // True RP plane angle
  486. for(int itrk=0;itrk<nh;itrk++) { //track loop
  487. float pt = sqrt( TMath::Power(momx[itrk], 2.0 ) + TMath::Power(momy[itrk], 2.0 ) );
  488. float p = sqrt( TMath::Power(pt, 2.0 ) + TMath::Power(momz[itrk], 2.0 ) );
  489. float oldphi = atan2( momy[itrk], momx[itrk] );
  490. float phi=oldphi;
  491. float dphiRP = atan2( momy[itrk], momx[itrk] ) - phiRP;
  492. float oldphiV1 = atan2( momy[itrk], momx[itrk] );
  493. float phiV1 = atan2( sin(oldphiV1), cos(oldphiV1) );
  494. float the = atan2( pt, momz[itrk] );//atan2(pt/pz)
  495. float eta = -log( tan( 0.5 * the ) );
  496. float rapidity = 0.5*log( (ene[itrk] + momz[itrk])/(ene[itrk] - momz[itrk]) );
  497. float ch;
  498. if (TDatabasePDG::Instance()->GetParticle(pdg[itrk]))
  499. ch = 1./3.*TDatabasePDG::Instance()->GetParticle(pdg[itrk])->Charge();
  500. else ch = -999.;
  501. // phi += phiRP;
  502. // float px = pt * cos(phi);
  503. // float py = pt * sin(phi);
  504. // pt = sqrt( TMath::Power(px, 2.0 ) + TMath::Power(py, 2.0 ) );
  505. //if( pt<0.15 || pt>4.0 ) continue;
  506. if ( pt<MpdPtMin || pt>MpdPtMax ) continue;
  507. //if ( pt<StarPtMin || pt>StarPtMax ) continue;
  508. //if ( eta<MpdEtaMin || eta>MpdEtaMax ) continue;
  509. if( ch == 0 || ch == -999. ) continue;
  510. int ipt = 0;
  511. for(int i=0; i<npt-1;i++){
  512. if(pt>=bin_w[i] && pt<bin_w[i+1]) ipt = i;
  513. }// end of ipt loop
  514. float v2tpc=-999.0;
  515. float v2rxn=-999.0;
  516. float v2bbc=-999.0;
  517. float v2fhcal=-999.0;
  518. float v2fhcalFull=-999.0;
  519. float v1fhcalFull=-999.0;
  520. float v2RP=-999.0;
  521. float v1RP=-999.0;
  522. if(eta>MpdEtaGap&&eta<MpdEtaMax){
  523. v2tpc = cos(2.0 * (phi-fEP[0][0]) )/res2tpc[fCent];
  524. v2rxn = cos(2.0 * (phi-fEP[0][3]) )/res2rxn[fCent];
  525. v2bbc = cos(2.0 * (phi-fEP[0][5]) )/res2bbc[fCent];
  526. v2fhcal = cos(2.0 * (phi-fEP[0][7]) )/res2fhcal[fCent];
  527. v2fhcalFull = cos(2.0 * (phi-fhcalFullEP_phi) )/res2fhcalFull[fCent];
  528. v2RP = cos(2.0 * (dphiRP) );
  529. v1fhcalFull = 1.0 * cos(1.0 * (phiV1-fhcalFullEP_phi) )/res1fhcalFull[fCent];
  530. v1RP = 1.0 * cos(1.0 * (dphiRP) );
  531. }
  532. if(eta<-1.*MpdEtaGap&&eta>MpdEtaMin){
  533. v2tpc = cos(2.0 * (phi-fEP[0][1]) )/res2tpc[fCent];
  534. v2rxn = cos(2.0 * (phi-fEP[0][4]) )/res2rxn[fCent];
  535. v2bbc = cos(2.0 * (phi-fEP[0][6]) )/res2bbc[fCent];
  536. v2fhcal = cos(2.0 * (phi-fEP[0][8]) )/res2fhcal[fCent];
  537. v2fhcalFull = cos(2.0 * (phi-fhcalFullEP_phi) )/res2fhcalFull[fCent];
  538. v2RP = cos(2.0 * (dphiRP) );
  539. v1fhcalFull = -1.0 * cos(1.0 * (phi-fhcalFullEP_phi) )/res1fhcalFull[fCent];
  540. v1RP = -1.0 * cos(1.0 * (dphiRP) );
  541. }
  542. if(fabs(eta)>MpdEtaGap&&fabs(eta)<MpdEtaMax){
  543. hv2[0][fCent][ipt][0]->Fill(v2tpc);
  544. hv2[1][fCent][ipt][0]->Fill(v2rxn);
  545. hv2[2][fCent][ipt][0]->Fill(v2bbc);
  546. hv2[3][fCent][ipt][0]->Fill(v2fhcalFull);
  547. hv2[4][fCent][ipt][0]->Fill(v2RP);
  548. hv1[3][fCent][ipt][0]->Fill(v1fhcalFull);
  549. hv1[4][fCent][ipt][0]->Fill(v1RP);
  550. if (v2tpc!=-999.) pv2[0][fCent][0]->Fill(pt,v2tpc);
  551. if (v2rxn!=-999.) pv2[1][fCent][0]->Fill(pt,v2rxn);
  552. if (v2bbc!=-999.) pv2[2][fCent][0]->Fill(pt,v2bbc);
  553. //if (v2fhcal!=-999.) pv2[3][fCent][0]->Fill(pt,v2fhcal);
  554. if (v2fhcalFull!=-999.) pv2[3][fCent][0]->Fill(pt,v2fhcalFull);
  555. if (v2RP!=-999.) pv2[4][fCent][0]->Fill(pt,v2RP);
  556. if (v1fhcalFull!=-999.) pv1[3][fCent][0]->Fill(pt,v1fhcalFull);
  557. if (v1RP!=-999.) pv1[4][fCent][0]->Fill(pt,v1RP);
  558. if (v1fhcalFull!=-999.) pv1[3][fCent][0]->Fill(pt,v1fhcalFull);
  559. if (v1RP!=-999.) pv1[4][fCent][0]->Fill(pt,v1RP);
  560. //std::cout << "v2TPC " << v2tpc << "; v2RP " << v2RP << std::endl;
  561. //cos(1.0 * (phi-fhcalFullEP_phi) )/res1fhcalFull[fCent]
  562. hpt[fCent][ipt][0]->Fill(pt);
  563. if(fCent>0&&fCent<4){
  564. hv22[0][ipt][0]->Fill(v2tpc);
  565. hv22[1][ipt][0]->Fill(v2rxn);
  566. hv22[2][ipt][0]->Fill(v2bbc);
  567. hv22[3][ipt][0]->Fill(v2fhcalFull);
  568. hv22[4][ipt][0]->Fill(v2RP);
  569. hv12[3][ipt][0]->Fill(v1fhcalFull);
  570. hv12[4][ipt][0]->Fill(v1RP);
  571. if (v2tpc!=-999.) pv22[0][0]->Fill(pt,v2tpc);
  572. if (v2rxn!=-999.) pv22[1][0]->Fill(pt,v2rxn);
  573. if (v2bbc!=-999.) pv22[2][0]->Fill(pt,v2bbc);
  574. //if (v2fhcal!=-999.) pv22[3][0]->Fill(pt,v2fhcal);
  575. if (v2fhcalFull!=-999.) pv22[3][0]->Fill(pt,v2fhcalFull);
  576. if (v2RP!=-999.) pv22[4][0]->Fill(pt,v2RP);
  577. if (v1fhcalFull!=-999.) pv12[3][0]->Fill(pt,v1fhcalFull);
  578. if (v1RP!=-999.) pv12[4][0]->Fill(pt,v1RP);
  579. }
  580. if ( pdg[itrk]==211){
  581. hv2[0][fCent][ipt][1]->Fill(v2tpc);
  582. hv2[1][fCent][ipt][1]->Fill(v2rxn);
  583. hv2[2][fCent][ipt][1]->Fill(v2bbc);
  584. hv2[3][fCent][ipt][1]->Fill(v2fhcalFull);
  585. hv2[4][fCent][ipt][1]->Fill(v2RP);
  586. hv1[3][fCent][ipt][1]->Fill(v1fhcalFull);
  587. hv1[4][fCent][ipt][1]->Fill(v1RP);
  588. if (v2tpc!=-999.) pv2[0][fCent][1]->Fill(pt,v2tpc);
  589. if (v2rxn!=-999.) pv2[1][fCent][1]->Fill(pt,v2rxn);
  590. if (v2bbc!=-999.) pv2[2][fCent][1]->Fill(pt,v2bbc);
  591. //if (v2fhcal!=-999.) pv2[3][fCent][1]->Fill(pt,v2fhcal);
  592. if (v2fhcalFull!=-999.) pv2[3][fCent][1]->Fill(pt,v2fhcalFull);
  593. if (v2RP!=-999.) pv2[4][fCent][1]->Fill(pt,v2RP);
  594. if (v1fhcalFull!=-999.) pv1[3][fCent][1]->Fill(pt,v1fhcalFull);
  595. if (v1RP!=-999.) pv1[4][fCent][1]->Fill(pt,v1RP);
  596. hpt[fCent][ipt][1]->Fill(pt);
  597. if(fCent>0&&fCent<4){
  598. hv22[0][ipt][1]->Fill(v2tpc);
  599. hv22[1][ipt][1]->Fill(v2rxn);
  600. hv22[2][ipt][1]->Fill(v2bbc);
  601. hv22[3][ipt][1]->Fill(v2fhcalFull);
  602. hv22[4][ipt][1]->Fill(v2RP);
  603. hv12[3][ipt][1]->Fill(v1fhcalFull);
  604. hv12[4][ipt][1]->Fill(v1RP);
  605. if (v2tpc!=-999.) pv22[0][1]->Fill(pt,v2tpc);
  606. if (v2rxn!=-999.) pv22[1][1]->Fill(pt,v2rxn);
  607. if (v2bbc!=-999.) pv22[2][1]->Fill(pt,v2bbc);
  608. //if (v2fhcal!=-999.) pv22[3][1]->Fill(pt,v2fhcal);
  609. if (v2fhcalFull!=-999.) pv22[3][1]->Fill(pt,v2fhcalFull);
  610. if (v2RP!=-999.) pv22[4][1]->Fill(pt,v2RP);
  611. if (v1fhcalFull!=-999.) pv12[3][1]->Fill(pt,v1fhcalFull);
  612. if (v1RP!=-999.) pv12[4][1]->Fill(pt,v1RP);
  613. }
  614. }// end of pion selection
  615. if ( pdg[itrk]==321){
  616. hv2[0][fCent][ipt][2]->Fill(v2tpc);
  617. hv2[1][fCent][ipt][2]->Fill(v2rxn);
  618. hv2[2][fCent][ipt][2]->Fill(v2bbc);
  619. hv2[3][fCent][ipt][2]->Fill(v2fhcalFull);
  620. hv2[4][fCent][ipt][2]->Fill(v2RP);
  621. hv1[3][fCent][ipt][2]->Fill(v1fhcalFull);
  622. hv1[4][fCent][ipt][2]->Fill(v1RP);
  623. if (v2tpc!=-999.) pv2[0][fCent][2]->Fill(pt,v2tpc);
  624. if (v2rxn!=-999.) pv2[1][fCent][2]->Fill(pt,v2rxn);
  625. if (v2bbc!=-999.) pv2[2][fCent][2]->Fill(pt,v2bbc);
  626. //if (v2fhcal!=-999.) pv2[3][fCent][2]->Fill(pt,v2fhcal);
  627. if (v2fhcalFull!=-999.) pv2[3][fCent][2]->Fill(pt,v2fhcalFull);
  628. if (v2RP!=-999.) pv2[4][fCent][2]->Fill(pt,v2RP);
  629. if (v1fhcalFull!=-999.) pv1[3][fCent][2]->Fill(pt,v1fhcalFull);
  630. if (v1RP!=-999.) pv1[4][fCent][2]->Fill(pt,v1RP);
  631. hpt[fCent][ipt][2]->Fill(pt);
  632. if(fCent>0&&fCent<4){
  633. hv22[0][ipt][2]->Fill(v2tpc);
  634. hv22[1][ipt][2]->Fill(v2rxn);
  635. hv22[2][ipt][2]->Fill(v2bbc);
  636. hv22[3][ipt][2]->Fill(v2fhcalFull);
  637. hv22[4][ipt][2]->Fill(v2RP);
  638. hv12[3][ipt][2]->Fill(v1fhcalFull);
  639. hv12[4][ipt][2]->Fill(v1RP);
  640. if (v2tpc!=-999.) pv22[0][2]->Fill(pt,v2tpc);
  641. if (v2rxn!=-999.) pv22[1][2]->Fill(pt,v2rxn);
  642. if (v2bbc!=-999.) pv22[2][2]->Fill(pt,v2bbc);
  643. //if (v2fhcal!=-999.) pv22[3][2]->Fill(pt,v2fhcal);
  644. if (v2fhcalFull!=-999.) pv22[3][2]->Fill(pt,v2fhcalFull);
  645. if (v2RP!=-999.) pv22[4][2]->Fill(pt,v2RP);
  646. if (v1fhcalFull!=-999.) pv12[3][2]->Fill(pt,v1fhcalFull);
  647. if (v1RP!=-999.) pv12[4][2]->Fill(pt,v1RP);
  648. }
  649. }// end of kaon selection
  650. if ( pdg[itrk]==2212){
  651. hv2[0][fCent][ipt][3]->Fill(v2tpc);
  652. hv2[1][fCent][ipt][3]->Fill(v2rxn);
  653. hv2[2][fCent][ipt][3]->Fill(v2bbc);
  654. hv2[3][fCent][ipt][3]->Fill(v2fhcalFull);
  655. hv2[4][fCent][ipt][3]->Fill(v2RP);
  656. hv1[3][fCent][ipt][3]->Fill(v1fhcalFull);
  657. hv1[4][fCent][ipt][3]->Fill(v1RP);
  658. if (v2tpc!=-999.) pv2[0][fCent][3]->Fill(pt,v2tpc);
  659. if (v2rxn!=-999.) pv2[1][fCent][3]->Fill(pt,v2rxn);
  660. if (v2bbc!=-999.) pv2[2][fCent][3]->Fill(pt,v2bbc);
  661. //if (v2fhcal!=-999.) pv2[3][fCent][3]->Fill(pt,v2fhcal);
  662. if (v2fhcalFull!=-999.) pv2[3][fCent][3]->Fill(pt,v2fhcalFull);
  663. if (v2RP!=-999.) pv2[4][fCent][3]->Fill(pt,v2RP);
  664. if (v1fhcalFull!=-999.) pv1[3][fCent][3]->Fill(pt,v1fhcalFull);
  665. if (v1RP!=-999.) pv1[4][fCent][3]->Fill(pt,v1RP);
  666. hpt[fCent][ipt][3]->Fill(pt);
  667. if(fCent>0&&fCent<4){
  668. hv22[0][ipt][3]->Fill(v2tpc);
  669. hv22[1][ipt][3]->Fill(v2rxn);
  670. hv22[2][ipt][3]->Fill(v2bbc);
  671. hv22[3][ipt][3]->Fill(v2fhcalFull);
  672. hv22[4][ipt][3]->Fill(v2RP);
  673. hv12[3][ipt][3]->Fill(v1fhcalFull);
  674. hv12[4][ipt][3]->Fill(v1RP);
  675. if (v2tpc!=-999.) pv22[0][3]->Fill(pt,v2tpc);
  676. if (v2rxn!=-999.) pv22[1][3]->Fill(pt,v2rxn);
  677. if (v2bbc!=-999.) pv22[2][3]->Fill(pt,v2bbc);
  678. //if (v2fhcal!=-999.) pv22[3][3]->Fill(pt,v2fhcal);
  679. if (v2fhcalFull!=-999.) pv22[3][3]->Fill(pt,v2fhcalFull);
  680. if (v2RP!=-999.) pv22[4][3]->Fill(pt,v2RP);
  681. if (v1fhcalFull!=-999.) pv12[3][3]->Fill(pt,v1fhcalFull);
  682. if (v1RP!=-999.) pv12[4][3]->Fill(pt,v1RP);
  683. }
  684. }// end of proton selection
  685. }
  686. if(pt>MpdPtMin&&pt<MpdPtMax){
  687. pv1_y[3][fCent][0]->Fill(rapidity,cos(1.0 * (phi-fhcalFullEP_phi) )/res1fhcalFull[fCent]);
  688. pv1_y[4][fCent][0]->Fill(rapidity,cos(1.0 * (dphiRP) ));
  689. if(fCent>0&&fCent<4){
  690. pv12_y[3][0]->Fill(rapidity,cos(1.0 * (phi-fhcalFullEP_phi) )/res1fhcalFull[fCent]);
  691. pv12_y[4][0]->Fill(rapidity,cos(1.0 * (dphiRP) ));
  692. }
  693. if ( pdg[itrk]==211){ // && pt > StarPionPtMin & p < StarPionPMax){
  694. pv1_y[3][fCent][1]->Fill(rapidity,cos(1.0 * (oldphiV1 - fhcalFullEP_phi) )/res1fhcalFull[fCent]);
  695. pv1_y[4][fCent][1]->Fill(rapidity,cos(1.0 * (dphiRP) ));
  696. if(fCent>0&&fCent<4){
  697. pv12_y[3][1]->Fill(rapidity,cos(1.0 * (phi-fhcalFullEP_phi) )/res1fhcalFull[fCent]);
  698. pv12_y[4][1]->Fill(rapidity,cos(1.0 * (dphiRP) ));
  699. }
  700. }
  701. if ( pdg[itrk]==321){
  702. pv1_y[3][fCent][2]->Fill(rapidity,cos(1.0 * (phi-fhcalFullEP_phi) )/res1fhcalFull[fCent]);
  703. pv1_y[4][fCent][2]->Fill(rapidity,cos(1.0 * (dphiRP) ));
  704. if(fCent>0&&fCent<4){
  705. pv12_y[3][2]->Fill(rapidity,cos(1.0 * (phi-fhcalFullEP_phi) )/res1fhcalFull[fCent]);
  706. pv12_y[4][2]->Fill(rapidity,cos(1.0 * (dphiRP) ));
  707. }
  708. }
  709. if ( pdg[itrk]==2212){ // && pt > StarProtonPtMin && pt < StarProtonPtMax){
  710. pv1_y[3][fCent][3]->Fill(rapidity,cos(1.0 * (phi-fhcalFullEP_phi) )/res1fhcalFull[fCent]);
  711. pv1_y[4][fCent][3]->Fill(rapidity,cos(1.0 * (dphiRP) ));
  712. if(fCent>0&&fCent<4){
  713. pv12_y[3][3]->Fill(rapidity,cos(1.0 * (phi-fhcalFullEP_phi) )/res1fhcalFull[fCent]);
  714. pv12_y[4][3]->Fill(rapidity,cos(1.0 * (dphiRP) ));
  715. }
  716. }
  717. }
  718. }// end of the track loop
  719. }// end of centrality selection
  720. }
  721. // Urqmd 7.7 GeV
  722. int FlowANA::GetCentrality10_RefMult( double refMult ){
  723. int fcent;
  724. if ( refMult>=268 ) fcent = 0; // 0-10%
  725. else if( refMult>=185 ) fcent = 1; //10-20%
  726. else if( refMult>=126 ) fcent = 2; //20-30%
  727. else if( refMult>=83 ) fcent = 3; //30-40%
  728. else if( refMult>=52 ) fcent = 4; //40-50%
  729. else if( refMult>= 21 ) fcent = 5; //50-60%
  730. else if( refMult>= 17 ) fcent = 6; //60-70%
  731. else if( refMult>= 9 ) fcent = 7; //70-80%
  732. else fcent =-1;
  733. return fcent;
  734. }
  735. int FlowANA::GetCentrality10_RefMultPHENIX( double refMult ){
  736. int fcent;
  737. if ( refMult>=516 ) fcent = 0; // 0-10%
  738. else if( refMult>=382 ) fcent = 1; //10-20%
  739. else if( refMult>=280 ) fcent = 2; //20-30%
  740. else if( refMult>=199 ) fcent = 3; //30-40%
  741. else if( refMult>=137 ) fcent = 4; //40-50%
  742. else if( refMult>= 90 ) fcent = 5; //50-60%
  743. else if( refMult>= 55 ) fcent = 6; //60-70%
  744. else if( refMult>= 31 ) fcent = 7; //70-80%
  745. else fcent =-1;
  746. return fcent;
  747. }
  748. /*int FlowANA::GetCentrality10_Bimp( float bimp ){
  749. int fcent;
  750. if ( bimp<4.17 ) fcent = 0; // 0-10%
  751. else if( bimp<6.02 ) fcent = 1; //10-20%
  752. else if( bimp<7.38 ) fcent = 2; //20-30%
  753. else if( bimp<8.53 ) fcent = 3; //30-40%
  754. else if( bimp<9.56) fcent = 4; //40-50%
  755. else if( bimp<10.50) fcent = 5; //50-60%
  756. else if( bimp<11.35) fcent = 6; //60-70%
  757. else if( bimp<12.19) fcent = 7; //70-80%
  758. else fcent =-1;
  759. return fcent;
  760. }*/
  761. int FlowANA::GetCentrality10_Bimp( float bimp ){
  762. int fcent;
  763. if ( bimp<4.5 ) fcent = 0; // 0-10%
  764. else if( bimp<6.3 ) fcent = 1; //10-20%
  765. else if( bimp<7.73 ) fcent = 2; //20-30%
  766. else if( bimp<8.92 ) fcent = 3; //30-40%
  767. else if( bimp<9.99) fcent = 4; //40-50%
  768. else if( bimp<10.83) fcent = 5; //50-60%
  769. else if( bimp<11.78) fcent = 6; //60-70%
  770. else if( bimp<12.61) fcent = 7; //70-80%
  771. else fcent =-1;
  772. return fcent;
  773. }
  774. int FlowANA::GetCentrality10_BimpExp( float bimp ){
  775. int fcent;
  776. if ( bimp<4.68 ) fcent = 0; // 0-10%
  777. else if( bimp<6.47 ) fcent = 1; //10-20%
  778. else if( bimp<7.99 ) fcent = 2; //20-30%
  779. else if( bimp<9.31 ) fcent = 3; //30-40%
  780. else if( bimp<10.48 ) fcent = 4; //40-50%
  781. else if( bimp<11.49 ) fcent = 5; //50-60%
  782. else if( bimp<12.35) fcent = 6; //60-70%
  783. else if( bimp<13.0) fcent = 7; //70-80%
  784. else fcent =-1;
  785. return fcent;
  786. }