FairRoot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
runPixelTaskProcessor.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 "PixelDigitize.h"
10 #include "PixelFindHits.h"
11 #include "PixelFindTracks.h"
12 #include "PixelFitTracks.h"
13 #include "runFairMQDevice.h"
14 
15 // PixelDetector example
17 
18 #include <string>
19 
24 
25 namespace bpo = boost::program_options;
26 
27 void addCustomOptions(bpo::options_description& options)
28 {
29  // clang-format off
30  options.add_options()
31  ("task-name", bpo::value<std::string>()->required(), "Name of task to run")
32  ("keep-data", bpo::value<std::string>(), "Name of data to keep in stream")
33  ("in-channel", bpo::value<std::string>()->default_value("data-in"), "input channel name")
34  ("out-channel", bpo::value<std::string>()->default_value("data-out"), "output channel name")
35  ("par-channel", bpo::value<std::string>()->default_value("param"), "param channel name")
36  ("static-pars", bpo::value<bool>()->default_value(false), "static parameters flag");
37  // clang-format on
38 }
39 
40 FairMQDevicePtr getDevice(const FairMQProgOptions& config)
41 {
42  std::string taskname = config.GetValue<std::string>("task-name");
43 
44  LOG(info) << "get device with setting!";
45 
46  if (taskname == "PixelFindHits") {
47  return new HitFinder();
48  } else if (taskname == "PixelFindTracks") {
49  return new TrackFinder();
50  } else if (taskname == "PixelFitTracks") {
51  return new TrackFitter();
52  } else if (taskname == "PixelDigitize") {
53  return new Digitizer();
54  }
55 
56  return 0;
57 }
FairMQPixelTaskProcessor< PixelFitTracks > TrackFitter
void addCustomOptions(bpo::options_description &options)
FairMQPixelTaskProcessor< PixelFindTracks > TrackFinder
FairMQPixelTaskProcessor< PixelFindHits > HitFinder
FairMQPixelTaskProcessor< PixelDigitize > Digitizer
FairMQDevicePtr getDevice(const FairMQProgOptions &config)