Project
Loading...
Searching...
No Matches
PHData.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 ALICEO2_TRD_PHDATA_H_
13#define ALICEO2_TRD_PHDATA_H_
14
15#include <cstdint>
16#include "Rtypes.h"
17
18namespace o2::trd
19{
20
21/*
22 This data type is used to send around the information required to fill PH plots per chamber
23
24 |31|30|29|28|27|26|25|24|23|22|21|20|19|18|17|16|15|14|13|12|11|10|09|08|07|06|05|04|03|02|01|00|
25 -------------------------------------------------------------------------------------------------
26 |type |nNeighb | time bin | detector number | ADC sum for all neigbours |
27 -------------------------------------------------------------------------------------------------
28*/
29
30class PHData
31{
32 public:
39
40 PHData() = default;
41 PHData(int adc, int det, int tb, int nb, int type) { set(adc, det, tb, nb, type); }
42
43 void set(int adc, int det, int tb, int nb, int type)
44 {
45 mData = ((type & 0x3) << 30) | ((nb & 0x7) << 27) | ((tb & 0x1f) << 22) | ((det & 0x3ff) << 12) | (adc & 0xfff);
46 }
47
48 // the ADC sum for given time bin for up to three neighbours
49 int getADC() const { return mData & 0xfff; }
50 // the TRD detector number
51 int getDetector() const { return (mData >> 12) & 0x3ff; }
52 // the given time bin
53 int getTimebin() const { return (mData >> 22) & 0x1f; }
54 // number of neighbouring digits for which the ADC is accumulated
55 int getNneighbours() const { return (mData >> 27) & 0x7; }
56 // the origin of this point: digit on ITS-TPC-TRD track, ... (see enum Origin above)
57 int getType() const { return (mData >> 30) & 0x3; }
58
59 private:
60 uint32_t mData{0}; // see comment above for data content
61
62 ClassDefNV(PHData, 1);
63};
64
65/*
66 This data type is used to send around the information required to fill PH plots per chamber
67
68 |19|18|17|16|15|14|13|12|11|10|09|08|07|06|05|04|03|02|01|00|
69 -------------------------------------------------------------
70 |type |nNeighb | time bin | detector number |
71 -------------------------------------------------------------
72*/
73/*
74 This data type is used to send around the information required to fill PH plots per chamber
75
76 |15|14|13|12|11|10|09|08|07|06|05|04|03|02|01|00|
77 ------------------------------------------------
78 | ADC sum for all neigbours |
79 ------------------------------------------------
80*/
81
83{
84 public:
91
92 PHDataHD() = default;
93 PHDataHD(int adc, int det, int tb, int nb, int type) { set(adc, det, tb, nb, type); }
94
95 void set(int adc, int det, int tb, int nb, int type)
96 {
97 mDetector = det;
98 mTimeBin = tb;
99 mType = type;
100 mNNeighbours = nb;
101 mADC = adc;
102 }
103
104 // the ADC sum for given time bin for up to three neighbours
105 int getADC() const { return mADC; }
106 // the TRD detector number
107 int getDetector() const { return mDetector; }
108 // the given time bin
109 int getTimebin() const { return mTimeBin; }
110 // number of neighbouring digits for which the ADC is accumulated
111 int getNNeighbours() const { return mNNeighbours; }
112 // the origin of this point: digit on ITS-TPC-TRD track, ... (see enum Origin above)
113 int getType() const { return mType; }
114
115 private:
116 uint16_t mDetector{0};
117 uint8_t mTimeBin{0};
118 uint8_t mType{0};
119 uint8_t mNNeighbours{0};
120 uint16_t mADC{0};
121
122 ClassDefNV(PHDataHD, 1);
123};
124} // namespace o2::trd
125
126#endif // ALICEO2_TRD_PHDATA_H_
PHDataHD(int adc, int det, int tb, int nb, int type)
Definition PHData.h:93
int getDetector() const
Definition PHData.h:107
int getNNeighbours() const
Definition PHData.h:111
int getADC() const
Definition PHData.h:105
PHDataHD()=default
void set(int adc, int det, int tb, int nb, int type)
Definition PHData.h:95
int getTimebin() const
Definition PHData.h:109
int getType() const
Definition PHData.h:113
PHData(int adc, int det, int tb, int nb, int type)
Definition PHData.h:41
int getType() const
Definition PHData.h:57
int getTimebin() const
Definition PHData.h:53
int getNneighbours() const
Definition PHData.h:55
int getADC() const
Definition PHData.h:49
int getDetector() const
Definition PHData.h:51
void set(int adc, int det, int tb, int nb, int type)
Definition PHData.h:43
PHData()=default
GLint GLint GLsizei GLint GLenum GLenum type
Definition glcorearb.h:275
uint8_t itsSharedClusterMap uint8_t
ArrayADC adc