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;
33 if (ifebWithData < persObj->m_subset.m_febsWithSparseData.size() &&
44 for (
unsigned int j = 0; j < nChannelsPerFeb; ++j){
46 bool copyChannel =
true;
48 if (!(chansSet & (1 << (j - chansOffset)))) {
52 if (j%32 == 31 && j < nChannelsPerFeb-2) {
64 if (shapeIndex >= persObj->
m_vShape.size() ||
67 <<
"LArShapeSubsetCnv_p1::persToTrans - shape index too large: shape/size, shapeder/size "
68 << shapeIndex <<
" " << persObj->
m_vShape.size() <<
" "
69 << shapederIndex <<
" " << persObj->
m_vShapeDer.size()
75 subsetIt->second[j].m_vShape.resize(nShapes);
76 subsetIt->second[j].m_vShapeDer.resize(nShapeDers);
79 subsetIt->second[j].m_vShape[
k] = persObj->
m_vShape[shapeIndex];
84 subsetIt->second[j].m_vShapeDer[
k] = persObj->
m_vShapeDer[shapederIndex];
110 std::vector<float> vShape(nShapes,0.0);
111 std::vector<float> vShapeDer(nShapeDers,0.0);
118 for (
unsigned int i = 0;
i < ncorrs; ++
i){
120 if (shapeIndex >= persObj->
m_vShape.size() ||
123 <<
"LArShapeSubsetCnv_p1::persToTrans - shape index too large: shape/size, shapeder/size "
124 << shapeIndex <<
" " << persObj->
m_vShape.size() <<
" "
125 << shapederIndex <<
" " << persObj->
m_vShapeDer.size()
132 corrs[
i].second.m_vShape[
k] = persObj->
m_vShape[shapeIndex];
137 corrs[
i].second.m_vShapeDer[
k] = persObj->
m_vShapeDer[shapederIndex];
154 MsgStream &
log)
const
189 unsigned int nsubsetsNotEmpty = 0;
191 unsigned int nchans = 0;
192 unsigned int nShapes = 0;
193 unsigned int nShapeDers = 0;
194 bool foundNShapes =
false;
195 std::vector<unsigned int> febsWithSparseData;
199 const auto subsetEnd = transObj->
subsetEnd();
201 subsetIt != subsetEnd;
204 unsigned int nfebChans = subsetIt->second.size();
206 if (nfebChans != 0 && nfebChans != nChannelsPerFeb) {
208 <<
"LArShapeSubsetCnv_p1::transToPers - found incorrect number of channels per feb: " << nfebChans
212 if (nfebChans) ++nsubsetsNotEmpty;
215 bool subsetIsSparse =
false;
216 for (
unsigned int j = 0; j < nfebChans; ++j) {
217 const LArShapeP1& shape = subsetIt->second[j];
219 if (!subsetIsSparse) {
221 subsetIsSparse =
true;
222 febsWithSparseData.push_back(subsetIt->first);
236 if (!foundNShapes && ncorrs > 0) {
243 if (nShapes == 0 && nShapeDers == 0) {
245 <<
"LArShapeSubsetCnv_p1::transToPers - cannot get number of shapes and shape derivatives"
257 unsigned int nShapesTot = (nchans + ncorrs)*nShapes;
258 unsigned int nShapeDersTot = (nchans + ncorrs)*nShapeDers;
259 persObj->
m_vShape.reserve(nShapesTot);
266 if (febsWithSparseData.size())
270 unsigned int isparse = 0;
272 subsetIt != subsetEnd;
275 unsigned int nfebChans = subsetIt->second.size();
278 if (nfebChans == 0)
continue;
280 unsigned int febid = subsetIt->first;
284 bool isSparse =
false;
285 if (isparse < febsWithSparseData.size() &&
286 febsWithSparseData[isparse] == febid) {
296 unsigned int chansSet = 0;
297 unsigned int chansOffset = 0;
298 for (
unsigned int j = 0; j < nfebChans; ++j){
300 bool saveShapes =
true;
304 if (subsetIt->second[j].m_vShape.size() > 0) {
306 assert (j >= chansOffset && (j - chansOffset) <= 31);
307 chansSet |= (1 << (j - chansOffset));
313 if (j == (chansOffset + 31) || j == nfebChans-1) {
321 for (
unsigned int k = 0;
k < nShapes; ++
k){
322 persObj->
m_vShape.push_back(subsetIt->second[j].m_vShape[
k]);
325 for (
unsigned int k = 0;
k < nShapeDers; ++
k){
326 persObj->
m_vShapeDer.push_back(subsetIt->second[j].m_vShapeDer[
k]);
350 for (
unsigned int k = 0;
k < nShapes; ++
k){
351 persObj->
m_vShape.push_back(corrIt->second.m_vShape[
k]);
354 for (
unsigned int k = 0;
k < nShapeDers; ++
k){
355 persObj->
m_vShapeDer.push_back(corrIt->second.m_vShapeDer[
k]);