22int main(
int argc,
char* argv[] ) {
24 std::cout << std::endl
25 <<
"**************************************************" << std::endl
26 <<
" BOSS version: " << getenv(
"BES_RELEASE" ) << std::endl
27 <<
"************** BESIII Collaboration **************" << std::endl
30 IInterface* iface = Gaudi::createApplicationMgr();
31 SmartIF<IProperty> propMgr( iface );
32 SmartIF<IAppMgrUI> appMgr( iface );
33 if ( !appMgr.isValid() || !propMgr.isValid() )
35 std::cout <<
"Fatal error while creating the ApplicationMgr " << std::endl;
40 std::string opts = ( argc > 1 ) ? argv[1] :
"jobOptions.txt";
41 std::cout <<
"the jobOptions file is : " << opts << std::endl;
42 std::ifstream fin( opts.c_str() );
43 if ( fin.peek() == std::ifstream::traits_type::eof() )
45 std::cout <<
"ERROR! the jobOptions file is empty!" << std::endl;
55 if (
cont.size() < 10 )
57 std::cout <<
"Please check your jobOptions." << std::endl;
61 propMgr->setProperty(
"JobOptionsPath", opts );
62 if ( opts.substr( opts.length() - 3, 3 ) ==
".py" )
66 propMgr->setProperty(
"JobOptionsType",
"NONE" );
67 propMgr->setProperty(
"DLLs",
68 "['BossServices', 'GaudiPython', 'McEventSelector' ,'GaudiSvc']" );
69 propMgr->setProperty(
"ExtSvc",
"[ 'McEventSelector/EventSelector']" );
70 propMgr->setProperty(
"Runable",
"PythonScriptingSvc" );
71 propMgr->setProperty(
"EventLoop",
"BossEventLoopMgr" );
72 propMgr->setProperty(
"OutStreamType",
"BossOutputStream" );
76 return ( appMgr->run().isSuccess() ) ? 0 : 1;