Project
Loading...
Searching...
No Matches
trd-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
21
22using namespace o2::framework;
23
24// we need to add workflow options before including Framework/runDataProcessing
25void customize(std::vector<o2::framework::ConfigParamSpec>& workflowOptions)
26{
27 // option allowing to set parameters
28 std::vector<o2::framework::ConfigParamSpec> options{
29 {"enable-root-input", o2::framework::VariantType::Bool, false, {"enable root-files input readers"}},
30 {"vDriftAndExB", o2::framework::VariantType::Bool, false, {"enable vDrift and ExB calibration"}},
31 {"noise", o2::framework::VariantType::Bool, false, {"enable noise and pad status calibration"}},
32 {"gain", o2::framework::VariantType::Bool, false, {"enable gain calibration"}},
33 {"t0", o2::framework::VariantType::Bool, false, {"enable t0 fit"}},
34 {"calib-dds-collection-index", VariantType::Int, -1, {"allow only single collection to produce calibration objects (use -1 for no limit)"}},
35 {"configKeyValues", VariantType::String, "", {"Semicolon separated key=value strings"}}};
36
37 std::swap(workflowOptions, options);
38}
39
40// ------------------------------------------------------------------
41
43
45{
46 o2::conf::ConfigurableParam::updateFromString(configcontext.options().get<std::string>("configKeyValues"));
47 auto enableRootInp = configcontext.options().get<bool>("enable-root-input");
48
49 WorkflowSpec specs;
50
51 if (configcontext.options().get<bool>("vDriftAndExB")) {
52 if (enableRootInp) {
53 specs.emplace_back(o2::trd::getTRDCalibReaderSpec());
54 }
55 specs.emplace_back(getTRDVdAndExBCalibSpec());
56 }
57
58 if (configcontext.options().get<bool>("noise")) {
59 if (enableRootInp) {
60 specs.emplace_back(o2::trd::getTRDDigitReaderSpec(false));
61 }
62 int ddsCollectionIdx = configcontext.options().get<int>("calib-dds-collection-index");
63 bool noiseCalibIsDummy = true;
64 if (ddsCollectionIdx != -1) {
65 char* colIdx = getenv("DDS_COLLECTION_INDEX");
66 int myIdx = colIdx ? atoi(colIdx) : -1;
67 if (myIdx == ddsCollectionIdx) {
68 LOG(info) << "TRD noise calib is enabled for this collection, my index " << myIdx;
69 noiseCalibIsDummy = false;
70 } else {
71 LOG(info) << "TRD noise calib is disabled for this collection, my index " << myIdx;
72 }
73 } else {
74 noiseCalibIsDummy = false;
75 }
76 specs.emplace_back(o2::trd::getTRDNoiseCalibSpec(noiseCalibIsDummy));
77 }
78
79 if (configcontext.options().get<bool>("gain")) {
80 specs.emplace_back(getTRDGainCalibSpec());
81 }
82
83 if (configcontext.options().get<bool>("t0")) {
84 if (enableRootInp) {
85 specs.emplace_back(o2::trd::getTRDPHReaderSpec());
86 }
87 specs.emplace_back(getTRDT0FitSpec());
88 }
89
90 return specs;
91}
DPL device for steering the TRD gain time slot based calibration.
DPL device for steering the TRD t0 fits.
Extract mean ADC values per pad from digits and send them to the aggregator.
DPL device for steering the TRD vD and ExB time slot based calibration.
static void updateFromString(std::string const &)
ConfigParamRegistry & options() const
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
std::vector< DataProcessorSpec > WorkflowSpec
framework::DataProcessorSpec getTRDPHReaderSpec()
framework::DataProcessorSpec getTRDCalibReaderSpec()
o2::framework::DataProcessorSpec getTRDNoiseCalibSpec(bool dummy)
o2::framework::DataProcessorSpec getTRDDigitReaderSpec(bool useMC, bool trigRec=true, int dataSubspec=1)
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"
void customize(std::vector< o2::framework::ConfigParamSpec > &workflowOptions)
WorkflowSpec defineDataProcessing(ConfigContext const &configcontext)
This function hooks up the the workflow specifications into the DPL driver.