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
Made static const for BeamSpotTransientTrackingRecHit #3580
Made static const for BeamSpotTransientTrackingRecHit #3580
Conversation
By moving the initialization to library load time, the static used by BeamSpotTransientTrackingRecHit can be made const. This avoids thread-safety issues.
A new Pull Request was created by @Dr15Jones (Chris Jones) for CMSSW_7_1_X. Made static const for BeamSpotTransientTrackingRecHit It involves the following packages: Alignment/ReferenceTrajectories @cmsbuild, @Degano, @diguida, @rcastello, @nclopezo can you please review it and eventually sign? Thanks. |
+1 |
isInitialized = true; | ||
AlgebraicMatrix ret( 1, 5, 0); | ||
ret[0][3] = 1; | ||
return ret; | ||
} |
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.
@Dr15Jones
Dummy question for my education. By declaring the initialize
function as static
, you make it visible only in this compilation unit, i.e. this library, right? This way, you can use it only in this file to initialise the instances you need.
But, IIRC, in order to mark a function as having internal linkage, so that it cannot be referenced in other compilation units, we can use anonymous namespaces in C++. Is there any reason for choosing one approach w.r.t. another?
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.
I'm still distrustful about how symbols are exported using anonymous namespaces. I'm probably just too old and set in my ways :).
…nsientTrackingRecHit Reco -- Made static const for BeamSpotTransientTrackingRecHit
By moving the initialization to library load time, the static used
by BeamSpotTransientTrackingRecHit can be made const. This avoids
thread-safety issues.