22 {
23
24 std::cout << std::endl
25 << "**************************************************" << std::endl
26 << " BOSS version: " << getenv( "BES_RELEASE" ) << std::endl
27 << "************** BESIII Collaboration **************" << std::endl
28 << std::endl;
29
30 IInterface* iface = Gaudi::createApplicationMgr();
31 SmartIF<IProperty> propMgr( iface );
32 SmartIF<IAppMgrUI> appMgr( iface );
33 if ( !appMgr.isValid() || !propMgr.isValid() )
34 {
35 std::cout << "Fatal error while creating the ApplicationMgr " << std::endl;
36 return 1;
37 }
38
39
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() )
44 {
45 std::cout << "ERROR! the jobOptions file is empty!" << std::endl;
46 exit( 1 );
47 }
49 std::string temp;
50 while ( !fin.eof() )
51 {
52 fin >> temp;
54 }
55 if (
cont.size() < 10 )
56 {
57 std::cout << "Please check your jobOptions." << std::endl;
58 exit( 1 );
59 }
60
61 propMgr->setProperty( "JobOptionsPath", opts );
62 if ( opts.substr( opts.length() - 3, 3 ) == ".py" )
63 {
64
65
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" );
73 }
74
75
76 return ( appMgr->run().isSuccess() ) ? 0 : 1;
77}
EvtComplex cont(const EvtTensor4C &t1, const EvtTensor4C &t2)