Faster R-CNN with FPN

FPN outputs 4 layers of different sizes. How are RPN and RoI connected to them? RPN should output a set of anchors/layer, so 4 sets of anchors. Is RoI connected to just 1 of them to get the pooled feature map, or the corresponding feature map? E.g. for an anchor from pyramid layer 0, layer_blocks 0 is used?
Thanks