BES III 离线软件系统
BES III Offline Software System (BOSS)
李卫东
2004年11月19日
BES III 离线软件系统
Transient Event Store
Generator
Simulation
Digitization
Gaudi
Event Display
Simulation
Reconstruction
Physics Analysis
Calibration
Cal-MDC
EVERTEX
EMC(B/E)
V0FIND
Exp. data
MC data
Detector-Geo
Cal-Data
Control-Data
DST
Made
Cal-TOF
Fast-track
Event-T0
MUID
TOF(B/E)
MDC-track
REC
Data
DST
Data
Pre-tracking
Post-tracking
Phy-tracking
calibUtil Services
Register, write
Search
Read
Gaudi
Client
Calibrator
Gaudi
services
Metadata (persistent)
MySQL rdbms
FACS
Calibration &
Database
Simulation
Reconstruction
离线软件子系统负责人
Simulation H. M. Liu
Reconstruction Z. P. Mao
Framework and Analysis Core Software (FACS) W. D. Li
Calibration and Database (new) J. F. Qiu
Parameters database design and access
Tools for database storage and retrieval of calibration data
Algorithms for calibration constant measurements
Tools for examination of calibration results
研究团队
副负责人
数据重建
子系统负责人
探测器刻度
子系统负责人
框架和物理分析工具
子系统负责人
MC事例产生和模拟
子系统负责人
离线数据分析系统负责人
北京大学:
一名教授、一名博士生
山东大学:
一名教授、一名讲师、一名博士生
湖南大学: 一名硕士生
浙江大学、四川大学 (正申请加入)
中科院高能物理研究所:
三名研究员、一名副研究员
一名助理研究员、二名实习研究员
二名博士后
六名博士生
中国科技大学: 一名博士生
总共:22 名
研究人员
软件开发环境
Concurrent Versions System (CVS) is used for version management
ViewCVS for browsing files in CVS repository
Configuration Management Tool ( CMT) is used:
to define and maintain a software package
to define and manage dependence on other packages
to generate binaries and executables
to organize releases
Main language C++, Linux RedHat
with gcc
软件系统的配置管理
Internal software
Gaudi
External software
HEP software
Public domain software
Release area
CVS
Work area
sources
Installation area
binaries
package
package
package
package
package
package
generated
cmt
package
package
package
package
package
package
cmt
External
External
External
External
开发过程
建立项目的工作分解结构( WBS )
人员、内容、时间、里程碑
软件模块开发:
分析软件功能、需求
定义和其它模块间的接口
软件设计
软件实现
软件的测试、文档和评审
软件发布
迭代式开发模式
Days
Weeks
1 Month
2 – 3 Months
3 - 4 Months
6 Months
需求分析
软件设计
软件实现
软件测试
软件发布
时间
理想
实践
Software Framework Evolvement
BES Analysis Framework (BESF)
Based on Belle software
Supports two types of data management: Panther and ProxyDict
Added more features . new dynamic library loading and new software components . Service etc
Implemented Event I/O: Raw Data and NDST Data
Build system: Automake and CMT
Currently all reconstruction algorithms being developed in the BESF
BOSS Gaudi framework
A concrete implementation of the underlying architecture: Gaudi
Gaudi Framework
provides standard interfaces for the common components necessary for data processing and analysis
Gaudi users: LHCb, ATLAS, HARP, GLAST, OPERA etc
Concrete
Algorithm
EventDataSvc
IDataProviderSvc
IDataProviderSvc
IHistogramSvc
IMessageSvc
IAlgorithm
IProperty
Obj_B
DetectorDataSvc
HistogramSvc
MessageSvc
ApplicationMgr
ISvcLocator
Obj_A
ParticlePropertySvc
IParticlePropertySvc
Why Gaudi ?
Benefits
In general, gain more in simplicity, modularity, flexibility and extendibility
Clear separation of experiment-dependent and experiment-independent parts. Only need to focus on BES III specific packages.
Save coding time. Many common utilities and services available.
More control available in work flow: sequence, branch and filter
Support of multi-threaded implementation: no extra constraints if online event filter system reuses offline packages.
Cost of migrating to Gaudi
A steep learning curve for core developer although well documented.
Gaudi Architecture Object Diagram
Converter
Algorithm
Event Data
Service
Persistency
Service
Data
Files
Algorithm
Algorithm
Transient Event Store
Detec. Data
Service
Persistency
Service
Data
Files
Transient Detector
Store
Message
Service
JobOptions
Service
Particle Prop.
Service
Other
Services
Histogram
Service
Persistency
Service
Data
Files
Transient
Histogram Store
Application
Manager
Converter
Converter
Data Flow in Gaudi
Algorithm
A
Algorithm
B
Algorithm
C
Transient Event
Data Store
Data T1
Data T2, T3
Data T2
Data T3, T4
Data T4
Data T5
T1
T5
Real data flow
Apparent data flow
Each algorithm only knows what data (type and name) is expecting as input and creating as output
The only coupling is through the data
Scheduling of sub-algorithms is responsibility of the parent algorithm
A
C
B
Parent
T2
T4
T3
Control flow
Reconstruction (1) : Data Access
Algorithm
(1) Retrieve object
Unsuccessful if requested object is not present
(3) Request load
Persistency Service
Converter
Converter
Converter
Converter
(4) Request creation
Conversion
Service
Request dispatcher Objy, ROOT,..
Data Store
Data
Service
(2) Search in Store
(5) Register
Reconstruction (2) : Event I/O
Reconstruction (3) : geometry data
Geometry
Data Objects
DB
Records
DB Access
Layer
Application
Layer
Calibration Infrastructure (1)
calibUtil interface
Data (persistent)
Metadata (persistent)
bad strips
(XML)
CAL calibs
(ROOT)
MySQL rdbms
Write/register
Search
Read
Gaudi Client
Calibrator
Signifies “uses” or “accesses”
Calibration Infrastructure (2)
Simulation (1): BOOST
Geometry
Geant4
Tracking
Detector
Digitization
Response
Hit
objects
Event
GENBES
Generator
HepEvt
format
Raw data
MC truth
Simulation (2)
Hits in MDC
Hits in TOF
p=
|cosθ|<
(no threshold cut)
Simulation (3)
Simulation Application
Event Generator
Simulation
Digitization
Transient Event Store
Generator
Simulation
Digitization
Gaudi
Gaudi Applications
Event Display
Simulation
Reconstruction
Physics Analysis
Simulation
Three major independent components communicate through Gaudi Transient Event Store.
①
④
②
⑤
③
Calibration
Event Display (1)
Event Display (2)
Event Filter (EF): Event Selection
质量控制 (1)
详细的计划
利用 MS Project 制定工作分解结构,共计 250 多项
任务书
开发人员的个人计划
良好的软件设计
利用 UML 描述设计,工具软件 MS Visio 和 IBM Rational Rose
对于引进的软件,实行软件设计逆向工程
设计以 PowerPoint 方式,在软件会上进行汇报。
需要加强技术设计文档的编写
质量控制(2)
规范的编程
利用 CERN 的研究成果,制定约 70 条 C++ 编程规则。
涵盖命名规则、代码组织、控制流、对象生命周期、类接口、错误处理、可读性和可维护性等方面。
分两个级别:推荐、必需执行。
高频率的软件构建
将难得一见的集成工作转化为频繁进行的常规工作
国外许多实验采用日构建 (Nightly Build)
基础:自动构建、统一代码源和“冒烟”测试。
质量控制(3)
Gaudi 核心框架和组件
可以节省大量的代码,代码结构会更加清晰
能够保持整体架构的稳定性和一致性
面向组件:
减轻耦合度太高导致的复杂度
框架管理组件
用户只需要了解接口,而不需要了解实现细节
测试驱动的开发
主要的错误来源
软件复杂程度大
时间的压力
缺乏或没有进行沟通
编程错误
质量控制(4)
采用的测试类型
单元测试 Unit Tests
系统测试 System Tests (包括集成测试、回归测试和可接受测试)
性能测试 Performance Tests
端对端测试 End-to-end Tests ( Data Challenge )
测试工具
CppUnit: provides a support for unit testing of C++ programs.
Valgrind: check for memory leaks and uninitialised data
系统测试人员
质量控制(5)
不同层次的设计评估 (Technical Reviews)
非正式设计回顾 ( Walkthrough )
设计检查 ( Inspection )
项目评审 ( Final Review )
长期的性能优化研究
其它工具 (1): ViewCVS
其它工具 (2): Database Designer
BOSS 使用的外部软件包
Gaudi
AIDA
Anaphe
Boost
CERNLIB
CLHEP
FOX
GENBES
Geant4
LessTif
MYSQL
PGSQL
ROOT
XercesC
Xt
BES III 离线软件系统研发时间线
BOSS Major Milestones
2004-12-30 BOSS alpha release
integration with BOOST simulation
Running the reconstruction chain for MDC, TOF, EMC and MC can be achieved in the BOSS Gaudi framework.
EDM for both Raw Data and reconstructed data deployed. Completion of fully functional Event Data I/O.
2005-10-30 BOSS betta release
Simulation and reconstruction chain functions reasonably well and can successfully process several thousand events.
Common physics analysis tools and utilities available.
Physics study in BOSS can start.
2006-12-30 BOSS production release
谢谢大家!