I've got a modified version that seems to be working based on the inside method of this class. I'll post it here once I've tested and polished it a bit more.
It depends on the detector having subdetectors named "SiVertexEndcap" and "SiVertexBarrel" in order to work but I don't think theres an easy way around this.
[Updated on: Thu, 28 August 2014 08:03]