kelseymh / G4CMP

A low energy condensed matter physics package for Geant4
GNU General Public License v3.0
28 stars 15 forks source link

Geant4 version 11.0.4 compile errors #24

Open whit2333 opened 2 months ago

whit2333 commented 2 months ago

G4PhysicsModelCatalog

The latest G4 version changed the G4PhysicsModelCatalog interface latest: https://geant4.kek.jp/Reference/11.2.0/classG4PhysicsModelCatalog.html v10.05: https://geant4.kek.jp/Reference/10.05/classG4PhysicsModelCatalog.html

G4CMP/library/src/G4CMPConfigManager.cc:111:44: error: ‘Register’ is not a member of ‘G4PhysicsModelCatalog’

Not sure how to fix this one right away.

G4String changes

substr

Also, errors with G4String which no longer has the implicit conversion operator taking two integers:

/G4CMP/library/src/G4CMPConfigManager.cc:169:11: error: no match for call to ‘(G4String) (int, int)’
 if (name(0,3) == "lin") setNIEL(new G4CMPLindhardNIEL);

latest: https://geant4.kek.jp/Reference/11.2.0/classG4String.html v10.05: https://geant4.kek.jp/Reference/10.05/classG4String.html

I suggest using substr https://en.cppreference.com/w/cpp/string/basic_string/substr

(int,int) -> .substr(int,int)

index

Similar issue with new G4String. Can replace with find. .index(args) -> .find(args)

Index is just wrapper on https://en.cppreference.com/w/cpp/string/basic_string/find

kelseymh commented 1 month ago

Apologies for not replying; we haven't used GitHub issues for G4CMP, and I'm not consistently getting notifications about them. The G4CMP package has not been migrated for consistency with Geant4 11 at all. There are multiple interface changes (besides the two you found) which make such a migration irreversable. For now, we're keeping it at Geant4 10.7, for compatibility with the main experimental users. I'll leave this issue open as a reminder.