16 Int_t iEvt=0,istat=0,nEvents=0;
19 cout <<
"Usage: doEEmcSmd.C(2) // work with default event.root file" << endl;
20 cout <<
" doEEmcSmd.C(startEvent,nEvents,\"path/somefile.event.root\")" << endl;
21 cout <<
" doEEmcSmd.C(nEvents,\"path/*.event.root\")" << endl;
22 cout <<
" doEEmcSmd.C(nEvents,\"path/file.dst.root\",\"evout\") //Write out StEvent" << endl;
23 cout <<
" doEEmcSmd.C(nEvents,\"path/file.dst.root\",\"display\") //EventDispay" << endl;
27 void doEEmcSmd(Int_t nEvents,
const Char_t ** fileList,
const Char_t *qaflag =0);
28 void doEEmcSmd(Int_t startEvent, Int_t nEvents,
const Char_t ** fileList,
const Char_t *qaflag =0);
30 void doEEmcSmd(Int_t nEvents,
31 const Char_t *file=
"AuPb200-100.event.root",
32 const Char_t *qaflag = 0);
34 void doEEmcSmd(Int_t startEvent,Int_t nEvents,
35 const Char_t *file=
"/afs/rhic.bnl.gov/star/data/samples/example.event.root",
36 const Char_t *qaflag = 0);
38 void doEEmcSmd(
const Int_t nEvents,
41 const Char_t *qaflag,
int flag);
47 void doEEmcSmd(Int_t startEvent, Int_t nEventsQQ,
const Char_t **fileList,
const Char_t *qaflag)
51 TString tflag = qaflag;
52 int eventDisplay = tflag.Contains(
"disp",TString::kIgnoreCase);
54 cout << endl << endl <<
" doEEmcSmd - input # events = " << nEvents << endl;
56 while(fileList[ilist]){
57 cout <<
" doEEmcSmd - input fileList = " << fileList[ilist] << endl;
66 gSystem->Load(
"St_base");
67 gSystem->Load(
"StChain");
69 gSystem->Load(
"libgen_Tables");
70 gSystem->Load(
"libsim_Tables");
71 gSystem->Load(
"libglobal_Tables");
73 gSystem->Load(
"StUtilities");
74 gSystem->Load(
"StIOMaker");
75 gSystem->Load(
"StTreeMaker");
76 gSystem->Load(
"StarClassLibrary");
77 gSystem->Load(
"StEvent");
78 gSystem->Load(
"StEventUtilities");
79 gSystem->Load(
"StMagF");
80 gSystem->Load(
"libtpc_Tables");
82 gSystem->Load(
"StTpcDb");
83 gSystem->Load(
"StEEmcSmdAnalysisMaker");
84 gSystem->Load(
"StEEmcUtil");
87 gSystem->Load(
"St_Tables.so");
88 gSystem->Load(
"StDbLib.so");
89 gSystem->Load(
"StDbBroker.so");
90 gSystem->Load(
"libStDb_Tables.so");
92 gSystem->Load(
"St_db_Maker.so");
96 gSystem->Load(
"St_g2t");
97 gSystem->Load(
"geometry");
98 gSystem->Load(
"St_geant_Maker");
99 gSystem->Load(
"StTableUtilities");
100 gSystem->Load(
"StEventDisplayMaker");
106 chain =
new StChain(
"StChain");
109 setFiles=
new StFile(fileList);
111 gSystem->Load(
"StChallenger");
112 setFiles = StChallenger::Challenge();
113 setFiles->SetDebug();
114 const char *Argv[]= {
116 "-q",
"numberOfPrimaryTracks>1500",
117 "-c",
"/afs/rhic.bnl.gov/star/incoming/GCA/daq/stacs.rc"
119 Int_t Argc=
sizeof(Argv)/4;
120 setFiles->Init(Argc,Argv);
125 int NwGeant=5000000, IwType=0, NwPaw=0;
133 if (fileList && fileList[0] && strstr(fileList[0],
".root")) {
134 mainBranch = fileList[0];
135 printf(
"fileList[0] %s %s\n",fileList[0],mainBranch.Data());
136 mainBranch.ReplaceAll(
".root",
"");
137 int idot = strrchr((
char*)mainBranch,
'.') - mainBranch.Data();
138 mainBranch.Replace(0,idot+1,
"");
139 mainBranch+=
"Branch";
140 printf(
"*** mainBranch=%s ***\n",mainBranch.Data());
145 IOMk->SetBranch(
"*",0,
"0");
146 if(!mainBranch.IsNull()) IOMk->SetBranch(mainBranch,0,
"r");
147 IOMk->SetBranch(
"dstBranch",0,
"r");
154 if (!mainBranch.Contains(
"eventBranch")) {
155 gSystem->Load(
"StTpcDb");
156 gSystem->Load(
"StEventMaker");
163 char *db2 =
"StarDb";
164 if (gSystem->AccessPathName(db2) !=0) {
165 printf(
"File %s does not exist\n",db2);
169 dbMk->SetDateTime(010102,000);
173 StEEmcSmdAnalysisMaker *analysisMaker =
new StEEmcSmdAnalysisMaker(
"EEmcSmdAna");
176 analysisMaker->setOuterTrackGeometry();
177 analysisMaker->setAnalysisSectorId(6);
178 analysisMaker->setMinMomentum(1.0);
179 analysisMaker->setMaxGapForMatch(3);
183 Int_t wrStEOut = tflag.Contains(
"evout",TString::kIgnoreCase);
185 cout <<
"!!!! doEEmcSmd: will write out .event.root file !!" << endl << endl;
188 outMk->SetBranch(
"eventBranch",
"test.event.root",
"w");
189 outMk->IntoBranch(
"eventBranch",
"StEvent");
196 StEventDisplayMaker *displayMk =
new StEventDisplayMaker();
197 displayMk->AddName(
"StEvent(All Tracks)");
198 displayMk->AddFilter(
new StFilterDef(
"MainFilter"));
205 Int_t iInit = chain->Init();
206 if (iInit) chain->Fatal(iInit,
"on init");
208 if (startEvent > 1) IOMk->Skip(startEvent-1);
224 EventLoop:
if (iEvt <= nEvents && istat!=2) {
226 cout << endl <<
"=== Event " << iEvt <<
" start ===" << endl;
229 istat = chain->
Make(iEvt);
232 {cout <<
"Last event processed. Status = " << istat << endl;}
234 {cout <<
"Error event processed. Status = " << istat << endl;}
242 cout << endl <<
"=== Event " << iEvt <<
" finish ===" << endl;
248 void doEEmcSmd(
const Int_t startEvent,
const Int_t nEvents,
const Char_t *file,
const Char_t *qaflag)
250 printf(
"*file = %s\n",file);
251 const char *fileListQQ[]={0,0};
252 if (strncmp(file,
"GC",2)==0) {
257 doEEmcSmd(startEvent,nEvents,fileListQQ,qaflag);
260 void doEEmcSmd(
const Int_t nEvents,
const Char_t *file,
const Char_t *qaflag)
262 doEEmcSmd(1,nEvents,file,qaflag);
266 void doEEmcSmd(
const Int_t nEvents,
const Char_t *path,
const Char_t *file,
const Char_t *qaflag,
int flag)
269 if (path && path[0] && path[0]!=
'-') F = path;
270 if (file && file[0] && file[0]!=
'-')
272 if (!F.IsNull()) F +=
"/";
275 TString opt = qaflag;
276 if (flag) opt +=
" evout";
279 doEEmcSmd(1,nEvents,F.Data(),opt.Data());
283 void doEEmcSmd(Int_t nEvents,
const Char_t **fileList,
const Char_t *qaflag)
284 { doEEmcSmd(1,nEvents,fileList,qaflag); }
virtual void SetIOMode(Option_t *iomode="w")
number of transactions
virtual void Clear(Option_t *option="")
User defined functions.
virtual void SetActive(Bool_t k=kTRUE)
Setters for flags and switches.
virtual void LoadGeometry(const Char_t *option="detp geometry field_only")
Specifies GEANT3 geometry command.