cms-sw/cmssw — pull request #3639 by mark-grimes (2014-05-02 01:41:45+00:00)
Title: Make QuickTrackAssociatorByHits thread safe

Removed all mutable members from QuickTrackAssociatorByHits to (as far as I can tell) make it thread safe. There are now no members modified outside of the constructor. I've only done limited testing with the 25202.0 matrix test, results are attached. Even though it's only 10 events everything appears to overlay exactly.

Note that I expect two differences to the old code:

1. More LogInfo messages when there is a particular failure - The configuration parameter useClusterTPAssociation_ used to be mutable and was changed to false if retrieving the cluster to TrackingParticle map from the event failed. So previously only one LogInfo message was displayed in this case and then it reverted to permanently using the hit associator. Now a LogInfo message will be displayed every time this fails (but still reverts to the hit associator). This failure mode is unlikely anyway.
2. Accidentally fixed (I think) a bug in TrackerHitAssociator where the results from a previous method call could be returned - For convenience I changed all the methods in TrackerHitAssociator to be "const" since no internal changes should be made after construction. In doing so I had to remove a member (simtrackid) which is only ever used as a local variable, and in most cases is actually shadowed by local variables of different types. There is one logic possibility where I think the value of simtrackid from a previous call could be returned. So I think this actually fixes a bug. I'll comment on this line specifically once the request is submitted (I don't seem to be able to do so while creating the request??).

Here are some of the tracking validation plots from matrix test 25202.0.

![effandfake1](https://cloud.githubusercontent.com/assets/6480160/2859103/d9feddbc-d199-11e3-9ccc-c867d9f7b1b5.png)
![effandfake2](https://cloud.githubusercontent.com/assets/6480160/2859104/dff82e1c-d199-11e3-9325-67b2af38ebd8.png)
![dupandfake1](https://cloud.githubusercontent.com/assets/6480160/2859109/f118d886-d199-11e3-9d66-c71e657d8e12.png)
![dupandfake2](https://cloud.githubusercontent.com/assets/6480160/2859111/f6f8c374-d199-11e3-821f-9524961806a5.png)
![hitsandpt](https://cloud.githubusercontent.com/assets/6480160/2859112/0e901f3c-d19a-11e3-8c93-0873d55d32db.png)
![pulls](https://cloud.githubusercontent.com/assets/6480160/2859113/1e478d02-d19a-11e3-86f7-5ad9b24d2b7c.png)