Mathematical Identification of Brain States Applied to Classification of Drugs