Skip to content

Commit 97cd824

Browse files
mfasDashahor02
authored andcommitted
[EMCAL-612] Make workflow name optional for cell writer
Needed in order to run different cell writers in parallel. As default the current workflow name is used so the standard behaviour is unchanged.
1 parent ecaa240 commit 97cd824

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

Detectors/EMCAL/workflow/src/cell-writer-workflow.cxx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ using namespace o2::emcal;
2727
// we need to add workflow options before including Framework/runDataProcessing
2828
void customize(std::vector<ConfigParamSpec>& workflowOptions)
2929
{
30-
std::vector<ConfigParamSpec> options{{"disable-mc", VariantType::Bool, false, {"Do not propagate MC labels"}},
30+
std::vector<ConfigParamSpec> options{{"cell-writer-name", VariantType::String, "emcal-cells-writer", {"Workflow name"}},
31+
{"disable-mc", VariantType::Bool, false, {"Do not propagate MC labels"}},
3132
{"subspec", VariantType::UInt32, 0U, {"Input subspecification"}},
3233
{"configKeyValues", VariantType::String, "", {"Semicolon separated key=value strings"}}};
3334
workflowOptions.insert(workflowOptions.end(), options.begin(), options.end());
@@ -45,10 +46,11 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
4546
{
4647
bool disableMC = cfgc.options().get<bool>("disable-mc");
4748
auto subspec = cfgc.options().get<uint32_t>("subspec");
49+
auto workflowname = cfgc.options().get<std::string>("cell-writer-name");
4850
o2::conf::ConfigurableParam::updateFromString(cfgc.options().get<std::string>("configKeyValues"));
4951

5052
WorkflowSpec specs;
51-
specs.emplace_back(MakeRootTreeWriterSpec("emcal-cells-writer", "emccells.root", "o2sim",
53+
specs.emplace_back(MakeRootTreeWriterSpec(workflowname.data(), "emccells.root", "o2sim",
5254
MakeRootTreeWriterSpec::BranchDefinition<std::vector<Cell>>{InputSpec{"data", "EMC", "CELLS", subspec}, "EMCALCell", "cell-branch-name"},
5355
MakeRootTreeWriterSpec::BranchDefinition<std::vector<TriggerRecord>>{InputSpec{"trigger", "EMC", "CELLSTRGR", subspec}, "EMCALCellTRGR", "celltrigger-branch-name"},
5456
MakeRootTreeWriterSpec::BranchDefinition<o2::dataformats::MCTruthContainer<MCLabel>>{InputSpec{"mc", "EMC", "CELLSMCTR", subspec}, "EMCALCellMCTruth", "cellmc-branch-name", disableMC ? 0 : 1})());

0 commit comments

Comments
 (0)