Project
Loading...
Searching...
No Matches
ITSCATrackWriterSpec.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
21
22using namespace o2::framework;
23
24namespace o2::its::ca
25{
26
27template <typename T>
29using LabelsType = std::vector<o2::MCCompLabel>;
30
32{
33 // Spectators for logging; mirrors ITSWorkflow/TrackWriterSpec.cxx.
34 auto tracksSize = std::make_shared<size_t>(0);
35 auto tracksSizeGetter = [tracksSize](std::vector<o2::its::TrackITS> const& tracks) {
36 *tracksSize = tracks.size();
37 };
38 auto logger = [tracksSize](std::vector<o2::itsmft::ROFRecord> const& rofs) {
39 LOG(info) << "ITSCATrackWriter pulled " << *tracksSize << " tracks, in " << rofs.size() << " RO frames";
40 };
41 // Deliberately no VERTICES/VERTICESROF/VERTICESMCTR/VERTICESMCPUR branch:
42 // this opt-in tracker-only workflow never publishes those OutputSpecs (see
43 // CATrackerSpec.cxx), so a writer branch consuming them would simply never
44 // fire.
45 return MakeRootTreeWriterSpec("its-ca-track-writer",
46 "o2trac_its_ca.root",
47 MakeRootTreeWriterSpec::TreeAttributes{"o2sim", "Tree with ITS common-CA tracks"},
49 "ITSTrack",
50 tracksSizeGetter},
51 BranchDefinition<std::vector<int>>{InputSpec{"trackClIdx", "ITS", "TRACKCLSID", 0},
52 "ITSTrackClusIdx"},
53 BranchDefinition<std::vector<o2::itsmft::ROFRecord>>{InputSpec{"ROframes", "ITS", "ITSTrackROF", 0},
54 "ITSTracksROF",
55 logger},
56 BranchDefinition<LabelsType>{InputSpec{"labels", "ITS", "TRACKSMCTR", 0},
57 "ITSTrackMCTruth",
58 (useMC ? 1 : 0), // one branch if mc labels enabled
59 ""})();
60}
61
62} // namespace o2::its::ca
Vertex-free ITS common-CA track writer. Writes a distinct file (o2trac_its_ca.root) with no vertex br...
Definition of the ITSMFT ROFrame (trigger) record.
std::vector< o2::its::TrackITS > tracks
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
std::vector< o2::MCCompLabel > LabelsType
o2::framework::DataProcessorSpec getTrackWriterSpec(bool useMC)
Write ITS CA tracks to o2trac_its_ca.root without vertex branches.
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"