1 #include "runFairMQDevice.h"
11 #include <TObjArray.h>
19 namespace bpo = boost::program_options;
25 (
"random-seed", bpo::value<int64_t>()->default_value(0),
"Random seed number")
26 (
"transport-name", bpo::value<std::string>()->default_value(
"TGeant3"),
"Transport name")
27 (
"fairroot-config-dir", bpo::value<std::string>()->default_value(
""),
"FairRoot config dir")
28 (
"param-channel-name", bpo::value<std::string>()->default_value(
"updateChannel"),
"Parameter update channel name")
29 (
"running-mode", bpo::value<std::string>()->default_value(
"pp"),
"pp to pull, rr to request")
30 (
"detector-library", bpo::value<std::vector<std::string>>(),
"detector library")
31 (
"run-digi-tasks", bpo::value<bool>()->default_value(
false),
"Run digi tasks");
35 FairMQDevicePtr
getDevice(
const FairMQProgOptions& config)
37 gRandom->SetSeed(config.GetValue<int64_t>(
"random-seed"));
39 TString dir = getenv(
"VMCWORKDIR");
40 TString tutdir = dir +
"/MQ/pixelDetector";
42 TString tut_geomdir = dir +
"/common/geometry";
43 gSystem->Setenv(
"GEOMPATH", tut_geomdir.Data());
45 TString tut_configdir = config.GetValue<std::string>(
"fairroot-config-dir");
46 if (tut_configdir.Length() < 1)
47 tut_configdir = dir +
"/common/gconfig";
48 gSystem->Setenv(
"CONFIG_DIR", tut_configdir.Data());
52 if (config.GetValue<std::string>(
"running-mode") ==
"rr") {
53 LOG(
INFO) <<
"Going to request data.";
56 LOG(
INFO) <<
"Going to pull data.";
70 TObjArray* detArray =
new TObjArray();
81 if ((config.GetValue<
bool>(
"run-digi-tasks")) ==
true) {
83 TString digParFile = tutdir +
"/param/pixel_digi.par";
85 parIo1->
open(digParFile.Data(),
"in");
88 TObjArray* taskArray =
new TObjArray();
90 taskArray->Add(digiTask);
virtual void SetGeometryFileName(TString fname, TString geoVer="0")
Bool_t open(const Text_t *fname, const Text_t *status="in")
void SetDetectorArray(TObjArray *array)
void addCustomOptions(bpo::options_description &options)
void RunInPullMode(bool tb=true)
void SetSink(FairSink *sink)
void SetMaterials(const std::string &str)
void SetFirstParameter(FairParIo *par)
void SetTransportName(const std::string &str)
virtual void SetMQRunDevice(FairMQRunDevice *mrs)
void SetTaskArray(TObjArray *array)
void SetStoreTraj(bool flag=true)
void SetParamUpdateChannelName(TString tString)
FairMQDevicePtr getDevice(const FairMQProgOptions &config)