Project
Loading...
Searching...
No Matches
TrackWriterSpec.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
13
14#include <vector>
15
20
21using namespace o2::framework;
22
23namespace o2
24{
25namespace trk
26{
27
28template <typename T>
30using LabelsType = std::vector<o2::MCCompLabel>;
31using namespace o2::header;
32
34{
35 // Spectators for logging
36 auto tracksSize = std::make_shared<int>(0);
37 auto tracksSizeGetter = [tracksSize](std::vector<o2::its::TrackITS> const& tracks) {
38 *tracksSize = tracks.size();
39 };
40 auto logger = [tracksSize]() {
41 LOG(info) << "TRKTrackWriter pulled " << *tracksSize << " tracks";
42 };
43
44 return MakeRootTreeWriterSpec("trk-track-writer",
45 "o2trac_trk.root",
46 MakeRootTreeWriterSpec::TreeAttributes{"o2sim", "Tree with TRK tracks"},
48 "TRKTrack",
49 tracksSizeGetter},
50 BranchDefinition<LabelsType>{InputSpec{"labels", "TRK", "TRACKSMCTR", 0},
51 "TRKTrackMCTruth",
52 (useMC ? 1 : 0), // one branch if mc labels enabled
53 ""})();
54}
55
56} // namespace trk
57} // namespace o2
Configurable generator for RootTreeWriter processor spec.
Definition of the ITS track.
Generate a processor spec for the RootTreeWriter utility.
Defining PrimaryVertex explicitly as messageable.
O2 data header classes and API, v0.1.
Definition DetID.h:49
std::vector< o2::MCCompLabel > LabelsType
o2::framework::DataProcessorSpec getTrackWriterSpec(bool useMC)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"