Define Constants in a separate Class
When changing some code today I stumbled again over some constants which are defined directly in the code. In this case it was the proton mass in CbmUnigenGenerator, but I am sure we have such definitions in many classes.
To overcome the problem I propose to create a new class CbmConstants (or similar) and put all definitions there. This class should be then included at any place where such constants are needed.
Updated by Volker Friese about 7 years ago
- Tracker changed from Feature to Development
- Status changed from New to Assigned
- Assignee set to Florian Uhlig
Good proposal; I agree. Better, I think, than a class would be a include file with namespace Cbm:: for the constants, which are then to be made static global. We will gradually move constants there when encountering them in code reviews.
Updated by Volker Friese over 6 years ago
Well, then the hardcoding of the numbers is done in ROOT instead of in CbmRoot. That's of course possible. But anybody can call this ROOT method himself from anywhere in the code, so I do not se the need to wrap this by CbmRoot.
Anyhow, the header file is there and can be used. Guess the issue can be closed then.