Applying the Rice formula (see [1]}),
\(E:=& \mathbb {E} \left(\textnormal {card}\left\lbrace  t\in \overset{\circ }{B}: \; X(.)\textnormal { \;has\; a\; local\; maxima\; at}\; t, \; X(t)>u,\; t\in \underset{i=1}{\overset{m}{\cap }} S_i^{+\overline{r}} \right\rbrace \right)\\=& \int _u^{+\infty }dx\int _{\overset{\circ }{B}}\mathbb {E} \left(|\det (X^{\prime \prime }(t))|\mathbb {I}_{\lbrace X^{\prime \prime }(t)\preceq 0\rbrace }\mathbb {I}_{\lbrace t\in \underset{i=1}{\overset{m}{\cap }} S_i^{+\overline{r}}\rbrace }\mid X(t)=x,\; X^{\prime }(t)=0\right)p_{X(t),X^{\prime }(t)}(x,0)\sigma _n(dt)\\=& \frac{1}{(2\pi )^{n/2}} \int _u^{+\infty }\sigma _n(\underset{i=1}{\overset{m}{\cap }} S_i^{+\overline{r}^*}) \mathbb {E} \left(|\det (X^{\prime \prime }(0))|\mathbb {I}_{\lbrace X^{\prime \prime }(0)\preceq 0\rbrace }\mid X(0)=x,X^{\prime }(0)=0\right)\varphi (x)\, dx,\) 
