Skip to content

Rules and Conventions

Jung Woo edited this page Jun 29, 2023 · 4 revisions

Rules (must be followed)

File

  • Class file must be named after name of the class : [class_name].cpp [class_name].h.
  • Source file extension must be .cpp.
  • Header file extension must be .h.
  • Root macros must have extension .C.
  • Macros for creating executable file must have extension .cc.
  • Text file for the use of parameter container must have one of following extensions : .mac, .conf, .par, .json.

Project directory structure

  • Project must contain one of the following directories to be recognized as lilak-project from running configure.sh : task, detector, container, tool. Directories geant4, get, fftw, source may be added to cmake configuration depending on the cmake options. The other directory name may be used for the general macros such as macros and test.
  • Source and header files of same class must be placed in the same directory.
  • One must not create LinkDef.h. All classes from task, detector, container, tool directories are added to auto created LinkDef.h file which is need for creating lilak library. If one do not wants to add classes to the library (which may be just for the use of executable), the source file must be place in the source directory.
  • Task class must inherit LKTask or class that inherit LKTask.
  • Container class must inherit LKContainer or class that inherit LKContainer.

Conventions (flexible)

Naming

  • Class name should have naming of [project-initial]+[job-name]: ex) LKRun
  • Task class name should end with Task. ex) LKCalibrationTask
  • Class memeber parameter should start with f (field) and second letter is recommanded to be capital. ex) fDataValue
  • Class member method name should start with upper case: ex) GetDataValue()
  • Local parameter name should start with lower case: ex) dataValue
  • Defining parameter for iteration-index should have naming of i+[iterating object]: ex) iDataValue
  • Defining parameter for number-of-objects should have naming of num+[iterating object]s : numDataValues