22 int pretrig_chan[4]={0,0,0,0};
23 unsigned int tbin_strt,tbin_stop;
24 unsigned int ibit,jbit,itbin,ich,iram,
iline,iadr;
29 LogTrace(
"CSCTMBScope|CSCRawToDigi") <<
" .....TMBHeader -- unpacking Logic Analyzer......";
32 if((e05Line-b05Line) == 1537) {
35 LogTrace(
"CSCTMBScope|CSCRawToDigi") <<
"Scope data found";
39 for(iram=0;iram<6;iram++){
40 for(iadr=0;iadr<256;iadr++) {
47 for(ich=0;ich<51;ich++)
data[ich]=0;
57 tbin_strt = pretrig_chan[0]-7;
58 tbin_stop = pretrig_chan[0]+24;
60 for(ich=0;ich<=14;ich++) {
63 for(itbin=tbin_strt;itbin<=tbin_stop;itbin++) {
64 ibit = (
scope_ram[itbin][iram] >> (ich%16) ) & 1;
65 data[ich] = (ibit << jbit) |
data[ich];
71 for(ich=16;ich<=30;ich++) {
74 for(itbin=tbin_strt;itbin<=tbin_stop;itbin++) {
75 ibit = (
scope_ram[itbin][iram] >> (ich%16) ) & 1;
76 data[ich-1] = (ibit << jbit) |
data[ich-1];
82 tbin_strt = pretrig_chan[1]-7;
83 tbin_stop = pretrig_chan[1]+24;
85 for(ich=32;ich<=36;ich++) {
88 for(itbin=tbin_strt;itbin<=tbin_stop;itbin++) {
89 ibit = (
scope_ram[itbin][iram] >> (ich%16) ) & 1;
90 data[ich-2] = (ibit << jbit) |
data[ich-2];
95 tbin_strt = pretrig_chan[1]-7+120;
96 tbin_stop = pretrig_chan[1]+24+120;
98 for(ich=37;ich<=40;ich++) {
101 for(itbin=tbin_strt;itbin<=tbin_stop;itbin++) {
102 ibit = (
scope_ram[itbin][iram] >> (ich%16) ) & 1;
103 data[ich-2] = (ibit << jbit) |
data[ich-2];
108 tbin_strt = pretrig_chan[1]-7;
109 tbin_stop = pretrig_chan[1]+24;
111 for(ich=41;ich<=46;ich++) {
114 for(itbin=tbin_strt;itbin<=tbin_stop;itbin++) {
115 ibit = (
scope_ram[itbin][iram] >> (ich%16) ) & 1;
116 data[ich-2] = (ibit << jbit) |
data[ich-2];
122 tbin_strt = pretrig_chan[2]-7;
123 tbin_stop = pretrig_chan[2]+24;
125 for(ich=48;ich<=53;ich++) {
128 for(itbin=tbin_strt;itbin<=tbin_stop;itbin++) {
129 ibit = (
scope_ram[itbin][iram] >> (ich%16) ) & 1;
130 data[ich-3] = (ibit << jbit) |
data[ich-3];
139 for(ich=65;ich<=76;ich++) {
141 itbin = pretrig_chan[3];
142 ibit = (
scope_ram[itbin][iram] >> (ich%16) ) & 1;
143 lct_bxn = (ibit << jbit) | lct_bxn;
149 LogTrace(
"CSCTMBScope|CSCRawToDigi") <<
"Scope bxn at LCT (seq_pretrig): "
154 for(ich=0;ich<=50;ich++) {
155 for(itbin=0;itbin<32;itbin++) {
156 ibit = (
data[ich] >> itbin ) & 1;
157 if(ibit == 0)
LogTrace(
"CSCTMBScope|CSCRawToDigi") <<
"_";
158 if(ibit == 1)
LogTrace(
"CSCTMBScope|CSCRawToDigi") <<
"-";
168 for(ich=0;ich<51;ich++)
data[ich]=0;
173 LogTrace(
"CSCTMBScope|CSCRawToDigi") <<
"No scope data found: wrdcnt: "
174 << (e05Line-b05Line);
178 LogTrace(
"CSCTMBScope|CSCRawToDigi") <<
" .....END -- unpacking Logic Analyzer...........";
181 return (e05Line - b05Line + 1);
188 unsigned int ibit,itbin,iram;
195 ibit = (
scope_ram[itbin][iram] >> (ich%16) ) & 1;
201 LogTrace(
"CSCTMBScope|CSCRawToDigi") <<
"TMB SCOPE: ------- Pretrig value: " <<
value;
int UnpackScope(unsigned short *buf, int b05Line, int e05Line)
unsigned int scope_ram[256][6]