18 static string FindIntersection(
const FairTrackParam* par, TVector3& crossPoint,
const string& volumeName,
22 pos.SetXYZ(par->GetX(), par->GetY(), par->GetZ());
25 dirCos.SetXYZ(nx, ny, nz);
31 const string& volumeName, TGeoNavigator* navi)
34 gGeoManager->InitTrack(
pos.X(),
pos.Y(),
pos.Z(), dirCos.X(), dirCos.Y(), dirCos.Z());
36 if (gGeoManager->IsOutside()) {
41 gGeoManager->PushPoint();
42 string name = string(gGeoManager->GetCurrentNode()->GetName());
43 Double_t
x = gGeoManager->GetCurrentPoint()[0];
44 Double_t
y = gGeoManager->GetCurrentPoint()[1];
45 Double_t z = gGeoManager->GetCurrentPoint()[2];
48 std::size_t found = name.find(volumeName);
49 if (found != std::string::npos) {
51 crossPoint.SetXYZ(
x,
y, z);
52 gGeoManager->PopPoint();
53 navi = gGeoManager->GetCurrentNavigator();
59 gGeoManager->FindNextBoundaryAndStep(step);
60 if (gGeoManager->IsOutside()) {
62 gGeoManager->PopDummy();
66 if (std::isnan(gGeoManager->GetCurrentPoint()[0]) || std::isnan(gGeoManager->GetCurrentPoint()[1])
67 || std::isnan(gGeoManager->GetCurrentPoint()[2])) {
69 gGeoManager->PopDummy();
73 gGeoManager->PopDummy();
80 static void GetDirCos(
const FairTrackParam* par, Double_t& nx, Double_t& ny, Double_t& nz)
82 Double_t p = (std::abs(par->GetQp()) != 0.) ? 1. / std::abs(par->GetQp()) : 1.e20;
83 Double_t pz = std::sqrt(p * p / (par->GetTx() * par->GetTx() + par->GetTy() * par->GetTy() + 1));
84 Double_t px = par->GetTx() * pz;
85 Double_t py = par->GetTy() * pz;
86 TVector3 unit = TVector3(px, py, pz).Unit();