Sorry, I cannot write full functional example. but I hope this will help
// TT : the mesh
// Rrad : ring radii [Rout,Rin]
// Aangle : angular sector (in units of pi)
// npts : the nb of points on the perimeter
// labs : array of labels of segments of the boundary
// labs[0] : outter disk border
// labs[1] : inner disk border
// labs[2] : axis 1
// labs[3] : axis 2
real LCout=Aangle*pi*Rrad[0], LCin=Aangle*pi*Rrad[1], LZ=Rrad[0]-Rrad[1];
int CptsIn= int(npts*LCin/(LCin+LCout+2*LZ)); // pts on the circle-axis sides
int CptsOut= int(npts*LCout/(LCin+LCout+2*LZ)); // pts on the circle-axis sides
int Zpts= int(npts*LZ/(LCin+LCout+2*LZ)); // pts on the z-axis sides
border circleOut (t=0.0,Aangle*pi){
x=Rrad[0]*cos(t);
y=Rrad[0]*sin(t);
label = labs[0];}
border circleIn (t=Aangle*pi,0){
x=Rrad[1]*cos(t);
y=Rrad[1]*sin(t);
label = labs[1];}
border axis1 (t=Rrad[0],Rrad[1]){
x=t*cos(Aangle*pi);
y=t*sin(Aangle*pi);label = labs[2];}
border axis2 (t=Rrad[1],Rrad[0]){x=t;y=0;label = labs[3];}
TT=buildmesh(circleOut(CptsOut)+axis1(Zpts)+circleIn(CptsIn)+axis2(Zpts));