1 void centralityData(
const char* infile,
int writeAscii=0,
int makeGif=0) {
21 tf =
new TFile(infile);
26 const char* names[] = {
"hNEvent",
"hnt",
"href",
"hnumPrim",
"hctb",
"hmeanpt"};
31 for(i=0; i<NUM; i++) {
33 hin[i] = (TH1F*)tf->Get(name);
35 cout <<
" ERROR reading " << name << endl;
40 if (i==0) name =
"hnev";
42 hin14[i] = (TH1F*)tf->Get(name);
46 name = infile; name +=
": centrality";
47 c1 =
new TCanvas(name, name, 750, 500);
49 for(i=0; i<NUM; i++) {
57 if(makeGif) c1->Print(
"cent.gif");
59 name = infile; name +=
": powerlaw";
60 c2 =
new TCanvas(name, name, 750, 500);
62 for(i=0; i<NUM; i++) {
66 if(makeGif) c2->Print(
"cent-power.gif");
72 const char* fnames[] = {
"nch",
"ntrack",
"refMult",
"numPrim",
"ctb",
"meanpt"};
75 name = fnames[i]; name+=
".txt";
76 cout << endl << name << endl;
77 cout <<
"Binning:\t" << hin[i]->GetNbinsX() <<
" bins\tmin=" << hin[i]->GetXaxis()->GetXmin() <<
"\tmax=" << hin[i]->GetXaxis()->GetXmax() << endl;
79 if (i>3)
for(
int j=1; j<=hin[i]->GetNbinsX(); j++) out << hin[i]->GetBinCenter(j) <<
"\t" << hin[i]->GetBinContent(j) << endl;
80 else for(
int j=1; j<=hin[i]->GetNbinsX(); j++) out << (
int)hin[i]->GetBinCenter(j) <<
"\t" << hin[i]->GetBinContent(j) << endl;
85 name = fnames[i]; name+=
"14.txt";
86 cout << endl << name << endl;
87 cout <<
"Binning:\t" << hin14[i]->GetNbinsX() <<
" bins\tmin=" << hin14[i]->GetXaxis()->GetXmin() <<
"\tmax=" << hin14[i]->GetXaxis()->GetXmax() << endl;
89 for(
int j=1; j<=hin14[i]->GetNbinsX(); j++) out << hin14[i]->GetBinCenter(j) <<
"\t" << hin14[i]->GetBinContent(j) << endl;