86 const unsigned long * buffer = (
reinterpret_cast<unsigned long*
>(
const_cast<unsigned char*
> ( fedData.data())));
87 int fedLenght = fedData.size();
92 edm::LogError(
"CamacTBDataFormatter") <<
"CamacTBData has size " << fedLenght
93 <<
" Bytes as opposed to expected "
126 a = buffer[wordCounter];wordCounter++;
127 LogDebug(
"CamacTBDataFormatter") <<
"\n\nword:\t" <<
a;
131 LogDebug(
"CamacTBDataFormatter") <<
"format ver:\t" <<
b;
135 LogDebug(
"CamacTBDataFormatter") <<
"major:\t" <<
b;
139 LogDebug(
"CamacTBDataFormatter") <<
"minor:\t" <<
b;
141 a = buffer[wordCounter];wordCounter++;
142 LogDebug(
"CamacTBDataFormatter") <<
"\n\n word:\t" <<
a;
143 LogDebug(
"CamacTBDataFormatter") <<
"time stamp secs: "<<
a;
145 a = buffer[wordCounter];wordCounter++;
146 LogDebug(
"CamacTBDataFormatter") <<
"\n\n word:\t" <<
a;
147 LogDebug(
"CamacTBDataFormatter") <<
"time stamp musecs: " <<
a;
150 a = buffer[wordCounter];wordCounter++;
151 LogDebug(
"CamacTBDataFormatter") <<
"\n\n word:\t" <<
a;
153 LogDebug(
"CamacTBDataFormatter") <<
"LV1A: "<<
b;
156 a = buffer[wordCounter];wordCounter++;
157 LogDebug(
"CamacTBDataFormatter") <<
"\n\n word:\t" <<
a;
160 LogDebug(
"CamacTBDataFormatter") <<
"run number: "<<
b;
163 LogDebug(
"CamacTBDataFormatter") <<
"spill number: "<<
b;
166 a = buffer[wordCounter];wordCounter++;
168 LogDebug(
"CamacTBDataFormatter") <<
"event number in spill: "<<
b;
170 a = buffer[wordCounter];wordCounter++;
172 LogDebug(
"CamacTBDataFormatter") <<
"internal event number: "<<
b;
174 a = buffer[wordCounter];wordCounter++;
175 LogDebug(
"CamacTBDataFormatter") <<
"\n\n word:\t" <<
a;
178 LogDebug(
"CamacTBDataFormatter") <<
"vme errors: "<<
b;
180 LogDebug(
"CamacTBDataFormatter") <<
"camac errors: "<<
b;
182 a = buffer[wordCounter];wordCounter++;
183 LogDebug(
"CamacTBDataFormatter") <<
"\n\n word:\t" <<
a;
185 LogDebug(
"CamacTBDataFormatter") <<
"extended (32 bits) run number: "<<
b;
195 unsigned long bufferHodo[16];
196 bool hodoAreGood =
true;
197 for (
int hodo=0; hodo<16; hodo++)
199 hodoAreGood = hodoAreGood &&
checkStatus(buffer[wordCounter], wordCounter);
201 a = buffer[wordCounter];
202 bufferHodo[hodo] = buffer[wordCounter];
206 LogDebug(
"CamacTBDataFormatter") <<
"hodo: " << hodo <<
"\t: " <<
b;
223 int word= bufferHodo[
j+iplane*
hodoRawLen ] &0xffff;
224 for(
int i=1;
i<0x10000;
i<<=1)
238 hodoRaw.
setPlanes((
unsigned int)nHodoPlanes);
242 theHodoPlane.
setChannels((
unsigned int)nHodoFibers);
244 hodoRaw.
setPlane((
unsigned int)ipl, theHodoPlane);
249 edm::LogWarning(
"CamacTBDataFormatter") <<
"hodoscope block has hardware problems or is partly unused at LV1: "
250 << lv1 <<
" spill: " << spill
252 <<
". Skipping digi.";
268 bool scalersAreGood =
true;
269 for (
int scaler=0; scaler<72; scaler++)
271 scalersAreGood = scalersAreGood &&
checkStatus(buffer[wordCounter], wordCounter);
273 a = buffer[wordCounter]; wordCounter++;
275 LogDebug(
"CamacTBDataFormatter") <<
"scaler: " << scaler <<
"\t: " <<
b;
278 if ( (scaler%2)==0 )
scalers_.push_back(b);
285 edm::LogWarning(
"CamacTBDataFormatter") <<
"scalers block has hardware problems or is partly unused at LV1: "
286 << lv1 <<
" spill: " << spill
298 LogDebug(
"CamacTBDataFormatter") <<
"\n";
299 bool fingersAreGood =
true;
300 for (
int finger=0; finger<2; finger++)
302 fingersAreGood = fingersAreGood &&
checkStatus(buffer[wordCounter], wordCounter);
304 a = buffer[wordCounter]; wordCounter++;
306 LogDebug(
"CamacTBDataFormatter") <<
"finger: " << finger <<
"\t: " <<
b;
312 edm::LogWarning(
"CamacTBDataFormatter") <<
"fingers block has hardware problems or is partly unused at LV1: "
313 << lv1 <<
" spill: " << spill
324 a = buffer[wordCounter]; wordCounter++;
325 LogDebug(
"CamacTBDataFormatter") <<
"\n\n word:\t" <<
a;
327 LogDebug(
"CamacTBDataFormatter") <<
"number of words used in multi stop TDC words: "<<
b;
329 int numberTDCwords =
b;
331 bool multiStopTDCIsGood =
true;
332 for (
int tdc=0; tdc< numberTDCwords ; tdc++)
334 multiStopTDCIsGood = multiStopTDCIsGood &&
checkStatus(buffer[wordCounter], wordCounter);
336 a = buffer[wordCounter]; wordCounter++;
338 LogDebug(
"CamacTBDataFormatter") <<
"tdc: " << tdc <<
"\t: " <<
b;
340 if ( multiStopTDCIsGood ){
344 edm::LogWarning(
"CamacTBDataFormatter") <<
"multi stop TDC block has hardware problems or is partly unused at LV1: "
345 << lv1 <<
" spill: " << spill
350 wordCounter += (16 - numberTDCwords);
358 a = buffer[wordCounter]; wordCounter++;
359 b = (a & 0x00000001);
362 LogDebug(
"CamacTBDataFormatter") <<
" table is in position.";
363 tableIsMoving =
false;
367 LogDebug(
"CamacTBDataFormatter") <<
" table is moving.";
368 tableIsMoving =
true;
382 bool ADCIsGood =
true;
384 ADCIsGood =
checkStatus(buffer[wordCounter], wordCounter);
385 a = buffer[wordCounter]; wordCounter++;
387 LogDebug(
"CamacTBDataFormatter") <<
"ADC word1: " << a <<
"\t ADC2: " << b <<
" word is: " << (wordCounter-1);
390 ADCIsGood =
checkStatus(buffer[wordCounter], wordCounter);
391 a = buffer[wordCounter]; wordCounter++;
393 LogDebug(
"CamacTBDataFormatter") <<
"ADC word2, adc channel 11, ampli S6: " << a <<
"\t ADC2: " <<
b;
394 if (ADCIsGood) tbEventHeader.
setS6ADC ( b ) ;
395 else tbEventHeader.
setS6ADC ( -1 ) ;
403 ADCIsGood &&
checkStatus(buffer[wordCounter], wordCounter);
404 a = buffer[wordCounter]; wordCounter++;
406 LogDebug(
"CamacTBDataFormatter") <<
"TDC word1: " << a <<
"\t TDC2: " <<
b;
407 ADCIsGood &&
checkStatus(buffer[wordCounter], wordCounter);
408 a = buffer[wordCounter]; wordCounter++;
410 LogDebug(
"CamacTBDataFormatter") <<
"TDC word2: (ext_val_trig - LHC_clock) "
411 << a <<
"\t (ext_val_trig - LHC_clock): "
420 a = buffer[wordCounter]; wordCounter++;
421 LogDebug(
"CamacTBDataFormatter") <<
"\n\n word:\t" <<
a;
423 LogDebug(
"CamacTBDataFormatter") <<
"last word of event: "<<
b;
void setHit(unsigned int i, bool status)
void setPlane(unsigned int i, const EcalTBHodoscopePlaneRawHits &planeHit)
void setChannels(unsigned int size)
Set methods.
void setSample(unsigned int i, const EcalTBTDCSample &sam)
void setSize(unsigned int size)
Set methods.
void setPlanes(unsigned int size)
Set methods.