24void customize(std::vector<o2::framework::CompletionPolicy>& policies)
31void customize(std::vector<ConfigParamSpec>& workflowOptions)
35 std::vector<ConfigParamSpec> options{
36 {
"crus", VariantType::String, cruDefault.c_str(), {
"List of CRUs, comma separated ranges, e.g. 0-3,7,9-15"}},
37 {
"timeframes", VariantType::Int, 2000, {
"Number of TFs which will be aggregated per aggregation interval."}},
38 {
"firstTF", VariantType::Int, -1, {
"First time frame index. (if set to -1 the first TF will be automatically detected. Values < -1 are setting an offset for skipping the first TFs)"}},
39 {
"configKeyValues", VariantType::String,
"", {
"Semicolon separated key=value strings"}},
40 {
"lanes", VariantType::Int, 1, {
"Number of lanes of this device (CRUs are split per lane)"}},
41 {
"send-precise-timestamp", VariantType::Bool,
false, {
"Send precise timestamp which can be used for writing to CCDB"}},
42 {
"n-TFs-buffer", VariantType::Int, 1, {
"Buffer which was defined in the TPCFLPIDCSpec."}},
43 {
"output-lanes", VariantType::Int, 2, {
"Number of parallel pipelines which will be used in the factorization device."}}};
44 std::swap(workflowOptions, options);
57 const auto tpcCRUs = o2::RangeTokenizer::tokenize<int>(config.
options().
get<std::string>(
"crus"));
58 const auto nCRUs = tpcCRUs.size();
59 auto timeframes =
static_cast<unsigned int>(config.
options().
get<
int>(
"timeframes"));
60 const auto outlanes =
static_cast<unsigned int>(config.
options().
get<
int>(
"output-lanes"));
61 const auto nLanes =
static_cast<unsigned int>(config.
options().
get<
int>(
"lanes"));
62 const auto firstTF =
static_cast<unsigned int>(config.
options().
get<
int>(
"firstTF"));
63 const bool sendPrecisetimeStamp = config.
options().
get<
bool>(
"send-precise-timestamp");
64 int nTFsBuffer = config.
options().
get<
int>(
"n-TFs-buffer");
65 if (nTFsBuffer <= 0) {
68 assert(timeframes >= nTFsBuffer);
69 timeframes /= nTFsBuffer;
70 LOGP(info,
"using {} timeframes as each TF contains {} IDCs", timeframes, nTFsBuffer);
71 const auto crusPerLane = nCRUs / nLanes + ((nCRUs % nLanes) != 0);
73 for (
int ilane = 0; ilane < nLanes; ++ilane) {
74 const auto first = tpcCRUs.begin() + ilane * crusPerLane;
75 if (
first >= tpcCRUs.end()) {
78 const auto last = std::min(tpcCRUs.end(),
first + crusPerLane);
79 const std::vector<uint32_t> rangeCRUs(
first, last);
80 workflow.emplace_back(
getTPCDistributeIDCSpec(ilane, rangeCRUs, timeframes, outlanes, firstTF, sendPrecisetimeStamp, nTFsBuffer));
Helper function to tokenize sequences and ranges of integral numbers.
TPC aggregation of grouped IDCs and factorization.
static void writeINI(std::string const &filename, std::string const &keyOnly="")
static void updateFromString(std::string const &)
ConfigParamRegistry & options() const
T get(const char *key) const
Defining PrimaryVertex explicitly as messageable.
std::vector< DataProcessorSpec > WorkflowSpec
Global TPC definitions and constants.
DataProcessorSpec getTPCDistributeIDCSpec(const int ilane, const std::vector< uint32_t > &crus, const unsigned int timeframes, const unsigned int outlanes, const int firstTF, const bool sendPrecisetimeStamp=false, const int nTFsBuffer=1)
std::string to_string(gsl::span< T, Size > span)
static CompletionPolicy defineByName(std::string const &name, CompletionPolicy::CompletionOp op)
WorkflowSpec defineDataProcessing(ConfigContext const &config)
This function hooks up the the workflow specifications into the DPL driver.
void customize(std::vector< o2::framework::CompletionPolicy > &policies)