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
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085 class StChain;
00086 StChain *chain;
00087
00088 void bfcread_event_QA_outhistfile(
00089 Int_t nevents=2,
00090 const Char_t *MainFile=
00091
00092 "/star/rcf/test/dev/trs_redhat61/Tue/year_2001/hc_standard/hc_standard.40_evts.event.root",
00093 const Char_t *outHistFile="StEQAMaker",
00094 const Char_t *TopDirTree="StEQAtree",
00095 const Char_t *MakerHistDir="StEQA")
00096 {
00097
00098 cout << "bfcread_event_QA_outhistfile.C, num events to process "
00099 << nevents << endl;
00100 cout << "bfcread_event_QA_outhistfile.C, input file name "
00101 << MainFile << endl;
00102 cout << "bfcread_event_QA_outhistfile.C, Maker directory name "
00103 << MakerHistDir<< endl;
00104 cout << "bfcread_event_QA_outhistfile.C, output hist name "
00105 << outHistFile<< endl;
00106 cout << "bfcread_event_QA_outhistfile.C, output top level directory name "
00107 << TopDirTree<< endl;
00108
00109 gSystem->Load("St_base");
00110 gSystem->Load("StChain");
00111 gSystem->Load("St_Tables");
00112
00113 gSystem->Load("StUtilities");
00114 gSystem->Load("StAnalysisUtilities");
00115 gSystem->Load("StIOMaker");
00116 gSystem->Load("StarClassLibrary");
00117 gSystem->Load("StDetectorDbMaker");
00118 gSystem->Load("StTpcDb");
00119 gSystem->Load("StDbUtilities");
00120 gSystem->Load("StDbLib");
00121 gSystem->Load("StDbBroker");
00122 gSystem->Load("St_db_Maker");
00123 gSystem->Load("StEvent");
00124 gSystem->Load("StEmcUtil");
00125 gSystem->Load("StEEmcUtil");
00126 gSystem->Load("StMcEvent");
00127 gSystem->Load("StMcEventMaker");
00128 gSystem->Load("St_QA_Maker");
00129 gSystem->Load("StTreeMaker");
00130
00131
00132 chain = new StChain("MyChain");
00133 chain->SetDebug();
00134
00135
00136 StIOMaker *IOMk = new StIOMaker("IO","r",MainFile,"bfcTree");
00137 IOMk->SetIOMode("r");
00138 IOMk->SetBranch("event",0,"r");
00139 IOMk->SetBranch("geantBranch",0,"r");
00140 IOMk->SetBranch("runcoBranch",0,"r");
00141
00142
00143 const char* calibDB = "MySQL:StarDb";
00144 const char* calibDB2 = "$STAR/StarDb";
00145 St_db_Maker* calibMk = new St_db_Maker("StarDb",calibDB,calibDB2);
00146 calibMk->SetDateTime("year_2b");
00147 calibMk->SetDebug();
00148 StMagFMaker* magfMk = new StMagFMaker;
00149 StTpcDbMaker *tpcDbMk = new StTpcDbMaker("tpcDb");
00150
00151
00152 StHistUtil *HU = new StHistUtil;
00153
00154
00155
00156
00157 HU->SetPntrToMaker((StMaker *)IOMk);
00158
00159
00160 StMcEventMaker *mcEvent = new StMcEventMaker;
00161 StEventQAMaker *EventQA = new StEventQAMaker(MakerHistDir,"StEvent/QA-notused");
00162
00163
00164 StTreeMaker* treeMk = new StTreeMaker("tree",outHistFile,TopDirTree);
00165 treeMk->SetIOMode("w");
00166 treeMk->SetBranch("histBranch");
00167
00168
00169 Int_t iInit = chain->Init();
00170 if (iInit) chain->Fatal(iInit,"on init");
00171 chain->PrintInfo();
00172
00173
00174
00175 Int_t NoHist=0;
00176 NoHist = HU->ListHists(MakerHistDir);
00177 cout << " !!! bfcread_dst_QAhist.C, No. of Hist we have == " << NoHist << endl;
00178
00179
00180 int iev=0,iret=0, evnum=0;
00181 EventLoop: if (iev<nevents && iret!=2) {
00182 evnum=iev+1;
00183 cout << " !!! bfcread_event_QA_outhistfile.C, processing event !!! " << evnum << endl ;
00184 chain->Clear();
00185 switch (iret = chain->Make()) {
00186 case 0: break;
00187 case 2: { gMessMgr->Info("Last event from input."); break; }
00188 case 3: { gMessMgr->Error() << "Event " << evnum << " had error " <<
00189 iret << ". Now skipping event."; gMessMgr->Print(); break; }
00190 default: { gMessMgr->Warning() << "Event " << evnum << " returned status "
00191 << iret << ". Continuing."; gMessMgr->Print(); }
00192 }
00193 iev++;
00194 goto EventLoop;
00195 }
00196
00197 cout << " !!! bfcread_event_QA_outhistfile.C, passed chain->Make !!!" << endl ;
00198
00199 chain->Finish();
00200 cout << "bfcread_event_QA_outhistfile.C, passed chain->Finish" << endl ;
00201
00202 }
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217