6 #include "TObjString.h"
8 #include "TInterpreter.h"
9 #include "TClassTable.h"
10 #include "StMemStat.h"
11 #include "StBFChain.h"
12 #include "StBFChainOpt.h"
13 #include "St_db_Maker/St_db_Maker.h"
14 #include "StTreeMaker/StTreeMaker.h"
15 #include "StIOMaker/StIOMaker.h"
16 #include "StMessMgr.h"
17 #include "StShadowMaker/StShadowMaker.h"
26 #define STR_OBSOLETE "WARNING *** Option is OBSOLETE ***"
38 #define BFC_DBREGEXP "(dbv|sdt)(\\d+)(_)(.*)(_)(.*)"
60 static const Char_t *path =
"./StRoot/StBFChain:$STAR/StRoot/StBFChain";
61 TString fileName(
"BFC.C");
62 Char_t *file = gSystem->Which(path,fileName,kReadPermission);
64 if (! file) { LOG_FATAL << Form(
"StBFChain::Setup\tFile %s has not been found in path %s",fileName.Data(),path) << endm; }
65 else { LOG_WARN << Form(
"StBFChain::Setup\tFile %s has been found as %s",fileName.Data(),file) << endm; }
68 if (! file) Fatal(
"StBFChain::Setup",
"File %s has not been found in path %s",fileName.Data(),path);
69 else Warning(
"StBFChain::Setup",
"File %s has been found as %s",fileName.Data(),file);
73 gInterpreter->ProcessLine(cmd);
74 fchainOpt = (
St_Bfc *) gInterpreter->Calc(
"CreateTable()");
77 gInterpreter->ProcessLine(cmd);
80 fNoChainOptions = fchainOpt->
GetNRows();
81 fBFC = fchainOpt->GetTable();
83 const DbAlias_t *DbAlias = GetDbAliases();
84 Bfc_st row = {
"",
"",
"",
"db,detDb",
"",
"",
"",kFALSE};
85 for (Int_t i = 0; DbAlias[i].tag; i++) {
86 for (Int_t r = 0; r < 2; r++) {
89 dbTag += DbAlias[i].tag;
90 if (!
kOpt(dbTag,kFALSE)) {
91 memset (&row.Key, 0,
sizeof(row.Key));
92 memcpy (&row.Key, dbTag.Data(), dbTag.Length());
93 fchainOpt->
AddAt(&row);
94 fNoChainOptions = fchainOpt->
GetNRows();
95 fBFC = fchainOpt->GetTable();
119 static const Char_t *prefix[3] = {
"lib_",
"lib",
""};
120 Int_t status =
kStOk;
122 TString lib(gSystem->GetLibraries(0,
"D"));
123 TObjArray LoadedLibs;
124 ParseString(lib,LoadedLibs);
125 TIter next(&LoadedLibs);
126 TObjString *LoadedLib;
127 while ((LoadedLib = (TObjString *) next())){
128 TString Base(gSystem->BaseName(LoadedLib->GetName()));
129 Base.ReplaceAll(
".so",
"");
130 Base.ReplaceAll(
".sl",
"");
131 if (Base.BeginsWith(
"lib_")) Base.ReplaceAll(
"lib_",
"");
132 if (Base.BeginsWith(
"lib")) Base.ReplaceAll(
"lib",
"");
133 LoadedLib->SetString(Base);
135 for (i = 1; i< fNoChainOptions; i++) {
137 if (strlen(fBFC[i].Libs) > 0) {
139 ParseString(fBFC[i].Libs,Libs);
141 TObjString *libe = 0;
143 while ((libe = (TObjString *) nextL())) {
144 TString libN(libe->GetString());
145 if (libN.BeginsWith(
"lib_")) libN.ReplaceAll(
"lib_",
"");
146 if (libN.BeginsWith(
"lib")) libN.ReplaceAll(
"lib",
"");
149 for (Int_t j = 0; j < 3; j++) {
150 libL = prefix[j]; libL += libN;
152 if ((path = gSystem->DynamicPathName(libL,kTRUE)))
break;
156 TIter next(&LoadedLibs);
157 TObjString *LoadedLib;
158 while ((LoadedLib = (TObjString *) next())){
159 TString Base(LoadedLib->GetName());
161 if (Base == libN) {iok = 1;
break;}
163 if (iok > 0)
continue;
169 iok = gSystem->Load(libL);
172 LOG_FATAL <<
"problem with loading of " << libL.Data() << endm;
173 LOG_FATAL << fBFC[i].Key <<
" is switched off \t!!!!" << endm;
178 Int_t libraryload =
kStErr;
179 assert(libraryload!=
kStErr);
182 LOG_QA << Form(
"Library %-22s [%15s] (%s)\tis loaded",libL.Data(),fBFC[i].Key,path) << endm;
183 StMemStat::doPs(libL.Data(),
"Load");
184 LoadedLibs.Add(
new TObjString(libN));
187 if ( ! index(fBFC[i].Libs,
',') || Debug() > 1 ) {
188 LOG_WARN <<
"No path for Key=" << fBFC[i].Key <<
"-> Searched for [" << libL
189 <<
"] from Libs=" << fBFC[i].Libs <<
" (will proceed)" << endm;
216 Int_t status =
kStOk;
218 if (! fNoChainOptions)
return status;
219 Long64_t maxsize = kMaxLong64;
220 TTree::SetMaxTreeSize(maxsize);
221 for (i = 1; i< fNoChainOptions; i++) {
222 if (! fBFC[i].Flag)
continue;
223 TString maker(fBFC[i].Maker);
224 if (maker ==
"")
continue;
225 TString Key(fBFC[i].Key);
226 TString name(fBFC[i].Name);
231 if (maker ==
"St_db_Maker" || maker ==
"StTpcDbMaker" ||
232 maker ==
"StSvtDbMaker" || maker ==
"StSsdDbMaker" || maker ==
"StSstDbMaker" ||
233 maker ==
"StDetectorDbMaker" ||
234 maker ==
"StMagFMaker" ||
235 maker ==
"StEEmcDbMaker" ||
236 maker ==
"St_geant_Maker" ||
237 maker ==
"StVMCMaker") {
238 mk = GetTopChain()->GetMakerInheritsFrom(maker);
240 if (maker ==
"St_geant_Maker" || maker ==
"StVMCMaker") {
241 LOG_INFO <<
"StBFChain::Instantiate ignore request for instantiation of " << maker
242 <<
"(\"" << fBFC[i].Name <<
"\") because chain alreary has one." << endm;
245 if (name ==
"" || name == mk->
GetName()) {
246 LOG_INFO <<
"StBFChain::Instantiate ignore request for instantiation of " << maker
247 <<
"(\"" << fBFC[i].Name <<
"\") because chain alreary has one"
248 <<
" but accumulate options" << endm;
253 if (strlen(fBFC[i].Chain) > 0) myChain = GetMaker(fBFC[i].Chain);
254 if (maker ==
"St_db_Maker"){
255 if (Key.CompareTo(
"db",TString::kIgnoreCase) == 0) {
258 TString MySQLDb(
"MySQL:StarDb");
259 TString MainCintDb(
"$STAR/StarDb");
260 TString MainCintDbObj(
"$STAR/.$STAR_HOST_SYS/obj/StarDb");
261 TString MyCintDb(
"$PWD/StarDb");
262 TString MyCintDbObj(
"$PWD/.$STAR_HOST_SYS/obj/StarDb");
263 if (GetOption(
"NoMySQLDb")) {MySQLDb =
"";}
266 if (GetOption(
"NoLocalCintDb")) {MyCintDb =
"";}
267 if (GetOption(
"NoStarCintDb") ) {MainCintDb =
"";}
268 if (GetOption(
"NoCintDb") ) {MainCintDb =
""; MyCintDb =
"";}
272 for (j = 0; j < 10; j++) Dirs[j] =
"";
274 if (MySQLDb !=
"") {Dirs[j] = MySQLDb; j++;}
275 if (MainCintDb !=
"") {Dirs[j] = MainCintDb; j++;}
276 if (MainCintDbObj !=
"") {Dirs[j] = MainCintDbObj; j++;}
277 if (MyCintDb !=
"") {Dirs[j] = MyCintDb; j++;}
278 if (MyCintDbObj !=
"") {Dirs[j] = MyCintDbObj; j++;}
279 dbMk =
new St_db_Maker(fBFC[i].Name,Dirs[0],Dirs[1],Dirs[2],Dirs[3],Dirs[4]);
280 if (!dbMk)
goto Error;
282 TString namec = dbMk->
GetName();
283 int len =
sizeof(fBFC[i].Name);
284 if ( namec.Length() <= len){
285 strncpy (fBFC[i].Name, namec.Data(),len);
287 gMessMgr->Error() <<
"Maker name [" << namec
288 <<
"] length is > " << len
289 <<
" - increase BFC Name field length" << endm;
293 TString flavors =
"ofl";
296 if (GetOption(
"FXT")) flavors.Prepend(
"FXT+");
299 if (GetOption(
"Simu") && ! GetOption(
"NoSimuDb")) flavors.Prepend(
"sim+");
303 TString firstFileName = fSetFiles->GetFileName(0);
304 firstFileName = firstFileName(firstFileName.Last(
'/')+1,firstFileName.Length());
305 if (firstFileName.BeginsWith(
"st_")) {
306 TString fileStream = firstFileName(3,firstFileName.Index(
'_',3)-3);
307 if (fileStream.Length()>0) flavors.Prepend(fileStream +=
'+');
311 LOG_INFO <<
"Using DB flavors: " << flavors << endm;
312 dbMk->SetFlavor(flavors.Data());
315 if (GetOption(
"dbSnapshot")) dbMk->SetAttr(
"dbSnapshot",
"dbSnapshot.root",dbMk->
GetName());
320 if (!mk && maker ==
"StIOMaker" && fSetFiles) {
322 if (GetOption(
"InTree")) {
323 Char_t line[80] =
"bfcTree";
324 Int_t k =
kOpt(
"InTree");
325 sscanf(fBFC[k].Comment,
"%s",line);
326 inpMk =
new StIOMaker(
"inputStream",
"r",fSetFiles,line);
328 else inpMk =
new StIOMaker(
"inputStream",
"r",fSetFiles);
332 int len =
sizeof(fBFC[i].Name);
333 if ( namec.Length() <= len){
334 strncpy (fBFC[i].Name, namec.Data() , len);
336 gMessMgr->Error() <<
"Maker name [" << namec
337 <<
"] length is > " << len
338 <<
" - increase BFC Name field length" << endm;
341 SetInput(
"StDAQReader",
".make/inputStream/.make/inputStream_DAQ/.const/StDAQReader");
342 if (GetOption(
"ReadAll")) {
344 const Char_t *allBranches[] = {
345 "emc_rawBranch",
"eventBranch",
"ftpc_rawBranch",
346 "geantBranch",
"globalBranch",
"McEventBranch",
"svt_hitsBranch",
"svt_tracksBranch",
347 "tpc_hitsBranch",
"trgBranch",0};
348 for (Int_t i = 0; allBranches[i]; i++) inpMk->SetBranch(allBranches[i],0,
"r");
350 if (GetOption(
"adcOnly")) mk->SetAttr(
"adcOnly",1); ;
355 if (!mk && maker ==
"StTreeMaker" && fFileOut !=
"") {
357 if (GetOption(
"OutTree")) {
358 Char_t line[80] =
"bfcTree";
359 Int_t k =
kOpt(
"OutTree");
360 sscanf(fBFC[k].Comment,
"%s",line);
361 treeMk =
new StTreeMaker(
"outputStream",fFileOut.Data(),line);
363 else treeMk =
new StTreeMaker(
"outputStream",fFileOut.Data());
366 TString namec = treeMk->
GetName();
367 int len =
sizeof(fBFC[i].Name);
368 if ( namec.Length() <= len ){
369 strncpy (fBFC[i].Name, namec.Data() , len);
371 gMessMgr->Error() <<
"Maker name [" << namec
372 <<
"] length is > " << len
373 <<
" - increase BFC Name field length" << endm;
383 if (strlen(fBFC[i].Name) > 0) mk = New(fBFC[i].Maker,fBFC[i].Name);
384 else mk = New(fBFC[i].Maker);
386 LOG_FATAL << Form(
"StBFChain::Instantiate() problem with instantiation Maker=[%s] Name=[%s]",fBFC[i].Maker,fBFC[i].Name) << endm;
393 int len =
sizeof(fBFC[i].Name);
394 if ( namec.Length() <= len){
395 strncpy (fBFC[i].Name,namec.Data(),len);
397 gMessMgr->Error() <<
"Maker name [" << namec
398 <<
"] length is > " << len
399 <<
" - increase BFC Name field length" << endm;
403 if (maker ==
"StTpcDbMaker" && GetOption(
"laserIT")) mk->SetAttr(
"laserIT" ,kTRUE);
404 if (maker ==
"StDAQMaker") {
405 if (GetOption(
"adcOnly")) mk->SetAttr(
"adcOnly",1); ;
408 if (maker ==
"St_geant_Maker") {
410 if (!GetOption(
"fzin") &&
411 !GetOption(
"ntin") &&
412 !GetOption(
"gstar") &&
413 !GetOption(
"pythia")) NwGeant = 5;
414 if (GetOption(
"big")) NwGeant = 20;
415 if (GetOption(
"bigbig")) NwGeant = 40;
416 if (GetOption(
"huge")) NwGeant = 80;
417 ProcessLine(Form(
"((St_geant_Maker *) %p)->SetNwGEANT(%i);",mk,NwGeant));
418 if (GetOption(
"Higz")) ProcessLine(Form(
"((St_geant_Maker *) %p)->SetIwtype(1);",mk));
419 if (GetOption(
"paw")) ProcessLine(Form(
"((St_geant_Maker *) %p)->SetNwPAW(2);",mk));
420 if (GetOption(
"fzin") ||
422 GetOption(
"gstar") ||
423 GetOption(
"pythia") ||
424 GetOption(
"hijing") ||
425 GetOption(
"PrepEmbed") ||
429 if (GetOption(
"PrepEmbed") || GetOption(
"pythiaEmbed")) mk->SetAttr(
"Don'tTouchTimeStamp",kTRUE);
430 if (GetOption(
"flux")) mk->SetAttr(
"flux",kTRUE);
431 if (GetOption(
"pythia")) {
432 mk->SetAttr(
"Pythia",kTRUE);
433 if (GetOption(
"Wenu")) mk->SetAttr(
"Wenu",kTRUE);
434 if (GetOption(
"beamLine")) mk->SetAttr(
"beamLine",kTRUE);
436 if (GetOption(
"hijing")) {
437 mk->SetAttr(
"hijing",kTRUE);
450 if (maker ==
"StVMCMaker") {
451 if (GetOption(
"VMCPassive")) {
452 mk->SetAttr(
"VMCPassive",kTRUE);
455 if (GetOption(
"phys_off")) mk->SetAttr(
"phys_off",kTRUE);
456 if (GetOption(
"hadr_off")) mk->SetAttr(
"hadr_off",kTRUE);
458 if (ProcessLine(Form(
"((StVMCMaker *) %p)->SetInputFile(\"%s\")",mk,fInFile.Data())))
462 if (GetOption(
"Embedding")) mk->SetAttr(
"Embedding",kTRUE);
468 if (maker ==
"StiMaker" || maker ==
"StiVMCMaker" ) {
471 if ( GetOption(
"StiCA") ) {
472 mk->SetAttr(
"seedFinders",
"CA DEF");
476 if ( GetOption(
"hitreuseon") ){
477 mk->SetAttr(
"SetMaxTimes", 100);
481 mk->SetAttr(
"activeiTpc", GetOption(
"iTpcIT") ? kTRUE : kFALSE);
484 if (GetOption(
"NoSvtIT")){
485 mk->SetAttr(
"useSvt" ,kFALSE);
487 if (GetOption(
"SvtIT")){
488 mk->SetAttr(
"useSvt" ,kTRUE);
489 mk->SetAttr(
"activeSvt" ,kTRUE);
492 if ( GetOption(
"NoSsdIT") &&
493 !GetOption(
"SstIT") ){
494 mk->SetAttr(
"useSsd" ,kFALSE);
496 if (GetOption(
"SsdIT")){
497 mk->SetAttr(
"useSsd" ,kTRUE);
498 mk->SetAttr(
"activeSsd" ,kTRUE);
504 if (GetOption(
"HpdIT")){
505 mk->SetAttr(
"useHpd" ,kTRUE);
506 mk->SetAttr(
"activeHpd" ,kTRUE);
510 if (GetOption(
"NoPxlIT")) {
511 mk->SetAttr(
"usePxl" ,kTRUE);
512 mk->SetAttr(
"usePixel" ,kTRUE);
514 if (GetOption(
"PixelIT") || GetOption(
"PxlIT") ){
515 mk->SetAttr(
"usePxl" ,kTRUE);
516 mk->SetAttr(
"usePixel" ,kTRUE);
517 mk->SetAttr(
"activePxl" ,kTRUE);
518 mk->SetAttr(
"activePixel",kTRUE);
521 if (GetOption(
"NoIstIT")) {
522 mk->SetAttr(
"useIst" ,kTRUE);
524 if (GetOption(
"IstIT")){
525 mk->SetAttr(
"useIst" ,kTRUE);
526 mk->SetAttr(
"activeIst" ,kTRUE);
529 if (GetOption(
"NoSstIT")) {
530 mk->SetAttr(
"useSst" ,kTRUE);
532 if (GetOption(
"SstIT")){
533 mk->SetAttr(
"useSst" ,kTRUE);
534 mk->SetAttr(
"activeSst" ,kTRUE);
539 if (GetOption(
"BTofIT")){
540 mk->SetAttr(
"useBTof" ,kTRUE);
541 mk->SetAttr(
"activeBTof" ,kTRUE);
544 if (GetOption(
"StiPulls")) mk->SetAttr(
"makePulls" ,kTRUE);
545 if (GetOption(
"skip1row")) mk->SetAttr(
"skip1row" ,kTRUE);
546 if (GetOption(
"EastOff")) mk->SetAttr(
"EastOff" ,kTRUE);
547 if (GetOption(
"WestOff")) mk->SetAttr(
"WestOff" ,kTRUE);
548 if (GetOption(
"laserIT")) mk->SetAttr(
"laserIT" ,kTRUE);
549 if (GetOption(
"Alignment")) mk->SetAttr(
"Alignment" ,kTRUE);
550 if (GetOption(
"Cosmics")) mk->SetAttr(
"Cosmics" ,kTRUE);
553 if (maker==
"StKFVertexMaker" && GetOption(
"laserIT")) mk->SetAttr(
"laserIT" ,kTRUE);
555 if (maker==
"StGenericVertexMaker") {
557 if (GetOption(
"Sti") || GetOption(
"StiCA") || GetOption(
"StiVMC" ) ) mk->SetAttr(
"ITTF" , kTRUE);
558 if (GetOption(
"VFMinuit" ) ) mk->SetAttr(
"VFMinuit" , kTRUE);
559 if (GetOption(
"VFppLMV" ) ) mk->SetAttr(
"VFppLMV" , kTRUE);
560 if (GetOption(
"VFppLMV5" ) ) mk->SetAttr(
"VFppLMV5" , kTRUE);
561 if ( GetOption(
"VFPPVEv") ) {
562 gSystem->Load(
"StBTofUtil.so");
563 mk->SetAttr(
"VFPPVEv" , kTRUE);
565 else if (GetOption(
"VFPPV") && GetOption(
"Sti")) mk->SetAttr(
"VFPPV", kTRUE);
566 if (GetOption(
"VFPPVEvNoBtof")){
567 gSystem->Load(
"StBTofUtil.so");
568 mk->SetAttr(
"VFPPVEvNoBtof", kTRUE);
570 if (GetOption(
"VFPPVnoCTB" ) ) mk->SetAttr(
"VFPPVnoCTB" , kTRUE);
571 if (GetOption(
"VFFV" ) ) mk->SetAttr(
"VFFV" , kTRUE);
572 if (GetOption(
"VFMCE" ) ) mk->SetAttr(
"VFMCE" , kTRUE);
573 if (GetOption(
"VFMinuit2" ) ) mk->SetAttr(
"VFMinuit2" , kTRUE);
574 if (GetOption(
"VFMinuit3" ) ) mk->SetAttr(
"VFMinuit3" , kTRUE);
575 if (GetOption(
"beamLine" ) ) mk->SetAttr(
"BeamLine" , kTRUE);
576 if (GetOption(
"beamLine3D" ) ) mk->SetAttr(
"BeamLine3D" , kTRUE);
577 if (GetOption(
"CtbMatchVtx") ) mk->SetAttr(
"CTB" , kTRUE);
578 if (GetOption(
"min2trkVtx" ) ) mk->SetAttr(
"minTracks" , 2);
579 if (GetOption(
"VtxSeedCalG") ) mk->SetAttr(
"calibBeamline" , kTRUE);
580 if (GetOption(
"usePct4Vtx" ) ) mk->SetAttr(
"PCT" , kTRUE);
581 if (GetOption(
"useBTOF4Vtx") ) mk->SetAttr(
"BTOF" , kTRUE);
582 if (GetOption(
"useBTOFmatchOnly") ) mk->SetAttr(
"useBTOFmatchOnly", kTRUE);
583 if (GetOption(
"FXT" ) ) mk->SetAttr(
"FXT" , kTRUE);
587 if (GetOption(
"VFStoreX") ) mk->SetAttr(
"VFStore" , 100);
591 if (maker==
"StKFVertexMaker") {
592 if (GetOption(
"beamLine" ) ) mk->SetAttr(
"BeamLine" , kTRUE);
594 if (maker==
"StAssociationMaker") {
596 LOG_QA <<
"StBFChain::Instantiate Setting the Parameters for the Association Maker" << endm;
599 if (GetOption(
"ITTF") || GetOption(
"StiVMC") || GetOption(
"useInTracker"))
600 cmd = Form (
"((StAssociationMaker *) %p)->useInTracker();",mk);
601 cmd +=
"StMcParameterDB* parameterDB = StMcParameterDB::instance();";
604 cmd +=
"parameterDB->setXCutTpc(.5);";
605 cmd +=
"parameterDB->setYCutTpc(.5);";
606 cmd +=
"parameterDB->setZCutTpc(.5);";
608 cmd +=
"parameterDB->setReqCommonHitsTpc(3);";
611 cmd +=
"parameterDB->setRCutFtpc(.3);";
612 cmd +=
"parameterDB->setPhiCutFtpc(5*(3.1415927/180.0));";
614 cmd +=
"parameterDB->setReqCommonHitsFtpc(3);";
617 cmd +=
"parameterDB->setXCutSvt(.08);";
618 cmd +=
"parameterDB->setYCutSvt(.08);";
619 cmd +=
"parameterDB->setZCutSvt(.08);";
621 cmd +=
"parameterDB->setReqCommonHitsSvt(1);";
622 if (GetOption(
"IdTruth")) cmd += Form(
"((StAssociationMaker *) %p)->useIdAssoc();",mk);
625 if (maker ==
"StMiniMcMaker" && GetOption(
"IdTruth") && ! GetOption(
"OldMiniMc")) {
627 gMessMgr->QAInfo() <<
"StBFChain::Instantiate create simplified MiniMcTree in " << maker << endm;
632 if (GetOption(
"ppOpt") ) {
633 if (maker ==
"StTrsMaker")
637 if (maker ==
"StStrangeMuDstMaker" && GetOption(
"CMuDST")&& GetOption(
"StrngMuDST") ) {
639 mk -> SetAttr(
"DoV0", 1 );
640 mk -> SetAttr(
"DoXi", 1 );
641 mk -> SetAttr(
"DoKink", 1 );
642 mk -> SetAttr(
"SetNoKeep", 1 );
648 if ( maker ==
"StEmcRawMaker" && GetOption(
"BEmcDebug"))
652 if ( maker ==
"StEmcRawMaker" && GetOption(
"BEmcChkStat"))
653 mk->SetAttr(
"BEmcCheckStatus",kTRUE);
656 if ( maker ==
"StEmcRawMaker" && GetOption(
"picoWrite") ) {
661 if ( maker ==
"StTriggerSimuMaker" && GetOption(
"picoWrite") ) {
669 if (maker ==
"StMuDstMaker" && GetOption(
"ezTree") ){
670 TString cmd(Form(
"StMuDstMaker *pMuMk = (StMuDstMaker *) %p;",mk));
671 if ( ! GetOption(
"CMuDST")) cmd +=
"pMuMk->SetStatus(\"*\",0);";
672 cmd +=
"pMuMk->SetStatus(\"EztAll\",1);";
677 if (maker ==
"StFstRawHitMaker" && GetOption(
"fstEvtRawHit") ){
678 mk->SetAttr(
"fstEvtRawHit", kTRUE);
682 if (maker ==
"StMuDstMaker" && GetOption(
"fstMuRawHit") ){
683 mk->SetAttr(
"fstMuRawHit", kTRUE);
686 if ( maker ==
"StPicoDstMaker"){
687 if ( GetOption(
"picoWrite") ) mk->SetMode(1);
688 if ( GetOption(
"picoRead") ) mk->SetMode(2);
689 if ( GetOption(
"PicoVtxVpd")) mk->SetAttr(
"PicoVtxMode",
"PicoVtxVpd");
690 else if ( GetOption(
"PicoVtxFXT")) mk->SetAttr(
"PicoVtxMode",
"PicoVtxFXT");
691 else if ( GetOption(
"PicoVtxMtd")) mk->SetAttr(
"PicoVtxMode",
"PicoVtxMtd");
692 else if ( GetOption(
"PicoVtxVpdOrDefault")) mk->SetAttr(
"PicoVtxMode",
"PicoVtxVpdOrDefault");
693 else if ( GetOption(
"PicoVtxDefault")) mk->SetAttr(
"PicoVtxMode",
"PicoVtxDefault");
694 if ( GetOption(
"PicoCovMtxWrite")) mk->SetAttr(
"PicoCovMtxMode",
"PicoCovMtxWrite");
695 else if ( GetOption(
"PicoCovMtxSkip")) mk->SetAttr(
"PicoCovMtxMode",
"PicoCovMtxSkip");
696 if ( GetOption(
"PicoBEmcSmdWrite")) mk->SetAttr(
"PicoBEmcSmdMode",
"PicoBEmcSmdWrite");
697 else if ( GetOption(
"PicoBEmcSmdSkip")) mk->SetAttr(
"PicoBEmcSmdMode",
"PicoBEmcSmdSkip");
701 if (maker ==
"StLaserEventMaker"){
704 if (maker ==
"StDetectorDbMaker") {
705 if ( GetOption(
"DbRichSca") ) mk->SetMode(1);
707 if (maker ==
"StTpcRSMaker") {
708 if (! GetOption(
"TrsToF")) {
709 Int_t mode = mk->GetMode();
713 if (GetOption(
"EbyET0")) mk->SetAttr(
"EbyET0", kTRUE);
715 if (maker ==
"StTrsMaker") {
717 if (GetOption(
"TrsPileUp")) mode += 1;
718 if (GetOption(
"TrsToF")) mode += 2;
719 if (mode) mk->SetMode(mode);
723 if (maker ==
"StTofrMatchMaker"){
727 if (maker ==
"StSpaceChargeEbyEMaker") {
728 if ( GetOption(
"SpcChgCal") ||
729 GetOption(
"SpcChgCalG")) mk->SetMode(2);
730 if ( GetOption(
"SCScalerCal") ) mk->SetMode(4);
731 if ( GetOption(
"EastOff")) mk->SetAttr(
"EastOff",kTRUE);
732 if ( GetOption(
"WestOff")) mk->SetAttr(
"WestOff",kTRUE);
734 if (maker ==
"StEventQAMaker") {
735 if ( GetOption(
"QAalltrigs")) mk->SetAttr(
"allTrigs",kTRUE);
736 if ( GetOption(
"QAallevents")) mk->SetAttr(
"allEvents",kTRUE);
739 if(maker==
"StV0FinderMaker" && Key==
"v0svt"){
740 TString cmd(Form(
"StV0FinderMaker *V0mk=(StV0FinderMaker*) %p;",mk));
741 cmd +=
"V0mk->SetLanguageUsage(0);";
742 cmd +=
"V0mk->SetSVTUsage(1);";
743 cmd +=
"V0mk->SetV0LanguageUsage(3);";
746 if(maker==
"StXiFinderMaker" && Key==
"xisvt"){
747 TString cmd(Form(
"StXiFinderMaker *Ximk=(StXiFinderMaker*) %p;",mk));
748 cmd +=
"Ximk->SetLanguageUsage(0);";
749 cmd +=
"Ximk->SetSVTUsage(1);";
750 cmd +=
"Ximk->SetV0LanguageUsage(3);";
751 cmd +=
"Ximk->SetXiLanguageUsage(5);";
756 if (maker ==
"StTpcRTSHitMaker") {
757 if ( GetOption(
"TpxClu2D")) mk->SetAttr(
"TpxClu2D", kTRUE);
758 if ( GetOption(
"TPC23")) mk->SetAttr(
"TPC23", kTRUE);
760 if (maker ==
"StTpcDbMaker"){
761 if ( GetOption(
"Simu") && ! GetOption(
"NoSimuDb")) mk->SetAttr(
"Simu",kTRUE);
762 if ( GetOption(
"useLDV") ) mk->SetAttr(
"useLDV",kTRUE) ;
763 if ( GetOption(
"useCDV") ) mk->SetAttr(
"useCDV",kTRUE) ;
764 if ( GetOption(
"useNewLDV") ) mk->SetAttr(
"useNewLDV",kTRUE);
765 if ( GetOption(
"shadow") ) mk->SetAttr(
"NoReset",kTRUE);
766 if ( GetOption(
"ExB")){
767 mk->SetAttr(
"ExB", kTRUE);
768 if ( GetOption(
"EB1") ) mk->SetAttr(
"EB1", kTRUE);
769 else if ( GetOption(
"EB2") ) mk->SetAttr(
"EB2", kTRUE);
773 if(GetOption(
"RY1H") ||
774 GetOption(
"RY2000") ||
775 GetOption(
"RY2001") ||
776 GetOption(
"RY2001N") ||
777 GetOption(
"RY2003") ||
778 GetOption(
"RY2003X")) mk->SetAttr(
"OldRuns", kTRUE);
785 if( GetOption(
"OBmap") ) mk->SetAttr(
"OBmap" , kTRUE);
786 if( GetOption(
"OPr13") ) mk->SetAttr(
"OPr13" , kTRUE);
787 if( GetOption(
"OPr40") ) mk->SetAttr(
"OPr40" , kTRUE);
788 if( GetOption(
"OTwist") ) mk->SetAttr(
"OTwist" , kTRUE);
789 if( GetOption(
"OClock") ) mk->SetAttr(
"OClock" , kTRUE);
790 if( GetOption(
"OCentm") ) mk->SetAttr(
"OCentm" , kTRUE);
791 if( GetOption(
"OECap") ) mk->SetAttr(
"OECap" , kTRUE);
792 if( GetOption(
"OIFC") ) mk->SetAttr(
"OIFC" , kTRUE);
793 if( GetOption(
"OSpaceZ") ) mk->SetAttr(
"OSpaceZ" , kTRUE);
794 if( GetOption(
"OSpaceZ2") ) {
795 if( GetOption(
"FXT") ) mk->SetAttr(
"OSpaceFXT" , kTRUE);
796 else mk->SetAttr(
"OSpaceZ2" , kTRUE);
798 if( GetOption(
"OShortR") ) mk->SetAttr(
"OShortR" , kTRUE);
799 if( GetOption(
"OBMap2d") ) mk->SetAttr(
"OBMap2d" , kTRUE);
800 if( GetOption(
"OGridLeak") ) mk->SetAttr(
"OGridLeak" , kTRUE);
801 if( GetOption(
"OGridLeak3D")) mk->SetAttr(
"OGridLeak3D", kTRUE);
802 if( GetOption(
"OGridLeakFull")) mk->SetAttr(
"OGridLeakFull", kTRUE);
803 if( GetOption(
"OGGVoltErr") ) mk->SetAttr(
"OGGVoltErr" , kTRUE);
804 if( GetOption(
"OSectorAlign"))mk->SetAttr(
"OSectorAlign",kTRUE);
805 if( GetOption(
"ODistoSmear")) mk->SetAttr(
"ODistoSmear", kTRUE);
806 if( GetOption(
"OAbortGap")) mk->SetAttr(
"OAbortGap" , kTRUE);
810 if (maker ==
"StTpcHitMover" && GetOption(
"EbyET0")) {
811 mk->SetAttr(
"EbyET0", kTRUE);
813 if ((maker ==
"StdEdxY2Maker" || maker ==
"StTpcHitMover") &&
814 GetOption(
"EmbeddingShortCut")) {
815 mk->SetAttr(
"EmbeddingShortCut", kTRUE);
818 if (maker ==
"StdEdxY2Maker" && !GetOption(
"CalcdNdx")) {
819 mk->SetAttr(
"SkipdNdx", kTRUE);
821 if (maker ==
"StSvtDbMaker" || maker ==
"StSsdDbMaker"){
824 if (GetOption(
"Simu") && ! GetOption(
"NoSimuDb")) mk->SetMode(1);
828 if ((maker ==
"StFtpcClusterMaker" ||
829 maker ==
"StFtpcTrackMaker" ) &&
830 GetOption(
"fdbg")) mk->SetMode(mk->GetMode()+2);
831 if ( ( maker ==
"StFtpcClusterMaker" ||
832 maker ==
"StFtpcTrackMaker" ) &&
833 GetOption(
"flaser")) mk->SetMode(mk->GetMode()+1);
835 if ((maker ==
"StFtpcClusterMaker" ||
836 maker ==
"StFtpcTrackMaker" ) &&
837 GetOption(
"fgain")) mk->SetMode(mk->GetMode()+4);
841 if ( maker ==
"StPmdReadMaker" &&
842 GetOption(
"pmdRaw")) mk->SetAttr(
"pmdRaw",kTRUE);
848 if (maker ==
"StPxlSimMaker") {
849 if (GetOption(
"pxlSlowSim")) mk->SetAttr(
"useDIGMAPSSim",kTRUE);
853 if (maker ==
"StFmsDbMaker"){
854 if(fFmsGainCorrTag!=
"") mk->SetAttr(
"FmsGainCorr",fFmsGainCorrTag.Data());
859 if (maker ==
"StHitFilterMaker") {
860 if (GetOption(
"SvtHitFilt")){
862 LOG_QA <<
"SVT hit filter is ON" << endm;
863 TString cmd(Form(
"StHitFilterMaker *Filtmk=(StHitFilterMaker*) %p;",mk));
864 cmd +=
"Filtmk->setPtLowerCut(-99.);";
865 cmd +=
"Filtmk->setPtUpperCut(-99.);";
866 cmd +=
"Filtmk->setAbsEtaCut(-99);";
867 cmd +=
"Filtmk->setAbsZVertCut(30);";
869 }
else if (GetOption(
"TpcHitFilt")){
871 LOG_QA <<
"TPC hit filter is ON" << endm;
872 TString cmd(Form(
"StHitFilterMaker *Filtmk=(StHitFilterMaker*) %p;",mk));
873 cmd +=
"Filtmk->setPtLowerCut(-99.);";
874 cmd +=
"Filtmk->setPtUpperCut(-99.);";
875 cmd +=
"Filtmk->setAbsEtaCut(-99);";
876 cmd +=
"Filtmk->setAbsZVertCut(999);";
878 }
else if (GetOption(
"HftHitFilt")){
880 LOG_QA <<
"HFT hit filter is ON" << endm;
881 TString cmd(Form(
"StHitFilterMaker *Filtmk=(StHitFilterMaker*) %p;",mk));
882 cmd +=
"Filtmk->setAbsZVertCut(-1);";
883 cmd +=
"Filtmk->setKeepWestHighEtaHitsForFgt(0);";
886 LOG_QA <<
"Default hit filtering is ON" << endm;
889 if (GetOption(
"KeepTpcHit")) mode |= (1 << kTpcId);
890 if (GetOption(
"KeepSvtHit")) mode |= (1 << kSvtId);
893 if (GetOption(
"KeepFgtHit")){
894 TString cmd(Form(
"StHitFilterMaker *Filtmk=(StHitFilterMaker*) %p;",mk));
895 cmd +=
"Filtmk->setKeepWestHighEtaHitsForFgt(1.0);";
899 if (maker ==
"StMiniMcMaker" && fFileOut !=
"") {
900 ProcessLine(Form(
"((StMiniMcMaker *) %p)->setFileName(\"%s\");", mk, fFileOut.Data()));
902 if (maker ==
"StMcAnalysisMaker") {
904 if (GetOption(
"McAnaTpc")) mode += 0x1;
905 if (GetOption(
"McAnaSvt")) mode += 0x2;
906 if (GetOption(
"McAnaSsd")) mode += 0x4;
908 ProcessLine(Form(
"((StMaker *) %p)->SetMode(%i);", mk, mode));
910 if (maker ==
"StBTofCalibMaker") {
911 if (GetOption(
"UseProjectedVertex")) mk->SetAttr(
"UseProjectedVertex",kTRUE);
912 if (GetOption(
"setOutlierRej4BToft0")) mk->SetAttr(
"setPPPAOutlierRej", kTRUE);
913 if (GetOption(
"ImpBToFt0Mode")) mk->SetAttr(
"pppAMode", kTRUE);
914 if (GetOption(
"btofFXT")) mk->SetAttr(
"btofFXT", kTRUE);
916 if (maker ==
"StVpdCalibMaker" && GetOption(
"ImpBToFt0Mode")) mk->SetAttr(
"pppAMode", kTRUE);
918 if (maker ==
"StEventMaker" && fFiltTrg.Length()) {
919 mk->SetAttr(
"FiltTrg",(Int_t) (fFiltTrg.BeginsWith(
'+') ? 1 : -1));
920 TString FiltTrgFlavor = fFiltTrg(1,128);
921 if (FiltTrgFlavor.Length())
922 SetFlavor((FiltTrgFlavor +=
"+ofl").Data(),
"trgOfflineFilter");
924 if (maker ==
"StTagsMaker"){
925 if ( GetOption(
"shadow") ) mk->SetAttr(
"shadow",kTRUE);
930 if (name ==
"") strncpy (fBFC[i].Name,(Char_t *) mk->
GetName() ,
sizeof(fBFC[i].Name));
931 if (myChain) myChain->AddMaker(mk);
935 LOG_QA <<
" ======================================" << endm;
936 LOG_QA <<
" problem with Instantiation of " << fBFC[i].Maker << endm;
937 LOG_QA <<
" ======================================" << endm;
944 if (GetOption(
"MakeDoc")) MakeDoc();
946 if (GetOption(
"Debug")) SetDEBUG(1);
947 if (GetOption(
"Debug1")) SetDEBUG(1);
948 if (GetOption(
"Debug2")) SetDEBUG(2);
949 if (GetOption(
"nohistos")) SetAttr(
".histos",0,
"*");
950 else SetAttr(
".histos",1,
"*");
951 if (GetOption(
"NoRepeat")) gMessMgr->IgnoreRepeats();
953 if (GetOption(
"svt1hit")) SetAttr(
"minPrecHits",1,
"Sti");
954 if (GetOption(
"svt1hit")) SetAttr(
"minPrecHits",1,
"StiCA");
955 if (GetOption(
"svt1hit")) SetAttr(
"minPrecHits",1,
"StiVMC");
957 for (
unsigned int n=0 ; n < Gproperty.size() ; n++ ){
958 gMessMgr->QAInfo() <<
"+++ Setting attribute "
959 << (Gproperty.at(n)).Data() <<
" = " << (Gvalue.at(n)).Data() <<
" for "
960 << (Gpattern.at(n).Data()) << endm;
962 SetAttr( (Gproperty.at(n)).Data(),
963 (Gvalue.at(n)).Data(),
964 (Gpattern.at(n)).Data() );
970 Int_t StBFChain::Init() {
973 Info(
"Init",
"Time=%s Cwd=%s",td.AsString(),gSystem->pwd());
977 if (fNoChainOptions) {
979 if (GetOption(
"Simu") && ! (GetOption(
"mtin") || GetOption(
"PrepEmbed") || GetOption(
"pythiaEmbed"))) {
985 if (fEvtHddr->GetRunNumber() < 0 || fEvtHddr->GetRunNumber() >= 1000000) {
986 fEvtHddr->SetRunNumber(1);
990 if (fNoChainOptions) {
991 if (GetOption(
"NoOutput") || GetOption(
"EvOutOnly")) {
992 if (! GetOption(
"RMuDst"))
993 SetAttr(
".call",
"SetActive(0)",
"MuDst");
994 if (! GetOption(
"EvOutOnly")) {
995 SetAttr(
".call",
"SetActive(0)",
"outputStream");
997 SetAttr(
".call",
"SetActive(0)",
"kink2");
998 SetAttr(
".call",
"SetActive(0)",
"StTagsMaker::");
999 SetAttr(
".call",
"SetActive(0)",
"StStrangeMuDstMaker::");
1004 if (fNoChainOptions) {
1005 if (GetOption(
"misalign") && TClass::GetClass(
"AgPosition") )
1006 gROOT->ProcessLine(
"AgPosition::SetReal();");
1007 else if ( TClass::GetClass(
"AgPosition") )
1008 gROOT->ProcessLine(
"AgPosition::SetIdeal();");
1014 if (GetOption(
"Sti") || GetOption(
"StiCA") ||
1015 GetOption(
"StiVMC") ||GetOption(
"VMC") ||
1016 GetOption(
"VMCPassive")) {
1017 const DbAlias_t *DbAlias = GetDbAliases();
1018 for (Int_t i = 0; DbAlias[i].tag; i++) {
1020 dbTag += DbAlias[i].tag;
1021 if (GetOption(dbTag)) {
1022 TString path(
"./StarDb/AgiGeometry:$STAR/StarDb/AgiGeometry");
1023 if (GetOption(
"AgML")) {
1024 path =
"./StarDb/AgMLGeometry:$STAR/StarDb/AgMLGeometry";
1026 if (GetOption(
"VmcGeo")) {
1027 path =
"./StarDb/VmcGeo:$STAR/StarDb/VmcGeo";
1029 TString geom(
"Geometry.");
1030 geom += DbAlias[i].geometry;
1032 Char_t *file = gSystem->Which(path.Data(),geom,kReadPermission);
1034 LOG_INFO <<
"StBFChain::Init force load of " << file << endm;
1035 TString command =
".L "; command += file;
1036 gInterpreter->ProcessLine(command);
1037 gInterpreter->Calc(
"CreateTable()");
1038 command.ReplaceAll(
".L ",
".U ");
1039 gInterpreter->ProcessLine(command);
1042 LOG_INFO <<
"StBFChain::Init file for geometry tag " << geom <<
" has not been found in path" << path << endm;
1050 return StChain::Init();
1056 TFile *tf = GetTFile();
1057 if (tf) {tf->Write(); tf->Flush(); tf->Close();
delete tf; SetTFile(0);}
1058 if (!fBFC)
return kStOK;
1060 SafeDelete(fchainOpt);
1068 Int_t StBFChain::AddAB (
const Char_t *mkname,
const StMaker *maker,
const Int_t Opt) {
1069 if (! maker || strlen(mkname) == 0)
return kStErr;
1070 StMaker *parent = maker->GetParentMaker();
1072 TList *list = parent->GetMakeList();
1073 list->Remove((
StMaker *)maker);
1076 parent = mk->GetParentMaker();
if (!parent)
return kStErr;
1077 TList *list = parent->GetMakeList();
if (!list)
return kStErr;
1078 if (Opt > 0) list->AddAfter (mk,(
StMaker*)maker);
1079 else list->AddBefore(mk,(
StMaker*)maker);
1084 Int_t StBFChain::ParseString (
const TString &tChain, TObjArray &Opt, Bool_t Sort) {
1086 TObjArray *obj = tChain.Tokenize(
"[^ ;,]+");
1087 Int_t nParsed = obj->GetEntries();
1089 if (GetChain() && GetChain()->Debug() > 2) {
1090 gMessMgr->QAInfo() <<
"ParseString " << tChain.Data() << endm;
1091 for (k = 0; k < nParsed; k++) {
1093 gMessMgr->QAInfo() << k <<
"\t" << ((TObjString *) obj->At(k))->
GetName() << endm;
1097 for (k = 0; k < nParsed; k++) {
if (obj->At(k)) {
if (k != N) obj->AddAt(obj->At(k),N); N++;}}
1101 if (curChain && Sort) {
1102 TArrayI idT(nParsed); Int_t *idx = idT.GetArray();
1103 TArrayI kdT(nParsed); Int_t *kdx = kdT.GetArray();
1104 for (k = 0; k < nParsed; k++) {
1105 TString
string = ((TObjString *) obj->At(k))->GetString();
1106 kdx[k] = TMath::Abs(curChain->
kOpt(
string,kFALSE));
1108 TMath::Sort(nParsed,kdx,idx,0);
1110 for (k = 0; k < nParsed; k++) {
1111 Opt.AddAtAndExpand(obj->At(idx[k]),k);
1112 if (k == 0) sChain = ((TObjString *)Opt[k])->GetString();
1113 else {sChain +=
","; sChain += ((TObjString *)Opt[k])->GetString();}
1115 if (N > 1 && curChain->Debug() > 2) {
1116 gMessMgr->QAInfo() <<
"Requested chain is :\t" << tChain.Data() << endm;
1117 gMessMgr->QAInfo() <<
"Sorted chain is :\t" << sChain.Data() << endm;
1119 }
else for (k = 0; k < nParsed; k++) Opt.AddAtAndExpand(obj->At(k),k);
1120 obj->SetOwner(kFALSE);
1129 Int_t kO =
kOpt(&Tag, Check);
1144 for (Int_t i = 1; i< fNoChainOptions; i++) {
1145 opt = TString(fBFC[i].Key);
1147 nopt = TString(
"-");
1149 if (Tag == opt) {
return i;}
1150 else {
if (Tag == nopt) {
return -i;}}
1151 opt = fBFC[i].Maker;
1154 if (Tag == opt) {
return i;}
1155 else {
if (Tag == nopt) {
return -i;}}
1168 if (Tag.BeginsWith(
"dbv") || Tag.BeginsWith(
"sdt")) {
1171 if (Tag.Length() == 11 || Tag.Length() == 18)
return 0;
1176 if ( TPRegexp(BFC_DBREGEXP).Match(Tag) == 7)
return 0;
1178 if (Tag.BeginsWith(
"rung")) {
1184 if(Tag.BeginsWith(
"fmsGainCorr")){
1190 if ( Tag.BeginsWith(
"gopt") && Tag.Length() == 13 )
return 0;
1192 if ( Tag.BeginsWith(
"FiltTrg",TString::kIgnoreCase) ) {
1194 if ( TPRegexp(
"^FiltTrg(Inc|Exc)?(_.*)*$").Match(Tag,
"i") > 0)
return 0;
1196 if ( Tag.BeginsWith(
"VFStore",TString::kIgnoreCase) ||
1197 Tag.BeginsWith(
"TpcVpdVzDiffCut",TString::kIgnoreCase)
1201 if ( Tag.Index(
':') != 0)
return 0;
1206 gMessMgr->Error() <<
"Option " << Tag.Data() <<
" has not been recognized" << endm;
1212 void StBFChain::SetOptions(
const Char_t *options,
const Char_t *chainName) {
1213 TString tChain(options);
1215 Int_t nParsed = ParseString(tChain,Opts,kTRUE);
1216 for (Int_t l = 0; l < nParsed; l++) {
1217 TString Tag = ((TObjString *)Opts[l])->GetString();
1219 Int_t in = Tag.Index(
"=");
1221 TString subTag(Tag.Data(),in);
1223 kgo =
kOpt(subTag.Data());
1225 int len=
sizeof(fBFC[kgo].Comment);
1226 memset(fBFC[kgo].Comment,0,len);
1227 TString Comment(Tag.Data()+in+1,Tag.Capacity()-in-1);
1228 if ( Comment.Length() <= len ){
1229 strncpy (fBFC[kgo].Comment, Comment.Data(),
sizeof(fBFC[kgo].Comment));
1230 gMessMgr->QAInfo() << Form(
" Set %s = %s", fBFC[kgo].Key,fBFC[kgo].Comment) << endm;
1232 gMessMgr->Error() << Form(
" Cpy problem [%s] is > %d - adjust BFC Comment field size",
1233 Comment.Data(),len) << endm;
1239 kgo =
kOpt(Tag.Data(),kFALSE);
1243 TString Comment(fBFC[kgo].Comment);
1244 TString Opts(fBFC[kgo].Opts);
1245 if (Tag.BeginsWith(
"Test.",TString::kIgnoreCase) && ! Comment.BeginsWith(
"/star/") &&
1246 Opts.BeginsWith(
"test_",TString::kIgnoreCase)) {
1247 SetOptions(Opts,Tag);
1249 if ((Tag.BeginsWith(
"Test.",TString::kIgnoreCase) ||
1250 Tag.BeginsWith(
"test_",TString::kIgnoreCase) ||
1251 Tag.BeginsWith(
"eval_",TString::kIgnoreCase)) && Comment.BeginsWith(
"/star/") ) {
1253 gMessMgr->QAInfo() <<
"Default Test chain set " << fBFC[fkChain].Key <<
" with input " << fBFC[fkChain].Comment << endm;
1266 if (Tag.BeginsWith(
"dbv")) {
1267 if (Tag.Length() == 11) (
void) sscanf(Tag.Data(),
"dbv%8d",&FDate);
1268 if (Tag.Length() == 18) (
void) sscanf(Tag.Data(),
"dbv%8d.%6d",&FDate,&FTime);
1269 if (Tag.Length() == 11 || Tag.Length() == 18) {
1270 gMessMgr->QAInfo() << Tag.Data() <<
" ... but still will be considered as a dynamic timestamp (Max DB EntryTime) "
1271 << FDate <<
"." << FTime << endm;
1272 #ifdef USE_BFCTIMESTAMP
1276 TObjArray *subStrL = TPRegexp(BFC_DBREGEXP).MatchS(Tag);
1281 TS.Date = (((TObjString *) subStrL->At(2))->GetString()).Atoi();
1283 TS.Detector = ((TObjString *) subStrL->At(4))->GetString();
1284 TS.Realm = ((TObjString *) subStrL->At(6))->GetString();
1286 if ( TS.Realm.IsNull() ){ realm =
"*";}
1287 else { realm = TS.Realm;}
1289 GTSOptions.push_back(TS);
1291 LOG_WARN <<
"Override timestamp for detector requested\n\t"
1292 <<
"Detector " << TS.Detector <<
"\n\t"
1293 <<
"Realm " << realm <<
"\n\t"
1294 <<
"Date " << TS.Date <<
"\n\t"
1295 <<
"Time " << TS.Time << endm;
1299 }
else if (Tag.BeginsWith(
"sdt")) {
1300 if (Tag.Length() == 11) (
void) sscanf(Tag.Data(),
"sdt%8d",&FDateS);
1301 if (Tag.Length() == 18) (
void) sscanf(Tag.Data(),
"sdt%8d.%6d",&FDateS,&FTimeS);
1302 if (Tag.Length() == 11 || Tag.Length() == 18) {
1303 gMessMgr->QAInfo() << Tag.Data() <<
" ... but still will be considered as a dynamic timestamp (Event Time) "
1304 << FDateS <<
"." << FTimeS << endm;
1310 }
else if ( Tag.BeginsWith(
"gopt") && Tag.Length() == 13){
1313 char GOptName[4],GOptValue[7];
1314 TString property(
".gopt.");
1317 (void) sscanf(Tag.Data(),
"gopt%3s%6s",GOptName,GOptValue);
1321 property += GOptName;
1322 Gproperty.push_back(property);
1323 Gvalue.push_back(GOptValue);
1324 Gpattern.push_back(
"*");
1334 gMessMgr->QAInfo() << Tag.Data() <<
" ... this will set an general attribute "
1335 <<
property.Data() <<
" with value " << GOptValue <<
" to "
1341 }
else if (Tag.BeginsWith(
"rung")) {
1343 if (Tag.Length() > 4) (
void) sscanf(Tag.Data(),
"rung.%d",&fRunG);
1344 gMessMgr->QAInfo() << Tag.Data() <<
" will be considered as Run number (& rndm seed set) "
1345 << fRunG <<
" for simulation." << endm;
1349 }
else if (Tag.BeginsWith(
"VFStore" ,TString::kIgnoreCase) ||
1350 Tag.BeginsWith(
"TpcVpdVzDiffCut",TString::kIgnoreCase)
1353 Ssiz_t idx = Tag.Index(
':');
1359 Gproperty.push_back(Tag(0,idx));
1360 Gvalue.push_back(Tag(idx+1,64));
1362 Gpattern.push_back(
"*");
1364 gMessMgr->QAInfo() <<
"Detecting " << Tag(0,idx).Data() <<
" = " << Tag(idx+1,64).Data() <<
" as global property" << endm;
1371 }
else if (Tag.BeginsWith(
"FiltTrg",TString::kIgnoreCase)) {
1372 TString filtTrgTag = Tag;
1373 Ssiz_t flavorIdx = Tag.Index(
'_');
1374 if (flavorIdx > 0) {
1375 filtTrgTag = Tag(0,flavorIdx);
1376 fFiltTrg = Tag(flavorIdx+1,64);
1378 if (filtTrgTag.CompareTo(
"FiltTrgExc",TString::kIgnoreCase)==0) {
1379 gMessMgr->QAInfo() <<
"Trigger Filtering exclude with flavor=" << fFiltTrg << endm;
1380 fFiltTrg.Prepend(
'-');
1381 }
else if (filtTrgTag.CompareTo(
"FiltTrgInc",TString::kIgnoreCase)==0 ||
1382 filtTrgTag.CompareTo(
"FiltTrg" ,TString::kIgnoreCase)==0) {
1383 gMessMgr->QAInfo() <<
"Trigger Filtering include with flavor=" << fFiltTrg << endm;
1384 fFiltTrg.Prepend(
'+');
1390 }
else if (Tag.BeginsWith(
"fmsGainCorr",TString::kIgnoreCase)) {
1391 fFmsGainCorrTag = Tag;
1394 kgo =
kOpt(Tag.Data(),kFALSE);
1399 static const Char_t *path =
".:.$STAR_HOST_SYS/lib::.$STAR_HOST_SYS/LIB:$STAR/.$STAR_HOST_SYS/lib:$STAR/.$STAR_HOST_SYS/LIB";
1400 TString File = Tag; File +=
".so";
1401 Char_t *file = gSystem->Which(path,File.Data(),kReadPermission);
1404 Bfc_st row = {
"",
"",
"",
"",
"",
"",
"",kTRUE};
1405 memcpy (&row.Key, Tag.Data(), Tag.Length());
1406 if (Tag.Contains(
"Maker")) memcpy (&row.Maker, Tag.Data(), Tag.Length());
1407 memcpy (&row.Libs, Tag.Data(), Tag.Length());
1408 fchainOpt->
AddAt(&row);
1409 fNoChainOptions = fchainOpt->
GetNRows();
1410 fBFC = fchainOpt->GetTable();
1413 kgo =
kOpt(Tag.Data(),kFALSE);
1417 gMessMgr->QAInfo() <<
" Invalid Option " << Tag.Data() <<
". !! ABORT !! " << endm;
1432 assert(k<fNoChainOptions);
1433 Int_t n = strlen(fBFC[k].Opts);
1434 if (n > 0) SetOptions(fBFC[k].Opts,fBFC[k].Key);
1435 if (!fBFC[k].Flag) {
1436 fBFC[k].Flag = kTRUE;
1437 gMessMgr->QAInfo() << Form(
" Switch On %20s by %s", fBFC[k].Key, chainName) << endm;
1440 assert(-k<fNoChainOptions);
1441 if (k < 0 && fBFC[-k].Flag) {
1442 fBFC[-k].Flag = kFALSE;
1443 gMessMgr->QAInfo() << Form(
" Switch Off %20s by %s", fBFC[-k].Key, chainName) << endm;
1450 Bool_t StBFChain::GetOption(
const Int_t k)
const
1452 return (k>0 && k <fNoChainOptions) ? fBFC[k].Flag : kFALSE;
1477 Int_t o =
kOpt(Opt);
1479 else if(!GetOption(o))
return NULL;
1480 else return(fBFC[o].Comment);
1515 TString tChain(chainOpts);
1519 if (tChain ==
"" || tChain.CompareTo(
"ittf",TString::kIgnoreCase) == 0) {
1520 gMessMgr->QAInfo() <<
"\tPossible Chain Options are:" << endm;
1521 for (k=0;k<fNoChainOptions;k++)
1523 << Form(
" %3d: %-30s:%-12s:%-12s:%s:%s:%s:%s"
1524 ,k,fBFC[k].Key,fBFC[k].Name,fBFC[k].Chain,fBFC[k].Opts,fBFC[k].Maker,fBFC[k].Libs,fBFC[k].Comment)
1529 TString STAR_VERSION(
"$STAR_VERSION");
1530 gSystem->ExpandPathName(STAR_VERSION);
1531 gMessMgr->QAInfo() <<
"==============================================" << endm;
1532 gMessMgr->QAInfo() <<
"============= You are in " << STAR_VERSION.Data() <<
" ===============" << endm;
1533 gMessMgr->QAInfo() <<
"Requested chain " <<
GetName() <<
" is :\t" << tChain.Data() << endm;
1534 SetOptions(tChain,
"Chain");
1535 if (GetOption(
"NewTpcAlignment")) {
1536 gMessMgr->QAInfo() <<
"Set environment to use NewTpcAlignment" << endm;
1537 gEnv->SetValue(
"NewTpcAlignment",1);
1539 if (!GetOption(
"NoDefault")) {
1541 if (gClassTable->GetID(
"TGiant3") >= 0) {
1543 SetOption(
"-VMCPassive",
"Default,TGiant3");
1544 SetOption(
"-VMCAppl",
"Default,TGiant3");
1545 SetOption(
"-RootVMC",
"Default,TGiant3");
1546 if (GetOption(
"xgeometry")) {
1547 SetOption(
"-geometry",
"Default,-xgeometry");
1548 SetOption(
"-geomNoField",
"Default,-xgeometry");
1551 if (GetOption(
"fzin")) {
1552 gMessMgr->Error() <<
"Option fzin cannot be used in root.exe. Use root4star" << endm;
1555 if (GetOption(
"ntin")) {
1556 gMessMgr->Error() <<
"Option ntin cannot be used in root.exe. Use root4star" << endm;
1560 if (GetOption(
"gstar") || GetOption(
"pythia")) {
1561 SetOption(
"VMC",
"Default,-TGiant3,gstar");
1563 SetOption(
"-pythia",
"Default,-TGiant3");
1567 SetOption(
"-geantL",
"Default,-TGiant3");
1568 SetOption(
"-geometry",
"Default,-TGiant3");
1569 SetOption(
"-geomNoField",
"Default,-TGiant3");
1571 if (! (GetOption(
"VMC") || GetOption(
"VMCPassive"))) {
1572 SetOption(
"VMCPassive",
"Default,-TGiant3");
1576 SetOption(
"StarMiniCern",
"Default,-TGiant3");
1579 if (GetOption(
"ITTF") && ! (GetOption(
"Sti") || GetOption(
"StiCA") || GetOption(
"StiVMC"))) {
1580 TString STAR_LEVEL(gSystem->Getenv(
"STAR_LEVEL"));
1581 if (STAR_LEVEL ==
".DEV2")
SetOption(
"StiCA",
"Default,ITTF");
1585 if (!GetOption(
"Eval") && GetOption(
"AllEvent"))
SetOption(
"Eval",
"-Eval,AllEvent");
1589 for (k = 1; k<fNoChainOptions;k++) {
1591 gMessMgr->QAInfo() << Form(
"================== %20s\tis ON \t: %s",
1592 (
char *) fBFC[k].Key, (
char *) fBFC[k].Comment) << endm;
1593 Bfc->
AddAt(&fBFC[k]);
1599 void StBFChain::Set_IO_Files (
const Char_t *infile,
const Char_t *outfile){
1602 if (strlen(infile) > 2) {
1603 gc = TString(infile,3);
1607 SetInputFile(infile);
1611 void StBFChain::SetInputFile (
const Char_t *infile){
1613 if (infile) fInFile = infile;
1614 if (fInFile !=
"") {
1615 fInFile.ReplaceAll(
"\n",
";");
1616 fInFile.ReplaceAll(
"#",
";");
1617 fInFile.ReplaceAll(
":",
";");
1618 gMessMgr->QAInfo() <<
"Input file name = " << fInFile.Data() << endm;
1621 fInFile = fBFC[fkChain].Comment;
1622 fInFile.ReplaceAll(
"\n",
";");
1623 gMessMgr->QAInfo() <<
"Default Input file name = " << fInFile.Data() <<
" for chain : " << fBFC[fkChain].Key << endm;
1626 if (fInFile ==
"") {
SetOption(
"-in",
"No Input File");
SetOption(
"-InTree",
"NoInput File");
return;}
1627 if (!GetOption(
"fzin") && !GetOption(
"ntin")) {
1630 ParseString(fInFile,Files);
1633 while ((File = (TObjString *) next())) {
1634 TString
string = File->GetString();
1635 if (!
string.Contains(
"*") && !
string.BeginsWith(
"@") &&
1636 gSystem->AccessPathName(
string.Data())) {
1637 gMessMgr->Error() <<
"StBFChain::SetInputFile *** NO FILE: " <<
string.Data() <<
", exit!" << endm;
1640 else fSetFiles->AddFile(File->String().Data());
1648 if (! GetOption(
"NoOutput")) {
1652 if (fInFile !=
"") {
1653 if (GetOption(
"fzin") || GetOption(
"ntin")) {
1655 ParseString(fInFile,words);
1656 TIter nextL(&words);
1657 TObjString *word = 0;
1658 while ((word = (TObjString *) nextL())) {
1659 if (word->GetString().Contains(
".fz") ||
1660 word->GetString().Contains(
".nt")) {
1661 fFileOut = gSystem->BaseName(word->GetName());
1666 fFileOut = gSystem->BaseName(fInFile.Data());
1667 if (GetOption(
"shadow")) {
1668 TObjArray* fileOutTokens = fFileOut.Tokenize(
"_.");
1669 TString& runToken = ((TObjString*) (fileOutTokens->At(2)))->String();
1670 TString& seqToken = ((TObjString*) (fileOutTokens->At(4)))->String();
1671 if (!(runToken.CompareTo(
"adc"))) {
1672 runToken = ((TObjString*) (fileOutTokens->At(3)))->String();
1673 seqToken = ((TObjString*) (fileOutTokens->At(5)))->String();
1675 if (!(runToken.IsDigit())) {
1676 LOG_ERROR <<
"Unable to locate run number in filename for shadowing." << endm;
1678 fFileOut.ReplaceAll(runToken,Form(
"%d",
1679 StShadowMaker::getRunNumber(runToken.Atoi())));
1681 if (!(seqToken.IsDigit())) {
1682 LOG_ERROR <<
"Unable to locate file sequence number in filename for shadowing." << endm;
1684 fFileOut.ReplaceAll(seqToken,Form(
"%07d",
1685 StShadowMaker::getFileSeq(seqToken.Atoi())));
1687 delete fileOutTokens;
1691 if (fFileOut ==
"") {
1692 if (GetOption(
"pythia")) fFileOut =
"pythia.root";
1693 else if (GetOption(
"hijing")) fFileOut =
"hijing.root";
1694 else if (GetOption(
"VMC")) fFileOut =
"VMC.root";
1695 else if (GetOption(
"gstar")) fFileOut =
"gtrack.root";
1697 if ( fFileOut !=
"") {
1698 fFileOut.ReplaceAll(
"*",
"");
1699 fFileOut.ReplaceAll(
"@",
"");
1700 fFileOut.ReplaceAll(
"..",
".");
1701 fFileOut.ReplaceAll(
".daq",
"");
1702 fFileOut.ReplaceAll(
".fzd",
"");
1703 fFileOut.ReplaceAll(
".fz",
"");
1704 fFileOut.ReplaceAll(
".nt",
"");
1705 fFileOut.ReplaceAll(
".root",
"");
1706 fFileOut.ReplaceAll(
".list",
"");
1707 fFileOut.ReplaceAll(
".lis",
"");
1709 fFileOut.Append(
".root");
1713 if (fFileOut !=
"") gMessMgr->QAInfo() <<
"Output root file name " << fFileOut.Data() << endm;
1714 else SetOption(
"NoOutput",
"No Output File");
1716 if ( ( GetOption(
"tags") || GetOption(
"lana") ) && (fFileOut !=
"") ){
1717 TString TagsName = fFileOut;
1718 if( GetOption(
"lana") ){
1719 TagsName.ReplaceAll(
".root",
".laser.root");
1720 }
else if ( GetOption(
"mtdEvtFilt") ){
1721 TagsName.ReplaceAll(
".root",
".pretags.root");
1723 TagsName.ReplaceAll(
".root",
".tags.root");
1725 SetTFile(
new TFile(TagsName.Data(),
"RECREATE"));
1738 if (geantMk && geantMk->InheritsFrom(
"St_geant_Maker")) {
1739 SetInput(
"geant",
".make/geant/.data");
1740 TString GeomVersion(
"");
1742 geantMk->SetAttr(
"RunG",fRunG);
1744 if (!GetOption(
"fzin") || GetOption(
"ForceGeometry")) {
1745 GeomVersion =
"y2004x";
1746 const DbAlias_t *DbAlias = GetDbAliases();
1748 for (Int_t i = 0; DbAlias[i].tag; i++) {
1750 r += DbAlias[i].tag;
1751 if ( !GetOption(DbAlias[i].tag,kFALSE) && !GetOption(r,kFALSE))
continue;
1752 GeomVersion = DbAlias[i].geometry;
1756 if (! found) gMessMgr->QAInfo() <<
"StBFChain::SetGeantOptions() Chain has not found geometry tag. Use " << GeomVersion << endm;
1757 TString GeometryOpt;
1758 if (GetOption(
"phys_off")) {GeometryOpt +=
"detp phys_off=1;"; geantMk->SetAttr(
"phys_off",kTRUE);}
1759 if (GetOption(
"hadr_off")) {GeometryOpt +=
"detp hadr_off=1;"; geantMk->SetAttr(
"hadr_off",kTRUE);}
1760 GeometryOpt += (
"detp geometry ");
1761 GeometryOpt += GeomVersion;
1762 ProcessLine(Form(
"((St_geant_Maker *) %p)->LoadGeometry(\"%s\");",geantMk,GeometryOpt.Data()));
1764 if ((GetOption(
"fzin") || GetOption(
"ntin") || GetOption(
"mtin") || fInFile.Data()[0] ==
';') && fInFile !=
"")
1765 ProcessLine(Form(
"((St_geant_Maker *) %p)->SetInputFile(\"%s\")",geantMk,fInFile.Data()));
1784 if (GetOption(
"Agi")) mk->SetAlias(
"VmcGeometry",
"db/.const/StarDb/AgiGeometry");
1785 else if (GetOption(
"AgML") ) mk->SetAlias(
"VmcGeometry",
"db/.const/StarDb/AgMLGeometry");
1786 else if (GetOption(
"VmcGeo")) mk->SetAlias(
"VmcGeometry",
"db/.const/StarDb/VmcGeo");
1787 else mk->SetAlias(
"VmcGeometry",
"db/.const/StarDb/AgiGeometry");
1789 Int_t Idate=0,Itime=0;
1792 for (i = 1; i < fNoChainOptions; i++) {
1793 if (fBFC[i].Flag && !strncmp(fBFC[i].Key ,
"DbV",3)){
1797 gMessMgr->QAInfo() <<
"StBFChain::SetDbOptions Found time-stamp " << fBFC[i].Key <<
" [" << fBFC[i].Comment <<
"]" << endm;
1798 (void) sscanf(fBFC[i].Comment,
"%d/%d",&Idate,&Itime);
1804 if( ! Idate && FDate){
1805 gMessMgr->QAInfo() <<
"StBFChain::SetDbOptions Switching to user chosen dynamic time-stamp (MaxEntry) "
1806 << FDate <<
" " << FTime << endm;
1807 gMessMgr->QAInfo() <<
"Chain may crash if time-stamp is not validated by db interface" << endm;
1816 gMessMgr->QAInfo() <<
"StBFChain::SetDbOptions Switching to user chosen dynamic time-stamp (Start)"
1817 << FDateS <<
" " << FTimeS << endm;
1818 gMessMgr->QAInfo() <<
"Chain may crash if time-stamp is not validated by db interface" << endm;
1820 db->SetDateTime(FDateS,FTimeS);
1822 if (GetOption(
"simu")) {
1823 const DbAlias_t *DbAlias = GetDbAliases();
1825 for (Int_t i = 0; DbAlias[i].tag; i++) {
1826 if (GetOption(DbAlias[i].tag,kFALSE)) {
1827 db->SetDateTime(DbAlias[i].tag);
1832 if (! found) {gMessMgr->QAInfo() <<
"StBFChain::SetDbOptions() Chain has not set a time-stamp" << endm;}
1834 gMessMgr->QAInfo() << db->
GetName()
1835 <<
" Maker set time = "
1836 << db->GetDateTime().GetDate() <<
"."
1837 << db->GetDateTime().GetTime() << endm;
1838 if (GetOption(
"SIMU") && m_EvtHddr) {
1839 gMessMgr->QAInfo() <<
GetName() <<
" Chain set time from " << db->
GetName() << endm;
1840 m_EvtHddr->SetDateTime(db->GetDateTime());
1847 db->SetMaxEntryTime(Idate,Itime);
1848 gMessMgr->Info() <<
"\tSet DataBase max entry time " << Idate <<
"/" << Itime
1849 <<
" for St_db_Maker(\"" << db->
GetName() <<
"\")" << endm;
1851 #ifdef USE_BFCTIMESTAMP
1856 for (UInt_t i = 0; i < GTSOptions.size() ; i++){
1857 if ( (GTSOptions[i].Realm).IsNull() ){ realm =
"*";}
1858 else { realm = GTSOptions[i].Realm;}
1863 if ( GTSOptions[i].Type == 1){
1864 db->AddMaxEntryTimeOverride(GTSOptions[i].Date,0,
1865 (
char *) realm.Data(),
1866 (
char *) GTSOptions[i].Detector.Data());
1868 LOG_INFO <<
"Recovering override stamp " << i <<
" :: "
1869 << GTSOptions[i].Detector <<
", " << realm <<
", "
1870 << GTSOptions[i].Date <<
", " << GTSOptions[i].Time << endm;
1872 LOG_WARN <<
"Found override type " << GTSOptions[i].Type <<
" no treated yet"
1873 << GTSOptions[i].Detector <<
", " << realm <<
", "
1874 << GTSOptions[i].Date <<
", " << GTSOptions[i].Time << endm;
1881 if (!GetOption(
"fzin")) {
1886 Field_t FieldOptions[5] = {
1887 {
"FullMagFNegative", -1.0},
1888 {
"FullMagFPositive", 1.0},
1889 {
"HalfMagFNegative", -0.5},
1890 {
"HalfMagFPositive", 0.5},
1894 if (GetOption(
"FieldON")) {
1895 if (GetOption(
"ReverseField")) k = 0;
1897 }
else if (GetOption(
"HalfField")) {
1898 if (GetOption(
"ReverseField")) k = 2;
1900 }
else if (GetOption(
"FieldOff")) k = 4;
1902 SetFlavor(FieldOptions[k].name,
"MagFactor");
1903 gMessMgr->QAInfo() <<
"StBFChain::SetDbOptions SetFlavor(\"" << FieldOptions[k].name
1904 <<
"\",\"MagFactor\")" << endm;
1905 if ( gClassTable->GetID(
"StarMagField") >= 0) {
1907 Form(
"if (!StarMagField::Instance()) new StarMagField( StarMagField::EBField::kMapped, %f, kTRUE);",
1908 FieldOptions[k].scale);
1913 if (
this == GetTopChain()) {
1915 if (! GetOption(
"TpcDb") ) {mk->SetAttr(
"blacklist",
"tpc"); gMessMgr->QAInfo() <<
"blacklist tpc" << endm;}
1916 if (!(GetOption(
"SvtDb")||GetOption(
"SvtCalDb"))) {mk->SetAttr(
"blacklist",
"svt"); gMessMgr->QAInfo() <<
"blacklist svt" << endm;}
1917 if (!(GetOption(
"SsdDb")||GetOption(
"SsdCalDb"))) {mk->SetAttr(
"blacklist",
"ssd"); gMessMgr->QAInfo() <<
"blacklist ssd" << endm;}
1918 if (!(GetOption(
"SstDb")||GetOption(
"SstCalDb"))) {mk->SetAttr(
"blacklist",
"sst"); gMessMgr->QAInfo() <<
"blacklist sst" << endm;}
1919 if (! GetOption(
"EemcDb") ) {mk->SetAttr(
"blacklist",
"eemc"); gMessMgr->QAInfo() <<
"blacklist eemc"<< endm;}
1920 if (! GetOption(
"FmsDb") ) {mk->SetAttr(
"blacklist",
"fms"); gMessMgr->QAInfo() <<
"blacklist fms" << endm;}
1922 if (GetOption(
"NoSvtIt")) {mk->SetAttr(
"blacklist",
"svt"); gMessMgr->QAInfo() <<
"blacklist svt" << endm;}
1923 if (GetOption(
"NoSsdIt")) {mk->SetAttr(
"blacklist",
"ssd"); gMessMgr->QAInfo() <<
"blacklist ssd" << endm;}
1924 if (GetOption(
"NoSstIt")) {mk->SetAttr(
"blacklist",
"sst"); gMessMgr->QAInfo() <<
"blacklist sst" << endm;}
1933 if (!treeMk)
return;
1934 if (GetOption(
"EvOut")){
1935 gMessMgr->QAInfo() <<
"Will Write StEvent out, treeMk->GetFile() = " << treeMk->GetFile() << endm;
1936 treeMk->IntoBranch(
"eventBranch",
"StEvent");
1937 if (GetOption(
"EvOutOnly"))
return;
1939 if (! GetOption(
"nohistos")) treeMk->SetBranch(
"histBranch");
1940 if (! GetOption(
"norunco")) treeMk->SetBranch(
"runcoBranch");
1941 if (GetOption(
"McEvent") && GetOption(
"McEvOut")){
1942 gMessMgr->QAInfo() <<
"Will Write StMcEvent out, treeMk->GetFile() = " << treeMk->GetFile() << endm;
1943 treeMk->IntoBranch(
"McEventBranch",
"StMcEvent");
1945 if (GetOption(
"GeantOut")) treeMk->IntoBranch(
"geantBranch",
"geant");
1946 if (GetOption(
"AllEvent")) {
1947 if (GetOption(
"fzin") ||
1948 GetOption(
"ntin") ||
1949 GetOption(
"gstar") ||
1950 GetOption(
"pythia") ||
1952 GetOption(
"PrepEmbed")) {
1953 treeMk->IntoBranch(
"geantBranch",
"geant");
1954 treeMk->IntoBranch(
"geantBranch",
"geant/.data/particle");
1955 treeMk->IntoBranch(
"geantBranch",
"geant/.data/g2t_rch_hit");
1960 Long_t StBFChain::ProcessLine(
const char *line) {
1961 if (! line || !strlen(line))
return -1;
1962 if (Debug()) gMessMgr->QAInfo() <<
"ProcessLine " << line << endm;
1963 TInterpreter::EErrorCode error = TInterpreter::kNoError;
1964 Long_t res = gInterpreter->ProcessLine(line, &error);
1965 if (error != TInterpreter::kNoError) {
1966 gMessMgr->Error() <<
"StBFChain::ProcessLine command:" << line <<
" has failed. Quit job." << endm;
1972 TString StBFChain::GetGeometry()
const
1975 for (Int_t i=0;i<n;i++) {
1976 if (!fchainOpt->GetTable()[i].Flag)
continue;
1977 TString k(fchainOpt->GetTable()[i].Key);
1979 if (k[0]!=
'y')
continue;
1980 if (k[1]!=
'2')
continue;
1981 if (k[2] <
'0' || k[2]>
'9')
continue;
1982 if (k[3] <
'0' || k[3]>
'9')
continue;
1983 if (k[4] <
'0' || k[4]>
'9')
continue;
virtual Int_t Instantiate()
Maker-instantiation handler.
virtual Int_t Finish()
Really the destructor (close files, delete pointers etc ...)
virtual Char_t * GetOptionString(const Char_t *)
Returns the comment string associated to an option.
virtual void SetIOMode(Option_t *iomode="w")
number of transactions
void SetFlags(const Char_t *Chain="gstar tfs")
Scan all flags, check if they are correct, manipulate the comment if necessary.
virtual void SetTreeOptions()
Creates output-tree branches.
virtual void SetGeantOptions(StMaker *geant=0)
Handles all geant options.
virtual void SetDbOptions(StMaker *db=0)
Treats the DbV options used for database timestamp.
virtual Int_t kOpt(const TString *Tag, Bool_t Check=kTRUE) const
Check option if defined.
virtual Long_t GetNRows() const
Returns the number of the used rows for the wrapped table.
virtual Int_t AddAt(const void *c)
virtual const char * GetName() const
special overload
virtual void SetOption(const Int_t k, const Char_t *chain="Chain")
Enable/disable valid command line options.
virtual Int_t Load()
Routine handling library loading depending on chain options.
virtual ~StBFChain()
Destructor. Call Finish() . See this method for detail on what is cleaned.
void SetOutputFile(const Char_t *outfile=0)
Takes care of output file name (extension)
virtual void SetActive(Bool_t k=kTRUE)
Setters for flags and switches.