00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056 class StIOMaker;
00057 StIOMaker *IOMk=0;
00058
00059
00060
00061 void bfcread_hist_anal(
00062 const Char_t *MainFile=
00063 "/afs/rhic.bnl.gov/star/data/samples/gstar.hist.root",
00064 const Char_t *MakerHistDir="EventQA",
00065 const Char_t *TopDirTree="bfcTree",
00066 const Char_t *psFile="QA_hist.ps",
00067 const Char_t *PageTitle="",
00068 const Char_t *PrintList="",
00069 const Int_t ZoneH=2,
00070 const Int_t ZoneV=3,
00071 const Char_t *refOutFile="resultHists.root",
00072 const Char_t *refResultsFile="results.txt",
00073 const Char_t *refCutsFile=0,
00074 const Char_t *refInFile=0,
00075 const Char_t *DetList=0
00076 )
00077 {
00078
00079
00080 if (strlen(MainFile)<1) {
00081 cout << "bfcread_hist_anal.C, no input...trying reference as main input..." << endl;
00082 const Char_t* temp = refInFile;
00083 refInFile = MainFile;
00084 MainFile = temp;
00085 strcpy(TopDirTree,"");
00086 }
00087
00088 cout << "bfcread_hist_anal.C, input hist file = "
00089 << MainFile << endl;
00090 cout << "bfcread_hist_anal.C, directory name for hist = "
00091 << MakerHistDir << endl;
00092 cout << "bfcread_hist_anal.C, top level directory in hist file = "
00093 << TopDirTree << endl;
00094 cout << "bfcread_hist_anal.C, output ps file = "
00095 << psFile << endl;
00096 cout << "bfcread_hist_anal.C, page title for histograms = "
00097 << PageTitle << endl;
00098 cout << "bfcread_hist_anal.C, subset list name of which histograms to draw,print = "
00099 << PrintList << endl;
00100 cout << "bfcread_hist_anal.C, # histograms on page horizontally = "
00101 << ZoneH << endl;
00102 cout << "bfcread_hist_anal.C, # histograms on page vertically = "
00103 << ZoneV << endl;
00104
00105 gSystem->Load("St_base");
00106 gSystem->Load("StChain");
00107 gSystem->Load("StIOMaker");
00108 gSystem->Load("StarClassLibrary");
00109 gSystem->Load("libglobal_Tables");
00110 gSystem->Load("StUtilities");
00111 gSystem->Load("StAnalysisUtilities");
00112
00113
00114 StHistUtil *HU = new StHistUtil;
00115
00116 if (strlen(TopDirTree)) {
00117
00118 IOMk = new StIOMaker("IO","r",MainFile,TopDirTree);
00119 IOMk->SetDebug();
00120 IOMk->SetIOMode("r");
00121 IOMk->SetBranch("*",0,"0");
00122 IOMk->SetBranch("histBranch",0,"r");
00123
00124
00125 IOMk->Init();
00126 IOMk->Clear();
00127 IOMk->Make();
00128
00129
00130
00131
00132 HU->SetPntrToMaker((StMaker *)IOMk);
00133 } else {
00134
00135
00136 HU->SetPntrToPlainFile(TFile::Open(MainFile));
00137 }
00138
00139
00140 gROOT->SetStyle("Plain");
00141
00142 HU->SetDetectors(DetList);
00143 HU->SetHistsNamesDraw("*","*");
00144 HU->GetRunYear(MainFile);
00145 HU->SetOutFile(psFile);
00146 HU->SetZones(ZoneH,ZoneV);
00147 HU->SetPaperSize();
00148 HU->SetDefaultLogXList(MakerHistDir);
00149 HU->SetDefaultLogYList(MakerHistDir);
00150 if (PageTitle=="") PageTitle=MainFile;
00151 HU->SetGlobalTitle(PageTitle);
00152
00153 HU->SetDefaultPrintList(MakerHistDir,PrintList);
00154
00155 Int_t numLog = 0;
00156 numLog = HU->ExamineLogYList();
00157 cout <<" bfcread_hist_anal.C, Number hist to plot with log scale = " << numLog << endl;
00158
00159 Int_t numPrint = 0;
00160 numPrint = HU->ExaminePrintList();
00161 cout << " bfcread_hist_anal.C, Number hist to print = " << numPrint << endl;
00162
00163 HU->SetRefAnalysis(refOutFile,refResultsFile,refCutsFile,refInFile);
00164
00165
00166 HU->DrawHists(MakerHistDir);
00167
00168 cout <<" bfcread_hist_anal.C, end of macro" << endl;
00169
00170 }
00171