next up previous
Next: Running slim2 Up: slim2 program Previous: slim2 program

Developing your own version of slim2

To develop your own slim program, that performs event preselecting, prepare working environment first. In the following we will consider example of doing a two electron events analyses. To start, create analysis directory, say ana2sc:
mkdir ana2sc
cd ana2sc
mkdir slim
cd slim
cp $R10SYS/utils/slim2/makefile.user ./makefile
cp $R10SYS/utils/slim2/cut_dummy.cpp .

Next, prepare selection routine. There is a skeleton cut_dummy.cpp provided, just add your stuff inside cut function. Remember, event is rejected if cut returns 0, and accepted if cut returns 1. For our case we want to select events with 2 scintillator hits only, and it will look like this:

Int_t h10::Cut(Int_t * results){
  //User supplied function for slim2 program
  //Called from h10::Loop for each event
  //returns 1 if event selected, 0 otherwise
  //For the cuts passed by this events, increment results[20] array (if interested)


  //Cut values for event preselection;
  Int_t number_of_scintillators=2;

  //Selection code
  if(Nsc != number_of_scintillators) return 0;
  results[1]++;
 
  return 1;
}

results array is useful to monitor how your cuts reduce the data. It has dimensions from 1 to 10 and is printed out at the end of program. When selection function ready, move modified file to cut_2sc.C.

Before compiling the program, one need to update the makefile. Set UTILS variable to point to your rootana/utils directory, and CUT to your preselecting function.

# Your cut.C with cut() selection function for slim2
CUT          = cut_2sc.C

Type gmake to compile slim program. Check that you have slim2 executable in the directory.


next up previous
Next: Running slim2 Up: slim2 program Previous: slim2 program
Vladimir Vasiliev 2008-12-02