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>
27 bool 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 = 42;
79 const int run[N_config][4] = {
125 std::vector<std::vector<int>> mgr(N_config);
127 mgr[ 1].push_back(7010);
128 mgr[ 2].push_back(7010); mgr[ 2].push_back(7071);
129 mgr[ 3].push_back(7010); mgr[ 3].push_back(7071); mgr[ 3].push_back(8110);
130 mgr[ 4].push_back(7010); mgr[ 4].push_back(7071);
131 mgr[ 5].push_back(7010); mgr[ 5].push_back(7071); mgr[ 5].push_back(1000);
132 mgr[ 6].push_back(7010); mgr[ 6].push_back(7071);
133 mgr[ 7].push_back(7010); mgr[ 7].push_back(7071); mgr[ 7].push_back(2030);
134 mgr[ 8].push_back(7010); mgr[ 8].push_back(7071);
135 mgr[ 9].push_back(7010); mgr[ 9].push_back(7071); mgr[ 9].push_back(6061);
136 mgr[10].push_back(7010); mgr[10].push_back(7071);
138 mgr[12].push_back(7010);
139 mgr[13].push_back(7010); mgr[13].push_back(7090); mgr[13].push_back(3010);
140 mgr[14].push_back(7010); mgr[14].push_back(7090); mgr[14].push_back(3010); mgr[14].push_back(4040);
141 mgr[15].push_back(7010); mgr[15].push_back(7090); mgr[15].push_back(3010);
142 mgr[16].push_back(7010); mgr[16].push_back(7090);
143 mgr[17].push_back(7010); mgr[17].push_back(7090); mgr[17].push_back(3010);
144 mgr[18].push_back(7010); mgr[18].push_back(7090);
146 mgr[20].push_back(3010);
148 mgr[22].push_back(3031);
150 mgr[24].push_back(3010);
152 mgr[26].push_back(3010);
153 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);
154 mgr[27].push_back(8060); mgr[27].push_back(8061); mgr[27].push_back(8070);
155 mgr[28].push_back(3010);
156 mgr[29].push_back(3010); mgr[29].push_back(3031);
157 mgr[30].push_back(3010);
158 mgr[31].push_back(3010); mgr[31].push_back(8060); mgr[31].push_back(8061);
159 mgr[32].push_back(3010);
160 mgr[33].push_back(3010); mgr[33].push_back(8060); mgr[33].push_back(8061);
161 mgr[34].push_back(3010);
162 mgr[35].push_back(3010); mgr[35].push_back(4001);
163 mgr[36].push_back(3010);
164 mgr[37].push_back(3010); mgr[37].push_back(4001); mgr[37].push_back(5080);
165 mgr[38].push_back(3010);
166 mgr[39].push_back(3010); mgr[39].push_back(5050);
167 mgr[40].push_back(3010); mgr[40].push_back(5050); mgr[40].push_back(8021);
168 mgr[41].push_back(3010); mgr[41].push_back(5050);
171 bool badch_map[N_config][9][8][384];
172 for (
int i = 0; i < N_config; i++) {
173 for (
unsigned int j = 0; j < nSuperLayers; j++) {
174 for (
unsigned int k = 0; k < MAX_N_LAYERS; k++) {
175 for (
unsigned int l = 0; l < MAX_N_SCELLS; l++) {
176 badch_map[i][j][k][l] =
true;
183 for (
int i = 0; i < N_config; i++) {
184 for (
unsigned int j = 8; j < 9; j++) {
185 for (
unsigned int k = 4; k < 5; k++) {
186 for (
unsigned int l = 0; l < MAX_N_SCELLS; l++) {
187 badch_map[i][j][k][l] =
false;
194 for (
int i = 0; i < N_config; i++) {
195 for (
int j = 0; j < mgr[i].size(); j++) {
199 get_wire_mgr(mgr_sl, mgr_layer, mgr_ch, mgr[i][j]);
201 for (
int k = 0; k < 96; k++) {
203 badch_map[i][mgr_sl[k]][mgr_layer[k]][mgr_ch[k]] =
false;
211 for (
int i = 0; i < N_config; i++) {
215 for (
unsigned int j = 0; j < nSuperLayers; j++) {
216 for (
unsigned int k = 0; k < MAX_N_LAYERS; k++) {
217 for (
unsigned int l = 0; l < MAX_N_SCELLS; l++) {
218 if (!badch_map[i][j][k][l]) {
220 db_dead->setdeadch(j, k, l,
false);
222 db_dead->setdeadch(j, k, l,
true);
229 }
else if (ONLINE == 1) {
230 for (
int i = 0; i < 1; i++) {
232 for (
unsigned int j = 0; j < nSuperLayers; j++) {
233 for (
unsigned int k = 0; k < MAX_N_LAYERS; k++) {
234 for (
unsigned int l = 0; l < MAX_N_SCELLS; l++) {
235 if (!badch_map[i][j][k][l]) {
237 db_dead->setdeadch(j, k, l,
false);
239 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.
int main(int argc, char **argv)
Run all tests.