26void customize(std::vector<o2::framework::CompletionPolicy>& policies)
33void customize(std::vector<ConfigParamSpec>& workflowOptions)
37 std::vector<ConfigParamSpec> options{
38 {
"configFile", VariantType::String,
"", {
"configuration file for configurable parameters"}},
39 {
"timeframes", VariantType::Int, 2000, {
"Number of TFs which will be aggregated per aggregation interval."}},
40 {
"timeframesDeltaIDC", VariantType::Int, 100, {
"Number of TFs used for storing the IDCDelta struct in the CCDB."}},
41 {
"nthreads-IDC-factorization", VariantType::Int, 1, {
"Number of threads which will be used during the factorization of the IDCs."}},
42 {
"nthreads-grouping", VariantType::Int, 1, {
"Number of threads which will be used during the grouping of IDCDelta."}},
43 {
"sendOutputFFT", VariantType::Bool,
false, {
"sending the output for fourier transform device"}},
44 {
"crus", VariantType::String, cruDefault.c_str(), {
"List of CRUs, comma separated ranges, e.g. 0-3,7,9-15"}},
45 {
"compression", VariantType::Int, 2, {
"compression of DeltaIDC: 0 -> No, 1 -> Medium (data compression ratio 2), 2 -> High (data compression ratio ~6)"}},
46 {
"input-lanes", VariantType::Int, 2, {
"Number of parallel pipelines which were set in the TPCDistributeIDCSpec device."}},
47 {
"groupPads", VariantType::String,
"5,6,7,8,4,5,6,8,10,13", {
"number of pads in a row which will be grouped per region"}},
48 {
"groupRows", VariantType::String,
"2,2,2,3,3,3,2,2,2,2", {
"number of pads in row direction which will be grouped per region"}},
49 {
"groupLastRowsThreshold", VariantType::String,
"1", {
"set threshold in row direction for merging the last group to the previous group per region"}},
50 {
"groupLastPadsThreshold", VariantType::String,
"1", {
"set threshold in pad direction for merging the last group to the previous group per region"}},
51 {
"use-precise-timestamp", VariantType::Bool,
false, {
"Use precise timestamp from distribute when writing to CCDB"}},
52 {
"enable-CCDB-output", VariantType::Bool,
false, {
"send output for ccdb populator"}},
53 {
"n-TFs-buffer", VariantType::Int, 1, {
"Buffer which was defined in the TPCFLPIDCSpec."}},
54 {
"configKeyValues", VariantType::String,
"", {
"Semicolon separated key=value strings (e.g. for pp 50kHz: 'TPCIDCCompressionParam.maxIDCDeltaValue=15;')"}}};
56 std::swap(workflowOptions, options);
65 const std::string sgroupPads = config.
options().
get<std::string>(
"groupPads");
66 const std::string sgroupRows = config.
options().
get<std::string>(
"groupRows");
67 const std::string sgroupLastRowsThreshold = config.
options().
get<std::string>(
"groupLastRowsThreshold");
68 const std::string sgroupLastPadsThreshold = config.
options().
get<std::string>(
"groupLastPadsThreshold");
76 const auto tpcCRUs = o2::RangeTokenizer::tokenize<int>(config.
options().
get<std::string>(
"crus"));
77 const auto nCRUs = tpcCRUs.size();
78 auto timeframes =
static_cast<unsigned int>(config.
options().
get<
int>(
"timeframes"));
79 auto timeframesDeltaIDC =
static_cast<unsigned int>(config.
options().
get<
int>(
"timeframesDeltaIDC"));
80 const auto sendOutputFFT = config.
options().
get<
bool>(
"sendOutputFFT");
81 const auto nthreadsFactorization =
static_cast<unsigned long>(config.
options().
get<
int>(
"nthreads-IDC-factorization"));
83 const auto nthreadsGrouping =
static_cast<unsigned long>(config.
options().
get<
int>(
"nthreads-grouping"));
85 const auto nLanes =
static_cast<unsigned int>(config.
options().
get<
int>(
"input-lanes"));
86 const bool usePrecisetimeStamp = config.
options().
get<
bool>(
"use-precise-timestamp");
87 const bool sendCCDB = config.
options().
get<
bool>(
"enable-CCDB-output");
88 int nTFsBuffer = config.
options().
get<
int>(
"n-TFs-buffer");
89 if (nTFsBuffer <= 0) {
92 assert(timeframes >= nTFsBuffer);
93 timeframes /= nTFsBuffer;
94 timeframesDeltaIDC = std::clamp(timeframesDeltaIDC / nTFsBuffer,
static_cast<unsigned int>(1), timeframesDeltaIDC);
96 const int compressionTmp = config.
options().
get<
int>(
"compression");
98 switch (compressionTmp) {
99 case static_cast<int>(IDCDeltaCompression::NO):
100 case static_cast<int>(IDCDeltaCompression::MEDIUM):
101 case static_cast<int>(IDCDeltaCompression::HIGH):
105 LOGP(error,
"wrong compression type set. Setting compression to medium compression");
110 const auto first = tpcCRUs.begin();
111 const auto last = std::min(tpcCRUs.end(),
first + nCRUs);
112 const std::vector<uint32_t> rangeCRUs(
first, last);
115 workflow.reserve(nLanes);
116 for (
int ilane = 0; ilane < nLanes; ++ilane) {
117 workflow.emplace_back(
getTPCFactorizeIDCSpec(ilane, rangeCRUs, timeframes, timeframesDeltaIDC, compression, usePrecisetimeStamp, sendOutputFFT, sendCCDB, nTFsBuffer));
class for averaging and grouping of IDCs
class for aggregating IDCs for the full TPC (all sectors) and factorization of aggregated IDCs
Helper function to tokenize sequences and ranges of integral numbers.
static void writeINI(std::string const &filename, std::string const &keyOnly="")
static void updateFromFile(std::string const &, std::string const ¶msList="", bool unchangedOnly=false)
static void updateFromString(std::string const &)
ConfigParamRegistry & options() const
T get(const char *key) const
static void setNThreads(const int nThreads)
set the number of threads used for some of the calculations
static void setNThreads(const int nThreads)
Defining PrimaryVertex explicitly as messageable.
std::vector< DataProcessorSpec > WorkflowSpec
Global TPC definitions and constants.
IDCDeltaCompression
IDC Delta IDC Compression types.
DataProcessorSpec getTPCFactorizeIDCSpec(const int lane, const std::vector< uint32_t > &crus, const unsigned int timeframes, const unsigned int timeframesDeltaIDC, const IDCDeltaCompression compression, const bool usePrecisetimeStamp, const bool sendOutputFFT, const bool sendCCDB, const int nTFsBuffer=1)
std::string to_string(gsl::span< T, Size > span)
static CompletionPolicy defineByName(std::string const &name, CompletionPolicy::CompletionOp op)
static void setGroupingParameterFromString(const std::string sgroupPads, const std::string sgroupRows, const std::string sgroupLastRowsThreshold, const std::string sgroupLastPadsThreshold)
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)