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
18#include "MFTTracking/TrackCA.h"
19
24
25using namespace o2::framework;
26using LabelsType = std::vector<o2::MCCompLabel>;
27
28namespace o2
29{
30namespace mft
31{
32
33template <typename T>
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<int>(0);
42 auto tracksSizeGetter = [tracksSize](std::vector<o2::mft::TrackMFT> const& tracks) {
43 *tracksSize = tracks.size();
44 };
45 auto logger = [tracksSize](std::vector<o2::itsmft::ROFRecord> const& rofs) {
46 LOG(info) << "MFTTrackWriter pulled " << *tracksSize << " tracks, in " << rofs.size() << " RO frames";
47 };
48 return MakeRootTreeWriterSpec("mft-track-writer",
49 "mfttracks.root",
50 MakeRootTreeWriterSpec::TreeAttributes{"o2sim", "Tree with MFT tracks"},
52 "MFTTrack",
53 tracksSizeGetter},
54 BranchDefinition<std::vector<int>>{InputSpec{"trackClIdx", "MFT", "TRACKCLSID", 0},
55 "MFTTrackClusIdx"},
56 BranchDefinition<std::vector<o2::itsmft::ROFRecord>>{InputSpec{"ROframes", "MFT", "MFTTrackROF", 0},
57 "MFTTracksROF",
58 logger},
59 BranchDefinition<LabelsType>{InputSpec{"labels", "MFT", "TRACKSMCTR", 0},
60 "MFTTrackMCTruth",
61 (useMC ? 1 : 0), // one branch if mc labels enabled
62 ""})();
63}
64
65} // namespace mft
66} // namespace o2
std::vector< o2::MCCompLabel > LabelsType
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.
Standalone classes for the track found by the Linear-Track-Finder (LTF) and by the Cellular-Automaton...
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
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"