Project
Loading...
Searching...
No Matches
cell-recalibrator-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
12#include <string>
13#include <vector>
14#include "Framework/Variant.h"
20
21using namespace o2::framework;
22using namespace o2::emcal;
23
24void customize(std::vector<o2::framework::CallbacksPolicy>& policies)
25{
27}
28
29// we need to add workflow options before including Framework/runDataProcessing
30void customize(std::vector<ConfigParamSpec>& workflowOptions)
31{
32 std::vector<ConfigParamSpec> options{{"input-subspec", VariantType::UInt32, 1U, {"Subspecification for input objects"}},
33 {"output-subspec", VariantType::UInt32, 0U, {"Subspecification for output objects"}},
34 {"isMC", VariantType::Bool, false, {"Monte-Carlo mode"}},
35 {"no-badchannelcalib", VariantType::Bool, false, {"Disable bad channel calibration"}},
36 {"no-timecalib", VariantType::Bool, false, {"Disable time calibration"}},
37 {"no-gaincalib", VariantType::Bool, false, {"Disable gain calibration"}},
38 {"drop-led", VariantType::Bool, false, {"Drop LED events"}},
39 {"redirect-led", VariantType::Bool, false, {"Redirect LED events"}},
40 {"configKeyValues", VariantType::String, "", {"Semicolon separated key=value strings"}}};
42 workflowOptions.insert(workflowOptions.end(), options.begin(), options.end());
43}
44
46
48{
49 // Calibration types
50 auto disableBadchannels = cfgc.options().get<bool>("no-badchannelcalib"),
51 disableTime = cfgc.options().get<bool>("no-timecalib"),
52 disableEnergy = cfgc.options().get<bool>("no-gaincalib");
53
54 // subpsecs for input and output
55 auto inputsubspec = cfgc.options().get<uint32_t>("input-subspec"),
56 outputsubspec = cfgc.options().get<uint32_t>("output-subspec");
57
58 // LED event handling
59 auto dropled = cfgc.options().get<bool>("drop-led"),
60 redirectled = cfgc.options().get<bool>("redirect-led");
61
62 if (dropled && redirectled) {
63 LOG(fatal) << "Ambiguous handling of LED events";
64 }
65 uint32_t ledsetting = 0;
66 if (dropled) {
67 ledsetting = 1;
68 }
69 if (redirectled) {
70 ledsetting = 2;
71 }
72
73 o2::conf::ConfigurableParam::updateFromString(cfgc.options().get<std::string>("configKeyValues"));
74
75 WorkflowSpec specs;
76 specs.emplace_back(o2::emcal::getCellRecalibratorSpec(inputsubspec, outputsubspec, ledsetting, !disableBadchannels, !disableTime, !disableEnergy, cfgc.options().get<bool>("isMC")));
77
78 // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit
79 o2::raw::HBFUtilsInitializer hbfIni(cfgc, specs);
80 return specs;
81}
WorkflowSpec defineDataProcessing(ConfigContext const &cfgc)
void customize(std::vector< o2::framework::CallbacksPolicy > &policies)
static void updateFromString(std::string const &)
ConfigParamRegistry & options() const
framework::DataProcessorSpec getCellRecalibratorSpec(uint32_t inputSubspec, uint32_t outputSubspec, uint32_t ledsettings, bool badChannelCalib, bool timeCalib, bool gainCalib, bool isMC)
Create CellRecalibrator processor spec.
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
std::vector< DataProcessorSpec > WorkflowSpec
static void addNewTimeSliceCallback(std::vector< o2::framework::CallbacksPolicy > &policies)
static void addConfigOption(std::vector< o2::framework::ConfigParamSpec > &opts, const std::string &defOpt=std::string(o2::base::NameConf::DIGITIZATIONCONFIGFILE))
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"