Skip to content

Commit fb86fef

Browse files
committed
Add ZDC calibration to dpl-workflow
1 parent bce6d29 commit fb86fef

4 files changed

Lines changed: 25 additions & 18 deletions

File tree

Detectors/ZDC/calib/src/TDCCalibEPNSpec.cxx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,8 @@ void TDCCalibEPNSpec::run(ProcessingContext& pc)
105105
// Send debug histograms and intermediate calibration data
106106
o2::framework::Output output("ZDC", "TDCCALIBDATA", 0, Lifetime::Timeframe);
107107
pc.outputs().snapshot(output, mWorker.mData);
108-
char outputd[o2::header::gSizeDataDescriptionString];
109108
for (int ih = 0; ih < TDCCalibData::NTDC; ih++) {
110-
snprintf(outputd, o2::header::gSizeDataDescriptionString, "TDC_1DH%d", ih);
111-
o2::framework::Output output("ZDC", outputd, 0, Lifetime::Timeframe);
109+
o2::framework::Output output("ZDC", "TDC_1DH", ih, Lifetime::Timeframe);
112110
pc.outputs().snapshot(output, mWorker.mTDC[ih]->getBase());
113111
}
114112
}
@@ -147,4 +145,4 @@ framework::DataProcessorSpec getTDCCalibEPNSpec()
147145
}
148146

149147
} // namespace zdc
150-
} // namespace o2
148+
} // namespace o2

Detectors/ZDC/calib/src/TDCCalibSpec.cxx

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include "Framework/ControlService.h"
2424
#include "Framework/ConfigParamRegistry.h"
2525
#include "Framework/CCDBParamSpec.h"
26+
#include "Framework/InputRecordWalker.h"
2627
#include "DetectorsCommonDataFormats/DetID.h"
2728
#include "DataFormatsZDC/BCData.h"
2829
#include "DataFormatsZDC/ChannelData.h"
@@ -101,13 +102,14 @@ void TDCCalibSpec::run(ProcessingContext& pc)
101102
mTimer.Reset();
102103
mTimer.Start(false);
103104
}
104-
105+
std::vector<InputSpec> filterHisto = {{"tdc_1dh", ConcreteDataTypeMatcher{"ZDC", "TDC_1DH"}, Lifetime::Timeframe}};
106+
for (auto const& inputRef : InputRecordWalker(pc.inputs(), filterHisto)) {
107+
auto const* dh = framework::DataRefUtils::getHeader<o2::header::DataHeader*>(inputRef);
108+
o2::dataformats::FlatHisto1D<float> histoView(pc.inputs().get<gsl::span<float>>(inputRef));
109+
mWorker.add(dh->subSpecification, histoView);
110+
}
105111
auto data = pc.inputs().get<TDCCalibData>("tdccalibdata");
106112
mWorker.process(data);
107-
for (int ih = 0; ih < TDCCalibData::NTDC; ih++) {
108-
o2::dataformats::FlatHisto1D<float> histoView(pc.inputs().get<gsl::span<float>>(fmt::format("tdc_1dh{}", ih).data()));
109-
mWorker.add(ih, histoView);
110-
}
111113
}
112114

113115
void TDCCalibSpec::endOfStream(EndOfStreamContext& ec)
@@ -147,14 +149,7 @@ framework::DataProcessorSpec getTDCCalibSpec()
147149
inputs.emplace_back("tdccalibconfig", "ZDC", "TDCCALIBCONFIG", 0, Lifetime::Condition, o2::framework::ccdbParamSpec(fmt::format("{}", o2::zdc::CCDBPathTDCCalibConfig.data())));
148150
inputs.emplace_back("tdccalib", "ZDC", "TDCCALIB", 0, Lifetime::Condition, o2::framework::ccdbParamSpec(fmt::format("{}", o2::zdc::CCDBPathTDCCalib.data())));
149151
inputs.emplace_back("tdccalibdata", "ZDC", "TDCCALIBDATA", 0, Lifetime::Timeframe);
150-
151-
char outputa[o2::header::gSizeDataDescriptionString];
152-
char outputd[o2::header::gSizeDataDescriptionString];
153-
for (int ih = 0; ih < TDCCalibData::NTDC; ih++) {
154-
snprintf(outputa, o2::header::gSizeDataDescriptionString, "tdc_1dh%d", ih);
155-
snprintf(outputd, o2::header::gSizeDataDescriptionString, "TDC_1DH%d", ih);
156-
inputs.emplace_back(outputa, "ZDC", outputd, 0, Lifetime::Timeframe);
157-
}
152+
inputs.emplace_back("tdc_1dh", ConcreteDataTypeMatcher{"ZDC", "TDC_1DH"}, Lifetime::Timeframe);
158153

