STAR   Computing   Documentation  
StStrangeMuDstMaker: the Cuts
Offline Software using ROOT in STAR Maintained by G. Van Buren
Last modified Tue Apr 11 15:30:19 2000
StStrangeMuDstMaker


The Cuts

What are the cuts?
How are the cuts filled?


What are the cuts

The cuts are instances of the TCut class. This class has a name, and a title, and can be used in selections for TTree::Draw() or TTree::Scan(). These cuts are kept in two locations. On file, they are stored in a branch of the micro-DST tree called StrangeCuts. However, when running the maker, they are also stored in a TOrdCollection class in memory. You may find that in old micro-DST files, it was a TOrdCollection named StrangeCuts which was stored on file along with the micro-DST; in more recent files this is no longer true. One can easily view the cuts by running the listStrangeCuts.C macro on a micro-DST file like this:
  root4star -b -q 'listStrangeCuts.C("myMuDst.root")'
For an older file with the TOrdCollection in the file, one could do the following in Root to see the cuts:
  TFile file1("evMuDst.root");
  cuts = (TOrdCollection*) file1.Get("StrangeCuts");
  cuts->Print();

It is important to note that the cuts stored in the branch on file are currently only there at the beginning of a file, and at any subsequent point in the file at which it was determined that the cuts had changed. For example, when filtering many micro-DSTs into one, the cuts from the first micro-DST file read will go into the first event in the new micro-DST. Each of the subsequent micro-DSTs' cuts are examined to see if they are any different from current set of cuts, and if so, are again written at the appropriate event into the new micro-DST. For events imbetween, no cuts are written to the file. It is not meant for the user to access the cuts directly from the file for each event. Instead, please use either the listStrangeCuts.C macro described above, or the StStrangeCuts class via the maker described below.

When using the StStrangeMuDstMaker, the cuts are managed via a class called StStrangeCuts. Access to this class is obtained from the maker with a call to the member function Cuts():

  StStrangeCuts& cuts = dstMaker->Cuts();
This class inherits from TOrdCollection and keeps in memory what the current set of cuts associated with the data being read/written are. Thus, for all subsequent events in a micro-DST with cuts the same as the first (in which case the cuts are stored on file only with the first event), one can access the cuts during any event via this class. The following functionality is provided by the StStrangeCuts class in addition to what is provided by the TOrdCollection class from which it inherits:
List()
Lists the cuts (simply a call to the TOrdCollection::Print() function).
TCut* GetCut(char* name)
Get a pointer to the individual cut with the name specified.
const char* GetValue(char* name)
Get the value string of the individual cut with the name specified.
Add(char* name, char* value) and Add(TCut& cut)
Add a new cut with the name and value specified.


How are the cuts filled?

There are two methods for filling the cuts:
From run control parameters
When a micro-DST is created from a STAR DST, the run control parameters used in finding vertices during DST production are automatically read and cuts are created for each parameter. If multiple copies of each parameter exist (multiple rows in the parameter tables), an colon and index number are appended to the cut name (e.g. "dcaV0:2" for the third dcaV0 parameter).
By adding individual cuts
Use of the function call dstMaker->Cuts().Add("cut name","cut value") allows the user to append any additional cuts made after the run control parameter cuts are filled. This is particularly applicable when creating a sub-micro-DST where additional cuts are made to filter the micro-DST to a smaller subset. In this case, the addition should be made to the cuts associated with the maker controlling the new micro-DST, not the old one. The Add() function may be called at any point after instantiation of the new maker, but the new cuts will always be appended to the end of the list of existing cuts.