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
18
20
21template <typename T>
23
24void customize(std::vector<ConfigParamSpec>& workflowOptions)
25{
26 std::vector<ConfigParamSpec> options{
27 {"enable-writer", VariantType::Bool, false, {"selection string input specs"}},
28 {"use-global-tracks", VariantType::Bool, false, {"use global matched tracks instead of TPC only"}},
29 {"disable-root-input", VariantType::Bool, false, {"disable root-files input reader"}},
30 };
31
32 std::swap(workflowOptions, options);
33}
35
36using namespace o2::framework;
37
39{
40 using namespace o2::tpc;
41
42 const auto useGlobal = config.options().get<bool>("use-global-tracks");
43 WorkflowSpec workflow;
44
45 const auto useMC = false;
46 auto srcTracks = GID::getSourcesMask("TPC");
47 const auto srcCls = GID::getSourcesMask("");
48 if (useGlobal) {
49 srcTracks = GID::getSourcesMask("ITS,TPC,ITS-TPC,ITS-TPC-TRD,ITS-TPC-TOF,ITS-TPC-TRD-TOF");
50 }
51
52 workflow.emplace_back(getMIPTrackFilterSpec(srcTracks));
53
54 if (config.options().get<bool>("enable-writer")) {
55 const char* processName = "tpc-mips-writer";
56 const char* defaultFileName = "tpc-mips.root";
57 const char* defaultTreeName = "tpcrec";
58
59 // branch definitions for RootTreeWriter spec
60 using TrackOutputType = std::vector<o2::tpc::TrackTPC>;
61
62 // a spectator callback which will be invoked by the tree writer with the extracted object
63 // we are using it for printing a log message
64 auto logger = BranchDefinition<TrackOutputType>::Spectator([](TrackOutputType const& tracks) {
65 LOG(info) << "writing " << tracks.size() << " track(s)";
66 });
67 auto tracksdef = BranchDefinition<TrackOutputType>{InputSpec{"inputTracks", "TPC", "MIPS", 0, Lifetime::Sporadic}, //
68 "TPCTracks", "track-branch-name", //
69 1, //
70 logger}; //
71
72 workflow.push_back(MakeRootTreeWriterSpec(processName, defaultFileName, defaultTreeName,
73 std::move(tracksdef))());
74 }
75
76 return workflow;
77}
Global index for barrel track: provides provenance (detectors combination), index in respective array...
Workflow to filter MIP tracks and streams them to other devices.
Configurable generator for RootTreeWriter processor spec.
static mask_t getSourcesMask(const std::string_view srcList)
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)