FairRoot/PandaRoot
Functions
runPndTopixSorterDistributor.cxx File Reference
#include <PndMQSorterDistributor.h>
#include <iostream>
#include "boost/program_options.hpp"
#include "FairMQLogger.h"
#include "FairMQParser.h"
#include "FairMQProgOptions.h"
#include "FairMQProcessor.h"
#include "FairMQDevice.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 35 of file runPndTopixSorterDistributor.cxx.

References fe, and filename.

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