STAR Computing | |
How to create your own "chain"/"maker" | |
Maintenance Valeri Fine | |
Some terms:
"Maker" stands for the USER DEFINED C++ class derived from the StMaker class. It is not "ROOT macro". That means "Maker" must be compiled with the "native" compiler and packed into "native" share/dynamic library (for each STAR platform) with the "regular" STAR "cons script file". The base class for all STAR "makers" - StMaker class is compiled with the native compiler as well and packed into the "$STAR/lib/StChain.so(.dll)" share/dynamic library together with StChain class (see next point). Maker class is class derived from TDataSet class. It is supposed to
prepare the internal data struicture to accomodate the next event with StChain::Clear method if any
create and own the TDataSet structure within StChain::Make method (event by event);
provide its own data for other makers by adding it in to the chain with StMaker::AddData method;
complete the session with StMaker::Finish() method if any
Usually the only mandatory method the user code would overload is StMaker::Make.
"Chain" stands for the user NOT defined C++ class StChain to control the various "makers" supplied by different "users" to perform some "analysis" in chain. Again "Chain" is NOT ROOT macro. It is C++ class compiled with the native compiler and packed into "$STAR/lib/StChain.so" share library. It is expected at this stage the user doesn't change this class. There is a class derived from StChain. It is StBFChain. Sometimes speaking on "chain" they keep in mind the ROOT macros to launch StBFChain/StChain/StMaker-based production.
"macros" - very likely in this context this stands for the short ROOT macro to
3.1. LOAD all STAR share libraries into the ROOT session
3.2. Create one instance of the "common" object of class StChain
3.3. Define which "maker" will be in use for the current session.
Namely to achieve that one:
3.3.1. Loads share libraries defining the particular chain/makers/pams implemetation
3.3.2. Creates one instance of each Maker one wants to employ for this particular session in the "right" order.
3.4. to create a C++ loop "by event" to reach the goal of this particular ROOT session.
(see: $STAR/StRoot/macros/bfc.C as example)
<should be written>
To develope your own code within STAR/ROOT framework one needs:
$ROOTSYS/.rootrc
Its syntax is described with this ROOT Web pag
Choose (create ) any ("standard" STAR) working directory and check out ROOT subtree in there
cvs co
StRoot/St_TLA_Maker
cvs co StRoot/macros
Edit St_TLA_Maker (replacing TLA with the name of your maker)
Edit macros/bfc.C
6.1. Load the share libraries with gSystem->Load(.. ) statements.
6.2. Watch order. Loading the PAMS's share libraries your maker is going to call must be followed by loading your maker share library in this order (on most UNIX system). Under Windows the loading of the maker DLL will be sufficient.
6.3. Create an instance of your maker,
6.4. Delete all makers you don't want to be called for your job.
Create share library with cons
cons
+St_TLA_Maker
Fix compilation problem. Go to 6.
Start STAR version of "ROOT" launching root4star.
The STAR version of ROOT - 'root4star' is the
"regular" ROOT
compiled with the "debug" mode and linked with
CERNLIB as well. (see: /STAR/comp/root
)
Set the debug ROOT mode
root [1] .TLaunch your ROOT chain
root [2] .x bfc.C
How to make HTML doc.
To get a nice Html automatic docs of
your classes you need comments placed at the three
strategic points in your source code as described at
section "Requirements"
of http://root.cern.ch/root/Documentation.html.
To generate the Html docs of your maker (let's say TLA)
place the two C++ statements
St_TLA_Maker
laser;
laser.MakeDoc();
somewhere in you code to produce the Web page:
Relax.
Send questions to mailto:starsofi_l@bnl.gov or complain via "Problem and Bug Reporting"