#include "GaudiKernel/SmartIF.h"
#include "GaudiKernel/Bootstrap.h"
#include "GaudiKernel/IAppMgrUI.h"
#include "GaudiKernel/IProperty.h"
#include <iostream>
#include <fstream>
Go to the source code of this file.
Defines | |
#define | COMMON_MAIN_CPP |
Functions | |
int | main (int argc, char *argv[]) |
Variables | |
static const char * | rcsid = "$Id: BossMain.cxx,v 1.4 2013/11/21 01:07:52 dengzy Exp $" |
#define COMMON_MAIN_CPP |
Definition at line 1 of file BossMain.cxx.
int main | ( | int | argc, | |
char * | argv[] | |||
) |
Definition at line 25 of file BossMain.cxx.
References cont(), deljobs::string, and subSeperate::temp.
00025 { 00026 00027 00028 00029 std::cout<<std::endl 00030 << "**************************************************" << std::endl 00031 << " BOSS version: "<<getenv("BES_RELEASE") << std::endl 00032 << "************** BESIII Collaboration **************" << std::endl 00033 << std::endl; 00034 // Create an instance of an application manager 00035 IInterface* iface = Gaudi::createApplicationMgr(); 00036 SmartIF<IProperty> propMgr ( iface ); 00037 SmartIF<IAppMgrUI> appMgr ( iface ); 00038 if( !appMgr.isValid() || !propMgr.isValid() ) { 00039 std::cout << "Fatal error while creating the ApplicationMgr " << std::endl; 00040 return 1; 00041 } 00042 00043 // Get the input configuration file from arguments (defaulting to "jobOptions.txt") 00044 std:: string opts = (argc>1) ? argv[1] : "jobOptions.txt"; 00045 std::cout<<"the jobOptions file is : " <<opts<<std::endl; 00046 std::ifstream fin(opts.c_str()); 00047 if(fin.peek()==std::ifstream::traits_type::eof()) 00048 { 00049 std::cout<<"ERROR! the jobOptions file is empty!"<<std::endl; 00050 exit(1); 00051 } 00052 std::string cont; 00053 std::string temp; 00054 while(!fin.eof()) 00055 { 00056 fin>>temp; 00057 cont+=temp; 00058 } 00059 if(cont.size()<10) 00060 { 00061 std::cout<<"Please check your jobOptions."<<std::endl; 00062 exit(1); 00063 } 00064 00065 00066 propMgr->setProperty( "JobOptionsPath", opts ); 00067 if( opts.substr( opts.length() - 3, 3 ) == ".py" ) { 00068 00069 // Python script specified - override defaults 00070 propMgr->setProperty( "JobOptionsType", "NONE" ); 00071 propMgr->setProperty( "DLLs", 00072 "['BossServices', 'GaudiPython', 'McEventSelector' ,'GaudiSvc']" ); 00073 propMgr->setProperty( "ExtSvc", 00074 "[ 'McEventSelector/EventSelector']" ); 00075 propMgr->setProperty( "Runable", "PythonScriptingSvc" ); 00076 propMgr->setProperty( "EventLoop", "BossEventLoopMgr" ); 00077 propMgr->setProperty( "OutStreamType", "BossOutputStream" ); 00078 } 00079 00080 // Run the application manager and process events 00081 return (appMgr->run().isSuccess()) ? 0 : 1; 00082 }
Definition at line 13 of file BossMain.cxx.