83 {
84 if (verboseLevel >= 10) {
85 G4cout << "MuonWallSD::ProcessHits" << G4endl;
86 }
87
88 const G4TouchableHistory* theTouchable = static_cast<const G4TouchableHistory*>(aStep->GetPreStepPoint()->GetTouchable());
89 const G4VPhysicalVolume* physVol = theTouchable->GetVolume();
90 const G4LogicalVolume* logiVol = physVol->GetLogicalVolume();
91 const G4String nameLogiVol = logiVol->GetName();
92 const G4int nScinti = physVol->GetCopyNo();
93
94 const G4double edep = aStep->GetTotalEnergyDeposit() * aStep->GetTrack()->GetWeight();
95 G4double stepl = 0.;
96
97 if (aStep->GetTrack()->GetDefinition()->GetPDGCharge() != 0.){
98
99 stepl = aStep->GetStepLength();
100 }
101
102 if ((edep == 0.) && (stepl == 0.)) {
103
104 return false;
105 }
106
107 int ind;
108
109 if(nameLogiVol.find("MuScintillatorLayer") !=G4String::npos) {
110
111 ind = nScinti-1;
112 } else if(nameLogiVol.find("S1") !=G4String::npos) {
114 } else if(nameLogiVol.find("S2") !=G4String::npos) {
116 } else if(nameLogiVol.find("S3") !=G4String::npos) {
118 } else {
120 }
121
122 if (verboseLevel >= 10) {
123 G4cout << ((
m_nhits[ind] > 0)?
"Additional hit in ":
"First hit in ")
124 << ((ind<
s_nCellMu)?
"MuonWall ":
"beam counter S")
126 << " time=" << aStep->GetPostStepPoint()->GetGlobalTime()
127 << " ene=" << edep << G4endl;
128 }
129
131 m_hit[ind]->add(edep,0.0,0.0);
132 } else {
133
134 m_hit[ind] =
new TileSimHit(
m_id[ind],edep,0.0,0.0);
135 }
136
138
139 return true;
140}