19 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)
34 gGeoManager->InitTrack(
pos.X(),
pos.Y(),
pos.Z(), dirCos.X(), dirCos.Y(), dirCos.Z());
36 if (gGeoManager->IsOutside()) {
return string(
""); }
39 gGeoManager->PushPoint();
40 string name = string(gGeoManager->GetCurrentNode()->GetName());
41 string fullPath = string(gGeoManager->GetPath());
42 Double_t
x = gGeoManager->GetCurrentPoint()[0];
43 Double_t
y = gGeoManager->GetCurrentPoint()[1];
44 Double_t z = gGeoManager->GetCurrentPoint()[2];
47 std::size_t found = name.find(volumeName);
48 if (found != std::string::npos) {
50 crossPoint.SetXYZ(
x,
y, z);
51 gGeoManager->PopPoint();
57 gGeoManager->FindNextBoundaryAndStep(step);
58 if (gGeoManager->IsOutside()) {
60 gGeoManager->PopDummy();
64 if (std::isnan(gGeoManager->GetCurrentPoint()[0]) || std::isnan(gGeoManager->GetCurrentPoint()[1])
65 || std::isnan(gGeoManager->GetCurrentPoint()[2])) {
67 gGeoManager->PopDummy();
71 gGeoManager->PopDummy();
78 static void GetDirCos(
const FairTrackParam* par, Double_t& nx, Double_t& ny, Double_t& nz)
80 Double_t p = (std::abs(par->GetQp()) != 0.) ? 1. / std::abs(par->GetQp()) : 1.e20;
81 Double_t pz = std::sqrt(p * p / (par->GetTx() * par->GetTx() + par->GetTy() * par->GetTy() + 1));
82 Double_t px = par->GetTx() * pz;
83 Double_t py = par->GetTy() * pz;
84 TVector3 unit = TVector3(px, py, pz).Unit();