1 #include "commonmacro/common.h"
2 #include "common/Name.cc"
3 #include "commonmacro/histutil.h"
5 void rawSpectra(
const char* inName=
6 "links/P01hi.minbias.2000.hist/hianalysis_1000.hist.root",
7 const char* psDir=
"ps",
9 const char* outDir=
"./",
10 const char* more =
"west",
13 cout <<
"--------------------------" << endl;
14 cout <<
"in name=" << inName << endl
15 <<
"ps dir=" << psDir << endl
16 <<
"cut=" << cut << endl;
17 cout <<
"--------------------------" << endl;
19 inRoot =
new TFile(inName);
22 cout <<
"cannot find the infile" << endl;
25 TH1* ha,*hb; TCanvas c1(
"c1",
"c1",400,500);
26 gStyle->SetOptLogy(1); gStyle->SetPadGridX(1); gStyle->SetPadGridY(1);
28 const int nBin=2;
float min=0;
float max=1e6;
29 for(
int iBin=0;iBin<nBin;iBin++){
30 sprintf(title,
"raw yield bin %d (cut %d)",iBin,cut);
31 Divide(&c1,1,3,title,inName);
32 setName(name,
"h1Raw",iBin); cout << name<< endl;
33 c1.cd(1);ha=(TH1*)inRoot.Get(name); sTitle=name;
34 ha->SetMarkerStyle(8);
35 SetRange(ha->GetXaxis(),2,6);
37 for(
int ic=0;ic<2;ic++){
38 setName(name,
"h1Raw",iBin,sPM[ic].Data());
39 c1.cd(ic+2); ha=(TH1*)inRoot.Get(name);
40 ha->SetMarkerStyle(8);
41 SetRange(ha->GetXaxis(),2,6);ha->Draw();
44 Print(&c1,psDir,sTitle.Data());