Project
Loading...
Searching...
No Matches
MFTCATrackWriterSpec.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
12#include <vector>
13
16#include "MFTTracking/TrackCA.h"
17
22
23using namespace o2::framework;
24using LabelsType = std::vector<o2::MCCompLabel>;
25
26namespace o2
27{
28namespace mft
29{
30
31template <typename T>
33using namespace o2::header;
34
36{
37 // Spectators for logging
38 // this is only to restore the original behavior
39 auto tracksSize = std::make_shared<int>(0);
40 auto tracksSizeGetter = [tracksSize](std::vector<o2::mft::TrackMFT> const& tracks) {
41 *tracksSize = tracks.size();
42 };
43 auto logger = [tracksSize](std::vector<o2::itsmft::ROFRecord> const& rofs) {
44 LOG(info) << "MFTTrackWriter pulled " << *tracksSize << " tracks, in " << rofs.size() << " RO frames";
45 };
46 return MakeRootTreeWriterSpec("mft-track-writer",
47 "mfttracks.root",
48 MakeRootTreeWriterSpec::TreeAttributes{"o2sim", "Tree with MFT tracks"},
50 "MFTTrack",
51 tracksSizeGetter},
52 BranchDefinition<std::vector<int>>{InputSpec{"trackClIdx", "MFT", "TRACKCLSID", 0},
53 "MFTTrackClusIdx"},
54 BranchDefinition<std::vector<uint16_t>>{InputSpec{"trackSeedPat", "MFT", "TRACKSEEDPAT", 0},
55 "MFTTrackSeedPattern",
56 (useCA ? 1 : 0),
57 ""},
58 BranchDefinition<std::vector<o2::itsmft::ROFRecord>>{InputSpec{"ROframes", "MFT", "MFTTrackROF", 0},
59 "MFTTracksROF",
60 logger},
61 BranchDefinition<LabelsType>{InputSpec{"labels", "MFT", "TRACKSMCTR", 0},
62 "MFTTrackMCTruth",
63 (useMC ? 1 : 0), // one branch if mc labels enabled
64 ""})();
65}
66
67} // namespace mft
68} // namespace o2
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.
std::vector< o2::MCCompLabel > LabelsType
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:51
o2::framework::DataProcessorSpec getTrackWriterSpec(bool useMC, bool useCA=false)
Write MFT tracks to a ROOT file.
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"