When you get up the stairs, go to the right, then enter the first room you find. You'll know it's right because it has lots of rubble. See that mostly-buried bookcase by the door, facing away from you? Go around the other side of it and look at the bookcase, the hat should be in there. It's small, so look carefully and use the Pip-Boy light.
If you disagree with the above post, don't bother flaming, I'll likely agree somewhat with your opinion, too. I'm pretty open-minded.