StFgtDbMaker/StFgtGeom Review
Summary of Reviewer's Comments
RESPONSE TO EVALUATION by Justin Stevens
StFgtDbMaker
- StFgtDbIdealImp removed and StFgtDbImpl collapsed into StFgtDb
- asserts removed
- constants removed
- beginTime statements included in StFgtDbMaker when tables are loaded
StFgtGeom
- See comment to Burton below - we are under impression that all static numbers (widths of strips, location within disc etc) should be hardcoded and not put into database.
RESPONSE TO EVALUATION of StFgtGeom by Tom Burton
NOTES & SUGGESTIONS:
- During DB discussions with S&C we were instructed to have all non-dynamic geometries hard-coded. Only parameters that change with time should be in the database. We would consider changing this if requested/approved by Jerome+Dmitry.
- Agree - made StFgtGeomData a nested class of StFgtGeom::Data
- The StFgtDbFileMaker is an expert-only code that lives in StFgtPool and is used by experts to make database mapping files. It needs to access private members in StFgtGeom and this is why it is a friend. It will not be reviewed.
- ROOT::TMath used for all pi variables.
- Boundry checks are implemented
- see above
- All asserts removed.
- see boundry checking issue above
- removed from header and .cxx
WARNINGS: ( cons EXTRA_CXXFLAGS="-Wextra -pedantic -ansi -Winit-self -Wold-style-cast -Woverloaded-virtual -Wuninitialized -Wmissing-declarations -Winit-self")
1) FIXED - ./StRoot/StFgtUtil/StFgtConsts.h:39: error: comma at end of enumerator list
In file included from .sl53_gcc432/obj/StRoot/StFgtUtil/geometry/
StFgtGeom.cxx:9:
2) RDO+ARM are passed to getNaiveMapping to have a consistant interface across classes. The StFgtDb class contains a getMapping which does use RDO and ARM and therefore we would prefer to pass it as well to the getNaiveMapping in StFgtGeom.h This also allows RDO+ARM to be used in the future NaiveMappings.
.sl53_gcc432/obj/StRoot/StFgtUtil/geometry/StFgtGeom.h:327: warning: unused
parameter 'rdo'
.sl53_gcc432/obj/StRoot/StFgtUtil/geometry/StFgtGeom.h:327: warning: unused
parameter 'arm'
3) Same explanation for isNaiveR as for getNaiveMapping in 2)
.sl53_gcc432/obj/StRoot/StFgtUtil/geometry/StFgtGeom.h:339: warning: unused
parameter 'rdo'
.sl53_gcc432/obj/StRoot/StFgtUtil/geometry/StFgtGeom.h:339: warning: unused
parameter 'arm'
4) FIXED - .sl53_gcc432/obj/StRoot/StFgtUtil/geometry/StFgtGeom.cxx:67: error: extra ';'
5) pbins was changed to const but still problem - not at all clear why.
.sl53_gcc432/obj/StRoot/StFgtUtil/geometry/StFgtGeom.cxx: In static member
function 'static int StFgtGeom::phi2LocalStripId(double, double, double*)':
.sl53_gcc432/obj/StRoot/StFgtUtil/geometry/StFgtGeom.cxx:129: error: ISO C++
forbids variable length array 'pstrip'
6) binFrac may be used in future - would prefer to leave for now.
.sl53_gcc432/obj/StRoot/StFgtUtil/geometry/StFgtGeom.cxx: At global scope:
.sl53_gcc432/obj/StRoot/StFgtUtil/geometry/StFgtGeom.cxx:124: warning: unused
parameter 'binFrac'
7) rstrip was changed to const but still problem - not clear why
.sl53_gcc432/obj/StRoot/StFgtUtil/geometry/StFgtGeom.cxx: In static member
function 'static int StFgtGeom::rad2LocalStripId(double, double, double*)':
.sl53_gcc432/obj/StRoot/StFgtUtil/geometry/StFgtGeom.cxx:630: error: ISO C++
forbids variable length array 'rstrip'
8) see comment 6) .sl53_gcc432/obj/StRoot/StFgtUtil/geometry/StFgtGeom.cxx: At global scope:
.sl53_gcc432/obj/StRoot/StFgtUtil/geometry/StFgtGeom.cxx:625: warning: unused
parameter 'binFrac'
RESPONSE TO EVALUATION of StFgtDbMaker by Tom Burton
- removed
- private moved
- removed gStFgtDbMaker
- indentation fixed
- Yes - it is needed for user work flow purposes
- moved
- removed asserts
RESPONSE TO EVALUATION of StFgtDbImpl by Tom Burton
- We can't currently restrict access because we may have more than one factory class. We could use friend functions for every factory class, but we're also supposed to avoid the use of friend classes, as per the coding standard.
- all pointer fields have been initialized to NULL
- Will include checks for NULL pointers in boundry checks implemented (see StFgtGeom)
- Will use returns for error return
- asserts removed
- remains the same
RESPONSE TO EVALUATION of StFgtDb by Tom Burton
- we prefer getXXXfromYYY naming convention so that function is explicit in name
- we think this comes down to preference and chose to leave function as written
- gridAttenuation removed
- printFgtDumpCVS1 - assert removed, fstream used, *this is only thing that works (StFgtDb::function doesn't), remains virtual to avoid runtime error
- extraneous includes in header removed
- rfatemi's blog
- Login or register to post comments