(* ************************************************************ *)
(* 
  RunDec_ex21.m

  This file contains examples illustrating the new features
  of RunDec2.1.
*)
(* ************************************************************ *)

<<RunDec_v2.1.m

(* ************************************************************ *)

(* *** *)
(*--#[ mOS/MS/SI-mPS/1S/RS/PSp relations, top and bottom: *)

Print["------------------------------------------------------------"];

(* relative uncertainty of 4-loop termin MS-OS relation. *)
xerr = 0.002;

(* choose: *)

CASE = "top";
(* CASE = "bottom"; *)

nloopsnum = 4; (* choose: 1,2,3,4 *)

If[CASE == "top",
  (* top: *)
   (
    mtOSnum   = 173.34;
    mtMSnum   = 163.643;
    mtPSnum   = 171.792;
    mt1Snum   = 172.227;
    mtRSnum   = 171.215;
    asMznum   = 0.1185;
    Mznum     = 91.1876;
    as6[mu_] := AlL2AlH[asMznum,Mznum,{{6,mtOSnum,2*mtOSnum}},mu,4];
    as5[mu_] := AlphasExact[asMznum,Mznum, mu, 5, 4];
    mufnum    = 20.;
    nlnum     = 5;
    )
   ];

If[CASE == "bottom",
   (* bottom: (note: use variable names mt..., as5[], as6[]) *)
   (
    mtOSnum   = 4.78;
    mtMSnum   = 4.163;
    mtPSnum   = 4.483;
    mt1Snum   = 4.670;
    mtRSnum   = 4.365;
    asMznum   = 0.1185;
    Mznum     = 91.1876;
    as6[mu_] := AlphasExact[asMznum,Mznum, mu, 5, 4];
    mbMSin = mtMSnum;
    asMzin = asMznum;
    (as5[mu_] := AlphasExact[DecAsDownSI[
	AlphasExact[asMzin,Mznum, 2*mbMSin, 5, 4],
	mbMSin, 2*mbMSin, 4, 4], 2*mbMSin, mu, 4, 4]);
    mufnum    = 2.;
    nlnum     = 4;
    )
   ];

Print["Consider ",CASE," case"];
Print["# loops: ",nloopsnum];

Print["------------------------------------------------------------"];

Print["Option in mass relations: fdelm"];
?fdelm

Print["------------------------------------------------------------"];

Print["{ctr. value, 4-loop coef. + ",100*xerr,"%, 4-loop coef. - ",100*xerr,"%}"];

Print["mOS2mMS: ",{
mOS2mMS[mtOSnum, {}, as6[mtOSnum], mtOSnum, nlnum+1, 4]
, 
mOS2mMS[mtOSnum, {}, as6[mtOSnum], mtOSnum, nlnum+1, 4, 1+xerr] 
,
mOS2mMS[mtOSnum, {}, as6[mtOSnum], mtOSnum, nlnum+1, 4, 1-xerr] 
}]

Print["mOS2mSI: ",{
mOS2mSI[mtOSnum, {}, as6[mtOSnum], nlnum+1, 4]
,
mOS2mSI[mtOSnum, {}, as6[mtOSnum], nlnum+1, 4, 1+xerr]
,
mOS2mSI[mtOSnum, {}, as6[mtOSnum], nlnum+1, 4, 1-xerr]
}]

Print["mMS2mOS: ",{
tmp = mMS2mOS[mtMSnum, {}, XX*as6[mtMSnum], mtMSnum, nlnum+1, 4] // Expand
,
tmp /. XX->1
,
mMS2mOS[mtMSnum, {}, as6[mtMSnum], mtMSnum, nlnum+1, 4, 1+xerr]
,
mMS2mOS[mtMSnum, {}, as6[mtMSnum], mtMSnum, nlnum+1, 4, 1-xerr]
}]

Print["mOS2mPS: ",{
mOS2mPS[mtOSnum, {}, as6[mtOSnum], mtOSnum, mufnum, nlnum, nloopsnum] 
}]

Print["mMS2mPS: ",{
mMS2mPS[mtMSnum, {}, as5[mtMSnum], mtMSnum, mufnum, nlnum, nloopsnum] 
,
mMS2mPS[mtMSnum, {}, as5[mtMSnum], mtMSnum, mufnum, nlnum, nloopsnum, 1+xerr] 
,
mMS2mPS[mtMSnum, {}, as5[mtMSnum], mtMSnum, mufnum, nlnum, nloopsnum, 1-xerr] 
}]

Print["mPS2mMS: ",{
mPS2mMS[mtPSnum, {}, as5[mtMSnum], mtMSnum, mufnum, nlnum, nloopsnum] 
,
mPS2mMS[mtPSnum, {}, as5[mtMSnum], mtMSnum, mufnum, nlnum, nloopsnum, 1+xerr]
,
mPS2mMS[mtPSnum, {}, as5[mtMSnum], mtMSnum, mufnum, nlnum, nloopsnum, 1-xerr]
}]

Print["mPS2mSI: ",{
(* Note: 3rd argument is just the function head *)
mPS2mSI[mtPSnum, {}, as5, mufnum, nlnum, nloopsnum] 
,
mPS2mSI[mtPSnum, {}, as5, mufnum, nlnum, nloopsnum, 1+xerr] 
,
mPS2mSI[mtPSnum, {}, as5, mufnum, nlnum, nloopsnum, 1-xerr] 
}]

Print["mOS2mRS RS: ",{
mOS2mRS[mtOSnum, {}, as6[mtOSnum], mtOSnum, mufnum, nlnum, nloopsnum] 
," RS': ",
mOS2mRSp[mtOSnum, {}, as6[mtOSnum], mtOSnum, mufnum, nlnum, nloopsnum] 
}]

Print["mMS2mRS RS: ",{
mMS2mRS[mtMSnum, {}, as5[mtMSnum], mtMSnum, mufnum, nlnum, nloopsnum] 
,
mMS2mRS[mtMSnum, {}, as5[mtMSnum], mtMSnum, mufnum, nlnum, nloopsnum, 1+xerr] 
,
mMS2mRS[mtMSnum, {}, as5[mtMSnum], mtMSnum, mufnum, nlnum, nloopsnum, 1-xerr] 
," RS': ",
mMS2mRSp[mtMSnum, {}, as5[mtMSnum], mtMSnum, mufnum, nlnum, nloopsnum] 
,
mMS2mRSp[mtMSnum, {}, as5[mtMSnum], mtMSnum, mufnum, nlnum, nloopsnum, 1+xerr] 
,
mMS2mRSp[mtMSnum, {}, as5[mtMSnum], mtMSnum, mufnum, nlnum, nloopsnum, 1-xerr] 
}];

Print["mRS2mMS RS: ",{
mRS2mMS[mtRSnum, {}, as5[mtMSnum], mtMSnum, mufnum, nlnum, nloopsnum]
,
mRS2mMS[mtRSnum, {}, as5[mtMSnum], mtMSnum, mufnum, nlnum, nloopsnum, 1+xerr]
,
mRS2mMS[mtRSnum, {}, as5[mtMSnum], mtMSnum, mufnum, nlnum, nloopsnum, 1-xerr]
," RS': ",
mRSp2mMS[mtRSnum, {}, as5[mtMSnum], mtMSnum, mufnum, nlnum, nloopsnum]
,
mRSp2mMS[mtRSnum, {}, as5[mtMSnum], mtMSnum, mufnum, nlnum, nloopsnum,1+xerr]
,
mRSp2mMS[mtRSnum, {}, as5[mtMSnum], mtMSnum, mufnum, nlnum, nloopsnum,1-xerr]
}]

Print["mRS2mSI RS: ",{
mRS2mSI[mtRSnum, {}, as5, mufnum, nlnum, nloopsnum]
,
mRS2mSI[mtRSnum, {}, as5, mufnum, nlnum, nloopsnum, 1+xerr]
,
mRS2mSI[mtRSnum, {}, as5, mufnum, nlnum, nloopsnum, 1-xerr]
," RS': ",
mRSp2mSI[mtRSnum, {}, as5, mufnum, nlnum, nloopsnum]
,
mRSp2mSI[mtRSnum, {}, as5, mufnum, nlnum, nloopsnum, 1+xerr]
,
mRSp2mSI[mtRSnum, {}, as5, mufnum, nlnum, nloopsnum, 1-xerr]
}];

Print["mOS2m1S: ",{
mOS2m1S[mtOSnum, {}, as6[mtOSnum], mtOSnum, nlnum, nloopsnum] 
}];

Print["mMS2m1S: ",{
mMS2m1S[mtMSnum, {}, as5[mtMSnum], mtMSnum, nlnum, nloopsnum]
,
mMS2m1S[mtMSnum, {}, as5[mtMSnum], mtMSnum, nlnum, nloopsnum, 1+xerr]
,
mMS2m1S[mtMSnum, {}, as5[mtMSnum], mtMSnum, nlnum, nloopsnum, 1-xerr]
}];

Print["m1S2mMS: ",{
m1S2mMS[mt1Snum, {}, as5[mtMSnum], mtMSnum, nlnum, nloopsnum]
,
m1S2mMS[mt1Snum, {}, as5[mtMSnum], mtMSnum, nlnum, nloopsnum, 1+xerr]
,
m1S2mMS[mt1Snum, {}, as5[mtMSnum], mtMSnum, nlnum, nloopsnum, 1-xerr]
}];

Print["m1S2mSI: ",{
m1S2mSI[mt1Snum, {}, as5, nlnum, nloopsnum]
,
m1S2mSI[mt1Snum, {}, as5, nlnum, nloopsnum, 1+xerr]
,
m1S2mSI[mt1Snum, {}, as5, nlnum, nloopsnum, 1-xerr]
}];

(*--#] *)
(* *** *)

(* *** *)
(*--#[ as(mu), mq(mu) to 5-loop running and 4-loop decoupling: *)

Print["... running:"];

asMznum   = 0.1185;
Mznum     = 91.1876;

(b4num = b4num = 100*RunDec`Modules`b0 /. setbeta;
muend = 2500.;
mqmu0 = 2.5;
nf = 5;
For[iloops = 1, iloops<=5, iloops++,
  Print["iloops = ",iloops,", as[",muend,"] = ",  asmu = AlphasExact[asMznum, Mznum, muend, nf, iloops] ]
  Print["iloops = ",iloops,", mq[",muend,"] = ",  mMS2mMS[mqmu0, asMznum, asmu, nf, iloops]  ]
])

Print["... decoupling:"];

(muth   = 2500.;
massth = 150.;
alphas = 0.101;
massq  = 2.5;
nl = 5;
For[iloops = 1, iloops<=5, iloops++,
  Print["iloops = ",iloops,", DecAsUpOS   = ",  DecAsUpOS[alphas ,massth ,muth ,nl ,iloops ] ];
  Print["iloops = ",iloops,", DecAsDownOS = ",  DecAsDownOS[alphas ,massth ,muth ,nl ,iloops ] ];
  Print["iloops = ",iloops,", DecMqUpOS   = ",  DecMqUpOS[massq,alphas ,massth ,muth ,nl ,iloops ] ];
  Print["iloops = ",iloops,", DecMqDownOS = ",  DecMqDownOS[massq,alphas ,massth ,muth ,nl ,iloops ] ];
])

(*--#] *)
(* *** *)

