16#include <fmt/format.h>
45void customize(std::vector<o2::framework::CompletionPolicy>& policies)
52void customize(std::vector<ConfigParamSpec>& workflowOptions)
55 int defaultlanes = std::max(1u, std::thread::hardware_concurrency() / 2);
57 std::vector<ConfigParamSpec> options{
58 {
"input-spec", VariantType::String,
DEFAULTINPUT, {
"selection string input specs"}},
59 {
"publish-after-tfs", VariantType::UInt32, 0u, {
"number of time frames after which to force publishing the objects"}},
60 {
"configKeyValues", VariantType::String,
"", {
"Semicolon separated key=value strings (e.g.: 'TPCCalibPedestal.FirstTimeBin=10;...')"}},
61 {
"configFile", VariantType::String,
"", {
"configuration file for configurable parameters"}},
62 {
"calib-type", VariantType::String,
"pedestal", {
"Calibration type to run: pedestal, pulser, ce"}},
63 {
"no-write-ccdb", VariantType::Bool,
false, {
"skip sending the calibration output to CCDB"}},
64 {
"lanes", VariantType::Int, defaultlanes, {
"Number of parallel processing lanes."}},
65 {
"sectors", VariantType::String, sectorDefault.c_str(), {
"List of TPC sectors, comma separated ranges, e.g. 0-3,7,9-15"}},
68 std::swap(workflowOptions, options);
84 std::string inputSpec = config.
options().
get<std::string>(
"input-spec");
85 const auto skipCCDB = config.
options().
get<
bool>(
"no-write-ccdb");
86 const auto publishAfterTFs = config.
options().
get<uint32_t>(
"publish-after-tfs");
88 const auto tpcsectors = o2::RangeTokenizer::tokenize<int>(config.
options().
get<std::string>(
"sectors"));
89 const auto nSectors = (uint32_t)tpcsectors.size();
90 auto nLanes = std::min((uint32_t)config.
options().
get<
int>(
"lanes"), nSectors);
91 const auto sectorsPerLane = nSectors / nLanes + ((nSectors % nLanes) != 0);
96 if ((rawType == CDBType::CalCE) && (inputSpec ==
DEFAULTINPUT)) {
97 inputSpec =
"tpcdigits:TPC/CEDIGITS";
99 }
catch (std::out_of_range&) {
100 throw std::invalid_argument(std::string(
"invalid writer-type type: ") + config.
options().
get<std::string>(
"calib-type"));
109 const bool digitInput = inputSpec.find(
"DIGITS") != std::string::npos;
110 if (digitInput && nLanes != 1) {
111 LOGP(info,
"only one lane allowed for DIGIT type input");
114 for (
int ilane = 0; ilane < nLanes; ++ilane) {
115 auto first = tpcsectors.begin() + ilane * sectorsPerLane;
116 if (
first >= tpcsectors.end()) {
119 auto last = std::min(tpcsectors.end(),
first + sectorsPerLane);
TPC CalDet merger and CCDB publisher.
Helper function to tokenize sequences and ranges of integral numbers.
Generic parser for consecutive raw pages.
TPC Pad-wise raw data calibration processor.
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 constexpr int MAXSECTOR
Defining PrimaryVertex explicitly as messageable.
std::vector< DataProcessorSpec > WorkflowSpec
Global TPC definitions and constants.
DataProcessorSpec getTPCCalibPadRawSpec(const std::string inputSpec, uint32_t ilane=0, std::vector< int > sectors={}, uint32_t publishAfterTFs=0, CDBType rawType=CDBType::CalPedestalNoise)
const std::unordered_map< std::string, CDBType > CalibRawTypeMap
o2::framework::DataProcessorSpec getCalDetMergerPublisherSpec(uint32_t lanes, bool skipCCDB, bool dumpAfterComplete=false)
CDBType
Calibration and parameter types for CCDB.
std::string to_string(gsl::span< T, Size > span)
static CompletionPolicy defineByName(std::string const &name, CompletionPolicy::CompletionOp op)
const std::string DEFAULTINPUT
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)