next up previous
Next: Spring Up: Instruction Previous: What to edit ?

Set parameters ; Constructor and Userin

When JSFBases is used, parameters can be set at three places; (1) At the constructor of XXBases, (2) In a ROOT macro, after bases object is created, and (3) In the Userin member function of XXBases class.

The constructor of the XXBases is a place to set the default parameters. With a help of the Environment class of ROOT, user can write the program so that it can obtain parameters from a file. The default parameter file name is jsf.root[#!help!#]. For an example, by a statement

  sscanf(gJSF->Env()->GetValue("XXBases.Ecm","300.0"),"%g",&fEcm);

the default value for the variable fEcm is 300.0 and its value can be changed by a line

XXBases.Ecm:             300.0
in the parameter file, jsf.conf.

After a base object is created, parameter values set to the bases class data member can be changed in a macro. This improves the flexibility of application and very nice feature of ROOT system.

The actual bases calculation is performed in DoBases() member function of the bases object. In DoBases(), XXBases::Userin() is called after Bases initialization, then the routine for Bases integration, and XXBases::Usrout at the end. The task of XXBases::Userin() is to calculate parameters derived from user input and to define histograms. The parameters defined in the XXBases constractor and others defined by the macro are saved as the data member of the XXBases class. In XXBases::Userin(), values in the class data member must be copied to the Bases Fortran common. The standard parameters such as NDIM, XL, XU, etc are defined in the JSFBases class and they are loaded into Fortran common block when JSFBases::Userin() is called in XXBases::Userin().

To use Bases from a fortran program, user needs to set parameters in commons BPARM1 and BPARM2 in the subroutine USERIN. In the JSF, clone of variables in these commons are prepared as the data member of the class JSFBases. They can be set in the constructor of XXBases class, and they are copied to BPARM1 and BPARM2 in JSFBases::Userin().


next up previous
Next: Spring Up: Instruction Previous: What to edit ?
Miyamoto AKiya
1998-12-13