Skip to content

Commit 3574f14

Browse files
committed
TPC Workflow: Clean up CompCluster options
1 parent 07201bc commit 3574f14

File tree

7 files changed

+51
-42
lines changed

7 files changed

+51
-42
lines changed

Detectors/TPC/workflow/include/TPCWorkflow/RecoWorkflow.h

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ struct CorrectionMapsLoaderGloOpts;
3535
namespace reco_workflow
3636
{
3737
/// define input and output types of the workflow
38-
enum struct InputType { PassThrough, // No processing, just pass through available inputs to the writers, defined by the OutputType
39-
Digitizer, // directly read digits from channel {TPC:DIGITS}
40-
Digits, // read digits from file
41-
ClustersHardware, // read hardware clusters in raw page format from file
42-
Clusters, // read native clusters from file
43-
CompClusters, // read compressed cluster container
44-
CompClustersCTF, // compressed clusters from CTF, as flat format
45-
CompClustersFlat, // compressed clusters in flat format, used as input for the entropy encoder
46-
EncodedClusters, // read encoded clusters
38+
enum struct InputType { PassThrough, // No processing, just pass through available inputs to the writers, defined by the OutputType
39+
Digitizer, // directly read digits from channel {TPC:DIGITS}
40+
Digits, // read digits from file
41+
ClustersHardware, // read hardware clusters in raw page format from file
42+
Clusters, // read native clusters from file
43+
CompClustersRoot, // read compressed cluster in ROOT format
44+
CompClustersFlat, // compressed clusters from flat format (e.g. from CTF)
45+
CompClustersFlatForEncode, // compressed clusters in flat format, used as input for the entropy encoder, no gpu-reco
46+
EncodedClusters, // read encoded clusters
4747
ZSRaw,
4848
};
4949

@@ -59,7 +59,8 @@ enum struct OutputType { Digits,
5959
ClustersHardware,
6060
Clusters,
6161
Tracks,
62-
CompClusters,
62+
CompClustersRoot,
63+
CompClustersFlat,
6364
EncodedClusters,
6465
DisableWriter,
6566
SendClustersPerSector,

Detectors/TPC/workflow/src/RecoWorkflow.cxx

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -80,16 +80,17 @@ const std::unordered_map<std::string, InputType> InputMap{
8080
{"clustershardware", InputType::ClustersHardware},
8181
{"clusters", InputType::Clusters},
8282
{"zsraw", InputType::ZSRaw},
83-
{"compressed-clusters", InputType::CompClusters},
84-
{"compressed-clusters-ctf", InputType::CompClustersCTF},
85-
{"compressed-clusters-flat", InputType::CompClustersFlat}};
83+
{"compressed-clusters-root", InputType::CompClustersRoot},
84+
{"compressed-clusters-flat", InputType::CompClustersFlat},
85+
{"compressed-clusters-flat-for-encode", InputType::CompClustersFlatForEncode}};
8686

8787
const std::unordered_map<std::string, OutputType> OutputMap{
8888
{"digits", OutputType::Digits},
8989
{"clustershardware", OutputType::ClustersHardware},
9090
{"clusters", OutputType::Clusters},
9191
{"tracks", OutputType::Tracks},
92-
{"compressed-clusters", OutputType::CompClusters},
92+
{"compressed-clusters-root", OutputType::CompClustersRoot},
93+
{"compressed-clusters-flat", OutputType::CompClustersFlat},
9394
{"encoded-clusters", OutputType::EncodedClusters},
9495
{"disable-writer", OutputType::DisableWriter},
9596
{"send-clusters-per-sector", OutputType::SendClustersPerSector},
@@ -122,14 +123,19 @@ framework::WorkflowSpec getWorkflow(CompletionPolicyData* policyData, std::vecto
122123
throw std::invalid_argument("filtered-input option must be provided only with pass-through input and clusters,tracks,send-clusters-per-sector output");
123124
}
124125

125-
bool decompressTPC = inputType == InputType::CompClustersCTF || inputType == InputType::CompClusters;
126+
bool decompressTPC = inputType == InputType::CompClustersFlat || inputType == InputType::CompClustersRoot;
126127
// Disable not applicable settings depending on TPC input, no need to disable manually
127128
if (decompressTPC && (isEnabled(OutputType::Clusters) || isEnabled(OutputType::Tracks))) {
128129
caClusterer = false;
129130
zsOnTheFly = false;
130131
propagateMC = false;
131132
}
132-
if (inputType == InputType::ZSRaw || inputType == InputType::CompClustersFlat) {
133+
if (inputType == InputType::CompClustersFlatForEncode || inputType == InputType::CompClustersRoot || inputType == InputType::CompClustersFlat) {
134+
caClusterer = false;
135+
zsOnTheFly = false;
136+
propagateMC = false;
137+
}
138+
if (inputType == InputType::ZSRaw) {
133139
caClusterer = true;
134140
zsOnTheFly = false;
135141
propagateMC = false;
@@ -225,7 +231,7 @@ framework::WorkflowSpec getWorkflow(CompletionPolicyData* policyData, std::vecto
225231
if (sclOpts.requestCTPLumi) { // need CTP digits (lumi) reader
226232
specs.emplace_back(o2::ctp::getDigitsReaderSpec(false));
227233
}
228-
} else if (inputType == InputType::CompClusters) {
234+
} else if (inputType == InputType::CompClustersRoot) {
229235
// TODO: need to check if we want to store the MC labels alongside with compressed clusters
230236
// for the moment reading of labels is disabled (last parameter is false)
231237
// TODO: make a different publisher spec for only one output spec, for now using the
@@ -248,8 +254,9 @@ framework::WorkflowSpec getWorkflow(CompletionPolicyData* policyData, std::vecto
248254
// output matrix
249255
// Note: the ClusterHardware format is probably a deprecated legacy format and also the
250256
// ClusterDecoderRawSpec
251-
bool produceCompClusters = isEnabled(OutputType::CompClusters);
252-
bool runGPUReco = (produceTracks || produceCompClusters || (isEnabled(OutputType::Clusters) && caClusterer) || inputType == InputType::CompClustersCTF) && inputType != InputType::CompClustersFlat;
257+
bool produceCompClustersRoot = isEnabled(OutputType::CompClustersRoot);
258+
bool produceCompClustersFlat = isEnabled(OutputType::CompClustersFlat);
259+
bool runGPUReco = (produceTracks || produceCompClustersRoot || produceCompClustersFlat || (isEnabled(OutputType::Clusters) && caClusterer) || inputType == InputType::CompClustersFlat) && inputType != InputType::CompClustersFlatForEncode;
253260
bool runHWDecoder = !caClusterer && (runGPUReco || isEnabled(OutputType::Clusters));
254261
bool runClusterer = !caClusterer && (runHWDecoder || isEnabled(OutputType::ClustersHardware));
255262
bool zsDecoder = inputType == InputType::ZSRaw;
@@ -460,13 +467,13 @@ framework::WorkflowSpec getWorkflow(CompletionPolicyData* policyData, std::vecto
460467
cfg.enableMShape = sclOpts.enableMShapeCorrection;
461468
cfg.enableCTPLumi = sclOpts.requestCTPLumi;
462469
cfg.decompressTPC = decompressTPC;
463-
cfg.decompressTPCFromROOT = decompressTPC && inputType == InputType::CompClusters;
470+
cfg.decompressTPCFromROOT = decompressTPC && inputType == InputType::CompClustersRoot;
464471
cfg.caClusterer = caClusterer;
465472
cfg.zsDecoder = zsDecoder;
466473
cfg.zsOnTheFly = zsOnTheFly;
467474
cfg.outputTracks = produceTracks;
468-
cfg.outputCompClusters = produceCompClusters;
469-
cfg.outputCompClustersFlat = runClusterEncoder;
475+
cfg.outputCompClustersRoot = produceCompClustersRoot;
476+
cfg.outputCompClustersFlat = produceCompClustersFlat || runClusterEncoder;
470477
cfg.outputCAClusters = isEnabled(OutputType::Clusters) && (caClusterer || decompressTPC);
471478
cfg.outputQA = isEnabled(OutputType::QA);
472479
cfg.outputSharedClusterMap = (isEnabled(OutputType::Clusters) || inputType == InputType::Clusters) && isEnabled(OutputType::Tracks) && !isEnabled(OutputType::NoSharedClusterMap);
@@ -500,7 +507,7 @@ framework::WorkflowSpec getWorkflow(CompletionPolicyData* policyData, std::vecto
500507
//
501508
// selected by output type 'encoded-clusters'
502509
if (runClusterEncoder) {
503-
specs.emplace_back(o2::tpc::getEntropyEncoderSpec(!runGPUReco && inputType != InputType::CompClustersFlat, selIR));
510+
specs.emplace_back(o2::tpc::getEntropyEncoderSpec(!runGPUReco && inputType != InputType::CompClustersFlatForEncode, selIR));
504511
}
505512

506513
//////////////////////////////////////////////////////////////////////////////////////////////
@@ -547,7 +554,7 @@ framework::WorkflowSpec getWorkflow(CompletionPolicyData* policyData, std::vecto
547554
// a writer process for compressed clusters container
548555
//
549556
// selected by output type 'compressed-clusters'
550-
if (produceCompClusters && !isEnabled(OutputType::DisableWriter)) {
557+
if (produceCompClustersRoot && !isEnabled(OutputType::DisableWriter)) {
551558
// defining the track writer process using the generic RootTreeWriter and generator tool
552559
//
553560
// defaults

Detectors/TPC/workflow/src/tpc-reco-workflow.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ void customize(std::vector<o2::framework::ConfigParamSpec>& workflowOptions)
5757
using namespace o2::framework;
5858

5959
std::vector<ConfigParamSpec> options{
60-
{"input-type", VariantType::String, "digits", {"digitizer, digits, zsraw, clustershw, clusters, compressed-clusters, compressed-clusters-ctf, pass-through"}},
61-
{"output-type", VariantType::String, "tracks", {"digits, zsraw, clustershw, clusters, tracks, compressed-clusters, encoded-clusters, disable-writer, send-clusters-per-sector, qa, no-shared-cluster-map, tpc-triggers"}},
60+
{"input-type", VariantType::String, "digits", {"digitizer, digits, zsraw, clustershw, clusters, compressed-clusters-root, compressed-clusters-ctf, compressed-clusters-flat-for-encode, pass-through"}},
61+
{"output-type", VariantType::String, "tracks", {"digits, zsraw, clustershw, clusters, tracks, compressed-clusters-root, compressed-clusters-flat, encoded-clusters, disable-writer, send-clusters-per-sector, qa, no-shared-cluster-map, tpc-triggers"}},
6262
{"disable-root-input", o2::framework::VariantType::Bool, false, {"disable root-files input reader"}},
6363
{"no-ca-clusterer", VariantType::Bool, false, {"Use HardwareClusterer instead of clusterer of GPUCATracking"}},
6464
{"disable-mc", VariantType::Bool, false, {"disable sending of MC information"}},

GPU/Workflow/include/GPUWorkflow/GPUWorkflowSpec.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ class GPURecoWorkflowSpec : public o2::framework::Task
117117
bool zsDecoder = false;
118118
bool zsOnTheFly = false;
119119
bool outputTracks = false;
120-
bool outputCompClusters = false;
120+
bool outputCompClustersRoot = false;
121121
bool outputCompClustersFlat = false;
122122
bool outputCAClusters = false;
123123
bool outputQA = false;

GPU/Workflow/src/GPUWorkflowSpec.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -236,14 +236,14 @@ void GPURecoWorkflowSpec::init(InitContext& ic)
236236
}
237237

238238
// Configure the "GPU workflow" i.e. which steps we run on the GPU (or CPU)
239-
if (mSpecConfig.outputTracks || mSpecConfig.outputCompClusters || mSpecConfig.outputCompClustersFlat) {
239+
if (mSpecConfig.outputTracks || mSpecConfig.outputCompClustersRoot || mSpecConfig.outputCompClustersFlat) {
240240
mConfig->configWorkflow.steps.set(GPUDataTypes::RecoStep::TPCConversion,
241241
GPUDataTypes::RecoStep::TPCSectorTracking,
242242
GPUDataTypes::RecoStep::TPCMerging);
243243
mConfig->configWorkflow.outputs.set(GPUDataTypes::InOutType::TPCMergedTracks);
244244
mConfig->configWorkflow.steps.setBits(GPUDataTypes::RecoStep::TPCdEdx, mConfParam->rundEdx == -1 ? !mConfParam->synchronousProcessing : mConfParam->rundEdx);
245245
}
246-
if (mSpecConfig.outputCompClusters || mSpecConfig.outputCompClustersFlat) {
246+
if (mSpecConfig.outputCompClustersRoot || mSpecConfig.outputCompClustersFlat) {
247247
mConfig->configWorkflow.steps.setBits(GPUDataTypes::RecoStep::TPCCompression, true);
248248
mConfig->configWorkflow.outputs.setBits(GPUDataTypes::InOutType::TPCCompressedClusters, true);
249249
}
@@ -966,7 +966,7 @@ void GPURecoWorkflowSpec::run(ProcessingContext& pc)
966966
LOG(info) << "found " << ptrs.nOutputTracksTPCO2 << " track(s)";
967967
}
968968

969-
if (mSpecConfig.outputCompClusters) {
969+
if (mSpecConfig.outputCompClustersRoot) {
970970
o2::tpc::CompressedClustersROOT compressedClusters = *ptrs.tpcCompressedClusters;
971971
pc.outputs().snapshot(Output{gDataOriginTPC, "COMPCLUSTERS", 0}, ROOTSerialized<o2::tpc::CompressedClustersROOT const>(compressedClusters));
972972
}
@@ -1259,7 +1259,7 @@ Outputs GPURecoWorkflowSpec::outputs()
12591259
if (mSpecConfig.processMC && mSpecConfig.outputTracks) {
12601260
outputSpecs.emplace_back(gDataOriginTPC, "TRACKSMCLBL", 0, Lifetime::Timeframe);
12611261
}
1262-
if (mSpecConfig.outputCompClusters) {
1262+
if (mSpecConfig.outputCompClustersRoot) {
12631263
outputSpecs.emplace_back(gDataOriginTPC, "COMPCLUSTERS", 0, Lifetime::Timeframe);
12641264
}
12651265
if (mSpecConfig.outputCompClustersFlat) {

GPU/Workflow/src/gpu-reco-workflow.cxx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ void customize(std::vector<ConfigParamSpec>& workflowOptions)
5151
{
5252

5353
std::vector<ConfigParamSpec> options{
54-
{"input-type", VariantType::String, "digits", {"digitizer, digits, zsraw, zsonthefly, clustersnative, compressed-clusters-root, compressed-clusters-ctf, trd-tracklets, its-clusters"}},
55-
{"output-type", VariantType::String, "tracks", {"clustersnative, tracks, compressed-clusters-ctf, qa, no-shared-cluster-map, send-clusters-per-sector, trd-tracks, error-qa, tpc-triggers, its-tracks"}},
54+
{"input-type", VariantType::String, "digits", {"digits, zsraw, zsonthefly, clusters, compressed-clusters-root, compressed-clusters-flat, trd-tracklets, its-clusters, its-mean-vertex"}},
55+
{"output-type", VariantType::String, "tracks", {"cluster, tracks, compressed-clusters-root, compressed-clusters-flat, qa, error-qa, no-shared-cluster-map, send-clusters-per-sector, trd-tracks, tpc-triggers, its-tracks"}},
5656
{"corrmap-lumi-mode", VariantType::Int, 0, {"scaling mode: (default) 0 = static + scale * full; 1 = full + scale * derivative"}},
5757
{"disable-root-input", VariantType::Bool, true, {"disable root-files input reader"}},
5858
{"disable-mc", VariantType::Bool, false, {"disable sending of MC information"}},
@@ -98,7 +98,7 @@ enum struct ioType { Digits,
9898
ZSRaw,
9999
ZSRawOTF,
100100
CompClustROOT,
101-
CompClustCTF,
101+
CompClustFlat,
102102
Tracks,
103103
QA,
104104
ErrorQA,
@@ -117,7 +117,7 @@ static const std::unordered_map<std::string, ioType> InputMap{
117117
{"zsraw", ioType::ZSRaw},
118118
{"zsonthefly", ioType::ZSRawOTF},
119119
{"compressed-clusters-root", ioType::CompClustROOT},
120-
{"compressed-clusters-ctf", ioType::CompClustCTF},
120+
{"compressed-clusters-flat", ioType::CompClustFlat},
121121
{"trd-tracklets", ioType::TRDTracklets},
122122
{"its-clusters", ioType::ITSClusters},
123123
{"its-mean-vertex", ioType::MeanVertex},
@@ -126,7 +126,8 @@ static const std::unordered_map<std::string, ioType> InputMap{
126126
static const std::unordered_map<std::string, ioType> OutputMap{
127127
{"clusters", ioType::Clusters},
128128
{"tracks", ioType::Tracks},
129-
{"compressed-clusters-ctf", ioType::CompClustCTF},
129+
{"compressed-clusters-flat", ioType::CompClustFlat},
130+
{"compressed-clusters-root", ioType::CompClustROOT},
130131
{"qa", ioType::QA},
131132
{"error-qa", ioType::ErrorQA},
132133
{"no-shared-cluster-map", ioType::NoSharedMap},
@@ -167,13 +168,13 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
167168
cfg.enableMShape = sclOpt.enableMShapeCorrection;
168169
cfg.enableCTPLumi = sclOpt.requestCTPLumi;
169170
cfg.decompressTPCFromROOT = isEnabled(inputTypes, ioType::CompClustROOT);
170-
cfg.decompressTPC = isEnabled(inputTypes, ioType::CompClustCTF) || cfg.decompressTPCFromROOT;
171+
cfg.decompressTPC = isEnabled(inputTypes, ioType::CompClustFlat) || cfg.decompressTPCFromROOT;
171172
cfg.zsDecoder = isEnabled(inputTypes, ioType::ZSRaw);
172173
cfg.zsOnTheFly = isEnabled(inputTypes, ioType::ZSRawOTF);
173174
cfg.caClusterer = cfg.zsDecoder || cfg.zsOnTheFly || isEnabled(inputTypes, ioType::Digits);
174175
cfg.outputTracks = isEnabled(outputTypes, ioType::Tracks);
175-
cfg.outputCompClusters = isEnabled(outputTypes, ioType::CompClustROOT);
176-
cfg.outputCompClustersFlat = isEnabled(outputTypes, ioType::CompClustCTF);
176+
cfg.outputCompClustersRoot = isEnabled(outputTypes, ioType::CompClustROOT);
177+
cfg.outputCompClustersFlat = isEnabled(outputTypes, ioType::CompClustFlat);
177178
cfg.outputCAClusters = isEnabled(outputTypes, ioType::Clusters);
178179
cfg.outputQA = isEnabled(outputTypes, ioType::QA);
179180
cfg.outputErrorQA = isEnabled(outputTypes, ioType::ErrorQA);

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ workflow_has_parameter CALIB && [[ $CALIB_TPC_VDRIFTTGL == 1 ]] && SEND_ITSTPC_D
205205

206206
PVERTEXING_CONFIG_KEY+="${ITSMFT_STROBES};"
207207

208-
has_processing_step ENTROPY_ENCODER && has_detector_ctf TPC && GPU_OUTPUT+=",compressed-clusters-ctf"
208+
has_processing_step ENTROPY_ENCODER && has_detector_ctf TPC && GPU_OUTPUT+=",compressed-clusters-flat"
209209

210210
if [[ $SYNCMODE == 1 ]] && workflow_has_parameter QC && has_detector_qc TPC; then
211211
GPU_OUTPUT+=",qa,error-qa"
@@ -443,7 +443,7 @@ fi
443443

444444
if [[ -n $INPUT_DETECTOR_LIST ]]; then
445445
if [[ $CTFINPUT == 1 ]]; then
446-
GPU_INPUT=compressed-clusters-ctf
446+
GPU_INPUT=compressed-clusters-flat
447447
TOF_INPUT=digits
448448
CTFName=`ls -t $RAWINPUTDIR/o2_ctf_*.root 2> /dev/null | head -n1`
449449
[[ -z $CTFName && $WORKFLOWMODE == "print" ]] && CTFName='$CTFName'
@@ -652,7 +652,7 @@ if has_processing_step ENTROPY_ENCODER && [[ -n "$WORKFLOW_DETECTORS_CTF" ]] &&
652652
has_detector_ctf TOF && add_W o2-tof-entropy-encoder-workflow "$RANS_OPT --mem-factor ${TOF_ENC_MEMFACT:-1.5} --pipeline $(get_N tof-entropy-encoder TOF CTF 1)"
653653
has_detector_ctf ITS && add_W o2-itsmft-entropy-encoder-workflow "$RANS_OPT --mem-factor ${ITS_ENC_MEMFACT:-1.5} --pipeline $(get_N its-entropy-encoder ITS CTF 1)"
654654
has_detector_ctf TRD && add_W o2-trd-entropy-encoder-workflow "$RANS_OPT --mem-factor ${TRD_ENC_MEMFACT:-1.5} --pipeline $(get_N trd-entropy-encoder TRD CTF 1 TRDENT)"
655-
has_detector_ctf TPC && add_W o2-tpc-reco-workflow " $RANS_OPT --mem-factor ${TPC_ENC_MEMFACT:-1.} --input-type compressed-clusters-flat --output-type encoded-clusters,disable-writer --pipeline $(get_N tpc-entropy-encoder TPC CTF 1 TPCENT)"
655+
has_detector_ctf TPC && add_W o2-tpc-reco-workflow " $RANS_OPT --mem-factor ${TPC_ENC_MEMFACT:-1.} --input-type compressed-clusters-flat-for-encode --output-type encoded-clusters,disable-writer --pipeline $(get_N tpc-entropy-encoder TPC CTF 1 TPCENT)"
656656
has_detector_ctf CTP && add_W o2-ctp-entropy-encoder-workflow "$RANS_OPT --mem-factor ${CTP_ENC_MEMFACT:-1.5} --pipeline $(get_N its-entropy-encoder CTP CTF 1)"
657657

658658
if [[ $CREATECTFDICT == 1 && $WORKFLOWMODE == "run" ]] ; then

0 commit comments

Comments
 (0)