11 #include "runFairMQDevice.h"
20 namespace bpo = boost::program_options;
26 (
"file-name", bpo::value<std::vector<std::string>>(),
"Path to the input file")
27 (
"max-index", bpo::value<int64_t>()->default_value(-1),
"number of events to read")
28 (
"branch-name", bpo::value<std::vector<std::string>>()->required(),
"branch name")
29 (
"sampler-type", bpo::value<std::string>()->default_value(
"FairFileSource"),
"FairSource type")
30 (
"out-channel", bpo::value<std::string>()->default_value(
"data-out"),
"output channel name")
31 (
"ack-channel", bpo::value<std::string>()->default_value(
""),
"ack channel name");
35 FairMQDevicePtr
getDevice(
const FairMQProgOptions& config)
37 std::string samplerType = config.GetValue<std::string>(
"sampler-type");
38 std::vector<std::string> filename = config.GetValue<std::vector<std::string>>(
"file-name");
42 if (samplerType ==
"FairFileSource") {
43 }
else if (samplerType ==
"PixelDigiSource") {
44 if (!filename.empty()) {
46 sampler->SetSource(digiSource);
48 }
else if (samplerType ==
"PixelDigiBinSource") {
49 if (!filename.empty()) {
51 sampler->SetSource(digiSource);
54 LOG(error) <<
"Sampler \"" << samplerType
55 <<
"\" unknown! Set it to \"FairFileSource\" or \"PixelDigiSource\" or \"PixelDigiBinSource\"";
void addCustomOptions(bpo::options_description &options)
FairMQDevicePtr getDevice(const FairMQProgOptions &config)