120 {
121
122
123
124
125
126
127
128 const int sensorCopyNo = myTouch->GetVolume()->GetCopyNo();
129
130 if (verboseLevel>5){
131 for (
int i=0;
i<myTouch->GetHistoryDepth();
i++){
132 std::string detname=myTouch->GetVolume(i)->GetLogicalVolume()->GetName();
133 int copyno=myTouch->GetVolume(i)->GetCopyNo();
134 G4cout << "Volume "<<detname << " Copy Nr. " << copyno << G4endl;
135 }
136 }
137
138
139
140 if(sensorCopyNo/1000) {
141
142 if(sensorCopyNo == 1000) {
143 side = myTouch->GetVolume(1)->GetCopyNo();
144 etaMod = myTouch->GetVolume(2)->GetCopyNo();
145 phiMod = myTouch->GetVolume(3)->GetCopyNo();
146 layerDisk = myTouch->GetVolume(5)->GetCopyNo();
147 } else if(sensorCopyNo == 1100) {
148
149 int etaModTmp = myTouch->GetVolume(1)->GetCopyNo();
150 int sign = (etaModTmp>=0)? +1 : -1;
151 side = std::abs(etaModTmp)%2;
153 phiMod = myTouch->GetVolume(2)->GetCopyNo();
154 layerDisk = myTouch->GetVolume(4)->GetCopyNo();
155 } else if(sensorCopyNo/100 == 12) {
156
157 int iSegment = sensorCopyNo%100;
158 int sensorEnvCopyNo = myTouch->GetVolume(1)->GetCopyNo();
159 if (sensorEnvCopyNo == 1000) {
160 side = myTouch->GetVolume(2)->GetCopyNo();
161 etaMod = myTouch->GetVolume(3)->GetCopyNo() + iSegment;
162 phiMod = myTouch->GetVolume(4)->GetCopyNo();
163 layerDisk = myTouch->GetVolume(6)->GetCopyNo();
164 } else if (sensorEnvCopyNo == 1100) {
165
166 int etaModTmp = myTouch->GetVolume(2)->GetCopyNo();
167 int sign = (etaModTmp>=0)? +1 : -1;
168 side = std::abs(etaModTmp)%2;
169 etaMod =
sign * std::abs(etaModTmp)/2 + iSegment;
170 phiMod = myTouch->GetVolume(3)->GetCopyNo();
171 layerDisk = myTouch->GetVolume(5)->GetCopyNo();
172 } else {
174 description <<
"ProcessHits: Unrecognized geometry in SCT sensitive detector. Please contact the maintainer of the SCT Detector Description.";
175 G4Exception(
"SctSensorSD",
"UnrecognizedSCTGeometry1", FatalException,
description);
176 abort();
177 }
178 } else {
180 description <<
"ProcessHits: Unrecognized geometry in SCT sensitive detector. Please contact the maintainer of the SCT Detector Description.";
181 G4Exception(
"SctSensorSD",
"UnrecognizedSCTGeometry2", FatalException,
description);
182 abort();
183 }
184 if (verboseLevel>5){
185 G4cout << "In the SCT Barrel" << G4endl;
186 G4cout <<
"----- side : " <<
side << G4endl;
187 G4cout <<
"----- eta_module : " <<
etaMod << G4endl;
188 G4cout << "----- phi_module : " << phiMod << G4endl;
189 G4cout << "----- layer : " << layerDisk << G4endl;
190 G4cout << "----- barrel_ec : " << brlEcap<< G4endl;
191 }
192 } else {
193
194
195
196
197 int sensorCopyNoTest = sensorCopyNo/100;
198 if(sensorCopyNoTest == 5 || sensorCopyNoTest == 6) {
199 int signZ = (coord1z > 0) ? 1 : -1;
200 brlEcap = 2 * signZ;
201 side = myTouch->GetVolume(0)->GetCopyNo() % 2;
202 if (sensorCopyNoTest == 5) {
203 etaMod = myTouch->GetVolume(3)->GetCopyNo();
204 layerDisk = myTouch->GetVolume(4)->GetCopyNo();
205 } else {
206 etaMod = myTouch->GetVolume(2)->GetCopyNo();
207 layerDisk = myTouch->GetVolume(3)->GetCopyNo();
208 }
209 int phiNumber = myTouch->GetVolume(1)->GetCopyNo();
210
211
212 int maxModules = (phiNumber & 0x00ff0000) >> 16;
213 int moduleZero = (phiNumber & 0xff000000) >> 24;
214 phiMod = phiNumber & 0x0000ffff;
215
216
217
218 if (maxModules && signZ < 0) phiMod = (maxModules + moduleZero - phiMod) % maxModules;
219
220
221 if (verboseLevel>5){
222 G4cout << "In the SCT EndCap" << G4endl;
223 G4cout <<
"----- side : " <<
side << G4endl;
224 G4cout << "----- phi_module : " << phiMod<< G4endl;
225 G4cout <<
"----- eta_module : " <<
etaMod << G4endl;
226 G4cout << "----- layerDisk : " << layerDisk << G4endl;
227 G4cout << "----- barrel_ec : " << brlEcap << G4endl;
228 }
229 } else {
230
232 description <<
"ProcessHits: Unrecognized geometry in SCT sensitive detector. Please contact the maintainer of the SCT Detector Description.";
233 G4Exception(
"SctSensorSD",
"UnrecognizedSCTGeometry3", FatalException,
description);
234 abort();
235 }
236 }
237 return;
238}
std::string description
glabal timer - how long have I taken so far?