61 {
62
64
65 G4String symbol;
66 G4double a, z;
67 G4double density;
68 G4int ncomponents;
69
70 G4Element* H = new G4Element("Hydrogen", symbol = "H", z = 1., a = 1.00794 * CLHEP::g / CLHEP::mole);
71 G4Element* He = new G4Element("Helium", symbol = "He", z = 2., a = 4.002602 * CLHEP::g / CLHEP::mole);
72 G4Element* C = new G4Element("Carbon", symbol = "C", z = 6., a = 12.01 * CLHEP::g / CLHEP::mole);
73 G4Element* O = new G4Element("Oxygen", symbol = "O", z = 8., a = 16.00 * CLHEP::g / CLHEP::mole);
74 G4Element* Si = new G4Element("Silicon", symbol = "Si", z = 14., a = 28.09 * CLHEP::g / CLHEP::mole);
75 G4Element* Cl = new G4Element("Chlore", symbol = "Cl", z = 17., a = 35.453 * CLHEP::g / CLHEP::mole);
76 G4Element* Cu = new G4Element("Copper", symbol = "Cu", z = 29., a = 63.546 * CLHEP::g / CLHEP::mole);
77 G4Element* Zn = new G4Element("Zinc", symbol = "Zn", z = 30., a = 65.38 * CLHEP::g / CLHEP::mole);
78
79
80 G4Material* gas_4He = new G4Material("gas_4He", density = 0.0001664 * CLHEP::g / CLHEP::cm3, ncomponents = 1, kStateGas,
81 293.15 * CLHEP::kelvin, 1.*CLHEP::atmosphere);
82 gas_4He->AddElementByNumberOfAtoms(He, 1);
83
84 G4Material* gas_CO2 = new G4Material("gas_CO2", density = 0.001842 * CLHEP::g / CLHEP::cm3, ncomponents = 2, kStateGas,
85 293.15 * CLHEP::kelvin, 1.*CLHEP::atmosphere);
86 gas_CO2->AddElementByNumberOfAtoms(C, 1);
87 gas_CO2->AddElementByNumberOfAtoms(O, 2);
88
89
90 G4Material* gasmix_4HeCO2 = new G4Material("gasmix_4HeCO2", density = 0.00066908 * CLHEP::g / CLHEP::cm3, ncomponents = 2,
91 kStateGas, 293.15 * CLHEP::kelvin, 1.*CLHEP::atmosphere);
92 gasmix_4HeCO2->AddMaterial(gas_4He, 17.409 * CLHEP::perCent);
93 gasmix_4HeCO2->AddMaterial(gas_CO2, 82.591 * CLHEP::perCent);
94
95
96 G4Material* TPC_ParylenC = new G4Material("TPC_ParylenC", density = 1.298 * CLHEP::g / CLHEP::cm3, ncomponents = 3);
97 TPC_ParylenC->AddElementByMassFraction(H, 0.050908 * CLHEP::perCent);
98 TPC_ParylenC->AddElementByMassFraction(C, 0.693276 * CLHEP::perCent);
99 TPC_ParylenC->AddElementByMassFraction(Cl, 0.255816 * CLHEP::perCent);
100
101
102 G4Material* TPC_G10 = new G4Material("TPC_G10", density = 1.700 * CLHEP::g / CLHEP::cm3, ncomponents = 4);
103 TPC_G10->AddElementByNumberOfAtoms(Si, 1);
104 TPC_G10->AddElementByNumberOfAtoms(O, 2);
105 TPC_G10->AddElementByNumberOfAtoms(C, 3);
106 TPC_G10->AddElementByNumberOfAtoms(H, 3);
107
108
109 G4Material* metalCu = new G4Material("MetalCopper", density = 8.960 * CLHEP::g / CLHEP::cm3, ncomponents = 1);
110 metalCu->AddElement(Cu, 1);
111
112
113 G4Material* TPC_metaCuScreen = new G4Material("TPC_metaCuScreen", density = 8.95 * CLHEP::g / CLHEP::cm3, ncomponents = 2);
114 TPC_metaCuScreen->AddElementByMassFraction(Cu, 90.*CLHEP::perCent);
115 TPC_metaCuScreen->AddElementByMassFraction(Zn, 10.*CLHEP::perCent);
116
117
118
119 double stepSize = content.getLength("stepSize", 5 * CLHEP::um);
120
121
122
123 vector<double> bar = content.getArray("bar");
124 B2INFO("Contents of bar: ");
125 BOOST_FOREACH(double value, bar) {
126 B2INFO("value: " << value);
127 }
128 int detID = 0;
129
130 BOOST_FOREACH(const GearDir & activeParams, content.getNodes("Active")) {
131
132 G4double inch = 2.54 * CLHEP::cm;
133
134
135 G4double dx_Vessel = activeParams.getLength("dx_Vessel") * CLHEP::cm / 2.;
136 G4double dy_Vessel = activeParams.getLength("dy_Vessel") * CLHEP::cm / 2.;
137 G4double dz_VesselEndCap = 1. / 8. / 2.*inch;
138 G4double dz_Vessel = activeParams.getLength("dz_Vessel") * CLHEP::cm / 2. + dz_VesselEndCap;
139 G4VSolid* s_Vessel = new G4Box("s_Vessel_tmp", dx_Vessel, dy_Vessel, dz_Vessel);
140
141 G4double width = 1. / 8.*inch;
142 G4double dx_iGasTPC = (dx_Vessel - width);
143 G4double dy_iGasTPC = (dy_Vessel - width);
144 G4double dz_iGasTPC = (dz_Vessel);
145
146
147 G4VSolid* s_iGasTPC = new G4Box("s_iGasTPC", dx_iGasTPC, dy_iGasTPC, dz_iGasTPC);
148
149
150 s_Vessel = new G4SubtractionSolid("s_Vessel", s_Vessel, s_iGasTPC, 0, G4ThreeVector(0, 0, 0));
151
153 G4LogicalVolume* l_iGasTPC = new G4LogicalVolume(s_iGasTPC, gasmix_4HeCO2, "l_iGasTPC");
154
155 G4RotationMatrix* rotXx = new G4RotationMatrix();
156 G4double AngleX = activeParams.getAngle("AngleX");
157 G4double AngleZ = activeParams.getAngle("AngleZ");
158 rotXx->rotateX(AngleX);
159 rotXx->rotateZ(AngleZ);
160 G4ThreeVector TPCpos = G4ThreeVector(
161 activeParams.getLength("TPCpos_x") * CLHEP::cm,
162 activeParams.getLength("TPCpos_y") * CLHEP::cm,
163 activeParams.getLength("TPCpos_z") * CLHEP::cm
164 );
165
166 new G4PVPlacement(rotXx, TPCpos, l_Vessel, "p_Vessel", &topVolume, false, 1);
167 new G4PVPlacement(rotXx, TPCpos, l_iGasTPC, "p_iGasTPC", &topVolume, false, 1);
168
169 B2INFO("Micro-TPC-" << detID << " placed at: " << TPCpos << " mm");
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194 G4VisAttributes* orange = new G4VisAttributes(G4Colour(1, 2, 0));
195 orange->SetForceAuxEdgeVisible(true);
196
197 l_Vessel->SetVisAttributes(orange);
198
199 G4double dx_parC1 = dx_iGasTPC;
200 G4double dy_parC1 = dy_iGasTPC;
201 G4double dz_parC1 = dz_iGasTPC;
202 G4double cwidth = 0.001 / 2. * inch;
203 G4double dx_parC2 = dx_parC1 - cwidth;
204 G4double dy_parC2 = dy_parC1 - cwidth;
205 G4double dz_parC2 = dz_parC1 - cwidth;
206 G4Box* s_parC1 = new G4Box("s_parC1", dx_parC1, dy_parC1, dz_parC1);
207 G4Box* s_parC2 = new G4Box("s_parC2", dx_parC2, dy_parC2, dz_parC2);
208 G4VSolid* s_parylenC = new G4SubtractionSolid("s_parylenC", s_parC1, s_parC2, 0, G4ThreeVector(0, 0, 0));
209 G4LogicalVolume* l_parylenC = new G4LogicalVolume(s_parylenC, TPC_ParylenC, "l_parylenC");
210 new G4PVPlacement(0, G4ThreeVector(0 * CLHEP::cm, 0 * CLHEP::cm, 0 * CLHEP::cm), l_parylenC, "p_parylenC", l_iGasTPC, false, 1);
211
212 G4double dx_kap1 = dx_parC2;
213 G4double dy_kap1 = dy_parC2;
214 G4double dz_kap1 = dz_parC2;
215 G4double kwidth = 0.05 / 2. * CLHEP::cm;
216 G4double dx_kap2 = dx_kap1 - kwidth;
217 G4double dy_kap2 = dy_kap1 - kwidth;
218 G4double dz_kap2 = dz_kap1 - kwidth;
219 G4Box* s_kap1 = new G4Box("s_kap1", dx_kap1, dy_kap1, dz_kap1);
220 G4Box* s_kap2 = new G4Box("s_kap2", dx_kap2, dy_kap2, dz_kap2);
221 G4VSolid* s_kapton = new G4SubtractionSolid("s_kapton", s_kap1, s_kap2, 0, G4ThreeVector(0, 0, 0));
223 new G4PVPlacement(0, G4ThreeVector(0 * CLHEP::cm, 0 * CLHEP::cm, 0 * CLHEP::cm), l_kapton, "p_kapton", l_iGasTPC, false, 1);
224
225
226 G4double w = 1.4 * CLHEP::cm;
227 G4double rodx = 9.476 * CLHEP::cm;
228 G4double rody = 6.976 * CLHEP::cm;
229 G4double ridx = rodx - w;
230 G4double ridy = rody - w;
231
232 G4double xrodh = ridx / 2. + w / 8.;
233 G4double yrodh = ridy / 2. + w / 8.;
234
235
236 G4double iR_Rod = 0.*CLHEP::mm;
237 G4double oR_Rod = 5. / 2.*CLHEP::mm;
238 G4double h_Rod = 20. / 2. * CLHEP::cm;
239 G4double sA_Rod = 0.*CLHEP::deg;
240 G4double spA_Rod = 360.*CLHEP::deg;
241
242
243
244
245
246
247
248 G4double x_Rod[4] = {xrodh, xrodh, -xrodh, -xrodh};
249 G4double y_Rod[4] = {yrodh, -yrodh, yrodh, -yrodh};
250
251 G4double z_Rod = 0. * CLHEP::cm;
252
253 G4Tubs* s_Rod = new G4Tubs("s_Rod", iR_Rod, oR_Rod, h_Rod, sA_Rod, spA_Rod);
255
256 new G4PVPlacement(0, G4ThreeVector(x_Rod[0], y_Rod[0], z_Rod), l_Rod, "p_Rod_0", l_iGasTPC, false, 1);
257 new G4PVPlacement(0, G4ThreeVector(x_Rod[1], y_Rod[1], z_Rod), l_Rod, "p_Rod_1", l_iGasTPC, false, 1);
258 new G4PVPlacement(0, G4ThreeVector(x_Rod[2], y_Rod[2], z_Rod), l_Rod, "p_Rod_2", l_iGasTPC, false, 1);
259 new G4PVPlacement(0, G4ThreeVector(x_Rod[3], y_Rod[3], z_Rod), l_Rod, "p_Rod_3", l_iGasTPC, false, 1);
260
261
262
263
264 G4double dx_Ring = rodx / 2.;
265 G4double dy_Ring = rody / 2.;
266 G4double dz_Ring = 0.127 / 2.*CLHEP::cm;
267
268 G4VSolid* s_Ring = new G4Box("s_RingFilled", dx_Ring, dy_Ring, dz_Ring);
269
270
271 G4double dx_RingHole = xrodh / 2.;
272 G4double dy_RingHole = yrodh / 2.;
273 G4double dz_RingHole = dz_Ring;
274 G4VSolid* s_RingHole = new G4Box("s_RingHole", dx_RingHole, dy_RingHole, dz_RingHole);
275 s_Ring = new G4SubtractionSolid("s_Ring", s_Ring, s_RingHole, 0, G4ThreeVector(0, 0, 0));
276
277 G4double iR_RingHoles = 0.*CLHEP::mm;
278 G4double oR_RingHoles = oR_Rod;
279 G4double h_RingHoles = dz_Ring;
280 G4double sA_RingHoles = 0.*CLHEP::deg;
281 G4double spA_RingHoles = 360.*CLHEP::deg;
282 G4VSolid* s_RingHoles = new G4Tubs("s_RingHoles", iR_RingHoles, oR_RingHoles, h_RingHoles, sA_RingHoles, spA_RingHoles);
283 char Name[400];
284 for (G4int i = 0; i < 4; i++) {
285 sprintf(Name, "s_Ring_%d", i);
286 s_Ring = new G4SubtractionSolid(Name, s_Ring, s_RingHoles, 0, G4ThreeVector(x_Rod[i], y_Rod[i], 0));
287 }
288
290 G4int RingNb = 10;
291 G4double hspacer = 1.*CLHEP::cm;
292 G4double offset = dz_iGasTPC - 5.*CLHEP::cm;
293
294 G4double x_Ring[40];
295 G4double y_Ring[40];
296 G4double z_Ring[40];
297 for (G4int i = 0; i < RingNb; i++) {
298 x_Ring[i] = 0;
299 y_Ring[i] = 0;
300 z_Ring[i] = -dz_iGasTPC + offset + (hspacer + 2. * dz_Ring) * i;
301
302 sprintf(Name, "p_Ring_%d", i);
303 new G4PVPlacement(0, G4ThreeVector(x_Ring[i], y_Ring[i], z_Ring[i]), l_Ring, Name, l_iGasTPC, false, 1);
304 }
305
306
307 G4VSolid* s_Anode = new G4Box("s_Anode", dx_Ring, dy_Ring, dz_Ring);
308 for (G4int i = 0; i < 4; i++) {
309 sprintf(Name, "s_Anode_%d", i);
310 s_Anode = new G4SubtractionSolid(Name, s_Anode, s_RingHoles, 0, G4ThreeVector(x_Rod[i], y_Rod[i], 0));
311 }
313 x_Ring[10] = 0;
314 y_Ring[10] = 0;
315 z_Ring[10] = -dz_iGasTPC + offset + (hspacer + 2.*dz_Ring) * RingNb;
316 new G4PVPlacement(0, G4ThreeVector(x_Ring[RingNb], y_Ring[RingNb], z_Ring[RingNb]), l_Anode, "p_Anode", l_iGasTPC, false, 1);
317
318
319 G4double iR_RSpacer = oR_Rod;
320 G4double oR_RSpacer = oR_Rod + 2.*CLHEP::mm;
321 G4double h_RSpacer = (z_Ring[1] - dz_Ring - (z_Ring[0] + dz_Ring)) / 2.;
322 G4double sA_RSpacer = 0.*CLHEP::deg;
323 G4double spA_RSpacer = 360.*CLHEP::deg;
324 G4Tubs* s_RSpacer = new G4Tubs("s_RSpacer1", iR_RSpacer, oR_RSpacer, h_RSpacer, sA_RSpacer, spA_RSpacer);
325 G4LogicalVolume* l_RSpacer =
new G4LogicalVolume(s_RSpacer,
geometry::Materials::get(
"G4_POLYVINYL_ACETATE"),
"l_RSpacer");
326
327 G4double x_RSpacer[40];
328 G4double y_RSpacer[40];
329 G4double z_RSpacer[40];
330 for (G4int i = 0; i < 10; i++) {
331 for (G4int k = 0; k < 4; k++) {
332 x_RSpacer[i] = x_Rod[k];
333 y_RSpacer[i] = y_Rod[k];
334 z_RSpacer[i] = z_Ring[i] + dz_Ring + h_RSpacer;
335 sprintf(Name, "p_RSpacer_%d_%d", i, k);
336 new G4PVPlacement(0, G4ThreeVector(x_RSpacer[i], y_RSpacer[i], z_RSpacer[i]), l_RSpacer, Name, l_iGasTPC, false, 1);
337 }
338 }
339
340
341 G4double dx_GEM = 50. / 2.*CLHEP::mm;
342 G4double dy_GEM = 50. / 2.*CLHEP::mm;
343 G4double dz_GEM = 1.6 / 2.*CLHEP::mm;
344
345 G4double x_GEM = 0.*CLHEP::cm;
346 G4double y_GEM = 0.*CLHEP::cm;
347
348 G4double z_GEM[] = { z_Ring[0] - dz_Ring - dz_GEM, z_Ring[0] - dz_Ring - 2. * dz_GEM - 0.28 * CLHEP::cm};
349
350
351
352 G4VSolid* s_GEM = new G4Box("s_GEM", dx_GEM, dy_GEM, dz_GEM);
354 for (G4int i = 0; i < 2; i++) {
355 sprintf(Name, "p_GEM_%d", i);
356 new G4PVPlacement(0, G4ThreeVector(x_GEM, y_GEM, z_GEM[i]), l_GEM, Name, l_iGasTPC, false, 1);
357 }
358
359
360 G4double dx_GEMSupport = dx_Ring;
361 G4double dy_GEMSupport = dy_Ring;
362 G4double dz_GEMSupport = dz_GEM;
363 G4VSolid* s_GEMSupport = new G4Box("s_GEMSupport1", dx_GEMSupport, dy_GEMSupport, dz_GEMSupport);
364
365 G4double iR_GEMSupportHoles = 0.*CLHEP::mm;
366 G4double oR_GEMSupportHoles = oR_Rod;
367 G4double h_GEMSupportHoles = dz_GEMSupport;
368 G4double sA_GEMSupportHoles = 0.*CLHEP::deg;
369 G4double spA_GEMSupportHoles = 360.*CLHEP::deg;
370 G4VSolid* s_GEMSupportHoles = new G4Tubs("s_GEMSupportHoles", iR_GEMSupportHoles, oR_GEMSupportHoles, h_GEMSupportHoles,
371 sA_GEMSupportHoles, spA_GEMSupportHoles);
372 s_GEMSupport = new G4SubtractionSolid("s_GEMSupport2", s_GEMSupport, s_GEM, 0, G4ThreeVector(0, 0, 0));
373 for (G4int i = 0; i < 4; i++) {
374 sprintf(Name, "s_GEMSupport_%d", i);
375 s_GEMSupport = new G4SubtractionSolid(Name, s_GEMSupport, s_GEMSupportHoles, 0, G4ThreeVector(x_Rod[i], y_Rod[i], 0));
376 }
377
378 G4LogicalVolume* l_GEMSupport = new G4LogicalVolume(s_GEMSupport, TPC_G10, "l_GEMSupport");
379 for (G4int i = 0; i < 2; i++) {
380 sprintf(Name, "p_GEMSupport_%d", i);
381 new G4PVPlacement(0, G4ThreeVector(x_GEM, y_GEM, z_GEM[i]), l_GEMSupport, Name, l_iGasTPC, false, 1);
382 }
383
384
385 G4double dx_GasTPC = 2.95 / 2. * CLHEP::cm;
386 G4double dy_GasTPC = 2.95 / 2. * CLHEP::cm;
387 G4double dz_GasTPC = (z_Ring[10] - dz_Ring - z_GEM[0] - dz_GEM) / 2.;
388 cout << " dz_GasTPC " << dz_GasTPC / CLHEP::cm << endl;
389 G4Box* s_GasTPC = new G4Box("s_GasTPC", dx_GasTPC, dy_GasTPC, dz_GasTPC);
390 G4LogicalVolume* l_GasTPC =
new G4LogicalVolume(s_GasTPC, gasmix_4HeCO2,
"l_GasTPC", 0,
m_sensitive);
391
392
393 l_GasTPC->SetUserLimits(new G4UserLimits(stepSize));
394
395 G4double x_GasTPC = 0;
396 G4double y_GasTPC = 0;
397 G4double z_GasTPC = z_GEM[0] + dz_GEM + dz_GasTPC;
398
399 new G4PVPlacement(0, G4ThreeVector(x_GasTPC, y_GasTPC, z_GasTPC), l_GasTPC, "p_GasTPC", l_iGasTPC, false, detID);
400
401 B2INFO("Micro-TPC-Sensitive-Volume-" << detID << " placed at: (" << TPCpos.getX() + x_GasTPC << "," << TPCpos.getY() + y_GasTPC <<
402 "," << TPCpos.getZ() + z_GasTPC << ") mm");
403
404
405 G4double dx_PixelChip = dx_GasTPC;
406 G4double dy_PixelChip = dy_GasTPC;
407 G4double dz_PixelChip = 1. / 2.*CLHEP::mm;
408
409 G4double x_PixelChip = 0.*CLHEP::mm;
410 G4double y_PixelChip = 0.*CLHEP::mm;
411 G4double z_PixelChip = z_GEM[1] - 0.3 * CLHEP::cm;
412
413 G4Box* s_PixelChip = new G4Box("s_PixelChip", dx_PixelChip, dy_PixelChip, dz_PixelChip);
414 G4LogicalVolume* l_PixelChip =
new G4LogicalVolume(s_PixelChip,
geometry::Materials::get(
"G4_PLASTIC_SC_VINYLTOLUENE"),
415 "l_PixelChip");
416 new G4PVPlacement(0, G4ThreeVector(x_PixelChip, y_PixelChip, z_PixelChip), l_PixelChip, "p_PixelChip", l_iGasTPC, false, 1);
417
418
419 G4double dx_CuPlate = dx_Ring;
420 G4double dy_CuPlate = dy_Ring;
421 G4double dz_CuPlate = dz_PixelChip;
422
423 G4VSolid* s_CuPlate = new G4Box("s_CuPlate", dx_CuPlate, dy_CuPlate, dz_CuPlate);
424 G4VSolid* s_HolesInCuPlate = new G4Tubs("HolesInCuPlate", iR_RingHoles, oR_RingHoles, dz_PixelChip, sA_RingHoles, spA_RingHoles);
425 for (G4int i = 0; i < 4; i++) {
426 sprintf(Name, "s_CuPlate_%d", i);
427 s_CuPlate = new G4SubtractionSolid(Name, s_CuPlate, s_HolesInCuPlate, 0, G4ThreeVector(x_Rod[i], y_Rod[i], 0));
428 }
429 s_CuPlate = new G4SubtractionSolid("s_CuPlate", s_CuPlate, s_PixelChip, 0, G4ThreeVector(0, 0, 0));
430
431
432 G4LogicalVolume* l_CuPlate = new G4LogicalVolume(s_CuPlate, TPC_metaCuScreen, "l_CuPlate");
433 new G4PVPlacement(0, G4ThreeVector(x_PixelChip, y_PixelChip, z_PixelChip), l_CuPlate, "p_CuPlate", l_iGasTPC, false, 1);
434
435
436 G4double dx_PixelBoard = dx_Ring;
437 G4double dy_PixelBoard = dy_Ring;
438 G4double dz_PixelBoard = 2.*CLHEP::mm;
439
440 G4VSolid* s_PixelBoard = new G4Box("s_PixelBoard1", dx_PixelBoard, dy_PixelBoard, dz_PixelBoard);
441 G4VSolid* s_PixelBoardHoles = new G4Tubs("s_PixelBoardHoles", iR_RingHoles, oR_RingHoles, dz_PixelBoard, sA_RingHoles,
442 spA_RingHoles);
443 for (G4int i = 0; i < 4; i++) {
444 sprintf(Name, "s_PixelBoard_%d", i);
445 s_PixelBoard = new G4SubtractionSolid(Name, s_PixelBoard, s_PixelBoardHoles, 0, G4ThreeVector(x_Rod[i], y_Rod[i], 0));
446 }
447
448 G4double x_PixelBoard = 0.*CLHEP::mm;
449 G4double y_PixelBoard = 0.*CLHEP::mm;
450 G4double z_PixelBoard = z_PixelChip - dz_PixelBoard - dz_PixelChip;
451
452 G4LogicalVolume* l_PixelBoard = new G4LogicalVolume(s_PixelBoard, TPC_G10, "l_PixelBoard");
453
454 new G4PVPlacement(0, G4ThreeVector(x_PixelBoard, y_PixelBoard, z_PixelBoard), l_PixelBoard, "p_PixelBoard", l_iGasTPC, false, 1);
455 detID++;
456 }
457 }
static G4Material * get(const std::string &name)
Find given material.
VXD::SensitiveDetector< PXDSimHit, PXDTrueHit > SensitiveDetector
The PXD Sensitive Detector class.