-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add double values to LCParameters #143
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. I just have a question about the versioning and how it relates to I/O and some potential improvements (which would probably also apply to other parts of the LCParameters handling)
int nDouble ; | ||
SIO_DATA( device , &nDouble , 1 ) ; | ||
EVENT::DoubleVec doubleVec(nDouble) ; | ||
for(int j=0; j< nDouble ; j++ ) { | ||
SIO_DATA( device , &doubleVec[j] , 1 ) ; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
int nDouble ; | |
SIO_DATA( device , &nDouble , 1 ) ; | |
EVENT::DoubleVec doubleVec(nDouble) ; | |
for(int j=0; j< nDouble ; j++ ) { | |
SIO_DATA( device , &doubleVec[j] , 1 ) ; | |
} | |
EVENT::DoubleVec doubleVec; | |
SIO_SDATA(device, doubleVec); |
sio should be able to handle vectors as a whole, without having to read each element separately. We do this in podio: https://github.com/AIDASoft/podio/blob/master/src/SIOBlock.cc#L47-L67
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right of course. I have here intentionally used the same code structure as for the other parameters for 'consistency'. I believe we should create a separate PR and apply this optimization in all streaming handlers...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed :) I will create an issue to keep track of it.
SIO_DATA( device , &nDouble , 1 ) ; | ||
for(int j=0; j< nDouble ; j++ ){ | ||
SIO_SDATA( device, doubleVec[j] ) ; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SIO_DATA( device , &nDouble , 1 ) ; | |
for(int j=0; j< nDouble ; j++ ){ | |
SIO_SDATA( device, doubleVec[j] ) ; | |
} | |
SIO_SDATA(device, doubleVec); |
See above.
BEGINRELEASENOTES
ENDRELEASENOTES