9#include <framework/database/DBImportObjPtr.h>
10#include <framework/database/DBObjPtr.h>
11#include <framework/database/DBStore.h>
12#include <framework/datastore/StoreObjPtr.h>
13#include <framework/datastore/DataStore.h>
14#include <framework/dataobjects/EventMetaData.h>
15#include <framework/logging/LogSystem.h>
16#include <trg/cdc/dbobjects/CDCTriggerDeadch.h>
27bool get_wire_mgr(
int mask_sl[],
int mask_layer[],
int mask_ch[],
int mgr)
29 int mgr_sl = mgr / 1000;
30 int mgr_i = (mgr - mgr_sl * 1000) / 10;
45 for (
int i = 0; i < 32; i++) {
47 mask_ch[i] = mgr_i * 32 + i;
49 if (mgr_u == 1) mask_layer[i] += 3;
50 if (mgr_sl == 0) mask_layer[i] += 2;
53 for (
int i = 0; i < 32; i++) {
54 mask_sl[i + 32] = mgr_sl;
55 mask_ch[i + 32] = mgr_i * 32 + i;
56 mask_layer[i + 32] = 1;
57 if (mgr_u == 1) mask_layer[i + 32] += 3;
58 if (mgr_sl == 0) mask_layer[i + 32] += 2;
61 for (
int i = 0; i < 32; i++) {
62 mask_sl[i + 64] = mgr_sl;
63 mask_ch[i + 64] = mgr_i * 32 + i;
64 mask_layer[i + 64] = 2;
65 if (mgr_u == 1) mask_layer[i + 64] += 3;
66 if (mgr_sl == 0) mask_layer[i + 64] += 2;
75 const static int MAX_N_LAYERS = 8;
77 const int N_config = 75;
79 const int run[N_config][4] = {
100 {12, 3490, 12, 4214},
101 {12, 4215, 12, 4406},
102 {12, 4407, 12, 4419},
103 {12, 4420, 14, 1382},
122 {24, 1185, 24, 1190},
123 {24, 1191, 24, 1404},
124 {24, 1405, 24, 1406},
125 {24, 1407, 24, 1599},
126 {24, 1600, 24, 1613},
127 {24, 1614, 24, 1618},
128 {24, 1619, 24, 1844},
129 {24, 1845, 24, 1852},
130 {24, 1853, 24, 2058},
131 {24, 2059, 24, 2061},
132 {24, 2062, 24, 2062},
133 {24, 2063, 24, 2315},
152 {26, 1390, 26, 1430},
153 {26, 1431, 26, 1431},
158 std::vector<std::vector<int>> mgr(N_config);
160 mgr[ 1].push_back(7010);
161 mgr[ 2].push_back(7010); mgr[ 2].push_back(7071);
162 mgr[ 3].push_back(7010); mgr[ 3].push_back(7071); mgr[ 3].push_back(8110);
163 mgr[ 4].push_back(7010); mgr[ 4].push_back(7071);
164 mgr[ 5].push_back(7010); mgr[ 5].push_back(7071); mgr[ 5].push_back(1000);
165 mgr[ 6].push_back(7010); mgr[ 6].push_back(7071);
166 mgr[ 7].push_back(7010); mgr[ 7].push_back(7071); mgr[ 7].push_back(2030);
167 mgr[ 8].push_back(7010); mgr[ 8].push_back(7071);
168 mgr[ 9].push_back(7010); mgr[ 9].push_back(7071); mgr[ 9].push_back(6061);
169 mgr[10].push_back(7010); mgr[10].push_back(7071);
171 mgr[12].push_back(7010);
172 mgr[13].push_back(7010); mgr[13].push_back(7090); mgr[13].push_back(3010);
173 mgr[14].push_back(7010); mgr[14].push_back(7090); mgr[14].push_back(3010); mgr[14].push_back(4040);
174 mgr[15].push_back(7010); mgr[15].push_back(7090); mgr[15].push_back(3010);
175 mgr[16].push_back(7010); mgr[16].push_back(7090);
176 mgr[17].push_back(7010); mgr[17].push_back(7090); mgr[17].push_back(3010);
177 mgr[18].push_back(7010); mgr[18].push_back(7090);
179 mgr[20].push_back(3010);
181 mgr[22].push_back(3031);
183 mgr[24].push_back(3010);
185 mgr[26].push_back(3010);
186 mgr[27].push_back(3010); mgr[27].push_back(2040); mgr[27].push_back(11); mgr[27].push_back(4060); mgr[27].push_back(4061);
187 mgr[27].push_back(8060); mgr[27].push_back(8061); mgr[27].push_back(8070);
188 mgr[28].push_back(3010);
189 mgr[29].push_back(3010); mgr[29].push_back(3031);
190 mgr[30].push_back(3010);
191 mgr[31].push_back(3010); mgr[31].push_back(8060); mgr[31].push_back(8061);
192 mgr[32].push_back(3010);
193 mgr[33].push_back(3010); mgr[33].push_back(8060); mgr[33].push_back(8061);
194 mgr[34].push_back(3010);
195 mgr[35].push_back(3010); mgr[35].push_back(4001);
196 mgr[36].push_back(3010);
197 mgr[37].push_back(3010); mgr[37].push_back(4001); mgr[37].push_back(5080);
198 mgr[38].push_back(3010);
199 mgr[39].push_back(3010); mgr[39].push_back(5050);
200 mgr[40].push_back(3010); mgr[40].push_back(5050); mgr[40].push_back(8021);
201 mgr[41].push_back(3010); mgr[41].push_back(5050);
202 mgr[42].push_back(3010); mgr[42].push_back(5050); mgr[42].push_back(21);
203 mgr[43].push_back(3010); mgr[43].push_back(5050);
204 mgr[44].push_back(3010); mgr[44].push_back(5050); mgr[44].push_back(30);
205 mgr[45].push_back(3010); mgr[45].push_back(5050);
206 mgr[46].push_back(3010); mgr[46].push_back(5050); mgr[46].push_back(1030);
207 mgr[47].push_back(3010); mgr[47].push_back(5050); mgr[47].push_back(1030); mgr[47].push_back(1011);
208 mgr[48].push_back(3010); mgr[48].push_back(5050); mgr[48].push_back(1030);
209 mgr[49].push_back(3010); mgr[49].push_back(5050); mgr[49].push_back(1030); mgr[49].push_back(2021);
210 mgr[50].push_back(3010); mgr[50].push_back(5050); mgr[50].push_back(1030);
211 mgr[51].push_back(3010); mgr[51].push_back(5050); mgr[51].push_back(1030); mgr[51].push_back(8020); mgr[51].push_back(8060);
212 mgr[51].push_back(8061);
213 mgr[52].push_back(3010); mgr[52].push_back(5050); mgr[52].push_back(1030); mgr[52].push_back(8060); mgr[52].push_back(8061);
214 mgr[53].push_back(3010); mgr[53].push_back(5050); mgr[53].push_back(1030); mgr[53].push_back(8020); mgr[53].push_back(8060);
215 mgr[53].push_back(8061);
216 mgr[54].push_back(3010); mgr[54].push_back(5450); mgr[54].push_back(1030);
217 mgr[55].push_back(3010); mgr[55].push_back(5050); mgr[55].push_back(1030); mgr[55].push_back(8020); mgr[55].push_back(8060);
218 mgr[55].push_back(8061);
219 mgr[56].push_back(3010); mgr[56].push_back(5050); mgr[56].push_back(1030);
220 mgr[57].push_back(3010); mgr[57].push_back(5050); mgr[57].push_back(1030); mgr[57].push_back(1000);
221 mgr[58].push_back(3010); mgr[58].push_back(5050); mgr[58].push_back(1030);
222 mgr[59].push_back(3010); mgr[59].push_back(5050); mgr[59].push_back(1030); mgr[59].push_back(6051);
223 mgr[60].push_back(3010); mgr[60].push_back(5050); mgr[60].push_back(1030); mgr[60].push_back(40); mgr[60].push_back(6051);
224 mgr[60].push_back(6060);
225 mgr[61].push_back(3010); mgr[61].push_back(5050); mgr[61].push_back(1030);
226 mgr[62].push_back(3010); mgr[62].push_back(5050); mgr[62].push_back(1030); mgr[62].push_back(6080); mgr[62].push_back(6081);
227 mgr[63].push_back(3010); mgr[63].push_back(5050); mgr[63].push_back(1030);
228 mgr[64].push_back(3010); mgr[64].push_back(5050); mgr[64].push_back(1030); mgr[64].push_back(8041);
229 mgr[65].push_back(3010); mgr[65].push_back(5050); mgr[65].push_back(1030);
230 mgr[66].push_back(3010); mgr[66].push_back(5050); mgr[66].push_back(1030); mgr[66].push_back(1021); mgr[66].push_back(8041);
231 mgr[67].push_back(3010); mgr[67].push_back(5050); mgr[67].push_back(1030);
232 mgr[68].push_back(3010); mgr[68].push_back(5050); mgr[68].push_back(1030); mgr[68].push_back(30);
233 mgr[69].push_back(3010); mgr[69].push_back(30); mgr[69].push_back(7000); mgr[69].push_back(7001); mgr[69].push_back(7010);
234 mgr[69].push_back(7011);
235 mgr[70].push_back(3010); mgr[70].push_back(30);
236 mgr[71].push_back(30);
238 mgr[73].push_back(1010); mgr[73].push_back(2000); mgr[73].push_back(2001);
242 auto badch_map =
new bool[N_config][9][8][384];
243 for (
int i = 0; i < N_config; i++) {
244 for (
unsigned int j = 0; j < c_nSuperLayers; j++) {
245 for (
unsigned int k = 0; k < MAX_N_LAYERS; k++) {
246 for (
unsigned int l = 0; l < c_maxNDriftCells; l++) {
247 badch_map[i][j][k][l] =
true;
254 for (
int i = 0; i < N_config; i++) {
255 for (
unsigned int j = 8; j < 9; j++) {
256 for (
unsigned int k = 4; k < 5; k++) {
257 for (
unsigned int l = 0; l < c_maxNDriftCells; l++) {
258 badch_map[i][j][k][l] =
false;
265 for (
int i = 0; i < N_config; i++) {
266 for (
unsigned int j = 0; j < mgr[i].size(); j++) {
270 get_wire_mgr(mgr_sl, mgr_layer, mgr_ch, mgr[i][j]);
272 for (
int k = 0; k < 96; k++) {
274 badch_map[i][mgr_sl[k]][mgr_layer[k]][mgr_ch[k]] =
false;
282 for (
int i = 0; i < N_config; i++) {
286 for (
unsigned int j = 0; j < c_nSuperLayers; j++) {
287 for (
unsigned int k = 0; k < MAX_N_LAYERS; k++) {
288 for (
unsigned int l = 0; l < c_maxNDriftCells; l++) {
289 if (!badch_map[i][j][k][l]) {
291 db_dead->setdeadch(j, k, l,
false);
293 db_dead->setdeadch(j, k, l,
true);
300 }
else if (ONLINE == 1) {
301 for (
int i = 0; i < 1; i++) {
303 for (
unsigned int j = 0; j < c_nSuperLayers; j++) {
304 for (
unsigned int k = 0; k < MAX_N_LAYERS; k++) {
305 for (
unsigned int l = 0; l < c_maxNDriftCells; l++) {
306 if (!badch_map[i][j][k][l]) {
308 db_dead->setdeadch(j, k, l,
false);
310 db_dead->setdeadch(j, k, l,
true);
bool import(const IntervalOfValidity &iov)
Import the object to database.
Class for importing a single object to the database.
void construct(Args &&... params)
Construct an object of type T in this DBImportObjPtr using the provided constructor arguments.
A class that describes the interval of experiments/runs for which an object in the database is valid.
Abstract base class for different kinds of events.