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

make some internal globals const in TkBfield.cc #27422

Merged
merged 3 commits into from Jul 5, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 6 additions & 6 deletions MagneticField/ParametrizedEngine/src/TkBfield.cc
Expand Up @@ -11,18 +11,18 @@ using namespace magfieldparam;

namespace {

BCylParam<float> fpar1{
const BCylParam<float> fpar1{
4.90541f, 17.8768f, 2.02355f, 0.0210538f, 0.000321885f, 2.37511f, 0.00326725f, 2.07656f, 1.71879f}; // 2.0T-2G
BCylParam<float> fpar2{
const BCylParam<float> fpar2{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

constexpr?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense; done.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apparently clang disagrees

4.41982f, 15.7732f, 3.02621f, 0.0197814f, 0.000515759f, 2.43385f, 0.00584258f, 2.11333f, 1.76079f}; // 3.0T-2G
BCylParam<float> fpar3{
const BCylParam<float> fpar3{
4.30161f, 15.2586f, 3.51926f, 0.0183494f, 0.000606773f, 2.45110f, 0.00709986f, 2.12161f, 1.77038f}; // 3.5T-2G
BCylParam<float> fpar4{
const BCylParam<float> fpar4{
4.24326f, 15.0201f, 3.81492f, 0.0178712f, 0.000656527f, 2.45818f, 0.00778695f, 2.12500f, 1.77436f}; // 3.8T-2G
BCylParam<float> fpar5{
const BCylParam<float> fpar5{
4.21136f, 14.8824f, 4.01683f, 0.0175932f, 0.000695541f, 2.45311f, 0.00813447f, 2.11688f, 1.76076f}; // 4.0T-2G
std::string const flds[] = {"2_0T", "3_0T", "3_5T", "3_8T", "4_0T"};
float flds_f[] = {2.0, 3.0, 3.5, 3.8, 4.0};
constexpr float flds_f[] = {2.0, 3.0, 3.5, 3.8, 4.0};
BCylParam<float> const fpars[]{fpar1, fpar2, fpar3, fpar4, fpar5};

BCylParam<float> const& findPar(float fld) {
Expand Down