From ae51606cb98b25fa052f793d3b623041d5049fbc Mon Sep 17 00:00:00 2001 From: Gene Van Buren <85305093+genevb@users.noreply.github.com> Date: Fri, 13 Oct 2023 10:56:19 -0400 Subject: [PATCH] Change from int to StarMagField::EBField type (#605) 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. --- StRoot/StBFChain/StBFChain.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/StRoot/StBFChain/StBFChain.cxx b/StRoot/StBFChain/StBFChain.cxx index 008f2509850..2ad61649dd6 100644 --- a/StRoot/StBFChain/StBFChain.cxx +++ b/StRoot/StBFChain/StBFChain.cxx @@ -1918,7 +1918,7 @@ void StBFChain::SetDbOptions(StMaker *mk){ << "\",\"MagFactor\")" << endm; if ( gClassTable->GetID("StarMagField") >= 0) { TString cmd = - Form("if (!StarMagField::Instance()) new StarMagField( 2, %f, kTRUE);", + Form("if (!StarMagField::Instance()) new StarMagField( StarMagField::EBField::kMapped, %f, kTRUE);", FieldOptions[k].scale); ProcessLine(cmd); }