Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
eloghandler.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file eloghandler.cc
1 #include <eloghandler.h>
2 #include <iostream>
3 #include <stdlib.h>
4 #include <sstream>
5 
6 using namespace std;
7 
9  {
10  hostname=h;
11  port=p;
12  logbookname = name;
13  }
14 
16 {
17 
18  ostringstream command;
19 
20  command << "elog -h " << hostname << " -p " << port << " -l " << logbookname <<
21  " -a \"Author=" << who << "\"" <<
22  " -a \"Subject=Run " << run << " started\" " <<
23  "\"Run " << run << " started with file " << filename << "\"" <<
24  " >/dev/null 2<&1" << endl;
25 
26 
27  // cout << command.str() << endl;
28  system (command.str().c_str() );
29  return 0;
30 }
31 
32 int ElogHandler::EndrunLog ( const int run, std::string who, const int events, const double volume, time_t starttime)
33 {
34 
35 
36  ostringstream command;
37 
38  command << "elog -h " << hostname << " -p " << port
39  << " -l " << logbookname<< " -a \"Author=" << who << "\""
40  << " -a \"Subject=Run " << run << " ended\" "
41  << "\"Run " << run
42  << " ended with " << events
43  << " events, size is " << volume << " MB"
44  << " duration " << time(0) - starttime << " s\" "
45  << " >/dev/null 2<&1" << endl;
46 
47  // cout << command.str() << endl;
48  system (command.str().c_str() );
49 
50 
51  return 0;
52 }