FairRoot/PandaRoot
Functions
runPndTopixHitSampler.cxx File Reference
#include <iostream>
#include "boost/program_options.hpp"
#include "FairMQLogger.h"
#include "FairMQParser.h"
#include "FairMQProgOptions.h"
#include "PndMQFileSamplerHits.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 32 of file runPndTopixHitSampler.cxx.

References fe, filename, PndMQFileSamplerHits::InputFile, and PndMQFileSamplerHits::SetProperty().

33 {
34  PndMQFileSamplerHits sampler;
35  sampler.CatchSignals();
36 
37  FairMQProgOptions config;
38 
39  try
40  {
41  std::string text;
42  int fe;
43  double timecorr;
44 
45  options_description samplerOptions("Sampler options");
46  samplerOptions.add_options()
47  ("InputFile", value<std::string>(&text)->default_value("HitsFE1.root"), "FileName of data to read");
48 
49 
50  config.AddToCmdLineOptions(samplerOptions);
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  config.UserParser<FairMQParser::JSON>(filename, id);
58 
59  sampler.fChannels = config.GetFairMQMap();
60 
61  LOG(INFO) << "PID: " << getpid();
62 
63 #ifdef NANOMSG
64  FairMQTransportFactory* transportFactory = new FairMQTransportFactoryNN();
65 #else
66  FairMQTransportFactory* transportFactory = new FairMQTransportFactoryZMQ();
67 #endif
68 
69  sampler.SetTransport(transportFactory);
70 
72 
73  sampler.ChangeState("INIT_DEVICE");
74  sampler.WaitForEndOfState("INIT_DEVICE");
75 
76  sampler.ChangeState("INIT_TASK");
77  sampler.WaitForEndOfState("INIT_TASK");
78 
79  sampler.ChangeState("RUN");
80  sampler.InteractiveStateLoop();
81  }
82  catch (std::exception& e)
83  {
84  LOG(ERROR) << e.what();
85  LOG(INFO) << "Command line options are the following: ";
86  config.PrintHelp();
87  return 1;
88  }
89 
90  return 0;
91 }
void SetProperty(const int key, const std::string &value)
int fe
Definition: anaLmdDigi.C:67
const string filename