Project
Loading...
Searching...
No Matches
tpc-laser-track-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
17
18using namespace o2::framework;
19using namespace o2::tpc;
20
21template <typename T>
23
24// we need to add workflow options before including Framework/runDataProcessing
25void customize(std::vector<ConfigParamSpec>& workflowOptions)
26{
27 std::vector<ConfigParamSpec> options{
28 {"enable-writer", VariantType::Bool, false, {"selection string input specs"}},
29 };
30
31 std::swap(workflowOptions, options);
32}
34
36{
37
38 using namespace o2::tpc;
39
40 WorkflowSpec workflow;
41 workflow.emplace_back(getLaserTrackFilter());
42
43 if (config.options().get<bool>("enable-writer")) {
44 const char* processName = "tpc-laser-track-writer";
45 const char* defaultFileName = "tpc-laser-tracks.root";
46 const char* defaultTreeName = "tpcrec";
47
48 // branch definitions for RootTreeWriter spec
49 using TrackOutputType = std::vector<o2::tpc::TrackTPC>;
50
51 // a spectator callback which will be invoked by the tree writer with the extracted object
52 // we are using it for printing a log message
53 auto logger = BranchDefinition<TrackOutputType>::Spectator([](TrackOutputType const& tracks) {
54 LOG(info) << "writing " << tracks.size() << " track(s)";
55 });
56 auto tracksdef = BranchDefinition<TrackOutputType>{InputSpec{"inputTracks", "TPC", "LASERTRACKS", 0}, //
57 "TPCTracks", "track-branch-name", //
58 1, //
59 logger}; //
60
61 workflow.push_back(MakeRootTreeWriterSpec(processName, defaultFileName, defaultTreeName,
62 std::move(tracksdef))());
63 }
64
65 return workflow;
66}
Device to filter out laser tracks.
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
DataProcessorSpec getLaserTrackFilter()
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)