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

Change from int to StarMagField::EBField type #605

Merged
merged 1 commit into from
Oct 13, 2023

Conversation

genevb
Copy link
Contributor

@genevb genevb commented Oct 13, 2023

Resolves a run-time error seen in tests of compiling software for ROOT 6.16.00. I also tested this fix in ROOT 5.34.38 to be sure it doesn't break it.

-Gene


root4star -b -q -l 'bfc.C(-1)'

...

QA :INFO - ProcessLine if (!StarMagField::Instance()) new StarMagField( 2, 1.000000, kTRUE);
input_line_668:2:37: error: no matching constructor for initialization of 'StarMagField'
if (!StarMagField::Instance()) new StarMagField( 2, 1.000000, kTRUE);
^ ~~~~~~~~~~~~~~~~~~
/afs/rhic.bnl.gov/star/packages/SL23x/.sl73_x8664_gcc485/include/StarMagField.h:155:3: note: candidate constructor not viable: no known conversion from 'int' to 'StarMagField::EBField' for 1st argument
StarMagField ( EBField map = kMapped, Float_t Factor = 1,
^
/afs/rhic.bnl.gov/star/packages/SL23x/.sl73_x8664_gcc485/include/StarMagField.h:91:7: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 3 were provided
class StarMagField : public TVirtualMagField
^
BFC:ERROR - StBFChain::ProcessLine command:if (!StarMagField::Instance()) new StarMagField( 2, 1.000000, kTRUE); has failed. Quit job.

Copy link
Member

@plexoos plexoos left a comment

Choose a reason for hiding this comment

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

Hm, it is strange that we don't see this runtime error for StarMagField in our CI jobs with ROOT 6.16. We don't run specifically 'bfc.C(-1)' but I would think the initialization is the same.

The change itself is good. We should favor named constants

@genevb genevb merged commit ae51606 into star-bnl:main Oct 13, 2023
148 checks passed
@genevb
Copy link
Contributor Author

genevb commented Oct 13, 2023

Hm, it is strange that we don't see this runtime error for StarMagField in our CI jobs with ROOT 6.16. We don't run specifically 'bfc.C(-1)' but I would think the initialization is the same.

Running bfc.C(-1) results in turning on the chain option Test.default.ITTF (see below) which leads eventually to turning on the option FieldOn, which causes this line of code to be called in StBFChain.cxx. Normal chains do not have these options turned on. It isn't the most important test, but it's simple to execute and does test a lot of details.

From bfc.C:

TString defChain("y2010,gstar,Test.default.ITTF,NosvtIT,NossdIT,-sfs,-ssdFast,sdt20100107.110000");

dkapukchyan pushed a commit to dkapukchyan/star-sw that referenced this pull request Mar 11, 2024
Resolves a run-time error seen in tests of compiling software for ROOT
6.16.00. I also tested this fix in ROOT 5.34.38 to be sure it doesn't
break it.

-Gene
____________________

    root4star -b -q -l 'bfc.C(-1)'

...

QA :INFO - ProcessLine if (!StarMagField::Instance()) new StarMagField(
2, 1.000000, kTRUE);
input_line_668:2:37: error: no matching constructor for initialization
of 'StarMagField'
 if (!StarMagField::Instance()) new StarMagField( 2, 1.000000, kTRUE);
                                    ^             ~~~~~~~~~~~~~~~~~~

/afs/rhic.bnl.gov/star/packages/SL23x/.sl73_x8664_gcc485/include/StarMagField.h:155:3:
note: candidate constructor not viable: no known conversion from 'int'
to 'StarMagField::EBField' for 1st argument
  StarMagField ( EBField map     = kMapped, Float_t Factor  =      1, 
  ^

/afs/rhic.bnl.gov/star/packages/SL23x/.sl73_x8664_gcc485/include/StarMagField.h:91:7:
note: candidate constructor (the implicit copy constructor) not viable:
requires 1 argument, but 3 were provided
class StarMagField : public TVirtualMagField 
      ^
BFC:ERROR - StBFChain::ProcessLine command:if
(!StarMagField::Instance()) new StarMagField( 2, 1.000000, kTRUE); has
failed. Quit job.
@genevb genevb deleted the EBField_enum branch March 16, 2024 03:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants