Skip to content

Commit d445463

Browse files
Cleaning up input and output types of the TPC reco workflow
The data type 'clusters' has formerly been the cluster output of the digitizer. Since the conversion step has been removed and the digitizer directly outputs TPC ClusterHardware in raw pages, this output type has been removed but was still in the help message of the option. Data type 'decoded-clusters' is now renamed to 'clusters' and refers to the output of the HardwareClusterDecoder, the TPC ClusterNative format.
1 parent e3479f8 commit d445463

4 files changed

Lines changed: 40 additions & 35 deletions

File tree

Detectors/TPC/workflow/README.md

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
## TPC reconstruction workflow
44
The TPC reconstruction workflow starts from the TPC digits, the *clusterer* reconstructs clusters in the
55
[ClusterHardware](../../../DataFormats/Detectors/TPC/include/DataFormatsTPC/ClusterHardware.h) format.
6-
The clusters are written to RAW pages and passed onto the *decoder* providing the decoded (native) cluster
6+
The clusters are directly written in the *RAW page* format. The raw data are passed onto the *decoder*
7+
providing the [TPC native cluster](../../../DataFormats/Detectors/TPC/include/DataFormatsTPC/ClusterNative.h)
78
format to the *tracker*.
89

910
Note: The format of the raw pages is preliminary and does not reflect what is currently implemented in the CRU.
@@ -17,11 +18,10 @@ The workflow consists of the following DPL processors:
1718
* `tpc-track-writer` -> implements simple writing to ROOT file
1819

1920
Depending on the input and output types the default workflow is extended by the following readers and writers:
20-
* `tpc-raw-cluster-reader`
21-
* `tpc-decoded-cluster-reader`
22-
* `tpc-raw-cluster-writer`
23-
* `tpc-decoded-cluster-writer`
24-
21+
* `tpc-raw-cluster-writer` writes the binary raw format data to binary branches in a ROOT file
22+
* `tpc-raw-cluster-reader` reads data from binary branches of a ROOT file
23+
* `tpc-cluster-writer` writes the binary native cluster data to binary branches in a ROOT file
24+
* `tpc-cluster-reader` reads data from binary branches of a ROOT file
2525

2626
MC labels are passed through the workflow along with the data objects and also written together with the
2727
output at the configured stages (see output types).
@@ -31,7 +31,7 @@ The input can be created by running the simulation (`o2sim`) and the digitizer w
3131
The digitizer workflow produces the file `tpcdigits.root` by default, data is stored in separated branches for
3232
all sectors.
3333

34-
The workflow can be started starting from digits, raw clusters, or decoded (native) clusters, or directly attached to the
34+
The workflow can be run starting from digits, raw clusters, or (native) clusters, or directly attached to the
3535
`digitizer-workflow`, see comment on inputs types below.
3636

3737
### Quickstart running the reconstruction workflow
@@ -67,17 +67,17 @@ Options for the `tpc-track-writer` process
6767

6868
Examples:
6969
```
70-
tpc-reco-workflow --infile tpcdigits.root --tpc-sectors 0-15 --tracker-options "cont refX=83 bz=-5.0068597793"
70+
tpc-reco-workflow --infile tpcdigits.root --tpc-sectors 0-17 --tracker-options "cont refX=83 bz=-5.0068597793"
7171
```
7272

7373
```
74-
tpc-reco-workflow --infile tpcdigits.root --tpc-sectors 0-15 --disable-mc 1 --tracker-options "cont refX=83 bz=-5.0068597793"
74+
tpc-reco-workflow --infile tpcdigits.root --tpc-sectors 0-17 --disable-mc 1 --tracker-options "cont refX=83 bz=-5.0068597793"
7575
```
7676

