Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
eventClient.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file eventClient.cc
1 #include <string.h>
2 #include <stdio.h>
3 #include <iostream>
4 #include <iomanip>
5 
6 #include "eventReceiverClient.h"
7 #include "Event.h"
8 
9 #ifdef HAVE_GETOPT_H
10 #include "getopt.h"
11 #endif
12 
13 using namespace std;
14 
15 // Driver code
16 int
17 main(int argc, char *argv[])
18 {
19 
20 
21  if ( argc < 2)
22  {
23  cout << " usage: " << argv[0] << " event_nr [hostname] " << endl;
24  return 1;
25  }
26  int evtnr = atoi(argv[1]);
27  string host;
28  if ( argc >= 3)
29  {
30  host = argv[2];
31  }
32  else
33  {
34  host = "localhost";
35  }
36 
38  if ( erc->getStatus())
39  {
40  delete erc;
41  return 1;
42  }
43 
44  Event *e = erc->getEvent(evtnr);
45  if (e)
46  {
47  e->identify();
48  delete e;
49  }
50  else
51  {
52  cout << "event " << evtnr << " not received" << endl;
53  }
54  delete erc;
55 
56  return 0;
57 }