58 LOG(error) <<
"CbmRichProjectionProducerTGeo::DoExtrapolation(): richProj is nullptr.";
69 TMatrixFSym covMat(5);
70 for (Int_t i = 0; i < 5; i++) {
71 for (Int_t j = 0; j <= i; j++) {
75 covMat(0, 0) = covMat(1, 1) = covMat(2, 2) = covMat(3, 3) = covMat(4, 4) = 1.e-4;
78 for (Int_t iT0 = 0; iT0 < nofTrackParams; iT0++) {
80 FairTrackParam* trackParam =
static_cast<FairTrackParam*
>(
fTrackParams->At(iT));
81 new ((*richProj)[iT]) FairTrackParam(0., 0., 0., 0., 0., 0., covMat);
84 if (trackParam->GetX() == 0 && trackParam->GetY() == 0 && trackParam->GetZ() == 0 && trackParam->GetTx() == 0
85 && trackParam->GetTy() == 0)
87 if (trackParam->GetQp() == 0)
continue;
89 TVector3 startP, crossP, centerP;
93 dirCos.SetXYZ(nx, ny, nz);
96 Bool_t mirrorIntersectionFound = (volumeName != string(
""));
97 if (!mirrorIntersectionFound)
continue;
100 if (crossP.Y() > 0) {
101 centerP.SetXYZ(mirrorX, mirrorY, mirrorZ);
104 centerP.SetXYZ(mirrorX, -mirrorY, mirrorZ);
108 TVector3 normP(crossP.x() - centerP.x(), crossP.y() - centerP.y(), crossP.z() - centerP.z());
109 normP = normP.Unit();
111 if ((normP.z() * dirCos.z()) < 0.) normP = TVector3(-1. * normP.x(), -1. * normP.y(), -1. * normP.z());
114 Double_t np = normP.x() * dirCos.x() + normP.y() * dirCos.y() + normP.z() * dirCos.z();
115 Double_t refX = 2 * np * normP.x() - dirCos.x();
116 Double_t refY = 2 * np * normP.y() - dirCos.y();
117 Double_t refZ = 2 * np * normP.z() - dirCos.z();
119 refl.SetXYZ(-refX, -refY, -refZ);
122 TVector3 pmtIntersectionPoint;
124 Bool_t pmtIntersectionFound = (volumeName != string(
""));
125 if (!pmtIntersectionFound)
continue;
132 Double_t xDet = outPos.X();
133 Double_t yDet = outPos.Y();
134 Double_t zDet = outPos.Z();
139 FairTrackParam richtrack(xDet, yDet, zDet, 0., 0., 0., covMat);
140 *(FairTrackParam*) (
richProj->At(iT)) = richtrack;