Back to home page

sPhenix code displayed by LXR

 
 

    


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 //#include <gsl/gsl_const_cgsm.h>
0008 
0009 #define AUAU  // PROTONPROTON //PAU //DAU
0010 
0011 namespace BbcMonDefs
0012 {
0013 
0014   const int num_pmt = 128;                 // number of PMT
0015   const int tdc_max = 4096;                // TDC number of max
0016   const int tdc_min_overflow = 2600;       // TDC number of max
0017   const int tdc_max_overflow = 3299;       // TDC number of max
0018   const float max_armhittime = 22;         // Minimum of Tdc-ArmHitTime
0019   const float min_armhittime = 0;          // Maximum od Tdc-ArmHitTime
0020   static const double TDC_FIT_MAX = 19.0;  // compatible type with TF::GetParameter(1)
0021   static const double TDC_FIT_MIN = 1.0;
0022   // static const int zvtnbin = 180;
0023   static const int zvtnbin = 600;
0024   static const float max_zvertex = 300;
0025   static const float min_zvertex = -300;
0026 
0027 
0028   // auto-update zvertex timer
0029   // static  unsigned int zvtx_autoupdate_ticker = 1000;
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   //static const char *TRIGGER_str[nTRIGGER] __attribute__((unused)) = {"minimum_bias", "laser"};
0042 
0043 #define nTDC 1
0044   // static const char *TDC_STR[nTDC] = {"TDC0","TDC1"};
0045   // static const char *TDC_Str[nTDC] = {"Tdc0","Tdc1"};
0046   // static const char *TDC_str[nTDC] = {"tdc0","tdc1"};
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;        // Sigma
0057   static const float BBC_TDC_OVERFLOW_REGULAR_MIN = -3;       // Sigma
0058   static const float BBC_TDC_OVERFLOW_REGULAR_RMS_MAX = 3.0;  // sigma
0059   static const float BBC_ZVERTEX_OVERFLOW_REGULAR_MAX = 50;   // cm
0060   static const float BBC_ZVERTEX_OVERFLOW_REGULAR_MIN = -50;  // cm
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   // changed at Jan. 25. 2003
0065   // Due to the laser timing in ch25 is faster than normal ch,
0066   // the ich25 tend to have under-flow of the tdc(tdc<0ch).
0067   // Then, I changed the BBC_nHIT_LASER_MIN[nSIDE] to 0.95%
0068   // Takashi Hachiya
0069 
0070   /*
0071     0 : for 6 devided pads
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;  // for 7.7GeV run
0087   static const float BBC_MIN_REGULAR_TDC0_MEAN = 7.5;   // for 7.7GeV run
0088   // static const float BBC_MAX_REGULAR_TDC0_MEAN = 12.5;
0089   // static const float BBC_MIN_REGULAR_TDC0_MEAN =  8.5;
0090   static const float BBC_TYPICAL_REGULAR_TDC1_MEAN = 10.5;
0091   static const float BBC_MAX_REGULAR_TDC1_MEAN = 13.5;  // for 7.7GeV run
0092   static const float BBC_MIN_REGULAR_TDC1_MEAN = 7.5;   // for 7.7GeV run
0093   // static const float BBC_MAX_REGULAR_TDC1_MEAN = 12.5;
0094   // static const float BBC_MIN_REGULAR_TDC1_MEAN =  8.5;
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;     // 0x2;
0106   static const unsigned long BBC_BBC_TRIG = 0x2;     // 0x1;
0107   static const unsigned long BBC_BBZDC_TRIG = 0x8;   // 0x8;
0108   static const unsigned long BBC_BBLL1_TRIG = 0x40;  // 0x1000;
0109   // for AuAu
0110   static const float BBC_nHIT_MB_MAX[nSIDE] = {0.90, 0.90};
0111   // static const float BBC_nHIT_MB_MIN[nSIDE] = { 0.10, 0.10 };
0112   static const float BBC_nHIT_MB_MIN[nSIDE] = {0.05, 0.05};
0113   static const float ZDC_BBC_TRIGSCALE = 1;
0114   // Charge Sum plot
0115   static const int MAX_ADC_MIP = 100;      // for AuAu
0116   static const int MAX_CHARGE_SUM = 1500;  // for AuAu 200GeV
0117 // static const int MAX_ADC_MIP  = 100;     // for AuAu 15GeV
0118 // static const int MAX_CHARGE_SUM = 150; // for AuAu 15GeV
0119 // static const int MAX_ADC_MIP  = 50;     // for AuAu
0120 // static const int MAX_CHARGE_SUM = 400; // for AuAu
0121 // static const int MAX_CHARGE_SUM = 1500; // for AuAu 200GeV
0122 // static const int MAX_CHARGE_SUM = 750; // for AuAu 62GeV
0123 // static const int MAX_CHARGE_SUM = 150; // for AuAu 7.7GeV
0124 #endif
0125 
0126 #ifdef DAU
0127   static const unsigned long BBC_ZDC_TRIG = 0x4;     // 0x2;
0128   static const unsigned long BBC_BBC_TRIG = 0x2;     // 0x1;
0129   static const unsigned long BBC_BBZDC_TRIG = 0x8;   // 0x8;
0130   static const unsigned long BBC_BBLL1_TRIG = 0x40;  // 0x1000;
0131   // for dAu
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   // Charge Sum plot
0136   static const int MAX_ADC_MIP = 50;      // for dAu
0137   static const int MAX_CHARGE_SUM = 150;  // for dAu
0138 #endif
0139 
0140 #ifdef PAU
0141   static const unsigned long BBC_ZDC_TRIG = 0x4;     // 0x2;
0142   static const unsigned long BBC_BBC_TRIG = 0x2;     // 0x1;
0143   static const unsigned long BBC_BBZDC_TRIG = 0x8;   // 0x8;
0144   static const unsigned long BBC_BBLL1_TRIG = 0x40;  // 0x1000;
0145   // for pAu
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   // Charge Sum plot
0150   static const int MAX_ADC_MIP = 100;     // for pAu
0151   static const int MAX_CHARGE_SUM = 250;  // for pAu
0152 #endif
0153 
0154 #ifdef PROTONPROTON
0155 
0156   static const unsigned long BBC_ZDC_TRIG = 0x4000000;           // 27 zdcns;
0157   static const unsigned long BBC_BBC_TRIG = 0x4;                 // 3bit bbll1>1 only
0158   static const unsigned long BBC_BBZDC_TRIG = 0x8;               // 0x8;
0159   static const unsigned long BBC_BBLL1_TRIG = 0x40;              // 0x1000;
0160   static const unsigned long BBC_BBLL1_NOVTX_TRIG = 0x80000000;  //;
0161   static const unsigned long BBC_RBIB_NTC_WIDE = 0x100000;       //;
0162 
0163   // for pp
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   // Charge Sum plot
0168   static const int MAX_ADC_MIP = 100;     // for pp
0169   static const int MAX_CHARGE_SUM = 100;  // for pp
0170 #endif
0171 
0172   static const unsigned long BBC_BBLL1_COPY_TRIG = 0x1000000;  // new trigger
0173   // static const int BBC_BBLL1_TRIG    = 0x10;       //0x1000;
0174   // static const unsigned long BBC_LASER_TRIG = 0x40000000;  // 0x40000000;
0175 
0176   // the mean of TDC between south and north should be this value.
0177   // static const int BBC_DEFAULT_OFFSET = 1500;
0178   static const float BBC_DEFAULT_OFFSET = 10.5;
0179 
0180   // for trigger rate between BBCLL1 and ZDC within certain vertex cut
0181   // the number should be within 3-5
0182   static const float BBC_ZVERTEX_CUT_FOR_TRIG_RATE = 30.0;  // [cm]
0183 
0184   // color definition
0185   // static const int BBC_COLOR_ZVTX[4] = {4,2,7,1};
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;  // number of digitizer samples
0191 
0192   const double index_refract = 1.4585;        // quartz radiator index of refraction
0193   const double v_ckov = 1.0 / index_refract;  // velocity threshold for CKOV
0194   const double C = 29.9792458;                // cm/ns
0195   //const double C = GSL_CONST_CGSM_SPEED_OF_LIGHT*1e-9;                // cm/ns
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 }  // namespace BbcMonDefs
0217 
0218 #endif /*__BBCMONDEFS_H__ */