Skip to content
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

Conversation

Dr15Jones
Copy link
Contributor

By moving the initialization to library load time, the static used
by BeamSpotTransientTrackingRecHit can be made const. This avoids
thread-safety issues.

By moving the initialization to library load time, the static used
by BeamSpotTransientTrackingRecHit can be made const. This avoids
thread-safety issues.
@cmsbuild
Copy link
Contributor

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.
@ghellwig, @mmusich, @frmeier this is something you requested to watch as well.
You can sign-off by replying to this message having '+1' in the first line of your reply.
You can reject by replying to this message having '-1' in the first line of your reply.
@nclopezo, @ktf you are the release manager for this.
You can merge this pull request by typing 'merge' in the first line of your comment.

@cmsbuild
Copy link
Contributor

cmsbuild commented May 1, 2014

@cmsbuild
Copy link
Contributor

cmsbuild commented May 1, 2014

@diguida
Copy link
Contributor

diguida commented May 1, 2014

+1

@cmsbuild
Copy link
Contributor

cmsbuild commented May 1, 2014

This pull request is fully signed and it will be integrated in one of the next CMSSW_7_1_X IBs unless changes (tests are also fine). @nclopezo, @ktf can you please take care of it?

isInitialized = true;
AlgebraicMatrix ret( 1, 5, 0);
ret[0][3] = 1;
return ret;
}
Copy link
Contributor

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?

Copy link
Contributor Author

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 :).

ktf added a commit that referenced this pull request May 1, 2014
…nsientTrackingRecHit

Reco -- Made static const for BeamSpotTransientTrackingRecHit
@ktf ktf merged commit 3550478 into cms-sw:CMSSW_7_1_X May 1, 2014
@Dr15Jones Dr15Jones deleted the makeStaticConstForBeamSpotTransientTrackingRecHit branch May 6, 2014 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants