double GetPotentialValue(int& ix, int& iy); double GetPotentialHVValue(int& ix, int& iy); double induced (int istrip, double x, double y) { // x and y are the coorlocation of charge (e or hole) // induced chardege on the strip "istrip" situated at the height y = d // the center of the strip (istrip=0) is x = 0. double d=0.0285, strip_width=0.0080, xmax = 0.04, pi = 3.141592 ; double P, xc, dx, deltax = 0.002, deltay = 0.0005, fx, fy; int ix, iy; if ( y < 0. || y > d) return 0; xc = strip_width * istrip; dx = fabs( x-xc ); if ( dx >= xmax ) return 0.; ix = int( dx / deltax ); iy = int( y / deltay ); fx = (dx - ix*deltax) / deltax; fy = (y - iy*deltay) / deltay; P = GetPotentialValue(ix,iy) *(1.-fx)*(1.-fy) + GetPotentialValue(ix+1,iy) *fx*(1.-fy) + GetPotentialValue(ix,iy+1) *(1.-fx)*fy + GetPotentialValue(ix+1,iy+1)*fx*fy ; // cout <<"x,y,iy="< d) return 0; xc = strip_width * istrip; dx = fabs( x-xc ); if ( dx > xmax ) return 0.; ix = int( dx / deltax ); iy = int( y / deltay ); fx = (x - ix*deltax) / deltax; fy = (y - iy*deltay) / deltay; PHV = GetPotentialHVValue(ix,iy) *(1.-fx)*(1.-fy) + GetPotentialHVValue(ix+1,iy) *fx*(1.-fy) + GetPotentialHVValue(ix,iy+1) *(1.-fx)*fy + GetPotentialHVValue(ix+1,iy+1)*fx*fy ; return PHV; }