116 {
117 G4Track* curTrack = aStep->GetTrack();
118
119 m_CurEvent = G4EventManager::GetEventManager()->GetConstCurrentEvent();
120
121 if ( m_CurEvent )
122 {
123 m_TrackCon = m_CurEvent->GetTrajectoryContainer();
124
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
148 BesMucHit* newHit = new BesMucHit();
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 =
167 theTouchable->GetHistory()->GetTransform( stackDepth - 1 ).TransformPoint( pos );
169
170 G4ThreeVector posInGap =
171 theTouchable->GetHistory()->GetTransform( stackDepth - 2 ).TransformPoint( pos );
172
173
174
175
176 G4double
energy = aStep->GetPreStepPoint()->GetKineticEnergy();
178
179 G4ThreeVector dir = aStep->GetPreStepPoint()->GetMomentumDirection();
181
182 G4ThreeVector
momentum = aStep->GetPreStepPoint()->GetMomentum();
184
185 G4double GlobalTime = aStep->GetPostStepPoint()->GetGlobalTime();
187
188 G4VPhysicalVolume* vl = theTouchable->GetVolume( 0 );
190
191
192
193
194
196
197
198 m_PreviousPrimaryTrackG4Id = g4TrackId;
199
200
201
202
203 if ( MucHitList )
204 {
205
206
207
208
209
210
211
212
213
214
215
216 G4int newTrackFlag = 0;
218 if ( m_trackIndex != trackIndex )
219 {
220 m_trackIndex = trackIndex;
221 G4int size = m_trackIndexes.size();
222 newTrackFlag = 1;
223 if ( size > 0 )
224 {
225 for ( G4int i = 0; i < size; i++ )
226 if ( m_trackIndexes[i] == trackIndex )
227 {
228 newTrackFlag = 0;
229 break;
230 }
231 }
232 }
233
234 if ( newTrackFlag )
235 {
236 m_trackIndexes.push_back( trackIndex );
237 m_prePart = -99;
238 m_preSeg = -99;
239 m_preGap = -99;
240 m_preStrip = -99;
241 }
242 BesMucHit* truHit = new BesMucHit();
243 *truHit = *newHit;
244 if ( g4TrackId != trackID )
245 {
246
247 trackIndex += 0;
249 }
250
251
252 BesMucDigit aDigit;
254 G4int curPart, curSeg, curGap, curStrip;
259
260 m_effi->CheckCalibSvc();
261 m_effi->SetHit( truHit );
262 G4double need_eff = m_effi->GetEfficiency();
263
264
265
266 if ( curPart == m_prePart && curSeg == m_preSeg && curGap == m_preGap &&
267 curStrip == m_preStrip )
268 {
269
270
271
272
273
274 delete truHit;
275 delete newHit;
276 }
277 else
278 {
279
280
281
286
287
288
289
290 bool truHitExist = false;
291 G4int n_hit = MucHitList->entries();
292 for ( G4int iTru = 0; iTru < n_hit; iTru++ )
293 {
294 BesMucHit* aTruHit = ( *MucHitList )[iTru];
299 {
300 truHitExist = true;
301 break;
302 }
303 }
304 G4float random = G4UniformRand();
305
306
307 if ( random <= need_eff ) { MucHitCollection->insert( newHit ); }
308 else delete newHit;
309 if ( !truHitExist && random <= need_eff ) { MucHitList->insert( truHit ); }
310 else delete truHit;
311 m_prePart = curPart;
312 m_preSeg = curSeg;
313 m_preGap = curGap;
314 m_preStrip = curStrip;
315 }
316
317 }
318
319 return true;
320}
**********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_KeyIHVP 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 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