Project
Loading...
Searching...
No Matches
ETCalibHistos.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 PHOS_ETCALIBHISTOS_H
20#define PHOS_ETCALIBHISTOS_H
21
22#include <array>
23#include <cstring>
24
25namespace o2
26{
27
28namespace phos
29{
30
32{
33 public:
34 // Histogram kinds to be filled
44 static constexpr int nChannels = 14336 - 1793; // 4 full modules -1/2
45 static constexpr int offset = 1793; // 1/2 full module
46 // mgg histos
47 static constexpr int nMass = 150.;
48 static constexpr float massMax = 0.3;
49 static constexpr float dm = massMax / nMass;
50 // time histograms
51 static constexpr int nTime = 400;
52 static constexpr float timeMin = -200.e-9;
53 static constexpr float timeMax = 200.e-9;
54 static constexpr float dt = (timeMax - timeMin) / nTime;
55
56 // pt
57 static constexpr int npt = 200;
58 static constexpr float ptMax = 20;
59 static constexpr float dpt = ptMax / npt;
60
61 // L1 phase
62 static constexpr int nDDL = 52; // 14 DDL * 4 BC
63
65 ETCalibHistos() = default;
66
68
70 virtual ~ETCalibHistos() = default;
71
75 {
76 for (int i = nChannels; --i;) {
77 for (int j = nMass; --j;) {
78 mReInvMassPerCell[i][j] += other->mReInvMassPerCell[i][j];
79 mMiInvMassPerCell[i][j] += other->mMiInvMassPerCell[i][j];
80 }
81 for (int j = nTime; --j;) {
82 mTimeHGPerCell[i][j] += other->mTimeHGPerCell[i][j];
83 mTimeLGPerCell[i][j] += other->mTimeLGPerCell[i][j];
84 }
85 }
86 for (int i = npt; --i;) {
87 for (int j = nMass; --j;) {
88 mReInvMassNonlin[i][j] += other->mReInvMassNonlin[i][j];
89 mMiInvMassNonlin[i][j] += other->mMiInvMassNonlin[i][j];
90 }
91 for (int j = nTime; --j;) {
92 mTimeHGSlewing[i][j] += other->mTimeHGSlewing[i][j];
93 mTimeLGSlewing[i][j] += other->mTimeLGSlewing[i][j];
94 }
95 }
96 for (int i = nDDL; --i;) {
97 for (int j = nTime; --j;) {
98 mTimeDDL[i][j] += other->mTimeDDL[i][j];
99 }
100 }
101 }
102
103 void fill(int kind, float x, float y)
104 {
105 if (kind == kReInvMassNonlin || kind == kMiInvMassNonlin) {
106 int i = int(x / dm);
107 int j = int(y / dpt);
108 if (i < nMass && j < npt) {
109 if (kind == kReInvMassNonlin) {
110 mReInvMassNonlin[i][j]++;
111 } else {
112 mMiInvMassNonlin[i][j]++;
113 }
114 }
115 }
116 if (kind == kTimeHGSlewing || kind == kTimeLGSlewing) {
117 int i = int((x - timeMin) / dt);
118 int j = int(y / dpt);
119 if (i >= 0 && i < nTime && j < npt) {
120 if (kind == kTimeHGSlewing) {
121 mTimeHGSlewing[i][j]++;
122 } else {
123 mTimeHGSlewing[i][j]++;
124 }
125 }
126 }
127 }
128 void fill(int kind, int x, float y)
129 {
130 if (kind == kReInvMassPerCell || kind == kMiInvMassPerCell) {
131 int j = int(y / dm);
132 if (j < nMass) {
133 if (kind == kReInvMassPerCell) {
135 } else {
137 }
138 }
139 }
140 if (kind == kTimeHGPerCell || kind == kTimeLGPerCell) {
141 int j = int((y - timeMin) / dt);
142 if (j >= 0 && j < nTime) {
143 if (kind == kTimeHGPerCell) {
144 mTimeHGPerCell[x - offset][j]++;
145 } else {
146 mTimeLGPerCell[x - offset][j]++;
147 }
148 }
149 }
150 if (kind == kTimeDDL) {
151 int j = int((y - timeMin) / dt);
152 if (j >= 0 && j < nTime) {
153 mTimeDDL[x][j]++;
154 }
155 }
156 }
157 void reset()
158 {
159 memset(&mReInvMassPerCell, 0, sizeof(mReInvMassPerCell));
160 memset(&mMiInvMassPerCell, 0, sizeof(mMiInvMassPerCell));
161 memset(&mReInvMassNonlin, 0, sizeof(mReInvMassNonlin));
162 memset(&mMiInvMassNonlin, 0, sizeof(mMiInvMassNonlin));
163 memset(&mTimeHGPerCell, 0, sizeof(mTimeHGPerCell));
164 memset(&mTimeLGPerCell, 0, sizeof(mTimeLGPerCell));
165 memset(&mTimeHGSlewing, 0, sizeof(mTimeHGSlewing));
166 memset(&mTimeLGSlewing, 0, sizeof(mTimeLGSlewing));
167 memset(&mTimeDDL, 0, sizeof(mTimeDDL));
168 }
169
170 public:
171 std::array<std::array<float, nMass>, nChannels> mReInvMassPerCell;
172 std::array<std::array<float, nMass>, nChannels> mMiInvMassPerCell;
173 std::array<std::array<float, npt>, nMass> mReInvMassNonlin;
174 std::array<std::array<float, npt>, nMass> mMiInvMassNonlin;
175 std::array<std::array<float, nTime>, nChannels> mTimeHGPerCell;
176 std::array<std::array<float, nTime>, nChannels> mTimeLGPerCell;
177 std::array<std::array<float, npt>, nTime> mTimeHGSlewing;
178 std::array<std::array<float, npt>, nTime> mTimeLGSlewing;
179 std::array<std::array<float, nDDL>, nTime> mTimeDDL;
180
182};
183
184} // namespace phos
185
186} // namespace o2
187#endif
int32_t i
uint32_t j
Definition RawData.h:0
static constexpr float massMax
static constexpr int npt
std::array< std::array< float, nTime >, nChannels > mTimeHGPerCell
time per cell
void fill(int kind, float x, float y)
std::array< std::array< float, nMass >, nChannels > mReInvMassPerCell
inv mass per cell
static constexpr float dpt
static constexpr float timeMin
static constexpr int nTime
ETCalibHistos()=default
Constructor.
void merge(const ETCalibHistos *other)
Merge statistics in two containers.
static constexpr int nChannels
std::array< std::array< float, nDDL >, nTime > mTimeDDL
time vs DDL
std::array< std::array< float, npt >, nMass > mMiInvMassNonlin
inv mass vs pT
std::array< std::array< float, npt >, nMass > mReInvMassNonlin
inv mass vs pT
std::array< std::array< float, npt >, nTime > mTimeHGSlewing
time vs pT
ETCalibHistos & operator=(const ETCalibHistos &other)=default
std::array< std::array< float, nTime >, nChannels > mTimeLGPerCell
time per cell
std::array< std::array< float, nMass >, nChannels > mMiInvMassPerCell
inv mass per cell
static constexpr float timeMax
virtual ~ETCalibHistos()=default
Destructor.
static constexpr float ptMax
static constexpr float dm
static constexpr int nMass
ClassDef(ETCalibHistos, 2)
static constexpr float dt
static constexpr int nDDL
void fill(int kind, int x, float y)
std::array< std::array< float, npt >, nTime > mTimeLGSlewing
time vs pT
static constexpr int offset
GLint GLenum GLint x
Definition glcorearb.h:403
GLintptr offset
Definition glcorearb.h:660
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
VectorOfTObjectPtrs other