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
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
81 static void loadCorrMaps(std::string_view corrMapFile, std::string_view corrMapFileRef = "");
83 };
84
85 struct TrackInfo : public TrackTPC {
86 TrackInfo() = default;
87 TrackInfo(const TrackTPC& track) : TrackTPC(track){};
88 TrackInfo(const TrackInfo&) = default;
89 ~TrackInfo() = default;
90
91 std::vector<ClusterNativeAdd> clusters{};
92
94 };
95
97 enum class ClStorageType {
98 InsideTrack = 0,
100 SeparateTree = 2,
101 SeparateFile = 3,
102 };
103
105 enum class ClUnStorageType {
106 DontStore = 0,
107 SeparateTree = 1,
108 SeparateFile = 2,
109 };
110
111 using ClExcludes = std::vector<int>[MAXSECTOR][MAXGLOBALPADROW];
112
113 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);
114 void finalize();
115 void fillClNativeAdd(ClusterNativeAccess const& clusterIndex, std::vector<ClusterNativeAdd>& clInfos, ClExcludes* excludes = nullptr);
116
117 std::string outputFileName{"filtered-tracks-and-clusters.root"};
118 bool writeTracks{true};
119 bool writeGlobal{false};
120 bool writeMC{false};
123
124 private:
125 std::unique_ptr<o2::utils::TreeStreamRedirector> mTreeDump;
126 std::unique_ptr<o2::utils::TreeStreamRedirector> mTreeDumpClOnly;
127 std::unique_ptr<o2::utils::TreeStreamRedirector> mTreeDumpUnassCl;
128};
129} // namespace o2::tpc
130#endif
Helper class to access correction maps.
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:121
ClUnStorageType
how to store clusters NOT associated to tracks
Definition TrackDump.h:105
bool writeTracks
write global cluster information for quick drawing
Definition TrackDump.h:118
bool writeMC
write MC track information for quick drawing
Definition TrackDump.h:120
ClUnStorageType noTrackClusterType
store unassociated clusters in separate tree
Definition TrackDump.h:122
void fillClNativeAdd(ClusterNativeAccess const &clusterIndex, std::vector< ClusterNativeAdd > &clInfos, ClExcludes *excludes=nullptr)
bool writeGlobal
write global cluster information for quick drawing
Definition TrackDump.h:119
std::vector< int >[MAXSECTOR][MAXGLOBALPADROW] ClExcludes
Definition TrackDump.h:111
std::string outputFileName
Name of the output file with the tree.
Definition TrackDump.h:117
ClStorageType
how to store clusters associated to tracks
Definition TrackDump.h:97
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:167
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 gpu::CorrectionMapsHelper sCorrHelper
Definition TrackDump.h:27
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
TrackInfo(const TrackInfo &)=default
TrackInfo(const TrackTPC &track)
Definition TrackDump.h:87
std::vector< ClusterNativeAdd > clusters
Definition TrackDump.h:91