StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
exampleAnalysis3.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(500,500);
9 c1->Divide(2,2);
10 
11 gStyle->SetOptTitle(0);
12 gStyle->SetOptStat(0);
13 
14 
15 gROOT->LoadMacro("load2ptLibs.C");
16 load2ptLibs();
17 gSystem->Load("StEStructPoolSupport.so");
18 
19 int nCent = 3;
20 TFile *tf[nCent][12];
21 StEStructSupport *ehelp[nCent][12];
22 TH2F **ytyt[nCent][12];
23 TH2F **ptdedp[nCent][12];
24 TH2F **dedp[nCent][12];
25 
26 const char* oname[]={"all","awayside","nearside","soft","softAS","softNS","neck","neckAS","neckNS","hard","hardAS","hardNS"};
27 char fileName[1024];
28 char *dir = "/common/star/stardata/estruct/prindle/Hijing/auau200/QuenchOff/noSymm_mode3";
29 char *dir = "/common/star/stardata/estruct/prindle/Data/pp200/pidTest/productionMinBias_year5";
30 //char *dir = "/star/data01/pwg/estruct/prindle/Data/auau19/2001/2pt/MinBias_FewerBins2";
31 float sf[2] = {0.98,0.98};
32 {
33 for (int ic=0;ic<nCent;ic++) {
34  for (int it=0;it<12;it++) {
35  sprintf(fileName,"%s/data/Data%i%s.root",dir,ic,oname[it]);
36  tf[ic][it] = new TFile(fileName);
37  ehelp[ic][it] = new StEStructSupport(tf[ic][it],1);
38  ytyt[ic][it] = (TH2F**) ehelp[ic][it]->buildChargeTypes("YtYt",0);
39  for(int j=0;j<4;j++){
40  float dx = ytyt[ic][it][j]->GetXaxis()->GetBinWidth(1);
41  float dy = ytyt[ic][it][j]->GetYaxis()->GetBinWidth(1);
42  float sf2 = sqrt(dx*dy);
43  ytyt[ic][it][j]->Scale(1.0/sf2);
44  }
45  ptdedp[ic][it] = (TH2F**) ehelp[ic][it]->buildPtChargeTypes("DEtaDPhi",0,1);
46  dedp[ic][it] = (TH2F**) ehelp[ic][it]->buildChargeTypes("DEtaDPhi",0);
47  }
48 }
49 }
50 
51 {
52  for (int i=0;i<nCent;i++) {
53  ytyt[i][2]->SetMaximum(0.02);
54  ytyt[i][3]->SetMaximum(0.04);
55  }
56 }
57 
58 
59 int ipid = 0;
60 int icharge = 1;
61 {
62 for (int ic=0;ic<nCent;ic++) {
63  c1->cd(ic+1);
64  gPad->SetPhi(-70);
65  gPad->SetTheta(45);
66  ytyt[ic][ipid][icharge]->Draw("surf1");
67 }
68 }
69 
70 {
71 const char* oname[]={"all","awayside","nearside","soft","softAS","softNS",
72  "neck","neckAS","neckNS","hard","hardAS","hardNS"};
73 }
74 char *chargeCombo[] = {"LS", "US", "CD", "CI"};
75 char buffer[1024];
76 int icut = 0;
77 int icharge = 3;
78 {
79  for (int ic=0;ic<nCent;ic++) {
80  c1->cd(ic+1);
81  gPad->SetPhi();
82  gPad->SetTheta();
83  dedp[ic][icut][icharge]->Draw("surf1");
84  }
85 }
86 
87 
88 
89 
90 // Write histograms out in ascii format.
91 int dumpEm[] = {0, 3, 9};
92 {
93 for (int ic=0;ic<nCent;ic++) {
94  for (int id=0;id<3;id++) {
95  for (int ih=0;ih<4;ih++) {
96  sprintf(fileName,"%s/txt/asciiYtYtData%i%s_%i.txt",dir,ic,oname[dumpEm[id]],ih);
97  ehelp[ic][dumpEm[id]]->writeAscii( ytyt[ic][dumpEm[id]], ih, fileName, 0 );
98  sprintf(fileName,"%s/txt/asciidedpData%i%s_%i.txt",dir,ic,oname[dumpEm[id]],ih);
99  ehelp[ic][dumpEm[id]]->writeAscii( dedp[ic][dumpEm[id]], ih, fileName, 0 );
100  sprintf(fileName,"%s/txt/asciiptdedpData%i%s_%i.txt",dir,ic,oname[dumpEm[id]],ih);
101  ehelp[ic][dumpEm[id]]->writeAscii( ptdedp[ic][dumpEm[id]], ih, fileName, 0 );
102  }
103  }
104 }
105 }