5 #define DETAIL_DUMP_ON false
6 #define ADC_DUMP_ON false
7 #define VALIDATE_DUMP_ON false
14 #include "GaudiKernel/MsgStream.h"
20 static const InterfaceID IID_ILArLATOMEDecoder(
"LArLATOMEDecoder", 1, 0);
26 declareInterface<LArLATOMEDecoder>(
this);
30 return IID_ILArLATOMEDecoder;
40 return StatusCode::SUCCESS;
47 if(!
re)
return StatusCode::FAILURE;;
53 ATH_MSG_WARNING(
"Exception while checking eformat fragment validity: " << ex.what());
58 return StatusCode::FAILURE;
61 std::map<eformat::SubDetectorGroup, std::vector<const uint32_t*> > robIndex;
62 eformat::helper::build_toc(*
re, robIndex);
63 for (
auto mapit : robIndex)
64 ATH_MSG_DEBUG(
"Rob Index subdetgroup is " << std::hex << mapit.first);
65 std::map<eformat::SubDetectorGroup, std::vector<const uint32_t*> >::const_iterator robIt = robIndex.find(
eformat::LAR);
66 if (robIt != robIndex.end()) {
67 const std::vector<const uint32_t*>&
robs = robIt->second;
72 uint32_t latomeSourceID = robFrag.rod_source_id();
73 if (!(latomeSourceID & 0x1000)) {
74 ATH_MSG_DEBUG(
" discarding non latome source ID " << std::hex << latomeSourceID);
77 ATH_MSG_DEBUG(
" found latome source ID " << std::hex << latomeSourceID);
79 EventProcess ev(
this, 0, 0, 0, 0, accdigits, caccdigits, header_coll);
80 ev.fillCollection(&robFrag, map, onoffmap, clmap);
82 ATH_MSG_WARNING(
" exception thrown by ROBFragment, badly corrupted event. Abort decoding ");
94 return StatusCode::SUCCESS;
103 if (robFrags.size() > 0) {
107 uint32_t latomeSourceID = pRob->rod_source_id();
108 if (!(latomeSourceID & 0x1000)) {
109 ATH_MSG_DEBUG(
" discarding non latome source ID " << std::hex << latomeSourceID);
112 ATH_MSG_DEBUG(
" found latome source ID " << std::hex << latomeSourceID);
114 EventProcess ev(
this, adc_coll, adc_bas_coll, et_coll, et_id_coll, 0, 0, header_coll);
115 ev.fillCollection(pRob, map,
nullptr,
nullptr);
117 ATH_MSG_WARNING(
" exception thrown by ROBFragment, badly corrupted event. Abort decoding ");
121 adc_bas_coll->
clear();
127 header_coll->
clear();
132 return StatusCode::SUCCESS;
138 :
AthMessaging(
Gaudi::svcLocator()->service<IMessageSvc>(
"MessageSvc"),
"LArLATOMEDecoder::EventProcess"),
139 m_decoder(decoderInput),
140 m_adc_coll(adc_coll),
141 m_adc_bas_coll(adc_bas_coll),
143 m_et_id_coll(et_id_coll),
144 m_accdigits(accdigits),
145 m_caccdigits(caccdigits),
146 m_header_coll(header_coll) {
207 return param ==
value;
212 if (bswap_32(
p[
offset]) != 0xc0ffee00 || bswap_32(
p[
offset + 1] != 0xaaaaaaaa)) {
213 ATH_MSG_WARNING(
"Problem in trailer at packet " << m_iPacket <<
" words " << std::hex << bswap_32(
p[
offset]) <<
", " << bswap_32(
p[
offset + 1])
217 return offset + m_monTrailerSize;
223 int monheadererror = 0;
224 int monheadererrorbit = 0;
225 if (!compareOrSet(m_latomeID, bswap_32(
p[0 +
offset]), m_headerDecoded))
226 monheadererror |= (1 << monheadererrorbit++);
227 Word l1IDtmp = m_l1ID;
228 if (!compareOrSet(l1IDtmp, bswap_32(
p[1 +
offset]), m_headerDecoded))
229 monheadererror |= (1 << monheadererrorbit++);
230 if (l1IDtmp != m_l1ID) {
231 ATH_MSG_DEBUG(
"Mon header L1ID " << l1IDtmp <<
" different from rod header L1ID " << m_l1ID);
233 ATH_MSG_DEBUG(
" latomeID: " << m_latomeID <<
" l1ID: " << m_l1ID);
237 if (s_monHeaderMarker != monHeaderMarker) {
238 monheadererror |= (1 << monheadererrorbit++);
241 if (s_monCheckPoint != monCheckPoint) {
242 monheadererror |= (1 << monheadererrorbit++);
246 if (!compareOrSet(m_nPackets, bswap_32(
p[3 +
offset]) >> 24, m_headerDecoded))
247 monheadererror |= (1 << monheadererrorbit++);
249 if (m_nPackets == 0xFF) {
252 m_nWordsPerPacket = (bswap_32(
p[3 +
offset]) & 0xffffff) / 4.;
258 if (!compareOrSet(m_iPacket, (bswap_32(
p[3 +
offset]) >> 16) & 0xf, m_headerDecoded))
259 monheadererror |= (1 << monheadererrorbit++);
260 m_nWordsPerPacket = (bswap_32(
p[3 +
offset]) & 0xffff) / 4.;
263 if (!compareOrSet(m_monHeaderSize, bswap_32(
p[5 +
offset]), m_headerDecoded))
264 monheadererror |= (1 << monheadererrorbit++);
268 if (m_monHeaderSize < 18) {
269 ATH_MSG_WARNING(
" Mon header size should not be less that 18 : =" << m_monHeaderSize <<
" are you reading old data file?");
273 ATH_MSG_DEBUG(
" nPackets: " << m_nPackets <<
" iPacket: " << m_iPacket <<
" nWordsPerPacket: " << m_nWordsPerPacket <<
" monHeaderSize: " << m_monHeaderSize);
276 if (!compareOrSet(m_at0typeRec, bswap_32(
p[9 +
offset]), m_headerDecoded))
277 monheadererror |= (1 << monheadererrorbit++);
278 if (!compareOrSet(m_at1typeRec, bswap_32(
p[12 +
offset]), m_headerDecoded))
279 monheadererror |= (1 << monheadererrorbit++);
280 monheadererrorbit += 2;
282 if (!compareOrSet(m_at0nBC, bswap_32(
p[10 +
offset]), m_headerDecoded))
283 monheadererror |= (1 << monheadererrorbit++);
284 if (!compareOrSet(m_at1nBC, bswap_32(
p[13 +
offset]), m_headerDecoded))
285 monheadererror |= (1 << monheadererrorbit++);
286 if (!compareOrSet(m_at0BC, bswap_32(
p[11 +
offset]), m_headerDecoded))
287 monheadererror |= (1 << monheadererrorbit++);
288 if (!compareOrSet(m_at1BC, bswap_32(
p[14 +
offset]), m_headerDecoded))
289 monheadererror |= (1 << monheadererrorbit++);
290 if (!compareOrSet(m_activeSC, bswap_32(
p[15 +
offset]), m_headerDecoded))
291 monheadererror |= (1 << monheadererrorbit++);
292 if (!compareOrSet(m_nsc1, bswap_32(
p[16]) >> 24, m_headerDecoded))
293 monheadererror |= (1 << monheadererrorbit++);
294 if (!compareOrSet(m_nsc2, (bswap_32(
p[16]) >> 16) & 0xff, m_headerDecoded))
295 monheadererror |= (1 << monheadererrorbit++);
296 if (!compareOrSet(m_nsc3, (bswap_32(
p[16]) >> 8) & 0xff, m_headerDecoded))
297 monheadererror |= (1 << monheadererrorbit++);
298 if (!compareOrSet(m_nsc4, (bswap_32(
p[16])) & 0xff, m_headerDecoded))
299 monheadererror |= (1 << monheadererrorbit++);
300 if (!compareOrSet(m_nsc5, bswap_32(
p[17]) >> 24, m_headerDecoded))
301 monheadererror |= (1 << monheadererrorbit++);
302 if (!compareOrSet(m_nsc6, (bswap_32(
p[17]) >> 16) & 0xff, m_headerDecoded))
303 monheadererror |= (1 << monheadererrorbit++);
305 ATH_MSG_DEBUG(
" at0type " << m_at0typeRec <<
" at1type " << m_at1typeRec <<
" at0nBC " << m_at0nBC <<
" at1nBC " << m_at1nBC <<
" at0BC " << m_at0BC
306 <<
" at1BC " << m_at1BC <<
" nsc1 " << m_nsc1 <<
" nsc2 " << m_nsc2 <<
" nsc3 " << m_nsc3 <<
" nsc4 " << m_nsc4 <<
" nsc5 "
307 << m_nsc5 <<
" nsc6 " << m_nsc6);
309 if (monheadererror) {
310 ATH_MSG_WARNING(
" consistency error in mon checker at packet " << m_iPacket <<
" errorbits " << std::hex << monheadererror << std::dec);
313 m_headerDecoded =
true;
314 return m_monHeaderSize + m_nWordsPerPacket +
offset;
342 if (m_packetEnd[m_iPacket] == wordshift) {
344 wordshift += (m_monHeaderSize + m_monTrailerSize);
345 ATH_MSG_DEBUG(
"switch packet " << m_iPacket <<
" " << wordshift);
351 if (byteshift == 4) {
352 increaseWordShift(wordshift);
358 byte = ((bswap_32(
p[wordshift])) >> (8 * (4 - 1 - byteshift))) & 0xff;
362 unsigned int msb = 0;
363 unsigned int lsb = 0;
364 decodeByte(msb, wordshift, byteshift,
p);
365 increaseByteShift(wordshift, byteshift);
366 decodeByte(lsb, wordshift, byteshift,
p);
367 increaseByteShift(wordshift, byteshift);
368 word = lsb | (msb << 8);
372 unsigned int& at0Data,
unsigned int& at1Data,
unsigned int& saturation,
bool& at0val,
bool& at1val) {
378 unsigned int nbytesPerChannel = bytesPerChannel(at0, at1);
379 bool satByte = nbytesPerChannel % 2;
385 unsigned int satData = 0;
388 unsigned int word1 = 0;
389 unsigned int word2 = 0;
390 decodeWord(
word1, wordshift, byteshift,
p);
391 if (nbytesPerChannel > 3) {
392 decodeWord(word2, wordshift, byteshift,
p);
394 at0Data =
word1 & 0x7fff;
395 at0val =
word1 & 0x8000;
396 if (nbytesPerChannel > 3) {
397 at1Data = word2 & 0x7fff;
398 at1val = word2 & 0x8000;
401 decodeByte(satData, wordshift, byteshift,
p);
402 increaseByteShift(wordshift, byteshift);
410 at0Data = (at0Data << 3) | (satData & 0x7);
411 at1Data = (at1Data << 3) | ((satData & 0x70) >> 4);
412 saturation = ((satData & 0x88) == 0x88);
414 at0Data = (at0Data << 3) | ((satData & 0x70) >> 4);
415 at1Data = (at1Data << 3) | (satData & 0x7);
416 saturation = ((satData & 0x88) == 0x88);
419 at0Data = (at0Data << 3) | (satData & 0x7);
420 saturation = (satData & 0x20);
423 at1Data = (at1Data << 3) | (satData & 0x7);
424 saturation = (satData & 0x20);
436 const unsigned int sourceID = robFrag->rob_source_id();
444 m_l1ID = robFrag->rod_lvl1_id();
445 m_ROBFragSize = robFrag->rod_ndata();
447 const unsigned int n = robFrag->rod_ndata();
453 m_latomeBCID = robFrag->rod_bc_id();
454 const uint32_t* rod_status = robFrag->rod_status();
455 const unsigned int rod_nstatus = robFrag->rod_nstatus();
456 if (rod_nstatus != 27) {
457 ATH_MSG_WARNING(
"Inconsistent number of rod header status elements: nstatus= " << rod_nstatus);
460 if (rod_nstatus > 8) {
462 m_at0type = status8 & 0x3;
463 m_at1type = (status8 >> 2) & 0x3;
465 m_nthLATOME = robFrag->rod_source_id();
468 pat1.
DAC = rod_status[9];
469 pat1.
delay = rod_status[10];
471 for (
unsigned int i = 0;
i < 4; ++
i)
474 pat2.
DAC = rod_status[15];
475 pat2.
delay = rod_status[16];
477 for (
unsigned int i = 0;
i < 4; ++
i)
480 pat3.
DAC = rod_status[21];
481 pat3.
delay = rod_status[22];
483 for (
unsigned int i = 0;
i < 4; ++
i)
486 m_latomeCalibPatternsInEvent = {pat1, pat2, pat3};
488 const HWIdentifier hwidEmpty;
492 unsigned int offset = decodeHeader(
p, 0);
493 if (
offset > m_ROBFragSize) {
494 ATH_MSG_WARNING(
"Data corruption, offset found at pos 0 (" <<
offset <<
") is larger than the ROB fragment size (" << m_ROBFragSize <<
"). Ignoring data.");
499 m_at0type = m_at0typeRec >> 24;
502 ATH_MSG_WARNING(
" inconsistant data type with requested averaged decoding at0 type " << m_at0type <<
" " << m_at0typeRec <<
" " << std::hex << m_l1ID
503 <<
" " << sourceID << std::dec);
508 m_at0type = m_at0typeRec >> 24;
511 ATH_MSG_WARNING(
" inconsistant data type with requested averaged decoding at0 type " << m_at0type <<
" " << m_at0typeRec <<
" " << std::hex << m_l1ID
512 <<
" " << sourceID << std::dec);
517 m_packetEnd.push_back(
offset);
521 for (
unsigned int ip = 1;
ip < m_nPackets; ++
ip) {
523 m_packetEnd.push_back(
offset);
527 ATH_MSG_DEBUG(
" end of header check computed offset=" << std::dec <<
offset <<
" nwords in payload=" <<
n);
531 if (m_packetEnd[m_nPackets - 1] + m_monTrailerSize !=
n) {
532 ATH_MSG_WARNING(
"problem in packet size loop " << m_packetEnd[m_nPackets - 1] <<
" != " <<
n);
535 std::vector<unsigned int> timeslot_nsc = {m_nsc1, m_nsc2, m_nsc3, m_nsc4, m_nsc5, m_nsc6};
536 std::vector<unsigned int> bc_size;
546 if (m_isAveraged || m_isAutoCorr) {
549 m_nBC_Averaged = nBC;
553 for (
auto&
val : m_averagedRawValuesInEvent) {
554 val.sum.resize(m_nBC_Averaged);
555 val.sumSq.resize(m_nBC_Averaged);
556 val.nTrigValid.resize(m_nBC_Averaged);
557 val.latomeChannel = 99999;
565 if (m_at0nBC >= m_at1nBC) {
568 startBC1 = m_at1BC - m_at0BC;
574 startBC1 = m_at0BC - m_at1BC;
617 m_BC_rawADC = startBC1;
641 for (
auto&
val : m_rawValuesInEvent) {
643 val.adc.resize(m_nBC_rawADC);
645 val.adc_bas.resize(m_nBC_ADC);
647 val.et.resize(m_nBC_E);
649 val.et_id.resize(m_nBC_EID);
650 if (m_hasEID || m_hasE) {
651 val.saturation.resize(
std::max(m_nBC_EID, m_nBC_E));
654 val.latomeChannel = 99999;
658 m_BCIDsInEvent.resize(nBC);
660 unsigned int s = m_monHeaderSize;
663 for (
short iBC = 0; iBC < nBC; ++iBC) {
667 if (iBC < startBC1 || iBC >= startBC1 + nBC1)
670 unsigned int nbytesPerChannel = bytesPerChannel(at0, at1);
673 unsigned int oldipacket = 0;
674 for (
unsigned int itimeslot = 0; itimeslot < 6; ++itimeslot) {
675 unsigned int l_bcid = (bswap_32(
p[
s]))>>16;
683 unsigned int bcid_c =
bcid+1;
689 if(bcid_c != l_bcid){
690 ATH_MSG_WARNING(
"ERROR: BCID not increasing properly between samples, sourceId: " << m_nthLATOME <<
" L1ID is: " << m_l1ID <<
", BCID is from payload: " << l_bcid <<
", expected BCID is: " << bcid_c <<
", LATOME channel is: " << nsc );
693 m_BCIDsInEvent[iBC] = l_bcid;
697 unsigned int mux = ((bswap_32(
p[
s])) >> 8) & 0xff;
698 increaseWordShift(
s);
700 increaseWordShift(
s);
704 unsigned int timeslotsize = timeslot_nsc[itimeslot];
705 unsigned int nbytes = timeslotsize * nbytesPerChannel;
706 unsigned int n64word = nbytes / 8;
709 ATH_MSG_DEBUG(
" at BC " << iBC <<
" timeslot " << itimeslot <<
" " <<
bcid <<
" " <<
mux <<
" n64word " << n64word <<
" at0 " << (
int)at0 <<
" at1 "
710 << (
int)at1 <<
" l_bcid " <<
bcid);
712 unsigned int wordshift =
s;
713 unsigned int byteshift = 0;
716 oldipacket = m_iPacket;
718 unsigned int at0Data = 0, at1Data = 0, satData = 0;
719 bool at0val =
false, at1val =
false;
726 if (!m_isAveraged && !m_isAutoCorr) {
727 decodeChannel(wordshift, byteshift,
p, at0, at1, at0Data, at1Data, satData, at0val, at1val);
728 ATH_MSG_DEBUG(
" wordshift " << wordshift <<
" byteshift " << byteshift <<
" at0data " << at0Data <<
" at1Data " << at1Data <<
" satData " << satData
729 <<
" at0val " << at0val <<
" at1val " << at1val <<
" nsc " << nsc);
732 const auto SCID = map ? map->getChannelID(m_nthLATOME, nsc) : hwidEmpty;
733 if (SCID == hwidEmpty) {
736 int RAWValue0 = -999;
738 ATH_MSG_DEBUG(
"at0 bad quality bit for SC:" << nsc <<
" BC " << iBC <<
" latome " << robFrag->rod_source_id());
743 int defaultADCValue = -1;
744 int defaultEValue = -99999;
745 auto& rawValuesInEvent = m_rawValuesInEvent[nsc];
748 if ((
unsigned)iBC < rawValuesInEvent.adc.size()) {
749 rawValuesInEvent.adc[iBC] = (at0val) ? RAWValue0 : defaultADCValue;
753 if ((
unsigned)iBC < rawValuesInEvent.adc_bas.size()) {
754 rawValuesInEvent.adc_bas[iBC] = (at0val) ? RAWValue0 : defaultADCValue;
758 if ((
unsigned)iBC < rawValuesInEvent.et.size()) {
759 rawValuesInEvent.et[iBC] = (at0val) ? signEnergy(RAWValue0) : defaultEValue;
760 rawValuesInEvent.saturation[iBC] = satData;
764 if ((
unsigned)iBC < rawValuesInEvent.et_id.size()) {
765 rawValuesInEvent.et_id[iBC] = (at0val) ? signEnergy(RAWValue0) : defaultEValue;
766 rawValuesInEvent.saturation[iBC] = satData;
776 int RAWValue1 = -999;
778 ATH_MSG_DEBUG(
"at1 bad quality bit for SC:" << nsc <<
" BC " << iBC <<
" latome " << robFrag->rod_source_id());
784 const size_t BCidx = iBC - startBC1;
787 if (BCidx < rawValuesInEvent.adc.size()) {
788 rawValuesInEvent.adc[BCidx] = (at1val) ? RAWValue1 : defaultADCValue;
792 if (BCidx < rawValuesInEvent.adc_bas.size()) {
793 rawValuesInEvent.adc_bas[BCidx] = (at1val) ? RAWValue1 : defaultADCValue;
797 if (BCidx < rawValuesInEvent.et.size()) {
798 rawValuesInEvent.et[BCidx] = (at1val) ? signEnergy(RAWValue1) : defaultEValue;
799 rawValuesInEvent.saturation[BCidx] = satData;
803 if (BCidx < rawValuesInEvent.et_id.size()) {
804 m_rawValuesInEvent[nsc].et_id[BCidx] = (at1val) ? signEnergy(RAWValue1) : defaultEValue;
805 m_rawValuesInEvent[nsc].saturation[BCidx] = satData;
815 m_rawValuesInEvent[nsc].latomeChannel = nsc;
819 ATH_MSG_ERROR(
"inconsistant wordshift in decoding everaged data");
822 unsigned int averageword = bswap_32(
p[wordshift]);
824 unsigned int sumSq = bswap_32(
p[wordshift]);
826 unsigned long long sumsqMSB = averageword >> 28;
827 sumsqMSB = sumsqMSB << 32;
829 m_averagedRawValuesInEvent[nsc].sum[iBC] = averageword & 0xFFFFF;
830 m_averagedRawValuesInEvent[nsc].sumSq[iBC] = sumSq | sumsqMSB;
831 m_averagedRawValuesInEvent[nsc].nTrigValid[iBC] = (averageword >> 20) & 0xFF;
832 m_averagedRawValuesInEvent[nsc].latomeChannel = nsc;
841 increaseWordShift(wordshift);
845 if ((wordshift -
s) % 2)
846 increaseWordShift(wordshift);
848 if ((wordshift -
s - ((m_iPacket - oldipacket) * (m_monHeaderSize + m_monTrailerSize))) != n64word * 2) {
849 ATH_MSG_WARNING(
" ERROR: time slice end is not padded properly " << (wordshift -
s - m_iPacket * (m_monHeaderSize + m_monTrailerSize))
850 <<
"!=" << n64word * 2 <<
" m_ipacket " << m_iPacket);
853 oldipacket = m_iPacket;
858 if (!m_isAveraged && !m_isAutoCorr) {
861 if (onoffmap && clmap) {
862 fillCalib(map, onoffmap, clmap);
876 std::unique_ptr<LArCalibParams> calibParams1;
877 std::unique_ptr<LArCalibParams> calibParams2;
880 const LArOnOffIdMapping*
cabling = 0;
891 calibParams1=std::make_unique<LArCalibParams>();
892 calibParams2=std::make_unique<LArCalibParams>();
894 if (pattype > 0x48) {
897 if (sc1 != StatusCode::SUCCESS || sc2 != StatusCode::SUCCESS) {
898 ATH_MSG_WARNING(
"could not initialize LArCalibParams, acc calib will not be filled ");
901 if (pattype == 0x49 || pattype == 0x4a) {
914 if (sc1 != StatusCode::SUCCESS) {
915 ATH_MSG_WARNING(
"could not initialize LArCalibParams, acc calib will not be filled ");
922 const HWIdentifier hwidEmpty;
926 if (SCID == hwidEmpty) {
935 std::vector<uint64_t>
sum;
936 std::vector<uint64_t> sum2;
937 unsigned int ntmin = 9999999;
951 sum2[is] =
round(fsum2);
959 if (pattype == 0x49 || pattype == 0x4a) {
961 calibParams = calibParams1.get();
963 calibParams = calibParams2.get();
965 }
else if (pattype == 0x4b || pattype == 0x4c) {
967 calibParams = calibParams1.get();
969 calibParams = calibParams2.get();
972 calibParams = calibParams1.get();
974 unsigned int eventNb = 0;
975 unsigned int numCL = 0;
976 unsigned int numPulsedLeg = 0;
977 std::vector<Identifier> ccellIds(0);
981 HWIdentifier cellLegHWID = cablingLeg->createSignalChannelID(
id);
982 const std::vector<HWIdentifier>& calibLineLeg = clcabling->
calibSlotLine(cellLegHWID);
983 numCL += calibLineLeg.size();
984 for (HWIdentifier calibLineHWID : calibLineLeg) {
985 if (calibParams->
isPulsed(eventNb, calibLineHWID)) {
991 isPulsed_value =
true;
992 if (numPulsedLeg != numCL) {
995 isPulsed_value =
false;
997 DAC_value = calibParams->
DAC(eventNb, SCID) * numPulsedLeg;
1007 DAC_value = DAC_value / 1.363;
1010 DAC_value = DAC_value / 1.206;
1016 delay_value = calibParams->
Delay(eventNb, SCID);
1028 const HWIdentifier hwidEmpty;
1030 const auto SCID = map ? map->
getChannelID(m_nthLATOME,
ch) : hwidEmpty;
1031 if (SCID == hwidEmpty) {
1035 if (m_decoder->m_ignoreBarrelChannels && m_decoder->m_onlineId->barrel_ec(SCID) == 0)
1037 if (m_decoder->m_ignoreEndcapChannels && m_decoder->m_onlineId->barrel_ec(SCID) == 1)
1040 std::vector<short> adcValues_inChannel_inEvent;
1043 adcValues_inChannel_inEvent = m_rawValuesInEvent[
ch].adc;
1046 if (m_hasRawAdc && m_adc_coll) {
1050 std::vector<unsigned short> bcid_in_event;
1051 for (
short b = m_BC_rawADC;
b < m_BC_rawADC + m_nBC_rawADC; ++
b) {
1052 bcid_in_event.push_back(m_BCIDsInEvent[
b]);
1055 LArSCDigit* scDigit =
new LArSCDigit(SCID, m_rawValuesInEvent[
ch].latomeChannel, m_nthLATOME, adcValues_inChannel_inEvent, bcid_in_event);
1056 m_adc_coll->push_back(scDigit);
1059 if (m_hasAdc && m_adc_bas_coll) {
1060 std::vector<unsigned short> bcid_in_event;
1061 if (m_nBC_ADC == (
short)m_BCIDsInEvent.size()) {
1062 bcid_in_event = m_BCIDsInEvent;
1064 for (
short b = m_BC_ADC;
b < m_BC_ADC + m_nBC_ADC; ++
b) {
1065 bcid_in_event.push_back(m_BCIDsInEvent[
b]);
1068 LArSCDigit* scDigit =
new LArSCDigit(SCID, m_rawValuesInEvent[
ch].latomeChannel, m_nthLATOME, m_rawValuesInEvent[
ch].adc_bas, bcid_in_event);
1069 m_adc_bas_coll->push_back(scDigit);
1072 if (m_hasE && m_et_coll) {
1073 std::vector<unsigned short> bcid_in_event;
1074 if (m_nBC_E == (
unsigned short)m_BCIDsInEvent.size()) {
1075 bcid_in_event = m_BCIDsInEvent;
1077 for (
short b = m_BC_E;
b < m_BC_E + m_nBC_E; ++
b) {
1078 bcid_in_event.push_back(m_BCIDsInEvent[
b]);
1082 new LArRawSC(SCID, m_rawValuesInEvent[
ch].latomeChannel, m_nthLATOME, m_rawValuesInEvent[
ch].
et, bcid_in_event, m_rawValuesInEvent[
ch].saturation);
1083 m_et_coll->push_back(scDigit);
1086 if (m_hasEID && m_et_id_coll) {
1087 std::vector<unsigned short> bcid_in_event;
1088 if (m_nBC_EID == (
short)m_BCIDsInEvent.size()) {
1089 bcid_in_event = m_BCIDsInEvent;
1091 for (
short b = m_BC_EID;
b < m_BC_EID + m_nBC_EID; ++
b) {
1092 bcid_in_event.push_back(m_BCIDsInEvent[
b]);
1096 new LArRawSC(SCID, m_rawValuesInEvent[
ch].latomeChannel, m_nthLATOME, m_rawValuesInEvent[
ch].et_id, bcid_in_event, m_rawValuesInEvent[
ch].saturation);
1097 m_et_id_coll->push_back(scDigit);
1104 if (m_header_coll) {
1106 m_header_coll->push_back(latome);