Project
Loading...
Searching...
No Matches
cpv-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
17
18using namespace o2::framework;
19
20// // we need to add workflow options before including Framework/runDataProcessing
21void customize(std::vector<o2::framework::ConfigParamSpec>& workflowOptions)
22{
23 // option allowing to set parameters
24 workflowOptions.push_back(ConfigParamSpec{"use-ccdb", o2::framework::VariantType::Bool, false, {"enable access to ccdb cpv calibration objects"}});
25 workflowOptions.push_back(ConfigParamSpec{"forceupdate", o2::framework::VariantType::Bool, false, {"update ccdb even difference to previous object large"}});
26 workflowOptions.push_back(ConfigParamSpec{"pedestals", o2::framework::VariantType::Bool, false, {"do pedestal calculation"}});
27 workflowOptions.push_back(ConfigParamSpec{"gains", o2::framework::VariantType::Bool, false, {"do gain calculation"}});
28 workflowOptions.push_back(ConfigParamSpec{"badmap", o2::framework::VariantType::Bool, false, {"do bad map calculation"}});
29 workflowOptions.push_back(ConfigParamSpec{"path", o2::framework::VariantType::String, "./", {"path to store temp files"}});
30 workflowOptions.push_back(ConfigParamSpec{"configKeyValues", VariantType::String, "", {"Semicolon separated key=value strings"}});
31}
32
33// ------------------------------------------------------------------
34// we need to add workflow options before including Framework/runDataProcessing
36
38{
39 WorkflowSpec specs;
40 o2::conf::ConfigurableParam::updateFromString(configcontext.options().get<std::string>("configKeyValues"));
41 auto useCCDB = configcontext.options().get<bool>("use-ccdb");
42 auto forceUpdate = configcontext.options().get<bool>("forceupdate");
43 auto doPedestals = configcontext.options().get<bool>("pedestals");
44 auto doGain = configcontext.options().get<bool>("gains");
45 auto doBadMap = configcontext.options().get<bool>("badmap");
46 auto path = configcontext.options().get<std::string>("path");
47 if (doPedestals && doGain) {
48 LOG(fatal) << "Can not run pedestal and gain calibration simulteneously";
49 }
50
51 LOG(info) << "CPV Calibration workflow: options";
52 LOG(info) << "useCCDB = " << useCCDB;
53 if (doPedestals) {
54 LOG(info) << "pedestals ";
55 specs.emplace_back(o2::cpv::getPedestalCalibSpec(useCCDB, forceUpdate, path));
56 } else {
57 if (doGain) {
58 LOG(info) << "gain calculation";
59 specs.emplace_back(o2::cpv::getGainCalibSpec(useCCDB, forceUpdate, path));
60 }
61 }
62 if (doBadMap) {
63 LOG(info) << "bad map calculation ";
64 short m = 0;
65 specs.emplace_back(o2::cpv::getBadMapCalibSpec(useCCDB, forceUpdate, path, m));
66 }
67 return specs;
68}
void customize(std::vector< o2::framework::ConfigParamSpec > &workflowOptions)
WorkflowSpec defineDataProcessing(ConfigContext const &configcontext)
static void updateFromString(std::string const &)
ConfigParamRegistry & options() const
const GLfloat * m
Definition glcorearb.h:4066
GLsizei const GLchar *const * path
Definition glcorearb.h:3591
o2::framework::DataProcessorSpec getPedestalCalibSpec(bool useCCDB, bool forceUpdate, std::string path)
o2::framework::DataProcessorSpec getBadMapCalibSpec(bool useCCDB, bool forceUpdate, std::string path, short method)
o2::framework::DataProcessorSpec getGainCalibSpec(bool useCCDB, bool forceUpdate, std::string path)
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
std::vector< DataProcessorSpec > WorkflowSpec
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"