Definition at line 6 of file TMarkov.h.
int TMarkov::computeChain |
( |
int * |
bing | ) |
|
|
private |
Definition at line 42 of file TMarkov.cc.
References binu, create_public_lumi_plots::exp, i, gen::k, fff_deleter::log, m, evf::evtn::offset(), mathSSE::sqrt(), and u.
Referenced by peakFinder().
44 int i;
int k;
int nuprime;
int offset=0;
int m;
int pass;
45 double sumUprime,sumU;
46 double jumpToNext,jumpToPrevious;
47 double chainToNext,chainToPrevious;
48 double aConst[101],uprime[101];
51 for(m=3,i=1,nuprime=1;i<101;i++)
54 for(k=1,jumpToNext=0.,jumpToPrevious=0.;k<=
m;k++)
57 if(bing[i] > 0 || bing[i+k] > 0)
58 jumpToNext +=
exp( (
double)(bing[i+k]-bing[i])
59 /
sqrt((
double)(bing[i+k]+bing[i])));
61 if(bing[i] > 0 || bing[i-k] > 0)
62 jumpToPrevious +=
exp( (
double)(bing[i-k]-bing[i])
63 /
sqrt((
double)(bing[i-k]+bing[i])));
67 if(jumpToNext > 0. && jumpToPrevious > 0.)
69 aConst[
i] = -
log(jumpToNext+jumpToPrevious);
70 chainToNext = aConst[
i]+
log(jumpToNext);
71 chainToPrevious = aConst[
i]+
log(jumpToPrevious);
72 uprime[
i]=chainToNext - chainToPrevious;
73 nuprime++;
u[nuprime] = uprime[
i];
75 { offset=i-1; pass=1;}
82 for(k=3,sumUprime=
u[2],sumU=
u[2];k<nuprime+1;k++)
84 sumU +=
u[
k];
u[
k] = sumU;
85 sumUprime +=
log(1.+
exp(
u[k]-
u[k-1]));
90 for(k=2;k<nuprime+1;k++)
93 for(i=1;i<offset+1;i++)
96 for(i=1;i<nuprime+1;i++)
unsigned int offset(bool)