26 #include "StPrimaryVertex.h"
27 #include "StContainers.h"
28 #include "StPrimaryTrack.h"
29 #include "StTrackGeometry.h"
30 #include "StTrackFitTraits.h"
32 #include "StLorentzVectorF.hh"
34 float largestPairMass(
StEvent* event) {
37 if (!event)
return -9999;
38 if (!(event->primaryVertex()))
return -9999;
45 const float eMass = 0.00051099906;
48 float mostGargantuanMass = 0.0;
51 const StSPtrVecPrimaryTrack& trackArray =
event->primaryVertex()->daughters();
56 for (
unsigned int ipr1=0; ipr1<trackArray.size(); ++ipr1) {
60 if (!ptrack1)
continue;
61 if (ptrack1->flag()<=0)
continue;
62 if (ptrack1->fitTraits().numberOfFitPoints(kTpcId)<15)
continue;
64 if (mom1.mag()<1.)
continue;
65 if (fabs(mom1.pseudoRapidity())>1.5)
continue;
72 for (
unsigned int ipr2=ipr1+1; ipr2<trackArray.size(); ++ipr2) {
76 if (!ptrack2)
continue;
77 if (ptrack2->flag()<=0)
continue;
78 if (ptrack2->fitTraits().numberOfFitPoints(kTpcId)<15)
continue;
80 if (mom2.mag()<1.)
continue;
81 if (fabs(mom2.pseudoRapidity())>1.5)
continue;
89 float mass = (fmom1 + fmom2).m();
90 if (mass>mostGargantuanMass) {
91 mostGargantuanMass = mass;
95 return mostGargantuanMass;