Patch hierarchyconstraints to CMSSW_7_0_X

This is a backport to 70X of pull request #2370. Notes from there:
> This patch has been prepared by Gero Flucke some time ago, see https://twiki.cern.ch/twiki/bin/viewauth/CMS/TkAlignmentLegacyThoughts, first topic. Testing happened on CMSSW_4_4_5. Results were presented in the alignment meeting of Oct 31, 2013, where the modifications got blessed. See https://twiki.cern.ch/twiki/bin/viewauth/CMS/TkAlPullReq201401 for more details and link to the presentation.
This is an outstanding issue since months that was not put into git.

For consistency, this needs to be put into earlier releases as well. Please give instructions if this is not the right flavour of 70X and/or if we should target this patch to other 70X versions as well.