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 {
"use-precise-timestamp", VariantType::Bool,
false, {
"Use precise timestamp which can be used for writing to CCDB"}},
42 {
"enable-CCDB-output", VariantType::Bool,
false, {
"Send output to the CCDB populator"}},
43 {
"n-TFs-buffer", VariantType::Int, 1, {
"Buffer which was defined in the TPCFLPCMVSpec."}}};
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 nLanes =
static_cast<unsigned int>(config.
options().
get<
int>(
"lanes"));
61 const auto firstTF =
static_cast<unsigned int>(config.
options().
get<
int>(
"firstTF"));
62 const bool usePreciseTimestamp = config.
options().
get<
bool>(
"use-precise-timestamp");
63 const bool sendCCDB = config.
options().
get<
bool>(
"enable-CCDB-output");
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 {} CMVs", 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(
getTPCDistributeCMVSpec(ilane, rangeCRUs, timeframes, firstTF, sendCCDB, usePreciseTimestamp, nTFsBuffer));
Helper function to tokenize sequences and ranges of integral numbers.
TPC aggregation of grouped CMVs.
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 ITS Vertex explicitly as messageable.
std::vector< DataProcessorSpec > WorkflowSpec
Global TPC definitions and constants.
DataProcessorSpec getTPCDistributeCMVSpec(const int ilane, const std::vector< uint32_t > &crus, const unsigned int timeframes, const int firstTF, const bool sendCCDB=false, const bool usePreciseTimestamp=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)