StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
showHistos9.C
1 // This is an example macro reading the \Delta\rho/sqrt(\rho) files and
2 // putting them into histogram arrays. This makes it easier to plot
3 // specific histograms on a local computer.
4 
5 // This particular file grabs a subset of the pid histograms.
6 
7 TFile *data = new TFile("/common/star/stardata/estruct/prindle/Hijing/cucu62/mode3_QuenchOff/data/DeltaRhoByRho_1.root");
8 
9 const char* oname[]={"all","below4","below3","below2","below1","above1","above2","above3","above4","one","onetwo","onethree","two","twothree","three"};
10 const char* chargeName[] = {"_LS_", "_US_", "_CD_", "_CI_"};
11 const char* chargeType[] = {"_PP_", "_PM_", "_MP_", "_MM_"};
12 
13 int nCent = 3;
14 TH2D *dedp[nCent][12][4];
15 TH2D *dedpC[nCent][12][4];
16 TH2D *ptdedp[nCent][12][4];
17 TH2D *ptdedpC[nCent][12][4];
18 TH2D *ytyt[nCent][12][4];
19 TH2D *ytytC[nCent][12][4];
20 TH2D *etaeta[nCent][12][4];
21 TH2D *etaetaC[nCent][12][4];
22 TH2D *ptetaeta[nCent][12][4];
23 TH2D *ptetaetaC[nCent][12][4];
24 TH2D *phiphi[nCent][12][4];
25 TH2D *phiphiC[nCent][12][4];
26 TH2D *ptphiphi[nCent][12][4];
27 TH2D *ptphiphiC[nCent][12][4];
28 
29 {
30  for (int ibin=0;ibin<12;ibin++) {
31  for (int ic=0;ic<nCent;ic++) {
32  for (int icharge=0;icharge<4;icharge++) {
33  TString name(binName[ibin]);
34  name += "_NDEtaDPhi"; name += chargeName[icharge]; name += ic;
35  dedp[ic][ibin][icharge] = (TH2D *) gDirectory->Get(name.Data());
36  TString name(binName[ibin]);
37  name += "_PtDEtaDPhi"; name += chargeName[icharge]; name += ic;
38  ptdedp[ic][ibin][icharge] = (TH2D *) gDirectory->Get(name.Data());
39  TString name(binName[ibin]);
40  name += "_YtYt"; name += chargeName[icharge]; name += ic;
41  ytyt[ic][ibin][icharge] = (TH2D *) gDirectory->Get(name.Data());
42 
43  TString name(binName[ibin]);
44  name += "_NDEtaDPhi"; name += chargeType[icharge]; name += ic;
45  dedpC[ic][ibin][icharge] = (TH2D *) gDirectory->Get(name.Data());
46  TString name(binName[ibin]);
47  name += "_PtDEtaDPhi"; name += chargeType[icharge]; name += ic;
48  ptdedpC[ic][ibin][icharge] = (TH2D *) gDirectory->Get(name.Data());
49  TString name(binName[ibin]);
50  name += "_YtYt"; name += chargeType[icharge]; name += ic;
51  ytytC[ic][ibin][icharge] = (TH2D *) gDirectory->Get(name.Data());
52 
53 
54  TString name(binName[ibin]);
55  name += "_NEtaEta"; name += chargeName[icharge]; name += ic;
56  etaeta[ic][ibin][icharge] = (TH2D *) gDirectory->Get(name.Data());
57  TString name(binName[ibin]);
58  name += "_PtEtaEta"; name += chargeName[icharge]; name += ic;
59  ptetaeta[ic][ibin][icharge] = (TH2D *) gDirectory->Get(name.Data());
60 
61  TString name(binName[ibin]);
62  name += "_NEtaEta"; name += chargeType[icharge]; name += ic;
63  etaetaC[ic][ibin][icharge] = (TH2D *) gDirectory->Get(name.Data());
64  TString name(binName[ibin]);
65  name += "_PtEtaEta"; name += chargeType[icharge]; name += ic;
66  ptetaetaC[ic][ibin][icharge] = (TH2D *) gDirectory->Get(name.Data());
67 
68 
69  TString name(binName[ibin]);
70  name += "_NPhiPhi"; name += chargeName[icharge]; name += ic;
71  phiphi[ic][ibin][icharge] = (TH2D *) gDirectory->Get(name.Data());
72  TString name(binName[ibin]);
73  name += "_PtPhiPhi"; name += chargeName[icharge]; name += ic;
74  ptphiphi[ic][ibin][icharge] = (TH2D *) gDirectory->Get(name.Data());
75 
76  TString name(binName[ibin]);
77  name += "_NPhiPhi"; name += chargeType[icharge]; name += ic;
78  phiphiC[ic][ibin][icharge] = (TH2D *) gDirectory->Get(name.Data());
79  TString name(binName[ibin]);
80  name += "_PtPhiPhi"; name += chargeType[icharge]; name += ic;
81  ptphiphiC[ic][ibin][icharge] = (TH2D *) gDirectory->Get(name.Data());
82 
83  }
84  }
85  }
86 }
87 
88 TCanvas* c1=new TCanvas("c1");
89 gStyle->SetPalette(1); // set up the colors
90 c1->Clear();
91 
92 c1->SetWindowSize(1000,750);
93 c1->Divide(4,3);
94 
95 gStyle->SetOptTitle(0);
96 gStyle->SetOptStat(0);
97 
98 
99 int ic = 0;
100 int icharge = 3;
101 {
102  for (int ibin=0;ibin<12;ibin++) {
103  c1->cd(ibin+1);
104  gPad->SetPhi(30);
105  gPad->SetTheta(50);
106  ptphiphi[ic][ibin][icharge]->Draw("surf1");
107  }
108 }
109 
110 
111 
112 c1->Clear();
113 c1->SetWindowSize(350,350);
114 gStyle->SetOptTitle();
115 gStyle->SetTitleBorderSize(0)
116 
117 char label[1024];
118 const char* binName[]={"all","awayside","nearside","soft","softAS","softNS","neck","neckAS","neckNS","hard","hardAS","hardNS"};
119 const char* binBinName[]={"all","awayside","nearside","soft","softAS","softNS","neck","neckAS","neckNS","hard","hardAS","hardNS"};
120 const char* chargeName[] = {"LS", "US", "CD", "CI"};
121 const char* centName[] = {"0-17", "17-33", "33-50", "50-67", "67-83", "83-100"};
122 char fileName[1024]
123 {
124  for (int ibin=0;ibin<12;ibin++) {
125  for (int icharge=0;icharge<4;icharge++) {
126  for (int ic=0;ic<nCent;ic++) {
127  sprintf(label,"P: %s, %s, multiplicity %s",texBinName[ibin],chargeName[icharge],centName[ic]);
128  ptdedp[ic][ibin][icharge]->SetTitle(label);
129  TAxis *x = ptdedp[ic][ibin][icharge]->GetXaxis();
130  TAxis *y = ptdedp[ic][ibin][icharge]->GetYaxis();
131  x->SetTitleSize(0.07);
132  x->SetTitleColor(1);
133  x->SetTitleOffset(1.0);
134  x->SetNdivisions(505);
135  x->SetLabelSize(0.05);
136  x->SetTitle("#eta_{#Delta}");
137  y->SetTitleSize(0.07);
138  y->SetTitleOffset(1.0);
139  y->SetTitleColor(1);
140  y->SetNdivisions(505);
141  y->SetLabelSize(0.05);
142  y->SetTitle("#phi_{#Delta}");
143  gPad->SetPhi(30);
144  gPad->SetTheta(50);
145  ptdedp[ic][ibin][icharge]->Draw("surf1");
146  sprintf(fileName,"auto_P_%s-%s_%s.gif",binName[ibin],chargeName[icharge],centName[ic]);
147  c1->Print(fileName);
148  }
149  }
150  }
151 }
152 
153 
154 char textFileName[1024]
155 FILE *out;
156 {
157  for (int ibin=0;ibin<12;ibin++) {
158  for (int icharge=0;icharge<4;icharge++) {
159  for (int ic=0;ic<nCent;ic++) {
160  sprintf( textFileName, "auto_N_%s-%s_%s.txt",binName[ibin],chargeName[icharge],centName[ic]);
161  out = fopen(textFileName,"w");
162  for (int ix=1;ix<dedp[ic][ibin][icharge]->GetNbinsX();ix++) {
163  for (int iy=1;iy<dedp[ic][ibin][icharge]->GetNbinsY();iy++) {
164  fprintf(out,"%i %i %f\n",ix,iy,dedp[ic][ibin][icharge]->GetBinContent(ix,iy));
165  }
166  }
167  fclose(out);
168  }
169  }
170  }
171 }
172 
173