Project
Loading...
Searching...
No Matches
VisualisationTrack.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
18
19#ifndef ALICE_O2_EVENTVISUALISATION_BASE_VISUALISATIONTRACK_H
20#define ALICE_O2_EVENTVISUALISATION_BASE_VISUALISATIONTRACK_H
21
23#include "ConversionConstants.h"
25#include "rapidjson/document.h"
26
27#include <iosfwd>
28#include <string>
29#include <vector>
30#include <array>
31#include <cmath>
32#include <gsl/span>
33
34namespace o2
35{
36namespace event_visualisation
37{
38
44
46{
50
51 public:
52 // Default constructor
54
60 float time = 0;
61 int charge = 0;
62 int PID = 0;
63 float startXYZ[3];
64 float phi = 0;
65 float theta = 0;
66 float eta = 0;
68 };
69 // Constructor with properties initialisation
70 explicit VisualisationTrack(const VisualisationTrackVO& vo);
71
73
74 // Add child particle (coming from decay of this particle)
75 void addChild(int childID);
76 // Add xyz coordinates of the point along the track
77 void addPolyPoint(float x, float y, float z);
78 void addPolyPoint(const float p[]);
79 // Time getter
80 [[nodiscard]] float getTime() const { return mTime; }
81 // Charge getter
82 int getCharge() const { return mCharge; }
83 // PID (particle identification code) getter
84 int getPID() const { return mPID; }
85 // GID getter
86 std::string getGIDAsString() const { return mBGID.asString(); }
87 // Source Getter
88 [[nodiscard]] o2::dataformats::GlobalTrackID::Source getSource() const { return static_cast<o2::dataformats::GlobalTrackID::Source>(mBGID.getSource()); }
89 // Phi getter
90 [[nodiscard]] float getPhi() const { return mPhi; }
91 // Theta getter
92 float getTheta() const { return mTheta; }
93 //
94 const float* getStartCoordinates() const { return mStartCoordinates; }
95
96 size_t getPointCount() const { return mPolyX.size(); }
97 std::array<float, 3> getPoint(size_t i) const { return std::array<float, 3>{mPolyX[i], mPolyY[i], mPolyZ[i]}; }
98
99 VisualisationCluster& addCluster(const float pos[]);
100 const VisualisationCluster& getCluster(int i) const { return mClusters[i]; };
101 size_t getClusterCount() const { return mClusters.size(); } // Returns number of clusters
102 gsl::span<const VisualisationCluster> getClustersSpan() const
103 {
104 return mClusters;
105 }
106
107 private:
108 // Set coordinates of the beginning of the track
109 void addStartCoordinates(const float xyz[3]);
110
111 float mTime;
112 int mCharge;
113
114 int mPID;
115 // std::string mGID_obsolete; /// String representation of gid (obsolete)
116 o2::dataformats::GlobalTrackID mBGID; // binary representation of gid
117
118 float mStartCoordinates[3];
119
120 float mTheta;
121 float mPhi;
122 float mEta;
123
124 // std::vector<int> mChildrenIDs; /// Uniqe IDs of children particles
125 // o2::dataformats::GlobalTrackID::Source mSource; /// data source of the track (debug)
126
128 std::vector<float> mPolyX;
129 std::vector<float> mPolyY;
130 std::vector<float> mPolyZ;
131
132 std::vector<VisualisationCluster> mClusters;
133};
134
135} // namespace event_visualisation
136} // namespace o2
137#endif // ALICE_O2_EVENTVISUALISATION_BASE_VISUALISATIONTRACK_H
int32_t i
Global index for barrel track: provides provenance (detectors combination), index in respective array...
uint16_t pos
Definition RawData.h:3
std::array< float, 3 > getPoint(size_t i) const
o2::dataformats::GlobalTrackID::Source getSource() const
VisualisationCluster & addCluster(const float pos[])
gsl::span< const VisualisationCluster > getClustersSpan() const
const VisualisationCluster & getCluster(int i) const
void addPolyPoint(float x, float y, float z)
GLint GLenum GLint x
Definition glcorearb.h:403
GLenum src
Definition glcorearb.h:1767
GLdouble GLdouble GLdouble z
Definition glcorearb.h:843
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...