Belle II Software  release-05-02-19
eclPackerModule.cc
1 //This module
2 #include <ecl/modules/eclPacker/eclPackerModule.h>
3 
4 //STL
5 #include <ios>
6 #include <iomanip>
7 
8 //Framework
9 #include <framework/logging/Logger.h>
10 
11 //ECL
12 #include <ecl/dataobjects/ECLDigit.h>
13 #include <ecl/dataobjects/ECLDsp.h>
14 
15 //Raw data
16 #include <rawdata/dataobjects/RawECL.h>
17 
18 using namespace std;
19 using namespace Belle2;
20 using namespace ECL;
21 
22 REG_MODULE(ECLPacker)
23 
24 ECLPackerModule::ECLPackerModule() :
25  m_bufPos(0),
26  m_bufLength(0),
27  m_bitPos(0),
28  m_EclWaveformSamples(),
29  m_eclMapper(),
30  m_eclRawCOPPERs("", DataStore::c_Event),
31  adcBuffer_temp(),
32  collectorMaskArray(),
33  shaperMaskArray(),
34  shaperADCMaskArray(),
35  shaperNWaveform(),
36  shaperNHits(),
37  iEclDigIndices(),
38  iEclWfIndices()
39 {
40  setDescription("The module reads ECLDigits from the DataStore and writes ECLRaw data.");
41  addParam("InitFileName", m_eclMapperInitFileName, "Initialization file", string("/ecl/data/ecl_channels_map.txt"));
42  addParam("RawCOPPERsName", m_eclRawCOPPERsName, "Name of the RawECL container", string("RawECLs"));
43  addParam("CompressMode", m_compressMode, "compress mode for ADC samples", true);
44  addParam("AmpThreshold", m_ampThreshold, "Amplitude threshold", -50);
45  addParam("PackWfRareFactor", m_WaveformRareFactor, "Pack ADC samples for one of N events. No waveform is packed if 0", 100);
46 
47  m_EvtNum = 0;
48 }
49 
50 ECLPackerModule::~ECLPackerModule()
51 {
52 }
53 
55 {
56  // require input data
57  m_eclDigits.isRequired();
58  m_eclDsps.isOptional();
59 
60  // register output container in data store
61  m_eclRawCOPPERs.registerInDataStore(m_eclRawCOPPERsName);
62 
63  B2INFO("ECL Packer: Compress mode = " << m_compressMode);
64 }
65 
67 {
68  // Initialize channel mapper at run start to account for possible
69  // changes in ECL mapping between runs.
70  if (!m_eclMapper.initFromDB()) {
71  B2FATAL("ECL Packer: Can't initialize eclChannelMapper!");
72  }
73 
74  //TODO
75 }
76 
78 {
79 
80  B2DEBUG(50, "EclPacker:: event called ");
81  // output data
82  m_eclRawCOPPERs.clear();
83 
84  B2DEBUG(50, "EclPacker:: output data arrays created");
85 
86  int nActiveChannelsWithADCData, nActiveDSPChannels;
87  int triggerPhase = 0, dspMask = 0;
88 
89  // get total number of hits
90  int nEclDigits = m_eclDigits.getEntries();
91  int nEclWaveform = m_eclDsps.getEntries();
92 
93  for (int i = 0; i < ECL_CRATES; i++) {
94  collectorMaskArray[i] = 0;
95  for (int j = 0; j < ECL_BARREL_SHAPERS_IN_CRATE; j++) {
96  shaperMaskArray[i][j] = 0;
97  shaperNHits[i][j] = 0;
98  shaperADCMaskArray[i][j] = 0;
99  shaperNWaveform[i][j] = 0;
100  }
101  }
102 
103  for (int j = 0; j < ECL_TOTAL_CHANNELS; j++) {
104  iEclDigIndices[j] = -1;
105  iEclWfIndices[j] = -1;
106  }
107 
108  B2DEBUG(100, "EclPacker:: N_Digits = " << nEclDigits);
109  B2DEBUG(100, "EclPacker:: N_Waveforms = " << nEclWaveform);
110 
111  int iCOPPER, iFINESSE, iCrate, iShaper, iChannel, nShapers;
112 
113  B2DEBUG(100, "EclPacker:: Hits ======>> ");
114  int tot_dsp_hits = 0;
115  // fill number of hits, masks and fill correspondance between cellID and index in container
116  for (int i_digit = 0; i_digit < nEclDigits; i_digit++) {
117  int cid = m_eclDigits[i_digit]->getCellId();
118  int amp = m_eclDigits[i_digit]->getAmp();
119 
120  if (amp < m_ampThreshold) continue;
121 
122  //TODO: Threshold
123  iCrate = m_eclMapper.getCrateID(cid);
124  iShaper = m_eclMapper.getShaperPosition(cid);
125  iChannel = m_eclMapper.getShaperChannel(cid);
126 
127  if (iCrate < 1 && iShaper < 1 && iChannel < 1) {
128  B2ERROR("Wrong crate/shaper/channel ids: " << iCrate << " " << iShaper << " " << iChannel << " for CID " << cid);
129  throw eclPacker_internal_error();
130  }
131  collectorMaskArray[iCrate - 1] |= (1 << (iShaper - 1));
132 
133  shaperMaskArray[iCrate - 1][iShaper - 1] |= (1 << (iChannel - 1));
134  shaperNHits[iCrate - 1][iShaper - 1]++;
135 
136  iEclDigIndices[cid - 1] = i_digit;
137  tot_dsp_hits++;
138  }
139 
140  B2DEBUG(100, "ECL Packer:: N Hits above threshold = " << tot_dsp_hits << " nWaveforms = " << nEclWaveform);
141 
142  if (m_WaveformRareFactor != 0)
143  if (m_EvtNum % m_WaveformRareFactor == 0) {
144  B2DEBUG(100, "ECL Packer:: Pack waveform data for this event: " << m_EvtNum);
145  for (int i_wf = 0; i_wf < nEclWaveform; i_wf++) {
146  int cid = m_eclDsps[i_wf]->getCellId();
147  iCrate = m_eclMapper.getCrateID(cid);
148  iShaper = m_eclMapper.getShaperPosition(cid);
149  iChannel = m_eclMapper.getShaperChannel(cid);
150 
151  //check corresponding amplitude in ecl digits
152  int amp = 0;
153  for (int i_digit = 0; i_digit < nEclDigits; i_digit++) {
154  if (m_eclDigits[i_digit]->getCellId() == cid) {
155  amp = m_eclDigits[i_digit]->getAmp();
156  break;
157  }
158  }
159  if (amp < m_ampThreshold) continue;
160 
161  shaperADCMaskArray[iCrate - 1][iShaper - 1] |= (1 << (iChannel - 1));
162  shaperNWaveform[iCrate - 1][iShaper - 1]++;
163 
164  iEclWfIndices[cid - 1] = i_wf;
165  }
166  }
167 
168  // fill rawCOPPERPacker data
169  RawCOPPERPackerInfo rawcprpacker_info;
170  rawcprpacker_info.exp_num = 0;
171  rawcprpacker_info.run_subrun_num = 1; // run number : 14bits, subrun # : 8bits
172  rawcprpacker_info.eve_num = m_EvtNum;
173  rawcprpacker_info.tt_ctime = 0x7123456; //??? (copy-past from CDC)
174  rawcprpacker_info.tt_utime = 0xF1234567; //???
175  rawcprpacker_info.b2l_ctime = 0x7654321; //???
176 
177 
178  B2DEBUG(100, "EclPacker:: proceed COPPERs... ");
179  B2DEBUG(100, "EclPacker:: ECL_COPPERS = " << ECL_COPPERS);
180 
181  //cycle over all coppers
182  for (iCOPPER = 1; iCOPPER <= ECL_COPPERS; iCOPPER++) {
183 
184  std::vector <unsigned int> buff[ECL_FINESSES_IN_COPPER];
185  for (int i = 0; i < ECL_FINESSES_IN_COPPER; i++) buff[i].clear();
186 
187  int iCOPPERNode = (iCOPPER <= ECL_BARREL_COPPERS) ? BECL_ID + iCOPPER : EECL_ID + iCOPPER - ECL_BARREL_COPPERS;
188 
189  //check if at least one of FINESSES have hits
190  int icr1 = m_eclMapper.getCrateID(iCOPPERNode, 0);
191  int icr2 = m_eclMapper.getCrateID(iCOPPERNode, 1);
192  B2DEBUG(200, "iCOPPERNode = 0x" << std::hex << iCOPPERNode << std::dec << " nCrate1 = " << icr1 << " nCrate2 = " << icr2);
193  if (!(collectorMaskArray[icr1 - 1] || collectorMaskArray[icr2 - 1])) continue;
194 
195  rawcprpacker_info.node_id = iCOPPERNode;
196  // Create RawECL object
197 
198  int nwords[2] = {0, 0};
199  const int finesseHeaderNWords = 3;
200 
201  //cycle over finesses in copper
202  for (iFINESSE = 0; iFINESSE < ECL_FINESSES_IN_COPPER; iFINESSE++) {
203  iCrate = m_eclMapper.getCrateID(iCOPPERNode, iFINESSE);
204 
205  nShapers = m_eclMapper.getNShapersInCrate(iCrate);
206  if (!nShapers) B2ERROR("Ecl packer:: Wrong shapers number " << nShapers);
207 
208  if (!shaperMaskArray[iCrate - 1]) continue;
209  B2DEBUG(200, "Pack data for iCrate = " << iCrate << " nShapers = " << nShapers);
210 
211  // write EclCollector header to the buffer
212  unsigned int eclCollectorHeader = (1 << nShapers) - 1;
213  if (m_compressMode) eclCollectorHeader += (1 << 12);
214  buff[iFINESSE].push_back(eclCollectorHeader);
215 
216  for (iShaper = 1; iShaper <= nShapers; iShaper++) {
217 
218  nActiveDSPChannels = shaperNHits[iCrate - 1][iShaper - 1];
219  B2DEBUG(200, "iCrate = " << iCrate << " iShaper = " << iShaper << " nActiveDSPChannels = " << nActiveDSPChannels);
220  nActiveChannelsWithADCData = shaperNWaveform[iCrate - 1][iShaper - 1];
221  B2DEBUG(200, "nActiveChannelsWithADCData = " << nActiveChannelsWithADCData);
222 
223  // write 4 words of shaper header
224 
225  unsigned int shaperDataLength = 4 + nActiveDSPChannels + nActiveChannelsWithADCData * ECL_ADC_SAMPLES_PER_CHANNEL;
226  // fill shaperDsp header
227  unsigned int shaper_header_w0 = (0x10 << 16) + (shaperDataLength & 0xFFFF);
228  buff[iFINESSE].push_back(shaper_header_w0);
229 
230  triggerPhase = 0; //?????
231  unsigned int shaper_header_w1 = (nActiveChannelsWithADCData & 0x1F) << 24;
232  shaper_header_w1 |= (ECL_ADC_SAMPLES_PER_CHANNEL & 0x7F) << 16;
233  shaper_header_w1 |= (nActiveDSPChannels & 0x1F) << 8;
234  shaper_header_w1 |= triggerPhase;
235  buff[iFINESSE].push_back(shaper_header_w1);
236 
237  dspMask = shaperMaskArray[iCrate - 1][iShaper - 1];
238  B2DEBUG(200, "dspMask = " << std::hex << dspMask);
239  unsigned int shaper_header_w2 = (dspMask & 0xFFFF) << 16;
240  shaper_header_w2 |= (m_EvtNum & 0xFFFF); // trigger tag
241  buff[iFINESSE].push_back(shaper_header_w2);
242 
243  unsigned int adcMask = shaperADCMaskArray[iCrate - 1][iShaper - 1];
244  B2DEBUG(100, "adcMask = " << std::hex << adcMask);
245  unsigned int shaper_header_w3 = (adcMask & 0xFFFF);
246  buff[iFINESSE].push_back(shaper_header_w3);
247 
248  // cycle over shaper channels and push DSP data to buffer
249  for (iChannel = 1; iChannel <= ECL_CHANNELS_IN_SHAPER; iChannel++) {
250 
251  const int cid = m_eclMapper.getCellId(iCrate, iShaper, iChannel);
252 
253  if (cid < 1) continue;
254 
255  const int i_digit = iEclDigIndices[cid - 1];
256  if (i_digit < 0) continue;
257  const int qua = m_eclDigits[i_digit]->getQuality();
258  const int amp = m_eclDigits[i_digit]->getAmp();
259  const int chi = m_eclDigits[i_digit]->getChi();
260  int tim = 0;
261  if (qua == 2) {
262  // pack chisquare
263 
264  int chi_mantissa = 0, chi_exponent = 0;
265  int n_bits = ceil(log2(double(chi)));
266  if (n_bits > 9) {
267  chi_exponent = ceil(float(n_bits - 9) / 2.0);
268  chi_mantissa = chi >> chi_exponent * 2;
269  } else {
270  chi_exponent = 0;
271  chi_mantissa = chi;
272  }
273  tim = (chi_exponent << 9) | chi_mantissa;
274  } else {
275  // pack time
276  tim = m_eclDigits[i_digit]->getTimeFit();
277  }
278  unsigned int hit_data = ((qua & 3) << 30) & 0xC0000000;
279  hit_data |= (tim & 0xFFF) << 18;
280  hit_data |= ((amp + 128) & 0x3FFFF);
281  buff[iFINESSE].push_back(hit_data);
282 
283  B2DEBUG(100, "cid = " << cid << " amp = " << amp << " tim = " << tim);
284  }
285 
286  for (int i = 0; i < ECL_CHANNELS_IN_SHAPER; i++) adcBuffer_temp[i] = 0;
288  setBuffLength(ECL_ADC_SAMPLES_PER_CHANNEL * ECL_CHANNELS_IN_SHAPER);
289  for (iChannel = 1; iChannel <= ECL_CHANNELS_IN_SHAPER; iChannel++) {
290  int cid = m_eclMapper.getCellId(iCrate, iShaper, iChannel);
291  if (cid < 1) continue;
292  int i_wf = iEclWfIndices[cid - 1];
293  if (i_wf < 0) continue;
294  B2DEBUG(200, "i_wf = " << i_wf);
295  m_eclDsps[i_wf]->getDspA(m_EclWaveformSamples); // Check this method in implementation of ECLDsp.h!!!
296 
297  if (m_compressMode) {
298  unsigned int adc_data_base = 0;
299  unsigned int adc_data_diff_width = 0;
300 
301  // calculate adc_data_base and adc_data_diff_width for compressed mode
302  unsigned int ampMin = m_EclWaveformSamples[0];
303  unsigned int ampMax = m_EclWaveformSamples[0];
304 
305  for (unsigned int iSample = 0; iSample < ECL_ADC_SAMPLES_PER_CHANNEL; iSample++) {
306  if ((unsigned int) m_EclWaveformSamples[iSample] > ampMax) ampMax = m_EclWaveformSamples[iSample];
307  if ((unsigned int) m_EclWaveformSamples[iSample] < ampMin) ampMin = m_EclWaveformSamples[iSample];
308  }
309 
310  B2DEBUG(250, "ampMin = " << ampMin << " ampMax = " << ampMax);
311 
312  adc_data_base = ampMin & 0x3FFFF;
313  writeNBits(adcBuffer_temp, adc_data_base, 18);
314  adc_data_diff_width = (unsigned int)(log2((float)ampMax - (float)ampMin)) + 1;
315  adc_data_diff_width &= 0x1F;
316  writeNBits(adcBuffer_temp, adc_data_diff_width, 5);
317 
318  B2DEBUG(250, "Width = " << adc_data_diff_width << " Base = " << adc_data_base);
319 
320  for (unsigned int iSample = 0; iSample < ECL_ADC_SAMPLES_PER_CHANNEL; iSample++) {
321  unsigned int adc_data_offset = m_EclWaveformSamples[iSample] - adc_data_base;
322  B2DEBUG(250, "offset = " << adc_data_offset);
323  writeNBits(adcBuffer_temp, adc_data_offset, adc_data_diff_width);
324  }
325  } else {
326  for (unsigned int iSample = 0; iSample < ECL_ADC_SAMPLES_PER_CHANNEL; iSample++) {
327  buff[iFINESSE].push_back(m_EclWaveformSamples[iSample]);
328  }
329 
330  }
331 
332  }
333  if (m_compressMode) {
334  if (m_bitPos > 0) m_bufPos++;
335  for (int i = 0; i < m_bufPos; i++) {
336  buff[iFINESSE].push_back(adcBuffer_temp[i]);
337 
338  B2DEBUG(500, "Buff word " << std::hex << adcBuffer_temp[i]);
339  }
340  }
341  }
342  }
343 
344  RawECL* newRawECL = m_eclRawCOPPERs.appendNew();
345 
346  nwords[0] = buff[0].size();
347  nwords[1] = buff[1].size();
348 
349  buff[0][0] |= (nwords[0] - finesseHeaderNWords) * 4;
350  buff[1][0] |= (nwords[1] - finesseHeaderNWords) * 4;
351 
352  B2DEBUG(100, "**** iEvt = " << m_EvtNum << " node= " << iCOPPERNode);
353  for (unsigned int i = 0; i < 2; i++)
354  for (unsigned int j = 0; j < buff[i].size(); j++) {
355  B2DEBUG(210, ">> " << std::hex << setfill('0') << setw(8) << buff[i][j]);
356  }
357 
358  B2DEBUG(100, "Call PackDetectorBuf");
359  newRawECL->PackDetectorBuf((int*)buff[0].data(), nwords[0], (int*)buff[1].data(), nwords[1],
360  NULL, 0, NULL, 0, rawcprpacker_info);
361  }
362  m_EvtNum++;
363 }
364 
366 {
367  //TODO
368 }
369 
371 {
372 }
373 
375 {
376  m_bufLength = bufLength;
377 }
378 
380 {
381  m_bufPos = 0;
382  m_bitPos = 0;
383 }
384 
385 void ECLPackerModule::writeNBits(unsigned int* buff, unsigned int value, unsigned int bitsToWrite)
386 {
387  unsigned int tmpval = 0;
388 
389  if (!bitsToWrite) return;
390 
391  if (value > (unsigned int)(1 << bitsToWrite) - 1) {
392  B2ERROR("Error compressing ADC samples: tying to write too long word");
393  throw Write_adc_samples_error();
394  }
395 
396  if (m_bitPos + bitsToWrite > 32)
397  if (m_bufPos == m_bufLength) {
398  B2ERROR("Error compressing ADC samples: unexpectedly reach end of buffer");
399  throw Write_adc_samples_error();
400  } else {
401  tmpval = (1 << m_bitPos) - 1;
402  buff[m_bufPos] &= tmpval;
403  buff[m_bufPos] += value << m_bitPos;
404  m_bufPos++;
405  buff[m_bufPos] = value >> (32 - m_bitPos);
406  m_bitPos += bitsToWrite;
407  m_bitPos -= 32;
408  }
409  else {
410  tmpval = (1 << m_bitPos) - 1;
411  buff[m_bufPos] &= tmpval;
412  buff[m_bufPos] += value << m_bitPos;
413  m_bitPos += bitsToWrite;
414  if (m_bitPos == 32) {
415  m_bufPos++;
416  m_bitPos -= 32;
417  }
418  }
419 
420 }
Belle2::RawCOPPERPackerInfo::tt_utime
unsigned int tt_utime
27bit clock ticks at trigger timing distributed by FTSW. For details, see Nakao-san's belle2link user...
Definition: RawCOPPERPackerInfo.h:28
Belle2::RawCOPPERPackerInfo
struct to contain header information used by RawCOPPERFormat::Packer()
Definition: RawCOPPERPackerInfo.h:12
Belle2::RawCOPPERPackerInfo::exp_num
unsigned int exp_num
Experiment number (10bit)
Definition: RawCOPPERPackerInfo.h:16
Belle2::ECLPackerModule::m_eclRawCOPPERs
StoreArray< RawECL > m_eclRawCOPPERs
Output data
Definition: eclPackerModule.h:104
Belle2::ECLPackerModule::m_bufPos
int m_bufPos
position in the data array
Definition: eclPackerModule.h:74
Belle2::RawCOPPERPackerInfo::node_id
unsigned int node_id
Event Number (32bit)
Definition: RawCOPPERPackerInfo.h:22
Belle2::Module::setDescription
void setDescription(const std::string &description)
Sets the description of the module.
Definition: Module.cc:216
Belle2::RawCOPPERPackerInfo::b2l_ctime
unsigned int b2l_ctime
32bit unitx time at trigger timing distributed by FTSW. For details, see Nakao-san's belle2link user ...
Definition: RawCOPPERPackerInfo.h:31
Belle2::ECLPackerModule::event
virtual void event() override
event
Definition: eclPackerModule.cc:77
REG_MODULE
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Definition: Module.h:652
Belle2::ECLPackerModule::m_compressMode
bool m_compressMode
eneble/disable compression of waveform data
Definition: eclPackerModule.h:86
Belle2::ECL::ECLChannelMapper::getCrateID
int getCrateID(int iCOPPERNode, int iFINESSE)
get crate number by given COPPER node number and FINESSE number
Definition: ECLChannelMapper.cc:211
Belle2::ECLPackerModule::shaperNWaveform
int shaperNWaveform[ECL::ECL_CRATES][ECL::ECL_BARREL_SHAPERS_IN_CRATE]
Number of waveforms per shaper.
Definition: eclPackerModule.h:117
Belle2::ECLPackerModule::shaperNHits
int shaperNHits[ECL::ECL_CRATES][ECL::ECL_BARREL_SHAPERS_IN_CRATE]
Number of hits per shaper.
Definition: eclPackerModule.h:119
Belle2::ECL::ECLChannelMapper::getShaperPosition
int getShaperPosition(int cellID)
get position of the shaper in the crate by given CellId
Definition: ECLChannelMapper.cc:289
Belle2::ECLPackerModule::iEclWfIndices
int iEclWfIndices[ECL::ECL_TOTAL_CHANNELS]
indexes of related waveforms
Definition: eclPackerModule.h:125
Belle2::ECL::ECLChannelMapper::getShaperChannel
int getShaperChannel(int cellID)
get number of DSP channel in the shaper by given number of CellId
Definition: ECLChannelMapper.cc:296
Belle2::ECLPackerModule::adcBuffer_temp
unsigned int adcBuffer_temp[ECL::ECL_CHANNELS_IN_SHAPER *ECL_ADC_SAMPLES_PER_CHANNEL]
temporary buffer to store ADC data
Definition: eclPackerModule.h:107
Belle2::ECLPackerModule::setBuffLength
void setBuffLength(int bufLength)
set buffer length
Definition: eclPackerModule.cc:374
Belle2::RawCOPPERPackerInfo::eve_num
unsigned int eve_num
Run # and subrun # ( 22bit )
Definition: RawCOPPERPackerInfo.h:20
Belle2::RawECL
The Raw ECL class Class for RawCOPPER class data taken by ECL Currently, this class is almost same as...
Definition: RawECL.h:26
Belle2::ECLPackerModule::writeNBits
void writeNBits(unsigned int *buff, unsigned int value, unsigned int bitsToWrite)
write N bits to the collector buffer
Definition: eclPackerModule.cc:385
Belle2::ECLPackerModule::m_EvtNum
int m_EvtNum
Event number.
Definition: eclPackerModule.h:71
Belle2::ECLPackerModule::m_EclWaveformSamples
int m_EclWaveformSamples[ECL_ADC_SAMPLES_PER_CHANNEL]
array of ADC samples
Definition: eclPackerModule.h:98
Belle2::RawCOPPERPackerInfo::tt_ctime
unsigned int tt_ctime
Node ID (32bit)
Definition: RawCOPPERPackerInfo.h:25
Belle2::ECLPackerModule::endRun
virtual void endRun() override
endRun
Definition: eclPackerModule.cc:365
Belle2::ECLPackerModule::m_bitPos
int m_bitPos
bit position for bit-by-bit data read
Definition: eclPackerModule.h:80
Belle2::ECLPackerModule::iEclDigIndices
int iEclDigIndices[ECL::ECL_TOTAL_CHANNELS]
indexes of related eclDigits
Definition: eclPackerModule.h:122
Belle2::ECLPackerModule::shaperMaskArray
int shaperMaskArray[ECL::ECL_CRATES][ECL::ECL_BARREL_SHAPERS_IN_CRATE]
triggered shapers
Definition: eclPackerModule.h:113
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::RawCOPPERPackerInfo::run_subrun_num
unsigned int run_subrun_num
Experiment number (10bit)
Definition: RawCOPPERPackerInfo.h:18
Belle2::ECLPackerModule::beginRun
virtual void beginRun() override
beginRun
Definition: eclPackerModule.cc:66
Belle2::ECLPackerModule::m_eclMapper
ECL::ECLChannelMapper m_eclMapper
channel mapper
Definition: eclPackerModule.h:101
Belle2::ECL::ECLChannelMapper::getCellId
int getCellId(int iCrate, int iShaper, int iChannel)
get CellId by given crate number, shaper position in the crate and DSP channel number in the shaper
Definition: ECLChannelMapper.cc:244
Belle2::ECLPackerModule::m_eclRawCOPPERsName
std::string m_eclRawCOPPERsName
name of output collection for RawCOPPER
Definition: eclPackerModule.h:92
Belle2::ECLPackerModule::resetBuffPosition
void resetBuffPosition()
reset current position in the buffer
Definition: eclPackerModule.cc:379
Belle2::ECLPackerModule::m_eclDsps
StoreArray< ECLDsp > m_eclDsps
ECLDSP dataStore object.
Definition: eclPackerModule.h:129
Belle2::Module::addParam
void addParam(const std::string &name, T &paramVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
Definition: Module.h:562
Belle2::RawCOPPER::PackDetectorBuf
void PackDetectorBuf(int *detector_buf_1st, int nwords_1st, int *detector_buf_2nd, int nwords_2nd, int *detector_buf_3rd, int nwords_3rd, int *detector_buf_4th, int nwords_4th, RawCOPPERPackerInfo rawcprpacker_info)
Packer for RawCOPPER class Pack data (format ver.
Definition: RawCOPPER.cc:183
Belle2::ECL::ECLChannelMapper::initFromDB
bool initFromDB()
Initialize channel mapper from the conditions database.
Definition: ECLChannelMapper.cc:105
Belle2::ECLPackerModule::shaperADCMaskArray
int shaperADCMaskArray[ECL::ECL_CRATES][ECL::ECL_BARREL_SHAPERS_IN_CRATE]
shapers with ADC data
Definition: eclPackerModule.h:115
Belle2::ECLPackerModule::m_eclMapperInitFileName
std::string m_eclMapperInitFileName
name of the file with correspondence between cellID and crate/shaper/channel numbers
Definition: eclPackerModule.h:95
Belle2::ECL::ECLChannelMapper::getNShapersInCrate
int getNShapersInCrate(int iCrate)
get number of ShaperDSP modules in the given VME crate number
Definition: ECLChannelMapper.h:83
Belle2::ECLPackerModule::m_WaveformRareFactor
int m_WaveformRareFactor
the rate of writing of the ADC samples
Definition: eclPackerModule.h:89
Belle2::ECLPackerModule::m_ampThreshold
int m_ampThreshold
DSP amplitude threshold.
Definition: eclPackerModule.h:83
Belle2::ECLPackerModule::initialize
virtual void initialize() override
initialize
Definition: eclPackerModule.cc:54
Belle2::ECLPackerModule::m_bufLength
int m_bufLength
length data
Definition: eclPackerModule.h:77
Belle2::DataStore
In the store you can park objects that have to be accessed by various modules.
Definition: DataStore.h:53
Belle2::ECLPackerModule::terminate
virtual void terminate() override
terminate
Definition: eclPackerModule.cc:370
Belle2::ECLPackerModule::collectorMaskArray
int collectorMaskArray[ECL::ECL_CRATES]
array of triggered collectors
Definition: eclPackerModule.h:111
Belle2::ECLPackerModule::m_eclDigits
StoreArray< ECLDigit > m_eclDigits
ECLDigit dataStore object.
Definition: eclPackerModule.h:128