fix long standing typo in TIDLayer

optimization of the whole logic is left for next student joining the project...

negligible regression observed

Jira ticket https://its.cern.ch/jira/browse/CMSTRACK-109