8#include <ecl/digitization/algorithms.h>
13double Belle2::ECL::Sv123(
double t,
double t01,
double tb1,
double t02,
double tb2,
double td1,
double ts1)
17 double dks0, dks1, dksm,
18 dw0, dw1, dwp, dwm, das1, dac1, das0, dac0, dzna, dksm2, ds, dd,
19 dcs0, dsn0, dzn0, td, ts, dr,
20 dcs0s, dsn0s, dcs0d, dsn0d, dcs1s, dsn1s, dcs1d, dsn1d;
23 if (t < 0.)
return 0.;
25 dr = (ts1 - td1) / td1;
26 if (abs(dr) >= 0.0000001) {
38 dr = ((t01 - t02) * (t01 - t02) + (tb1 - tb2) * (tb1 - tb2)) / ((t01) * (t01) + (tb1) * (tb1));
42 if (dr < 0.0000000001) {
45 dks0 = dks1 * 1.00001;
47 dks0 = dks1 * 0.99999;
66 dzna = (dksm2 + dwm * dwm) * (dksm2 + dwp * dwp);
69 das0 = dw1 * (dksm2 + dwp * dwm);
70 dac0 = -2 * dksm * dw0 * dw1;
71 das1 = dw0 * (dksm2 - dwp * dwm);
80 dzn0 = dcs0 * dcs0 + dsn0 * dsn0;
82 dsn0s = (dsn0 * das0 - dcs0 * dac0) / dzn0;
83 dcs0s = (dcs0 * das0 + dsn0 * dac0) / dzn0;
87 dzn0 = dcs0 * dcs0 + dsn0 * dsn0;
89 dsn1s = (dsn0 * das1 - dcs0 * dac1) / dzn0;
90 dcs1s = (dcs0 * das1 + dsn0 * dac1) / dzn0;
95 dzn0 = dcs0 * dcs0 + dsn0 * dsn0;
97 dsn0d = (dsn0 * das0 - dcs0 * dac0) / dzn0;
98 dcs0d = (dcs0 * das0 + dsn0 * dac0) / dzn0;
102 dzn0 = dcs0 * dcs0 + dsn0 * dsn0;
104 dsn1d = (dsn0 * das1 - dcs0 * dac1) / dzn0;
105 dcs1d = (dcs0 * das1 + dsn0 * dac1) / dzn0;
112 sv123 = ((((dsn0s - dsn0d) * sin(dw0 * t)
113 + (dcs0s - dcs0d) * cos(dw0 * t)) * exp(-t * dks0)
114 - (dcs0s + dcs1s) * exp(-t * ds) + (dcs0d + dcs1d) * exp(-t * dd)
115 + ((dsn1s - dsn1d) * sin(dw1 * t)
116 + (dcs1s - dcs1d) * cos(dw1 * t)) * exp(-t * dks1)) / dzna / (ts - td));