Skip to content

Commit 250eeef

Browse files
committed
Add HBFUtilsInitializer to MCH cl.reader and o2-eve-exporter
1 parent 5d3995d commit 250eeef

2 files changed

Lines changed: 25 additions & 3 deletions

File tree

Detectors/MUON/MCH/Workflow/src/clusters-reader-workflow.cxx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,24 @@
1212
#include <vector>
1313
#include "Framework/ConfigParamSpec.h"
1414
#include "MCHWorkflow/ClusterReaderSpec.h"
15+
#include "DetectorsRaw/HBFUtilsInitializer.h"
16+
#include "Framework/CallbacksPolicy.h"
1517

1618
using namespace o2::framework;
1719

20+
// ------------------------------------------------------------------
21+
void customize(std::vector<o2::framework::CallbacksPolicy>& policies)
22+
{
23+
o2::raw::HBFUtilsInitializer::addNewTimeSliceCallback(policies);
24+
}
25+
1826
// we need to add workflow options before including Framework/runDataProcessing
1927
void customize(std::vector<ConfigParamSpec>& workflowOptions)
2028
{
2129
workflowOptions.emplace_back("enable-mc", VariantType::Bool, false, ConfigParamSpec::HelpString{"Propagate MC info"});
2230
workflowOptions.emplace_back("local", VariantType::Bool, false, ConfigParamSpec::HelpString{"Read clusters in local reference frame"});
2331
workflowOptions.emplace_back("digits", VariantType::Bool, false, ConfigParamSpec::HelpString{"Read the associated digits"});
32+
o2::raw::HBFUtilsInitializer::addConfigOption(workflowOptions);
2433
}
2534

2635
#include "Framework/runDataProcessing.h"
@@ -30,5 +39,7 @@ WorkflowSpec defineDataProcessing(const ConfigContext& config)
3039
bool useMC = config.options().get<bool>("enable-mc");
3140
bool global = !config.options().get<bool>("local");
3241
bool digits = config.options().get<bool>("digits");
33-
return WorkflowSpec{o2::mch::getClusterReaderSpec(useMC, "mch-cluster-reader", global, digits)};
42+
WorkflowSpec wf{o2::mch::getClusterReaderSpec(useMC, "mch-cluster-reader", global, digits)};
43+
o2::raw::HBFUtilsInitializer hbfIni(config, wf);
44+
return wf;
3445
}

EventVisualisation/Workflow/src/O2DPLDisplay.cxx

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
/// \file
1313
/// \author Julian Myrcha
1414

15+
#include "DetectorsRaw/HBFUtilsInitializer.h"
16+
#include "Framework/CallbacksPolicy.h"
17+
#include "Framework/CompletionPolicyHelpers.h"
1518
#include "EveWorkflow/O2DPLDisplay.h"
1619
#include "EveWorkflow/EveWorkflowHelper.h"
1720
#include "EventVisualisationBase/ConfigurationManager.h"
@@ -38,6 +41,12 @@ using namespace o2::globaltracking;
3841
using namespace o2::tpc;
3942
using namespace o2::trd;
4043

44+
// ------------------------------------------------------------------
45+
void customize(std::vector<o2::framework::CallbacksPolicy>& policies)
46+
{
47+
o2::raw::HBFUtilsInitializer::addNewTimeSliceCallback(policies);
48+
}
49+
4150
void customize(std::vector<ConfigParamSpec>& workflowOptions)
4251
{
4352
std::vector<o2::framework::ConfigParamSpec> options{
@@ -63,7 +72,7 @@ void customize(std::vector<ConfigParamSpec>& workflowOptions)
6372
{"only-nth-event", VariantType::Int, 0, {"process only every nth event"}},
6473
{"primary-vertex-mode", VariantType::Bool, false, {"produce jsons with individual primary vertices, not total time frame data"}},
6574
};
66-
75+
o2::raw::HBFUtilsInitializer::addConfigOption(options);
6776
std::swap(workflowOptions, options);
6877
}
6978

@@ -284,7 +293,6 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
284293
if (primaryVertexMode) {
285294
dataRequest->requestPrimaryVertertices(useMC);
286295
}
287-
288296
InputHelper::addInputSpecs(cfgc, specs, srcCl, srcTrk, srcTrk, useMC);
289297

290298
auto minITSTracks = cfgc.options().get<int>("min-its-tracks");
@@ -302,5 +310,8 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
302310
{},
303311
AlgorithmSpec{adaptFromTask<O2DPLDisplaySpec>(useMC, srcTrk, srcCl, dataRequest, jsonFolder, timeInterval, numberOfFiles, numberOfTracks, eveHostNameMatch, minITSTracks, minTracks, filterITSROF, filterTime, timeBracket, removeTPCEta, etaBracket, tracksSorting, onlyNthEvent, primaryVertexMode)}});
304312

313+
// configure dpl timer to inject correct firstTFOrbit: start from the 1st orbit of TF containing 1st sampled orbit
314+
o2::raw::HBFUtilsInitializer hbfIni(cfgc, specs);
315+
305316
return std::move(specs);
306317
}

0 commit comments

Comments
 (0)