Project
Loading...
Searching...
No Matches
TrackDump.h
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#ifndef O2_TPC_TrackDump_H_
13#define O2_TPC_TrackDump_H_
14
15#include <Rtypes.h>
16#include <cstdint>
17#include <memory>
18#include <string>
19#include <gsl/span>
20#include <string_view>
21#include <vector>
22
27#include "TPCFastTransformPOD.h"
28
31
32using namespace o2::tpc::constants;
33
34namespace o2::tpc
35{
36
38
41{
42 public:
44 float gx{};
45 float gy{};
46 uint16_t qMax; //< QMax of the cluster
47 uint16_t qTot; //< Total charge of the cluster
48 uint8_t sector = 0;
49 uint8_t padrow = 0;
50
52 };
53
55 ClusterNativeAdd() = default;
57 ~ClusterNativeAdd() = default;
58
59 // float z = 0.f;
60
61 float tgl = 0.f;
62 float snp = 0.f;
63 uint8_t sector = 0;
64 uint8_t padrow = 0;
65
66 // uncorrected values
67 float lx() const;
68 float ly() const;
69 float gx() const;
70 float gy() const;
71 float cpad() const;
72
73 // corrected values
74 float lxc(float vertexTime = 0) const;
75 float lyc(float vertexTime = 0) const;
76 float gxc(float vertexTime = 0) const;
77 float gyc(float vertexTime = 0) const;
78 float zc(float vertexTime = 0) const;
79
80 inline static o2::gpu::aligned_unique_buffer_ptr<o2::gpu::TPCFastTransformPOD> corrMapBuffer; // buffer for owning the correction map in case of update during runtime
81 inline static const o2::gpu::TPCFastTransformPOD* corrMap{nullptr}; // local copy of the correction map for quick access to the transform functions
82 static void loadCorrMaps(std::string_view corrMapFile, std::string_view corrMapFileRef = "");
84 };
85
86 struct TrackInfo : public TrackTPC {
87 TrackInfo() = default;
88 TrackInfo(const TrackTPC& track) : TrackTPC(track) {};
89 TrackInfo(const TrackInfo&) = default;
90 ~TrackInfo() = default;
91
92 std::vector<ClusterNativeAdd> clusters{};
93
95 };
96
98 enum class ClStorageType {
99 InsideTrack = 0,
100 SeparateBranch = 1,
101 SeparateTree = 2,
102 SeparateFile = 3,
103 };
104
106 enum class ClUnStorageType {
107 DontStore = 0,
108 SeparateTree = 1,
109 SeparateFile = 2,
110 };
111
112 using ClExcludes = std::vector<int>[MAXSECTOR][MAXGLOBALPADROW];
113
114 void filter(const gsl::span<const TrackTPC> tracks, ClusterNativeAccess const& clusterIndex, const gsl::span<const o2::tpc::TPCClRefElem> clRefs, const gsl::span<const MCCompLabel> mcLabels);
115 void finalize();
116 void fillClNativeAdd(ClusterNativeAccess const& clusterIndex, std::vector<ClusterNativeAdd>& clInfos, ClExcludes* excludes = nullptr);
117
118 std::string outputFileName{"filtered-tracks-and-clusters.root"};
119 bool writeTracks{true};
120 bool writeGlobal{false};
121 bool writeMC{false};
124
125 private:
126 std::unique_ptr<o2::utils::TreeStreamRedirector> mTreeDump;
127 std::unique_ptr<o2::utils::TreeStreamRedirector> mTreeDumpClOnly;
128 std::unique_ptr<o2::utils::TreeStreamRedirector> mTreeDumpUnassCl;
129};
130} // namespace o2::tpc
131#endif
POD correction map.
The class can be used to dump track and associated clusters to a tree to easily iterate over them and...
Definition TrackDump.h:41
ClStorageType clusterStorageType
instead of storing the clusters with the tracks, store them in a separate tree
Definition TrackDump.h:122
ClUnStorageType
how to store clusters NOT associated to tracks
Definition TrackDump.h:106
bool writeTracks
write global cluster information for quick drawing
Definition TrackDump.h:119
bool writeMC
write MC track information for quick drawing
Definition TrackDump.h:121
ClUnStorageType noTrackClusterType
store unassociated clusters in separate tree
Definition TrackDump.h:123
void fillClNativeAdd(ClusterNativeAccess const &clusterIndex, std::vector< ClusterNativeAdd > &clInfos, ClExcludes *excludes=nullptr)
bool writeGlobal
write global cluster information for quick drawing
Definition TrackDump.h:120
std::vector< int >[MAXSECTOR][MAXGLOBALPADROW] ClExcludes
Definition TrackDump.h:112
std::string outputFileName
Name of the output file with the tree.
Definition TrackDump.h:118
ClStorageType
how to store clusters associated to tracks
Definition TrackDump.h:98
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
Definition glcorearb.h:1308
constexpr int MAXSECTOR
Definition Constants.h:28
constexpr int MAXGLOBALPADROW
Definition Constants.h:34
Global TPC definitions and constants.
Definition SimTraits.h:168
static o2::gpu::aligned_unique_buffer_ptr< o2::gpu::TPCFastTransformPOD > corrMapBuffer
Definition TrackDump.h:80
float gxc(float vertexTime=0) const
float lyc(float vertexTime=0) const
float lxc(float vertexTime=0) const
float zc(float vertexTime=0) const
static void loadCorrMaps(std::string_view corrMapFile, std::string_view corrMapFileRef="")
ClusterNativeAdd(const ClusterNative &cl)
Definition TrackDump.h:56
float gyc(float vertexTime=0) const
static const o2::gpu::TPCFastTransformPOD * corrMap
Definition TrackDump.h:81
TrackInfo(const TrackInfo &)=default
TrackInfo(const TrackTPC &track)
Definition TrackDump.h:88
std::vector< ClusterNativeAdd > clusters
Definition TrackDump.h:92