7777
### Global workflow options:
7878
```
79-
--input-type arg (=digits) digitizer, digits, raw, decoded-clusters
80-
--output-type arg (=tracks) digits, raw, decoded-clusters, tracks
79+
--input-type arg (=digits) digitizer, digits, raw, clusters
80+
--output-type arg (=tracks) digits, raw, clusters, tracks
8181
--disable-mc arg (=0) disable sending of MC information
8282
--tpc-lanes arg (=1) number of parallel lanes up to the tracker
8383
--tpc-sectors arg (=0-35) TPC sector range, e.g. 5-7,8,9
@@ -101,9 +101,12 @@ are supported in order to write data at intermediate steps, e.g.
101101
MC label data are stored in corresponding branches per sector. The sequence of MC objects must match
102102
the sequence of data objects.
103103

104+
By default, all data is written to ROOT files, even the data in binary format like the raw data and cluster
105+
data. This allows to record multiple sets (i.e. timeframes/events) in one file alongside with the MC labels.
106+
104107
#### Parallel processing
105108
Parallel processing is controlled by the option `--tpc-lanes n`. The digit reader will fan out to n processing
106-
lanes, each with clusterer, converter and decoder. The tracker will fan in from the parallel lanes.
109+
lanes, each with clusterer, and decoder. The tracker will fan in from multiple parallel lanes.
107110
For each sector, a dedicated DPL data channel is created. The channels are distributed among the lanes.
108111
The default configuration processes sector data belonging together in the same time slice, but in earlier
109112
implementations the sector data was distributed among multiple time slices (thus abusing the DPL time

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

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,16 @@ namespace TPC
2828
namespace RecoWorkflow
2929
{
3030
/// define input and output types of the workflow
31-
enum struct InputType { Digitizer, // directly read digits from {TPC:DIGITS}
32-
Digits, // read digits from file
33-
DecodedClusters, // read decoded clusters from file
34-
Raw };
31+
enum struct InputType { Digitizer, // directly read digits from channel {TPC:DIGITS}
32+
Digits, // read digits from file
33+
Raw, // read hardware clusters in raw page format from file
34+
Clusters, // read native clusters from file
35+
};
3536
enum struct OutputType { Digits,
3637
Raw,
37-
DecodedClusters,
38-
Tracks };
38+
Clusters,
39+
Tracks,
40+
};
3941

4042
/// create the workflow for TPC reconstruction
4143
framework::WorkflowSpec getWorkflow(std::vector<int> const& tpcSectors, //

Detectors/TPC/workflow/src/RecoWorkflow.cxx

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,13 @@ const std::unordered_map<std::string, InputType> InputMap{
5656
{ "digitizer", InputType::Digitizer },
5757
{ "digits", InputType::Digits },
5858
{ "raw", InputType::Raw },
59-
{ "decoded-clusters", InputType::DecodedClusters },
59+
{ "clusters", InputType::Clusters },
6060
};
6161

6262
const std::unordered_map<std::string, OutputType> OutputMap{
6363
{ "digits", OutputType::Digits },
6464
{ "raw", OutputType::Raw },
65-
{ "decoded-clusters", OutputType::DecodedClusters },
65+
{ "clusters", OutputType::Clusters },
6666
{ "tracks", OutputType::Tracks },
6767
};
6868

@@ -89,8 +89,8 @@ framework::WorkflowSpec getWorkflow(std::vector<int> const& tpcSectors, std::vec
8989
if (inputType == InputType::Raw && isEnabled(OutputType::Digits)) {
9090
throw std::invalid_argument("input/output type mismatch, can not produce 'digits' from 'raw'");
9191
}
92-
if (inputType == InputType::DecodedClusters && (isEnabled(OutputType::Digits) || isEnabled(OutputType::Raw))) {
93-
throw std::invalid_argument("input/output type mismatch, can not produce 'digits', nor 'raw' from 'decoded-clusters");
92+
if (inputType == InputType::Clusters && (isEnabled(OutputType::Digits) || isEnabled(OutputType::Raw))) {
93+
throw std::invalid_argument("input/output type mismatch, can not produce 'digits', nor 'raw' from 'clusters'");
9494
}
9595

9696
WorkflowSpec specs;
@@ -111,19 +111,19 @@ framework::WorkflowSpec getWorkflow(std::vector<int> const& tpcSectors, std::vec
111111
specs.emplace_back(o2::TPC::getPublisherSpec(PublisherConf{
112112
"tpc-raw-cluster-reader",
113113
"tpcraw",
114-
{ "databranch", "TPCClusterHw", "Branch with raw clusters" },
114+
{ "databranch", "TPCClusterHw", "Branch with TPC raw clusters" },
115115
{ "mcbranch", "TPCClusterHwMCTruth", "MC label branch" },
116116
OutputSpec{ "TPC", "CLUSTERHW" },
117117
OutputSpec{ "TPC", "CLUSTERHWMCLBL" },
118118
tpcSectors,
119119
laneConfiguration,
120120
},
121121
propagateMC));
122-
} else if (inputType == InputType::DecodedClusters) {
122+
} else if (inputType == InputType::Clusters) {
123123
specs.emplace_back(o2::TPC::getPublisherSpec(PublisherConf{
124-
"tpc-decoded-cluster-reader",
124+
"tpc-native-cluster-reader",
125125
"tpcrec",
126-
{ "clusterbranch", "TPCClusterNative", "Branch with decoded clusters" },
126+
{ "clusterbranch", "TPCClusterNative", "Branch with TPC native clusters" },
127127
{ "clustermcbranch", "TPCClusterNativeMCTruth", "MC label branch" },
128128
OutputSpec{ "TPC", "CLUSTERNATIVE" },
129129
OutputSpec{ "TPC", "CLNATIVEMCLBL" },
@@ -135,13 +135,13 @@ framework::WorkflowSpec getWorkflow(std::vector<int> const& tpcSectors, std::vec
135135

136136
// output matrix
137137
bool runTracker = isEnabled(OutputType::Tracks);
138-
bool runDecoder = runTracker || isEnabled(OutputType::DecodedClusters);
138+
bool runDecoder = runTracker || isEnabled(OutputType::Clusters);
139139
bool runClusterer = runDecoder || isEnabled(OutputType::Raw);
140140

141141
// input matrix
142142
runClusterer &= inputType == InputType::Digitizer || inputType == InputType::Digits;
143143
runDecoder &= runClusterer || inputType == InputType::Raw;
144-
runTracker &= runDecoder || inputType == InputType::DecodedClusters;
144+
runTracker &= runDecoder || inputType == InputType::Clusters;
145145

146146
WorkflowSpec parallelProcessors;
147147
//////////////////////////////////////////////////////////////////////////////////////////////
@@ -302,13 +302,13 @@ framework::WorkflowSpec getWorkflow(std::vector<int> const& tpcSectors, std::vec
302302

303303
//////////////////////////////////////////////////////////////////////////////////////////////
304304
//
305-
// a writer process for decoded clusters
305+
// a writer process for TPC native clusters
306306
//
307-
// selected by output type 'decoded-clusters'
308-
if (isEnabled(OutputType::DecodedClusters)) {
307+
// selected by output type 'clusters'
308+
if (isEnabled(OutputType::Clusters)) {
309309
using MCLabelCollection = std::vector<o2::dataformats::MCTruthContainer<o2::MCCompLabel>>;
310-
specs.push_back(makeWriterSpec("tpc-decoded-cluster-writer",
311-
inputType == InputType::DecodedClusters ? "tpc-filtered-decoded-clusters.root" : "tpc-decoded-clusters.root",
310+
specs.push_back(makeWriterSpec("tpc-native-cluster-writer",
311+
inputType == InputType::Clusters ? "tpc-filtered-native-clusters.root" : "tpc-native-clusters.root",
312312
"tpcrec",
313313
BranchDefinition<const char*>{ InputSpec{ "data", "TPC", "CLUSTERNATIVE", 0 },
314314
"TPCClusterNative",

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
void customize(std::vector<o2::framework::ConfigParamSpec>& workflowOptions)
2828
{
2929
std::vector<o2::framework::ConfigParamSpec> options{
30-
{ "input-type", o2::framework::VariantType::String, "digits", { "digitizer, digits, clusters, raw, decoded-clusters" } },
31-
{ "output-type", o2::framework::VariantType::String, "tracks", { "digits, clusters, raw, decoded-clusters, tracks" } },
30+
{ "input-type", o2::framework::VariantType::String, "digits", { "digitizer, digits, raw, clusters" } },
31+
{ "output-type", o2::framework::VariantType::String, "tracks", { "digits, raw, clusters, tracks" } },
3232
{ "disable-mc", o2::framework::VariantType::Bool, false, { "disable sending of MC information" } },
3333
{ "tpc-sectors", o2::framework::VariantType::String, "0-35", { "TPC sector range, e.g. 5-7,8,9" } },
3434
{ "tpc-lanes", o2::framework::VariantType::Int, 1, { "number of parallel lanes up to the tracker" } },

0 commit comments

Comments
 (0)