CGEM BOSS 6.6.5.h
BESIII Offline Software System
Loading...
Searching...
No Matches
BossMain.cxx File Reference
#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.

Macros

#define COMMON_MAIN_CPP
 

Functions

int main (int argc, char *argv[])
 

Macro Definition Documentation

◆ COMMON_MAIN_CPP

#define COMMON_MAIN_CPP

Definition at line 1 of file BossMain.cxx.

Function Documentation

◆ main()

int main ( int argc,
char * argv[] )

Definition at line 25 of file BossMain.cxx.

25 {
26
27
28
29 std::cout<<std::endl
30 << "**************************************************" << std::endl
31 << " BOSS version: "<<getenv("BES_RELEASE") << std::endl
32 << "************** BESIII Collaboration **************" << std::endl
33 << std::endl;
34 // Create an instance of an application manager
35 IInterface* iface = Gaudi::createApplicationMgr();
36 SmartIF<IProperty> propMgr ( iface );
37 SmartIF<IAppMgrUI> appMgr ( iface );
38 if( !appMgr.isValid() || !propMgr.isValid() ) {
39 std::cout << "Fatal error while creating the ApplicationMgr " << std::endl;
40 return 1;
41 }
42
43 // Get the input configuration file from arguments (defaulting to "jobOptions.txt")
44 std:: string opts = (argc>1) ? argv[1] : "jobOptions.txt";
45 std::cout<<"the jobOptions file is : " <<opts<<std::endl;
46 std::ifstream fin(opts.c_str());
47 if(fin.peek()==std::ifstream::traits_type::eof())
48 {
49 std::cout<<"ERROR! the jobOptions file is empty!"<<std::endl;
50 exit(1);
51 }
52 std::string cont;
53 std::string temp;
54 while(!fin.eof())
55 {
56 fin>>temp;
57 cont+=temp;
58 }
59 if(cont.size()<10)
60 {
61 std::cout<<"Please check your jobOptions."<<std::endl;
62 exit(1);
63 }
64
65
66 propMgr->setProperty( "JobOptionsPath", opts );
67 if( opts.substr( opts.length() - 3, 3 ) == ".py" ) {
68
69 // Python script specified - override defaults
70 propMgr->setProperty( "JobOptionsType", "NONE" );
71 propMgr->setProperty( "DLLs",
72 "['BossServices', 'GaudiPython', 'McEventSelector' ,'GaudiSvc']" );
73 propMgr->setProperty( "ExtSvc",
74 "[ 'McEventSelector/EventSelector']" );
75 propMgr->setProperty( "Runable", "PythonScriptingSvc" );
76 propMgr->setProperty( "EventLoop", "BossEventLoopMgr" );
77 propMgr->setProperty( "OutStreamType", "BossOutputStream" );
78 }
79
80 // Run the application manager and process events
81 return (appMgr->run().isSuccess()) ? 0 : 1;
82}
EvtComplex cont(const EvtTensor4C &t1, const EvtTensor4C &t2)