Project
Loading...
Searching...
No Matches
tof-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
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{"configKeyValues", VariantType::String, "", {"Semicolon separated key=value strings"}});
25 workflowOptions.push_back(ConfigParamSpec{"use-ccdb", o2::framework::VariantType::Bool, false, {"enable access to ccdb tof calibration objects"}});
26 workflowOptions.push_back(ConfigParamSpec{"do-lhc-phase", o2::framework::VariantType::Bool, false, {"do LHC clock phase calibration"}});
27 workflowOptions.push_back(ConfigParamSpec{"do-channel-offset", o2::framework::VariantType::Bool, false, {"do TOF channel offset calibration"}});
28 workflowOptions.push_back(ConfigParamSpec{"attach-channel-offset-to-lhcphase", o2::framework::VariantType::Bool, false, {"do TOF channel offset calibration using the LHCphase previously calculated in the same workflow"}});
29 workflowOptions.push_back(ConfigParamSpec{"cosmics", o2::framework::VariantType::Bool, false, {"for cosmics data"}});
30 workflowOptions.push_back(ConfigParamSpec{"perstrip", o2::framework::VariantType::Bool, false, {"offsets per strip"}});
31 workflowOptions.push_back(ConfigParamSpec{"safe-mode", o2::framework::VariantType::Bool, false, {"require safe mode (discard strange TF)"}});
32}
33
34// ------------------------------------------------------------------
35
37
39{
40 WorkflowSpec specs;
41 o2::conf::ConfigurableParam::updateFromString(configcontext.options().get<std::string>("configKeyValues"));
42
43 auto useCCDB = configcontext.options().get<bool>("use-ccdb");
44 auto doLHCcalib = configcontext.options().get<bool>("do-lhc-phase");
45 auto doChannelOffsetCalib = configcontext.options().get<bool>("do-channel-offset");
46 auto attachChannelOffsetToLHCphase = configcontext.options().get<bool>("attach-channel-offset-to-lhcphase");
47 auto isCosmics = configcontext.options().get<bool>("cosmics");
48 auto perstrip = configcontext.options().get<bool>("perstrip");
49 auto safe = configcontext.options().get<bool>("safe-mode");
50
51 if (isCosmics) {
52 LOG(info) << "Cosmics set!!!! No LHC phase, Yes channel offset";
53 doChannelOffsetCalib = true;
54 doLHCcalib = false;
55 }
56
57 if (!doLHCcalib && attachChannelOffsetToLHCphase) {
58 LOG(info) << "Over-writing attachChannelOffsetToLHCphase because we are not doing the LHCphase calibration";
59 attachChannelOffsetToLHCphase = false;
60 }
61
62 LOG(info) << "TOF Calibration workflow: options";
63 LOG(info) << "doLHCcalib = " << doLHCcalib;
64 LOG(info) << "doChannelOffsetCalib = " << doChannelOffsetCalib;
65 LOG(info) << "useCCDB = " << useCCDB;
66 LOG(info) << "attachChannelOffsetToLHCphase = " << attachChannelOffsetToLHCphase;
67
68 if (doLHCcalib) {
69 specs.emplace_back(getLHCClockCalibDeviceSpec(useCCDB));
70 }
71 if (doChannelOffsetCalib) {
72 if (!isCosmics) {
73 specs.emplace_back(getTOFChannelCalibDeviceSpec<o2::dataformats::CalibInfoTOF>(useCCDB, attachChannelOffsetToLHCphase, isCosmics, perstrip, safe));
74 } else {
75 specs.emplace_back(getTOFChannelCalibDeviceSpec<o2::tof::CalibInfoCluster>(useCCDB, attachChannelOffsetToLHCphase, isCosmics));
76 }
77 }
78 return specs;
79}
Class to store the output of the matching to TOF for calibration.
Device to calibrate LHC clock phase using TOF data.
Device to calibrate TOF channles (offsets)
static void updateFromString(std::string const &)
ConfigParamRegistry & options() const
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
std::vector< DataProcessorSpec > WorkflowSpec
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"
void customize(std::vector< o2::framework::ConfigParamSpec > &workflowOptions)
WorkflowSpec defineDataProcessing(ConfigContext const &configcontext)