Density profile consistency and its relation to the transport of trapped versus passing electrons in tokamaks