Project
Loading...
Searching...
No Matches
emc-channel-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
16
22#include "Framework/Variant.h"
26
27#include <string>
28#include <stdexcept>
29#include <unordered_map>
30
31using namespace o2::framework;
32using namespace o2::emcal;
33
34// add workflow options, note that customization needs to be declared before
35// including Framework/runDataProcessing
36void customize(std::vector<ConfigParamSpec>& workflowOptions)
37{
38 std::vector<ConfigParamSpec> options{
39 {"configKeyValues", VariantType::String, "", {"Semicolon separated key=value strings"}},
40 {"calibType", VariantType::String, "time", {"choose which calibration should be performed: time for tiem calibration, badchannel for bad channel calibration"}},
41 {"no-loadCalibParamsFromCCDB", VariantType::Bool, false, {"disabled by default such that calib params are taken from the ccdb. If enabled, calib params are taken from EMCALCalibParams.h directly"}},
42 {"no-rejectCalibTrigger", VariantType::Bool, false, {"disabled by default such that calib triggers are rejected. If enabled, calibration triggers (LED events etc.) also enter the calibration"}},
43 {"no-rejectL0Trigger", VariantType::Bool, false, {"disabled by default such that L0 triggers are rejected. If enabled, L0 triggers (Gamma trigger and jet trigger) also enter the calibration"}},
44 {"no-applyGainCalib", VariantType::Bool, false, {"if appplication of gain calibration should be disabled"}},
45 {"ctpconfig-run-independent", VariantType::Bool, false, {"Use CTP config w/o runNumber tag"}}};
46
47 std::swap(workflowOptions, options);
48}
49
50#include "Framework/runDataProcessing.h" // the main driver
51
53{
54
55 o2::conf::ConfigurableParam::updateFromString(cfgc.options().get<std::string>("configKeyValues"));
56 std::string calibType = cfgc.options().get<std::string>("calibType");
57 bool loadCalibParamsFromCCDB = !cfgc.options().get<bool>("no-loadCalibParamsFromCCDB");
58 bool rejectCalibTrigger = !cfgc.options().get<bool>("no-rejectCalibTrigger");
59 bool rejectL0Trigger = !cfgc.options().get<bool>("no-rejectL0Trigger");
60 bool ctpcfgperrun = !cfgc.options().get<bool>("ctpconfig-run-independent");
61 bool applyGainCalib = !cfgc.options().get<bool>("no-applyGainCalib");
62
63 WorkflowSpec specs;
64 specs.emplace_back(getEMCALChannelCalibDeviceSpec(calibType, loadCalibParamsFromCCDB, rejectCalibTrigger, rejectL0Trigger, ctpcfgperrun, applyGainCalib));
65
66 // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit
67 // o2::raw::HBFUtilsInitializer hbfIni(cfgc, specs);
68 return specs;
69}
Helper function to tokenize sequences and ranges of integral numbers.
static void updateFromString(std::string const &)
ConfigParamRegistry & options() const
WorkflowSpec defineDataProcessing(ConfigContext const &cfgc)
void customize(std::vector< ConfigParamSpec > &workflowOptions)
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
std::vector< DataProcessorSpec > WorkflowSpec