47 #include "StDcaGeometry.h"
48 #if ROOT_VERSION_CODE < 331013
54 #include "TRSymMatrix.h"
58 static const
char rcsid[] = "$Id:
StDcaGeometry.cxx,v 2.12 2017/06/01 23:48:44 smirnovd Exp $";
62 memset(mBeg,0,mEnd-mBeg+1);
65 StDcaGeometry::~StDcaGeometry() {}
69 float x = -mImp*sin(mPsi);
70 float y = mImp*cos(mPsi);
77 float x = ptt*cos(mPsi);
78 float y = ptt*sin(mPsi);
83 void StDcaGeometry::set(
const float pars[7],
const float errs[15])
85 if (pars) memcpy(&mImp ,pars,
sizeof(
float)*6 );
86 if (errs) memcpy(&mImpImp,errs,
sizeof(
float)*15);
88 void StDcaGeometry::set(
const double pars[7],
const double errs[15])
90 if (pars) TCL::ucopy(pars, &mImp, 6);
91 if (errs) TCL::ucopy(errs, &mImpImp, 15);
97 int h = (mCurv>=0) ? 1:-1;
99 double phase = mPsi-h*M_PI/2;
110 enum {kImp,kZ,kPsi,kPti,kTan};
115 double errXY[6],errSZ[6];
116 const float *myErr = &mImpImp;
119 for (
int i=0,li=0;i<5; li+=++i) {
120 for (
int j=0;j<=i;j++) {
122 if(i==kZ || i==kTan)
break;
123 if(j==kZ || j==kTan)
break;
124 errXY[jjx++]=myErr[li+j];
128 if(i!=kZ && i!=kTan)
break;
129 if(j!=kZ && j!=kTan)
break;
130 errSZ[jjz++]=myErr[li+j];
138 myHelx.SetEmx(errXY,errSZ);
143 const Float_t *errMx = dca.errMatrix();
144 return os << Form(
"Dca: imp %7.2f +/-%7.2f, Z:%7.2f +/-%7.2f, psi:%7.2f +/-%7.2f, pT/q:%7.2f +/-%6.1f%%, TanL:%8.3f +/-%8.3f",
145 dca.impact(), (errMx[0] >= 0) ? TMath::Sqrt(errMx[0]) : -13,
146 dca.z(), (errMx[2] >= 0) ? TMath::Sqrt(errMx[2]) : -13,
147 dca.psi(), (errMx[5] >= 0) ? TMath::Sqrt(errMx[5]) : -13,
148 dca.charge()*dca.pt(), (errMx[9] >= 0 && dca.pt() > 0) ? 100*TMath::Sqrt(errMx[9])*dca.pt() : -13,
149 dca.tanDip(), (errMx[14] >= 0) ? TMath::Sqrt(errMx[14]): -13);
152 void StDcaGeometry::Print(Option_t *option)
const {cout << *
this << endl;}
154 void StDcaGeometry::GetXYZ(Double_t xyzp[6], Double_t CovXyzp[21])
const {
155 static const Float_t one = 1;
156 Double_t sinP = TMath::Sin(mPsi);
157 Double_t cosP = TMath::Cos(mPsi);
159 xyzp[0] = - mImp*sinP;
165 Double_t dpTdPti = -pT*pT*TMath::Sign(one,mPti);
168 -sinP, 0, -mImp*cosP, 0, 0
169 ,cosP, 0, -mImp*sinP, 0, 0
171 , 0, 0, -pT*sinP, dpTdPti*cosP, 0
172 , 0, 0, pT*cosP, dpTdPti*sinP, 0
173 , 0, 0, 0, dpTdPti*mTan, pT
178 TCL::ucopy(Cov.GetArray(),CovXyzp,21);