00001 #include "commonmacro/common.h"
00002 #include "common/Name.cc"
00003 #include "commonmacro/histutil.h"
00004
00005 void rawSpectra(const char* inName=
00006 "links/P01hi.minbias.2000.hist/hianalysis_1000.hist.root",
00007 const char* psDir="ps",
00008 int cut = 1,
00009 const char* outDir="./",
00010 const char* more = "west",
00011 float extraValue = 1)
00012 {
00013 cout << "--------------------------" << endl;
00014 cout << "in name=" << inName << endl
00015 << "ps dir=" << psDir << endl
00016 << "cut=" << cut << endl;
00017 cout << "--------------------------" << endl;
00018
00019 inRoot = new TFile(inName);
00020
00021 if(!inRoot){
00022 cout << "cannot find the infile" << endl;
00023 return;
00024 }
00025 TH1* ha,*hb; TCanvas c1("c1","c1",400,500);
00026 gStyle->SetOptLogy(1); gStyle->SetPadGridX(1); gStyle->SetPadGridY(1);
00027
00028 const int nBin=2; float min=0; float max=1e6;
00029 for(int iBin=0;iBin<nBin;iBin++){
00030 sprintf(title,"raw yield bin %d (cut %d)",iBin,cut);
00031 Divide(&c1,1,3,title,inName);
00032 setName(name,"h1Raw",iBin); cout << name<< endl;
00033 c1.cd(1);ha=(TH1*)inRoot.Get(name); sTitle=name;
00034 ha->SetMarkerStyle(8);
00035 SetRange(ha->GetXaxis(),2,6);
00036 ha->Draw();
00037 for(int ic=0;ic<2;ic++){
00038 setName(name,"h1Raw",iBin,sPM[ic].Data());
00039 c1.cd(ic+2); ha=(TH1*)inRoot.Get(name);
00040 ha->SetMarkerStyle(8);
00041 SetRange(ha->GetXaxis(),2,6);ha->Draw();
00042 }
00043
00044 Print(&c1,psDir,sTitle.Data());
00045 }
00046 }
00047
00048