21
The report on the current situation of the BESIII fr amework zhangxiaomei maqiumei 10/3/2004

The report on the current situation of the BESIII framework zhangxiaomei maqiumei 10/3/2004

Embed Size (px)

Citation preview

The report on the current situation of the BESIII framework

zhangxiaomeimaqiumei10/3/2004

The version distribution situation (framework binary codes

area)

The original version completely based on belle(v1) <koala:~codeman/besold/bes>

The version improving with other frameworks like babar, gaudi(v2)

<koala:~codeman/bes/v2>The version with the new building tools—CMT(v3)

<koala:/bes/sw/dist/offline/3.0.0>The future version based on Gaudi

<koala:/bes/sw/dist/boss/1.0.0>

Source Code arrangements in CVS(source code saving area)

The three branches under CVSROOT represents three main versions of BesIII frameworks.

bes offline bossIn offline(besf3.0.0verison) directory

More details please see the website:http://koala.ihep.ac.cn/cgi-bin/viewcvs.cgi/

BesPolicy -- some common CMT definitions    BesRelease – for besf3.0.0 release    Database    DetectorDescription    Event    External -- enviroments for external libs    TestDatabase    framework    reco

Fouse on the version BESF3.0.0

The brief introduction about BESF3.0.0 the differences from other versions the release of BESF3.0.0

How to use BESF3.0.0 a brief introduction on building and configuration tools --CMT the steps of building your own modules

The differences from other versions

The most stable version now (most of reco and simu developers will use it for a long period time)Provide more help and introductions for usersBased on belle, having some advantages from other frameworksUsing CMT to do the configuration and building job

The release of BESF3.0.0

On Koala machine :.exe files located in:

/bes/sw/dist/offline/3.0.0/InstallArea/bin Lib files located in:

/bes/sw/dist/offline/3.0.0/InstallArea/libSource Files located in CVS:

CVSROOT/offline/

A brief introduction on building and configuration tools --CMT

CMT (configuration management tools)The materials for CMT beginners:

Teng-tao’s report on <<the introduction of CMT>> <<CMT user guide>> video << Atlas and CMT>>

CMT environment setup in the koala machine Bash as exmple: 1)setup enviroment for CMT tool (setupCMT.sh) 2)specify your own WorkArea in the requirements(copy from ~maqm/cmthome): macro WorkArea "${HOME}/mytest“ path_prepend CMTPATH "${WorkArea}“ 3) setup enviroment for Besf3.0.0 use the above requirement to generate shell files, then source it.

How to use BESF3.0.0--step1:Create a new package

>cd <WorkArea> >cmt create <packagename> <version> Example:

>cmt create test v1 the following files and directories will be created a

utomatically: src/ directory for source files and private include

files cmt/ directory for CMT requirements

You also can create some directories to meet your needs, such as:<packagename>/ , test/ , doc/ , share/, README/, ChangeLog/

How to use BESF3.0.0--step2:Write requirements file

package BesGeoMdc author "ma_qiumei" version v1 branches cmt src BesGeoMdc run share changelo

g public use FramePolicy v1 BesPolicy use PGSQL v1 External include_dirs "$(BESGEOMDCROOT)" library BesGeoMdc *.cxx ##application BesGeoMdc *.cxx apply_pattern package_linkopts apply_pattern package_stamps apply_pattern ld_library_path

How to use BESF3.0.0--step3: writing your own modules(1)

class ModuleGen : public BesModule

{

public:

ModuleGen(const std::string& ModuleName , BesFramework* frame);

~ModuleGen(){};

void init(int*);

void begin_run(BesEvent*, int*);

void event(BesEvent*, int*);

void term(void){};

void end_run(BesEvent*, int*);

void other(int*, BesEvent*, int*){};

private:

float P_t_cut;

std::string filename;

};

Write your own modules (for example: Write your own modules (for example: ModuleGenModuleGen) which must inherit fr) which must inherit fromom BesModule BesModule class and override member functions . class and override member functions .

How to use BESF3.0.0--step3: writing your own modules(2)

#include "BesKernel/BesFactoryMacro.h"#include "Test/ModuleGen.h“#include “Test/ModuleCC.h”

