Reading selected branches from the MuDst


In order to speed up your analysis, you can switch on and off branches of the MuDst. The largest branches in the microDst are those holding the primary and global tracks. For p+p events, the Emc branches are generally the largest chunk.

The most convenient and robust (i.e. backward compatible etc) way to control the branch status is by calling StMuDstMaker::SetStatus(char* branchName, Int_t status). Setting the status to 0 means that it will not be read. For convenience, the branches are grouped into blocks with similar origin, that can be switched ona nd off together:

*
All data
MuEventAll
The general event information from StMuEvent and all the tracks
StrangeAll
The strangeness barnches (V0s, kinks, Xi and corresponding MC info)
EmcAll
The calorimeter branches (Endcap and barrel, towers and SMDs)
PmdAll
The Pmd branches (both planes)
TofAll
TOF branches
EztAll
EZtree branches. These are special branches that are not in the normal MuDst

A more fine-grained control is also possible, by using directly the array names. An exhaustive list can be found in StArrays.cxx (choose the most recent version). The most common ones to switch will probably be 'GlobalTracks' and 'PrimaryTracks'.

Example 1: Read only primary tracks

In order to only read primary tracks in your macro, insert the following code after instantiating then StMuDstMaker (mudst_mk is the pointer to your mudst_mk):

mudst_mk->SetStatus("*",0);
mudst_mk->SetStatus("MuEvent",1);
mudst_mk->SetStatus("PrimaryTracks",1);

Important notes:
  1. You need to have the MuEvent branch switched on for StMuDstMaker to work, because the StChain wants to know the event number.
  2. The other branches will not be read, so if you try to use information from them, you will get zeroes (or even junk, but I think that's unlikely). It is up to you to make sure that you're not missing something.
  3. The primary tracks also hold teh global DCA, so if the DCA of the global track is the only global track information you use, this is the way to go.
A working example of this can be found in $STAR/StRoot/macros/mudst/readPrimaries.C