Suggestions by Cristiano
Suggestions for improvements from Cristiano:
https://git.km3net.de/opensource/gseagen/-/blob/master/src/tools/gGeometry/gPlotGeo.C?ref_type=heads
non-uniform code style (spacing)
commented line 103
https://git.km3net.de/opensource/gseagen/-/blob/master/src/tools/gFileConvert/gFileConvert.cxx?ref_type=heads
string constants repeated, better check on pointers
The syntax is not derived from string constants
https://git.km3net.de/opensource/gseagen/-/blob/master/src/tools/gCalcPEarth/gCalcPEarth.cxx?ref_type=heads
avoid calls to system ("rm... or wrap them
Syntax not derived from string constants, large commented block
Line 295 mistyped comment
https://git.km3net.de/opensource/gseagen/-/blob/master/src/tools/gCalcCross/gCalcCross.cxx?ref_type=heads
avoid calls to system ("rm... or wrap them
Syntax not derived from string constants, large commented block
https://git.km3net.de/opensource/gseagen/-/blob/master/src/tools/gCalcAstro/gCalcAstro.cxx?ref_type=heads
string constants repeated
The syntax is not derived from string constants
Repeated calls to trigonometric functions
https://git.km3net.de/opensource/gseagen/-/blob/master/src/tools/SeaNuDrivers/GSeaSyst.cxx?ref_type=heads
string constants repeated
https://git.km3net.de/opensource/gseagen/-/blob/master/src/tools/SeaNuDrivers/GAstro.cxx?ref_type=heads, https://git.km3net.de/opensource/gseagen/-/blob/master/src/tools/SeaNuDrivers/GAstro.h?ref_type=heads
why not replace pointers with references?
string constants repeated
non-uniform spacing style
https://git.km3net.de/opensource/gseagen/-/blob/master/src/tools/SeaNuDrivers/GGenerateEvent.cxx
avoid calls to system
special handling should be taken out of the method and placed in an isolated method call
Line 309, Br80
if(AtomicMass.find(1000350800) == AtomicMass.end()){
AtomicMass.insert(map<int, double>::value_type(1000350800,79.9185293));
ElementName.insert(map<int, string>::value_type(1000350800,"Br"));
}
Lines 454-456
repeated fGenPar->RhoSR * MassFrac[iComp]
PropagationTau: line 1289 why not put tau mass explicitly? (but the comment is OK)
DistToCan: the computation could be optimized by avoiding repeated multiplications. Difficult to follow the implementation without a geometrical sketch.
WriteTracks: use switch instead of if chain
----------------------------------------------------------------
https://git.km3net.de/opensource/gseagen/-/blob/master/src/SeaNuDrivers/GAstro.cxx
useless "return" statements in void methods.
multiple calls to trigonometric functions that could be coalesced
formulae involving precession/nutation should be explicitly referenced (I see the global citation in the file header, but some more explicitly written formula could be added).
I suggest adding a hyperlink to a documentation pdf that shows the formulae.
https://git.km3net.de/opensource/gseagen/-/blob/master/src/SeaNuDrivers/GGenerateEvent.cxx
string("/data/evgen/catalogues/iso/natural-isotopes.data"); -> this might change with GENIE version. Such strings should be isolated from the code and put in a specific file for easier maintenance.
There are too many repeated string constants carved in the code.
https://git.km3net.de/opensource/gseagen/-/blob/master/src/SeaNuDrivers/GGenerateEventExternal.cxx
"return" found in empty methods.
Comments to empty methods seem to refer to other versions.
https://git.km3net.de/opensource/gseagen/-/blob/master/src/SeaNuDrivers/GPEarth.cxx
constants carved in code.
formulae should be explained and documented
https://git.km3net.de/opensource/gseagen/-/blob/master/src/SeaNuDrivers/GSeaCORSIKAFileFlux.cxx
GSeaCORSIKAFileFlux::CRFlux
constants should be better explained.
https://git.km3net.de/opensource/gseagen/-/blob/master/src/PropaMuon/PropaBrem.cxx
double B(double Z) -> why not use switch or table?
https://git.km3net.de/opensource/gseagen/-/blob/master/src/PropaMuon/PropaMuon.cxx
Why do we have a max energy?
if(TrackIn.E>fEneMax){
cout<<"WARNING PropaMuon: Muon energy greater than maximum value, muon not propagated..."<<endl;
return false;
}
https://git.km3net.de/opensource/gseagen/-/blob/master/src/PropaMuon/PropaNucl.cxx
Remove commented lines, e.g. lines 268/269
https://git.km3net.de/opensource/gseagen/-/blob/master/src/SeaEvent/GBinParam.cxx
Isolate string constants depending on GENIE
LoadDefParams: use switch or table instead of if
LoadMediaComp: use switch or table instead of if
https://git.km3net.de/opensource/gseagen/-/blob/master/src/SeaNuCodes/gSeaNuEvGen.cxx
LoadAstroInfo: use switch or tables instead of if
CreaBin -> sounds a bit Italian, I would suggest to rename to CreateBin
DecodeCommandLine -> Maybe could be reshaped with switches or a more flexible logic.