FairRoot/PandaRoot
runTaskProcessor.cxx
Go to the documentation of this file.
1 
4 #include <csignal>
5 
7 #include "FairMQLogger.h"
8 #include "GenericProcessor.h"
9 #include "runSimpleMQStateMachine.h"
10 #include "BoostSerializer.h"
11 #include "RootSerializer.h"
12 #include "PndMvdPixelClusterTask.h"
13 #include "PndMvdStripClusterTask.h"
14 
15 // 9-PixelDetector example
16 
19 //using TrackFinder = PndMvdMQTaskProcessor<PixelFindTracks>;
20 //using TrackFitter = PndMvdMQTaskProcessor<PixelFitTracks>;
21 
22 // ////////////////////////////////////////////////////////////////////////
23 
24 int main(int argc, char** argv) {
25  try {
26  std::string taskname;
27  std::string keepdata;
28 
29  namespace po = boost::program_options;
30  po::options_description processor_options("Processor options");
31  processor_options.add_options()("task-name",
32  po::value<std::string>(&taskname)->required(),
33  "Name of task to run")("keep-data",
34  po::value<std::string>(&keepdata),
35  "Name of data to keep in stream");
36 
37  FairMQProgOptions config;
38  config.AddToCmdLineOptions(processor_options);
39 
40  config.ParseAll(argc, argv);
41 
42  if (strcmp(taskname.c_str(), "PndMvdPixelClusterTask") == 0) {
43  PixelHitFinder processor;
44  processor.SetDataToKeep(keepdata);
45  runStateMachine(processor, config);
46  } else if (strcmp(taskname.c_str(), "PndMvdStripClusterTask") == 0) {
47  StripHitFinder processor;
48  processor.SetDataToKeep(keepdata);
49  runStateMachine(processor, config);
50  } else {
51  LOG(INFO) << "TASK \"" << taskname << "\" UNKNOWN!!! " << strcmp(taskname.c_str(), "PndMvdStripClusterTask");
52  }
53 
54 
55  } catch (std::exception& e) {
56  LOG(ERROR) << "Unhandled Exception reached the top of main: "
57  << e.what() << ", application will now exit";
58  return 1;
59  }
60 
61  return 0;
62 }
void SetDataToKeep(std::string tStr)
int main(int argc, char **argv)