A tool box to ascertain the nature of doping and photoresponse in single-walled carbon nanotubes