Unlike their dog counterparts, when cats wag their tails it does not mean they are happy to see you. Most often then not, when a cat moves its tail back and forth it means that they are not a happy kitty and would like to be left alone.
The action means that your cat is annoyed and it would prefer to be left alone. However, if a cat is twitching its tail, it usually means that it is very interesting in something, such as a red dot on the wall.