Project
Loading...
Searching...
No Matches
tpc-miptrack-filter.cxx
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
16
17template <typename T>
19
20void customize(std::vector<ConfigParamSpec>& workflowOptions)
21{
22 std::vector<ConfigParamSpec> options{
23 {"enable-writer", VariantType::Bool, false, {"selection string input specs"}},
24 };
25
26 std::swap(workflowOptions, options);
27}
29
30using namespace o2::framework;
31
33{
34 using namespace o2::tpc;
35
36 WorkflowSpec workflow;
37 workflow.emplace_back(getMIPTrackFilterSpec());
38
39 if (config.options().get<bool>("enable-writer")) {
40 const char* processName = "tpc-mips-writer";
41 const char* defaultFileName = "tpc-mips.root";
42 const char* defaultTreeName = "tpcrec";
43
44 // branch definitions for RootTreeWriter spec
45 using TrackOutputType = std::vector<o2::tpc::TrackTPC>;
46
47 // a spectator callback which will be invoked by the tree writer with the extracted object
48 // we are using it for printing a log message
49 auto logger = BranchDefinition<TrackOutputType>::Spectator([](TrackOutputType const& tracks) {
50 LOG(info) << "writing " << tracks.size() << " track(s)";
51 });
52 auto tracksdef = BranchDefinition<TrackOutputType>{InputSpec{"inputTracks", "TPC", "MIPS", 0, Lifetime::Sporadic}, //
53 "TPCTracks", "track-branch-name", //
54 1, //
55 logger}; //
56
57 workflow.push_back(MakeRootTreeWriterSpec(processName, defaultFileName, defaultTreeName,
58 std::move(tracksdef))());
59 }
60
61 return workflow;
62}
Workflow to filter MIP tracks and streams them to other devices.
Configurable generator for RootTreeWriter processor spec.
ConfigParamRegistry & options() const
Generate a processor spec for the RootTreeWriter utility.
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
std::vector< DataProcessorSpec > WorkflowSpec
Global TPC definitions and constants.
Definition SimTraits.h:167
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"
WorkflowSpec defineDataProcessing(ConfigContext const &config)
This function hooks up the the workflow specifications into the DPL driver.
void customize(std::vector< ConfigParamSpec > &workflowOptions)