159154
std::vector<OutputSpec> outputs;
160155
outputs.emplace_back(ConcreteDataTypeMatcher{o2::calibration::Utils::gDataOriginCDBPayload, "ZDC_TDCcalib"}, Lifetime::Sporadic);
@@ -169,4 +164,4 @@ framework::DataProcessorSpec getTDCCalibSpec()
169164
}
170165

171166
} // namespace zdc
172-
} // namespace o2
167+
} // namespace o2

prodtests/full-system-test/aggregator-workflow.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ if [[ "0$GEN_TOPO_VERBOSE" == "01" ]]; then
5252
echo "CALIB_TPC_IDC = $CALIB_TPC_IDC" 1>&2
5353
echo "CALIB_TPC_IDC_BOTH = $CALIB_TPC_IDC_BOTH" 1>&2
5454
echo "CALIB_CPV_GAIN = $CALIB_CPV_GAIN" 1>&2
55+
echo "CALIB_ZDC_TDC = $CALIB_ZDC_TDC" 1>&2
5556
fi
5657

5758
# beamtype dependent settings
@@ -237,6 +238,14 @@ if [[ $AGGREGATOR_TASKS == CALO_TF || $AGGREGATOR_TASKS == ALL ]]; then
237238
fi
238239
fi
239240

241+
# Forward detectors
242+
if [[ $AGGREGATOR_TASKS == FORWARD_TF || $AGGREGATOR_TASKS == ALL ]]; then
243+
# ZDC
244+
if [[ $CALIB_ZDC_TDC == 1 ]]; then
245+
add_W o2-zdc-tdccalib-workflow
246+
fi
247+
fi
248+
240249
if [[ "0$GEN_TOPO_VERBOSE" == "01" ]]; then
241250
# calibrations for AGGREGATOR_TASKS == CALO_SPORADIC
242251
if [[ $AGGREGATOR_TASKS == CALO_SPORADIC ]] || [[ $AGGREGATOR_TASKS == ALL ]]; then

prodtests/full-system-test/calib-workflow.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ if [[ "0$CALIB_TPC_SCDCALIB_SENDTRKDATA" == "01" ]]; then ENABLE_TRKDATA_OUTPUT=
2020
if [[ $CALIB_TPC_SCDCALIB == 1 ]]; then add_W o2-tpc-scdcalib-interpolation-workflow "$ENABLE_TRKDATA_OUTPUT $DISABLE_ROOT_OUTPUT --disable-root-input --pipeline $(get_N tpc-track-interpolation TPC REST)" "$ITSMFT_FILES"; fi
2121
if [[ $CALIB_TPC_TIMEGAIN == 1 ]]; then add_W o2-tpc-miptrack-filter "" "" 0; fi
2222
if [[ $CALIB_TPC_RESPADGAIN == 1 ]]; then add_W o2-tpc-calib-gainmap-tracks "--publish-after-tfs 10000"; fi
23+
if [[ $CALIB_ZDC_TDC == 1 ]]; then add_W o2-zdc-tdccalib-epn-workflow "" "" 0; fi
2324

2425
# output-proxy for aggregator
2526
if workflow_has_parameter CALIB_PROXIES; then
@@ -51,6 +52,10 @@ if workflow_has_parameter CALIB_PROXIES; then
5152
if [[ ! -z $CALIBDATASPEC_MUON_SPORADIC ]]; then
5253
add_W o2-dpl-output-proxy "--dataspec \"$CALIBDATASPEC_MUON_SPORADIC\" $(get_proxy_connection muon_sp output)" "" 0
5354
fi
55+
if [[ ! -z $CALIBDATASPEC_ZDC_TF ]]; then
56+
add_W o2-dpl-output-proxy "--dataspec \"$CALIBDATASPEC_ZDC_TF\" $(get_proxy_connection zdc_tf output)" "" 0
57+
fi
58+
5459
fi
5560

5661
true # everything OK up to this point, so the script should return 0 (it is !=0 already if a has_detector check fails)

0 commit comments

Comments
 (0)