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
23
24using namespace o2::framework;
25
26namespace o2
27{
28namespace its
29{
31
32template <typename T>
34using LabelsType = std::vector<o2::MCCompLabel>;
35using ROFRecLblT = std::vector<o2::itsmft::MC2ROFRecord>;
36using namespace o2::header;
37
39{
40 // Spectators for logging
41 // this is only to restore the original behavior
42 auto tracksSize = std::make_shared<int>(0);
43 auto tracksSizeGetter = [tracksSize](std::vector<o2::its::TrackITS> const& tracks) {
44 *tracksSize = tracks.size();
45 };
46 auto logger = [tracksSize](std::vector<o2::itsmft::ROFRecord> const& rofs) {
47 LOG(info) << "ITSTrackWriter pulled " << *tracksSize << " tracks, in " << rofs.size() << " RO frames";
48 };
49 return MakeRootTreeWriterSpec("its-track-writer",
50 "o2trac_its.root",
51 MakeRootTreeWriterSpec::TreeAttributes{"o2sim", "Tree with ITS tracks"},
53 "ITSTrack",
54 tracksSizeGetter},
55 BranchDefinition<std::vector<int>>{InputSpec{"trackClIdx", "ITS", "TRACKCLSID", 0},
56 "ITSTrackClusIdx"},
57 BranchDefinition<std::vector<Vertex>>{InputSpec{"vertices", "ITS", "VERTICES", 0},
58 "Vertices"},
59 BranchDefinition<std::vector<o2::itsmft::ROFRecord>>{InputSpec{"vtxROF", "ITS", "VERTICESROF", 0},
60 "VerticesROF"},
61 BranchDefinition<std::vector<o2::itsmft::ROFRecord>>{InputSpec{"ROframes", "ITS", "ITSTrackROF", 0},
62 "ITSTracksROF",
63 logger},
64 BranchDefinition<LabelsType>{InputSpec{"labels", "ITS", "TRACKSMCTR", 0},
65 "ITSTrackMCTruth",
66 (useMC ? 1 : 0), // one branch if mc labels enabled
67 ""},
68 BranchDefinition<LabelsType>{InputSpec{"labelsVertices", "ITS", "VERTICESMCTR", 0},
69 "ITSVertexMCTruth",
70 (useMC ? 1 : 0), // one branch if mc labels enabled
71 ""},
72 BranchDefinition<ROFRecLblT>{InputSpec{"MC2ROframes", "ITS", "ITSTrackMC2ROF", 0},
73 "ITSTracksMC2ROF",
74 (useMC ? 1 : 0), // one branch if mc labels enabled
75 ""},
76 BranchDefinition<std::vector<float>>{InputSpec{"purityVertices", "ITS", "VERTICESMCPUR", 0},
77 "ITSVertexMCPurity", (useMC ? 1 : 0), // one branch if mc labels enabled
78 ""})();
79}
80
81} // namespace its
82} // namespace o2
std::vector< o2::MCCompLabel > LabelsType
std::vector< o2::itsmft::MC2ROFRecord > ROFRecLblT
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 PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
O2 data header classes and API, v0.1.
Definition DetID.h:49
o2::dataformats::Vertex< o2::dataformats::TimeStamp< int > > Vertex
Definition ROframe.h:37
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"