11int External ()
22{
3+ // Print folder content through ls command
4+ std ::cout << "### Folder content ###" << std ::endl ;
5+ std ::system ("ls -l" );
6+ // Print the content of the o2sim_serverlog file
7+ std ::ifstream serverLog ("o2sim_serverlog" );
8+ std ::cout << "### o2sim_serverlog ###" << std ::endl ;
9+ if (!serverLog .is_open ())
10+ {
11+ std ::cerr << "Cannot open o2sim_serverlog file\n" ;
12+ return 1 ;
13+ }
14+ std ::string line ;
15+ while (std ::getline (serverLog , line ))
16+ {
17+ std ::cout << line << "\n" ;
18+ }
19+ serverLog .close ();
20+ // Print the content of the o2sim_mergerlog file
21+ std ::ifstream mergerLog ("o2sim_mergerlog" );
22+ std ::cout << "### o2sim_mergerlog ###" << std ::endl ;
23+ if (!mergerLog .is_open ())
24+ {
25+ std ::cerr << "Cannot open o2sim_mergerlog file\n" ;
26+ return 1 ;
27+ }
28+ while (std ::getline (mergerLog , line ))
29+ {
30+ std ::cout << line << "\n" ;
31+ }
32+ mergerLog .close ();
33+ // Print the content of the o2sim_workerlog0 file
34+ std ::ifstream workerLog ("o2sim_workerlog0" );
35+ std ::cout << "### o2sim_workerlog0 ###" << std ::endl ;
36+ if (!workerLog .is_open ())
37+ {
38+ std ::cerr << "Cannot open o2sim_workerlog0 file\n" ;
39+ return 1 ;
40+ }
41+ while (std ::getline (workerLog , line ))
42+ {
43+ std ::cout << line << "\n" ;
44+ }
45+ workerLog .close ();
46+ // Print the content of the z-cfg.mtr file
47+ std ::ifstream mtrLog ("z-cfg.mtr" );
48+ std ::cout << "### z-cfg.mtr ###" << std ::endl ;
49+ if (!mtrLog .is_open ())
50+ {
51+ std ::cerr << "Cannot open z-cfg.mtr file\n" ;
52+ return 1 ;
53+ }
54+ while (std ::getline (mtrLog , line ))
55+ {
56+ std ::cout << line << "\n" ;
57+ }
58+ mtrLog .close ();
359 std ::string path {"o2sim_Kine.root" };
460 // Check that file exists, can be opened and has the correct tree
561 TFile file (path .c_str (), "READ ");
@@ -61,4 +117,4 @@ int External()
61117 }
62118 }
63119 return 0 ;
64- }
120+ }
0 commit comments