Belle II Software  release-06-02-00
eclUnpackerModule.cc
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 
9 //This module
10 #include <ecl/modules/eclUnpacker/eclUnpackerModule.h>
11 
12 //STL
13 #include <iomanip>
14 
15 //Framework
16 #include <framework/dataobjects/EventMetaData.h>
17 
18 //Rawdata
19 #include <rawdata/dataobjects/RawECL.h>
20 
21 //ECL
22 #include <ecl/dataobjects/ECLDigit.h>
23 #include <ecl/dataobjects/ECLDsp.h>
24 #include <ecl/utility/ECLDspUtilities.h>
25 
26 using namespace std;
27 using namespace Belle2;
28 using namespace ECL;
29 
30 #define B2DEBUG_eclunpacker(level, msg) \
31  if (m_debugLevel >= level) {\
32  B2DEBUG(level, msg); \
33  }
34 
35 /*
36 
37 Data format of data packet from shaperDSP (32 bit words)
38 
39 ---------------------------------------------------------------------------------------
40 Offset | MSW(16 bits) | LSW(16 bits) |
41 --------------------------------------------------------------------------------------|
42  | | |
43 0 | 0x10 | 4+DSP_NUM+ADC_NUM*SAMPLES_NUM |
44  | | (Packet length) |
45 --------------------------------------------------------------------------------------|
46  | |
47 1 | b[28..24] – number of active ADC data channels (ADC_NUM) |
48  | b[22..16] – ADC samples per channel (SAMPLES_NUM) |
49  | b[12..8] – number of active DSP channels (DSP_NUM |
50  | b[7..0] – trigger phase |
51  | |
52 --------------------------------------------------------------------------------------|
53 2 | b[31…16] – dsp_mask | b[15…0] – trigger tag |
54  | | |
55 --------------------------------------------------------------------------------------|
56 3 | 0 | b[15…0] – adc_mask |
57  | | |
58 --------------------------------------------------------------------------------------|
59 4…3+DSP_NUM | b[31..30] – quality flag |
60  | quality = 0 : good fit |
61  | quality = 1 : internal error of approximation |
62  | quality = 2 : A < A_th, |
63  | time is replace with chi2 |
64  | quality = 3 : bad fit, A > A_thr |
65  | b[29..18] – reconstructed time (chi2 if qality = 2) |
66  | chi2 = m<<(p*2), m = b[29:27], p = b[26:18] |
67  | b[17..0] – reconstructed amplitude |
68  | |
69 --------------------------------------------------------------------------------------|
70 4+DSP_NUM… | |
71 3+DSP_NUM+ | ADC_NUM*SAMPLES_NUM -- ADC samples |
72 ADC_NUM*SAMPLES_NUM | |
73 --------------------------------------------------------------------------------------|
74 
75 */
76 
77 
78 REG_MODULE(ECLUnpacker)
79 
81  m_globalEvtNum(0),
82  m_localEvtNum(0),
83  m_bufPtr(0),
84  m_bufPos(0),
85  m_bufLength(0),
86  m_bitPos(0),
87  m_storeTrigTime(0),
88  m_storeUnmapped(0),
89  m_unpackingParams("ECLUnpackingParameters", false),
90  m_eclDigits("", DataStore::c_Event),
91  m_debugLevel(0)
92 {
93  setDescription("The module reads RawECL data from the DataStore and writes the ECLDigit data");
94 
95  setPropertyFlags(c_ParallelProcessingCertified);
96 
97  addParam("InitFileName", m_eclMapperInitFileName, "Initialization file", string("/ecl/data/ecl_channels_map.txt"));
98  addParam("ECLDigitsName", m_eclDigitsName, "Name of the ECLDigits container", string("ECLDigits"));
99  addParam("ECLDspsName", m_eclDspsName, "Name of the ECLDsp container", string("ECLDsps"));
100  addParam("ECLTrigsName", m_eclTrigsName, "Name of the ECLTrig container", string("ECLTrigs"));
101  // flag to store trigger times needed for calibration with pulse generator only, so false by default
102  addParam("storeTrigTime", m_storeTrigTime, "Store trigger time", false);
103  addParam("storeUnmapped", m_storeUnmapped, "Store ECLDsp for channels that don't "
104  "exist in ECL mapping", false);
105  addParam("useUnpackingParameters", m_useUnpackingParameters,
106  "Use ECLUnpackingParameters payload", true);
107 }
108 
109 void ECLUnpackerModule::initialize()
110 {
111  // Get cached debug level to improve performance
112  auto& config = LogSystem::Instance().getCurrentLogConfig(PACKAGENAME());
113  m_debugLevel = config.getLogLevel() == LogConfig::c_Debug ? config.getDebugLevel() : 0;
114 
115  // require input data
116  m_rawEcl.isRequired();
117 
118  // register output containers in data store
119  m_eclDigits.registerInDataStore(m_eclDigitsName);
120  if (m_storeTrigTime) {
121  m_eclTrigs.registerInDataStore(m_eclTrigsName);
122  m_relDigitToTrig.registerInDataStore();
123  }
124  m_eclDsps.registerInDataStore(m_eclDspsName);
125  m_relDigitToDsp.registerInDataStore();
126  m_eclDsps.registerRelationTo(m_eclDigits);
127 
128 }
129 
130 void ECLUnpackerModule::beginRun()
131 {
132  m_evtNumReportedMask = 0;
133  m_tagsReportedMask = 0;
134  m_phasesReportedMask = 0;
135  m_badHeaderReportedMask = 0;
136  // Initialize channel mapper at run start to account for possible
137  // changes in ECL mapping between runs.
138  if (!m_eclMapper.initFromDB()) {
139  B2FATAL("ECL Unpacker: Can't initialize eclChannelMapper!");
140  }
141  if (!m_unpackingParams.isValid() && m_useUnpackingParameters) {
142  B2FATAL("ECL Unpacker: Can't access ECLUnpackingParameters payload");
143  }
144 }
145 
146 void ECLUnpackerModule::event()
147 {
148  // output data
149  m_eclDigits.clear();
150  m_eclDsps.clear();
151  m_eclTrigs.clear();
152  // clear relations arrays
153  if (m_relDigitToTrig) m_relDigitToTrig.clear();
154  if (m_relDigitToDsp) m_relDigitToDsp.clear();
155 
156  if (m_eventMetaData.isValid()) {
157  m_globalEvtNum = m_eventMetaData->getEvent();
158  } else {
159  m_globalEvtNum = -1;
160  }
161 
162  for (int i = 0; i < ECL_CRATES; i++) {
163  m_eclTrigsBuffer[i].setTrigId(0);
164  }
165 
166  //=== Read raw event data
167 
168  int nRawEclEntries = m_rawEcl.getEntries();
169 
170  B2DEBUG_eclunpacker(22, "Ecl unpacker event called N_RAW = " << nRawEclEntries);
171 
172  for (int i = 0; i < nRawEclEntries; i++) {
173  for (int n = 0; n < m_rawEcl[i]->GetNumEntries(); n++) {
174  readRawECLData(m_rawEcl[ i ], n); // read data from RawECL and put into the m_eclDigits container
175  }
176  }
177 
178  //=== Add created ECLTrig objects to the StoreArray
179 
180  ECLTrig* new_ecl_trigs[ECL_CRATES] = {};
181  for (int i = 0; i < ECL_CRATES; i++) {
182  if (m_eclTrigsBuffer[i].getTrigId() > 0) {
183  new_ecl_trigs[i] = m_eclTrigs.appendNew(m_eclTrigsBuffer[i]);
184  }
185  }
186 
187  for (int i = 0; i < m_eclDigits.getEntries(); i++) {
188  int cid = m_eclDigits[i]->getCellId();
189  int crate0 = m_eclMapper.getCrateID(cid) - 1;
190  if (new_ecl_trigs[crate0]) {
191  m_relDigitToTrig.add(i, crate0);
192  }
193  }
194 
195  m_localEvtNum++;
196 
197 }
198 
199 void ECLUnpackerModule::endRun()
200 {
201 }
202 
203 void ECLUnpackerModule::terminate()
204 {
205 }
206 
207 // meathod to read collector data by 32-bit words
208 unsigned int ECLUnpackerModule::readNextCollectorWord()
209 {
210  if (m_bufPos == m_bufLength) {
211  B2DEBUG_eclunpacker(22, "Reached the end of the FINESSE buffer");
212  throw Unexpected_end_of_FINESSE_buffer();
213  }
214  unsigned int value = m_bufPtr[m_bufPos];
215  m_bufPos++;
216  return value;
217 }
218 
219 // read given number of bits from the buffer (in order to read compressed ADC data)
220 unsigned int ECLUnpackerModule::readNBits(int bitsToRead)
221 {
222  unsigned int val = 0;
223 
224  val = m_bufPtr[m_bufPos] >> m_bitPos;
225  if (m_bitPos + bitsToRead > 31)
226  if (m_bufPos == m_bufLength) {
227  B2ERROR("Reached the end of the FINESSE buffer while read compressed ADC data");
228 
229  throw Unexpected_end_of_FINESSE_buffer();
230  } else {
231  m_bufPos++;
232  val += m_bufPtr[m_bufPos] << (32 - m_bitPos);
233  m_bitPos += bitsToRead;
234  m_bitPos -= 32;
235  }
236  else {
237  m_bitPos += bitsToRead;
238  if (m_bitPos == 32) {
239  m_bufPos++;
240  m_bitPos -= 32;
241  }
242  }
243 
244  val &= (1 << bitsToRead) - 1;
245 
246  return val;
247 }
248 
249 void ECLUnpackerModule::readRawECLData(RawECL* rawCOPPERData, int n)
250 {
251  int iCrate, iShaper, iChannel, cellID;
252 
253  int shapersMask;
254  int adcDataBase, adcDataDiffWidth;
255  int compressMode, shaperDataLength;
256  unsigned int value = 0;
257  unsigned int nRead = 0, ind = 0, indSample = 0;
258  unsigned int nActiveChannelsWithADCData, nADCSamplesPerChannel, nActiveDSPChannels;
259  int triggerPhase;
260  int dspMask = 0, triggerTag = 0;
261  int nShapers;
262  int adcMask, adcHighMask, dspTime, dspAmplitude, dspQualityFlag;
263  // Mask of shapers that discarded waveform data due to beam burst suppression
264  int burstSuppressionMask;
265 
266 
267  std::vector <int> eclWaveformSamples;
268 
269  int nodeID = rawCOPPERData->GetNodeID(n);
270  int channelsCount = rawCOPPERData->GetMaxNumOfCh(n);
271 
272  int collectorsInNode = -1;
273 
274  bool pcie40Data = false;
275  if (channelsCount == 4) { // COPPER data
276  pcie40Data = false;
277  collectorsInNode = 2;
278  } else if (channelsCount == 48) { // PCIe40 data
279  pcie40Data = true;
280  collectorsInNode = 18;
281  if (nodeID == BECL_ID + 3) {
282  collectorsInNode = 16;
283  }
284  } else {
285  B2FATAL("The maximum number of channels per readout board is invalid."
286  << LogVar("Number of channels", channelsCount));
287  }
288 
289  // loop over FINESSEs in the COPPER
290  for (int iFINESSE = 0; iFINESSE < collectorsInNode; iFINESSE++) {
291 
292  m_bitPos = 0;
293  m_bufPos = 0;
294 
295  m_bufLength = rawCOPPERData->GetDetectorNwords(n, iFINESSE);
296 
297  if (m_bufLength <= 0) continue;
298 
299  // get Number of Collector/Crate connected to the FINESSE
300  iCrate = m_eclMapper.getCrateID(nodeID, iFINESSE, pcie40Data);
301 
302  // pointer to data from COPPER/FINESSE
303  m_bufPtr = (unsigned int*)rawCOPPERData->GetDetectorBuffer(n, iFINESSE);
304 
305  B2DEBUG_eclunpacker(21, "***** iEvt " << m_localEvtNum << " node " << std::hex << nodeID);
306 
307  // dump buffer data
308  for (int i = 0; i < m_bufLength; i++) {
309  B2DEBUG_eclunpacker(29, "" << std::hex << setfill('0') << setw(8) << m_bufPtr[i]);
310  }
311  B2DEBUG_eclunpacker(21, "***** ");
312 
313 
314  m_bufPos = 0; // set read position to the 1-st word
315 
316  // get number of shapers depending on the subsystem this crate belongs to(barrel/forward/backward)
317  int eclSubSystem = m_eclMapper.getSubSystem(iCrate);
318  switch (eclSubSystem) {
319  case 0 : nShapers = ECL_BARREL_SHAPERS_IN_CRATE; break;
320  case 1 : nShapers = ECL_FWD_SHAPERS_IN_CRATE; break;
321  case 2 : nShapers = ECL_BKW_SHAPERS_IN_CRATE; break;
322  default : nShapers = ECL_BARREL_SHAPERS_IN_CRATE;
323  }
324 
325  try {
326  burstSuppressionMask = 0;
327 
328  // trigger phase of the Collector connected to this FINESSE
329  // -1 if there are no triggered shapers
330  int triggerPhase0 = -1;
331  int triggerTag0 = -1;
332 
333  // read the collector header
334  value = readNextCollectorWord();
335  shapersMask = value & 0xFFF; // mask of active shapers
336  compressMode = (value & 0xF000) >> 12; // compression mode for ADC data, 0 -- disabled, 1 -- enabled
337 
338  B2DEBUG_eclunpacker(22, "ShapersMask = " << std::hex << shapersMask << " compressMode = " << compressMode);
339 
340  // loop over all shapers in crate
341  for (iShaper = 1; iShaper <= nShapers; iShaper++) {
342 
343  // check if shaper is active
344  int thisShaperMask = (1 << (iShaper - 1)) & shapersMask;
345  if (thisShaperMask != (1 << (iShaper - 1))) continue;
346 
347  // read the shaper header
348  value = readNextCollectorWord();
349  shaperDataLength = value & 0xFFFF; // amount of words in DATA section (without COLLECTOR HEADER)
350  B2DEBUG_eclunpacker(22, "iCrate = " << iCrate << " iShaper = " << iShaper);
351  B2DEBUG_eclunpacker(22, "Shaper HEADER = 0x" << std::hex << value << " dataLength = " << std::dec << shaperDataLength);
352  // check shaperDSP header
353  if ((value & 0x00FF0000) != 0x00100000) {
354  doBadHeaderReport(iCrate);
355  throw Bad_ShaperDSP_header();
356  }
357 
358  value = readNextCollectorWord();
359  burstSuppressionMask |= ((value >> 29) & 1) << (iShaper - 1); // burst suppression bit
360  nActiveChannelsWithADCData = (value >> 24) & 0x1F;//number of channels with ADC data
361  nADCSamplesPerChannel = (value >> 16) & 0x7F; //ADC samples per channel
362  nActiveDSPChannels = (value >> 8) & 0x1F; //number of active channels in DSP
363  triggerPhase = value & 0xFF; //trigger phase
364 
365  // check that trigger phases for all shapers in the crate are equal
366  if (triggerPhase0 == -1) triggerPhase0 = triggerPhase;
367  else if (triggerPhase != triggerPhase0) {
368  doPhasesReport(iCrate, triggerPhase0, triggerPhase);
369  }
370 
371  B2DEBUG_eclunpacker(22, "nActiveADCChannels = " << nActiveChannelsWithADCData << " samples " << nADCSamplesPerChannel <<
372  " nActiveDSPChannels "
373  << nActiveDSPChannels);
374 
375  value = readNextCollectorWord();
376 
377  dspMask = (value >> 16) & 0xFFFF; // Active DSP channels mask
378  triggerTag = value & 0xFFFF; // trigger tag
379  B2DEBUG_eclunpacker(22, "DSPMASK = 0x" << std::hex << dspMask << " triggerTag " << std::dec << triggerTag);
380 
381  if (triggerTag0 == -1) triggerTag0 = triggerTag;
382  else if (triggerTag != triggerTag0) {
383  doTagsReport(iCrate, triggerTag0, triggerTag);
384  triggerTag0 |= (1 << 16);
385  }
386 
387  if (m_globalEvtNum >= 0) {
388  if (triggerTag != (m_globalEvtNum & 0xFFFF)) {
389  doEvtNumReport(iCrate, triggerTag, m_globalEvtNum);
390  }
391  }
392 
393  value = readNextCollectorWord();
394  adcMask = value & 0xFFFF; // mask for channels with ADC data
395  adcHighMask = (value >> 16) & 0xFFFF;
396  B2DEBUG_eclunpacker(22, "ADCMASK = 0x" << std::hex << adcMask << " adcHighMask = 0x" << adcHighMask);
397 
398  ECLDigit* newEclDigits[ECL_CHANNELS_IN_SHAPER] = {};
399  int newEclDigitsIdx[ECL_CHANNELS_IN_SHAPER] = {};
400 
401  nRead = 0;
402  // read DSP data (quality, fitted time, amplitude)
403  for (ind = 0; ind < ECL_CHANNELS_IN_SHAPER; ind++) {
404  // check if DSP channel is active
405  if (((1 << ind) & dspMask) != (1 << ind)) continue;
406  iChannel = ind + 1;
407  value = readNextCollectorWord();
408  dspTime = (int)(value << 2) >> 20;
409  dspQualityFlag = (value >> 30) & 0x3;
410  dspAmplitude = (value & 0x3FFFF) - 128;
411  nRead++;
412 
413  cellID = m_eclMapper.getCellId(iCrate, iShaper, iChannel);
414 
415  if (!isDSPValid(cellID, iCrate, iShaper, iChannel, dspAmplitude, dspTime, dspQualityFlag)) continue;
416 
417  // fill eclDigits data object
418  B2DEBUG_eclunpacker(23, "New eclDigit: cid = " << cellID << " amp = " << dspAmplitude << " time = " << dspTime << " qflag = " <<
419  dspQualityFlag);
420 
421  // construct eclDigit object and save it in DataStore
422  ECLDigit* newEclDigit = m_eclDigits.appendNew();
423  newEclDigitsIdx[ind] = m_eclDigits.getEntries() - 1;
424  newEclDigits[ind] = newEclDigit;
425  newEclDigit->setCellId(cellID);
426  newEclDigit->setAmp(dspAmplitude);
427  newEclDigit->setQuality(dspQualityFlag);
428  if (dspQualityFlag == 2) {
429  // amplitude is lower than threshold value time = trg_time => fit_time = 0
430  newEclDigit->setTimeFit(0);
431  // the time data is replaced with chi2 data
432  const int chi_mantissa = dspTime & 0x1FF;
433  const int chi_exponent = (dspTime >> 9) & 7;
434  const int chi2 = chi_mantissa << (chi_exponent * 2);
435  newEclDigit->setChi(chi2);
436 
437  } else {
438  // otherwise we do not have chi2 information
439  newEclDigit->setTimeFit(dspTime);
440  newEclDigit->setChi(0);
441  }
442 
443  }
444 
445 
446 
447  if (nRead != nActiveDSPChannels) {
448  B2ERROR("Number of active DSP channels and number of read channels don't match (Corrupted data?)"
449  << LogVar("nRead", nRead) << LogVar("nActiveDSP", nActiveDSPChannels));
450  // do something (throw an exception etc.) TODO
451  }
452 
453  //read ADC data
454  eclWaveformSamples.resize(nADCSamplesPerChannel);
455  nRead = 0;
456  for (ind = 0; ind < ECL_CHANNELS_IN_SHAPER; ind++) {
457  //check if there is ADC data for this channel
458  if (((1 << ind) & adcMask) != (1 << ind)) continue;
459  iChannel = ind + 1;
460  adcDataBase = 0;
461  adcDataDiffWidth = 0;
462  for (indSample = 0; indSample < nADCSamplesPerChannel; indSample++) {
463  if (compressMode == 0) value = readNextCollectorWord();
464  else {
465  if (indSample == 0) {
466  value = readNBits(18);
467  adcDataBase = value;
468  B2DEBUG_eclunpacker(24, "adcDataBase = " << adcDataBase);
469  value = readNBits(5);
470  adcDataDiffWidth = value;
471  B2DEBUG_eclunpacker(24, "adcDataDiffWidth = " << adcDataDiffWidth);
472  }
473  value = readNBits(adcDataDiffWidth);
474  B2DEBUG_eclunpacker(24, "adcDataOffset = " << value);
475  value += adcDataBase;
476  }
477  // fill waveform data for single channel
478  eclWaveformSamples[indSample] = value;
479  }
480 
481  // save ADC data to the eclDsp DataStore object if any
482  if (nADCSamplesPerChannel > 0) {
483 
484  cellID = m_eclMapper.getCellId(iCrate, iShaper, iChannel);
485 
486  if (cellID > 0 || m_storeUnmapped) {
487  m_eclDsps.appendNew(cellID, eclWaveformSamples);
488 
489  if (m_useUnpackingParameters) {
490  // Check run-dependent unpacking parameters
491  auto params = m_unpackingParams->get(iCrate, iShaper, iChannel);
492  if (params & ECL_OFFLINE_ADC_FIT) {
493  auto result = ECLDspUtilities::shapeFitter(cellID, eclWaveformSamples, triggerPhase0);
494  if (result.quality == 2) result.time = 0;
495 
496  if (!newEclDigits[ind]) {
497  ECLDigit* newEclDigit = m_eclDigits.appendNew();
498  newEclDigits[ind] = newEclDigit;
499  newEclDigit->setCellId(cellID);
500  newEclDigit->setAmp(result.amp);
501  newEclDigit->setTimeFit(result.time);
502  newEclDigit->setQuality(result.quality);
503  newEclDigit->setChi(result.chi2);
504  }
505  }
506  }
507  // Add relation from ECLDigit to ECLDsp
508  if (newEclDigits[ind]) {
509  int eclDspIdx = m_eclDsps.getEntries() - 1;
510  m_relDigitToDsp.add(newEclDigitsIdx[ind], eclDspIdx);
511  }
512  }
513 
514  }
515 
516  nRead++;
517  } // read ADC data loop
518 
519  if (m_bitPos > 0) {
520  m_bufPos++;
521  m_bitPos = 0;
522  }
523 
524  if (nRead != nActiveChannelsWithADCData) {
525  B2ERROR("Number of channels with ADC data and "
526  "number of read channels don't match (Corrupted data?)"
527  << LogVar("active channels", nActiveChannelsWithADCData)
528  << LogVar("read channels", nRead));
529  // do something (throw an exception etc.) TODO
530  }
531 
532 
533 
534  } // loop over shapers
535 
536  // make new eclTrig oject to store trigger time for crate if there are triggered shapers in the crate
537  if (m_storeTrigTime && shapersMask != 0) {
538  int trigId = iCrate & 0x3F;
539  ECLTrig* eclTrig = &m_eclTrigsBuffer[trigId - 1];
540  // fill trigid, trgtime for eclTrig object
541  trigId |= (burstSuppressionMask & 0xFFF) << 6;
542  eclTrig->setTrigId(trigId);
543  eclTrig->setTimeTrig(triggerPhase0);
544  eclTrig->setTrigTag(triggerTag0);
545  }
546 
547  } // try
548  catch (...) {
549  // errors while reading data block
550  // do something (count errors etc) TODO
551  B2ERROR("Corrupted data from ECL collector");
552  }
553 
554  }// loop over FINESSEs
555 
556 }
557 
558 bool ECLUnpackerModule::isDSPValid(int cellID, int crate, int shaper, int channel, int, int, int quality)
559 {
560  // Channel is not connected to crystal
561  if (cellID < 1) return false;
562 
563  if (m_useUnpackingParameters) {
564  // Check if data for this channel should be discarded in current run.
565  auto params = m_unpackingParams->get(crate, shaper, channel);
566  if (params & ECL_DISCARD_DSP_DATA) {
567  if (params & ECL_KEEP_GOOD_DSP_DATA) {
568  if (quality == 0) return true;
569  }
570  return false;
571  }
572  }
573 
574  return true;
575 }
576 
577 void ECLUnpackerModule::doEvtNumReport(unsigned int iCrate, int tag, int evt_number)
578 {
579  if (!evtNumReported(iCrate)) {
580  B2ERROR("ECL trigger tag is inconsistent with event number."
581  << LogVar("crate", iCrate)
582  << LogVar("trigger tag", tag)
583  << LogVar("event number", evt_number));
584  m_evtNumReportedMask |= 1L << (iCrate - 1);
585  }
586 }
587 void ECLUnpackerModule::doTagsReport(unsigned int iCrate, int tag0, int tag1)
588 {
589  if (!tagsReported(iCrate)) {
590  B2ERROR("Different trigger tags. ECL data is corrupted for whole run probably."
591  << LogVar("crate", iCrate)
592  << LogVar("trigger tag0", tag0) << LogVar("trigger tag1", tag1));
593  m_tagsReportedMask |= 1L << (iCrate - 1);
594  }
595 }
596 void ECLUnpackerModule::doPhasesReport(unsigned int iCrate, int phase0, int phase1)
597 {
598  if (!phasesReported(iCrate)) {
599  B2ERROR("Different trigger phases. ECL data is corrupted for whole run probably."
600  << LogVar("crate", iCrate)
601  << LogVar("trigger phase0", phase0) << LogVar("trigger phase1", phase1));
602  m_phasesReportedMask |= 1L << (iCrate - 1);
603  }
604 }
605 void ECLUnpackerModule::doBadHeaderReport(unsigned int iCrate)
606 {
607  if (!badHeaderReported(iCrate)) {
608  B2ERROR("Bad shaper header."
609  << LogVar("crate", iCrate));
610  m_badHeaderReportedMask |= 1L << (iCrate - 1);
611  }
612 }
613 
In the store you can park objects that have to be accessed by various modules.
Definition: DataStore.h:51
Class to store ECL digitized hits (output of ECLDigi) relation to ECLHit filled in ecl/modules/eclDig...
Definition: ECLDigit.h:24
void setAmp(int Amp)
Set Fitting Amplitude.
Definition: ECLDigit.h:44
void setTimeFit(int TimeFit)
Set Fitting Time.
Definition: ECLDigit.h:49
void setCellId(int CellId)
Set Cell ID.
Definition: ECLDigit.h:40
void setQuality(int Quality)
Set Fitting Quality.
Definition: ECLDigit.h:54
void setChi(int Chi)
Set Chi-squared.
Definition: ECLDigit.h:58
Class to store ECLTrig, still need to be study relation to ECLHit filled in ecl/modules/eclDigitizer/...
Definition: ECLTrig.h:25
void setTrigTag(int TrigTag)
Set Trig Time (crate Id)
Definition: ECLTrig.h:41
void setTrigId(int TrigId)
Set TrigID.
Definition: ECLTrig.h:38
void setTimeTrig(double TimeTrig)
Set Triger Tag (crate Id)
Definition: ECLTrig.h:44
the ECL unpacker module
The Raw ECL class Class for RawCOPPER class data taken by ECL Currently, this class is almost same as...
Definition: RawECL.h:26
Class to store variables with their name which were sent to the logging service.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Definition: Module.h:650
int GetDetectorNwords(int n, int finesse_num)
get Detector buffer length
Definition: RawCOPPER.h:654
int * GetDetectorBuffer(int n, int finesse_num)
get Detector buffer
Definition: RawCOPPER.h:678
unsigned int GetNodeID(int n)
get node-ID from data
Definition: RawCOPPER.h:394
int GetMaxNumOfCh(int n)
Get the max number of channels in a readout board.
Definition: RawCOPPER.h:747
Abstract base class for different kinds of events.