I went looking for anything I could find on-line re possible contaminants in roof collected rainwater. Here it is:
I checked with several plant scientists, and the answer was that there should not be any problems with vegetables watered with normal run off from a normal asphalt roof. The amounts of any petroleum contaminants would be small, and plant roots are not designed to take up petroleum products.
Reasonably pure rainwater can be collected from roofs constructed with galvanized corrugated iron, aluminium or asbestos cement sheets, tiles and slates,
Some materials, such as the asbestos roof materials used in older homes, should not be part of any system used to provide drinking water. In addition, products such as asphalt shingles can contribute particulate matter into the water, requiring additional filtration before the water reaches the storage tank or cistern. In addition, lead materials in any form, such as lead flashing, should not be used in a rainwater collection system.
The main function of the roof washer is to isolate and reject the first water that has fallen on the roof after rain has begun and then direct the rest of the water to the cistern. Ten gallons of rainfall per thousand square feet of roof area is considered an acceptable amount for washing. Roof washers are commercially available and afford reliability, durability, and minimal maintenance to this function.
Roof washing is not needed for water used for irrigation purposes.
https://www.physorg.com/news88268999.html This was under the heading of rainwater fails health test:
More than half of 560 samples from private dwellings in New Zealand exceeded the minimal standards for contamination and 30 percent showed evidence of heavy faecal contamination.
But they were talking about using the roof water collected for drinking and the only contamination they were talking about was fecal contamination from bird droppings, etc. I think for purposes of growing vegetables we would not worry about that.
Some roofing materials are not suitable for a rainwater collection system. If there is lead, chromium or cadmium in the roofing materials, soldering, flashing's, or paint, you shouldn't collect rainwater on top of your roof.