Project
Loading...
Searching...
No Matches
GlobalFwdTrackWriterSpec.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>
21
22using namespace o2::framework;
23
24namespace o2
25{
26namespace globaltracking
27{
28
29template <typename T>
31using TracksType = std::vector<o2::dataformats::GlobalFwdTrack>;
32using FwdTracksType = std::vector<o2::track::TrackParCovFwd>;
33using MFTTracksType = std::vector<o2::mft::TrackMFT>;
34using MatchesType = std::vector<o2::dataformats::MatchInfoFwd>;
35using LabelsType = std::vector<o2::MCCompLabel>;
36
38{
39 const auto& matchingParam = GlobalFwdMatchingParam::Instance();
40 if (matchingParam.saveMode != kSaveTrainingData) {
41 // A spectator for logging
42 auto logger = [](TracksType const& tracks) {
43 LOG(info) << "Writing " << tracks.size() << " GlobalForward Tracks";
44 };
45 return MakeRootTreeWriterSpec("globalfwd-track-writer",
46 "globalfwdtracks.root",
47 "GlobalFwdTracks",
48 BranchDefinition<TracksType>{InputSpec{"fwdtracks", "GLO", "GLFWD", 0}, "fwdtracks", logger},
49 BranchDefinition<LabelsType>{InputSpec{"labels", "GLO", "GLFWD_MC", 0}, "MCTruth", (useMC ? 1 : 0), ""})();
50 } else {
51 // A spectator for logging
52 auto logger = [](MFTTracksType const& tracks) {
53 LOG(info) << "Writing " << tracks.size() << " MFT and MCH track parameters at matching plane";
54 };
55 return MakeRootTreeWriterSpec("globalfwd-track-writer",
56 "globalfwdparamsatmatchingplane.root",
57 "MatchingPlaneParams",
58 BranchDefinition<MFTTracksType>{InputSpec{"mfttracks", "GLO", "GLFWDMFT", 0}, "mfttracks", logger},
59 BranchDefinition<FwdTracksType>{InputSpec{"mchtracks", "GLO", "GLFWDMCH", 0}, "mchtracks"},
60 BranchDefinition<MatchesType>{InputSpec{"matchinfo", "GLO", "GLFWDINF", 0}, "matchinfo"},
61 BranchDefinition<LabelsType>{InputSpec{"labels", "GLO", "GLFWD_MC", 0}, "MCTruth", (useMC ? 1 : 0), ""})();
62 }
63}
64
65} // namespace globaltracking
66} // namespace o2
Global Forward Muon tracks.
Configurable generator for RootTreeWriter processor spec.
Generate a processor spec for the RootTreeWriter utility.
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
std::vector< o2::track::TrackParCovFwd > FwdTracksType
framework::DataProcessorSpec getGlobalFwdTrackWriterSpec(bool useMC)
std::vector< o2::dataformats::GlobalFwdTrack > TracksType
std::vector< o2::mft::TrackMFT > MFTTracksType
std::vector< o2::dataformats::MatchInfoFwd > MatchesType
std::vector< o2::MCCompLabel > LabelsType
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"