Skip to content

Commit 468d81d

Browse files
mfasDashahor02
authored andcommitted
[EMCAL-612] Add option to disable decoding errors in cell writer
Needed for converting CTF data into cell trees.
1 parent 2a90b30 commit 468d81d

File tree

3 files changed

+43
-18
lines changed

3 files changed

+43
-18
lines changed

Detectors/EMCAL/workflow/include/EMCALWorkflow/RecoWorkflow.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ framework::WorkflowSpec getWorkflow(bool propagateMC = true,
6060
std::string const& cfgInput = "digits",
6161
std::string const& cfgOutput = "clusters",
6262
bool disableRootInput = false,
63-
bool disableRootOutput = false);
63+
bool disableRootOutput = false,
64+
bool disableDecodingErrors = false);
6465
} // namespace reco_workflow
6566

6667
} // namespace emcal

Detectors/EMCAL/workflow/src/RecoWorkflow.cxx

Lines changed: 38 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ o2::framework::WorkflowSpec getWorkflow(bool propagateMC,
5252
std::string const& cfgInput,
5353
std::string const& cfgOutput,
5454
bool disableRootInput,
55-
bool disableRootOutput)
55+
bool disableRootOutput,
56+
bool disableDecodingErrors)
5657
{
5758

5859
const std::unordered_map<std::string, InputType> InputMap{
@@ -240,14 +241,22 @@ o2::framework::WorkflowSpec getWorkflow(bool propagateMC,
240241
std::move(analysisclusterbranch)));
241242
};
242243

243-
auto makeWriterSpec_CellsTR = [checkReady](const char* processName, const char* defaultFileName, const char* defaultTreeName,
244-
auto&& CellsBranch, auto&& TriggerRecordBranch, auto&& DecoderErrorsBranch) {
244+
auto makeWriterSpec_CellsTR = [disableDecodingErrors, checkReady](const char* processName, const char* defaultFileName, const char* defaultTreeName,
245+
auto&& CellsBranch, auto&& TriggerRecordBranch, auto&& DecoderErrorsBranch) {
245246
return std::move(o2::framework::MakeRootTreeWriterSpec(processName, defaultFileName, defaultTreeName,
246247
o2::framework::MakeRootTreeWriterSpec::TerminationCondition{checkReady},
247248
std::move(CellsBranch),
248249
std::move(TriggerRecordBranch),
249250
std::move(DecoderErrorsBranch)));
250251
};
252+
253+
auto makeWriterSpec_CellsTR_noerrors = [checkReady](const char* processName, const char* defaultFileName, const char* defaultTreeName,
254+
auto&& CellsBranch, auto&& TriggerRecordBranch) {
255+
return std::move(o2::framework::MakeRootTreeWriterSpec(processName, defaultFileName, defaultTreeName,
256+
o2::framework::MakeRootTreeWriterSpec::TerminationCondition{checkReady},
257+
std::move(CellsBranch),
258+
std::move(TriggerRecordBranch)));
259+
};
251260
/*
252261
// RS getting input digits and outputing them under the same outputspec will create dependency loop when piping the workflows
253262
if (isEnabled(OutputType::Digits) && !disableRootOutput) {
@@ -284,19 +293,32 @@ o2::framework::WorkflowSpec getWorkflow(bool propagateMC,
284293
} else {
285294
using CellsDataType = std::vector<o2::emcal::Cell>;
286295
using TriggerRecordDataType = std::vector<o2::emcal::TriggerRecord>;
287-
using DecoderErrorsDataType = std::vector<o2::emcal::ErrorTypeFEE>;
288-
specs.push_back(makeWriterSpec_CellsTR("emcal-cells-writer",
289-
"emccells.root",
290-
"o2sim",
291-
BranchDefinition<CellsDataType>{o2::framework::InputSpec{"data", "EMC", "CELLS", 0},
292-
"EMCALCell",
293-
"cell-branch-name"},
294-
BranchDefinition<TriggerRecordDataType>{o2::framework::InputSpec{"trigger", "EMC", "CELLSTRGR", 0},
295-
"EMCALCellTRGR",
296-
"celltrigger-branch-name"},
297-
BranchDefinition<DecoderErrorsDataType>{o2::framework::InputSpec{"errors", "EMC", "DECODERERR", 0},
298-
"EMCALDECODERERR",
299-
"decodererror-branch-name"})());
296+
if (disableDecodingErrors) {
297+
specs.push_back(makeWriterSpec_CellsTR_noerrors("emcal-cells-writer",
298+
"emccells.root",
299+
"o2sim",
300+
BranchDefinition<CellsDataType>{o2::framework::InputSpec{"data", "EMC", "CELLS", 0},
301+
"EMCALCell",
302+
"cell-branch-name"},
303+
BranchDefinition<TriggerRecordDataType>{o2::framework::InputSpec{"trigger", "EMC", "CELLSTRGR", 0},
304+
"EMCALCellTRGR",
305+
"celltrigger-branch-name"})());
306+
307+
} else {
308+
using DecoderErrorsDataType = std::vector<o2::emcal::ErrorTypeFEE>;
309+
specs.push_back(makeWriterSpec_CellsTR("emcal-cells-writer",
310+
"emccells.root",
311+
"o2sim",
312+
BranchDefinition<CellsDataType>{o2::framework::InputSpec{"data", "EMC", "CELLS", 0},
313+
"EMCALCell",
314+
"cell-branch-name"},
315+
BranchDefinition<TriggerRecordDataType>{o2::framework::InputSpec{"trigger", "EMC", "CELLSTRGR", 0},
316+
"EMCALCellTRGR",
317+
"celltrigger-branch-name"},
318+
BranchDefinition<DecoderErrorsDataType>{o2::framework::InputSpec{"errors", "EMC", "DECODERERR", 0},
319+
"EMCALDECODERERR",
320+
"decodererror-branch-name"})());
321+
}
300322
}
301323
}
302324

Detectors/EMCAL/workflow/src/emc-reco-workflow.cxx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ void customize(std::vector<o2::framework::ConfigParamSpec>& workflowOptions)
3737
{"disable-root-output", o2::framework::VariantType::Bool, false, {"do not initialize root file writers"}},
3838
{"configKeyValues", o2::framework::VariantType::String, "", {"Semicolon separated key=value strings"}},
3939
{"disable-mc", o2::framework::VariantType::Bool, false, {"disable sending of MC information"}},
40+
{"disable-decoding-errors", o2::framework::VariantType::Bool, false, {"disable propagating decoding errors"}},
4041
{"ignore-dist-stf", o2::framework::VariantType::Bool, false, {"do not subscribe to FLP/DISTSUBTIMEFRAME/0 message (no lost TF recovery)"}},
4142
{"subspecification", o2::framework::VariantType::Int, 0, {"Subspecification in case the workflow runs in parallel on multiple nodes (i.e. different FLPs)"}}};
4243

@@ -69,7 +70,8 @@ o2::framework::WorkflowSpec defineDataProcessing(o2::framework::ConfigContext co
6970
cfgc.options().get<std::string>("input-type"),
7071
cfgc.options().get<std::string>("output-type"),
7172
cfgc.options().get<bool>("disable-root-input"),
72-
cfgc.options().get<bool>("disable-root-output"));
73+
cfgc.options().get<bool>("disable-root-output"),
74+
cfgc.options().get<bool>("disable-decoding-errors"));
7375

7476
// configure dpl timer to inject correct firstTFOrbit: start from the 1st orbit of TF containing 1st sampled orbit
7577
o2::raw::HBFUtilsInitializer hbfIni(cfgc, wf);

0 commit comments

Comments
 (0)