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(
"y2005e,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";
52 Char_t *libs[] = {
"",
"/usr/mysql/lib/",
"/usr/lib/", 0};
58 lib = gSystem->ExpandPathName(lib.Data());
59 if (gSystem->DynamicPathName(lib,kTRUE)) {
60 gSystem->Load(lib.Data()); cout <<
" + " << lib.Data() << endl;
70 Bool_t needLogger = kFALSE;
71 if (!TString(options).Contains(
"-logger",TString::kIgnoreCase)) {
72 needLogger = gSystem->Load(
"liblog4cxx.so") <= 0;
75 gSystem->Load(
"libSt_base");
78 gSystem->Load(
"libStStarLogger.so");
79 gROOT->ProcessLine(
"StLoggerManager::StarLoggerInit();");
82 gSystem->Load(
"libHtml");
83 gSystem->Load(
"libStChain");
84 gSystem->Load(
"libStUtilities");
85 gSystem->Load(
"libStBFChain");
86 gSystem->Load(
"libStChallenger");
89 void bfc(Int_t First, Int_t Last,
92 const Char_t *outfile,
93 const Char_t *TreeFile)
99 if (gClassTable->GetID(
"StBFChain") < 0) Load(Chain);
100 chain =
new StBFChain(); cout <<
"Create chain " << chain->
GetName() << endl;
101 TString tChain(Chain);
104 if (Last < -3)
return;
106 if (tChain ==
"" || ! tChain.CompareTo(
"ittf",TString::kIgnoreCase)) Usage();
107 chain->Set_IO_Files(infile,outfile);
108 if (TreeFile) chain->SetTFile(
new TFile(TreeFile,
"RECREATE"));
109 gMessMgr->QAInfo() << Form(
"Process [First=%6i/Last=%6i/Total=%6i] Events",First,Last,Last-First+1) << endm;
110 if (Last < -2)
return;
112 gMessMgr->Error() <<
"Problems with loading of shared library(ies)" << endm;
115 if (Last < -1)
return;
117 gMessMgr->Error() <<
"Problems with instantiation of Maker(s)" << endm;
120 if (Last < 0)
return;
121 StMaker *dbMk = chain->GetMaker(
"db");
122 if (dbMk) dbMk->SetDebug(1);
124 dbMk->SetFlavor(
"simfgt",
"vertexSeed");
126 dbMk->SetFlavor(
"sim",
"eemcPMTcal");
127 dbMk->SetFlavor(
"sim",
"eemcPIXcal");
128 dbMk->SetFlavor(
"sim",
"eemcPMTped");
129 dbMk->SetFlavor(
"sim",
"eemcPMTstat");
130 dbMk->SetFlavor(
"sim",
"eemcPMTname");
131 dbMk->SetFlavor(
"sim",
"eemcADCconf");
133 dbMk->SetFlavor(
"sim",
"bemcPed");
134 dbMk->SetFlavor(
"sim",
"bemcStatus");
135 dbMk->SetFlavor(
"sim",
"bemcCalib");
136 dbMk->SetFlavor(
"sim",
"bemcGain");
139 gSystem->Load(
"StEEmcA2EMaker");
140 gSystem->Load(
"StEEmcPoolEEmcFilterMaker");
144 EEa2eMK->
source(
"StEventMaker",2);
150 eeFlt1Mk->setEtThres(14.);
151 eeFlt1Mk->setFixedVertex(-60.);
155 eeFlt2Mk->setEtThres(16.);
156 eeFlt2Mk->setZvertCut(-60.,15.);
160 StMaker *tpcMk = chain->GetMaker(
"tpcChain");
161 chain->AddAfter(
"eefs",tpcMk);
163 chain->AddAfter(
"eefs",eeFlt1Mk);
164 chain->AddAfter(
"eefs",EEa2eMK);
165 chain->AddBefore(
"MuDst",eeFlt2Mk);
172 Char_t *myMaker =
"St_TLA_Maker";
173 if (gClassTable->GetID(myMaker) < 0) {
174 gSystem->Load(myMaker);
176 StMaker *myMk = chain->GetMaker(myMaker);
177 if (myMk)
delete myMk;
178 myMk = chain->New(myMaker,
"before");
180 Char_t *before =
"tpc_hits";
181 StMaker *tclmk = chain->GetMaker(before);
182 if (tclmk) chain->AddBefore(before,myMk);
185 myMk = chain->New(myMaker,
"after");
187 Char_t *after =
"tpc_hits";
188 StMaker *tclmk = chain->GetMaker(after);
189 if (tclmk) chain->AddAfter(after,myMk);
195 if (chain->GetOption(
"TpcT0")) {
196 StTpcT0Maker *t0mk = (StTpcT0Maker *) chain->GetMaker(
"TpcT0");
197 if (t0mk) t0mk->SetDesiredEntries(10);
202 gMessMgr->QAInfo() << Form(
"Run is started at Date/Time %i/%i",t.GetDate(),t.GetTime()) << endm;
204 gMessMgr->QAInfo() << Form(
"Run on %s in %s",gSystem->HostName(),gSystem->WorkingDirectory()) << endm;
205 gMessMgr->QAInfo() << Form(
"with %s", chain->GetCVS()) << endm;
208 chain->SetAttr(
".Privilege",0,
"*" );
209 chain->SetAttr(
".Privilege",1,
"StIOInterFace::*" );
210 chain->SetAttr(
".Privilege",1,
"St_geant_Maker::*");
211 Int_t iInit = chain->Init();
212 if (iInit >=
kStEOF) {chain->FatalErr(iInit,
"on init");
return;}
213 if (Last == 0)
return;
215 if (hd) hd->SetRunNumber(-2);
217 chain->EventLoop(First,Last,0);
218 gMessMgr->QAInfo() <<
"Run completed " << endm;
219 gSystem->Exec(
"date");
224 const Char_t *infile,
225 const Char_t *outfile,
226 const Char_t *TreeFile)
228 bfc(1,Last,Chain,infile,outfile,TreeFile);
232 printf (
"============= \t U S A G E =============\n");
233 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");
234 printf (
"bfc(Int_t Last,const Char_t *Chain,const Char_t *infile,const Char_t *outfile,const Char_t *TreeFile)\n");
235 printf (
"bfc(const Char_t *ChainShort,Int_t Last,const Char_t *infile,const Char_t *outfile)\n");
237 printf (
" First \t- First event to process\t(Default = 1)\n");
238 printf (
" Last \t- Last event to process\t(Default = 1)\n");
239 printf (
" Chain \t- Chain specification \t(without First & Last: Default is \"\" which gives this message)\n");
240 printf (
" \t \t with First || Last: Default is \"gstar tfs\")\n");
241 printf (
" infile \t- Name of Input file \t(Default = 0, i.e. use preset file names depending on Chain)\n");
242 printf (
" outfile \t- Name of Output file \t(Default = 0, i.e. define Output file name from Input one)\n");
243 printf (
" outfile \t- Name of Tree File \t(Default = 0, i.e. define Output file name from Input one (tags TNtuple))\n");
244 printf (
" ChainShort\t- Short cut for chain \t(Default = \"\" -> print out of this message)\n");
248 void bfc(
const Char_t *Chain=
"ittf") {
EEmc ADC –> energy maker.
virtual Int_t Instantiate()
Maker-instantiation handler.
void source(const Char_t *, Int_t=0)
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
aborts events based on Endcap response cuts: reco vertex in some Z-range and EEMC 2x1 cluster event-e...
virtual const char * GetName() const
special overload
virtual Int_t Load()
Routine handling library loading depending on chain options.
void database(const Char_t *)
Set the name of the EEMC database, init obtains pointer.