The flat ridge is a roof flashing. It is used to finish the waterproofness of the roof and the aesthetics of the building.