57 {
58
59 if (aStep->GetPreStepPoint()->GetStepStatus() == fUndefined)
61
62
64
65
66 if (aStep->GetTrack()->GetDefinition() != G4MuonPlus::Definition() &&
67 aStep->GetTrack()->GetDefinition() != G4MuonMinus::Definition() &&
68 ( aStep->GetPostStepPoint()->GetPosition().rho() >
m_idR ||
69 aStep->GetPostStepPoint()->GetPosition().z() >
m_idZ ||
70 aStep->GetPostStepPoint()->GetPosition().z() < -
m_idZ ) ){
71
72 return;
73 }
74
75
76 if (aStep->GetTrack()->GetMomentum().mag() <
m_config.pMinPrimary)
return;
77
78
79
80
81 if ( aStep->GetTrack()->GetMomentum().x() * aStep->GetPostStepPoint()->GetPosition().x() +
82 aStep->GetTrack()->GetMomentum().y() * aStep->GetPostStepPoint()->GetPosition().y() < 0) return;
83
84
86
87
88
89 G4StepPoint* preStep = aStep->GetPreStepPoint();
90 G4StepPoint* postStep = aStep->GetPostStepPoint();
91 G4StepPoint* theStep = preStep;
92 if ( fabs( preStep->GetMomentumDirection().x() * preStep->GetPosition().x() +
93 preStep->GetMomentumDirection().y() * preStep->GetPosition().y() ) >
94 fabs( postStep->GetMomentumDirection().x() * postStep->GetPosition().x() +
95 postStep->GetMomentumDirection().y() * postStep->GetPosition().y() ) )
96 {
97
98 theStep = postStep;
99 }
100
101
102
103 int pdgcode = aStep->GetTrack()->GetDefinition()->GetPDGEncoding();
104 double ener = theStep->GetTotalEnergy();
105 G4ThreeVector
pos = theStep->GetPosition();
106 G4ThreeVector
mom = theStep->GetMomentum();
107 double time = theStep->GetGlobalTime();
108 G4VPhysicalVolume *preVol = theStep->GetPhysicalVolume();
109
110 if (aStep->GetTrack()->GetDefinition() == G4Geantino::Definition() ) pdgcode=999;
111 if (aStep->GetTrack()->GetDefinition() == G4ChargedGeantino::Definition() ) pdgcode=998;
112
113
114 TrackHelper trHelp(aStep->GetTrack());
115 const int barcode = trHelp.GetBarcode();
116 const int id = trHelp.GetUniqueID();
117 const int status = trHelp.GetStatus();
119 pdgcode,
120 status,
121 ener,
122 mom,
123 pos,
124 time,
125 barcode,
126 id,
127 preVol->GetName());
128 }
time(flags, cells_name, *args, **kw)