When your cat is in heat and there's other male cats around you need to isolate the cat away from any and all male cats.
Keep the litter box clean and use Catnip which can calm a cat down when they're in heat.
Also playing with your cat can distract them from their thoughts about the male cats and can help calm the cat down while she's in heat.
You can also buy and use a Feliway diffuser in your home to help calm a cat down when she's in heat and it helps stop your cat from urinating, spraying and scratching things in the house.