DECLARE_MODULE_FACTORY( ModuleGen );DECLARE_MODULE_FACTORY( ModuleCC ); DECLARE_FACTORY_ENTRIES( Test ) { DECLARE_MODULE( ModuleGen ); DECLARE_MODULE( ModuleCC ); }LOAD_FACTORY_ENTRIES( Test );

create factories for each modules in create factories for each modules in Test_Factories.cxxTest_Factories.cxx..

more details please see << besf user guide v2.0>>

Huang-xintao << BesIII framework introduction>>

How to use BESF3.0.0--step4: building your codes with CMT

>cmt config>source setup.sh>gmake clean>gmake

How to use BESF3.0.0--step5: checking your binary codes

(1)Run your .exe file

After gmake succesfully,you can run *.exe without the help of besf.

For exmaple: >test.exeRun your module in besf

1) get shell script( Suppose in cmt directory) cp ~maqm/testwork/framework/Test/share/Test_release.sh ../share

2) source Test_release.sh under the directory run, run besf.exe, testing modules using job cards. >cd ../run >source ../share/Test_release.sh >besf.exe < *.txt

How to use BESF3.0.0--step6: writing your job cards(2)

framework loglevel 2framework add_dll Test Histogramframework configureservice register BesRawEventInput BesEventOutput BesPawHistogramSvcservice inputsvc BesRawEventInputservice outputsvc BesEventOutputhistogram my.hbook HBOOKframework initializemodule register BesTestpath add_module main BesTesttable save bestdf_alloutput open mysave.datproc rawdata.raw 0output closeQuit

More details please see << besf user guide v2.0>>

A simple example for job cards:

How to use BESF3.0.0--step7: Import a new package into CVS

First,you should check your CVSROOT >cvs login [email protected] export CVSROOT=“:pserver:[email protected]:/bes/bes”

Second,you should remove all files you don’t want to import,e.g. setup.sh . Then set CVSIGNORE to avoid them.

export CVSIGNORE='setup.* cleanup.* *.make Makefile Linux-* ‘Lastly,import package to cvs

cd <packagename>/<version> cvs import –m “First import” offline/<package_name> Bes <v

ersion>e.g. you want to import package test, you can do: >cd test/v1 >cvs import –m “First import” offline/test Bes v1

How to use BESF3.0.0--step8: Check out a package from CV

S(1)

Go to your working area and do : cmt co -o offline -r <tag> <package> e.g. >cmt co -r v2r1 framework/BesKernel >cmt co framework/BesKernel

How to use BESF3.0.0--step8: Check out packages using containers(2)

Container also a package, who manages other packages, such as BesRelease.

A example, you want to check out all the packages in Besf3.0.0 with BesRelease

Go to your working area and do: >cmt co BesRelease >cmt co –requirements BesRelease/*/cmt/requirements

How to use BESF3.0.0--step9: Commit changes to a package

First, make sure your changes work well before committing. Go to the package's version directory: >cd <package-name>/<version>/ >cvs -n update

Before commiting, Update the ChangeLog file: write a short summary of the changes you made which files you made them too, and why.

To commit your changes, go to the package directory and type

>cvs commit -m 'message'

More details please see Teacher Li-weidong <<the developer’s guide>>

How to use BESF3.0.0--step10: about the version of a package

The format of the version number is <letters><major-id><letters><minor-id><letters><patch-id> e.g. v2r1p2

If you made a simple bug fix which doesn't change any interface (i.e. header file), increase the patch id. Clients of your package should not need to recompile. If you made improvements which are backward compatible, e.g adding new features to the interface but not changing the exisiting interface, increase the minor id. Client will have to recompile but should not need to be changed unless they choose to use the new functionality. If you really change the interface, increase the major-id. Clients will have to be modified before they can be compiled against this new version.

An Example in BESF3.0.0You can learn from it:

how to write a module, build a share library, write a job card, and runing module in Besf3.0.0.

The location framework/Test/

How to use it >cmt co framework/Test >cd framework/Test/v2r1/run >source ../share/Test_links.sh >besf.exe <*.txt

Any questions?