If you are using the standard ASCII input for the geometry just copy this and use it for your detector, otherwise you can implement here you own way of constructing the geometry.
145 {
150 TGeoVolume*
top = gGeoManager->GetTopVolume();
151 TGeoVolume* tSplitCal = new TGeoVolumeAssembly("SplitCalDetector");
152
158
159 TGeoMedium* A2 = gGeoManager->GetMedium("iron");
160 TGeoMedium* A3 = gGeoManager->GetMedium("lead");
161 TGeoMedium* A4 = gGeoManager->GetMedium("GEMmixture");
162 TGeoMedium* A1 = gGeoManager->GetMedium("Scintillator");
163
164 Double_t zStartSplitCal =
fZStart;
165
166 TGeoVolume* newECALfilter_first;
167 TGeoVolume* newECALfilter;
168 TGeoVolume* newECALdet_gas;
169 TGeoVolume* stripGivingX;
170 TGeoVolume* stripGivingY;
171
172 TGeoVolume* newHCALfilter[100];
173 TGeoVolume* newHCALdet[100];
174 const char* char_labelHCALfilter[100];
175 TString labelHCALfilter;
176 const char* char_labelHCALdet[100];
177 TString labelHCALdet;
178
179 Double_t z_splitcal = 0;
180
181
182
183 newECALfilter_first = gGeoManager->MakeBox(
185 newECALfilter_first->SetLineColor(kGray);
186 newECALfilter = gGeoManager->MakeBox(
"ECALfilter", A3,
fXMax,
fYMax,
188 newECALfilter->SetLineColor(kGray);
189
190 stripGivingX =
193 stripGivingX->SetVisibility(kTRUE);
194 AddSensitiveVolume(stripGivingX);
195 stripGivingX->SetLineColor(kGreen);
196
197 stripGivingY =
200 stripGivingY->SetVisibility(kTRUE);
201 AddSensitiveVolume(stripGivingY);
202 stripGivingY->SetLineColor(kGreen);
203
204
205 newECALdet_gas = gGeoManager->MakeBox(
"ECALdet_gas", A4,
fXMax,
fYMax,
207 AddSensitiveVolume(newECALdet_gas);
208 newECALdet_gas->SetLineColor(kRed);
209
210
211 for (Int_t i_nlayECAL = 0; i_nlayECAL <
fnECALSamplings; i_nlayECAL++) {
212
213
214 if (i_nlayECAL == 0) {
216 tSplitCal->AddNode(newECALfilter_first, i_nlayECAL * 1e5,
217 new TGeoTranslation(0, 0, z_splitcal));
219 } else {
221 tSplitCal->AddNode(newECALfilter, i_nlayECAL * 1e5,
222 new TGeoTranslation(0, 0, z_splitcal));
224 }
225
226 if (i_nlayECAL == 0)
228
229 if (i_nlayECAL == 7) z_splitcal +=
fBigGap;
230
231
236
237 tSplitCal->AddNode(newECALdet_gas, 1e8 + (i_nlayECAL + 1) * 1e5,
238 new TGeoTranslation(0, 0, z_splitcal));
243 tSplitCal->AddNode(newECALdet_gas, 1e8 + (i_nlayECAL + 1) * 1e5,
244 new TGeoTranslation(0, 0, z_splitcal));
246 }
247 } else {
248
250 if (i_nlayECAL % 2 == 0) {
251
255 int index = (i_nlayECAL + 1) * 1e5 + (mx + 1) * 1e4 +
256 (my + 1) * 1e3 + j + 1;
257 double xCoordinate =
260 2;
261
262 double yCoordinate =
264 2;
265
266 tSplitCal->AddNode(
267 stripGivingX, index,
268 new TGeoTranslation(xCoordinate, yCoordinate, z_splitcal));
269
270 }
271 }
272 }
273 }
274 else {
275
279 int index = (i_nlayECAL + 1) * 1e5 + (mx + 1) * 1e4 +
280 (my + 1) * 1e3 + j + 1;
281 double xCoordinate =
283 2;
284
285 double yCoordinate =
288 2;
289
290 tSplitCal->AddNode(
291 stripGivingY, index,
292 new TGeoTranslation(xCoordinate, yCoordinate, z_splitcal));
293
294 }
295 }
296 }
297 }
298
300 }
301
302 }
303
304 for (Int_t i_nlayHCAL = 0; i_nlayHCAL < 1; i_nlayHCAL++) {
305 labelHCALfilter = "HCALfilter_";
306 labelHCALfilter += i_nlayHCAL;
307 char_labelHCALfilter[i_nlayHCAL] = labelHCALfilter;
308 labelHCALdet = "HCAL_det";
309 labelHCALdet += i_nlayHCAL;
310 char_labelHCALdet[i_nlayHCAL] = labelHCALdet;
311 newHCALfilter[i_nlayHCAL] =
312 gGeoManager->MakeBox(char_labelHCALfilter[i_nlayHCAL], A2,
fXMax,
fYMax,
315 newHCALdet[i_nlayHCAL] =
316 gGeoManager->MakeBox(char_labelHCALdet[i_nlayHCAL], A4,
fXMax,
fYMax,
318
319 AddSensitiveVolume(newHCALdet[i_nlayHCAL]);
320
321 newHCALdet[i_nlayHCAL]->SetLineColor(kRed);
322 }
323 newHCALfilter[i_nlayHCAL]->SetLineColor(kBlue);
324 }
325 for (Int_t i_nlayHCAL = 0; i_nlayHCAL <
fnHCALSamplings; i_nlayHCAL++) {
327 tSplitCal->AddNode(newHCALfilter[i_nlayHCAL], 1,
328 new TGeoTranslation(0, 0, z_splitcal));
330
333 tSplitCal->AddNode(newHCALdet[i_nlayHCAL], 1,
334 new TGeoTranslation(0, 0, z_splitcal));
336 }
337
338
339 TGeoShapeAssembly* asmb =
340 dynamic_cast<TGeoShapeAssembly*>(tSplitCal->GetShape());
341 Double_t totLength = asmb->GetDZ();
342 top->AddNode(tSplitCal, 1,
343 new TGeoTranslation(0, 0, zStartSplitCal + totLength));
344}
Double_t fFilterHCALThickness
Double_t fnum_precision_layers
Double_t fActiveHCALThickness
Double_t fFilterECALThickness_first
Double_t fActiveECALThickness
Double_t fthird_precision_layer
Double_t fActiveECAL_gas_gap
Double_t fActiveECAL_gas_Thickness
Double_t fStripHalfLength
Double_t fsecond_precision_layer
Double_t ffirst_precision_layer
Double_t fFilterECALThickness
Int_t InitMedium(const char *name)