Project
Loading...
Searching...
No Matches
MatchInfoHMP.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
14
15#ifndef ALICEO2_MATCHINFOHMP_H
16#define ALICEO2_MATCHINFOHMP_H
17
21
22namespace o2
23{
24namespace dataformats
25{
27{
29
30 public:
31 MatchInfoHMP(int idxHMPClus, GTrackID idxTrack, float xmip = 0, float ymip = 0, float xtrk = 0, float ytrk = 0, float theta = 0, float phi = 0, float angle = 0, float size = 0, int idxPhotClus = 0, int hmpqn = 0, float hmpMom = 0) : mIdxHMPClus(idxHMPClus), mIdxTrack(idxTrack), mCkovAngle(angle), mMipX(xmip), mMipY(ymip), mTrkX(xtrk), mTrkY(ytrk), mTrkTheta(theta), mTrkPhi(phi), mMipCluSize(size), mIdxPhotClus(idxPhotClus), mHMPqn(hmpqn), mHmpMom(hmpMom)
32 { // Initialize the mPhotCharge array
33 for (int i = 0; i < 10; i++) {
34 mPhotCharge[i] = 0.0;
35 }
36 };
37 MatchInfoHMP() = default;
38
39 void setIdxHMPClus(int ch, int idx) { mIdxHMPClus = ch * 1000000 + idx; }
40 int getIdxHMPClus() const { return mIdxHMPClus; }
41
42 void setIdxTrack(GTrackID index) { mIdxTrack = index; }
43 int getTrackIndex() const { return mIdxTrack.getIndex(); }
44
45 GTrackID getTrackRef() const { return mIdxTrack; }
46
47 void setMipX(float x) { mMipX = x; }
48 float getMipX() const { return mMipX; }
49
50 void setMipY(float y) { mMipY = y; }
51 float getMipY() const { return mMipY; }
52
53 void setTrkX(float x) { mTrkX = x; }
54 float getTrkX() const { return mTrkX; }
55
56 void setTrkY(float y) { mTrkY = y; }
57 float getTrkY() const { return mTrkY; }
58
59 void setHMPsignal(float angle) { mCkovAngle = angle; }
60 float getHMPsignal() const
61 {
62 if (mCkovAngle > 0) {
63 return mCkovAngle - (Int_t)mCkovAngle;
64 } else {
65 return mCkovAngle;
66 }
67 }
68
69 void setMipClusSize(int size) { mMipCluSize = size; }
70 int getMipClusSize() const { return mMipCluSize; }
71
72 void setNPhots(int n) { mNPhots = n; }
73 int getNPhots() const { return mNPhots; }
74
75 void setPhotIndex(int idx) { mIdxPhotClus = idx; }
76 int getPhotIndex() const { return mIdxPhotClus; }
77
78 float getOccupancy() const { return (Int_t)mCkovAngle / 10.0; }
79
80 void setHMPIDtrk(float x, float y, float th, float ph)
81 {
82 mTrkX = x;
83 mTrkY = y;
84 mTrkTheta = th;
85 mTrkPhi = ph;
86 }
87
88 void getHMPIDtrk(float& x, float& y, float& th, float& ph) const
89 {
90 x = mTrkX;
91 y = mTrkY;
92 th = mTrkTheta;
93 ph = mTrkPhi;
94 }
95
96 void setHMPIDmip(float x, float y, int q, int nph = 0)
97 {
98 mMipX = x;
99 mMipY = y;
100 mHMPqn = 1000000 * nph + q;
101 }
102
103 void getHMPIDmip(float& x, float& y, int& q, int& nph) const
104 {
105 x = mMipX;
106 y = mMipY;
107 q = mHMPqn % 1000000;
108 nph = mHMPqn / 1000000;
109 }
110
111 void setHmpMom(float p) { mHmpMom = p; }
112 float getHmpMom() const { return mHmpMom; }
113
114 void setPhotCharge(float* chargeArray)
115 {
116 for (int i = 0; i < 10; i++) {
117 mPhotCharge[i] = chargeArray[i];
118 }
119 }
120
121 const float* getPhotCharge() const { return mPhotCharge; }
122
123 void print() const;
124
125 private:
126 int mIdxHMPClus; // Idx for HMP cluster
127 GTrackID mIdxTrack; // Idx for track
128 float mMipX; // local x coordinate of macthed cluster
129 float mMipY; // local y coordinate of macthed cluster
130 float mTrkX; // local x coordinate of extrapolated track intersection point
131 float mTrkY; // local y coordinate of extrapolated track intersection point
132 float mTrkTheta; // theta track
133 float mTrkPhi; // phi track
134 float mCkovAngle; // emission angle value
135 int mMipCluSize = 0.0; // MIP cluster size
136 int mNPhots = 0.0; // number of candidate photo-electrons
137 int mIdxPhotClus; // index of the first photo
138 int mHMPqn; // 1000000*number of photon clusters + QDC
139 float mHmpMom; // track momentum at HMPID chambers
140 float mPhotCharge[10] = {};
141
142 ClassDefNV(MatchInfoHMP, 2);
143};
144} // namespace dataformats
145} // namespace o2
146#endif
Class to store event ID and index in the event for objects like track, cluster...
int32_t i
Global index for barrel track: provides provenance (detectors combination), index in respective array...
Track Length and TOF integral.
const float * getPhotCharge() const
void setIdxHMPClus(int ch, int idx)
void setIdxTrack(GTrackID index)
void getHMPIDtrk(float &x, float &y, float &th, float &ph) const
void getHMPIDmip(float &x, float &y, int &q, int &nph) const
void setHMPIDmip(float x, float y, int q, int nph=0)
void setHMPsignal(float angle)
void setPhotCharge(float *chargeArray)
MatchInfoHMP(int idxHMPClus, GTrackID idxTrack, float xmip=0, float ymip=0, float xtrk=0, float ytrk=0, float theta=0, float phi=0, float angle=0, float size=0, int idxPhotClus=0, int hmpqn=0, float hmpMom=0)
void setHMPIDtrk(float x, float y, float th, float ph)
GLdouble n
Definition glcorearb.h:1982
GLint GLenum GLint x
Definition glcorearb.h:403
GLsizeiptr size
Definition glcorearb.h:659
GLuint index
Definition glcorearb.h:781
GLint y
Definition glcorearb.h:270
GLfloat angle
Definition glcorearb.h:4071
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...