00001
00002
00003
00004 #ifndef FROOT_Scc
00005 #define FROOT_Scc
00006
00008
00009
00010
00011
00012
00014
00015 #ifndef ROOT_Rtypes
00016 #include "Rtypes.h"
00017 #endif
00018 #include "TThread.h"
00019 #include "TString.h"
00020 #include "TMath.h"
00021
00022 namespace Scc {
00023
00024 enum SingleDetHdrPart_e {HdrDet_evlen = 0,
00025 HdrDet_detname,
00026 HdrDet_systime,
00027 HdrDet_nchans,
00028 HdrDet_dataoff,
00029 HdrDet_msgoff,
00030 HdrDet_miscoff,
00031 HdrDet_hdrlen,
00032 HdrDet_magic,
00033 HdrDet_free
00034 };
00035 enum GlobalHdrPart_e {HdrTot_EvLen = 0,
00036 HdrTot_SysTime,
00037 HdrTot_TofiOff,
00038 HdrTot_TofoOff,
00039 HdrTot_LmdOff,
00040 HdrTot_StbOff,
00041 HdrTot_GasOff,
00042 HdrTot_SilOff,
00043 HdrTot_MagOff,
00044 HdrTot_Magic
00045 };
00046
00047 static const Int_t K_DEBUG_LEV = 0;
00048
00049 static const Int_t K_N_SLOWS = 7;
00050 enum SlowDetectors_e {TOFI = 0, TOFO, LMD, STB, GAS, SIL, MAG};
00051 static TString fSlowDetNames[K_N_SLOWS] = {"TOFI", "TOFO", "LMD", "STB", "GAS", "SIL", "MAG"};
00052
00053 static const Int_t K_SLOW_N_CHANS[K_N_SLOWS] = { 24, 144, 32, 192, 0, 108, 0};
00054
00055 static const Int_t K_N_SECUR_SWITCHES = 5;
00056
00057
00058 static const Int_t K_N_SOCKS_IN = 8;
00059 enum SlowSocksIn_e {SOCK_TOFI = 0, SOCK_TOFO, SOCK_LMD, SOCK_STB, SOCK_GAS, SOCK_SIL, SOCK_SIL_MSG, SOCK_MAG};
00060 static const Int_t K_SLOW_UDP_PORT[K_N_SOCKS_IN] = { 3001, 3002, 3003, 3004, 3005, 3006, 3008, 3007 };
00061
00062 static const Int_t K_SLOW_SOCK_LEN = 4096;
00063
00064
00065
00066 static const Int_t K_DAQ_SCC_EV_UDP_PORT = 3010;
00067
00068 static const Int_t K_SCC_HDR_SIZE = 40;
00069 static const Int_t K_MSG_MAX_SIZE = 200;
00070 static const Int_t K_MISC_MAX_SIZE = 108;
00071 static const UInt_t K_MAGIC_NUMBER = 0xCAFE;
00072 static const UInt_t K_TOT_SCC_MAX_SIZE = 3736;
00073
00074 void Print();
00075
00076 inline static void print_binary(unsigned int a){
00077 Printf(" ---> printing binary code for (u_int_32)\"%d\"",a);
00078 TString built_data = "";
00079 for(int j=0;j<32;j++){
00080 int bit = (int)(31 -j);
00081 unsigned int tmp = a & (unsigned int)(TMath::Power((double)2.,(double)bit));
00082 tmp = tmp >> bit;
00083 built_data+=tmp;
00084 }
00085 Printf("bynary number: %s",built_data.Data());
00086 Printf(" --- --- --- ");
00087 }
00088 }
00089 #endif //FROOT_Scc