EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FwdMatchCandidate.cxx
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file FwdMatchCandidate.cxx
1 //
2 // AYK (ayk@bnl.gov)
3 //
4 // STAR forward track candidate class;
5 //
6 //
7 
8 #include <math.h>
9 
10 #include <FwdMatchCandidate.h>
11 
12 // ---------------------------------------------------------------------------------------
13 
14 void FwdMatchCandidate::SetVtxMomentum(double sx, double sy, double invp)
15 {
16  assert(invp);
17  // THINK: may want to preserve sign here?; well, mCharge will do;
18  double p = fabs(1/invp), norm = sqrt(1.0 + sx*sx + sy*sy);
19 
20  mCharge = invp > 0.0 ? 1 : -1;
21 
22  printf("%f %f %f\n", sx, sy, p);
23  mMomentum = p * TVector3(sx/norm, sy/norm, 1.0/norm);
24 } // FwdMatchCandidate::SetVtxMomentum()
25 
26 // ---------------------------------------------------------------------------------------
27