You can consult with a pediatric allergist about possible food allergy, but the presentation you suggest does not indicate that such allergic reaction is likely. If the compulsive behaviors do not interfere with her functioning you may not need to seek any particular treatment. But, given the overall picture, it would make sense to arrange for an evaluation by a pediatric mental health professional (clinical psychologist, psychiatric social worker, psychiatric nurse, psychiatrist). Poosible conditions include anxiety disorder, attention deficit hyperactivity disorder and mood disorder (though the latter is not likely). If you are not sure how to proceed to obtain such an evaluation, check with your daughter's pediatrician for guidance.
I just want to let oyu know that you are not alone. I have a 7 yr. old boy. He is very intelligent. But, when he is told to do something, two min. later he can't remember. The mood swings are awful to deal with. His mood can change in the middle of a sentence. I have had him to a phsychotherepist. Unfortunatley, I am still unable to get diagnosed with any type of condition. They tell me he has no medical disorder, only a case of an anger problem. We went through this therapy for about 6 mo. with no change in any area. Just wanted to let you know I feel for you & that you are not alone.