Project
Loading...
Searching...
No Matches
TrackWriterSpec.cxx
Go to the documentation of this file.
1// Copyright 2019-2026 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
23
24using namespace o2::framework;
25
26namespace o2
27{
28namespace its
29{
30
31template <typename T>
33using LabelsType = std::vector<o2::MCCompLabel>;
34using ROFRecLblT = std::vector<o2::itsmft::MC2ROFRecord>;
35using namespace o2::header;
36
38{
39 // Spectators for logging
40 // this is only to restore the original behavior
41 auto tracksSize = std::make_shared<size_t>(0);
42 auto tracksSizeGetter = [tracksSize](std::vector<o2::its::TrackITS> const& tracks) {
43 *tracksSize = tracks.size();
44 };
45 auto logger = [tracksSize](std::vector<o2::itsmft::ROFRecord> const& rofs) {
46 LOG(info) << "ITSTrackWriter pulled " << *tracksSize << " tracks, in " << rofs.size() << " RO frames";
47 };
48 return MakeRootTreeWriterSpec("its-track-writer",
49 "o2trac_its.root",
50 MakeRootTreeWriterSpec::TreeAttributes{"o2sim", "Tree with ITS tracks"},
52 "ITSTrack",
53 tracksSizeGetter},
54 BranchDefinition<std::vector<int>>{InputSpec{"trackClIdx", "ITS", "TRACKCLSID", 0},
55 "ITSTrackClusIdx"},
56 BranchDefinition<std::vector<Vertex>>{InputSpec{"vertices", "ITS", "VERTICES", 0},
57 "Vertices"},
58 BranchDefinition<std::vector<o2::itsmft::ROFRecord>>{InputSpec{"ROframes", "ITS", "ITSTrackROF", 0},
59 "ITSTracksROF",
60 logger},
61 BranchDefinition<std::vector<o2::itsmft::ROFRecord>>{InputSpec{"vtxROF", "ITS", "VERTICESROF", 0},
62 "VerticesROF"},
63 BranchDefinition<LabelsType>{InputSpec{"labels", "ITS", "TRACKSMCTR", 0},
64 "ITSTrackMCTruth",
65 (useMC ? 1 : 0), // one branch if mc labels enabled
66 ""},
67 BranchDefinition<LabelsType>{InputSpec{"labelsVertices", "ITS", "VERTICESMCTR", 0},
68 "ITSVertexMCTruth",
69 (useMC ? 1 : 0), // one branch if mc labels enabled
70 ""},
71 BranchDefinition<std::vector<float>>{InputSpec{"purityVertices", "ITS", "VERTICESMCPUR", 0},
72 "ITSVertexMCPurity", (useMC ? 1 : 0), // one branch if mc labels enabled
73 ""})();
74}
75
76} // namespace its
77} // namespace o2
Definition of the ITSMFT ROFrame (trigger) record.
Definition of a container to keep Monte Carlo truth external to simulation objects.
Configurable generator for RootTreeWriter processor spec.
Definition of the ITS track.
Generate a processor spec for the RootTreeWriter utility.
Defining ITS Vertex explicitly as messageable.
Definition Cartesian.h:288
O2 data header classes and API, v0.1.
Definition DetID.h:49
std::vector< o2::MCCompLabel > LabelsType
std::vector< o2::itsmft::MC2ROFRecord > ROFRecLblT
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"