File indexing completed on 2025-08-03 08:19:05
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019 #include <iostream>
0020 #include <time.h>
0021
0022
0023 #include "JetScape.h"
0024 #include "JetScapeWriterStream.h"
0025 #ifdef USE_HEPMC
0026 #include "JetScapeWriterHepMC.h"
0027 #endif
0028
0029 #include <chrono>
0030 #include <thread>
0031
0032 using namespace Jetscape;
0033
0034
0035 void Show();
0036
0037
0038
0039 int main(int argc, char** argv)
0040 {
0041 clock_t t; t = clock();
0042 time_t start, end; time(&start);
0043
0044
0045 JetScapeLogger::Instance()->SetInfo(true);
0046 JetScapeLogger::Instance()->SetDebug(false);
0047 JetScapeLogger::Instance()->SetRemark(false);
0048 JetScapeLogger::Instance()->SetVerboseLevel(0);
0049
0050 Show();
0051
0052
0053
0054 auto jetscape = make_shared<JetScape>();
0055 const char* mainXMLName = "../config/jetscape_main.xml";
0056 const char* userXMLName = "../config/jetscape_user.xml";
0057 if (argc == 2) {
0058 if ( strcmp(argv[1], "--help")==0 || strcmp(argv[1], "-h")==0 ){
0059 std::cout << "Command line options:" << std::endl;
0060 std::cout << " First (optional) argument: path to user XML file ./runJetscape /path/to/user.xml" << std::endl;
0061 std::cout << " Second (optional) argument: path to main XML file ./runJetscape /path/to/user.xml /path/to/main.xml" << std::endl;
0062 std::cout << " If no command line options are given, defaults are used: config/jetscape_user.xml config/jetscape_main.xml" << std::endl;
0063 return -1;
0064 }
0065 else {
0066 userXMLName = argv[1];
0067 }
0068 }
0069 else if (argc == 3) {
0070 userXMLName = argv[1];
0071 mainXMLName = argv[2];
0072 }
0073 jetscape->SetXMLMainFileName(mainXMLName);
0074 jetscape->SetXMLUserFileName(userXMLName);
0075
0076
0077 jetscape->Init();
0078
0079
0080 jetscape->Exec();
0081
0082
0083 jetscape->Finish();
0084
0085 INFO_NICE<<"Finished!";
0086 cout<<endl;
0087
0088 t = clock() - t;
0089 time(&end);
0090 printf ("CPU time: %f seconds.\n",((float)t)/CLOCKS_PER_SEC);
0091 printf ("Real time: %f seconds.\n",difftime(end,start));
0092 return 0;
0093 }
0094
0095
0096
0097 void Show()
0098 {
0099 INFO_NICE<<"------------------------------";
0100 INFO_NICE<<"| ... JetScape Framework ... |";
0101 INFO_NICE<<"------------------------------";
0102 INFO_NICE;
0103 }