Project
Loading...
Searching...
No Matches
ChamberStatus.cxx
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
13// //
14// TRD calibration class for parameters which are saved frequently(/run) //
15// 2019 - Ported from various bits of AliRoot (SHTM) //
16// Most things were stored in AliTRDcalROC,AliTRDcalPad, AliTRDcalDet //
18
20#include "TH2D.h"
21
22using namespace o2::trd;
23
24void ChamberStatus::setStatus(int det, char bit)
25{
26
27 //
28 // set the chamber status
29 //
30 //
31
32 switch (bit) {
33 case Good:
34 mStatus[det] = Good;
35 break;
36 case NoData:
37 mStatus[det] &= !Good;
38 mStatus[det] |= NoData;
39 mStatus[det] |= NoDataHalfChamberSideA;
40 mStatus[det] |= NoDataHalfChamberSideB;
41 break;
43 mStatus[det] |= NoDataHalfChamberSideA;
44 if (mStatus[det] & NoDataHalfChamberSideB) {
45 mStatus[det] |= NoData;
46 mStatus[det] &= !Good;
47 }
48 break;
50 mStatus[det] |= NoDataHalfChamberSideB;
51 if (mStatus[det] & NoDataHalfChamberSideA) {
52 mStatus[det] &= !Good;
53 mStatus[det] |= NoData;
54 }
55 break;
56 case BadCalibrated:
57 mStatus[det] &= !Good;
58 mStatus[det] |= BadCalibrated;
59 break;
60 case NotCalibrated:
61 mStatus[det] &= !Good;
62 mStatus[det] |= NotCalibrated;
63 break;
64 default:
65 mStatus[det] = 0;
66 }
67}
68
69//_____________________________________________________________________________
70TH2D* ChamberStatus::plot(int sm, int rphi)
71{
72 //
73 // Plot chamber status for supermodule and halfchamberside
74 // as a function of layer and stack
75 //
76
77 TH2D* h2 = new TH2D(Form("sm_%d_rphi_%d", sm, rphi), Form("sm_%d_rphi_%d", sm, rphi), 5, 0.0, 5.0, 6, 0.0, 6.0);
78
79 h2->SetDirectory(nullptr);
80 h2->SetXTitle("stack");
81 h2->SetYTitle("layer");
82
83 int start = sm * 30;
84 int end = (sm + 1) * 30;
85
86 for (int i = start; i < end; i++) {
87 int layer = i % 6;
88 int stackn = static_cast<int>((i - start) / 6.);
89 int status = getStatus(i);
90 h2->Fill(stackn, layer, status);
91 if (rphi == 0) {
92 if (!(mStatus[i] & NoDataHalfChamberSideB)) {
93 h2->Fill(stackn, layer, status);
94 }
95 } else if (rphi == 1) {
96 if (!(mStatus[i] & NoDataHalfChamberSideA)) {
97 h2->Fill(stackn, layer, status);
98 }
99 }
100 }
101
102 return h2;
103}
104//_____________________________________________________________________________
105TH2D* ChamberStatus::plotNoData(int sm, int rphi)
106{
107 //
108 // Plot chamber data status for supermodule and halfchamberside
109 // as a function of layer and stack
110 //
111
112 TH2D* h2 = new TH2D(Form("sm_%d_rphi_%d_data", sm, rphi), Form("sm_%d_rphi_%d_data", sm, rphi), 5, 0.0, 5.0, 6, 0.0, 6.0);
113
114 h2->SetDirectory(nullptr);
115 h2->SetXTitle("stack");
116 h2->SetYTitle("layer");
117
118 int start = sm * 30;
119 int end = (sm + 1) * 30;
120
121 for (int i = start; i < end; i++) {
122 int layer = i % 6;
123 int stackn = static_cast<int>((i - start) / 6.);
124 if (rphi == 0) {
125 if (mStatus[i] & NoDataHalfChamberSideB) {
126 h2->Fill(stackn, layer, 1);
127 }
128 if (mStatus[i] & NoData) {
129 h2->Fill(stackn, layer, 1);
130 }
131 } else if (rphi == 1) {
132 if (!(mStatus[i] & NoDataHalfChamberSideA)) {
133 h2->Fill(stackn, layer, 1);
134 }
135 if (!(mStatus[i] & NoData)) {
136 h2->Fill(stackn, layer, 1);
137 }
138 }
139 }
140
141 return h2;
142}
143//_____________________________________________________________________________
144TH2D* ChamberStatus::plotBadCalibrated(int sm, int rphi)
145{
146 //
147 // Plot chamber calibration status for supermodule and halfchamberside
148 // as a function of layer and stack
149 //
150
151 TH2D* h2 = new TH2D(Form("sm_%d_rphi_%d_calib", sm, rphi), Form("sm_%d_rphi_%d_calib", sm, rphi), 5, 0.0, 5.0, 6, 0.0, 6.0);
152
153 h2->SetDirectory(nullptr);
154 h2->SetXTitle("stack");
155 h2->SetYTitle("layer");
156
157 int start = sm * 30;
158 int end = (sm + 1) * 30;
159
160 for (int i = start; i < end; i++) {
161 int layer = i % 6;
162 int stackn = static_cast<int>((i - start) / 6.);
163 if (rphi == 0) {
164 if (mStatus[i] & BadCalibrated) {
165 h2->Fill(stackn, layer, 1);
166 }
167 } else if (rphi == 1) {
168 if (mStatus[i] & BadCalibrated) {
169 h2->Fill(stackn, layer, 1);
170 }
171 }
172 }
173
174 return h2;
175}
176//_____________________________________________________________________________
178{
179 //
180 // Plot chamber status for supermodule and halfchamberside
181 // as a function of layer and stack
182 //
183
184 TH2D* h2 = new TH2D(Form("sm_%d", sm), Form("sm_%d", sm), 5, 0.0, 5.0, 6, 0.0, 6.0);
185
186 h2->SetDirectory(nullptr);
187 h2->SetXTitle("stack");
188 h2->SetYTitle("layer");
189
190 int start = sm * 30;
191 int end = (sm + 1) * 30;
192
193 for (int i = start; i < end; i++) {
194 int layer = i % 6;
195 int stackn = static_cast<int>((i - start) / 6.);
196 int status = getStatus(i);
197 h2->Fill(stackn, layer, status);
198 }
199
200 return h2;
201}
int32_t i
TH2D * plotBadCalibrated(int sm, int rphi)
void setStatus(int det, char bit)
TH2D * plot(int sm, int rphi)
TH2D * plotNoData(int sm, int rphi)
char getStatus(int det) const
GLuint GLuint end
Definition glcorearb.h:469
GLenum GLuint GLint GLint layer
Definition glcorearb.h:1310
GLuint start
Definition glcorearb.h:469