18 #include <TGenericClassInfo.h>
20 #include <TMathBase.h>
48 , forigin(TVector3(0, 0, 0))
49 , fiver(TVector3(0, 0, 0))
50 , fjver(TVector3(0, 0, 0))
51 , fkver(TVector3(0, 0, 0))
55 for (Int_t i = 0; i < 15; i++) {
58 for (
int i = 0; i < 6; i++)
59 for (
int j = 0; j < 6; j++) {
60 fCovMatrix66[i][j] = 0;
70 Double_t CovMatrix[15],
88 , forigin(TVector3(0, 0, 0))
89 , fiver(TVector3(0, 0, 0))
90 , fjver(TVector3(0, 0, 0))
91 , fkver(TVector3(0, 0, 0))
102 Double_t P = TMath::Abs(1 /
fQp);
104 fq =
static_cast<int>(TMath::Sign(1.0,
fQp));
105 for (Int_t i = 0; i < 15; i++) {
106 fCovMatrix[i] = CovMatrix[i];
109 fPx_sd = TMath::Sqrt(P * P / (fTV * fTV + fTW * fTW + 1));
110 fPy_sd = fTV * fPx_sd;
111 fPz_sd = fTW * fPx_sd;
116 TVector3 position = util.
FromSDToMARSCoord(TVector3(fU, fV, fW), forigin, fiver, fjver, fkver);
121 fDQp = TMath::Sqrt(fabs(fCovMatrix[0]));
122 fDTV = TMath::Sqrt(fabs(fCovMatrix[5]));
123 fDTW = TMath::Sqrt(fabs(fCovMatrix[9]));
124 fDV = TMath::Sqrt(fabs(fCovMatrix[12]));
125 fDW = TMath::Sqrt(fabs(fCovMatrix[14]));
127 Double_t PD[3], RD[6][6], H[3], PC[3], RC[15], SP1;
133 for (Int_t i = 0; i < 15; i++) {
134 RC[i] = fCovMatrix[i];
138 for (Int_t i = 0; i < 6; i++) {
139 for (Int_t k = 0; k < 6; k++) {
154 TVector3 momsd = TVector3(fPx_sd, fPy_sd, fPz_sd);
155 SP1 = (momsd.Dot(fjver.Cross(fkver))) / TMath::Abs(momsd.Dot(fjver.Cross(fkver)));
158 util.
FromSDToMars(PC, RC, H, CH, SP1, fDJ, fDK, PD, RD);
164 for (
int i = 0; i < 6; i++)
165 for (
int j = 0; j < 6; j++) {
166 fCovMatrix66[i][j] = RD[i][j];
169 fDPx = TMath::Sqrt(fabs(RD[0][0]));
170 fDPy = TMath::Sqrt(fabs(RD[1][1]));
171 fDPz = TMath::Sqrt(fabs(RD[2][2]));
172 fDX = TMath::Sqrt(fabs(RD[3][3]));
173 fDY = TMath::Sqrt(fabs(RD[4][4]));
174 fDZ = TMath::Sqrt(fabs(RD[5][5]));
183 Double_t CovMatrix[15],
202 , forigin(TVector3(0, 0, 0))
203 , fiver(TVector3(0, 0, 0))
204 , fjver(TVector3(0, 0, 0))
205 , fkver(TVector3(0, 0, 0))
219 P = TMath::Abs(1 /
fQp);
220 fq =
static_cast<int>(TMath::Sign(1.0,
fQp));
225 for (Int_t i = 0; i < 15; i++) {
226 fCovMatrix[i] = CovMatrix[i];
229 fPx_sd = fSPU * TMath::Sqrt(P * P / (fTV * fTV + fTW * fTW + 1));
230 fPy_sd = fTV * fPx_sd;
231 fPz_sd = fTW * fPx_sd;
236 TVector3 position = util.
FromSDToMARSCoord(TVector3(fU, fV, fW), forigin, fiver, fjver, fkver);
241 fDQp = TMath::Sqrt(fabs(fCovMatrix[0]));
242 fDTV = TMath::Sqrt(fabs(fCovMatrix[5]));
243 fDTW = TMath::Sqrt(fabs(fCovMatrix[9]));
244 fDV = TMath::Sqrt(fabs(fCovMatrix[12]));
245 fDW = TMath::Sqrt(fabs(fCovMatrix[14]));
247 Double_t PD[3], RD[6][6], H[3], PC[3], RC[15], SP1;
254 for (Int_t i = 0; i < 6; i++) {
255 for (Int_t k = 0; k < 6; k++) {
260 for (Int_t i = 0; i < 15; i++) {
261 RC[i] = fCovMatrix[i];
274 TVector3 momsd = TVector3(fPx_sd, fPy_sd, fPz_sd);
278 util.
FromSDToMars(PC, RC, H, CH, SP1, fDJ, fDK, PD, RD);
284 for (
int i = 0; i < 6; i++)
285 for (
int j = 0; j < 6; j++) {
286 fCovMatrix66[i][j] = RD[i][j];
289 fDPx = TMath::Sqrt(fabs(RD[0][0]));
290 fDPy = TMath::Sqrt(fabs(RD[1][1]));
291 fDPz = TMath::Sqrt(fabs(RD[2][2]));
292 fDX = TMath::Sqrt(fabs(RD[3][3]));
293 fDY = TMath::Sqrt(fabs(RD[4][4]));
294 fDZ = TMath::Sqrt(fabs(RD[5][5]));
306 :
FairTrackPar(pos.x(), pos.y(), pos.z(), Mom.x(), Mom.y(), Mom.z(), Q)
320 , forigin(TVector3(0, 0, 0))
321 , fiver(TVector3(0, 0, 0))
322 , fjver(TVector3(0, 0, 0))
323 , fkver(TVector3(0, 0, 0))
338 fq = Q / TMath::Abs(Q);
355 Double_t PD[3], RD[6][6], H[3], SP1, PC[3], RC[15];
363 for (
int i = 0; i < 6; i++)
364 for (
int j = 0; j < 6; j++) {
374 for (
int i = 0; i < 6; i++)
375 for (
int j = 0; j < 6; j++) {
376 fCovMatrix66[i][j] = RD[i][j];
389 util.
FromMarsToSD(PD, RD, H, CH, fDJ, fDK, IERR, SP1, PC, RC);
391 for (Int_t i = 0; i < 15; i++) {
392 fCovMatrix[i] = RC[i];
398 fDQp = TMath::Sqrt(fabs(fCovMatrix[0]));
399 fDTV = TMath::Sqrt(fabs(fCovMatrix[5]));
400 fDTW = TMath::Sqrt(fabs(fCovMatrix[9]));
401 fDV = TMath::Sqrt(fabs(fCovMatrix[12]));
402 fDW = TMath::Sqrt(fabs(fCovMatrix[14]));
406 fPx_sd = fSPU * TMath::Sqrt(P * P / (fTV * fTV + fTW * fTW + 1));
407 fPy_sd = fTV * fPx_sd;
408 fPz_sd = fTW * fPx_sd;
414 Double_t covMARS[6][6],
419 :
FairTrackPar(pos.x(), pos.y(), pos.z(), Mom.x(), Mom.y(), Mom.z(), Q)
433 , forigin(TVector3(0, 0, 0))
434 , fiver(TVector3(0, 0, 0))
435 , fjver(TVector3(0, 0, 0))
436 , fkver(TVector3(0, 0, 0))
451 fq = Q / TMath::Abs(Q);
461 fDPx = TMath::Sqrt(fabs(covMARS[0][0]));
462 fDPy = TMath::Sqrt(fabs(covMARS[1][1]));
463 fDPz = TMath::Sqrt(fabs(covMARS[2][2]));
464 fDX = TMath::Sqrt(fabs(covMARS[3][3]));
465 fDY = TMath::Sqrt(fabs(covMARS[4][4]));
466 fDZ = TMath::Sqrt(fabs(covMARS[5][5]));
468 Double_t PD[3], RD[6][6], H[3], SP1, PC[3], RC[15];
475 for (
int i = 0; i < 6; i++)
476 for (
int j = 0; j < 6; j++) {
477 RD[i][j] = covMARS[i][j];
479 for (
int i = 0; i < 6; i++)
480 for (
int j = 0; j < 6; j++) {
481 fCovMatrix66[i][j] = RD[i][j];
494 util.
FromMarsToSD(PD, RD, H, CH, fDJ, fDK, IERR, SP1, PC, RC);
496 for (Int_t i = 0; i < 15; i++) {
497 fCovMatrix[i] = RC[i];
503 fDQp = TMath::Sqrt(fabs(fCovMatrix[0]));
504 fDTV = TMath::Sqrt(fabs(fCovMatrix[5]));
505 fDTW = TMath::Sqrt(fabs(fCovMatrix[9]));
506 fDV = TMath::Sqrt(fabs(fCovMatrix[12]));
507 fDW = TMath::Sqrt(fabs(fCovMatrix[14]));
511 fPx_sd = fSPU * TMath::Sqrt(P * P / (fTV * fTV + fTW * fTW + 1));
512 fPy_sd = fTV * fPx_sd;
513 fPz_sd = fTW * fPx_sd;
537 , forigin(TVector3(0, 0, 0))
538 , fiver(TVector3(0, 0, 0))
539 , fjver(TVector3(0, 0, 0))
540 , fkver(TVector3(0, 0, 0))
549 TVector3 xyz(helix->
GetX(), helix->
GetY(), helix->
GetZ());
550 Double_t H[3], pnt[3];
557 Int_t CH = helix->
GetQ();
559 Double_t DJ[3] = {dj.X(), dj.Y(), dj.Z()};
560 Double_t DK[3] = {dk.X(), dk.Y(), dk.Z()};
564 Double_t PD[3], RD[15];
567 util.
FromSCToSD(PC, RC, H, CH, DJ, DK, IERR, SPU, PD, RD);
572 TVector3 o(xyz.X(), xyz.Y(), xyz.Z());
573 TVector3 di = dj.Cross(dk);
577 SetTrackPar(uvm.Y(), uvm.Z(), PD[1], PD[2], PD[0], RD, o, di, dj, dk, SPU);
579 cout <<
"FairTrackParP(FairTrackParH *) contructor ERROR: CANNOT convert helix to parabola" << endl;
591 Double_t CovMatrix[15],
600 Double_t P = TMath::Sqrt(Px * Px + Py * Py + Pz * Pz);
603 fq = TMath::Abs(Q) / Q;
615 for (Int_t i = 0; i < 15; i++) {
616 fCovMatrix[i] = CovMatrix[i];
627 Double_t PD[3], RD[6][6], H[3], SP1, PC[3], RC[15];
633 for (
int i = 0; i < 6; i++)
634 for (
int j = 0; j < 6; j++) {
646 util.
FromMarsToSD(PD, RD, H, CH, fDJ, fDK, IERR, SP1, PC, RC);
650 fDQp = TMath::Sqrt(fabs(fCovMatrix[0]));
651 fDTV = TMath::Sqrt(fabs(fCovMatrix[5]));
652 fDTW = TMath::Sqrt(fabs(fCovMatrix[9]));
653 fDV = TMath::Sqrt(fabs(fCovMatrix[12]));
654 fDW = TMath::Sqrt(fabs(fCovMatrix[14]));
656 for (Int_t i = 0; i < 15; i++) {
657 RC[i] = fCovMatrix[i];
660 util.
FromSDToMars(PC, RC, H, CH, SP1, fDJ, fDK, PD, RD);
662 for (
int i = 0; i < 6; i++)
663 for (
int j = 0; j < 6; j++) {
664 fCovMatrix66[i][j] = RD[i][j];
667 fDPx = TMath::Sqrt(fabs(RD[0][0]));
668 fDPy = TMath::Sqrt(fabs(RD[1][1]));
669 fDPz = TMath::Sqrt(fabs(RD[2][2]));
670 fDX = TMath::Sqrt(fabs(RD[3][3]));
671 fDY = TMath::Sqrt(fabs(RD[4][4]));
672 fDZ = TMath::Sqrt(fabs(RD[5][5]));
683 Double_t CovMatrix[15],
700 Double_t P = TMath::Abs(1 /
fQp);
702 fq =
static_cast<int>(TMath::Sign(1.0,
fQp));
703 for (Int_t i = 0; i < 15; i++) {
704 fCovMatrix[i] = CovMatrix[i];
707 fPx_sd = fSPU * TMath::Sqrt(P * P / (fTV * fTV + fTW * fTW + 1));
708 fPy_sd = fTV * fPx_sd;
709 fPz_sd = fTW * fPx_sd;
712 TVector3 position = util.
FromSDToMARSCoord(TVector3(fU, fV, fW), forigin, fiver, fjver, fkver);
717 fDQp = TMath::Sqrt(fabs(fCovMatrix[0]));
718 fDTV = TMath::Sqrt(fabs(fCovMatrix[5]));
719 fDTW = TMath::Sqrt(fabs(fCovMatrix[9]));
720 fDV = TMath::Sqrt(fabs(fCovMatrix[12]));
721 fDW = TMath::Sqrt(fabs(fCovMatrix[14]));
723 Double_t PD[3], RD[6][6], H[3], PC[3], RC[15], SP1;
729 for (Int_t i = 0; i < 15; i++) {
730 RC[i] = fCovMatrix[i];
734 for (Int_t i = 0; i < 6; i++) {
735 for (Int_t k = 0; k < 6; k++) {
750 TVector3 momsd = TVector3(fPx_sd, fPy_sd, fPz_sd);
754 util.
FromSDToMars(PC, RC, H, CH, SP1, fDJ, fDK, PD, RD);
760 for (
int i = 0; i < 6; i++)
761 for (
int j = 0; j < 6; j++) {
762 fCovMatrix66[i][j] = RD[i][j];
765 fDPx = TMath::Sqrt(fabs(RD[0][0]));
766 fDPy = TMath::Sqrt(fabs(RD[1][1]));
767 fDPz = TMath::Sqrt(fabs(RD[2][2]));
768 fDX = TMath::Sqrt(fabs(RD[3][3]));
769 fDY = TMath::Sqrt(fabs(RD[4][4]));
770 fDZ = TMath::Sqrt(fabs(RD[5][5]));
773 void FairTrackParP::CalCov()
782 cout <<
"Position : (";
783 cout << std::setprecision(2) <<
fX <<
", " <<
fY <<
", " <<
fZ <<
")" << endl;
784 cout << std::setprecision(2) <<
"Slopes : dx/dz = " << fTV <<
", dy/dz = " << fTW << endl;
785 cout << std::setprecision(2) <<
"q/p = " <<
fQp << endl;
865 for (Int_t i = 0; i < 15; i++) {
883 forigin = TVector3(o.X(), o.Y(), o.Z());
891 k = (j.Cross(k)).Cross(j);
896 TVector3 i = j.Cross(k);
901 fiver = TVector3(fDI[0], fDI[1], fDI[2]);
906 fjver = TVector3(fDJ[0], fDJ[1], fDJ[2]);
911 fkver = TVector3(fDK[0], fDK[1], fDK[2]);
916 for (
int i = 0; i < 5; i++)
917 for (
int j = 0; j < 5; j++) {
918 ftrmat[i][j] = mat[i][j];
924 for (
int i = 0; i < 5; i++)
925 for (
int j = 0; j < 5; j++) {
926 mat[i][j] = ftrmat[i][j];
934 for (
int i = 0; i < 15; i++) {
935 CovQ[i] = fCovMatrix[i];
938 CovQ[i] = CovQ[i] / (
fq *
fq);
940 if (i > 0 && i < 5) {
941 CovQ[i] = CovQ[i] /
fq;
virtual void Print(Option_t *option="") const
void FromMarsToSD(Double_t PD[3], Double_t RD[6][6], Double_t H[3], Int_t CH, Double_t DJ1[3], Double_t DK1[3], Int_t &IERR, Double_t &SP1, Double_t *PC, Double_t *RC)
void FromSDToMars(Double_t PC[3], Double_t RC[15], Double_t H[3], Int_t CH, Double_t SP1, Double_t DJ1[3], Double_t DK1[3], Double_t *PD, sixMat &RD)
void SetPlane(TVector3 o, TVector3 dj, TVector3 dk)
virtual Double_t GetQp() const
virtual void GetFieldValue(const Double_t point[3], Double_t *bField)
virtual void SetPy(Double_t py)
ClassImp(FairEventBuilder)
void SetTrackPar(Double_t X, Double_t Y, Double_t Z, Double_t Px, Double_t Py, Double_t Pz, Int_t Q, Double_t CovMatrix[15], TVector3 o, TVector3 di, TVector3 dj, TVector3 dk)
virtual void SetY(Double_t y)
virtual void SetZ(Double_t z)
TVector3 FromMARSToSDCoord(TVector3 xyz, TVector3 o, TVector3 di, TVector3 dj, TVector3 dk)
void GetTransportMatrix(Double_t mat[5][5])
TVector3 FromSDToMARSCoord(TVector3 uvw, TVector3 o, TVector3 di, TVector3 dj, TVector3 dk)
virtual void SetPz(Double_t pz)
virtual void SetPx(Double_t px)
void GetCov(Double_t *Cov)
void FromSCToSD(Double_t PC[3], Double_t RC[15], Double_t H[3], Int_t CH, Double_t DJ[3], Double_t DK[3], Int_t &IERR, Double_t &SPU, Double_t *PD, Double_t *RD)
virtual void SetX(Double_t x)
void SetTransportMatrix(Double_t mat[5][5])
void GetCovQ(Double_t *CovQ)