5 #include <TGApplication.h>
15 extern JApplication *
japp;
28 int main(
int narg,
char *argv[])
38 try{ gPARMS->GetParameter(
"RUNNUMBER",
RUNNUMBER); }
catch(...){}
41 TApplication app(
"HDView", &narg, argv);
47 japp->AddProcessor(myproc);
73 japp->GetJParameterManager()->PrintParameters();
74 app.SetReturnFromRun(
true);
101 vector<JEventLoop*> loops = japp->GetJEventLoops();
103 _DBG_<<
"No JEventLoops in japp!"<<endl;
106 JEventLoop *loop = loops[0];
110 cout<<
" Factory List"<<endl;
111 cout<<
"-------------------------"<<endl;
115 vector<JFactory_base*> factories = loop->GetFactories();
116 vector<JFactory_base*>::iterator iter = factories.begin();
117 for(; iter!=factories.end(); iter++){
118 cout<<
" "<<(*iter)->GetDataClassName();
119 if(strlen((*iter)->Tag()) !=0){
120 cout<<
" : "<<(*iter)->Tag();
125 cout<<
" "<<factories.size()<<
" factories registered"<<endl;
136 if(narg==1)
Usage(japp);
138 for(
int i=1;i<narg;i++){
139 if(argv[i][0] !=
'-')
continue;
152 const char *DISPLAY = getenv(
"DISPLAY");
155 jerr <<
" WARNING: You do not appear to have your DISPLAY environment" << endl;
156 jerr <<
" variable set. This may prevent the graphics window" << endl;
157 jerr <<
" from opening or even cause a seg. fault. Consider" << endl;
158 jerr <<
" setting this to something like \"localhost:0\" if" << endl;
159 jerr <<
" you have trouble opening the display." << endl;
169 cout<<
"Usage:"<<endl;
170 cout<<
" hdview2 [options] source1 source2 ..."<<endl;
172 cout<<
"Print the contents of a Hall-D data source (e.g. a file)"<<endl;
173 cout<<
"to the screen."<<endl;
175 cout<<
"Options:"<<endl;
177 cout<<
" -h Print this message"<<endl;
178 cout<<
" -Dname Print the data of type \"name\" (can be used multiple times)"<<endl;
179 cout<<
" -A Print ALL data types (overrides and -DXXX options)"<<endl;
180 cout<<
" -L List available factories and exit"<<endl;
181 cout<<
" -p Don't pause for keystroke between events (def. is to pause)"<<endl;
182 cout<<
" -s Skip events which don't have any of the specified data types"<<endl;
184 cout<<
"JANA options:"<<endl;
void ParseCommandLineArguments(int &narg, char *argv[])
void PrintFactoryList(DApplication *app)
void Usage(JApplication &app)
int main(int argc, char *argv[])