43 collectionName.insert(
"BesMucHitsCollection");
44 collectionName.insert(
"BesMucHitsList");
45 HitID =
new G4int[500];
49 G4String GeometryPath2 = GeometryPath;
51 G4cout<<
"BOOST environment not set!"<<G4endl; exit(-1);
53 GeometryPath +=
"/dat/muc-effi.dat";
54 GeometryPath2 +=
"/dat/muc-noise.dat";
60 ISvcLocator* svcLocator = Gaudi::svcLocator();
62 StatusCode sc=svcLocator->service(
"G4Svc", iG4Svc);
63 m_G4Svc =
dynamic_cast<G4Svc *
>(iG4Svc);
65 G4cout <<
"MucNoiseMode:\t"<<m_noiseMode<<G4endl;
67 if( m_noiseMode != 0 )
70 G4LogicalVolume* logicalMuc = detector->
GetPhysicalMuc()->GetLogicalVolume();
75 m_PreviousPrimaryTrackG4Id = 0;
119 G4Track *curTrack = aStep->GetTrack();
121 m_CurEvent = G4EventManager::GetEventManager()->GetConstCurrentEvent();
124 m_TrackCon = m_CurEvent->GetTrajectoryContainer();
136 if (curTrack->GetDefinition()->GetPDGCharge() == 0.)
return false;
138 G4double edep = aStep->GetTotalEnergyDeposit();
142 G4int trackIndex = -99, g4TrackId = -99;
145 G4TouchableHistory* theTouchable
146 = (G4TouchableHistory*)(aStep->GetPreStepPoint()->GetTouchable());
150 G4int trackID = curTrack->GetTrackID();
151 G4int parentID = curTrack->GetParentID();
155 G4int pdg = curTrack->GetDefinition()->GetPDGEncoding();
160 G4ThreeVector pos = 0.5*( aStep->GetPostStepPoint()->GetPosition()
161 + aStep->GetPreStepPoint()->GetPosition() );
164 G4ThreeVector posInGas = theTouchable->GetHistory()->GetTopTransform().TransformPoint(pos);
165 G4int stackDepth = theTouchable->GetHistory()->GetDepth();
166 G4ThreeVector posInBox = theTouchable->GetHistory()->GetTransform(stackDepth-1).TransformPoint(pos);
169 G4ThreeVector posInGap = theTouchable->GetHistory()->GetTransform(stackDepth-2).TransformPoint(pos);
174 G4double
energy = aStep->GetPreStepPoint()->GetKineticEnergy();
177 G4ThreeVector dir = aStep->GetPreStepPoint()->GetMomentumDirection();
180 G4ThreeVector
momentum = aStep->GetPreStepPoint()->GetMomentum();
183 G4double GlobalTime = aStep->GetPostStepPoint()->GetGlobalTime();
186 G4VPhysicalVolume* vl = theTouchable->GetVolume(0);
194 m_PreviousPrimaryTrackG4Id = g4TrackId;
210 G4int newTrackFlag = 0;
212 if(m_trackIndex != trackIndex) {
213 m_trackIndex = trackIndex;
214 G4int size = m_trackIndexes.size();
217 for(G4int i=0;i<size;i++)
218 if(m_trackIndexes[i] == trackIndex ) {
226 m_trackIndexes.push_back(trackIndex);
234 if (g4TrackId != trackID) {
243 G4int curPart, curSeg, curGap, curStrip;
255 if (curPart == m_prePart && curSeg == m_preSeg &&
256 curGap == m_preGap && curStrip == m_preStrip) {
258 delete truHit;
delete newHit;
269 bool truHitExist =
false;
270 G4int n_hit = MucHitList->entries();
271 for(G4int iTru=0;iTru<n_hit;iTru++) {
272 BesMucHit* aTruHit = (*MucHitList)[iTru];
283 G4float random=G4UniformRand();
286 if (random<=need_eff){ MucHitCollection->insert(newHit);}
288 if (!truHitExist&&random<=need_eff)
289 { MucHitList->insert(truHit);}
294 m_preStrip = curStrip;