11 MsgStream &
log)
const
19 unsigned int shapeIndex = 0;
20 unsigned int shapederIndex = 0;
23 unsigned int ifebWithData = 0;
26 for (
unsigned int i = 0;
i < nfebids; ++
i, ++subsetIt){
28 unsigned int febid = subsetIt->first;
30 bool hasSparseData =
false;
31 unsigned int chansSet = 0;
32 unsigned int chansOffset = 0;
44 for (
unsigned int j = 0; j < nChannelsPerFeb; ++j){
46 bool copyChannel =
true;
50 if (!(chansSet & (1 << (j - chansOffset)))) {
54 if (j%32 == 31 && j < nChannelsPerFeb-2) {
66 if (shapeIndex >= persObj->
m_vShape.size() ||
69 <<
"LArShapeSubsetCnv_p1::persToTrans - shape index too large: shape/size, shapeder/size "
70 << shapeIndex <<
" " << persObj->
m_vShape.size() <<
" "
71 << shapederIndex <<
" " << persObj->
m_vShapeDer.size()
77 subsetIt->second[j].m_vShape.resize(nShapes);
78 subsetIt->second[j].m_vShapeDer.resize(nShapeDers);
81 subsetIt->second[j].m_vShape[
k] = persObj->
m_vShape[shapeIndex];
86 subsetIt->second[j].m_vShapeDer[
k] = persObj->
m_vShapeDer[shapederIndex];
112 std::vector<float> vShape(nShapes,0.0);
113 std::vector<float> vShapeDer(nShapeDers,0.0);
120 for (
unsigned int i = 0;
i < ncorrs; ++
i){
122 if (shapeIndex >= persObj->
m_vShape.size() ||
125 <<
"LArShapeSubsetCnv_p1::persToTrans - shape index too large: shape/size, shapeder/size "
126 << shapeIndex <<
" " << persObj->
m_vShape.size() <<
" "
127 << shapederIndex <<
" " << persObj->
m_vShapeDer.size()
134 corrs[
i].second.m_vShape[
k] = persObj->
m_vShape[shapeIndex];
139 corrs[
i].second.m_vShapeDer[
k] = persObj->
m_vShapeDer[shapederIndex];
156 MsgStream &
log)
const
191 unsigned int nsubsetsNotEmpty = 0;
193 unsigned int nchans = 0;
194 unsigned int nShapes = 0;
195 unsigned int nShapeDers = 0;
196 bool foundNShapes =
false;
197 std::vector<unsigned int> febsWithSparseData;
201 const auto subsetEnd = transObj->
subsetEnd();
203 subsetIt != subsetEnd;
206 unsigned int nfebChans = subsetIt->second.size();
208 if (nfebChans != 0 && nfebChans != nChannelsPerFeb) {
210 <<
"LArShapeSubsetCnv_p1::transToPers - found incorrect number of channels per feb: " << nfebChans
214 if (nfebChans) ++nsubsetsNotEmpty;
217 bool subsetIsSparse =
false;
218 for (
unsigned int j = 0; j < nfebChans; ++j) {
219 const LArShapeP1& shape = subsetIt->second[j];
221 if (!subsetIsSparse) {
223 subsetIsSparse =
true;
224 febsWithSparseData.push_back(subsetIt->first);
238 if (!foundNShapes && ncorrs > 0) {
245 if (nShapes == 0 && nShapeDers == 0) {
247 <<
"LArShapeSubsetCnv_p1::transToPers - cannot get number of shapes and shape derivatives"
259 unsigned int nShapesTot = (nchans + ncorrs)*nShapes;
260 unsigned int nShapeDersTot = (nchans + ncorrs)*nShapeDers;
261 persObj->
m_vShape.reserve(nShapesTot);
268 if (febsWithSparseData.size())
272 unsigned int isparse = 0;
274 subsetIt != subsetEnd;
277 unsigned int nfebChans = subsetIt->second.size();
280 if (nfebChans == 0)
continue;
282 unsigned int febid = subsetIt->first;
286 bool isSparse =
false;
287 if (isparse < febsWithSparseData.size() &&
288 febsWithSparseData[isparse] == febid) {
298 unsigned int chansSet = 0;
299 unsigned int chansOffset = 0;
300 for (
unsigned int j = 0; j < nfebChans; ++j){
302 bool saveShapes =
true;
306 if (subsetIt->second[j].m_vShape.size() > 0) {
308 assert (j >= chansOffset && (j - chansOffset) <= 31);
310 chansSet |= (1 << (j - chansOffset));
316 if (j == (chansOffset + 31) || j == nfebChans-1) {
324 for (
unsigned int k = 0;
k < nShapes; ++
k){
325 persObj->
m_vShape.push_back(subsetIt->second[j].m_vShape[
k]);
328 for (
unsigned int k = 0;
k < nShapeDers; ++
k){
329 persObj->
m_vShapeDer.push_back(subsetIt->second[j].m_vShapeDer[
k]);
353 for (
unsigned int k = 0;
k < nShapes; ++
k){
354 persObj->
m_vShape.push_back(corrIt->second.m_vShape[
k]);
357 for (
unsigned int k = 0;
k < nShapeDers; ++
k){
358 persObj->
m_vShapeDer.push_back(corrIt->second.m_vShapeDer[
k]);