Package in LhSoft

LhSoft 的功能单元:pacakge

  • package是 LhSoft 的基本单元,具有独立的功能。使使用LhSoft的软件开发者可以从package开始组建自己的分析程序,而不是从C++代码开始。
  • package通常表现为一个名为xxxx的文件夹,具有相对固定的文件夹结构,例如:源文件(.cc)文件夹src,头文件(.h)文件夹xxxx,编译文件夹cmt,宏控制文件夹python,编译产生的目标文件的文件夹等
  • 一个pacakge实现一个具体的功能,按照功能分为三种形式:Algorithm,Service,Tool
  • pacakge由相对固定的developer设计和维护,并提供给整个合作组使用
  • LHAASO软件发布的每一个官方release,由指定版本的pacakge组成。

Package的编写规则

编写规则并非强制,但是将非常有利于大家交流。

1. Package 命名规则

* package名由一个或多个首字母大写的完整单词组成,或者因名字过长,部分或全部单词采用易分辨的缩写代替,例如:DetectorSimulation or DetSim.

* Service package 应当以Svc结尾, such as DetcPosSvc , 应当以Tool结尾, such as DetcPosTool

* package子目录通常包含: cmt, PackageName, src, share, python. python目录内包含 python配置文件*.py,以便被python主程序调用。share目录通常包含python主程序

* package目录中除了子目录外,维护一个ChangeLog文件,对于每次pacakge的每次更新进行介绍,并描述使用方法

2. C++代码规则

* Data members begin with m_: m_energy

* Function members begin with the capital letter: SetEnergy ()

* Functions should correlate with variables: m_energy/SetEenergy()/(Get)Energy()

* Each function are encouraged to be written not more than one screen.

* Try to follow the coding LodeStar used.

3. Comments convention

* Each header file contains information, such as developer, e-mail, changelog

* Each function member and data member should have comments to tell what it is.

-- 祝 成光 - 2020-04-09

Comments


Edit | Attach | Watch | Print version | History: r7 | r5 < r4 < r3 < r2 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r3 - 2020-04-10 - ZhuChengguang
 
  • Edit
  • Attach
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2022 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback