  In this paper we investigate the vacuum densities for a massive scalar field
with general curvature coupling in background of a (2+1)-dimensional spacetime
corresponding to a cylindrical tube with a hemispherical cap. A complete set of
mode functions is constructed and the positive-frequency Wightman function is
evaluated for both the cylindrical and hemispherical subspaces. On the base of
this, the vacuum expectation values of the field squared and energy-momentum
tensor are investigated. The mean field squared and the normal stress are
finite on the boundary separating two subspaces, whereas the energy density and
the parallel stress diverge as the inverse power of the distance from the
boundary. For a conformally coupled field, the vacuum energy density is
negative on the cylindrical part of the space. On the hemisphere, it is
negative near the top and positive close to the boundary. In the case of
minimal coupling the energy density on the cup is negative. On the tube it is
positive near the boundary and negative at large distances. Though the
geometries of the subspaces are different, the Casimir pressures on the
separate sides of the boundary are equal and the net Casimir force vanishes.
The results obtained may be applied to capped carbon nanotubes described by an
effective field theory in the long-wavelength approximation.
