18 #include "runFairMQDevice.h"
21 #include <TObjArray.h>
30 namespace bpo = boost::program_options;
36 (
"random-seed", bpo::value<int64_t> ()->default_value(0),
"Random seed number")
37 (
"transport-name", bpo::value<std::string>()->default_value(
"TGeant3"),
"Transport name")
38 (
"nof-events", bpo::value<int64_t> ()->required(),
"Number of events to simulate")
39 (
"fairroot-config-dir", bpo::value<std::string>()->default_value(
""),
"FairRoot config dir")
40 (
"param-channel-name", bpo::value<std::string>()->default_value(
"updateChannel"),
"Parameter update channel name")
41 (
"run-digi-tasks", bpo::value<bool> ()->default_value(
false),
"Run digi tasks")
46 FairMQDevicePtr
getDevice(
const FairMQProgOptions& config)
48 gRandom->SetSeed(config.GetValue<int64_t>(
"random-seed"));
50 char* cdir = getenv(
"VMCWORKDIR");
52 if (cdir ==
nullptr) {
53 throw std::runtime_error(
"VMCWORKDIR not initialized");
56 std::string dir = cdir;
57 std::string tutdir = dir +
"/MQ/pixelDetector";
59 std::string tutGeomDir = dir +
"/common/geometry";
60 gSystem->Setenv(
"GEOMPATH", tutGeomDir.c_str());
62 std::string tutConfigDir = config.GetValue<std::string>(
"fairroot-config-dir");
63 if (tutConfigDir.empty()) {
64 tutConfigDir = dir +
"/common/gconfig";
66 gSystem->Setenv(
"CONFIG_DIR", tutConfigDir.c_str());
76 run->
SetNofEvents(config.GetValue<int64_t>(
"nof-events"));
80 TObjArray* detArray =
new TObjArray();
84 Pixel* det =
new Pixel(
"PixelDetector", kTRUE);
89 TString partName[] = {
"pions",
"eplus",
"proton"};
90 Int_t partPdgC[] = {211, 11, 2212};
103 if (config.GetValue<
bool>(
"run-digi-tasks")) {
105 TString digParFile = tutdir +
"/param/pixel_digi.par";
107 parIo1->
open(digParFile.Data(),
"in");
110 TObjArray* taskArray =
new TObjArray();
112 taskArray->Add(digiTask);
virtual void SetGeometryFileName(TString fname, TString geoVer="0")
void SetFirstParameter(FairParIo *par)
Bool_t open(const Text_t *fname, const Text_t *status="in")
void addCustomOptions(bpo::options_description &options)
void SetNofEvents(int64_t nofev)
void SetPRange(Double32_t pmin=0, Double32_t pmax=10)
void AddGenerator(FairGenerator *generator)
void SetTransportName(const std::string &str)
void SetMaterials(const std::string &str)
virtual void SetParamUpdateChannelName(const TString &tString)
void SetSink(FairSink *sink)
void SetTaskArray(TObjArray *array)
virtual void SetMQRunDevice(FairMQRunDevice *mrs)
void SetDetectorArray(TObjArray *array)
void SetGenerator(FairPrimaryGenerator *primGen)
void SetThetaRange(Double32_t thetamin=0, Double32_t thetamax=90)
FairMQDevicePtr getDevice(const FairMQProgOptions &config)
void SetStoreTraj(bool flag=true)
void SetPhiRange(Double32_t phimin=0, Double32_t phimax=360)