Installation of a new model.

The model of particle interaction has to be defined in the    
CalcHEP format,    hep-ph-/0412191

1. Define the model  by writing the *1.mdl model files and put
these files in the  directory work/models. 
There are some technical comments about model
    a)  ODD particles should have a name starting with "~". 
Otherwise you have to create by hand the list of ODD 
particles, see below.
    b)If the masses of ODD particles are not independent parameters but are
defined  by some constraint, put a '*' before the name of the parameter in 
the func1.mdl file. This constraint will then be attached to any numerical code 
generated by CalcHEP.  See, for example,
        NMSSM/work/models/func1.mdl  
   c) Widths of ODD particles must be independent parameters defined in the 
vars1.mdl file. The initial  numerical values for them does not matter, since
they will be calculated by micrOMEGAs. Even the  lightest ODD particle must have
a finite width. 

   d) For automatic calculation of widths of s-channel resonances 
the corresponding width parameter should be removed from 
vars1.mdl file since it is not an independent parameter. It should be introduced
in the prtcls1.mdl file in the column 'width' with  a  '!' mark before it. 
See as example MSSM/work/models/prtcls1.mdl.
This mark is not needed if you have your own function for width calculation
defined in func1.mdl file. 

   e). A comment about running couplings. The variable named "Q"  is used 
to define automatically the scale used in running couplings. In micromegas 
the numerical value assigned to this variable is twice the mass of the lightest 
ODD particle. See as example the  definition of the strong coupling 'SC', and 
of  b and t quarks effective masses n terms of Q in the MSSM/NMSSM models. 
The QCD functions  used in MSSM/NMSSM models 
      initQCD(alfSMZ,McMc,MbMb,Mtp)
      alphaQCD(Q) 
      MbEff(Q)
      MtEff(Q)
are available in any model. The description of these functions can be found in  
hep-ph//0405253

    f). To check your model go to work/  and launch calchep. 
Use "Edit Model"  to simulate changes and try to save the model. 
CalcHEP wil inform you of any  model inconsistencies. 
  
2. External constraints. 
If your model has external functions  they have to be realized in 
the shared library lib/mLib.so (or  lib/mLib.dll for Cygwin. The S0 
variable returns the needed suffix.).
It is assumed that this library is compiled by  gmake launched from
'lib'. gmake  in the main directory  launches gmake -C lib automatically. 
The  lib/Makefile has to be written by the user.
To generated shared library use the $(SHARED) flag. For OSF1 operation 
system one need additional option $(SONAME). See as example MSSM/lib/Makefile
and NMSSM/lib/Makefile. 

If for some reason one constraint can not be calculated one has to set 
non zero value to the FError variable. This FError has to be defined as 
extern int FError. Some operating systems (Cygwin, Darwin)  do not 
allow to construct shared library if not all references are resolved. 
If this case you have to pass to linker  the CalcHEP/sqme_aux.$(SO) file 
which contains FError. 

For QCD functions described above attach to mLib codes of sources/alpha_s.c.
Follow the examples in  MSSM/lib/Makefile and NMSSM/lib/Makefile. 
  
When the library is compiled you can launch ./calchep again 
and check compilation of the numerical code. It should work if mLib was 
generated in appropriate manner. 
 
3. Your lib/Makefile also can compile static library lib/aLib.a 
for auxiliary service functions.  Both aLib and mLib are optional.
 
4. When you will try to compile executable  'gmake' will check 
the existence of work/odd_particles.c which 
must contain the list of ODD particles. If this file is absent 
'gmake' generates it assuming that ODD particles are the particles 
of your model whose names  started with '~'. Thus the simplest way 
to generate this file is to use '~' into names of corresponding particles.
Otherwise you have to write this file before compiling the executable. 
See file format of odd_particles.c  file  in MSSM and NMSSM directories. 
All needed information about particle properties stored in this file 
can be found in prtcls1.mdl file.

5. We provide the  user with  two examples of main programs: 
omg.c, omg.F     - calculation of relic density.
cs_br.c, cs_br.F - calculation of auxiliary  cross sections.

Compilation of executable is launched by 

    gmake  main=<name of your main file>

if gmake is absent, use make. We assume that in such case make works like 
gmake.
