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
12
#include "
DPLUtils/MakeRootTreeWriterSpec.h
"
13
#include "
Framework/WorkflowSpec.h
"
14
#include "
Framework/ConfigParamSpec.h
"
15
#include "
TPCWorkflow/LaserTrackFilterSpec.h
"
16
#include "
DataFormatsTPC/TrackTPC.h
"
17
18
using namespace
o2::framework
;
19
using namespace
o2::tpc
;
20
21
template
<
typename
T>
22
using
BranchDefinition
=
MakeRootTreeWriterSpec::BranchDefinition<T>
;
23
24
// we need to add workflow options before including Framework/runDataProcessing
25
void
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
}
33
#include "
Framework/runDataProcessing.h
"
34
35
WorkflowSpec
defineDataProcessing
(
ConfigContext
const
& config)
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
}
ConfigParamSpec.h
LaserTrackFilterSpec.h
Device to filter out laser tracks.
MakeRootTreeWriterSpec.h
Configurable generator for RootTreeWriter processor spec.
TrackTPC.h
WorkflowSpec.h
o2::framework::ConfigContext
Definition
ConfigContext.h:24
o2::framework::ConfigContext::options
ConfigParamRegistry & options() const
Definition
ConfigContext.h:28
o2::framework::ConfigParamRegistry::get
T get(const char *key) const
Definition
ConfigParamRegistry.h:98
o2::framework::MakeRootTreeWriterSpec
Generate a processor spec for the RootTreeWriter utility.
Definition
MakeRootTreeWriterSpec.h:196
o2::framework
Defining PrimaryVertex explicitly as messageable.
Definition
TFIDInfo.h:20
o2::framework::WorkflowSpec
std::vector< DataProcessorSpec > WorkflowSpec
Definition
HBFUtilsInitializer.h:39
o2::tpc
Global TPC definitions and constants.
Definition
SimTraits.h:167
o2::tpc::getLaserTrackFilter
DataProcessorSpec getLaserTrackFilter()
Definition
LaserTrackFilterSpec.cxx:90
runDataProcessing.h
o2::framework::InputSpec
Definition
InputSpec.h:31
o2::framework::MakeRootTreeWriterSpec::BranchDefinition
Definition
MakeRootTreeWriterSpec.h:273
o2::framework::RootTreeWriter::BranchDef< T, InputSpec, KeyExtractor >::Spectator
std::function< void(T const &)> Spectator
Definition
RootTreeWriter.h:197
LOG
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"
defineDataProcessing
WorkflowSpec defineDataProcessing(ConfigContext const &config)
This function hooks up the the workflow specifications into the DPL driver.
Definition
tpc-laser-track-filter.cxx:35
customize
void customize(std::vector< ConfigParamSpec > &workflowOptions)
Definition
tpc-laser-track-filter.cxx:25
Detectors
TPC
workflow
src
tpc-laser-track-filter.cxx
Generated on Tue Feb 25 2025 23:16:31 for Project by
1.9.8