Project
Loading...
Searching...
No Matches
badchannel-calib-workflow.cxx
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
20
21using namespace o2::framework;
22
23const char* specName = "mch-badchannel-calibrator";
24
25// we need to add workflow options before including Framework/runDataProcessing
26void customize(std::vector<o2::framework::ConfigParamSpec>& workflowOptions)
27{
28 // option allowing to set parameters
29 workflowOptions.push_back(ConfigParamSpec{"input-pdigits-data-description", VariantType::String, "PDIGITS", {"input pedestal digits data description"}});
30 workflowOptions.push_back(ConfigParamSpec{"configKeyValues", VariantType::String, "", {"Semicolon separated key=value strings"}});
31}
32
33// ------------------------------------------------------------------
34
35DataProcessorSpec getBadChannelCalibratorSpec(const char* specName, const std::string inputSpec)
36{
37 std::vector<OutputSpec> outputs;
38 outputs.emplace_back(ConcreteDataTypeMatcher{o2::calibration::Utils::gDataOriginCDBPayload, "MCH_BADCHAN"}, Lifetime::Sporadic);
39 outputs.emplace_back(ConcreteDataTypeMatcher{o2::calibration::Utils::gDataOriginCDBWrapper, "MCH_BADCHAN"}, Lifetime::Sporadic);
40 outputs.emplace_back(OutputSpec{"MCH", "PEDESTALS", 0, Lifetime::Sporadic});
41 outputs.emplace_back(OutputSpec(ConcreteDataTypeMatcher{"MCH", "BADCHAN"}, Lifetime::Sporadic));
42 std::vector<InputSpec> inputs = o2::framework::select(fmt::format("digits:MCH/{}", inputSpec.data()).c_str());
43 auto ccdbRequest = std::make_shared<o2::base::GRPGeomRequest>(true, // orbitResetTime
44 true, // GRPECS=true
45 false, // GRPLHCIF
46 false, // GRPMagField
47 false, // askMatLUT
49 inputs);
50 return DataProcessorSpec{
52 inputs,
53 outputs,
54 AlgorithmSpec{adaptFromTask<o2::mch::calibration::BadChannelCalibrationDevice>(ccdbRequest)},
55 Options{
56 {"logging-interval", VariantType::Int, 0, {"time interval in seconds between logging messages (set to zero to disable)"}},
57 }};
58}
59
61
63{
64 o2::conf::ConfigurableParam::updateFromString(configcontext.options().get<std::string>("configKeyValues"));
65 const std::string inputSpec = configcontext.options().get<std::string>("input-pdigits-data-description");
66 WorkflowSpec specs;
67 specs.emplace_back(getBadChannelCalibratorSpec(specName, inputSpec));
68 return specs;
69}
Utils and constants for calibration and related workflows.
Definition of the Names Generator class.
void customize(std::vector< o2::framework::ConfigParamSpec > &workflowOptions)
const char * specName
DataProcessorSpec getBadChannelCalibratorSpec(const char *specName, const std::string inputSpec)
WorkflowSpec defineDataProcessing(ConfigContext const &configcontext)
static void updateFromString(std::string const &)
ConfigParamRegistry & options() const
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
std::vector< DataProcessorSpec > WorkflowSpec
std::vector< InputSpec > select(char const *matcher="")
static constexpr o2::header::DataOrigin gDataOriginCDBWrapper
Definition Utils.h:44
static constexpr o2::header::DataOrigin gDataOriginCDBPayload
Definition Utils.h:43