MiniballSort
Loading...
Searching...
No Matches
Settings.cc
Go to the documentation of this file.
1#include "Settings.hh"
2
11
12MiniballSettings::MiniballSettings( std::string filename ) {
13
14 SetFile( filename );
17
18}
19
21
22 // Loop over all channels and see what we find
23 for( unsigned int i = 0; i < n_febex_sfp; ++i ){
24
25 for( unsigned int j = 0; j < n_febex_board; ++j ){
26
27 for( unsigned int k = 0; k < n_febex_ch; ++k ){
28
29 std::vector<std::string> active_chs;
30 std::string detname;
31
32 // Is it a Miniball?
33 if( IsMiniball(i,j,k) ){
34
35 detname = "Miniball_";
36 detname += std::to_string( GetMiniballCluster(i,j,k) ) + "_";
37 detname += std::to_string( GetMiniballCrystal(i,j,k) ) + "_";
38 detname += std::to_string( GetMiniballSegment(i,j,k) ) + "\n";
39 active_chs.push_back( detname );
40
41 }
42
43 // Is it a CD?
44 if( IsCD(i,j,k) ){
45
46 detname = "CD_";
47 detname += std::to_string( GetCDDetector(i,j,k) ) + "_";
48 detname += std::to_string( GetCDSector(i,j,k) ) + "_";
49 detname += std::to_string( GetCDStrip(i,j,k) ) + ".";
50 detname += std::to_string( GetCDSide(i,j,k) ) + "\n";
51 active_chs.push_back( detname );
52
53 }
54
55 // Is it a Pad?
56 if( IsPad(i,j,k) ){
57
58 detname = "Pad_";
59 detname += std::to_string( GetPadDetector(i,j,k) ) + "_";
60 detname += std::to_string( GetPadSector(i,j,k) ) + "\n";
61 active_chs.push_back( detname );
62
63 }
64
65 // Is it a Spede?
66 if( IsSpede(i,j,k) ){
67
68 detname = "Spede_";
69 detname += std::to_string( GetSpedeSegment(i,j,k) ) + "\n";
70 active_chs.push_back( detname );
71
72 }
73
74 // Is it a beam dump?
75 if( IsBeamDump(i,j,k) ){
76
77 detname = "BeamDump_";
78 detname += std::to_string( GetBeamDumpDetector(i,j,k) ) + "\n";
79 active_chs.push_back( detname );
80
81 }
82
83 // Is it an IonChamber?
84 if( IsIonChamber(i,j,k) ){
85
86 detname = "IonChamber_";
87 detname += std::to_string( GetIonChamberLayer(i,j,k) ) + "\n";
88 active_chs.push_back( detname );
89
90 }
91
92 // Is it a pulser?
93 if( IsPulser(i,j,k) ){
94
95 detname = "Pulser_";
96 detname += std::to_string( GetPulser(i,j,k) ) + "\n";
97 active_chs.push_back( detname );
98
99 }
100
101 // Is it EBIS?
102 if( GetEBISSfp() == i && GetEBISBoard() == j && GetEBISChannel() == k )
103 active_chs.push_back( "EBIS\n" );
104
105 // Is it T1?
106 if( GetT1Sfp() == i && GetT1Board() == j && GetT1Channel() == k )
107 active_chs.push_back( "T1\n" );
108
109 // Is it SC?
110 if( GetSCSfp() == i && GetSCBoard() == j && GetSCChannel() == k )
111 active_chs.push_back( "SC\n" );
112
113 // Is it RILIS?
114 if( GetRILISSfp() == i && GetRILISBoard() == j && GetRILISChannel() == k )
115 active_chs.push_back( "RILIS\n" );
116
117
118 // Check now if we have multiple detectors in this channel
119 if( active_chs.size() > 1 ) {
120
121 std::cout << "Too many detectors in SFP " << i;
122 std::cout << ", board " << j << ", channel " << k << ":\n";
123 for( unsigned int q = 0; q < active_chs.size(); ++q )
124 std::cout << active_chs.at(q);
125
126 } // more than one detector
127
128 } // k = ch
129
130 } // j = board
131
132 } // i = sfp
133
134}
135
137
138 TEnv *config = new TEnv( fInputFile.data() );
139
140 // FEBEX initialisation
141 n_febex_sfp = config->GetValue( "NumberOfFebexSfps", 2 );
142 n_febex_board = config->GetValue( "NumberOfFebexBoards", 16 );
143 n_febex_ch = config->GetValue( "NumberOfFebexChannels", 16 );
144
145 // DGF initialisation
146 n_dgf_mod = config->GetValue( "NumberOfDgfModules", 0 );
147 n_dgf_ts_mod = config->GetValue( "NumberOfDgfTimestampModules", 5 );
148 n_dgf_ch = config->GetValue( "NumberOfDgfChannels", 4 );
149 dgf_mod_offset = config->GetValue( "DgfModuleOffset", 1 );
150 dgf_ts_mod_offset = config->GetValue( "DgfTimestampModuleOffset", 49 );
151 dgf_ts_delay = config->GetValue( "DgfTimestampDelay", 65527 );
152 dgf_ts_units = config->GetValue( "DgfTimestampUnits", 25. );
153
154 // CAEN ADC initialisation
155 n_caen_mod = config->GetValue( "NumberOfCaenAdcModules", 0 );
156 n_caen_ch = config->GetValue( "NumberOfCaenAdcChannels", 32 );
157 caen_mod_offset = config->GetValue( "CaenAdcModuleOffset", 60 );
158 caen_ts_units = config->GetValue( "CaenAdcTimestampUnits", 25. );
159
160 // Mesytec ADC initialisation
161 n_madc_mod = config->GetValue( "NumberOfMesytecAdcModules", 0 );
162 n_madc_ch = config->GetValue( "NumberOfMesytecAdcChannels", 32 );
163 madc_mod_offset = config->GetValue( "MesytecAdcModuleOffset", 55 );
164 madc_ts_units = config->GetValue( "MesytecAdcTimestampUnits", 25. );
165
166 // Scaler unit initialisation
167 n_scaler_unit = config->GetValue( "NumberOfScalerUnits", 1 );
168 scaler_unit_offset = config->GetValue( "ScalerUnitOffset", 0 );
169
170 // Pattern unit initialisation
171 n_pattern_unit = config->GetValue( "NumberOfPatternUnits", 1 );
172 pattern_unit_offset = config->GetValue( "PatternUnitOffset", 67 );
173
174 // VME ID initialisation
175 dgf_vme_first = config->GetValue( "Dgf.VME.First", 1 );
176 dgf_vme_last = config->GetValue( "Dgf.VME.Last", 10 );
177 adc_vme_first = config->GetValue( "Adc.VME.First", 11 );
178 adc_vme_last = config->GetValue( "Adc.VME.Last", 19 );
179 scaler_vme_first = config->GetValue( "Scaler.VME.First", 20 );
180 scaler_vme_last = config->GetValue( "Scaler.VME.Last", 20 );
181 pattern_vme_first = config->GetValue( "Pattern.VME.First", 21 );
182 pattern_vme_last = config->GetValue( "Pattern.VME.Last", 21 );
183 dgfscaler_vme_first = config->GetValue( "DgfScaler.VME.First", 22 );
184 dgfscaler_vme_last = config->GetValue( "DgfScaler.VME.Last", 24 );
185
186 // Miniball array initialisation
187 n_mb_cluster = config->GetValue( "NumberOfMiniballClusters", 8 );
188 n_mb_crystal = config->GetValue( "NumberOfMiniballCrystals", 3 );
189 n_mb_segment = config->GetValue( "NumberOfMiniballSegments", 7 );
190
191 // CD detector initialisation
192 n_cd_det = config->GetValue( "NumberOfCDDetectors", 1 );
193 n_cd_sector = config->GetValue( "NumberOfCDSectors", 4 );
194 n_cd_side = 2; // always 2, you cannot change this!
195 n_cd_pstrip = config->GetValue( "NumberOfCDStrips.P", 16 );
196 n_cd_nstrip = config->GetValue( "NumberOfCDStrips.N", 12 );
197
198 // Beam dump initialisation
199 n_bd_det = config->GetValue( "NumberOfBeamDumpDetectors", 1 );
200
201 // SPEDE initialisation
202 //n_spede_seg = config->GetValue( "NumberOfSpedeSegments", 24 );
203 n_spede_seg = config->GetValue( "NumberOfSpedeSegments", 0 );
204
205 // IonChamber initialisation
206 n_ic_layer = config->GetValue( "NumberOfIonChamberLayers", 2 );
207
208 // Pulser events
209 n_pulsers = config->GetValue( "NumberOfPulsers", 2 );
210 if( n_pulsers > 10 ) {
211
212 std::cout << "Number of pulsers limited to 10" << std::endl;
213 n_pulsers = 10;
214
215 }
216
217 // Info code initialisation
218 pause_code = 2;
219 resume_code = 3;
220 sync_msb_code = 14;
221 sync_hsb_code = 15;
222 tm_msb_code = 7;
223 tm_hsb_code = 8;
224 pulser_code = 30; // code for first channel, others are pulser_code+id
225 ebis_sfp = config->GetValue( "EBIS.Sfp", 1 );
226 ebis_board = config->GetValue( "EBIS.Board", 10 );
227 ebis_ch = config->GetValue( "EBIS.Channel", 0 ); // ch 0 if in DGF too!
228 ebis_dgf = config->GetValue( "EBIS.Dgf", 52 );
229 ebis_code = 21;
230 t1_sfp = config->GetValue( "T1.Sfp", 1 );
231 t1_board = config->GetValue( "T1.Board", 10 );
232 t1_ch = config->GetValue( "T1.Channel", 2 );
233 t1_dgf = config->GetValue( "T1.Dgf", 52 );
234 t1_code = 22;
235 sc_sfp = config->GetValue( "SC.Sfp", 1 );
236 sc_board = config->GetValue( "SC.Board", 10 );
237 sc_ch = config->GetValue( "SC.Channel", 4 );
238 sc_dgf = config->GetValue( "SC.Dgf", 52 );
239 sc_code = 23;
240 laser_sfp = config->GetValue( "RILIS.Sfp", 1 );
241 laser_board = config->GetValue( "RILIS.Board", 10 );
242 laser_ch = config->GetValue( "RILIS.Channel", 6 );
243 laser_pattern = config->GetValue( "RILIS.Pattern", 8 ); // channel for laser status
244 laser_code = 24;
245
246
247 // Event builder
248 event_window = config->GetValue( "EventWindow", 3e3 );
249 mbs_event_sort = config->GetValue( "MbsEventSort", true );
250
251 // Hit windows for complex events
252 mb_hit_window = config->GetValue( "MiniballCrystalHitWindow", 400. );
253 ab_hit_window = config->GetValue( "MiniballAddbackHitWindow", 400. );
254 cd_hit_window = config->GetValue( "CDHitWindow", 150. );
255 pad_hit_window = config->GetValue( "PadHitWindow", 150. );
256 ic_hit_window = config->GetValue( "IonChamberHitWindow", 500. );
257
258
259 // Data things
260 block_size = config->GetValue( "DataBlockSize", 0x10000 );
261 flag_febex_only = config->GetValue( "FebexOnlyData", true );
262
263
264 // Pileup and clipped rejection
265 pileup_reject = config->GetValue( "PileupRejection",
266 config->GetValue( "PileUpRejection", false ) );
267 clipped_reject = config->GetValue( "ClippedRejection", true );
268
269
270 // Buffer full rejection
271 bufferfull_reject = config->GetValue( "BufferFullRejection", false );
272 bufferpart_reject = config->GetValue( "BufferPartRejection", false );
273
274 // CD calibrator settings
275 cd_calibrator_max_energy = config->GetValue( "CDCalibrator.MaxEnergy", 2000e3 );
276
277 // Electronics mapping
278 // Will depend on whether we have FEBEX or DGF/ADC combo
279 unsigned int i_size = n_febex_sfp;
280 unsigned int j_size_dgf = n_febex_board;
281 unsigned int j_size_adc = n_febex_board;
282 unsigned int k_size_dgf = n_febex_ch;
283 unsigned int k_size_adc = n_febex_ch;
284
285 // We don't have FEBEX if any of the SFP/board/ch is = 0
286 // but for confidence, check that we have some ADCs or DGFs
287 if( ( !n_febex_sfp || !n_febex_board || !n_febex_ch ) &&
288 ( n_madc_mod || n_caen_mod || n_dgf_mod ) ) {
289
290 i_size = 1;
291 j_size_dgf = GetNumberOfDgfModules();
292 j_size_adc = GetNumberOfAdcModules();
293 k_size_dgf = GetNumberOfDgfChannels();
294 k_size_adc = GetMaximumNumberOfAdcChannels();
295
296 }
297
298 // Resize it all
299 mb_cluster.resize( i_size );
300 mb_crystal.resize( i_size );
301 mb_segment.resize( i_size );
302 cd_det.resize( i_size );
303 cd_sector.resize( i_size );
304 cd_side.resize( i_size );
305 cd_strip.resize( i_size );
306 pad_det.resize( i_size );
307 pad_sector.resize( i_size );
308 bd_det.resize( i_size );
309 spede_seg.resize( i_size );
310 ic_layer.resize( i_size );
311 pulser.resize( i_size );
312
313 for( unsigned int i = 0; i < i_size; ++i ){
314
315 mb_cluster[i].resize( j_size_dgf );
316 mb_crystal[i].resize( j_size_dgf );
317 mb_segment[i].resize( j_size_dgf );
318 bd_det[i].resize( j_size_dgf );
319 spede_seg[i].resize( j_size_dgf );
320 pulser[i].resize( j_size_dgf );
321
322 // DGFs or FEBEX
323 for( unsigned int j = 0; j < j_size_dgf; ++j ){
324
325 mb_cluster[i][j].resize( k_size_dgf );
326 mb_crystal[i][j].resize( k_size_dgf );
327 mb_segment[i][j].resize( k_size_dgf );
328 bd_det[i][j].resize( k_size_dgf );
329 spede_seg[i][j].resize( k_size_dgf );
330 pulser[i][j].resize( k_size_dgf );
331
332 for( unsigned int k = 0; k < k_size_dgf; ++k ){
333
334 mb_cluster[i][j][k] = -1;
335 mb_crystal[i][j][k] = -1;
336 mb_segment[i][j][k] = -1;
337 bd_det[i][j][k] = -1;
338 spede_seg[i][j][k] = -1;
339 pulser[i][j][k] = -1;
340
341 } // k: febex/dgf ch
342
343 } // j: febex/dgf board
344
345 cd_det[i].resize( j_size_adc );
346 cd_sector[i].resize( j_size_adc );
347 cd_side[i].resize( j_size_adc );
348 cd_strip[i].resize( j_size_adc );
349 pad_det[i].resize( j_size_adc );
350 pad_sector[i].resize( j_size_adc );
351 ic_layer[i].resize( j_size_adc );
352
353 // ADCs or FEBEX
354 for( unsigned int j = 0; j < j_size_adc; ++j ){
355
356 cd_det[i][j].resize( k_size_adc );
357 cd_sector[i][j].resize( k_size_adc );
358 cd_side[i][j].resize( k_size_adc );
359 cd_strip[i][j].resize( k_size_adc );
360 pad_det[i][j].resize( k_size_adc );
361 pad_sector[i][j].resize( k_size_adc );
362 ic_layer[i][j].resize( k_size_adc );
363
364 for( unsigned int k = 0; k < k_size_adc; ++k ){
365
366 cd_det[i][j][k] = -1;
367 cd_sector[i][j][k] = -1;
368 cd_side[i][j][k] = -1;
369 cd_strip[i][j][k] = -1;
370 pad_det[i][j][k] = -1;
371 pad_sector[i][j][k] = -1;
372 ic_layer[i][j][k] = -1;
373
374 } // k: febex/adc ch
375
376 } // j: febex/adc board
377
378 } // i: febex sfp
379
380
381 // Miniball array electronics mapping
382 int d, s, b, c, g;
383 mb_sfp.resize( n_mb_cluster );
384 mb_board.resize( n_mb_cluster );
385 mb_dgf.resize( n_mb_cluster );
386 mb_ch.resize( n_mb_cluster );
387 mb_veto.resize( n_mb_cluster );
388
389 for( unsigned int i = 0; i < n_mb_cluster; ++i ){
390
391 mb_sfp[i].resize( n_mb_crystal );
392 mb_board[i].resize( n_mb_crystal );
393 mb_dgf[i].resize( n_mb_crystal );
394 mb_ch[i].resize( n_mb_crystal );
395 mb_veto[i].resize( n_mb_crystal );
396
397 for( unsigned int j = 0; j < n_mb_crystal; ++j ){
398
399 mb_sfp[i][j].resize( n_mb_segment );
400 mb_board[i][j].resize( n_mb_segment );
401 mb_dgf[i][j].resize( n_mb_segment );
402 mb_ch[i][j].resize( n_mb_segment );
403 mb_veto[i][j].resize( n_mb_segment );
404
405 for( unsigned int k = 0; k < n_mb_segment; ++k ){
406
407 d = i*3 + j; // Crystal ordering: 0-23
408 s = 0; // spread 24 crystals over 1 SFPs
409 b = d/2; // 2 crystals per board
410 c = k + 9*(d&0x1); // odd crystals starts at ch9
411 g = d*2; // dgf number is 2 * detector number
412 if( k > 2 ) g++; // but add one for segments 3-6
413 mb_sfp[i][j][k] = config->GetValue( Form( "Miniball_%d_%d_%d.Sfp", i, j, k ), s );
414 mb_board[i][j][k] = config->GetValue( Form( "Miniball_%d_%d_%d.Board", i, j, k ), b );
415 mb_dgf[i][j][k] = config->GetValue( Form( "Miniball_%d_%d_%d.Dgf", i, j, k ), g );
416 mb_ch[i][j][k] = config->GetValue( Form( "Miniball_%d_%d_%d.Channel", i, j, k ), c );
417 mb_veto[i][j][k] = config->GetValue( Form( "Miniball_%d_%d_%d.Veto", i, j, k ), false );
418
419 // Check FEBEX inputs aren't overlapped
420 if( mb_sfp[i][j][k] < n_febex_sfp && n_febex_sfp > 0 &&
421 mb_board[i][j][k] < n_febex_board && n_febex_board > 0 &&
422 mb_ch[i][j][k] < n_febex_ch && n_febex_ch > 0 ){
423
424 if( mb_cluster[mb_sfp[i][j][k]][mb_board[i][j][k]][mb_ch[i][j][k]] >= 0 ||
425 mb_crystal[mb_sfp[i][j][k]][mb_board[i][j][k]][mb_ch[i][j][k]] >= 0 ||
426 mb_segment[mb_sfp[i][j][k]][mb_board[i][j][k]][mb_ch[i][j][k]] >= 0 ) {
427
428 std::cout << "You have defined two Miniball detectors in the same channel:" << std::endl;
429 std::cout << "\tMiniball_" << mb_cluster[mb_sfp[i][j][k]][mb_board[i][j][k]][mb_ch[i][j][k]] << "_";
430 std::cout << mb_crystal[mb_sfp[i][j][k]][mb_board[i][j][k]][mb_ch[i][j][k]] << "_";
431 std::cout << mb_segment[mb_sfp[i][j][k]][mb_board[i][j][k]][mb_ch[i][j][k]] << " and ";
432 std::cout << "Miniball_" << i << "_" << j << "_" << k << std::endl;
433
434 }
435
436 else {
437
438 mb_cluster[mb_sfp[i][j][k]][mb_board[i][j][k]][mb_ch[i][j][k]] = i;
439 mb_crystal[mb_sfp[i][j][k]][mb_board[i][j][k]][mb_ch[i][j][k]] = j;
440 mb_segment[mb_sfp[i][j][k]][mb_board[i][j][k]][mb_ch[i][j][k]] = k;
441
442 }
443
444 }
445
446 // Check DGF inputs aren't overlapped
447 else if( mb_dgf[i][j][k] < n_dgf_mod && n_dgf_mod > 0 &&
448 mb_ch[i][j][k] < n_dgf_ch && n_dgf_ch > 0 ){
449
450 if( mb_cluster[0][mb_dgf[i][j][k]][mb_ch[i][j][k]] >= 0 ||
451 mb_crystal[0][mb_dgf[i][j][k]][mb_ch[i][j][k]] >= 0 ||
452 mb_segment[0][mb_dgf[i][j][k]][mb_ch[i][j][k]] >= 0 ) {
453
454 std::cout << "You have defined two Miniball detectors in the same channel:" << std::endl;
455 std::cout << "\tMiniball_" << mb_cluster[0][mb_dgf[i][j][k]][mb_ch[i][j][k]] << "_";
456 std::cout << mb_crystal[0][mb_dgf[i][j][k]][mb_ch[i][j][k]] << "_";
457 std::cout << mb_segment[0][mb_dgf[i][j][k]][mb_ch[i][j][k]] << " and ";
458 std::cout << "Miniball_" << i << "_" << j << "_" << k << std::endl;
459
460 }
461
462 else {
463
464 mb_cluster[0][mb_dgf[i][j][k]][mb_ch[i][j][k]] = i;
465 mb_crystal[0][mb_dgf[i][j][k]][mb_ch[i][j][k]] = j;
466 mb_segment[0][mb_dgf[i][j][k]][mb_ch[i][j][k]] = k;
467
468 }
469
470
471 }
472
473 else {
474
475 std::cerr << "Dodgy Miniball settings: sfp = " << mb_sfp[i][j][k];
476 if( n_febex_board ) std::cerr << ", board = " << mb_board[i][j][k];
477 if( n_dgf_mod ) std::cerr << ", dgf = " << mb_dgf[i][j][k];
478 std::cerr << ", channel = " << mb_ch[i][j][k] << std::endl;
479
480 }
481
482 } // k: mb segment
483
484 } // j: mb crystal
485
486 } // i: mb cluster
487
488
489 // CD detector electronics mapping
490 unsigned int side_size;
491 std::string side_str;
492 cd_sfp.resize( n_cd_det );
493 cd_board.resize( n_cd_det );
494 cd_adc.resize( n_cd_det );
495 cd_ch.resize( n_cd_det );
496
497 for( unsigned int i = 0; i < n_cd_det; ++i ){
498
499 cd_sfp[i].resize( n_cd_sector );
500 cd_board[i].resize( n_cd_sector );
501 cd_adc[i].resize( n_cd_sector );
502 cd_ch[i].resize( n_cd_sector );
503
504 for( unsigned int j = 0; j < n_cd_sector; ++j ){
505
506 cd_sfp[i][j].resize( n_cd_side );
507 cd_board[i][j].resize( n_cd_side );
508 cd_adc[i][j].resize( n_cd_side );
509 cd_ch[i][j].resize( n_cd_side );
510
511 for( unsigned int k = 0; k < n_cd_side; ++k ){
512
513 // p or n side?
514 if( k == 0 ) side_str = "P";
515 else side_str = "N";
516
517 // p or n side?
518 if( k == 0 ) side_size = n_cd_pstrip;
519 else side_size = n_cd_nstrip;
520
521 cd_sfp[i][j][k].resize( side_size );
522 cd_board[i][j][k].resize( side_size );
523 cd_adc[i][j][k].resize( side_size );
524 cd_ch[i][j][k].resize( side_size );
525
526 for( unsigned int l = 0; l < side_size; ++l ){
527
528 s = 1; // sfp number - all in SFP 1
529 b = j*2 + k; // boards go 0-7
530 c = l;
531 g = j; // adc number is same as segment by default
532 cd_sfp[i][j][k][l] = config->GetValue( Form( "CD_%d_%d_%d.%s.Sfp", i, j, l, side_str.data() ), s );
533 cd_board[i][j][k][l] = config->GetValue( Form( "CD_%d_%d_%d.%s.Board", i, j, l, side_str.data() ), b );
534 cd_adc[i][j][k][l] = config->GetValue( Form( "CD_%d_%d_%d.%s.Adc", i, j, l, side_str.data() ), g );
535 cd_ch[i][j][k][l] = config->GetValue( Form( "CD_%d_%d_%d.%s.Channel", i, j, l, side_str.data() ), c );
536
537 if( cd_sfp[i][j][k][l] < n_febex_sfp && n_febex_sfp > 0 &&
538 cd_board[i][j][k][l] < n_febex_board && n_febex_board > 0 &&
539 cd_ch[i][j][k][l] < n_febex_ch && n_febex_ch > 0 ){
540
541 if( cd_det[cd_sfp[i][j][k][l]][cd_board[i][j][k][l]][cd_ch[i][j][k][l]] >= 0 ||
542 cd_sector[cd_sfp[i][j][k][l]][cd_board[i][j][k][l]][cd_ch[i][j][k][l]] >= 0 ||
543 cd_side[cd_sfp[i][j][k][l]][cd_board[i][j][k][l]][cd_ch[i][j][k][l]] >= 0 ||
544 cd_strip[cd_sfp[i][j][k][l]][cd_board[i][j][k][l]][cd_ch[i][j][k][l]] >= 0 ) {
545
546 std::cout << "You have defined two CD detector strips in the same channel:" << std::endl;
547 std::cout << "\tCD_" << cd_det[cd_sfp[i][j][k][l]][cd_board[i][j][k][l]][cd_ch[i][j][k][l]] << "_";
548 std::cout << cd_sector[cd_sfp[i][j][k][l]][cd_board[i][j][k][l]][cd_ch[i][j][k][l]] << "_";
549 std::cout << cd_strip[cd_sfp[i][j][k][l]][cd_board[i][j][k][l]][cd_ch[i][j][k][l]];
550 if( k == 0 ) std::cout << ".P and" << std::endl;
551 else std::cout << ".N and CD_" << std::endl;
552 std::cout << i << "_" << j << "_" << l;
553 if( k == 0 ) std::cout << ".P" << std::endl;
554 else std::cout << ".N" << std::endl;
555
556 }
557
558 else {
559
560 cd_det[cd_sfp[i][j][k][l]][cd_board[i][j][k][l]][cd_ch[i][j][k][l]] = i;
561 cd_sector[cd_sfp[i][j][k][l]][cd_board[i][j][k][l]][cd_ch[i][j][k][l]] = j;
562 cd_side[cd_sfp[i][j][k][l]][cd_board[i][j][k][l]][cd_ch[i][j][k][l]] = k;
563 cd_strip[cd_sfp[i][j][k][l]][cd_board[i][j][k][l]][cd_ch[i][j][k][l]] = l;
564
565 }
566
567 }
568
569 else if( cd_adc[i][j][k][l] < GetNumberOfAdcModules() && GetNumberOfAdcModules() > 0 &&
571
572
573 if( cd_det[0][cd_adc[i][j][k][l]][cd_ch[i][j][k][l]] >= 0 ||
574 cd_sector[0][cd_adc[i][j][k][l]][cd_ch[i][j][k][l]] >= 0 ||
575 cd_side[0][cd_adc[i][j][k][l]][cd_ch[i][j][k][l]] >= 0 ||
576 cd_strip[0][cd_adc[i][j][k][l]][cd_ch[i][j][k][l]] >= 0 ) {
577
578 std::cout << "You have defined two CD detector strips in the same channel:" << std::endl;
579 std::cout << "\tCD_" << cd_det[0][cd_adc[i][j][k][l]][cd_ch[i][j][k][l]] << "_";
580 std::cout << cd_sector[0][cd_adc[i][j][k][l]][cd_ch[i][j][k][l]] << "_";
581 std::cout << cd_strip[0][cd_adc[i][j][k][l]][cd_ch[i][j][k][l]];
582 if( k == 0 ) std::cout << ".P and" << std::endl;
583 else std::cout << ".N and CD_" << std::endl;
584 std::cout << i << "_" << j << "_" << l;
585 if( k == 0 ) std::cout << ".P" << std::endl;
586 else std::cout << ".N" << std::endl;
587
588 }
589
590 else {
591
592 cd_det[0][cd_adc[i][j][k][l]][cd_ch[i][j][k][l]] = i;
593 cd_sector[0][cd_adc[i][j][k][l]][cd_ch[i][j][k][l]] = j;
594 cd_side[0][cd_adc[i][j][k][l]][cd_ch[i][j][k][l]] = k;
595 cd_strip[0][cd_adc[i][j][k][l]][cd_ch[i][j][k][l]] = l;
596
597 }
598
599 }
600
601 else {
602
603 std::cerr << "Dodgy CD settings: sfp = " << cd_sfp[i][j][k][l];
604 if( n_febex_board > 0 ) std::cerr << ", board = " << cd_board[i][j][k][l];
605 if( GetNumberOfAdcModules() > 0 ) std::cerr << ", adc = " << cd_adc[i][j][k][l];
606 std::cerr << ", channel = " << cd_ch[i][j][k][l] << std::endl;
607
608 }
609
610 } // l: cd strips
611
612 } // k: cd side
613
614 } // j: cd sector
615
616 } // i: cd detector
617
618
619 // PAD detector electronics mapping
620 pad_sfp.resize( n_cd_det );
621 pad_board.resize( n_cd_det );
622 pad_adc.resize( n_cd_det );
623 pad_ch.resize( n_cd_det );
624
625 for( unsigned int i = 0; i < n_cd_det; ++i ){
626
627 pad_sfp[i].resize( n_cd_sector );
628 pad_board[i].resize( n_cd_sector );
629 pad_adc[i].resize( n_cd_sector );
630 pad_ch[i].resize( n_cd_sector );
631
632 for( unsigned int j = 0; j < n_cd_sector; ++j ){
633
634 s = 1;
635 b = 8;
636 c = i*n_cd_sector+j;
637 g = i;
638 pad_sfp[i][j] = config->GetValue( Form( "Pad_%d_%d.Sfp", i, j ), s );
639 pad_board[i][j] = config->GetValue( Form( "Pad_%d_%d.Board", i, j ), b );
640 pad_adc[i][j] = config->GetValue( Form( "Pad_%d_%d.Adc", i, j ), g );
641 pad_ch[i][j] = config->GetValue( Form( "Pad_%d_%d.Channel", i, j ), c );
642
643 if( pad_sfp[i][j] < n_febex_sfp && n_febex_sfp > 0 &&
644 pad_board[i][j] < n_febex_board && n_febex_board > 0 &&
645 pad_ch[i][j] < n_febex_ch && n_febex_ch > 0 ){
646
647 if( pad_det[pad_sfp[i][j]][pad_board[i][j]][pad_ch[i][j]] >= 0 ||
648 pad_sector[pad_sfp[i][j]][pad_board[i][j]][pad_ch[i][j]] >= 0 ) {
649
650 std::cout << "You have defined two Pad detectors in the same channel:" << std::endl;
651 std::cout << "\tPad_" << pad_det[pad_sfp[i][j]][pad_board[i][j]][pad_ch[i][j]] << "_";
652 std::cout << pad_sector[pad_sfp[i][j]][pad_board[i][j]][pad_ch[i][j]] << "and";
653 std::cout << "Pad_" << i << "_" << j << std::endl;
654
655 }
656
657 else {
658
659 pad_det[pad_sfp[i][j]][pad_board[i][j]][pad_ch[i][j]] = i;
660 pad_sector[pad_sfp[i][j]][pad_board[i][j]][pad_ch[i][j]] = j;
661
662 }
663
664 }
665
666 else if( pad_adc[i][j] < GetNumberOfAdcModules() && GetNumberOfAdcModules() > 0 &&
668
669 if( pad_det[0][pad_adc[i][j]][pad_ch[i][j]] >= 0 ||
670 pad_sector[0][pad_adc[i][j]][pad_ch[i][j]] >= 0 ) {
671
672 std::cout << "You have defined two Pad detectors in the same channel:" << std::endl;
673 std::cout << "\tPad_" << pad_det[0][pad_adc[i][j]][pad_ch[i][j]] << "_";
674 std::cout << pad_sector[0][pad_adc[i][j]][pad_ch[i][j]] << "and";
675 std::cout << "Pad_" << i << "_" << j << std::endl;
676
677 }
678
679 else {
680
681 pad_det[0][pad_adc[i][j]][pad_ch[i][j]] = i;
682 pad_sector[0][pad_adc[i][j]][pad_ch[i][j]] = j;
683
684 }
685
686 }
687
688 else {
689
690 std::cerr << "Dodgy PAD settings: sfp = " << pad_sfp[i][j];
691 if( n_febex_board > 0 ) std::cerr << ", board = " << pad_board[i][j];
692 if( GetNumberOfAdcModules() > 0 ) std::cerr << ", adc = " << pad_adc[i][j];
693 std::cerr << ", channel = " << pad_ch[i][j] << std::endl;
694
695 }
696
697 } // j: cd sector
698
699 } // i: cd detector
700
701
702 // Beam dump detector mapping
703 bd_sfp.resize( n_bd_det );
704 bd_board.resize( n_bd_det );
705 bd_dgf.resize( n_bd_det );
706 bd_ch.resize( n_bd_det );
707
708 for( unsigned int i = 0; i < n_bd_det; ++i ){
709
710 bd_sfp[i] = config->GetValue( Form( "BeamDump_%d.Sfp", i ), 1 );
711 bd_board[i] = config->GetValue( Form( "BeamDump_%d.Board", i ), 10 );
712 bd_dgf[i] = config->GetValue( Form( "BeamDump_%d.Dgf", i ), 54 );
713 bd_ch[i] = config->GetValue( Form( "BeamDump_%d.Channel", i ), (int)(i*2+1) );
714
715 if( bd_sfp[i] < n_febex_sfp && n_febex_sfp > 0 &&
717 bd_ch[i] < n_febex_ch && n_febex_ch > 0 ){
718
719 if( bd_det[bd_sfp[i]][bd_board[i]][bd_ch[i]] >= 0 ){
720
721 std::cout << "You have defined two beam-dump detectors in the same channel:" << std::endl;
722 std::cout << "\tBeamDump_" << bd_det[bd_sfp[i]][bd_board[i]][bd_ch[i]] << " and ";
723 std::cout << "BeamDump_" << i << std::endl;
724
725 }
726
727 else {
728
729 bd_det[bd_sfp[i]][bd_board[i]][bd_ch[i]] = i;
730
731 }
732
733 }
734
735 else if( bd_dgf[i] < n_dgf_mod && n_dgf_mod > 0 &&
736 bd_ch[i] < n_dgf_ch && n_dgf_ch > 0 ){
737
738 if( bd_det[0][bd_dgf[i]][bd_ch[i]] >= 0 ){
739
740 std::cout << "You have defined two beam-dump detectors in the same channel:" << std::endl;
741 std::cout << "\tBeamDump_" << bd_det[0][bd_dgf[i]][bd_ch[i]] << " and ";
742 std::cout << "BeamDump_" << i << std::endl;
743
744 }
745
746 else {
747
748 bd_det[0][bd_dgf[i]][bd_ch[i]] = i;
749
750 }
751
752 }
753
754 else {
755
756 std::cerr << "Dodgy beam-dump settings: sfp = " << bd_sfp[i];
757 if( n_febex_board > 0 ) std::cerr << ", board = " << bd_board[i];
758 if( n_dgf_mod > 0 )std::cerr << ", dgf = " << bd_dgf[i];
759 std::cerr << ", channel = " << bd_ch[i] << std::endl;
760
761 }
762
763 } // i: beam dump detector
764
765
766 // SPEDE detector mapping
767 spede_sfp.resize( n_spede_seg );
768 spede_board.resize( n_spede_seg );
769 spede_ch.resize( n_spede_seg );
770
771 for( unsigned int i = 0; i < n_spede_seg; ++i ){
772
773 s = 1;
774 if( i < 16 ){
775 b = 8;
776 c = i;
777 }
778 else {
779 b = 9;
780 c = i-16;
781 }
782
783 spede_sfp[i] = config->GetValue( Form( "Spede_%d.Sfp", i ), s );
784 spede_board[i] = config->GetValue( Form( "Spede_%d.Board", i ), b );
785 spede_ch[i] = config->GetValue( Form( "Spede_%d.Channel", i ), c );
786
787 if( spede_sfp[i] < n_febex_sfp &&
789 spede_ch[i] < n_febex_ch ){
790
791 if( spede_seg[spede_sfp[i]][spede_board[i]][spede_ch[i]] >= 0 ){
792
793 std::cout << "You have defined two SPEDE segments in the same channel:" << std::endl;
794 std::cout << "\tSpede_" << spede_seg[spede_sfp[i]][spede_board[i]][spede_ch[i]] << " and ";
795 std::cout << "Spede_" << i << std::endl;
796
797 }
798
799 else {
800
801 spede_seg[spede_sfp[i]][spede_board[i]][spede_ch[i]] = i;
802
803 }
804
805 }
806
807 else {
808
809 std::cerr << "Dodgy SPEDE settings: sfp = " << spede_sfp[i];
810 std::cerr << ", board = " << spede_board[i];
811 std::cerr << ", channel = " << spede_ch[i] << std::endl;
812
813 }
814
815
816 } // i: SPEDE detector
817
818 // IonChamber detector mapping
819 ic_sfp.resize( n_ic_layer );
820 ic_board.resize( n_ic_layer );
821 ic_adc.resize( n_ic_layer );
822 ic_ch.resize( n_ic_layer );
823
824 for( unsigned int i = 0; i < n_ic_layer; ++i ){
825
826 ic_sfp[i] = config->GetValue( Form( "IonChamber_%d.Sfp", i ), 1 );
827 ic_board[i] = config->GetValue( Form( "IonChamber_%d.Board", i ), 10 );
828 ic_adc[i] = config->GetValue( Form( "IonChamber_%d.Adc", i ), 4 );
829 ic_ch[i] = config->GetValue( Form( "IonChamber_%d.Channel", i ), (int)((i+n_bd_det)*2+1) );
830
831 if( ic_sfp[i] < n_febex_sfp && n_febex_sfp > 0 &&
833 ic_ch[i] < n_febex_ch && n_febex_ch > 0 ){
834
835 if( ic_layer[ic_sfp[i]][ic_board[i]][ic_ch[i]] >= 0 ){
836
837 std::cout << "You have defined two IonChamber elements in the same channel:" << std::endl;
838 std::cout << "\tIonChamber_" << ic_layer[ic_sfp[i]][ic_board[i]][ic_ch[i]] << " and ";
839 std::cout << "IonChamber_" << i << std::endl;
840
841 }
842
843 else {
844
845 ic_layer[ic_sfp[i]][ic_board[i]][ic_ch[i]] = i;
846
847 }
848
849 }
850
851 else if( ic_adc[i] < GetNumberOfAdcModules() && GetNumberOfAdcModules() > 0 &&
853
854 if( ic_layer[0][ic_adc[i]][ic_ch[i]] >= 0 ){
855
856 std::cout << "You have defined two IonChamber elements in the same channel:" << std::endl;
857 std::cout << "\tIonChamber_" << ic_layer[0][ic_adc[i]][ic_ch[i]] << " and ";
858 std::cout << "IonChamber_" << i << std::endl;
859
860 }
861
862 else {
863
864 ic_layer[0][ic_adc[i]][ic_ch[i]] = i;
865
866 }
867
868 }
869
870 else {
871
872 std::cerr << "Dodgy IonChamber settings: sfp = " << ic_sfp[i];
873 if( n_febex_board > 0 ) std::cerr << ", board = " << ic_board[i];
874 if( GetNumberOfAdcModules() > 0 ) std::cerr << ", adc = " << ic_adc[i];
875 std::cerr << ", channel = " << ic_ch[i] << std::endl;
876
877 }
878
879
880 } // i: IonChamber detector
881
882
883 // Pulser input mapping
884 pulser_sfp.resize( n_pulsers );
885 pulser_board.resize( n_pulsers );
886 pulser_ch.resize( n_pulsers );
887
888 for( unsigned int i = 0; i < n_pulsers; ++i ){
889
890 pulser_sfp[i] = config->GetValue( Form( "Pulser_%d.Sfp", i ), (int)i );
891 pulser_board[i] = config->GetValue( Form( "Pulser_%d.Board", i ), 15 );
892 pulser_ch[i] = config->GetValue( Form( "Pulser_%d.Channel", i ), 15 );
893
894 if( pulser_sfp[i] < n_febex_sfp &&
896 pulser_ch[i] < n_febex_ch ){
897
898 if( pulser[pulser_sfp[i]][pulser_board[i]][pulser_ch[i]] >= 0 ){
899
900 std::cout << "You have defined two Sync Pulsers in the same channel:" << std::endl;
901 std::cout << "\tPulser_" << pulser[pulser_sfp[i]][pulser_board[i]][pulser_ch[i]] << " and ";
902 std::cout << "Pulser_" << i << std::endl;
903
904 }
905
906 else {
907
908 pulser[pulser_sfp[i]][pulser_board[i]][pulser_ch[i]] = i;
909
910 }
911
912 }
913
914 else {
915
916 std::cerr << "Dodgy pulser settings: sfp = " << pulser_sfp[i];
917 std::cerr << ", board = " << pulser_board[i];
918 std::cerr << ", channel = " << pulser_ch[i] << std::endl;
919
920 }
921
922 } // i: pulser inputs
923
924 // Finished
925 delete config;
926
927}
928
929
930bool MiniballSettings::IsMiniball( unsigned int dgf, unsigned int ch ) {
931
933 if( dgf < n_dgf_mod && ch < n_dgf_ch ) {
934
935 if( mb_cluster[0][dgf][ch] >= 0 ) return true;
936 else return false;
937 }
938
939 else {
940
941 std::cerr << "Bad Miniball event: dgf = " << dgf;
942 std::cerr << ", channel = " << ch << std::endl;
943 return false;
944
945 }
946
947}
948
949bool MiniballSettings::IsMiniball( unsigned int sfp, unsigned int board, unsigned int ch ) {
950
952 if( sfp < n_febex_sfp && board < n_febex_board && ch < n_febex_ch ) {
953
954 if( mb_cluster[sfp][board][ch] >= 0 ) return true;
955 else return false;
956
957 }
958
959 else {
960
961 std::cerr << "Bad Miniball event: sfp = " << sfp;
962 std::cerr << ", board = " << board;
963 std::cerr << ", channel = " << ch << std::endl;
964 return false;
965
966 }
967
968}
969
970bool MiniballSettings::IsMiniballSegmentVetoed( unsigned int clu, unsigned int cry, unsigned int seg ) {
971
973 if( clu < n_mb_cluster && cry < n_mb_crystal && seg < n_mb_segment )
974 return mb_veto[clu][cry][seg];
975
976 else {
977
978 std::cerr << "Bad Miniball detector: Cluster = " << clu;
979 std::cerr << ", Crystal = " << cry;
980 std::cerr << ", Segment = " << seg << std::endl;
981 return false;
982
983 }
984
985}
986
987int MiniballSettings::GetMiniballID( unsigned int dgf, unsigned int ch,
988 const std::vector<std::vector<std::vector<int>>> &vector ) {
989
991 if( dgf < n_dgf_mod && ch < n_dgf_ch )
992 return vector[0][dgf][ch];
993
994 else {
995
996 std::cerr << "Bad Miniball event: dgf = " << dgf;
997 std::cerr << ", channel = " << ch << std::endl;
998 return 0;
999
1000 }
1001
1002}
1003
1004int MiniballSettings::GetMiniballID( unsigned int sfp, unsigned int board, unsigned int ch,
1005 const std::vector<std::vector<std::vector<int>>> &vector ) {
1006
1008 if( sfp < n_febex_sfp && board < n_febex_board && ch < n_febex_ch )
1009 return vector[sfp][board][ch];
1010
1011 else {
1012
1013 std::cerr << "Bad Miniball event: sfp = " << sfp;
1014 std::cerr << ", board = " << board;
1015 std::cerr << ", channel = " << ch << std::endl;
1016 return 0;
1017
1018 }
1019
1020}
1021
1022std::vector<int> MiniballSettings::GetMiniballDAQ( unsigned int clu, unsigned int cry, unsigned int seg ) {
1023
1030
1031 std::vector<int> daqinfo(3,-1);
1032
1033 // Loop over all FEBEX SFPs, boards and channels to find a match
1034 for( unsigned int i = 0; i < GetNumberOfFebexSfps(); ++i ) {
1035
1036 for( unsigned int j = 0; j < GetNumberOfFebexBoards(); ++j ) {
1037
1038 for( unsigned int k = 0; k < GetNumberOfFebexChannels(); ++k ) {
1039
1040 // test for complete match
1041 if( GetMiniballCluster(i,j,k) == (int)clu &&
1042 GetMiniballCrystal(i,j,k) == (int)cry &&
1043 GetMiniballSegment(i,j,k) == (int)seg ) {
1044
1045 daqinfo[0] = i;
1046 daqinfo[1] = j;
1047 daqinfo[2] = k;
1048 return daqinfo;
1049
1050 } // test
1051
1052 } // k - channel
1053
1054 } // j - board
1055
1056 } // i - sfp
1057
1058 // Loop over all DGF modules and channels to find a match
1059 // only here if we didn't find a match in FEBEX
1060 for( unsigned int i = 0; i < GetNumberOfDgfModules(); ++i ) {
1061
1062 for( unsigned int j = 0; j < GetNumberOfDgfChannels(); ++j ) {
1063
1064 // test for complete match
1065 if( GetMiniballCluster(i,j) == (int)clu &&
1066 GetMiniballCrystal(i,j) == (int)cry &&
1067 GetMiniballSegment(i,j) == (int)seg ) {
1068
1069 daqinfo[0] = -1;
1070 daqinfo[1] = i;
1071 daqinfo[2] = j;
1072 return daqinfo;
1073
1074 } // test
1075
1076 } // j - channel
1077
1078 } // i - module
1079
1080 return daqinfo;
1081
1082};
1083
1084
1085bool MiniballSettings::IsCD( unsigned int adc, unsigned int ch ) {
1086
1089
1090 if( cd_det[0][adc][ch] >= 0 ) return true;
1091 else return false;
1092
1093 }
1094
1095 else {
1096
1097 std::cerr << "Bad CD event: adc = " << adc;
1098 std::cerr << ", channel = " << ch << std::endl;
1099 return false;
1100
1101 }
1102
1103}
1104
1105bool MiniballSettings::IsCD( unsigned int sfp, unsigned int board, unsigned int ch ) {
1106
1108 if( sfp < n_febex_sfp && board < n_febex_board && ch < n_febex_ch ) {
1109
1110 if( cd_det[sfp][board][ch] >= 0 ) return true;
1111 else return false;
1112
1113 }
1114
1115 else {
1116
1117 std::cerr << "Bad CD event: sfp = " << sfp;
1118 std::cerr << ", board = " << board;
1119 std::cerr << ", channel = " << ch << std::endl;
1120 return false;
1121
1122 }
1123
1124}
1125
1126int MiniballSettings::GetCDID( unsigned int adc, unsigned int ch,
1127 const std::vector<std::vector<std::vector<int>>> &vector ) {
1128
1131 return vector[0][adc][ch];
1132
1133 else {
1134
1135 std::cerr << "Bad CD event: adc = " << adc;
1136 std::cerr << ", channel = " << ch << std::endl;
1137 return 0;
1138
1139 }
1140
1141}
1142
1143int MiniballSettings::GetCDID( unsigned int sfp, unsigned int board, unsigned int ch,
1144 const std::vector<std::vector<std::vector<int>>> &vector ) {
1145
1147 if( sfp < n_febex_sfp && board < n_febex_board && ch < n_febex_ch )
1148 return vector[sfp][board][ch];
1149
1150 else {
1151
1152 std::cerr << "Bad CD event: sfp = " << sfp;
1153 std::cerr << ", board = " << board;
1154 std::cerr << ", channel = " << ch << std::endl;
1155 return 0;
1156
1157 }
1158
1159}
1160
1161std::vector<int> MiniballSettings::GetCDDAQ( unsigned int det, unsigned int sec, unsigned int side, unsigned int strip ) {
1162
1170
1171 std::vector<int> daqinfo(3,-1);
1172
1173 // Loop over all FEBEX SFPs, boards and channels to find a match
1174 for( unsigned int i = 0; i < GetNumberOfFebexSfps(); ++i ) {
1175
1176 for( unsigned int j = 0; j < GetNumberOfFebexBoards(); ++j ) {
1177
1178 for( unsigned int k = 0; k < GetNumberOfFebexChannels(); ++k ) {
1179
1180 // test for complete match
1181 if( GetCDDetector(i,j,k) == (int)det &&
1182 GetCDSector(i,j,k) == (int)sec &&
1183 GetCDSide(i,j,k) == (int)side &&
1184 GetCDStrip(i,j,k) == (int)strip ) {
1185
1186 daqinfo[0] = i;
1187 daqinfo[1] = j;
1188 daqinfo[2] = k;
1189 return daqinfo;
1190
1191 } // test
1192
1193 } // k - channel
1194
1195 } // j - board
1196
1197 } // i - sfp
1198
1199 // Loop over all ADC modules and channels to find a match
1200 // only here if we didn't find a match in FEBEX
1201 for( unsigned int i = 0; i < GetNumberOfAdcModules(); ++i ) {
1202
1203 for( unsigned int j = 0; j < GetMaximumNumberOfAdcChannels(); ++j ) {
1204
1205 // test for complete match
1206 if( GetCDDetector(i,j) == (int)det &&
1207 GetCDSector(i,j) == (int)sec &&
1208 GetCDSide(i,j) == (int)side &&
1209 GetCDStrip(i,j) == (int)strip ) {
1210
1211 daqinfo[0] = -1;
1212 daqinfo[1] = i;
1213 daqinfo[2] = j;
1214 return daqinfo;
1215
1216 } // test
1217
1218 } // j - channel
1219
1220 } // i - module
1221
1222 return daqinfo;
1223
1224};
1225
1226
1227bool MiniballSettings::IsPad( unsigned int adc, unsigned int ch ) {
1228
1231
1232 if( pad_det[0][adc][ch] >= 0 ) return true;
1233 else return false;
1234
1235 }
1236
1237 else {
1238
1239 std::cerr << "Bad Pad event: adc = " << adc;
1240 std::cerr << ", channel = " << ch << std::endl;
1241 return false;
1242
1243 }
1244
1245}
1246
1247bool MiniballSettings::IsPad( unsigned int sfp, unsigned int board, unsigned int ch ) {
1248
1250 if( sfp < n_febex_sfp && board < n_febex_board && ch < n_febex_ch ) {
1251
1252 if( pad_det[sfp][board][ch] >= 0 ) return true;
1253 else return false;
1254
1255 }
1256
1257 else {
1258
1259 std::cerr << "Bad Pad event: sfp = " << sfp;
1260 std::cerr << ", board = " << board;
1261 std::cerr << ", channel = " << ch << std::endl;
1262 return false;
1263
1264 }
1265
1266}
1267
1268int MiniballSettings::GetPadDetector( unsigned int adc, unsigned int ch ) {
1269
1272 return pad_det[0][adc][ch];
1273
1274 else {
1275
1276 std::cerr << "Bad Pad event: adc = " << adc;
1277 std::cerr << ", channel = " << ch << std::endl;
1278 return false;
1279
1280 }
1281
1282}
1283
1284int MiniballSettings::GetPadDetector( unsigned int sfp, unsigned int board, unsigned int ch ) {
1285
1287 if( sfp < n_febex_sfp && board < n_febex_board && ch < n_febex_ch )
1288 return pad_det[sfp][board][ch];
1289
1290 else {
1291
1292 std::cerr << "Bad Pad event: sfp = " << sfp;
1293 std::cerr << ", board = " << board;
1294 std::cerr << ", channel = " << ch << std::endl;
1295 return false;
1296
1297 }
1298
1299}
1300
1301int MiniballSettings::GetPadSector( unsigned int adc, unsigned int ch ) {
1302
1305 return pad_sector[0][adc][ch];
1306
1307 else {
1308
1309 std::cerr << "Bad Pad event: adc = " << adc;
1310 std::cerr << ", channel = " << ch << std::endl;
1311 return 0;
1312
1313 }
1314
1315}
1316
1317int MiniballSettings::GetPadSector( unsigned int sfp, unsigned int board, unsigned int ch ) {
1318
1320 if( sfp < n_febex_sfp && board < n_febex_board && ch < n_febex_ch )
1321 return pad_sector[sfp][board][ch];
1322
1323 else {
1324
1325 std::cerr << "Bad Pad event: sfp = " << sfp;
1326 std::cerr << ", board = " << board;
1327 std::cerr << ", channel = " << ch << std::endl;
1328 return 0;
1329
1330 }
1331
1332}
1333
1334std::vector<int> MiniballSettings::GetPadDAQ( unsigned int det, unsigned int sec ) {
1335
1341
1342 std::vector<int> daqinfo(3,-1);
1343
1344 // Loop over all FEBEX SFPs, boards and channels to find a match
1345 for( unsigned int i = 0; i < GetNumberOfFebexSfps(); ++i ) {
1346
1347 for( unsigned int j = 0; j < GetNumberOfFebexBoards(); ++j ) {
1348
1349 for( unsigned int k = 0; k < GetNumberOfFebexChannels(); ++k ) {
1350
1351 // test for complete match
1352 if( GetPadDetector(i,j,k) == (int)det &&
1353 GetPadSector(i,j,k) == (int)sec ) {
1354
1355 daqinfo[0] = i;
1356 daqinfo[1] = j;
1357 daqinfo[2] = k;
1358 return daqinfo;
1359
1360 } // test
1361
1362 } // k - channel
1363
1364 } // j - board
1365
1366 } // i - sfp
1367
1368 // Loop over all ADC modules and channels to find a match
1369 // only here if we didn't find a match in FEBEX
1370 for( unsigned int i = 0; i < GetNumberOfAdcModules(); ++i ) {
1371
1372 for( unsigned int j = 0; j < GetMaximumNumberOfAdcChannels(); ++j ) {
1373
1374 // test for complete match
1375 if( GetPadDetector(i,j) == (int)det &&
1376 GetPadSector(i,j) == (int)sec ) {
1377
1378 daqinfo[0] = -1;
1379 daqinfo[1] = i;
1380 daqinfo[2] = j;
1381 return daqinfo;
1382
1383 } // test
1384
1385 } // j - channel
1386
1387 } // i - module
1388
1389 return daqinfo;
1390
1391};
1392
1393
1394bool MiniballSettings::IsBeamDump( unsigned int dgf, unsigned int ch ) {
1395
1397 if( GetBeamDumpDetector(dgf,ch) >= 0 ) return true;
1398 else return false;
1399
1400}
1401
1402bool MiniballSettings::IsBeamDump( unsigned int sfp, unsigned int board, unsigned int ch ) {
1403
1405 if( GetBeamDumpDetector(sfp,board,ch) >= 0 ) return true;
1406 else return false;
1407
1408}
1409
1410int MiniballSettings::GetBeamDumpDetector( unsigned int dgf, unsigned int ch ) {
1411
1413 if( dgf < n_dgf_mod && ch < n_dgf_ch )
1414 return bd_det[0][dgf][ch];
1415
1416 else {
1417
1418 std::cerr << "Bad beam dump event: dgf = " << dgf;
1419 std::cerr << ", channel = " << ch << std::endl;
1420 return 0;
1421
1422 }
1423
1424}
1425
1426int MiniballSettings::GetBeamDumpDetector( unsigned int sfp, unsigned int board, unsigned int ch ) {
1427
1429 if( sfp < n_febex_sfp && board < n_febex_board && ch < n_febex_ch )
1430 return bd_det[sfp][board][ch];
1431
1432 else {
1433
1434 std::cerr << "Bad beam dump event: sfp = " << sfp;
1435 std::cerr << ", board = " << board;
1436 std::cerr << ", channel = " << ch << std::endl;
1437 return 0;
1438
1439 }
1440
1441}
1442
1443std::vector<int> MiniballSettings::GetBeamDumpDAQ( unsigned int det ) {
1444
1449
1450 std::vector<int> daqinfo(3,-1);
1451
1452 // Loop over all FEBEX SFPs, boards and channels to find a match
1453 for( unsigned int i = 0; i < GetNumberOfFebexSfps(); ++i ) {
1454
1455 for( unsigned int j = 0; j < GetNumberOfFebexBoards(); ++j ) {
1456
1457 for( unsigned int k = 0; k < GetNumberOfFebexChannels(); ++k ) {
1458
1459 // test for complete match
1460 if( GetBeamDumpDetector(i,j,k) == (int)det ) {
1461
1462 daqinfo[0] = i;
1463 daqinfo[1] = j;
1464 daqinfo[2] = k;
1465 return daqinfo;
1466
1467 } // test
1468
1469 } // k - channel
1470
1471 } // j - board
1472
1473 } // i - sfp
1474
1475 // Loop over all DGF modules and channels to find a match
1476 // only here if we didn't find a match in FEBEX
1477 for( unsigned int i = 0; i < GetNumberOfDgfModules(); ++i ) {
1478
1479 for( unsigned int j = 0; j < GetNumberOfDgfChannels(); ++j ) {
1480
1481 // test for complete match
1482 if( GetBeamDumpDetector(i,j) == (int)det ) {
1483
1484 daqinfo[0] = -1;
1485 daqinfo[1] = i;
1486 daqinfo[2] = j;
1487 return daqinfo;
1488
1489 } // test
1490
1491 } // j - channel
1492
1493 } // i - module
1494
1495 return daqinfo;
1496
1497};
1498
1499
1500bool MiniballSettings::IsSpede( unsigned int sfp, unsigned int board, unsigned int ch ) {
1501
1503 if( GetSpedeSegment(sfp,board,ch) >= 0 ) return true;
1504 else return false;
1505
1506}
1507
1508int MiniballSettings::GetSpedeSegment( unsigned int sfp, unsigned int board, unsigned int ch ) {
1509
1511 if( sfp < n_febex_sfp && board < n_febex_board && ch < n_febex_ch )
1512 return spede_seg[sfp][board][ch];
1513
1514 else {
1515
1516 std::cerr << "Bad SPEDE event: sfp = " << sfp;
1517 std::cerr << ", board = " << board;
1518 std::cerr << ", channel = " << ch << std::endl;
1519 return 0;
1520
1521 }
1522
1523}
1524
1525std::vector<int> MiniballSettings::GetSpedeDAQ( unsigned int seg ) {
1526
1531
1532 std::vector<int> daqinfo(3,-1);
1533
1534 // Loop over all FEBEX SFPs, boards and channels to find a match
1535 for( unsigned int i = 0; i < GetNumberOfFebexSfps(); ++i ) {
1536
1537 for( unsigned int j = 0; j < GetNumberOfFebexBoards(); ++j ) {
1538
1539 for( unsigned int k = 0; k < GetNumberOfFebexChannels(); ++k ) {
1540
1541 // test for complete match
1542 if( GetSpedeSegment(i,j,k) == (int)seg ) {
1543
1544 daqinfo[0] = i;
1545 daqinfo[1] = j;
1546 daqinfo[2] = k;
1547 return daqinfo;
1548
1549 } // test
1550
1551 } // k - channel
1552
1553 } // j - board
1554
1555 } // i - sfp
1556
1557 // SPEDE never worked with the old Marabou DAQ, so we don't search
1558 // through the DGFs or ADCs to look for the mapping.
1559
1560 return daqinfo;
1561
1562};
1563
1564
1565bool MiniballSettings::IsIonChamber( unsigned int adc, unsigned int ch ) {
1566
1568 if( GetIonChamberLayer(adc,ch) >= 0 ) return true;
1569 else return false;
1570
1571}
1572
1573bool MiniballSettings::IsIonChamber( unsigned int sfp, unsigned int board, unsigned int ch ) {
1574
1576 if( GetIonChamberLayer(sfp,board,ch) >= 0 ) return true;
1577 else return false;
1578
1579}
1580
1581int MiniballSettings::GetIonChamberLayer( unsigned int adc, unsigned int ch ) {
1582
1585 return ic_layer[0][adc][ch];
1586
1587 else {
1588
1589 std::cerr << "Bad IonChamber event: adc = " << adc;
1590 std::cerr << ", channel = " << ch << std::endl;
1591 return 0;
1592
1593 }
1594
1595}
1596
1597int MiniballSettings::GetIonChamberLayer( unsigned int sfp, unsigned int board, unsigned int ch ) {
1598
1600 if( sfp < n_febex_sfp && board < n_febex_board && ch < n_febex_ch )
1601 return ic_layer[sfp][board][ch];
1602
1603 else {
1604
1605 std::cerr << "Bad IonChamber event: sfp = " << sfp;
1606 std::cerr << ", board = " << board;
1607 std::cerr << ", channel = " << ch << std::endl;
1608 return 0;
1609
1610 }
1611
1612}
1613
1614std::vector<int> MiniballSettings::GetIonChamberDAQ( unsigned int layer ) {
1615
1620
1621 std::vector<int> daqinfo(3,-1);
1622
1623 // Loop over all FEBEX SFPs, boards and channels to find a match
1624 for( unsigned int i = 0; i < GetNumberOfFebexSfps(); ++i ) {
1625
1626 for( unsigned int j = 0; j < GetNumberOfFebexBoards(); ++j ) {
1627
1628 for( unsigned int k = 0; k < GetNumberOfFebexChannels(); ++k ) {
1629
1630 // test for complete match
1631 if( GetIonChamberLayer(i,j) == (int)layer ) {
1632
1633 daqinfo[0] = i;
1634 daqinfo[1] = j;
1635 daqinfo[2] = k;
1636 return daqinfo;
1637
1638 } // test
1639
1640 } // k - channel
1641
1642 } // j - board
1643
1644 } // i - sfp
1645
1646 // Loop over all ADC modules and channels to find a match
1647 // only here if we didn't find a match in FEBEX
1648 for( unsigned int i = 0; i < GetNumberOfAdcModules(); ++i ) {
1649
1650 for( unsigned int j = 0; j < GetMaximumNumberOfAdcChannels(); ++j ) {
1651
1652 // test for complete match
1653 if( GetIonChamberLayer(i,j) == (int)layer ) {
1654
1655 daqinfo[0] = -1;
1656 daqinfo[1] = i;
1657 daqinfo[2] = j;
1658 return daqinfo;
1659
1660 } // test
1661
1662 } // j - channel
1663
1664 } // i - module
1665
1666 return daqinfo;
1667
1668};
1669
1670
1671bool MiniballSettings::IsPulser( unsigned int sfp, unsigned int board, unsigned int ch ) {
1672
1674 if( GetPulser(sfp,board,ch) >= 0 ) return true;
1675 else return false;
1676
1677}
1678
1679int MiniballSettings::GetPulser( unsigned int sfp, unsigned int board, unsigned int ch ) {
1680
1682 if( sfp < n_febex_sfp && board < n_febex_board && ch < n_febex_ch )
1683 return pulser[sfp][board][ch];
1684
1685 else {
1686
1687 std::cerr << "Bad pulser event: sfp = " << sfp;
1688 std::cerr << ", board = " << board;
1689 std::cerr << ", channel = " << ch << std::endl;
1690 return 0;
1691
1692 }
1693
1694}
ClassImp(MiniballSettings) MiniballSettings
Definition Settings.cc:3
unsigned int n_pattern_unit
Number of pattern unit modules.
Definition Settings.hh:426
unsigned int dgf_mod_offset
module number offset for the DGFs
Definition Settings.hh:418
unsigned int n_caen_mod
Number of CAEN ADC modules.
Definition Settings.hh:420
unsigned int pulser_code
Info code when we have a pulser event in InfoData packets.
Definition Settings.hh:528
unsigned int ebis_sfp
Location of the EBIS signal in the FEBEX system (sfp)
Definition Settings.hh:529
unsigned int caen_mod_offset
module number offset for the CAEN ADCs
Definition Settings.hh:422
double mb_hit_window
Prompt time for correlated Miniball events in crystal, i.e. segmen-core events.
Definition Settings.hh:555
unsigned int GetNumberOfFebexSfps()
Definition Settings.hh:36
unsigned int n_madc_mod
Number of Mesytec ADC modules.
Definition Settings.hh:423
std::vector< std::vector< std::vector< int > > > cd_det
A channel map for the CD detectors (-1 if not a CD, 0 forward CD, 1 backward CD)
Definition Settings.hh:468
unsigned int ebis_dgf
Location of the EBIS signal in the DGF system (module)
Definition Settings.hh:530
unsigned int n_scaler_unit
Number of scaler unit modules.
Definition Settings.hh:428
bool IsCD(unsigned int adc, unsigned int ch)
Definition Settings.cc:1085
std::vector< unsigned int > bd_dgf
A list of DGF module numbers for each beam dump detector.
Definition Settings.hh:488
unsigned int laser_board
Location of the RILIS laser signal in the FEBEX system (board)
Definition Settings.hh:545
unsigned int block_size
not yet implemented, needs C++ style reading of data files
Definition Settings.hh:562
unsigned int ebis_ch
Location of the EBIS signal in the FEBEX system (channel)
Definition Settings.hh:532
std::vector< int > GetCDDAQ(unsigned int det, unsigned int sec, unsigned int side, unsigned int strip)
Definition Settings.cc:1161
unsigned int GetRILISChannel()
Definition Settings.hh:167
unsigned int adc_vme_first
Definition Settings.hh:433
unsigned int laser_sfp
Location of the RILIS laser signal in the FEBEX system (sfp)
Definition Settings.hh:544
unsigned int dgf_vme_last
Marabou IDs for DGFs.
Definition Settings.hh:432
std::vector< std::vector< std::vector< bool > > > mb_veto
A boolean to check if we need to veto any segments.
Definition Settings.hh:448
int GetIonChamberLayer(unsigned int adc, unsigned int ch)
Definition Settings.cc:1581
std::vector< unsigned int > pulser_sfp
A list of SFP numbers for each pulser.
Definition Settings.hh:515
std::vector< std::vector< unsigned int > > pad_ch
A list of channel numbers for each PAD detector.
Definition Settings.hh:477
void TestSettings()
Definition Settings.cc:20
unsigned int dgf_ts_mod_offset
module number offset for the timestamper DGFs
Definition Settings.hh:419
std::vector< std::vector< std::vector< std::vector< unsigned int > > > > cd_adc
A list of ADC module numbers for each CD detector, sector, side and strip.
Definition Settings.hh:466
unsigned int GetNumberOfFebexChannels()
Definition Settings.hh:38
unsigned int n_cd_nstrip
number of n-side strips
Definition Settings.hh:458
std::vector< unsigned int > ic_board
A list of board numbers for each IonChamber segment.
Definition Settings.hh:507
unsigned int tm_msb_code
Medium significant bits of the timestamp are here.
Definition Settings.hh:524
unsigned int n_cd_sector
number of sectors in the CD (or quadrants, it's 4)
Definition Settings.hh:455
unsigned int pattern_unit_offset
module number offset for the pattern units
Definition Settings.hh:427
std::vector< std::vector< std::vector< std::vector< unsigned int > > > > cd_ch
A list of channel numbers for each CD detector, sector, side and strip.
Definition Settings.hh:467
bool clipped_reject
reject events that are clipped by the ADC range
Definition Settings.hh:567
unsigned int ebis_code
Info code when we have an EBIS event in InfoData packets.
Definition Settings.hh:533
double ab_hit_window
Prompt time for correlated Miniball events in cluster, i.e. addback events.
Definition Settings.hh:556
int GetSpedeSegment(unsigned int sfp, unsigned int board, unsigned int ch)
Definition Settings.cc:1508
unsigned int pattern_vme_last
Marabou IDs for pattern unit modules.
Definition Settings.hh:435
unsigned int GetEBISChannel()
Definition Settings.hh:150
int GetMiniballSegment(unsigned int dgf, unsigned int ch)
Definition Settings.hh:217
int GetPadDetector(unsigned int adc, unsigned int ch)
Definition Settings.cc:1268
bool IsIonChamber(unsigned int adc, unsigned int ch)
Definition Settings.cc:1565
std::vector< int > GetIonChamberDAQ(unsigned int layer)
Definition Settings.cc:1614
int GetPadSector(unsigned int adc, unsigned int ch)
Definition Settings.cc:1301
double dgf_ts_units
Definition Settings.hh:577
unsigned int n_cd_pstrip
number of p-side strips
Definition Settings.hh:457
bool IsPulser(unsigned int sfp, unsigned int board, unsigned int ch)
Definition Settings.cc:1671
void ReadSettings()
Definition Settings.cc:136
std::vector< unsigned int > ic_ch
A list of channel numbers for each IonChamber segment.
Definition Settings.hh:509
double cd_calibrator_max_energy
Max energy to fill spectra to calibrate CD strips with CD calibrator; default is 2000e3 keV.
Definition Settings.hh:461
unsigned int n_madc_ch
Number of Mesytec ADC channels.
Definition Settings.hh:424
unsigned int laser_ch
Location of the RILIS laser signal in the FEBEX system (channel)
Definition Settings.hh:546
std::vector< std::vector< unsigned int > > pad_board
A list of board numbers for each PAD detector.
Definition Settings.hh:475
unsigned int GetT1Channel()
Definition Settings.hh:156
std::vector< std::vector< std::vector< int > > > pad_det
A channel map for the PAD detectors (-1 if not a PAD, 0 forward CD-PAD, 1 backward CD-PAD)
Definition Settings.hh:478
int GetMiniballCrystal(unsigned int dgf, unsigned int ch)
Definition Settings.hh:211
unsigned int GetSCChannel()
Definition Settings.hh:162
int GetMiniballID(unsigned int dgf, unsigned int ch, const std::vector< std::vector< std::vector< int > > > &vector)
Definition Settings.cc:987
ClassDef(MiniballSettings, 3) private unsigned int n_febex_sfp
Number of SFPs in acquisition.
Definition Settings.hh:403
std::vector< unsigned int > bd_ch
A list of channel numbers for each beam dump detector.
Definition Settings.hh:489
std::vector< std::vector< std::vector< unsigned int > > > mb_sfp
A list of SFP numbers for each MB cluster, crystal and segment.
Definition Settings.hh:444
unsigned int sync_msb_code
Sync pulse code from Exploder (msb)
Definition Settings.hh:522
unsigned int GetNumberOfDgfChannels()
Definition Settings.hh:43
std::vector< unsigned int > spede_ch
A list of channel numbers for each SPEDE segment.
Definition Settings.hh:499
int GetMiniballCluster(unsigned int dgf, unsigned int ch)
Definition Settings.hh:205
void SetFile(std::string filename)
Definition Settings.hh:28
unsigned int n_caen_ch
Number of CAENADC channels.
Definition Settings.hh:421
bool mbs_event_sort
Flag to define if we sort MBS data by readout event (true), or by global time (false)
Definition Settings.hh:552
unsigned int scaler_unit_offset
module number offset for the scaler units
Definition Settings.hh:429
std::vector< unsigned int > bd_board
A list of board numbers for each beam dump detector.
Definition Settings.hh:487
unsigned int n_mb_cluster
Miniball usuall has 8 triple cluster detectors.
Definition Settings.hh:439
int GetCDStrip(unsigned int adc, unsigned int ch)
Definition Settings.hh:275
unsigned int GetRILISBoard()
Definition Settings.hh:166
bool IsPad(unsigned int adc, unsigned int ch)
Definition Settings.cc:1227
unsigned int t1_sfp
Location of the T1 signal in the FEBEX system (sfp)
Definition Settings.hh:534
double cd_hit_window
Prompt time for correlated CD events.
Definition Settings.hh:557
std::vector< unsigned int > spede_board
A list of board numbers for each SPEDE segment.
Definition Settings.hh:497
std::vector< int > GetSpedeDAQ(unsigned int seg)
Definition Settings.cc:1525
int GetCDSector(unsigned int adc, unsigned int ch)
Definition Settings.hh:263
bool pileup_reject
reject events where the pileup flag is set by the MWD firmware
Definition Settings.hh:566
int GetCDDetector(unsigned int adc, unsigned int ch)
Definition Settings.hh:257
std::vector< unsigned int > spede_sfp
A list of SFP numbers for each SPEDE segment.
Definition Settings.hh:496
unsigned int n_spede_seg
Number of SPEDE segments, usually 24.
Definition Settings.hh:493
double caen_ts_units
Definition Settings.hh:578
unsigned int GetSCSfp()
Definition Settings.hh:159
std::vector< std::vector< std::vector< std::vector< unsigned int > > > > cd_board
A list of board numbers for each CD detector, sector, side and strip.
Definition Settings.hh:465
std::vector< std::vector< std::vector< int > > > pad_sector
Definition Settings.hh:479
std::vector< std::vector< std::vector< unsigned int > > > mb_dgf
A list of DGF module numbers for each MB cluster, crystal and segment.
Definition Settings.hh:446
unsigned int n_bd_det
Number of beam dump detectors.
Definition Settings.hh:483
bool flag_febex_only
when there is only FEBEX data in the file
Definition Settings.hh:563
unsigned int t1_dgf
Location of the T1 signal in the DGF system (module)
Definition Settings.hh:535
unsigned int scaler_vme_last
Marabou IDs for scaler modules.
Definition Settings.hh:434
std::vector< std::vector< std::vector< unsigned int > > > mb_board
A list of board numbers for each MB cluster, crystal and segment.
Definition Settings.hh:445
unsigned int n_dgf_ch
Number of DGF channels.
Definition Settings.hh:417
unsigned int t1_code
Info code when we have a T1 event in InfoData packets.
Definition Settings.hh:538
unsigned int GetT1Board()
Definition Settings.hh:154
std::vector< unsigned int > ic_adc
A list of ADC module numbers for each IonChamber segment.
Definition Settings.hh:508
unsigned int ebis_board
Location of the EBIS signal in the FEBEX system (board)
Definition Settings.hh:531
double pad_hit_window
Prompt time for correlated CD-Pad events.
Definition Settings.hh:558
std::vector< std::vector< std::vector< int > > > cd_strip
A channel map for the CD strips IDs (-1 if not a CD, strip ID otherwise)
Definition Settings.hh:471
unsigned int n_cd_side
number of sides, it's always 2, i.e. p-side and n-side
Definition Settings.hh:456
unsigned int laser_pattern
Location of the RILIS laser signal in the pattern unit (channel)
Definition Settings.hh:547
unsigned int GetNumberOfAdcModules()
Definition Settings.hh:61
bool IsMiniballSegmentVetoed(unsigned int clu, unsigned int cry, unsigned int seg)
Definition Settings.cc:970
std::vector< std::vector< std::vector< std::vector< unsigned int > > > > cd_sfp
A list of SFP numbers for each CD detector, sector, side and strip.
Definition Settings.hh:464
unsigned int GetEBISSfp()
Definition Settings.hh:147
std::vector< std::vector< std::vector< int > > > bd_det
A channel map for the beam dump detectors (-1 if not a beam dump, otherwise detector number)
Definition Settings.hh:490
std::vector< std::vector< std::vector< int > > > mb_cluster
A channel map for the Miniball cluster IDs (-1 if not Miniball)
Definition Settings.hh:449
unsigned int madc_mod_offset
module number offset for the MADCs
Definition Settings.hh:425
unsigned int n_dgf_ts_mod
Number of DGF timestamp modules (subset of n_dgf_mod)
Definition Settings.hh:416
std::vector< std::vector< std::vector< int > > > cd_sector
A channel map for the CD sectors (-1 if not a CD, 0-3 for quadrants)
Definition Settings.hh:469
std::vector< std::vector< std::vector< int > > > ic_layer
A channel map for the IonChamber segments (-1 if not a IonChamber, otherwise layer number,...
Definition Settings.hh:510
std::vector< std::vector< std::vector< unsigned int > > > mb_ch
A list of channel numbers for each MB cluster, crystal and segment.
Definition Settings.hh:447
unsigned int laser_code
Info code when we have a RILIS Laser ON coincidence with EBIS in InfoData packets.
Definition Settings.hh:548
unsigned int n_ic_layer
Number of IonChamber layers, usually 2, dE (gas) and E (Si)
Definition Settings.hh:503
std::vector< int > GetMiniballDAQ(unsigned int clu, unsigned int cry, unsigned int seg)
Definition Settings.cc:1022
unsigned int sc_sfp
Location of the SuperCycle signal in the FEBEX system (sfp)
Definition Settings.hh:539
bool IsSpede(unsigned int sfp, unsigned int board, unsigned int ch)
Definition Settings.cc:1500
std::vector< std::vector< std::vector< int > > > cd_side
A channel map for the CD sides (-1 if not a CD, 0 for p-side, 1 for n-side)
Definition Settings.hh:470
double ic_hit_window
Prompt time for correlated ionchamber events.
Definition Settings.hh:559
bool IsMiniball(unsigned int dgf, unsigned int ch)
Definition Settings.cc:930
std::vector< unsigned int > ic_sfp
A list of SFP numbers for each IonChamber segment.
Definition Settings.hh:506
bool IsBeamDump(unsigned int dgf, unsigned int ch)
Definition Settings.cc:1394
unsigned int n_mb_segment
Number of sgements in a crystal is 7, including core = 0.
Definition Settings.hh:441
int GetBeamDumpDetector(unsigned int dgf, unsigned int ch)
Definition Settings.cc:1410
int GetCDID(unsigned int adc, unsigned int ch, const std::vector< std::vector< std::vector< int > > > &vector)
Definition Settings.cc:1126
int GetCDSide(unsigned int adc, unsigned int ch)
Definition Settings.hh:269
std::vector< std::vector< std::vector< int > > > pulser
A channel map for the pulser inputs.
Definition Settings.hh:518
std::vector< std::vector< std::vector< int > > > mb_crystal
A channel map for the Miniball crystal IDs (-1 if not Miniball)
Definition Settings.hh:450
unsigned int sc_dgf
Location of the SuperCycle signal in the DGF system (module)
Definition Settings.hh:540
unsigned int GetMaximumNumberOfAdcChannels()
Definition Settings.hh:62
int GetPulser(unsigned int sfp, unsigned int board, unsigned int ch)
Definition Settings.cc:1679
unsigned int dgfscaler_vme_last
Marabou IDs for DGF scalers.
Definition Settings.hh:436
unsigned int n_febex_ch
Number of channels per board (16 for FEBEX4)
Definition Settings.hh:412
double event_window
Event builder time window in ns.
Definition Settings.hh:551
std::vector< std::vector< unsigned int > > pad_sfp
A list of SFP numbers for each PAD detector.
Definition Settings.hh:474
std::vector< int > GetBeamDumpDAQ(unsigned int det)
Definition Settings.cc:1443
unsigned int pause_code
Info code when acquisition has paused due to a full buffer.
Definition Settings.hh:526
unsigned int GetSCBoard()
Definition Settings.hh:160
unsigned int t1_board
Location of the T1 signal in the FEBEX system (board)
Definition Settings.hh:536
std::vector< std::vector< unsigned int > > pad_adc
A list of ADC module numbers for each PAD detector.
Definition Settings.hh:476
unsigned int GetNumberOfDgfModules()
Definition Settings.hh:41
unsigned int pattern_vme_first
Definition Settings.hh:435
unsigned int sc_ch
Location of the SuperCycle signal in the FEBEX system (channel)
Definition Settings.hh:542
unsigned int scaler_vme_first
Definition Settings.hh:434
unsigned int adc_vme_last
Marabou IDs for ADCs.
Definition Settings.hh:433
std::vector< int > GetPadDAQ(unsigned int det, unsigned int sec)
Definition Settings.cc:1334
unsigned int tm_hsb_code
Highest significant bits of the timestamp are here.
Definition Settings.hh:525
unsigned int GetNumberOfFebexBoards()
Definition Settings.hh:37
unsigned int n_dgf_mod
Number of DGF modules.
Definition Settings.hh:415
std::vector< std::vector< std::vector< int > > > mb_segment
A channel map for the Miniball segment IDs (-1 if not Miniball)
Definition Settings.hh:451
unsigned int dgfscaler_vme_first
Definition Settings.hh:436
unsigned int n_febex_board
Maximum number of boards per SFP.
Definition Settings.hh:411
unsigned int n_pulsers
Number of pulser inputs for synchronisation tests.
Definition Settings.hh:514
std::vector< unsigned int > pulser_board
A list of board numbers for each pulser.
Definition Settings.hh:516
unsigned int n_cd_det
Number of CD detectors (just 1 for Coulex)
Definition Settings.hh:454
unsigned int t1_ch
Location of the T1 signal in the FEBEX system (channel)
Definition Settings.hh:537
unsigned int GetT1Sfp()
Definition Settings.hh:153
unsigned int n_mb_crystal
Number of crystals in a triple cluster is 3.
Definition Settings.hh:440
unsigned int GetRILISSfp()
Definition Settings.hh:165
unsigned int dgf_vme_first
Definition Settings.hh:432
unsigned int sync_hsb_code
Sync pulse code from Exploder (hsb)
Definition Settings.hh:523
unsigned int GetEBISBoard()
Definition Settings.hh:148
std::vector< unsigned int > bd_sfp
A list of SFP numbers for each beam dump detector.
Definition Settings.hh:486
unsigned int sc_board
Location of the SuperCycle signal in the FEBEX system (board)
Definition Settings.hh:541
unsigned int sc_code
Info code when we have a SuperCycle event in InfoData packets.
Definition Settings.hh:543
unsigned int resume_code
Info code when acquisition has resumed after a pause.
Definition Settings.hh:527
std::vector< unsigned int > pulser_ch
A list of channel numbers for each pulser.
Definition Settings.hh:517
double madc_ts_units
Definition Settings.hh:579
std::vector< std::vector< std::vector< int > > > spede_seg
A channel map for the SPEDE segments (-1 if not a SPEDE, otherwise segment number)
Definition Settings.hh:500