26 int pretrig_chan[4]={0,0,0,0};
27 unsigned int tbin_strt,tbin_stop;
28 unsigned int ibit,jbit,itbin,ich,iram,
iline,iadr;
33 LogTrace(
"CSCTMBScope|CSCRawToDigi") <<
" .....TMBHeader -- unpacking Logic Analyzer......";
36 if((e05Line-b05Line) == 1537) {
39 LogTrace(
"CSCTMBScope|CSCRawToDigi") <<
"Scope data found";
43 for(iram=0;iram<6;iram++){
44 for(iadr=0;iadr<256;iadr++) {
51 for(ich=0;ich<51;ich++)
data[ich]=0;
61 tbin_strt = pretrig_chan[0]-7;
62 tbin_stop = pretrig_chan[0]+24;
64 for(ich=0;ich<=14;ich++) {
67 for(itbin=tbin_strt;itbin<=tbin_stop;itbin++) {
68 ibit = (
scope_ram[itbin][iram] >> (ich%16) ) & 1;
69 data[ich] = (ibit << jbit) |
data[ich];
75 for(ich=16;ich<=30;ich++) {
78 for(itbin=tbin_strt;itbin<=tbin_stop;itbin++) {
79 ibit = (
scope_ram[itbin][iram] >> (ich%16) ) & 1;
80 data[ich-1] = (ibit << jbit) |
data[ich-1];
86 tbin_strt = pretrig_chan[1]-7;
87 tbin_stop = pretrig_chan[1]+24;
89 for(ich=32;ich<=36;ich++) {
92 for(itbin=tbin_strt;itbin<=tbin_stop;itbin++) {
93 ibit = (
scope_ram[itbin][iram] >> (ich%16) ) & 1;
94 data[ich-2] = (ibit << jbit) |
data[ich-2];
99 tbin_strt = pretrig_chan[1]-7+120;
100 tbin_stop = pretrig_chan[1]+24+120;
102 for(ich=37;ich<=40;ich++) {
105 for(itbin=tbin_strt;itbin<=tbin_stop;itbin++) {
106 ibit = (
scope_ram[itbin][iram] >> (ich%16) ) & 1;
107 data[ich-2] = (ibit << jbit) |
data[ich-2];
112 tbin_strt = pretrig_chan[1]-7;
113 tbin_stop = pretrig_chan[1]+24;
115 for(ich=41;ich<=46;ich++) {
118 for(itbin=tbin_strt;itbin<=tbin_stop;itbin++) {
119 ibit = (
scope_ram[itbin][iram] >> (ich%16) ) & 1;
120 data[ich-2] = (ibit << jbit) |
data[ich-2];
126 tbin_strt = pretrig_chan[2]-7;
127 tbin_stop = pretrig_chan[2]+24;
129 for(ich=48;ich<=53;ich++) {
132 for(itbin=tbin_strt;itbin<=tbin_stop;itbin++) {
133 ibit = (
scope_ram[itbin][iram] >> (ich%16) ) & 1;
134 data[ich-3] = (ibit << jbit) |
data[ich-3];
143 for(ich=65;ich<=76;ich++) {
145 itbin = pretrig_chan[3];
146 ibit = (
scope_ram[itbin][iram] >> (ich%16) ) & 1;
147 lct_bxn = (ibit << jbit) | lct_bxn;
153 LogTrace(
"CSCTMBScope|CSCRawToDigi") <<
"Scope bxn at LCT (seq_pretrig): " 158 for(ich=0;ich<=50;ich++) {
159 for(itbin=0;itbin<32;itbin++) {
160 ibit = (
data[ich] >> itbin ) & 1;
161 if(ibit == 0)
LogTrace(
"CSCTMBScope|CSCRawToDigi") <<
"_";
162 if(ibit == 1)
LogTrace(
"CSCTMBScope|CSCRawToDigi") <<
"-";
172 for(ich=0;ich<51;ich++)
data[ich]=0;
177 LogTrace(
"CSCTMBScope|CSCRawToDigi") <<
"No scope data found: wrdcnt: " 178 << (e05Line-b05Line);
182 LogTrace(
"CSCTMBScope|CSCRawToDigi") <<
" .....END -- unpacking Logic Analyzer...........";
185 return (e05Line - b05Line + 1);
static std::atomic< bool > debug
unsigned int scope_ram[256][6]