StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
exampleAnalysis5.C
1 
2 TCanvas* c1=new TCanvas("c1");
3 .L makePlots.C
4 .L setupPalette.C
5 setupPalette(); // set up the colors
6 c1->Clear();
7 
8 c1->SetWindowSize(750,500);
9 c1->Divide(3,2);
10 
11 gStyle->SetOptTitle(0);
12 gStyle->SetOptStat(0);
13 
14 .x load2ptLibs.C();
15 gSystem->Load("StEStructPoolSupport.so");
16 
17 int nCent = 6;
18 TFile *tf[nCent][8];
19 StEStructSupport *ehelp[nCent][8];
20 TH2F **ptdedp[nCent][8];
21 TH2F **ptdedpC[nCent][8];
22 TH2F **dedp[nCent][8];
23 TH2F **dedpC[nCent][8];
24 TH2F **ytyt[nCent][8];
25 TH2F **ytytC[nCent][8];
26 TH2F **ptetaeta[nCent][8];
27 TH2F **ptetaetaC[nCent][8];
28 TH2F **etaeta[nCent][8];
29 TH2F **etaetaC[nCent][8];
30 TH2F **ptphiphi[nCent][8];
31 TH2F **ptphiphiC[nCent][8];
32 TH2F **phiphi[nCent][8];
33 TH2F **phiphiC[nCent][8];
34 
35 const char* oname[]={"all","pi_pi","pi_K","pi_p","K_K","K_p","p_p","o_o"};
36 char fileName[1024];
37 //char *dir = "/common/star/stardata/estruct/prindle/Data/auau200/2004/MinBias/2pt/zBinning/data";
38 //char *dir = "/common/star/stardata/estruct/prindle/Pythia/pp200GeV/2pt/pid/data";
39 //char *dir = "/common/star/stardata/estruct/prindle/Hijing/cucu200/QuenchOff/data";
40 //char *dir = "/common/star/stardata/estruct/prindle/Hijing/cucu200/JetOff/data";
41 //char *dir = "/star/data01/pwg/estruct/prindle/Data/cucu200/2007ib/cuProdutionMinBias_test3/data";
42 //char *dir = "/auto/pdsfdv34/estruct/prindle/Data/auau62/2004/MinBias/2pt/data/combineCents";
43 //char *dir = "/auto/pdsfdv34/estruct/prindle/Data/auau200/2001/MinBiasVertex/2pt/data";
44 //char *dir = "/auto/pdsfdv34/estruct/prindle/Data/auau200/2004/MinBias/2pt/zBinning/data";
45 char *dir = "/star/data01/pwg/estruct/prindle/Data/cucu200/2007ib/cuProdutionMinBias/data";
46 //char *dir = "/star/data01/pwg/estruct/prindle/Data/cucu62/2007ib/cuProductionMinBias/data";
47 //char *dir = "/common/star/stardata/estruct/prindle/Therminator/standardStats2/data";
48 //char *dir = "/common/star/stardata/estruct/prindle/Therminator/kaons/data";
49 //char *dir = "/common/star/stardata/estruct/prindle/Therminator/Delta_phi/data";
50 //char *dir = "/common/star/stardata/estruct/prindle/Therminator/Lambda_rho/data";
51 {
52  for (int ic=0;ic<nCent;ic++) {
53  for (int ipid=0;ipid<8;ipid++) {
54  sprintf(fileName,"%s/Data%i%s.root",dir,ic,oname[ipid]);
55  tf[ic][ipid] = new TFile(fileName);
56  ehelp[ic][ipid] = new StEStructSupport(tf[ic][ipid],0);
57  ehelp[ic][ipid]->mapplyDEtaFix = false;
58  ehelp[ic][ipid]->mPairNormalization = false;
59  if ((0 ==ipid) || (1 == ipid) || (4 == ipid) || (6 == ipid) || (7 == ipid)) {
60  ehelp[ic][ipid]->mIdenticalPair = true;
61  } else {
62  ehelp[ic][ipid]->mIdenticalPair = false;
63  }
64  int subtract = 1;
65  ptdedpC[ic][ipid] = (TH2F**) ehelp[ic][ipid]->buildPtCommon("DEtaDPhi",2,subtract);
66  ptetaetaC[ic][ipid] = (TH2F**) ehelp[ic][ipid]->buildPtCommon("EtaEta",2,subtract);
67  ptphiphiC[ic][ipid] = (TH2F**) ehelp[ic][ipid]->buildPtCommon("PhiPhi",2,subtract);
68 
69  ptdedp[ic][ipid] = (TH2F**) ehelp[ic][ipid]->buildPtChargeTypes("DEtaDPhi",2,subtract);
70  ptetaeta[ic][ipid] = (TH2F**) ehelp[ic][ipid]->buildPtChargeTypes("EtaEta",2,subtract);
71  ptphiphi[ic][ipid] = (TH2F**) ehelp[ic][ipid]->buildPtChargeTypes("PhiPhi",2,subtract);
72 
73  dedpC[ic][ipid] = (TH2F**) ehelp[ic][ipid]->buildCommon("DEtaDPhi",2);
74  ytytC[ic][ipid] = (TH2F**) ehelp[ic][ipid]->buildCommon("YtYt",3);
75  etaetaC[ic][ipid] = (TH2F**) ehelp[ic][ipid]->buildCommon("EtaEta",2);
76  phiphiC[ic][ipid] = (TH2F**) ehelp[ic][ipid]->buildCommon("PhiPhi",2);
77 
78  dedp[ic][ipid] = (TH2F**) ehelp[ic][ipid]->buildChargeTypes("DEtaDPhi",2);
79  ytyt[ic][ipid] = (TH2F**) ehelp[ic][ipid]->buildChargeTypes("YtYt",3);
80  etaeta[ic][ipid] = (TH2F**) ehelp[ic][ipid]->buildChargeTypes("EtaEta",2);
81  phiphi[ic][ipid] = (TH2F**) ehelp[ic][ipid]->buildChargeTypes("PhiPhi",2);
82  }
83  }
84 }
85 
86 // The C (as in dedpC) is for common. 0 -> ++, 1 -> -+, 2 -> +-. 3 -> --.
87 // The -+ is only populated when we have different particle types.
88 // Without the C we have 0 -> LS, 1 -> US, 2-> CD, 3 -> CI
89 int ipid = 1;
90 int icharge = 0;
91 {
92  for (int ic=0;ic<nCent;ic++) {
93  c1->cd(ic+1);
94  gPad->SetPhi(30);
95  gPad->SetTheta(50);
96  ytyt[ic][ipid][icharge]->Draw("surf1");
97  }
98 }
99 
100 int ic = 0;
101 int icharge = 1;
102 {
103  for (int ipid=1;ipid<7;ipid++) {
104  c1->cd(ipid);
105  gPad->SetPhi(30);
106  gPad->SetTheta(50);
107  dedp[ic][ipid][icharge]->Draw("surf1");
108  }
109 }
110 
111 const char* pidName[] = {"all", "pipi", "piK", "pip", "KK", "KP", "pp", "oo"};
112 const char* chargeName[] = {"_LS_", "_US_", "_CD_", "_CI_"};
113 const char* chargeType[] = {"_PP_", "_PM_", "_MP_", "_MM_"};
114 TFile *out = new TFile("CuCu200GeV_histos.root","CREATE");
115 //TFile *out = new TFile("therminatorLambda_rho_histos.root","CREATE");
116 {
117  for (int ipid=0;ipid<8;ipid++) {
118  for (int icharge=0;icharge<4;icharge++) {
119  for (int ic=0;ic<nCent;ic++) {
120  TString name(pidName[ipid]);
121  name += "_NDEtaDPhi"; name += chargeName[icharge]; name += ic;
122  dedp[ic][ipid][icharge]->SetName(name.Data());
123  dedp[ic][ipid][icharge]->SetTitle(name.Data());
124  dedp[ic][ipid][icharge]->Write();
125  TString name(pidName[ipid]);
126  name += "_PtDEtaDPhi"; name += chargeName[icharge]; name += ic;
127  ptdedp[ic][ipid][icharge]->SetName(name.Data());
128  ptdedp[ic][ipid][icharge]->SetTitle(name.Data());
129  ptdedp[ic][ipid][icharge]->Write();
130  TString name(pidName[ipid]);
131  name += "_YtYt"; name += chargeName[icharge]; name += ic;
132  ytyt[ic][ipid][icharge]->SetName(name.Data());
133  ytyt[ic][ipid][icharge]->SetTitle(name.Data());
134  ytyt[ic][ipid][icharge]->Write();
135 
136  TString name(pidName[ipid]);
137  name += "_NDEtaDPhi"; name += chargeType[icharge]; name += ic;
138  dedpC[ic][ipid][icharge]->SetName(name.Data());
139  dedpC[ic][ipid][icharge]->SetTitle(name.Data());
140  dedpC[ic][ipid][icharge]->Write();
141  TString name(pidName[ipid]);
142  name += "_PtDEtaDPhi"; name += chargeType[icharge]; name += ic;
143  ptdedpC[ic][ipid][icharge]->SetName(name.Data());
144  ptdedpC[ic][ipid][icharge]->SetTitle(name.Data());
145  ptdedpC[ic][ipid][icharge]->Write();
146  TString name(pidName[ipid]);
147  name += "_YtYt"; name += chargeType[icharge]; name += ic;
148  ytytC[ic][ipid][icharge]->SetName(name.Data());
149  ytytC[ic][ipid][icharge]->SetTitle(name.Data());
150  ytytC[ic][ipid][icharge]->Write();
151 
152 
153  TString name(pidName[ipid]);
154  name += "_NEtaEta"; name += chargeName[icharge]; name += ic;
155  etaeta[ic][ipid][icharge]->SetName(name.Data());
156  etaeta[ic][ipid][icharge]->SetTitle(name.Data());
157  etaeta[ic][ipid][icharge]->Write();
158  TString name(pidName[ipid]);
159  name += "_PtEtaEta"; name += chargeName[icharge]; name += ic;
160  ptetaeta[ic][ipid][icharge]->SetName(name.Data());
161  ptetaeta[ic][ipid][icharge]->SetTitle(name.Data());
162  ptetaeta[ic][ipid][icharge]->Write();
163 
164  TString name(pidName[ipid]);
165  name += "_NEtaEta"; name += chargeType[icharge]; name += ic;
166  etaetaC[ic][ipid][icharge]->SetName(name.Data());
167  etaetaC[ic][ipid][icharge]->SetTitle(name.Data());
168  etaetaC[ic][ipid][icharge]->Write();
169  TString name(pidName[ipid]);
170  name += "_PtEtaEta"; name += chargeType[icharge]; name += ic;
171  ptetaetaC[ic][ipid][icharge]->SetName(name.Data());
172  ptetaetaC[ic][ipid][icharge]->SetTitle(name.Data());
173  ptetaetaC[ic][ipid][icharge]->Write();
174 
175 
176  TString name(pidName[ipid]);
177  name += "_NPhiPhi"; name += chargeName[icharge]; name += ic;
178  phiphi[ic][ipid][icharge]->SetName(name.Data());
179  phiphi[ic][ipid][icharge]->SetTitle(name.Data());
180  phiphi[ic][ipid][icharge]->Write();
181  TString name(pidName[ipid]);
182  name += "_PtPhiPhi"; name += chargeName[icharge]; name += ic;
183  ptphiphi[ic][ipid][icharge]->SetName(name.Data());
184  ptphiphi[ic][ipid][icharge]->SetTitle(name.Data());
185  ptphiphi[ic][ipid][icharge]->Write();
186 
187  TString name(pidName[ipid]);
188  name += "_NPhiPhi"; name += chargeType[icharge]; name += ic;
189  phiphiC[ic][ipid][icharge]->SetName(name.Data());
190  phiphiC[ic][ipid][icharge]->SetTitle(name.Data());
191  phiphiC[ic][ipid][icharge]->Write();
192  TString name(pidName[ipid]);
193  name += "_PtPhiPhi"; name += chargeType[icharge]; name += ic;
194  ptphiphiC[ic][ipid][icharge]->SetName(name.Data());
195  ptphiphiC[ic][ipid][icharge]->SetTitle(name.Data());
196  ptphiphiC[ic][ipid][icharge]->Write();
197 
198  }
199  }
200  }
201 }
202 out->Close();
203 delete out;
204 
205 c1->Clear();
206 c1->SetWindowSize(350,350);
207 gStyle->SetOptTitle();
208 gStyle->SetTitleBorderSize(0)
209 
210 char label[1024];
211 const char* texPidName[]={"all","#pi#pi","#piK","#piP","KK","KP","PP","noPID",};
212 const char* pidName[]={"all","pipi","piK","piP","KK","KP","PP","noPID",};
213 const char* chargeName[] = {"LS", "US", "CD", "CI"};
214 const char* centName[] = {"2-4", "5-7", "8-10", "11-13", "14-25"};
215 const char* centName[] = {"0-5", "5-10", "10-20", "20-30", "30-40", "40-50", "50-60", "60-70", "70-80", "80-90", "90-100"};
216 const char* centName[] = {"90-100" "80-90", "70-80", "60-70", "50-60", "40-50", "30-40", "20-30", "10-20", "5-10", "0-5"};
217 const char* centName[] = {"0-30", "30-60", "60-100"};
218 {
219  for (int ipid=0;ipid<8;ipid++) {
220  for (int icharge=0;icharge<4;icharge++) {
221  for (int ic=0;ic<nCent;ic++) {
222  sprintf(label,"N: %s, %s, multiplicity %s",texPidName[ipid],chargeName[icharge],centName[ic]);
223  dedp[ic][ipid][icharge]->SetTitle(label);
224  TAxis *x = dedp[ic][ipid][icharge]->GetXaxis();
225  TAxis *y = dedp[ic][ipid][icharge]->GetYaxis();
226  x->SetTitleSize(0.07);
227  x->SetTitleColor(1);
228  x->SetTitleOffset(1.0);
229  x->SetNdivisions(505);
230  x->SetLabelSize(0.05);
231  x->SetTitle("#eta_{#Delta}");
232  y->SetTitleSize(0.07);
233  y->SetTitleOffset(1.0);
234  y->SetTitleColor(1);
235  y->SetNdivisions(505);
236  y->SetLabelSize(0.05);
237  y->SetTitle("#phi_{#Delta}");
238  gPad->SetPhi(30);
239  gPad->SetTheta(50);
240  dedp[ic][ipid][icharge]->Draw("surf1");
241  sprintf(fileName,"auto_N_%s-%s_%s.gif",pidName[ipid],chargeName[icharge],centName[ic]);
242  c1->Print(fileName);
243  }
244  }
245  }
246 }
247 char textFileName[1024]
248 FILE *out;
249 {
250  for (int ipid=0;ipid<8;ipid++) {
251  for (int icharge=0;icharge<4;icharge++) {
252  for (int ic=0;ic<nCent;ic++) {
253  sprintf( textFileName, "auto_N_%s-%s_%s.txt",pidName[ipid],chargeName[icharge],centName[ic]);
254  out = fopen(textFileName,"w");
255  for (int ix=1;ix<dedp[ic][ipid][icharge]->GetNbinsX();ix++) {
256  for (int iy=1;iy<dedp[ic][ipid][icharge]->GetNbinsY();iy++) {
257  fprintf(out,"%i %i %f\n",ix,iy,dedp[ic][ipid][icharge]->GetBinContent(ix,iy));
258  }
259  }
260  fclose(out);
261  }
262  }
263  }
264 }
265 
266