STAR   Computing Tutorials main page
How to create a new or edit existing package
Offline computing tutorial Maintained by Wenaus, Turner

New - 8/24/99: Procedure for proposing/creating new packages

There are a few approaches to writing your package:
  1. Adapt a pre-existing package. If an existing package provides similar or related functionality, eg. if you're implementing the detector B analogue of an existing detector A package, you can use the existing package as a starting point. Consult the owner as to whether it is a good, up to date starting point.
  2. Extend an existing package. In some cases it may be better to incorporate the functionality you need in an existing package. Review what's already there.
  3. Create an entirely new package. If you propose to create a new package, the procedure is documented here.
For all of these options, the first step is to check out the package you're using as a starting point. If you're starting from scratch, use StRoot/St_TLA_Maker as a starting point (do not use the non-standard name of this package as a model; it's name is historical baggage and if we were to name it today it would be StTemplateMaker). eg. cvs co StRoot/St_TLA_Maker.

Set up directories needed

Most packages are structured as Makers, modular components that can be included in a processing chain within the framework. The template package St_TLA_Maker documents the interface that the Maker scheme provides you with. You fill in methods such as Init(), Make() (the 'event loop' step), InitRun(), etc.

Be sure to include and maintain a descriptive README file and documentation in your package. See the documentation tutorial.

To run your package

Assuming your package is a Maker, you must set up a macro that incorporates your package into a chain running within the framework in order to run it. In the macro you must load your shared library (and any others needed), create an instance of your Maker, add it to a chain, and run the chain. A standard example to follow is StRoot/macros/analysis/doEvents.C.

You should create this macro and work at the top level of your working directory, not down in your package directory.

Committing your package to CVS

To have your package added to the CVS repository once it is approved, consult the STAR software librarian, Lidia Didenko,