1 #include "runFairMQDevice.h"
15 namespace bpo = boost::program_options;
21 (
"random-seed", bpo::value<int64_t>()->default_value(0),
"Random seed number")
22 (
"nof-events", bpo::value<int64_t>()->required(),
"Number of events to simulate")
23 (
"running-mode", bpo::value<std::string>()->default_value(
"pp"),
"pp to push, rr to reply")
24 (
"fairroot-config-dir", bpo::value<std::string>()->default_value(
""),
"FairRoot config dir")
25 (
"chunk-size", bpo::value<int64_t>()->default_value(0),
"Max nof primaries in chunk")
26 (
"ack-channel", bpo::value<std::string>()->default_value(
""),
"Ack channel name");
30 FairMQDevicePtr
getDevice(
const FairMQProgOptions& config)
32 gRandom->SetSeed(config.GetValue<int64_t>(
"random-seed"));
34 TString dir = getenv(
"VMCWORKDIR");
35 TString tutdir = dir +
"/MQ/pixelDetector";
37 TString tut_configdir = config.GetValue<std::string>(
"fairroot-config-dir");
38 if (tut_configdir.Length() < 1)
39 tut_configdir = dir +
"/common/gconfig";
40 gSystem->Setenv(
"CONFIG_DIR", tut_configdir.Data());
42 Int_t partPdgC[] = {211, 11, 2212};
53 LOG(
INFO) <<
"Going to generate " << config.GetValue<int64_t>(
"nof-events") <<
" events.";
54 mqDevice->
SetChunkSize(config.GetValue<int64_t>(
"chunk-size"));
56 if (config.GetValue<std::string>(
"running-mode") ==
"rr") {
57 LOG(
INFO) <<
"Going to reply with data.";
60 LOG(
INFO) <<
"Going to push data.";
63 mqDevice->
SetNofEvents(config.GetValue<int64_t>(
"nof-events"));
void SetGenerator(FairPrimaryGenerator *primGen)
void addCustomOptions(bpo::options_description &options)
void SetPRange(Double32_t pmin=0, Double32_t pmax=10)
void AddGenerator(FairGenerator *generator)
void RunInPushMode(bool tb=true)
void SetNofEvents(int64_t nofev)
void SetChunkSize(int64_t ti)
void SetThetaRange(Double32_t thetamin=0, Double32_t thetamax=90)
FairMQDevicePtr getDevice(const FairMQProgOptions &config)
void SetPhiRange(Double32_t phimin=0, Double32_t phimax=360)