Pileup in pp500 BeamLine constraint

 When attempting a Run 9: pp500 Low Luminosity Fill, I got a glimpse of how big an issue pileup was going to be. When I first processed some mildly high luminosity pp500 data from day 83 (fill 10415, daq files from runs 10083013-56 were on disk), I found it a bit difficult to apply cuts to get rid of pileup. One place where pileup is easy to see is in the x position of vertices at large z. Here we can see that particularly at high vertex ranking (right plot) there are two peaks in the x position (shown versus multiplicity of the vertices for low and high ranked vertices separately):

A hint that the peak with higher x values is from the non-pileup distribution comes from its extension into high multiplicities, but it isn't solid evidence. Even more evidence comes from not weighting the vertices by their errors, which demonstrates that the low x value vertices have larger errors associated with them:

Note that I have used the VFMinuit3 chain option which supposedly gives lower ranking to split vertices. I do not know if this is appropriate (should I be using VFMinuit2?).

So I modified Minuit to instead use something akin to what PPV does, allowing rejection of tracks which appear to be PCTs (post-crossing tracks):

bool StMinuitVertexFinder::isPostCrossingTrack(StTrack* track) const{
  const float zMax=200;
  const float zMembraneDepth=1.0;
  const int   nWrongZHitCut=2;
  int nWrongZHit=0;
  StPtrVecHit hits = track->detectorInfo()->hits(kTpcId);
  for (unsigned int i=0;i<hits.size();i++) {
    StTpcHit* sthit = (StTpcHit*) hits[i];
      StTpcHit* hit=(StTpcHit*) sthit;
      float z=hit->position().z();
      if (fabs(z) > zMax) continue;
      if (z < -zMembraneDepth && hit->sector() <= 12 ||
          z >  zMembraneDepth && hit->sector() >  12) {
        if(nWrongZHit>=nWrongZHitCut) {return true;}
  return false;

Re-running the same data sample now results in plots as shown here:

The peak with high ranking at smaller x values has considerably shrunk, proving that it was comprised predominantly of pileup vertices.

I plan to use this modified Minuit vertex finder for the remainder of the BeamLine calibrations unless something better comes along.