Ionic moieties in organic and hybrid semiconducting devices: influence on energy band structures and functions