FrSimEvent structure is not read from Frame.
When I try to read the parameter list of a FrSimEvent structure from a frame, all the parameter names are empty and the values are blank. The version of framecpp I used (2.9.0-0.01+deb10u0) is from the debian buster-proposed repo. Here is the result of a dump program (SimList):
SimList -v 9 -infile $HOME/test/wstream/data/12340/DMTGen-1234000000-4.gwf
name: sg00000001
comment: SinGauss sg(A=1.18089e-22, F=795.339, Phi=0, Q=1, Width=6)
time: 1234000000.925105091
parameters:
= 0
= 0
= 0
= 0
= 0
The code from SimList that produces this output is:
//------------------------------ Loop over events
for (FrameH::const_simEvent_iterator i=frame->RefSimEvent().begin();
i != frame->RefSimEvent().end() && !mTerm ; i++) {
if (!mVerbose) {
*(mOutput) << (*i)->GetGTime() << " " << (*i)->GetComment()
<< endl;
} else {
*(mOutput) << "name: " << (*i)->GetName() << endl;
*(mOutput) << "comment: " << (*i)->GetComment() << endl;
*(mOutput) << "time: " << (*i)->GetGTime() << endl;
*(mOutput) << "parameters: " << endl;
const FrSimEvent::ParamList_type& l((*i)->GetParam());
for (auto j=l.begin(); j!=l.end(); j++) {
*(mOutput) << " " << j->first << " = " << j->second
<< endl;
}
}
mTrigProc++;
}
It is clear that most of the structure was read correctly, most of the fields corresponds to the structure contents written to the frame, but the number of the parameters is the only thing that is correct in the parameter list.
I believe that the problem is that the loop variable, p, in your range-based for loops (shown below) is being set from the input stream, rather than the data vector contents.
Data.resize( nParam );
for ( auto p : Data ) {
Stream >> p.second; // parameters
}
for ( auto p : Data ) {
STRING shadow;
Stream >> shadow;
p.first.swap( shadow );
}
Edited by John Zweizig