Bug found in StEEmcIUClusterMaker.cxx

 

In the process of validating my new software structure for EEMC analysis, I came accross the following "feature" in the CVS implementation.  The problem is in file

$CVSROOT/StRoot/StEEmcPool/StEEmcIUPi0/StEEmcIUClusterMaker.cxx

CVS version 1.1, starting line 711, and deals with the energy sharing of strips which are in more than one SMD cluster.

The problem

The idea which is supposed to be implemented is the following: given cluster A and cluster B, with the seed of A being to the left of the seed of B, assume that some strips are contained in both A and B.  One defines EAL as the energy of the seed strip of A, plus the energies of all the strips in A which are to the left of the seed.  Likewise, one defines EBR as the sum of the seed strip of B plus the energies of all strips in B to the right of the seed of B.  Any strip shared by both A and B then contribute to A with weight

wA = EAL/(EAL+EBR)

and constribute to B with weight

wB = EBR/(EAL+EBR).

The current implementation fails if there exists cluster C which also overlaps with B.  When the code is considering stips which might be shared between clusters A and B, it only checks to see how many clusters a strip is in, not which clusters they are in.  Thus strips in B, overlapping with cluster C, will be given the weight wB, which was computed with regard to clusters A and B, not C.

Simularly, when the code later compares clusters B and C, it will make a new copy of cluster B and weight all the strips which overlap with either A or C with the weights computed by comparing B and C.  However, it will not save this copy of cluster B, as it recognizes there was already a cluster B saved.  Thus this copy of B, with weights computed with regard to cluster C, is completely thrown out.  What remains in the list of clusters is one copy of B, with all strips overlapping with either A or C weighted according to wB computed with respect to clusters A and B.

 The effect is that for any clusters in the "middle" of a sequence of more than 2 overlapping SMD clusters, the energy will be computed incorrectly.  In some cases, this only effects the weighting of the tower energies, and results in the wrong point energy by a factor on the order of 10%.  In other cases, the change in the energy of the strip cluster effects the energy matching between u and v layers sufficiently to change the pairing of u and v clusters.  In this case, the entire event may have a different number of points and the points may have different positions and energies.

The Solution

One needs to check which cluster a given seed overlaps with, and also allow for seed energies to be updated.  Updated files are attached (names changed to have an extra .txt so drupal will allow the upload) and will hopefully be checked into CVS in the near future.