1 // Author: Mihai Niculescu 2013
3 /**************************************************************************
4 * Copyright(c) 1998-2013, ALICE Experiment at CERN, all rights reserved. *
5 * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for *
6 * full copyright notice. *
7 **************************************************************************/
9 #include <TApplication.h>
13 #include "AliEventServerWindow.h"
14 #include "AliEventServer.h"
19 int main(int argc, char **argv)
21 // check if there is events server already running
22 const char *pid = gSystem->GetFromPipe("pidof alieventserver").Data();
23 int pidSize = gSystem->GetFromPipe("pidof alieventserver").Sizeof();
24 std::string pidOfAll(pid,pidSize);
25 std::stringstream pidStream(pidOfAll);
29 while( pidStream >> word ) ++word_count;
33 std::cout<<"There are other servers. Cannot start multiple servers on the same machine. Quitting..."<<std::endl;
37 TApplication app("AliEventServer", &argc, argv);
41 std::cout<<"Starting Event Server without GUI"<<std::endl;
42 AliEventServer *server = new AliEventServer;
44 if(server){delete server;}
46 else if(strcmp(argv[1],"gui")==0)
48 std::cout<<"Starting Event Server in GUI mode"<<std::endl;
49 AliEventServerWindow *win = new AliEventServerWindow;
56 std::cout<<"Call without parameters to run without GUI.\nCall with \"gui\" parameter to launch with GUI"<<std::endl;