10 #if !defined(__CINT__) || defined(__MAKECINT__)
13 #include "TClassTable.h"
14 #include "TApplication.h"
15 #include "TInterpreter.h"
16 #include "StBFChain.h"
17 #include "StMessMgr.h"
25 void Load(
const Char_t *options=
"");
26 TString defChain(
"y2005h,Test.default.ITTF");
27 void bfc(Int_t First, Int_t Last,
const Char_t *Chain = defChain +
",Display",
28 const Char_t *infile=0,
const Char_t *outfile=0,
const Char_t *TreeFile=0);
30 void bfc(Int_t Last,
const Char_t *Chain = defChain,
31 const Char_t *infile=0,
const Char_t *outfile=0,
const Char_t *TreeFile=0);
34 void Load(
const Char_t *options){
35 cout <<
"Load system libraries" << endl;
36 if ( gClassTable->GetID(
"TGiant3") < 0) {
37 cout << endl <<
"Load ";
38 if (!TString(options).Contains(
"nodefault",TString::kIgnoreCase) ||
39 TString(options).Contains(
"pgf77",TString::kIgnoreCase)) {
40 const Char_t *pgf77 =
"libpgf77VMC";
41 if (gSystem->DynamicPathName(pgf77,kTRUE) ) {
42 gSystem->Load(pgf77); cout <<
" " << pgf77 <<
" + ";
45 if (!TString(options).Contains(
"nodefault",TString::kIgnoreCase) ||
46 TString(options).Contains(
"cern",TString::kIgnoreCase)) {
47 gSystem->Load(
"libminicern"); cout <<
"libminicern";
49 if (!TString(options).Contains(
"nodefault",TString::kIgnoreCase) ||
50 TString(options).Contains(
"mysql",TString::kIgnoreCase)) {
51 Char_t *mysql =
"libmysqlclient";
55 Char_t *libs[] = {
"",
"/usr/mysql/lib/",
"/usr/lib/", 0};
61 lib = gSystem->ExpandPathName(lib.Data());
62 if (gSystem->DynamicPathName(lib,kTRUE)) {
63 gSystem->Load(lib.Data()); cout <<
" + " << lib.Data() << endl;
73 Bool_t needLogger = kFALSE;
74 if (!TString(options).Contains(
"-logger",TString::kIgnoreCase)) {
75 needLogger = gSystem->Load(
"liblog4cxx.so") <= 0;
78 gSystem->Load(
"libSt_base");
81 gSystem->Load(
"libStStarLogger.so");
82 gROOT->ProcessLine(
"StLoggerManager::StarLoggerInit();");
85 gSystem->Load(
"libHtml");
86 gSystem->Load(
"libStChain");
87 gSystem->Load(
"libStUtilities");
88 gSystem->Load(
"libStBFChain");
89 gSystem->Load(
"libStChallenger");
92 void bfc(Int_t First, Int_t Last,
95 const Char_t *outfile,
96 const Char_t *TreeFile)
102 if (gClassTable->GetID(
"StBFChain") < 0) Load(Chain);
103 chain =
new StBFChain(); cout <<
"Create chain " << chain->
GetName() << endl;
104 TString tChain(Chain);
107 if (Last < -3)
return;
109 if (tChain ==
"" || ! tChain.CompareTo(
"ittf",TString::kIgnoreCase)) Usage();
110 chain->Set_IO_Files(infile,outfile);
111 if (TreeFile) chain->SetTFile(
new TFile(TreeFile,
"RECREATE"));
112 gMessMgr->QAInfo() << Form(
"Process [First=%6i/Last=%6i/Total=%6i] Events",First,Last,Last-First+1) << endm;
113 if (Last < -2)
return;
115 gMessMgr->Error() <<
"Problems with loading of shared library(ies)" << endm;
118 if (Last < -1)
return;
120 gMessMgr->Error() <<
"Problems with instantiation of Maker(s)" << endm;
123 if (Last < 0)
return;
124 StMaker *dbMk = chain->GetMaker(
"db");
125 if (dbMk) dbMk->SetDebug(1);
128 Char_t *myMaker =
"St_TLA_Maker";
129 if (gClassTable->GetID(myMaker) < 0) {
130 gSystem->Load(myMaker);
132 StMaker *myMk = chain->GetMaker(myMaker);
133 if (myMk)
delete myMk;
134 myMk = chain->New(myMaker,
"before");
136 Char_t *before =
"tpc_hits";
137 StMaker *tclmk = chain->GetMaker(before);
138 if (tclmk) chain->AddBefore(before,myMk);
141 myMk = chain->New(myMaker,
"after");
143 Char_t *after =
"tpc_hits";
144 StMaker *tclmk = chain->GetMaker(after);
145 if (tclmk) chain->AddAfter(after,myMk);
151 if (chain->GetOption(
"TpcT0")) {
152 StTpcT0Maker *t0mk = (StTpcT0Maker *) chain->GetMaker(
"TpcT0");
153 if (t0mk) t0mk->SetDesiredEntries(10);
158 gMessMgr->QAInfo() << Form(
"Run is started at Date/Time %i/%i",t.GetDate(),t.GetTime()) << endm;
160 gMessMgr->QAInfo() << Form(
"Run on %s in %s",gSystem->HostName(),gSystem->WorkingDirectory()) << endm;
161 gMessMgr->QAInfo() << Form(
"with %s", chain->GetCVS()) << endm;
164 chain->SetAttr(
".Privilege",0,
"*" );
165 chain->SetAttr(
".Privilege",1,
"StIOInterFace::*" );
166 chain->SetAttr(
".Privilege",1,
"St_geant_Maker::*");
167 chain->SetAttr(
".Privilege",1,
"StTpcDbMaker::*");
168 chain->SetAttr(
".Privilege",1,
"*::tpc_hits");
169 chain->SetAttr(
".Privilege",1,
"*::tpx_hits");
170 chain->SetAttr(
".Privilege",1,
"StTpcHitMover::*");
171 chain->SetAttr(
".Privilege",1,
"*::tpcChain");
172 chain->SetAttr(
".Privilege",1,
"StTriggerDataMaker::*");
175 TString &fnameOut1=chain->GetFileOut();
176 cout<<
"AAA"<<fnameOut1<<endl;
177 TString fnameOut2=fnameOut1;
178 fnameOut2.ReplaceAll(
".root",
".fgt");
180 cout<<
"FGT output core="<<fnameOut2<<endl;
182 gSystem->Load(
"libStEEmcPoolFgtSandbox1");
187 Char_t *after =
"geant";
StMaker *xMk = chain->GetMaker(after); assert(xMk);
189 chain->AddAfter(after,myMkEV);
190 chain->AddAfter(after,myMkCL);
191 chain->AddAfter(after,myMkSM);
195 myMkSM->setHList(HList); myMkCL->setHList(HList); myMkEV->setHList(HList);
196 myMkSM->initFrankModel(
"StRoot/StEEmcPool/FgtSandbox1/macros/BichselELossProbHighBG.dat");
199 myMkSM->useOnlyDisk(0);
200 myMkSM->setRadStripGain(1.00,0.03);
201 myMkSM->setPhiStripGain(1.00,0.03);
202 myMkSM->setStripThresh(1.);
203 myMkSM->setHexGemLatice(0.014, 60.);
204 myMkSM->setTransDiffusion(0.017);
206 myMkCL->setSeedStripThres(30.);
207 myMkCL->setStripNoiseSigma(12.);
213 Int_t iInit = chain->Init();
218 if (iInit >=
kStEOF) {chain->FatalErr(iInit,
"on init");
return;}
219 if (Last == 0)
return;
221 if (hd) hd->SetRunNumber(-2);
223 chain->EventLoop(First,Last,0);
224 gMessMgr->QAInfo() <<
"Run completed " << endm;
225 gSystem->Exec(
"date");
231 gMessMgr->QAInfo() << Form(
"Run is finished at Date/Time %i/%i",
232 t.GetDate(),t.GetTime()) << endm;
234 myMkSM->saveHisto(fnameOut2);
243 const Char_t *infile,
244 const Char_t *outfile,
245 const Char_t *TreeFile)
247 bfc(1,Last,Chain,infile,outfile,TreeFile);
251 printf (
"============= \t U S A G E =============\n");
252 printf (
"bfc(Int_t First,Int_t Last,const Char_t *Chain,const Char_t *infile,const Char_t *outfile,const Char_t *TreeFile)\n");
253 printf (
"bfc(Int_t Last,const Char_t *Chain,const Char_t *infile,const Char_t *outfile,const Char_t *TreeFile)\n");
254 printf (
"bfc(const Char_t *ChainShort,Int_t Last,const Char_t *infile,const Char_t *outfile)\n");
256 printf (
" First \t- First event to process\t(Default = 1)\n");
257 printf (
" Last \t- Last event to process\t(Default = 1)\n");
258 printf (
" Chain \t- Chain specification \t(without First & Last: Default is \"\" which gives this message)\n");
259 printf (
" \t \t with First || Last: Default is \"gstar tfs\")\n");
260 printf (
" infile \t- Name of Input file \t(Default = 0, i.e. use preset file names depending on Chain)\n");
261 printf (
" outfile \t- Name of Output file \t(Default = 0, i.e. define Output file name from Input one)\n");
262 printf (
" outfile \t- Name of Tree File \t(Default = 0, i.e. define Output file name from Input one (tags TNtuple))\n");
263 printf (
" ChainShort\t- Short cut for chain \t(Default = \"\" -> print out of this message)\n");
267 void bfc(
const Char_t *Chain=
"ittf") {
virtual Int_t Instantiate()
Maker-instantiation handler.
void SetFlags(const Char_t *Chain="gstar tfs")
Scan all flags, check if they are correct, manipulate the comment if necessary.
virtual void ls(Option_t *option="") const
virtual const char * GetName() const
special overload
virtual Int_t Load()
Routine handling library loading depending on chain options.