36{
38 const G4StepPoint *preStep=aStep->GetPreStepPoint();
39 const G4VPhysicalVolume *preVol=preStep->GetPhysicalVolume();
40 const G4StepPoint *postStep=aStep->GetPostStepPoint();
41 const G4VPhysicalVolume *postVol=postStep->GetPhysicalVolume();
42
43 if (preVol==postVol) { return false; }
44
45 const G4Track *
track(aStep->GetTrack());
46
47
48 int pdgcode = (
track->GetDefinition())?
track->GetDefinition()->GetPDGEncoding():0;
49 if (
track->GetDefinition() == G4Geantino::Definition() ) pdgcode=999;
50 if (
track->GetDefinition() == G4ChargedGeantino::Definition() ) pdgcode=998;
51
52
53 G4ThreeVector
pos=postStep->GetPosition();
54 G4ThreeVector
mom=postStep->GetMomentum();
55
57 {
58
59 const G4TouchableHistory* touchHist = static_cast<const G4TouchableHistory*>(preStep->GetTouchable());
60 const G4AffineTransform trans =
track->GetTouchable()->GetHistory()->GetTopTransform();
61 G4ThreeVector localPos=trans.TransformPoint(pos);
62 G4ThreeVector localMom=
mom;
63 trans.ApplyAxisTransform(localMom);
64 const G4VSolid *shape= touchHist->GetSolid();
65 const G4ThreeVector normal=shape->SurfaceNormal(localPos);
66
67 if(normal.dot(localPos)>=0.) return false;
68 }
69
70
71 const double ener=postStep->GetTotalEnergy();
72
73
74 const double time=postStep->GetGlobalTime();
75
76
77 TrackHelper trHelp(track);
78 const int barcode = trHelp.GetBarcode();
79 const int id = trHelp.GetUniqueID();
80 const int status = trHelp.GetStatus();
81
82
84 pdgcode,
85 status,
86 ener,
87 mom,
88 pos,
89 time,
90 barcode,
91 id,
92 preVol->GetName());
93
94 return true;
95}
time(flags, cells_name, *args, **kw)