25 std::vector<uint32_t>* pAPVAddresses,
26 const bool discardDigisWithAPVAddrErr,
28 const uint16_t expectedPos) {
30 std::vector<DetSetRawDigis> outputData;
31 outputData.reserve(inputScopeDigis->
size());
35 std::vector<uint16_t> lAddrVec;
37 uint16_t lPreviousFedId = 0;
38 std::vector<uint16_t> lHeaderBitVec;
40 std::vector<uint16_t> lTrailBitVec;
44 std::vector<DSVRawDigis::const_iterator> lFedScopeDigis;
50 bool hasBeenProcessed =
false;
52 for (; inputChannel != endChannels; ++inputChannel) {
53 const uint32_t lFedIndex = inputChannel->detId();
54 const uint16_t
fedId = static_cast<uint16_t>((lFedIndex >> 16) & 0xFFFF);
59 if (lPreviousFedId == 0) {
60 lPreviousFedId =
fedId;
75 if (
fedId == lPreviousFedId) {
77 hasBeenProcessed =
false;
79 if (
fedId != lPreviousFedId) {
81 discardDigisWithAPVAddrErr,
88 lPreviousFedId =
fedId;
89 hasBeenProcessed =
true;
92 lFedScopeDigis.push_back(inputChannel);
101 if (!hasBeenProcessed) {
103 discardDigisWithAPVAddrErr,
113 return std::unique_ptr<DSVRawDigis>(
new DSVRawDigis(outputData,
true));
118 const bool discardDigisWithAPVAddrErr,
119 std::vector<uint32_t>* pAPVAddresses,
120 std::vector<DetSetRawDigis>& outputData,
121 std::vector<uint16_t>& aAddrVec,
122 std::vector<uint16_t>& aHeaderBitVec,
123 std::vector<uint16_t>& aTrailBitVec,
124 std::vector<DSVRawDigis::const_iterator>& aFedScopeDigis) {
128 (*pAPVAddresses)[aPreviousFedId] = lMaj;
131 std::vector<DSVRawDigis::const_iterator>::iterator lIter;
132 unsigned int lCh = 0;
133 for (lIter = aFedScopeDigis.begin(); lIter != aFedScopeDigis.end(); ++lIter, ++lCh) {
137 if (discardDigisWithAPVAddrErr && aAddrVec[2 * lCh] != lMaj && aAddrVec[2 * lCh + 1] != lMaj) {
141 DetSetRawDigis::const_iterator iDigi = (*lIter)->begin();
142 const DetSetRawDigis::const_iterator endOfChannel = (*lIter)->end();
144 if (iDigi == endOfChannel) {
149 const DetSetRawDigis::const_iterator payloadBegin = iDigi + aHeaderBitVec[lCh] + 24;
150 const DetSetRawDigis::const_iterator payloadEnd = payloadBegin +
STRIPS_PER_FEDCH;
152 if (payloadEnd - iDigi >= endOfChannel - iDigi)
158 std::vector<SiStripRawDigi>& outputDetSetData = outputData.back().data;
160 std::vector<SiStripRawDigi>::iterator outputBegin = outputDetSetData.begin();
161 std::copy(payloadBegin, payloadEnd, outputBegin);
164 aFedScopeDigis.clear();
166 aHeaderBitVec.clear();
167 aTrailBitVec.clear();
177 std::vector<DetSetRawDigis> outputData;
178 outputData.reserve(inputPayloadDigis->
size());
182 inputChannel != inputPayloadDigis->
end();
184 const std::vector<SiStripRawDigi>& inputDetSetData = inputChannel->data;
186 std::vector<SiStripRawDigi>& outputDetSetData = outputData.back().data;
189 for (uint16_t readoutOrderStripIndex = 0; readoutOrderStripIndex < inputDetSetData.size();
190 ++readoutOrderStripIndex) {
191 const uint16_t physicalOrderStripIndex =
193 outputDetSetData.at(physicalOrderStripIndex) = inputDetSetData.at(readoutOrderStripIndex);
198 return std::unique_ptr<DSVRawDigis>(
new DSVRawDigis(outputData,
true));
208 auto iFed = cabling.
fedIds().begin();
209 auto endFeds = cabling.
fedIds().end();
210 for (; iFed != endFeds; ++iFed) {
213 auto iConn = conns.begin();
214 auto endConns = conns.end();
215 for (; iConn != endConns; ++iConn) {
217 if (!iConn->isConnected())
225 if (iDetSet == inputPhysicalOrderChannelDigis->
end()) {
236 DetSetRawDigis::const_iterator iDigi = iDetSet->begin();
237 const DetSetRawDigis::const_iterator endDetSetDigis = iDetSet->end();
238 for (; iDigi != endDetSetDigis; ++iDigi) {