118{
119 G4Track *curTrack = aStep->GetTrack();
120
121 m_CurEvent = G4EventManager::GetEventManager()->GetConstCurrentEvent();
122
123 if (m_CurEvent) {
124 m_TrackCon = m_CurEvent->GetTrajectoryContainer();
125
126
127
128
129
130
131
132
133 }
134
135
136 if (curTrack->GetDefinition()->GetPDGCharge() == 0.) return false;
137
138 G4double edep = aStep->GetTotalEnergyDeposit();
139
140
141
142 G4int trackIndex = -99, g4TrackId = -99;
144
145 G4TouchableHistory* theTouchable
146 = (G4TouchableHistory*)(aStep->GetPreStepPoint()->GetTouchable());
147
149
150 G4int trackID = curTrack->GetTrackID();
151 G4int parentID = curTrack->GetParentID();
154
155 G4int pdg = curTrack->GetDefinition()->GetPDGEncoding();
157
159
160 G4ThreeVector pos = 0.5*( aStep->GetPostStepPoint()->GetPosition()
161 + aStep->GetPreStepPoint()->GetPosition() );
163
164 G4ThreeVector posInGas = theTouchable->GetHistory()->GetTopTransform().TransformPoint(pos);
165 G4int stackDepth = theTouchable->GetHistory()->GetDepth();
166 G4ThreeVector posInBox = theTouchable->GetHistory()->GetTransform(stackDepth-1).TransformPoint(pos);
168
169 G4ThreeVector posInGap = theTouchable->GetHistory()->GetTransform(stackDepth-2).TransformPoint(pos);
170
171
172
173
174 G4double
energy = aStep->GetPreStepPoint()->GetKineticEnergy();
176
177 G4ThreeVector dir = aStep->GetPreStepPoint()->GetMomentumDirection();
179
180 G4ThreeVector
momentum = aStep->GetPreStepPoint()->GetMomentum();
182
183 G4double GlobalTime = aStep->GetPostStepPoint()->GetGlobalTime();
185
186 G4VPhysicalVolume* vl = theTouchable->GetVolume(0);
188
189
190
192
193
194 m_PreviousPrimaryTrackG4Id = g4TrackId;
195
196
197
198
199 if (MucHitList) {
200
201
202
203
204
205
206
207
208
209
210 G4int newTrackFlag = 0;
212 if(m_trackIndex != trackIndex) {
213 m_trackIndex = trackIndex;
214 G4int size = m_trackIndexes.size();
215 newTrackFlag = 1;
216 if (size > 0) {
217 for(G4int i=0;i<size;i++)
218 if(m_trackIndexes[i] == trackIndex ) {
219 newTrackFlag = 0;
220 break;
221 }
222 }
223 }
224
225 if (newTrackFlag) {
226 m_trackIndexes.push_back(trackIndex);
227 m_prePart = -99;
228 m_preSeg = -99;
229 m_preGap = -99;
230 m_preStrip = -99;
231 }
233 *truHit = *newHit;
234 if (g4TrackId != trackID) {
235
236 trackIndex += 0;
238 }
239
240
243 G4int curPart, curSeg, curGap, curStrip;
248
252
253
254
255 if (curPart == m_prePart && curSeg == m_preSeg &&
256 curGap == m_preGap && curStrip == m_preStrip) {
257
258 delete truHit;delete newHit;
259 }
260 else {
261
266
267
268
269 bool truHitExist = false;
270 G4int n_hit = MucHitList->entries();
271 for(G4int iTru=0;iTru<n_hit;iTru++) {
272 BesMucHit* aTruHit = (*MucHitList)[iTru];
278 {
279 truHitExist = true;
280 break;
281 }
282 }
283 G4float random=G4UniformRand();
284
285
286 if (random<=need_eff){ MucHitCollection->insert(newHit);}
287 else delete newHit;
288 if (!truHitExist&&random<=need_eff)
289 { MucHitList->insert(truHit);}
290 else delete truHit;
291 m_prePart = curPart;
292 m_preSeg = curSeg;
293 m_preGap = curGap;
294 m_preStrip = curStrip;
295 }
296
297 }
298
299 return true;
300 }
**********INTEGER nmxhep !maximum number of particles DOUBLE PRECISION vhep INTEGER jdahep COMMON hepevt $ !serial number $ !number of particles $ !status code $ !particle ident KF $ !parent particles $ !childreen particles $ !four momentum
************Class m_ypar INTEGER m_KeyWgt INTEGER m_nphot INTEGER m_KeyGPS INTEGER m_IsBeamPolarized INTEGER m_EvtGenInterface DOUBLE PRECISION m_Emin DOUBLE PRECISION m_sphot DOUBLE PRECISION m_Xenph DOUBLE PRECISION m_q2 DOUBLE PRECISION m_PolBeam2 DOUBLE PRECISION m_xErrPb *COMMON c_KK2f $ !CMS energy average $ !Spin Polarization vector first beam $ !Spin Polarization vector second beam $ !Beam energy spread[GeV] $ !minimum hadronization energy[GeV] $ !input READ never touch them !$ !debug facility $ !maximum weight $ !inverse alfaQED $ !minimum real photon energy
G4int GetNearestStripNo()
void SetHit(BesMucHit *hit)
void SetHit(BesMucHit *hit)
void SetPos(G4ThreeVector xyz)
void SetPosLocal(G4ThreeVector xyzLocal)
void SetVolume(G4VPhysicalVolume *pv)
void SetDir(G4ThreeVector dir)
void SetPDGCode(G4int pdg)
void SetEnergy(G4double energy)
void SetTrackID(G4int track)
void SetEdep(G4double de)
void SetStrip(G4int strip)
void SetMomentum(G4ThreeVector momentum)
void SetTrackIndex(G4int index)
void GetCurrentTrackIndex(G4int &trackIndex, G4int &g4TrackId) const