24 void RedoSpaceCharge(
const int firstEvt,
27 const char* inputFiles);
28 void RedoSpaceCharge(
const int NEvts,
30 const char* inputFiles);
31 void RedoSpaceCharge(
const int NEvts=10000000,
32 const char* inputFiles=0);
35 void run(
const int firstEvt,
38 const char* inputFiles,
39 const char* outDir=0);
43 const Char_t *defaultFiles =
"@o1.lis";
44 const Char_t *defaultOutDir =
"./";
51 " RedoSpaceCharge.C" <<
52 "(firstEvt,NEvts,redo,\"some_directory/some_file.event.root\")\n" <<
53 " RedoSpaceCharge.C" <<
54 "(NEvts,redo,\"some_directory/some_file.event.root\")\n" <<
55 " RedoSpaceCharge.C" <<
56 "(NEvts,\"some_directory/some_file.event.root\")\n" <<
58 cout <<
"where redo=kTRUE to redo using new SpaceCharge,\n" <<
59 " redo=kFALSE to use the current tracks as they are,\n" <<
60 " and the new SpaceCharge is used if redo is omitted." << endl;
65 gSystem->Load(
"libTable");
66 gSystem->Load(
"libPhysics");
67 gSystem->Load(
"St_base");
68 gSystem->Load(
"StUtilities");
69 gSystem->Load(
"StChain");
70 gSystem->Load(
"StTreeMaker");
71 gSystem->Load(
"St_Tables");
72 gSystem->Load(
"StIOMaker");
73 gSystem->Load(
"StarClassLibrary");
74 gSystem->Load(
"StTriggerDataMaker");
75 gSystem->Load(
"StBichsel");
76 gSystem->Load(
"StEvent");
77 gSystem->Load(
"StSecondaryVertexMaker");
78 gSystem->Load(
"StarMagField");
79 gSystem->Load(
"StMagF");
80 gSystem->Load(
"StDbLib.so");
81 gSystem->Load(
"StDbBroker.so");
82 gSystem->Load(
"libglobal_Tables.so");
83 gSystem->Load(
"St_db_Maker.so");
84 gSystem->Load(
"StDetectorDbMaker");
85 gSystem->Load(
"StTpcDb");
86 gSystem->Load(
"StDbUtilities");
87 gSystem->Load(
"StEventUtilities");
88 gSystem->Load(
"StStrangeMuDstMaker");
89 gSystem->Load(
"StEmcUtil");
90 gSystem->Load(
"StMuDSTMaker");
93 void run(
const int firstEvt,
96 const char* inputFiles,
100 const Char_t *file = ( (inputFiles) ? inputFiles : defaultFiles );
101 const Char_t *dir = ( (outDir) ? outDir : defaultOutDir );
103 files->AddFile(file);
109 StIOMaker IOMaker(
"IOMaker",
"r",files,
"bfcTree");
110 St_db_Maker dbMaker(
"db",
"MySQL:StarDb",
"$STAR/StarDb",
"StarDb");
120 IOMaker.SetBranch(
"*",0,
"0");
121 IOMaker.SetBranch(
"eventBranch",0,
"r");
122 IOMaker.SetBranch(
"runcoBranch",0,
"r");
123 IOMaker.SetBranch(
"emcBranch",0,
"r");
129 strangeDst.SetNoKeep();
132 commonDst.setProbabilityPidFile();
134 commonDst.setL3TrackFilter(l3Filter);
136 commonDst.setTrackFilter(filter);
139 if (!redo) redoMk.DontDo();
142 Int_t istatus = chain.Init();
143 if( istatus ) { chain.Fatal(istatus,
"on init");
return; }
145 IOMaker.Skip(firstEvt);
148 for( Int_t i=0; (i<NEvts) && (istatus!=2); i++ ) {
150 switch (istatus = chain.
Make()) {
152 case 2: { gMessMgr->Info(
"Last event from input.");
break; }
153 case 3: { gMessMgr->Error() <<
"Event " << i <<
" had error " <<
154 istatus <<
". Now skipping event."; gMessMgr->Print();
break; }
155 default: { gMessMgr->Warning() <<
"Event " << i <<
" returned status " <<
156 istatus <<
". Continuing."; gMessMgr->Print(); }
158 gMessMgr->Info() <<
"*** Finished processing event " << i;
163 if( NEvts >= 1 ) chain.
Finish();
166 void RedoSpaceCharge(
const int firstEvt,
169 const char* inputFiles) {
171 run(firstEvt,NEvts,redo,inputFiles,defaultOutDir);
174 void RedoSpaceCharge(
const int NEvts,
176 const char* inputFiles) {
177 RedoSpaceCharge(0,NEvts,redo,inputFiles);
180 void RedoSpaceCharge(
const int NEvts,
181 const char* inputFiles) {
182 RedoSpaceCharge(0,NEvts,kTRUE,inputFiles);
virtual void Clear(Option_t *option="")
User defined functions.