FairRoot/PandaRoot
Functions
runPndTopixOnlineHisto.cxx File Reference
#include <PndMQTopix4OnlineHisto.h>
#include <iostream>
#include "boost/program_options.hpp"
#include "FairMQLogger.h"
#include "FairMQParser.h"
#include "FairMQProgOptions.h"
#include "FairMQProcessor.h"
#include "FairMQDevice.h"
#include "TApplication.h"
#include "FairMQTransportFactoryZMQ.h"

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 37 of file runPndTopixOnlineHisto.cxx.

References filename, and PndMQTopix4OnlineHisto::Run().

38 {
39  PndMQTopix4OnlineHisto processor;
40  processor.CatchSignals();
41 
42  FairMQProgOptions config;
43 
44  TApplication theApp("App",0,0);
45 
46  try
47  {
48  config.ParseAll(argc, argv);
49 
50  std::string filename = config.GetValue<std::string>("config-json-file");
51  std::string id = config.GetValue<std::string>("id");
52 
53 
54  config.UserParser<FairMQParser::JSON>(filename, id);
55 
56  processor.fChannels = config.GetFairMQMap();
57 
58  LOG(INFO) << "PID: " << getpid();
59  LOG(INFO) << "ID: " << id ;
60 
61 #ifdef NANOMSG
62  FairMQTransportFactory* transportFactory = new FairMQTransportFactoryNN();
63 #else
64  FairMQTransportFactory* transportFactory = new FairMQTransportFactoryZMQ();
65 #endif
66 
67  processor.SetTransport(transportFactory);
68 
69  processor.SetProperty(FairMQDevice::Id, id);
70 
71  //PndMQTopix4ProcessorTask* task = new PndMQTopix4ProcessorTask();
72  //processor.SetTask(task);
73 
74  processor.ChangeState("INIT_DEVICE");
75  processor.WaitForEndOfState("INIT_DEVICE");
76 
77  processor.ChangeState("INIT_TASK");
78  processor.WaitForEndOfState("INIT_TASK");
79 
80  processor.ChangeState("RUN");
81  theApp.Run();
82  processor.InteractiveStateLoop();
83  }
84  catch (std::exception& e)
85  {
86  LOG(ERROR) << e.what();
87  LOG(INFO) << "Command line options are the following: ";
88  config.PrintHelp();
89  return 1;
90  }
91 
92  return 0;
93 }
const string filename