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