File indexing completed on 2025-08-03 08:20:58
0001 #ifndef __BBCMONDEFS_H__
0002 #define __BBCMONDEFS_H__
0003 #include <cstdint>
0004
0005 #include <mbd/MbdEvent.h>
0006
0007
0008
0009 #define AUAU
0010
0011 namespace BbcMonDefs
0012 {
0013
0014 const int num_pmt = 128;
0015 const int tdc_max = 4096;
0016 const int tdc_min_overflow = 2600;
0017 const int tdc_max_overflow = 3299;
0018 const float max_armhittime = 22;
0019 const float min_armhittime = 0;
0020 static const double TDC_FIT_MAX = 19.0;
0021 static const double TDC_FIT_MIN = 1.0;
0022
0023 static const int zvtnbin = 600;
0024 static const float max_zvertex = 300;
0025 static const float min_zvertex = -300;
0026
0027
0028
0029
0030
0031
0032 #define nPMT_1SIDE_BBC 64
0033 #define nPMT_BBC (nPMT_1SIDE_BBC * 2)
0034
0035 #define nCANVAS 9
0036
0037 #define nSIDE 2
0038 #define nTRIGGER 2
0039
0040 static const char *SIDE_Str[nSIDE] __attribute__((unused)) = {"South", "North"};
0041
0042
0043 #define nTDC 1
0044
0045
0046
0047
0048 static const int nBIN_TDC = 64;
0049
0050 static const float TDC_CONVERSION_FACTOR = 0.007;
0051 static const int nBIN_ADC = 128;
0052 static const int MAX_ADC = 4096;
0053
0054 static const float VIEW_OVERFLOW_MAX = 20;
0055 static const float VIEW_OVERFLOW_MIN = -20;
0056 static const float BBC_TDC_OVERFLOW_REGULAR_MAX = 3;
0057 static const float BBC_TDC_OVERFLOW_REGULAR_MIN = -3;
0058 static const float BBC_TDC_OVERFLOW_REGULAR_RMS_MAX = 3.0;
0059 static const float BBC_ZVERTEX_OVERFLOW_REGULAR_MAX = 50;
0060 static const float BBC_ZVERTEX_OVERFLOW_REGULAR_MIN = -50;
0061
0062 static const float BBC_nHIT_LASER_MAX[nSIDE] = {1.00, 1.00};
0063 static const float BBC_nHIT_LASER_MIN[nSIDE] = {0.95, 0.95};
0064
0065
0066
0067
0068
0069
0070
0071
0072
0073 static const float CANVAS_XAXIS_TITLE_SIZE[] = {0.060};
0074 static const float CANVAS_XAXIS_TITLE_OFFSET[] = {1.000};
0075 static const float CANVAS_XAXIS_LABEL_SIZE[] = {0.050};
0076 static const float CANVAS_XAXIS_LABEL_OFFSET[] = {0.005};
0077 static const float CANVAS_XAXIS_PAD_OFFSET[] = {1.000};
0078
0079 static const float CANVAS_YAXIS_TITLE_SIZE[] = {0.070};
0080 static const float CANVAS_YAXIS_TITLE_OFFSET[] = {0.500};
0081 static const float CANVAS_YAXIS_LABEL_SIZE[] = {0.050};
0082 static const float CANVAS_YAXIS_LABEL_OFFSET[] = {0.005};
0083 static const float CANVAS_YAXIS_PAD_OFFSET[] = {0.150};
0084
0085 static const float BBC_TYPICAL_REGULAR_TDC0_MEAN = 10.5;
0086 static const float BBC_MAX_REGULAR_TDC0_MEAN = 13.5;
0087 static const float BBC_MIN_REGULAR_TDC0_MEAN = 7.5;
0088
0089
0090 static const float BBC_TYPICAL_REGULAR_TDC1_MEAN = 10.5;
0091 static const float BBC_MAX_REGULAR_TDC1_MEAN = 13.5;
0092 static const float BBC_MIN_REGULAR_TDC1_MEAN = 7.5;
0093
0094
0095 static const float BBC_MAX_REGULAR_ZVERTEX_MEAN = 20.0;
0096 static const float BBC_MIN_REGULAR_ZVERTEX_MEAN = -20.0;
0097 static const float BBC_MIN_WORNING_STATISTICS_FOR_ZVERTEX_MEAN = 5000;
0098
0099 static const int BBCS_PACKET_ID = 1001;
0100 static const int BBCN_PACKET_ID = 1002;
0101 static const int BBC_TRIG_PACKET_ID = 14001;
0102
0103
0104 #ifdef AUAU
0105 static const unsigned long BBC_ZDC_TRIG = 0x4;
0106 static const unsigned long BBC_BBC_TRIG = 0x2;
0107 static const unsigned long BBC_BBZDC_TRIG = 0x8;
0108 static const unsigned long BBC_BBLL1_TRIG = 0x40;
0109
0110 static const float BBC_nHIT_MB_MAX[nSIDE] = {0.90, 0.90};
0111
0112 static const float BBC_nHIT_MB_MIN[nSIDE] = {0.05, 0.05};
0113 static const float ZDC_BBC_TRIGSCALE = 1;
0114
0115 static const int MAX_ADC_MIP = 100;
0116 static const int MAX_CHARGE_SUM = 1500;
0117
0118
0119
0120
0121
0122
0123
0124 #endif
0125
0126 #ifdef DAU
0127 static const unsigned long BBC_ZDC_TRIG = 0x4;
0128 static const unsigned long BBC_BBC_TRIG = 0x2;
0129 static const unsigned long BBC_BBZDC_TRIG = 0x8;
0130 static const unsigned long BBC_BBLL1_TRIG = 0x40;
0131
0132 static const float BBC_nHIT_MB_MAX[nSIDE] = {0.80, 0.40};
0133 static const float BBC_nHIT_MB_MIN[nSIDE] = {0.02, 0.005};
0134 static const float ZDC_BBC_TRIGSCALE = 3;
0135
0136 static const int MAX_ADC_MIP = 50;
0137 static const int MAX_CHARGE_SUM = 150;
0138 #endif
0139
0140 #ifdef PAU
0141 static const unsigned long BBC_ZDC_TRIG = 0x4;
0142 static const unsigned long BBC_BBC_TRIG = 0x2;
0143 static const unsigned long BBC_BBZDC_TRIG = 0x8;
0144 static const unsigned long BBC_BBLL1_TRIG = 0x40;
0145
0146 static const float BBC_nHIT_MB_MAX[nSIDE] = {0.80, 0.60};
0147 static const float BBC_nHIT_MB_MIN[nSIDE] = {0.02, 0.01};
0148 static const float ZDC_BBC_TRIGSCALE = 3;
0149
0150 static const int MAX_ADC_MIP = 100;
0151 static const int MAX_CHARGE_SUM = 250;
0152 #endif
0153
0154 #ifdef PROTONPROTON
0155
0156 static const unsigned long BBC_ZDC_TRIG = 0x4000000;
0157 static const unsigned long BBC_BBC_TRIG = 0x4;
0158 static const unsigned long BBC_BBZDC_TRIG = 0x8;
0159 static const unsigned long BBC_BBLL1_TRIG = 0x40;
0160 static const unsigned long BBC_BBLL1_NOVTX_TRIG = 0x80000000;
0161 static const unsigned long BBC_RBIB_NTC_WIDE = 0x100000;
0162
0163
0164 static const float BBC_nHIT_MB_MAX[nSIDE] = {0.60, 0.60};
0165 static const float BBC_nHIT_MB_MIN[nSIDE] = {0.01, 0.01};
0166 static const float ZDC_BBC_TRIGSCALE = 55;
0167
0168 static const int MAX_ADC_MIP = 100;
0169 static const int MAX_CHARGE_SUM = 100;
0170 #endif
0171
0172 static const unsigned long BBC_BBLL1_COPY_TRIG = 0x1000000;
0173
0174
0175
0176
0177
0178 static const float BBC_DEFAULT_OFFSET = 10.5;
0179
0180
0181
0182 static const float BBC_ZVERTEX_CUT_FOR_TRIG_RATE = 30.0;
0183
0184
0185
0186 static const int BBC_COLOR_ZVTX[5] = {4, 2, 7, 6, 1};
0187
0188 static const int MAX_WARNING = 16;
0189
0190 static const int BBC_MAXSAMPLES = 31;
0191
0192 const double index_refract = 1.4585;
0193 const double v_ckov = 1.0 / index_refract;
0194 const double C = 29.9792458;
0195
0196
0197 const int MBD_N_PMT = 128;
0198 const int MBD_N_FEECH = 256;
0199 const int BBC_N_PMT = 128;
0200 const int BBC_N_FEECH = 256;
0201 const int MAX_SAMPLES = 31;
0202
0203 enum
0204 {
0205 ABORTRUN = -2,
0206 ABORTEVENT = -1,
0207 EVENT_OK = 0,
0208 DISCARDEVENT = 1,
0209 SYNC_OK = 0,
0210 SYNC_FAIL = -1,
0211 SYNC_NOOBJECT = 1,
0212 DONOTREGISTERSUBSYSTEM = -3,
0213 RESET_NODE_TREE = 1
0214 };
0215
0216 }
0217
0218 #endif