ModifyNOT UPDATED to bookCRY IntroductionIt's suggested that you run check for a basic cross-check each time that you add n-tuple variables or constants in the fortran code.
It is extremely welcome that you mail to the mantainer of Book95 the patches that you have done ( please use Usage of constants from init filesDeclare that you want a constant from the ini file(s) by adding an entry in f_lbook_user, like
If you have to do calculations on constants, or create new constants, that DO NOT depend on the event values, put them into the f_calc_const subroutine, that is executed only at the beginning of the readout of each .dml file. This will save (a bit) of time in running book95. Since no way is given to detect whether the call to f_calc_const is the first or not, it is wiser not to modify values that are read out of the ini file, but create new constants instead. Ok, it's finally time for the interesting stuff, to be written in f_calib; something like
This example also uses a variable from the non-calculated xdc() array, and a variable from the calculated xcal() array. If you tought it was enough, i'm sorry you still have to work. First, in book95.inc, add your variable, or array, and any other variable you created in /f_cal_const/, in the /f_cal_const/ common, and declare it real right below it. Second, run the check script. It will (hopefully) tell if you missed any of the steps, or did any other common mistake. Third, write in your ini file the constant(s) that you wanted ! Finally, remake book95 and test it ! Adding calculations/variables in the nutpleDeclare that you want a variable in the ntuple by adding an entry in f_lbook_user using
Ok, it's finally time for the interesting stuff, to be written in f_calib using xcal(idx); something like
If you tought it was enough, i'm sorry you still have to work. First, in book95.inc, add your index variable in the /f_cal/ common, and declare it integer right below it. Second, run the check script. It will (hopefully) tell if you missed any of the steps, or did any other common mistake. Third, check in your ini file that you didn't by chance exclude from storage in the N-tuple just the variable you created - it can happen when using wildcards. Finally, re-make book95 and test it ! As a general rule, do not add too many variables, because this leads to excessive file sizes on disk and increased analysis times in PAW. Defining cutssince you can add calculations and retrieve constants from a setup file, you can use these to setup whatever kind of cut you might imagine. Just write your if statement in f_sel_uncal, if rejection of the event can be decided before any calibration is appiled (in this way avoiding lots of calculations, for that event), or in f_sel_cal, if you need calibrated data. A value of f_sel_cal or f_sel_uncal equal to .false. rejects the event (it will not be written in the N-tuple) Remember that all of the raw and of the calculated variables are always there in memory, no matter what the user chooses about the storage of variables in the ntuple; so all of them can always be accessed. |