The primary environment for analysis within the Root for STAR framework is the
Maker. Makers are "links" in the analysis
chain. They must have one or more of the
following parts (implemented as member functions):
- Initialization [Init() member function]:
Any set-up steps, or any before-run-only processing must go here.
- Analysis [Make() member function]:
This member function implements any processing that should be done
on an event-by-event basis.
- Conclusion [Finish() member function]:
Wrap up the analysis and/or do any post-event-loop processing.
Examples of many makers can be found in the directory:
$STAR/StRoot.
HTML documentation should be available at
/STAR/comp/root/html/St_dst_Maker.html
(where you can replace the St_dst_Maker portion with whichever Maker
you want).
If you want to make your own Maker, Akio Ogawa has written a detailed
diary of
his efforts for taking the
St_TLA_Maker
template and creating a new
Maker. I found some new problems of my own when I decided to
follow Akio's path. When making your own Maker, you may wish to
look here for some of the details you might need to know:
- Constructor: St_xxx_Maker() member function
- You should not have to do much alteration of the constructor from the
template. Some default and intialization values can be set here.
- Initialization: Init() member function
- Any parameter tables you wish to use for all events should
be constructed/pointed in Init(). A new table will require
allocation of a St_Table-derived table class (see
Using Tables). You are also
welcome to use your own new classes for data-handling.
- Book any diagnostic histograms you wish to provide here.
- For safety of future compatibility, call the StMaker::Init() member
function if you define your own Init() member function too.
- Analysis: Make() member function
- Event Clear: Clear() member function
- A Maker needs its own Clear() member function if it builds constructs
outside the dataset which need to be destroyed after each event. Anything
in the dataset (tables in particular) should not be deleted.
- Conclusion: Finish() member function
- If you are doing any processing which only occurs after some number of
events n, then you may need to be sure the processing finishes
if the total number of events is not an even multiple of n by
doing some processing here. (e.g. only updating histograms every 100
events)
- For safety of future compatibility, call the StMaker::Finish() member
function if you define your own Finish() member function too.
- Include file: St_xxx_Maker.h file
- Any data members which should not be saved with this Maker and
its dataset must have "//!" on the same line as the declarartion.
This is a particularly valid note for pointers, whose values are
meaningless if read in another session. Examples of this can be
seen in many Maker header files.
- Any classes which are referenced in the header
(e.g. "TH1F *m_histo;" refers to the TH1F class)
must have a class statement before the Maker class statement (in this
case, there must be a statement "class TH1F;"
earlier in the header file which precedes the
"class St_xxx_Maker" statement.
- You can add the comment "// *MENU*" to the end of a line on
which you have a particular member which you woul like
to be available from a browser in Root.
- Miscellaneous:
- Be sure to keep the ClassDef and ClassImp statements in the header
and source code files respectively. These are macros which autmoatically
insert necessary STAR code into the Makers.
- Remember that any tables, histograms, TCanvases, TPads, ... any
classes defined externally to this Maker ... will require include
files to be specified either in the source file or in the header file
if they are going to be used in the Maker class definition.
- Don't be afraid to add new member functions to your maker which make
the implementation better or easier to understand. Remember to put them
in the header file too. It may be best to keep these functions hidden
from public use.