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 "AliOnlineReconstruction.h"
11 #include <TApplication.h>
19 bool isReconstructionRunning()
21 // check if there is events server already running
22 const char *pid = gSystem->GetFromPipe("pidof alionlinereco").Data();
23 int pidSize = gSystem->GetFromPipe("pidof alionlinereco").Sizeof();
24 std::string pidOfAll(pid,pidSize);
25 std::stringstream pidStream(pidOfAll);
28 while( pidStream >> word ) ++word_count;
29 if(word_count != 1){return true;}
33 int main(int argc, char **argv)
37 std::cout<<"Start Online Reconstruction with run number as a parameter"<<std::endl;
40 if(isReconstructionRunning())
42 std::cout<<"There are other servers. Cannot start multiple servers on the same machine. Quitting..."<<std::endl;
47 std::cout<<"Incorrect run number"<<std::endl;
51 //TApplication app("AliOnlineReconstruction", &argc, argv);
53 gSystem->Setenv("DATE_RUN_NUMBER",Form("%d",atoi(argv[1])));
55 std::cout<<"Starting Online Reconstruction for run:"<<atoi(argv[1])<<std::endl;
56 AliOnlineReconstruction *onlineReconstruction = new AliOnlineReconstruction(atoi(argv[1]));
58 std::cout<<"after run"<<std::endl;
59 if(onlineReconstruction){delete onlineReconstruction;}
60 std::cout<<"deleted"<<std::endl;