CTM4DOC: electronic structure analysis from X-ray spectroscopy