27 std::vector<uint32_t>* pAPVAddresses,
28 const bool discardDigisWithAPVAddrErr,
30 const uint16_t expectedPos) {
32 std::vector<DetSetRawDigis> outputData;
33 outputData.reserve(inputScopeDigis->
size());
37 std::vector<uint16_t> lAddrVec;
39 uint16_t lPreviousFedId = 0;
40 std::vector<uint16_t> lHeaderBitVec;
42 std::vector<uint16_t> lTrailBitVec;
46 std::vector<DSVRawDigis::const_iterator> lFedScopeDigis;
52 bool hasBeenProcessed =
false;
54 for (; inputChannel != endChannels; ++inputChannel) {
55 const uint32_t lFedIndex = inputChannel->detId();
56 const uint16_t
fedId = static_cast<uint16_t>((lFedIndex >> 16) & 0xFFFF);
61 if (lPreviousFedId == 0) {
62 lPreviousFedId =
fedId;
77 if (
fedId == lPreviousFedId) {
79 hasBeenProcessed =
false;
81 if (
fedId != lPreviousFedId) {
83 discardDigisWithAPVAddrErr,
90 lPreviousFedId =
fedId;
91 hasBeenProcessed =
true;
94 lFedScopeDigis.push_back(inputChannel);
103 if (!hasBeenProcessed) {
105 discardDigisWithAPVAddrErr,
115 return std::make_unique<DSVRawDigis>(outputData,
true);
120 const bool discardDigisWithAPVAddrErr,
121 std::vector<uint32_t>* pAPVAddresses,
122 std::vector<DetSetRawDigis>& outputData,
123 std::vector<uint16_t>& aAddrVec,
124 std::vector<uint16_t>& aHeaderBitVec,
125 std::vector<uint16_t>& aTrailBitVec,
126 std::vector<DSVRawDigis::const_iterator>& aFedScopeDigis) {
130 (*pAPVAddresses)[aPreviousFedId] = lMaj;
133 std::vector<DSVRawDigis::const_iterator>::iterator lIter;
134 unsigned int lCh = 0;
135 for (lIter = aFedScopeDigis.begin(); lIter != aFedScopeDigis.end(); ++lIter, ++lCh) {
139 if (discardDigisWithAPVAddrErr && aAddrVec[2 * lCh] != lMaj && aAddrVec[2 * lCh + 1] != lMaj) {
143 DetSetRawDigis::const_iterator iDigi = (*lIter)->begin();
144 const DetSetRawDigis::const_iterator endOfChannel = (*lIter)->end();
146 if (iDigi == endOfChannel) {
151 const DetSetRawDigis::const_iterator payloadBegin = iDigi + aHeaderBitVec[lCh] + 24;
152 const DetSetRawDigis::const_iterator payloadEnd = payloadBegin +
STRIPS_PER_FEDCH;
154 if (payloadEnd - iDigi >= endOfChannel - iDigi)
160 std::vector<SiStripRawDigi>& outputDetSetData = outputData.back().data;
162 std::vector<SiStripRawDigi>::iterator outputBegin = outputDetSetData.begin();
163 std::copy(payloadBegin, payloadEnd, outputBegin);
166 aFedScopeDigis.clear();
168 aHeaderBitVec.clear();
169 aTrailBitVec.clear();
179 std::vector<DetSetRawDigis> outputData;
180 outputData.reserve(inputPayloadDigis->
size());
184 inputChannel != inputPayloadDigis->
end();
186 const std::vector<SiStripRawDigi>& inputDetSetData = inputChannel->data;
188 std::vector<SiStripRawDigi>& outputDetSetData = outputData.back().data;
191 for (uint16_t readoutOrderStripIndex = 0; readoutOrderStripIndex < inputDetSetData.size();
192 ++readoutOrderStripIndex) {
193 const uint16_t physicalOrderStripIndex =
195 outputDetSetData.at(physicalOrderStripIndex) = inputDetSetData.at(readoutOrderStripIndex);
200 return std::make_unique<DSVRawDigis>(outputData,
true);
210 auto iFed = cabling.
fedIds().begin();
211 auto endFeds = cabling.
fedIds().end();
212 for (; iFed != endFeds; ++iFed) {
215 auto iConn = conns.begin();
216 auto endConns = conns.end();
217 for (; iConn != endConns; ++iConn) {
219 if (!iConn->isConnected())
227 if (iDetSet == inputPhysicalOrderChannelDigis->
end()) {
238 DetSetRawDigis::const_iterator iDigi = iDetSet->begin();
239 const DetSetRawDigis::const_iterator endDetSetDigis = iDetSet->end();
240 for (; iDigi != endDetSetDigis; ++iDigi) {