FairRoot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
runPixelTaskProcessorBin.cxx
Go to the documentation of this file.
1 /********************************************************************************
2  * Copyright (C) 2014-2019 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
3  * *
4  * This software is distributed under the terms of the *
5  * GNU Lesser General Public Licence (LGPL) version 3, *
6  * copied verbatim in the file "LICENSE" *
7  ********************************************************************************/
8 
9 #include "PixelFindHits.h"
10 #include "runFairMQDevice.h"
11 
12 // PixelDetector example
14 
15 #include <string>
16 
18 
19 namespace bpo = boost::program_options;
20 
21 void addCustomOptions(bpo::options_description& options)
22 {
23  // clang-format off
24  options.add_options()
25  ("task-name", bpo::value<std::string>()->required(), "Name of task to run")
26  ("keep-data", bpo::value<std::string>(), "Name of data to keep in stream")
27  ("in-channel", bpo::value<std::string>()->default_value("data-in"), "input channel name")
28  ("out-channel", bpo::value<std::string>()->default_value("data-out"), "output channel name")
29  ("par-channel", bpo::value<std::string>()->default_value("param"), "param channel name")
30  ("static-pars", bpo::value<bool>()->default_value(false), "static parameters flag");
31  // clang-format on
32 }
33 
34 FairMQDevicePtr getDevice(const FairMQProgOptions& config)
35 {
36  std::string taskname = config.GetValue<std::string>("task-name");
37 
38  LOG(info) << "get device with setting!";
39 
40  if (taskname == "PixelFindHits") {
41  return new HitFinder();
42  }
43 
44  LOG(info) << "TASK \"" << taskname << "\" UNKNOWN!!!";
45  return 0;
46 }
void addCustomOptions(bpo::options_description &options)
FairMQPixelTaskProcessor< PixelFindHits > HitFinder
FairMQDevicePtr getDevice(const FairMQProgOptions &config)