StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
exampleAnalysis0.C
1 // Set up canvas and load appropriate libraries.
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 gROOT->LoadMacro("load2ptLibs.C");
15 load2ptLibs();
16 gSystem->Load("StEStructPoolSupport.so");
17 
18 
19 // Use support code to combine charge types.
20 // I don't think the ytyt handling is up to date, and I don't
21 // know if PhiPhi is correct.
22 int nCent = 6;
23 TFile *tf[nCent];
24 StEStructSupport *ehelp[nCent];
25 TH2F **ytyt[nCent];
26 TH2F **ptdedp[nCent];
27 TH2F **dedp[nCent];
28 TH2F **phiphi[nCent];
29 
30 char fileName[1024];
31 char *dir = "/common/star/stardata/estruct/prindle/Hijing/auau200/QuenchOff/testMode0";
32 float sf[2] = {0.98,0.98};
33 {
34 for (int ic=0;ic<nCent;ic++) {
35  // The Symm part of this name refers to histogram files that have been
36  // processed through selectAllM0. If you don't care about DEtaDPhi
37  // or SEtaDPhi you can remove all the dedp stuff and then you don't
38  // need to process histograms through selectAllM0.
39  sprintf(fileName,"%s/data/Data%iSymm.root",dir,ic);
40  tf[ic] = new TFile(fileName);
41  ehelp[ic] = new StEStructSupport(tf[ic],1);
42  ytyt[ic] = (TH2F**) ehelp[ic]->buildNChargeTypes("YtYt");
43  // I don't think this sort of normalization is correct anymore.
44  for(int j=0;j<4;j++){
45  float dx = ytyt[ic][j]->GetXaxis()->GetBinWidth(1);
46  float dy = ytyt[ic][j]->GetYaxis()->GetBinWidth(1);
47  float sf2 = sqrt(dx*dy);
48  ytyt[ic][j]->Scale(1.0/sf2);
49  }
50  ptdedp[ic] = (TH2F**) ehelp[ic]->buildPtChargeTypes("DEtaDPhi",0,1);
51  dedp[ic] = (TH2F**) ehelp[ic]->buildNChargeTypes("DEtaDPhi");
52  // I think this is the way we get the PhiPhi histograms.
53  phiphi[ic] = (TH2F**) ehelp[ic]->buildNChargeTypes("PhiPhi");
54 }
55 }
56 
57 
58 // Now make some plots, one per centrality.
59 char *chargeCombo[] = {"LS", "US", "CD", "CI"};
60 char buffer[1024];
61 int icharge = 0;
62 {
63  for (int ic=0;ic<nCent;ic++) {
64  c1->cd(ic+1);
65  gPad->SetPhi();
66  gPad->SetTheta();
67  phiphi[ic][icharge]->Draw("surf1");
68  }
69 }
70 
71 
72 
73 {
74  for (int i=0;i<nCent;i++) {
75  ytyt[i][2]->SetMaximum(0.02);
76  ytyt[i][3]->SetMaximum(0.04);
77  }
78 }
79 
80 
81 int icharge = 1;
82 {
83 for (int ic=0;ic<nCent;ic++) {
84  c1->cd(ic+1);
85  gPad->SetPhi(-70);
86  gPad->SetTheta(45);
87  ytyt[ic][icharge]->Draw("surf1");
88 }
89 }
90 
91 
92 
93 // Write histograms out in ascii format. (Useful for moving data to
94 // matlab for example.)
95 {
96 for (int ic=0;ic<nCent;ic++) {
97  for (int ih=0;ih<4;ih++) {
98  sprintf(fileName,"%s/txt/asciiYtYtData%i_%i.txt",dir,ic,ih);
99  ehelp[ic][dumpEm[id]]->writeAscii( ytyt[ic], ih, fileName, 0 );
100  sprintf(fileName,"%s/txt/asciidedpData%i_%i.txt",dir,ic,ih);
101  ehelp[ic][dumpEm[id]]->writeAscii( dedp[ic], ih, fileName, 0 );
102  sprintf(fileName,"%s/txt/asciiptdedpData%i_%i.txt",dir,ic,ih);
103  ehelp[ic][dumpEm[id]]->writeAscii( ptdedp[ic], ih, fileName, 0 );
104  }
105 }
106 }