synchTrigsTest.cxx

00001 {
00002 // Manually set up for a TIM histogram...
00003 
00004 // setNmask requires Functs.cxx to have been loaded
00005 setNmask(120);
00006 
00007 tapi.createDebugPrimList();
00008 tapi.debugPrimListFromFile("synchETS2.bin");
00009 // tapi.debugPrimListFromFile("synchETSSingle.bin");
00010 tapi.sendDebugPrimList(0);
00011 tapi.awaitResponse(0);
00012 
00013 gSystem->Sleep(100);
00014 
00015 // Set TIM trigger frequency to 6kHz
00016 tapi.timRegLoad(6, 9);
00017 
00018 // Set TIM BC offset to 3
00019 tapi.timRegLoad(0x14, 0x3000);
00020 //tapi.timRegLoad(0x14, 0x0000);
00021 
00022 // 0x1c2 bit 5   Trap all events...?
00023 
00024 tapi.rodMode(0, 0x20000, 0, 1, 0, 0, 1); 
00025 
00026 // Use ROD mode bits 
00027 // tapi.dspSingleWrite(0, 0x80000010, 1<<2, -1);
00028 // tapi.setABCDModules(0);
00029 
00030 // FE command input source to TIM
00031 // writeRegister(0x217, 1, 1, 1);
00032 // Decode TIM event IDs
00033 // writeRegister(0x217, 8, 1, 1);
00034 
00035 // writeRegister(0x202, 3, 1, 1);   // Inhibit S-link write
00036 writeRegister(0x202, 7, 1, 1);   // Mask LDown#
00037 
00038 // DM_DFLT_LUT(0-7)
00039 // for(int f=0; f<8; f++) writeRegister(0x270 + f, 0, 16, 0xaaaa);
00040 
00041 // Mask L1
00042 // ERROR_MASK(0-1, 0-47)  bit 5
00043 // for(int e=0; e<2; e++) for(int f=0; f<48; f++) writeRegister(0x140+(0x30*e)+f, 5, 1, 1);
00044 
00045 // Clear L1ID mask
00046 //for(int e=0; e<2; e++) for(int f=0; f<48; f++) writeRegister(0x140+(0x30*e)+f, 5, 1, 0);
00047 
00048 readRegister(0x202);  // Event types
00049 readRegister(0x203);  // Event types
00050 readRegister(0x1a6);  // EFB status 
00051 readRegister(0x21c);  // RRIF status 0
00052 readRegister(0x270);  // DM_DFLT_LUT 0
00053 // readRegister(0x140);  // Dynamic mask in [14:15]
00054 
00055 tapi.createDebugPrimList();
00056 tapi.debugPrimListFromFile("synchHisto_108_1416.bin");
00057 tapi.sendDebugPrimList(0);
00058 tapi.awaitResponse(0);
00059 
00060 // Don't put stuff into correct bins...
00061 // for(int i=0; i<256; i++) {
00062 //   unsigned int offset = 0x120 + i * 4;
00063 //   tapi.dspSingleWrite(0, 0x10000 + offset, 0xa00e2000 + 0x1000 * i, 0);
00064 // }
00065 
00066 // Set up L1 and BCIDs?
00067 
00068 // TTrigger soft; soft.softL1A(30); tapi.sendTrigger(0, soft);
00069 
00070 // tapi.timL1A(0, 0);
00071 tapi.timSoftReset(0, 0);
00072 tapi.timBCReset(0, 0);
00073 
00074 int bin = 0;
00075 for(int i=0; i<4; i++) { setTrigger(bin, i); }
00076 
00077 gSystem->Sleep(100);
00078 
00079 // Send triggers
00080 // tapi.sendTimBurst(1000,false);
00081 
00082 // Read out all histogram 
00083 // tapi.dspBlockDumpFile(0, 0xa00e2000, 0x800 * 128, 0, "timhistoall.bin");
00084 // Read out part of histogram
00085 // tapi.dspBlockDumpFile(0, 0xa00e2000 + 0x2000 * 128, 0x800 * 12, 0, "timhistoall.bin")
00086 }

Generated on Mon Feb 6 14:01:30 2006 for SCT DAQ/DCS Software - C++ by  doxygen 1.4.6