54 G4Track* track = step->GetTrack();
55 G4int stepNumber = track->GetCurrentStepNumber();
57 if (stepNumber == 1) {
59 Int_t trackNumber = gMC->GetStack()->GetCurrentTrackNumber();
60 Int_t parentTrackNumber = gMC->GetStack()->GetCurrentParentTrackNumber();
61 Int_t pdg = gMC->TrackPid();
62 if (parentTrackNumber >= 0) {
65 TString text =
"No parent track with id=";
66 text += parentTrackNumber;
73 G4cout <<
"New TGeo track with id=" << trackNumber <<
" pdg=" << pdg
74 <<
" parent=" << parentTrackNumber << G4endl;
78 Int_t itrack = gGeoManager->AddTrack(trackNumber, pdg);
79 gGeoManager->SetCurrentTrack(itrack);
82 G4cout <<
"New primary TGeo track with id=" << trackNumber
83 <<
" pdg=" << pdg << G4endl;
86 TParticlePDG* particle = TDatabasePDG::Instance()->GetParticle(pdg);
95 gMC->TrackPosition(x, y, z);
96 Bool_t skipPoint = kFALSE;
98 Double_t xo, yo, zo, to;
100 Double_t rdist = TMath::Sqrt(
101 (xo - x) * (xo - x) + (yo - y) * (yo - y) + (zo - z) * (zo - z));
104 if (skipPoint)
return;
107 G4double time = gMC->TrackTime();
110 G4cout <<
"Added point (x,y,z,t)=" << x <<
", " << y <<
", " << z <<
", "