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
14#include "NoiseCalibratorSpec.h"
15#include "GainCalibratorSpec.h"
16
17using namespace o2::framework;
18
19// we need to add workflow options before including Framework/runDataProcessing
20void customize(std::vector<o2::framework::ConfigParamSpec>& workflowOptions)
21{
22 // option allowing to set parameters
23 workflowOptions.push_back(ConfigParamSpec{"pedestals", o2::framework::VariantType::Bool, false, {"do pedestal calibration"}});
24 workflowOptions.push_back(ConfigParamSpec{"noise", o2::framework::VariantType::Bool, false, {"do noise scan calibration"}});
25 workflowOptions.push_back(ConfigParamSpec{"gains", o2::framework::VariantType::Bool, false, {"do gain calibration"}});
26 // workflowOptions.push_back(ConfigParamSpec{"badmap", o2::framework::VariantType::Bool, false, {"do bad map calibration"}});
27 workflowOptions.push_back(ConfigParamSpec{"configKeyValues", VariantType::String, "", {"Semicolon separated key=value strings"}});
28}
29
30// ------------------------------------------------------------------
31
33
35{
36 WorkflowSpec specs;
37 o2::conf::ConfigurableParam::updateFromString(configcontext.options().get<std::string>("configKeyValues"));
38 auto doPedestals = configcontext.options().get<bool>("pedestals");
39 auto doNoise = configcontext.options().get<bool>("noise");
40 auto doGain = configcontext.options().get<bool>("gains");
41 // auto doBadMap = configcontext.options().get<bool>("badmap");
42 int nProcessors = (int)doPedestals + (int)doNoise + (int)doGain;
43 if (nProcessors > 1) {
44 LOG(error) << "Can not run several calibrations simulteneously in one executable";
45 return specs;
46 }
47 if (doGain) {
48 specs.emplace_back(getCPVGainCalibratorSpec());
49 }
50 // if (doBadMap) {
51 // specs.emplace_back(getCPVBadMapCalibratorSpec());
52 // }
53 if (doPedestals) {
54 specs.emplace_back(getCPVPedestalCalibratorSpec());
55 }
56 if (doNoise) {
57 specs.emplace_back(getCPVNoiseCalibratorSpec());
58 }
59 return specs;
60}
static void updateFromString(std::string const &)
ConfigParamRegistry & options() const
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
std::vector< DataProcessorSpec > WorkflowSpec
void customize(std::vector< o2::framework::ConfigParamSpec > &workflowOptions)
WorkflowSpec defineDataProcessing(ConfigContext const &configcontext)
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"