00001 #include "commonmacro/common.h"
00002 #include "common/Name.cc"
00003 #include "commonmacro/histutil.h"
00004
00005 void zdcCent(const char* inName=
00006 "links/P01hi.minbias.2000.hist/hianalysis_cut111.hist.root",
00007 const char* psDir="ps",
00008 int cut = 1,
00009 const char* outDir="./",
00010 const char* more = "west",
00011 float extraValue = 0)
00012 {
00013 gSystem->Clear();
00014
00015 cout << "--------------------------" << endl;
00016 cout << "in name=" << inName << endl
00017 << "ps dir=" << psDir << endl
00018 << "cut=" << cut << endl;
00019 cout << "--------------------------" << endl;
00020
00021 inRoot = new TFile(inName);
00022
00023 gSystem->Load("StHiMicroEvent");
00024 gSystem->Load("StHiMicroAnalysis");
00025 Cut::SetCut(cut);
00026 Cut::ShowCuts();
00027
00028 if(!inRoot){
00029 cout << "cannot find the infile" << endl;
00030 return;
00031 }
00032
00033 gStyle->SetOptStat(0);
00034
00035 TCanvas *c1=new TCanvas("c1","c1",400,500);
00036
00037 TH3* h3=inRoot->Get("h3ZdcHMinusVtxZ");
00038
00039
00040 float vtxMin=-95,vtxMax=95;
00041
00042 TH2 *h2,*h2Clone; TProfile* p;
00043 h2 = HistSlice(h3,"","",0,vtxMin,vtxMax,"xy","e");
00044
00045
00046 TF1* f=new TF1("f","[0]*exp(-[1])");
00047
00048 Divide(c1,2,2,"zdc vs h-");
00049 c1->cd(1);
00050 h2->SetMinimum(0);
00051 h2->Draw("colz");
00052
00053
00054
00055
00056
00057
00058
00059
00060 c1->cd(3);
00061 p=h2->ProfileX();
00062 p->Draw("e");
00063
00064
00065
00066 }
00067
00068
00069