Summary
src/dedx_const.h defines a set of physics constants but the header is not included by any translation unit, and none of the macros it defines are referenced anywhere in src/ or include/. It is effectively dead code.
Details
The header defines:
#define DEDX_N_AVO 6.0221367
#define DEDX_AMU 931.49432
#define DEDX_PI 3.14159265358979323846
#define DEDX_EMASS 0.51099906
#define DEDX_ECHARGE 1.60217733
#define DEDX_ECHARGE2 14.399652
Evidence:
grep -rln 'dedx_const.h' src include → matches only the file itself (no #include "dedx_const.h" anywhere).
grep -rn 'DEDX_N_AVO\|DEDX_AMU\|DEDX_EMASS\|DEDX_ECHARGE' src include (excluding the header itself) → no matches.
So either:
- The header is stale and should be removed, or
- These constants are duplicated as magic numbers in the
.c files (Bethe / mpaul / mstar computations) and the intent was to centralize them here.
Suggested action
Confirm which case applies:
- If the constants are unused → delete
src/dedx_const.h.
- If equivalent magic numbers exist in the
.c files → wire the header in and replace the literals, so the constants live in one place.
Notes
This was found during a dependency-structure review of libdedx. The overall include graph is otherwise clean (no circular dependencies, consistent and unique include guards, good public/private header separation). A few other smaller items were noted separately (e.g. static const arrays defined in dedx_periodic_table.h); this issue is scoped to the dedx_const.h dead code only.
Summary
src/dedx_const.hdefines a set of physics constants but the header is not included by any translation unit, and none of the macros it defines are referenced anywhere insrc/orinclude/. It is effectively dead code.Details
The header defines:
Evidence:
grep -rln 'dedx_const.h' src include→ matches only the file itself (no#include "dedx_const.h"anywhere).grep -rn 'DEDX_N_AVO\|DEDX_AMU\|DEDX_EMASS\|DEDX_ECHARGE' src include(excluding the header itself) → no matches.So either:
.cfiles (Bethe / mpaul / mstar computations) and the intent was to centralize them here.Suggested action
Confirm which case applies:
src/dedx_const.h..cfiles → wire the header in and replace the literals, so the constants live in one place.Notes
This was found during a dependency-structure review of libdedx. The overall include graph is otherwise clean (no circular dependencies, consistent and unique include guards, good public/private header separation). A few other smaller items were noted separately (e.g.
static constarrays defined indedx_periodic_table.h); this issue is scoped to thededx_const.hdead code only.