132 G4cout <<
"BesTofConstruction::Construct(), logicalTof not found" << G4endl;
136 physicalTof =
new G4PVPlacement( 0, G4ThreeVector( 0, 0, 0 ), logicalTof,
"physicalTof",
167 G4double r2 = tofPara->GetBucketPosR() + 0.5 * tofPara->GetBucketDEc() + 1;
170 G4double a1 = 1382 + tofPara->GetBucketLEc() + 1;
174 G4cout <<
"Tof Volume: " << r1 <<
" " << r2 <<
" " << r3 <<
" " << r4 <<
" " << a1 <<
" "
175 << a2 <<
" " << a3 << G4endl;
179 G4Tubs* tub1 =
new G4Tubs(
"tub1", r1, r2, a1, 0, 360 );
180 G4Tubs* tub2 =
new G4Tubs(
"tub2", r2 - 4, r4, a2, 0, 360 );
181 G4Tubs* tub3 =
new G4Tubs(
"tub3", 0, r3, a3, 0, 360 );
182 G4UnionSolid* tub4 =
new G4UnionSolid(
183 "tub4", tub1, tub2, 0, G4ThreeVector( 0, 0, 0 ) );
184 G4SubtractionSolid* solidTof =
new G4SubtractionSolid(
185 "solidTof", tub4, tub3, 0, G4ThreeVector( 0, 0, 0 ) );
186 logicalTof =
new G4LogicalVolume( solidTof, G4Material::GetMaterial(
"Air" ),
188 physicalTof =
new G4PVPlacement( 0, G4ThreeVector( 0, 0, 0 ), logicalTof,
"physicalTof",
189 logicalBes,
false, 0 );
192 G4Tubs* tub5 =
new G4Tubs(
"tub5", r3, r4, a3, 0, 360 );
193 logicalBrTof =
new G4LogicalVolume( tub5, G4Material::GetMaterial(
"Air" ),
195 G4VPhysicalVolume* physicalBrTof =
new G4PVPlacement(
196 0, G4ThreeVector( 0, 0, 0 ), logicalBrTof,
"physicalBrTof", logicalTof,
false, 0 );
200 new G4Tubs(
"tub6", r1, r4, ( a2 - a3 ) / 2, 0, 360 );
202 new G4Tubs(
"tub7", r1, r2, ( a1 - a2 ) / 2, 0, 360 );
203 G4UnionSolid* tub8 =
new G4UnionSolid(
204 "tub8", tub6, tub7, 0,
205 G4ThreeVector( 0, 0, ( a3 - a1 ) / 2 ) );
208 new G4LogicalVolume( tub8, G4Material::GetMaterial(
"Air" ),
"logicalEcTofWest" );
209 G4VPhysicalVolume* physicalEcTofWest =
210 new G4PVPlacement( 0, G4ThreeVector( 0, 0, tofPara->GetzPosWestEc() ),
211 logicalEcTofWest,
"physicalEcTofWest", logicalTof,
false, 0 );
213 G4UnionSolid* tub9 =
new G4UnionSolid(
214 "tub9", tub6, tub7, 0,
215 G4ThreeVector( 0, 0, ( a1 - a3 ) / 2 ) );
218 new G4LogicalVolume( tub9, G4Material::GetMaterial(
"Air" ),
"logicalEcTofEast" );
219 G4VPhysicalVolume* physicalEcTofEast =
220 new G4PVPlacement( 0, G4ThreeVector( 0, 0, tofPara->GetzPosEastEc() ),
221 logicalEcTofEast,
"physicalEcTofEast", logicalTof,
false, 0 );
227 G4Tubs* tubTape =
new G4Tubs(
"tubTape", 866, 866.3, 1150, 0, 360 );
228 G4LogicalVolume* logicalTape =
229 new G4LogicalVolume( tubTape, G4Material::GetMaterial(
"tape" ),
"logicalTape" );
230 G4VPhysicalVolume* physicalTape =
new G4PVPlacement(
231 0, G4ThreeVector( 0, 0, 0 ), logicalTape,
"physicalTape", logicalBrTof,
false, 0 );
232 logicalTape->SetVisAttributes( G4VisAttributes::Invisible );
244 G4cout <<
"BesTofConstruction::Construct(), logicalTof not found" << G4endl;
247 physicalTof =
new G4PVPlacement( 0, G4ThreeVector( 0, 0, 0 ), logicalTof,
"physicalTof",
248 logicalBes,
false, 0 );
271 G4double r1 = tofPara->GetEcR1() - 1;
272 G4double r2 = tofPara->GetBucketPosR() + 0.5 * tofPara->GetBucketDEc() + 1;
276 G4double a1 = 1382 + tofPara->GetBucketLEc() + 1;
280 G4cout <<
"Tof Volume: " << r1 <<
" " << r2 <<
" " << r3 <<
" " << r4 <<
" " << a1 <<
" "
281 << a2 <<
" " << a3 << G4endl;
283 G4Tubs* tub1 =
new G4Tubs(
"tub1", r1, r2, a1, 0,
286 G4Tubs* tub2 =
new G4Tubs(
"tub2", r2 - 4, r4, a2, 0, 360 );
287 G4Tubs* tub3 =
new G4Tubs(
"tub3", 0, r3, a3, 0, 360 );
288 G4UnionSolid* tub4 =
new G4UnionSolid(
289 "tub4", tub1, tub2, 0, G4ThreeVector( 0, 0, 0 ) );
290 G4SubtractionSolid* solidTof =
new G4SubtractionSolid(
291 "solidTof", tub4, tub3, 0, G4ThreeVector( 0, 0, 0 ) );
292 logicalTof =
new G4LogicalVolume( solidTof, G4Material::GetMaterial(
"Air" ),
294 physicalTof =
new G4PVPlacement( 0, G4ThreeVector( 0, 0, 0 ), logicalTof,
"physicalTof",
295 logicalBes,
false, 0 );
297 G4Tubs* tub5 =
new G4Tubs(
"tub5", r3, r4, a3, 0, 360 );
298 logicalBrTof =
new G4LogicalVolume( tub5, G4Material::GetMaterial(
"Air" ),
300 G4VPhysicalVolume* physicalBrTof =
new G4PVPlacement(
301 0, G4ThreeVector( 0, 0, 0 ), logicalBrTof,
"physicalBrTof", logicalTof,
false, 0 );
304 G4Tubs* tub6 =
new G4Tubs(
"tub6", r1, r4, ( a2 - a3 ) / 2, 0,
306 G4Tubs* tub7 =
new G4Tubs(
"tub7", r1, r2, ( a1 - a2 ) / 2, 0,
308 G4UnionSolid* tub8 =
new G4UnionSolid(
"tub8", tub6, tub7, 0,
309 G4ThreeVector( 0, 0, ( a3 - a1 ) / 2 ) );
311 new G4LogicalVolume( tub8, G4Material::GetMaterial(
"Air" ),
"logicalEcTofWest" );
312 G4VPhysicalVolume* physicalEcTofWest =
313 new G4PVPlacement( 0, G4ThreeVector( 0, 0, tofPara->GetzPosWestEc() ),
314 logicalEcTofWest,
"physicalEcTofWest", logicalTof,
false, 0 );
317 new G4UnionSolid(
"tub9", tub6, tub7, 0, G4ThreeVector( 0, 0, ( a1 - a3 ) / 2 ) );
319 new G4LogicalVolume( tub9, G4Material::GetMaterial(
"Air" ),
"logicalEcTofEast" );
320 G4VPhysicalVolume* physicalEcTofEast =
321 new G4PVPlacement( 0, G4ThreeVector( 0, 0, tofPara->GetzPosEastEc() ),
322 logicalEcTofEast,
"physicalEcTofEast", logicalTof,
false, 0 );
327 G4Tubs* tubTape =
new G4Tubs(
"tubTape", 866, 866.3, 1150, 0, 360 );
328 G4LogicalVolume* logicalTape =
329 new G4LogicalVolume( tubTape, G4Material::GetMaterial(
"tape" ),
"logicalTape" );
330 G4VPhysicalVolume* physicalTape =
new G4PVPlacement(
331 0, G4ThreeVector( 0, 0, 0 ), logicalTape,
"physicalTape", logicalBrTof,
false, 0 );
332 logicalTape->SetVisAttributes( G4VisAttributes::Invisible );
341 G4SDManager* SDman = G4SDManager::GetSDMpointer();
343 SDman->AddNewDetector( tofSD );
345 if ( logicalScinBr1 ) logicalScinBr1->SetSensitiveDetector( tofSD );
346 if ( logicalScinBr2 ) logicalScinBr2->SetSensitiveDetector( tofSD );
347 if ( logicalScinEcWest ) logicalScinEcWest->SetSensitiveDetector( tofSD );
348 if ( logicalScinEcEast ) logicalScinEcEast->SetSensitiveDetector( tofSD );
349 if ( logical_gasLayer )
351 logical_gasLayer->SetSensitiveDetector( tofSD );
352 G4cout <<
"!!! Find logical_gasLayer !!!" << G4endl;
355 logical_gasLayer->SetUserLimits(
new G4UserLimits( m_userLimits * mm ) );
359 G4VisAttributes* visBrTof =
new G4VisAttributes( G4Colour( 1., 0., 0. ) );
360 G4VisAttributes* visEcTof =
new G4VisAttributes( G4Colour( 0., 1., 0. ) );
362 if ( logicalTof ) logicalTof->SetVisAttributes( G4VisAttributes::Invisible );
363 if ( logicalBrTof ) logicalBrTof->SetVisAttributes( G4VisAttributes::Invisible );
365 if ( logicalEcTofWest ) logicalEcTofWest->SetVisAttributes( G4VisAttributes::Invisible );
367 if ( logicalEcTofEast ) logicalEcTofEast->SetVisAttributes( G4VisAttributes::Invisible );
370 if ( logicalScinBr1 ) logicalScinBr1->SetVisAttributes( G4VisAttributes::Invisible );
371 if ( logicalScinBr2 ) logicalScinBr2->SetVisAttributes( G4VisAttributes::Invisible );
373 if ( logicalAlBr1 ) logicalAlBr1->SetVisAttributes( G4VisAttributes::Invisible );
374 if ( logicalAlBr2 ) logicalAlBr2->SetVisAttributes( G4VisAttributes::Invisible );
376 if ( logicalPVFBr1 ) logicalPVFBr1->SetVisAttributes( G4VisAttributes::Invisible );
377 if ( logicalPVFBr2 ) logicalPVFBr2->SetVisAttributes( G4VisAttributes::Invisible );
379 G4VisAttributes* visAttBrBuck =
new G4VisAttributes( G4Colour( 1., 1., 0. ) );
380 if ( logicalBucketBr1 ) logicalBucketBr1->SetVisAttributes( visAttBrBuck );
382 if ( logicalBucketBr2 ) logicalBucketBr2->SetVisAttributes( visAttBrBuck );
385 G4VisAttributes* visAttEcTof =
new G4VisAttributes( G4Colour( 0., 1., 1. ) );
386 if ( logicalScinEcWest ) logicalScinEcWest->SetVisAttributes( visAttEcTof );
388 if ( logicalScinEcEast ) logicalScinEcEast->SetVisAttributes( visAttEcTof );
390 G4VisAttributes* visAttEcBuck =
new G4VisAttributes( G4Colour( 1., 1., 0. ) );
391 if ( logicalBucketEc ) logicalBucketEc->SetVisAttributes( visAttEcBuck );
394 if ( logicalAlEcWest ) logicalAlEcWest->SetVisAttributes( G4VisAttributes::Invisible );
395 if ( logicalAlEcEast ) logicalAlEcEast->SetVisAttributes( G4VisAttributes::Invisible );
396 if ( logicalPVFEcWest ) logicalPVFEcWest->SetVisAttributes( G4VisAttributes::Invisible );
397 if ( logicalPVFEcEast ) logicalPVFEcEast->SetVisAttributes( G4VisAttributes::Invisible );
404 G4int nScinBr = tofPara->GetnScinBr();
405 G4double br1L = tofPara->GetBr1L();
406 G4double br1TrapW1 = tofPara->GetBr1TrapW1();
407 G4double br1TrapW2 = tofPara->GetBr1TrapW2();
408 G4double br1TrapH = tofPara->GetBr1TrapH();
409 G4double br1R1 = tofPara->GetBr1R1();
410 G4double AlThickness = tofPara->GetAlThickness();
411 G4double PVFThickness = tofPara->GetPVFThickness();
413 G4double bucketDBr = tofPara->GetBucketDBr();
414 G4double bucketLBr = tofPara->GetBucketLBr();
417 G4double angleBr = 360. / nScinBr * deg;
418 G4double scinTrapdx1, scinTrapdx2, scinTrapdx3, scinTrapdx4;
419 scinTrapdx1 = scinTrapdx3 = br1TrapW1 / 2.;
420 scinTrapdx2 = scinTrapdx4 = br1TrapW2 / 2.;
421 G4double scinTrapdy1, scinTrapdy2;
422 scinTrapdy1 = scinTrapdy2 = 0.5 * br1TrapH;
423 G4double scinTrapdz = br1L / 2.;
424 G4double scinPosR = br1R1 + scinTrapdy1;
425 G4double theta = atan( ( br1TrapW2 / 2. - br1TrapW1 / 2. ) / br1TrapH );
426 G4double delta13 = AlThickness * ( 1 /
cos( theta ) -
tan( theta ) );
427 G4double delta24 = AlThickness * ( 1 /
cos( theta ) +
tan( theta ) );
428 G4double delta13P = ( PVFThickness + AlThickness ) * ( 1 /
cos( theta ) -
tan( theta ) );
429 G4double delta24P = ( PVFThickness + AlThickness ) * ( 1 /
cos( theta ) +
tan( theta ) );
432 G4Trap* solidScinBr1 =
433 new G4Trap(
"solidScinBr1", scinTrapdz, 0 * deg, 0 * deg, scinTrapdy1, scinTrapdx1,
434 scinTrapdx2, 0 * deg, scinTrapdy2, scinTrapdx3, scinTrapdx4, 0 * deg );
435 logicalScinBr1 =
new G4LogicalVolume( solidScinBr1, BC408,
"logicalScinBr1" );
438 G4Trap* solidAlBr1 =
new G4Trap(
"solidAlBr1", scinTrapdz + 0.001, 0 * deg, 0 * deg,
439 scinTrapdy1 + AlThickness, scinTrapdx1 + delta13,
440 scinTrapdx2 + delta24, 0 * deg, scinTrapdy2 + AlThickness,
441 scinTrapdx3 + delta13, scinTrapdx4 + delta24, 0 * deg );
443 logicalAlBr1 =
new G4LogicalVolume( solidAlBr1, G4Material::GetMaterial(
"Aluminium" ),
445 G4Trap* solidPVFBr1 =
446 new G4Trap(
"solidPVFBr1", scinTrapdz + 0.002, 0 * deg, 0 * deg,
447 scinTrapdy1 + AlThickness + PVFThickness, scinTrapdx1 + delta13P,
448 scinTrapdx2 + delta24P, 0 * deg, scinTrapdy2 + AlThickness + PVFThickness,
449 scinTrapdx3 + delta13P, scinTrapdx4 + delta24P, 0 * deg );
451 logicalPVFBr1 =
new G4LogicalVolume( solidPVFBr1, PVF,
"logicalPVFBr1" );
453 physicalAlBr1 =
new G4PVPlacement( 0, G4ThreeVector( 0, 0, 0 ), logicalAlBr1,
454 "physicalAlBr1", logicalPVFBr1,
false, 0 );
455 physicalScinBr1 =
new G4PVPlacement( 0, G4ThreeVector( 0, 0, 0 ), logicalScinBr1,
456 "physicalScinBr1", logicalAlBr1,
false, 0 );
459 G4Tubs* solidBucketBr1 =
460 new G4Tubs(
"solidBucketBr1", 0, bucketDBr / 2., bucketLBr / 2., 0, 360. * deg );
461 logicalBucketBr1 =
new G4LogicalVolume( solidBucketBr1, PMTmaterial,
"logicalBucketBr1" );
464 G4RotationMatrix trapRot;
465 trapRot.rotateZ( 0.5 * angleBr - 90. * deg );
472 G4ThreeVector pos( 0, 0, 0 );
474 for (
int i = 0; i < nScinBr; i++ )
476 ostringstream osnamePVFBr1;
477 osnamePVFBr1 <<
"physicalPVFBr1_" << i;
478 ostringstream osnameBucket1Br1;
479 osnameBucket1Br1 <<
"physicalBucket1Br1_" << i;
480 ostringstream osnameBucket2Br1;
481 osnameBucket2Br1 <<
"physicalBucket2Br1_" << i;
484 x = scinPosR *
cos( ( i + 0.5 ) * angleBr );
485 y = scinPosR *
sin( ( i + 0.5 ) * angleBr );
492 getXYZ( trapRot, a, b, c );
493 G4RotationMatrix trapRotTemp;
494 trapRotTemp.rotateZ( c );
495 G4Transform3D transform( trapRotTemp, pos );
499 physicalPVFBr1 =
new G4PVPlacement( transform, logicalPVFBr1, osnamePVFBr1.str(),
500 logicalBrTof,
false, i );
502 pos.setZ( -( bucketLBr + br1L ) / 2. - 0.01 );
503 physicalBucket1Br1 =
new G4PVPlacement( 0, pos, logicalBucketBr1, osnameBucket1Br1.str(),
504 logicalBrTof,
false, 0 );
505 pos.setZ( ( bucketLBr + br1L ) / 2. + 0.01 );
506 physicalBucket2Br1 =
new G4PVPlacement( 0, pos, logicalBucketBr1, osnameBucket2Br1.str(),
507 logicalBrTof,
false, 0 );
510 trapRot.rotateZ( angleBr );
518 G4int nScinBr = tofPara->GetnScinBr();
519 G4double br2L = tofPara->GetBr2L();
520 G4double br2TrapW1 = tofPara->GetBr2TrapW1();
521 G4double br2TrapW2 = tofPara->GetBr2TrapW2();
522 G4double br2TrapH = tofPara->GetBr2TrapH();
523 G4double br2R1 = tofPara->GetBr2R1();
524 G4double AlThickness = tofPara->GetAlThickness();
525 G4double PVFThickness = tofPara->GetPVFThickness();
527 G4double bucketDBr = tofPara->GetBucketDBr();
528 G4double bucketLBr = tofPara->GetBucketLBr();
531 G4double angleBr = 360. / nScinBr * deg;
532 G4double scinTrapdx1, scinTrapdx2, scinTrapdx3, scinTrapdx4;
533 scinTrapdx1 = scinTrapdx3 = br2TrapW1 / 2.;
534 scinTrapdx2 = scinTrapdx4 = br2TrapW2 / 2.;
535 G4double scinTrapdy1, scinTrapdy2;
536 scinTrapdy1 = scinTrapdy2 = 0.5 * br2TrapH;
537 G4double scinTrapdz = br2L / 2.;
538 G4double scinPosR = br2R1 + scinTrapdy1;
539 G4double theta = atan( ( br2TrapW2 / 2. - br2TrapW1 / 2. ) / br2TrapH );
540 G4double delta13 = AlThickness * ( 1 /
cos( theta ) -
tan( theta ) );
541 G4double delta24 = AlThickness * ( 1 /
cos( theta ) +
tan( theta ) );
542 G4double delta13P = ( PVFThickness + AlThickness ) * ( 1 /
cos( theta ) -
tan( theta ) );
543 G4double delta24P = ( PVFThickness + AlThickness ) * ( 1 /
cos( theta ) +
tan( theta ) );
546 G4Trap* solidScinBr2 =
547 new G4Trap(
"solidScinBr2", scinTrapdz, 0 * deg, 0 * deg, scinTrapdy1, scinTrapdx1,
548 scinTrapdx2, 0 * deg, scinTrapdy2, scinTrapdx3, scinTrapdx4, 0 * deg );
549 logicalScinBr2 =
new G4LogicalVolume( solidScinBr2, BC408,
"logicalScinBr2" );
552 G4Trap* solidAlBr2 =
new G4Trap(
"solidAlBr2", scinTrapdz + 0.001, 0 * deg, 0 * deg,
553 scinTrapdy1 + AlThickness, scinTrapdx1 + delta13,
554 scinTrapdx2 + delta24, 0 * deg, scinTrapdy2 + AlThickness,
555 scinTrapdx3 + delta13, scinTrapdx4 + delta24, 0 * deg );
557 logicalAlBr2 =
new G4LogicalVolume( solidAlBr2, G4Material::GetMaterial(
"Aluminium" ),
559 G4Trap* solidPVFBr2 =
560 new G4Trap(
"solidPVFBr2", scinTrapdz + 0.002, 0 * deg, 0 * deg,
561 scinTrapdy1 + AlThickness + PVFThickness, scinTrapdx1 + delta13P,
562 scinTrapdx2 + delta24P, 0 * deg, scinTrapdy2 + AlThickness + PVFThickness,
563 scinTrapdx3 + delta13P, scinTrapdx4 + delta24P, 0 * deg );
565 logicalPVFBr2 =
new G4LogicalVolume( solidPVFBr2, PVF,
"logicalPVFBr2" );
567 physicalAlBr2 =
new G4PVPlacement( 0, G4ThreeVector( 0, 0, 0 ), logicalAlBr2,
568 "physicalAlBr2", logicalPVFBr2,
false, 0 );
569 physicalScinBr2 =
new G4PVPlacement( 0, G4ThreeVector( 0, 0, 0 ), logicalScinBr2,
570 "physicalScinBr2", logicalAlBr2,
false, 0 );
573 G4Tubs* solidBucketBr2 =
574 new G4Tubs(
"solidBucketBr2", 0, bucketDBr / 2., bucketLBr / 2., 0, 360. * deg );
575 logicalBucketBr2 =
new G4LogicalVolume( solidBucketBr2, PMTmaterial,
"logicalBucketBr2" );
577 G4RotationMatrix trapRot;
578 trapRot.rotateZ( -90. * deg );
585 G4ThreeVector pos( 0, 0, 0 );
587 for (
int i = 0; i < nScinBr; i++ )
589 ostringstream osnamePVFBr2;
590 osnamePVFBr2 <<
"physicalPVFBr2_" << i;
591 ostringstream osnameBucket1Br2;
592 osnameBucket1Br2 <<
"physicalBucket1Br2_" << i;
593 ostringstream osnameBucket2Br2;
594 osnameBucket2Br2 <<
"physicalBucket2Br2_" << i;
597 x = scinPosR *
cos( i * angleBr );
598 y = scinPosR *
sin( i * angleBr );
604 getXYZ( trapRot, a, b, c );
605 G4RotationMatrix trapRotTemp;
606 trapRotTemp.rotateZ( c );
607 G4Transform3D transform( trapRotTemp, pos );
609 physicalPVFBr2 =
new G4PVPlacement( transform, logicalPVFBr2, osnamePVFBr2.str(),
610 logicalBrTof,
false, i );
612 pos.setZ( -( bucketLBr + br2L ) / 2. - 0.01 );
613 physicalBucket1Br2 =
new G4PVPlacement( 0, pos, logicalBucketBr2, osnameBucket1Br2.str(),
614 logicalBrTof,
false, 0 );
615 pos.setZ( ( bucketLBr + br2L ) / 2. + 0.01 );
616 physicalBucket2Br2 =
new G4PVPlacement( 0, pos, logicalBucketBr2, osnameBucket2Br2.str(),
617 logicalBrTof,
false, 0 );
620 trapRot.rotateZ( angleBr );
629 G4int nScinEc = tofPara->GetnScinEc();
630 G4double ecL = tofPara->GetEcL();
631 G4double ecTrapW1 = tofPara->GetEcTrapW1();
632 G4double ecTrapW2 = tofPara->GetEcTrapW2();
633 G4double ecTrapH = tofPara->GetEcTrapH();
634 G4double ecTrapH1 = tofPara->GetEcTrapH1();
635 G4double zPosEastEc = tofPara->GetzPosEastEc();
636 G4double zPosWestEc = tofPara->GetzPosWestEc();
637 G4double ecR1 = tofPara->GetEcR1();
641 G4double bucketDEc = tofPara->GetBucketDEc();
642 G4double bucketLEc = tofPara->GetBucketLEc();
643 G4double bucketPosR = tofPara->GetBucketPosR();
645 G4double AlThickness = tofPara->GetAlThickness();
646 G4double PVFThickness = tofPara->GetPVFThickness();
648 G4double angleEc = 360. / nScinEc * deg;
649 G4double ecTrapW3 = ecTrapW1 + ( ecTrapW2 - ecTrapW1 ) * ecTrapH1 / ecTrapH;
650 G4double ecTrapH2 = ecTrapH - ecTrapH1;
651 G4double pdz = ecL / 2;
652 G4double ptheta = atan( ecTrapH1 / ( 2 * ecL ) );
653 G4double pdy1 = ecTrapH2 / 2;
654 G4double pdx1 = ecTrapW3 / 2;
655 G4double pdx2 = ecTrapW2 / 2;
656 G4double pdy2 = ecTrapH / 2;
657 G4double pdx3 = ecTrapW1 / 2;
658 G4double pdx4 = ecTrapW2 / 2;
662 G4double ecR = ecR1 + ecTrapH / 2 + ecTrapH1 / 4;
665 G4Trap* solidScinEc =
new G4Trap(
"solidScinEc", pdz, ptheta, 270 * deg, pdy1, pdx1, pdx2,
666 0 * deg, pdy2, pdx3, pdx4, 0 * deg );
668 logicalScinEcWest =
new G4LogicalVolume( solidScinEc, BC404,
"logicalScinEcWest" );
669 logicalScinEcEast =
new G4LogicalVolume( solidScinEc, BC404,
"logicalScinEcEast" );
672 G4Tubs* solidBucketEc =
673 new G4Tubs(
"solidBucketEc", 0, bucketDEc / 2., bucketLEc / 2., 0, 360. * deg );
674 logicalBucketEc =
new G4LogicalVolume( solidBucketEc, PMTmaterial,
"logicalBucketEc" );
677 G4double pthetaAl = atan( ecTrapH1 / ( 2 * ( ecL + AlThickness * 2 ) ) );
678 G4double
theta1 = atan( ( ecTrapW2 / 2. - ecTrapW3 / 2. ) / ecTrapH2 );
679 G4double
theta2 = atan( ( ecTrapW2 / 2. - ecTrapW1 / 2. ) / ecTrapH );
686 G4double thick = AlThickness + PVFThickness;
687 G4double pthetaPVF = atan( ecTrapH1 / ( 2 * ( ecL + thick * 2 ) ) );
693 G4Trap* solidAlEc =
new G4Trap(
"solidAlEc", pdz + AlThickness, pthetaAl, 270 * deg,
694 pdy1 + AlThickness, pdx1 + delta1, pdx2 + delta2, 0 * deg,
695 pdy2 + AlThickness, pdx3 + delta3, pdx4 + delta4, 0 * deg );
697 logicalAlEcWest =
new G4LogicalVolume( solidAlEc, G4Material::GetMaterial(
"Aluminium" ),
699 logicalAlEcEast =
new G4LogicalVolume( solidAlEc, G4Material::GetMaterial(
"Aluminium" ),
702 G4Trap* solidPVFEc =
new G4Trap(
"solidPVFEc", pdz + thick, pthetaPVF, 270 * deg,
703 pdy1 + thick, pdx1 + delta1P, pdx2 + delta2P, 0 * deg,
704 pdy2 + thick, pdx3 + delta3P, pdx4 + delta4P, 0 * deg );
706 logicalPVFEcWest =
new G4LogicalVolume( solidPVFEc, PVF,
"logicalPVFEcWest" );
707 logicalPVFEcEast =
new G4LogicalVolume( solidPVFEc, PVF,
"logicalPVFEcEast" );
710 physicalAlEcWest =
new G4PVPlacement( 0, G4ThreeVector( 0, 0, 0 ), logicalAlEcWest,
711 "physicalAlEcWest", logicalPVFEcWest,
false, 0 );
712 physicalScinEcWest =
new G4PVPlacement( 0, G4ThreeVector( 0, 0, 0 ), logicalScinEcWest,
713 "physicalScinEcWest", logicalAlEcWest,
false, 0 );
716 physicalAlEcEast =
new G4PVPlacement( 0, G4ThreeVector( 0, 0, 0 ), logicalAlEcEast,
717 "physicalAlEcEast", logicalPVFEcEast,
false, 0 );
718 physicalScinEcEast =
new G4PVPlacement( 0, G4ThreeVector( 0, 0, 0 ), logicalScinEcEast,
719 "physicalScinEcEast", logicalAlEcEast,
false, 0 );
725 G4ThreeVector posW( 0, 0, 0 );
726 G4ThreeVector posE( 0, 0, 0 );
727 G4RotationMatrix trapRot;
728 trapRot.rotateY( 180. * deg );
729 trapRot.rotateZ( 0.5 * angleEc - 90 * deg );
730 for (
int i = 0; i < nScinEc; i++ )
732 ostringstream osnamePVFEc;
733 osnamePVFEc <<
"physicalPVFEcWest_" << i;
734 ostringstream osnameBucketEc;
735 osnameBucketEc <<
"physicalBucketEcWest_" << i;
737 posW.setX( ecR *
cos( ( 0.5 + i ) * angleEc ) );
738 posW.setY( ecR *
sin( ( 0.5 + i ) * angleEc ) );
744 getXYZ( trapRot, a, b, c );
745 G4RotationMatrix trapRotTemp;
746 trapRotTemp.rotateX( a );
747 trapRotTemp.rotateY( b );
748 trapRotTemp.rotateZ( c );
749 G4Transform3D transform( trapRotTemp, posW );
751 physicalPVFEcWest =
new G4PVPlacement( transform, logicalPVFEcWest, osnamePVFEc.str(),
752 logicalEcTofWest,
false, i );
753 posW.setX( bucketPosR *
cos( ( 0.5 + i ) * angleEc ) );
754 posW.setY( bucketPosR *
sin( ( 0.5 + i ) * angleEc ) );
756 posW.setZ( -ecL / 2 - thick - bucketLEc / 2 - 0.01 );
757 physicalBucketEc =
new G4PVPlacement( 0, posW, logicalBucketEc, osnameBucketEc.str(),
758 logicalEcTofWest,
false, 0 );
759 trapRot.rotateZ( angleEc );
767 trapRot.rotateZ( -angleEc );
768 trapRot.rotateX( 180. * deg );
769 for (
int i = 0; i < nScinEc; i++ )
771 ostringstream osnamePVFEc;
772 osnamePVFEc <<
"physicalPVFEcEast_" << i;
773 ostringstream osnameBucketEc;
774 osnameBucketEc <<
"physicalBucketEcEast_" << i;
776 posE.setX( ecR *
cos( ( 0.5 + i ) * angleEc ) );
777 posE.setY( ecR *
sin( ( 0.5 + i ) * angleEc ) );
783 getXYZ( trapRot, a, b, c );
784 G4RotationMatrix trapRotTemp;
785 trapRotTemp.rotateX( a );
786 trapRotTemp.rotateY( b );
787 trapRotTemp.rotateZ( c );
788 G4Transform3D transform( trapRotTemp, posE );
790 physicalPVFEcEast =
new G4PVPlacement( transform, logicalPVFEcEast, osnamePVFEc.str(),
791 logicalEcTofEast,
false, i );
792 posE.setX( bucketPosR *
cos( ( 0.5 + i ) * angleEc ) );
793 posE.setY( bucketPosR *
sin( ( 0.5 + i ) * angleEc ) );
795 posE.setZ( ecL / 2 + thick + bucketLEc / 2 + 0.01 );
796 physicalBucketEc =
new G4PVPlacement( 0, posE, logicalBucketEc, osnameBucketEc.str(),
797 logicalEcTofEast,
false, 0 );
798 trapRot.rotateZ( angleEc );
811 G4double
smallL = 0.01 * mm;
812 G4RotationMatrix
rot_dummy( 0 * deg, 0 * deg, 0 * deg );
820 std::ostringstream name;
826 G4LogicalVolume* logical_container[4];
827 G4LogicalVolume* logical_gasContainer[4];
828 for (
int kk = 0; kk < 4; kk++ )
831 name <<
"logical_container_m" << kk;
832 logical_container[kk] = partProduce->
lg_container( (
int)kk / 2, name.str() );
835 name <<
"logical_gasContainer_m" << kk;
840 G4LogicalVolume* logical_containerFrame =
842 G4LogicalVolume* logical_upCover = partProduce->
lg_upCover(
"logical_upCover" );
843 G4LogicalVolume* logical_lowCover1 = partProduce->
lg_lowCover1(
"logical_lowCover1" );
844 G4LogicalVolume* logical_lowCover2 = partProduce->
lg_lowCover2(
"logical_lowCover2" );
845 G4LogicalVolume* logical_upFEE = partProduce->
lg_upFEE(
"logical_upFEE" );
846 G4LogicalVolume* logical_sideFEE = partProduce->
lg_sideFEE(
"logical_sideFEE" );
847 G4LogicalVolume* logical_castingDie = partProduce->
lg_castingDie(
"logical_castingDie" );
848 G4LogicalVolume* logical_bareChamber = partProduce->
lg_bareChamber(
"logical_bareChamber" );
849 G4LogicalVolume* logical_bracket = partProduce->
lg_bracket(
"logical_bracket" );
850 G4LogicalVolume* logical_sideStopBlock =
852 G4LogicalVolume* logical_upStopBlock = partProduce->
lg_upStopBlock(
"logical_upStopBlock" );
855 for (
int kk = 0; kk < 4; kk++ )
859 name <<
"physical_containerFrame_m" << kk;
860 new G4PVPlacement( 0, G4ThreeVector( 0, 0, 0 ), logical_containerFrame, name.str(),
864 G4ThreeVector translation_upCover( 0, ( containerOut_y + upCover_y ) / 2 +
smallL,
865 ( upCover_z - containerOut_z ) / 2 - upCover_posz );
867 name <<
"physical_upCover_m" << kk;
868 new G4PVPlacement( 0, translation_upCover, logical_upCover, name.str(),
873 name <<
"physical_lowCover_m" << kk;
876 G4ThreeVector translation_lowCover( 0, -1 * ( containerOut_y + upCover_y ) / 2,
877 ( lowCover1_z - containerOut_z ) / 2 -
879 new G4PVPlacement( 0, translation_lowCover, logical_lowCover1, name.str(),
884 G4ThreeVector translation_lowCover( 0, -1 * ( containerOut_y + upCover_y ) / 2,
885 ( lowCover2_z - containerOut_z ) / 2 -
887 new G4PVPlacement( 0, translation_lowCover, logical_lowCover2, name.str(),
892 G4ThreeVector translation_upFEE( 0, containerOut_y / 2 + upCover_y + upFEE_y / 2 +
smallL,
893 upCover_z - upFEE_posz - upFEE_z / 2 - upCover_posz -
894 containerOut_z / 2 );
896 name <<
"physical_upFEE_m" << kk;
897 new G4PVPlacement( 0, translation_upFEE, logical_upFEE, name.str(), logical_container[kk],
901 double angle_containerFrameSide =
902 atan( ( containerOut_xup - containerOut_xdown ) / 2 / containerOut_z ) *
rad;
903 double l_containerFrameSide = containerOut_z /
cos( angle_containerFrameSide );
905 ( l_containerFrameSide / 2 - sideFEE_posl ) *
sin( angle_containerFrameSide ) +
906 ( containerOut_xup + containerOut_xdown ) / 4 +
907 sideFEE_x / 2 *
cos( angle_containerFrameSide );
909 ( l_containerFrameSide / 2 - sideFEE_posl ) *
cos( angle_containerFrameSide ) -
910 sideFEE_x / 2 *
sin( angle_containerFrameSide );
911 G4ThreeVector translation_sideFEE_left( -x_sideFEE, 0, z_sideFEE );
912 G4RotationMatrix rot_sideFEE_left;
913 rot_sideFEE_left.rotateY( -angle_containerFrameSide );
914 G4Transform3D transform_sideFEE_left( rot_sideFEE_left, translation_sideFEE_left );
916 name <<
"physical_sideFEE_left_m" << kk;
917 new G4PVPlacement( transform_sideFEE_left, logical_sideFEE, name.str(),
920 G4ThreeVector translation_sideFEE_right( x_sideFEE, 0, z_sideFEE );
921 G4RotationMatrix rot_sideFEE_right;
922 rot_sideFEE_right.rotateZ( 180 * deg );
923 rot_sideFEE_right.rotateY( angle_containerFrameSide );
924 G4Transform3D transform_sideFEE_right( rot_sideFEE_right, translation_sideFEE_right );
926 name <<
"physical_sideFEE_right_m" << kk;
927 new G4PVPlacement( transform_sideFEE_right, logical_sideFEE, name.str(),
931 G4RotationMatrix rot_castingDie;
932 rot_castingDie.rotateX( -90 * deg );
933 G4ThreeVector translation_castingDie_1(
934 0, containerOut_y / 2 + upCover_y + castingDie_z / 2 +
smallL,
935 -containerOut_z / 2 + upCover_posz + castingDie_posz1 );
936 G4Transform3D transform_castingDie_1( rot_castingDie, translation_castingDie_1 );
938 name <<
"physical_castingDie_1_m" << kk;
939 new G4PVPlacement( transform_castingDie_1, logical_castingDie, name.str(),
942 G4ThreeVector translation_castingDie_2(
943 0, containerOut_y / 2 + upCover_y + castingDie_z / 2 +
smallL,
944 -containerOut_z / 2 + upCover_posz + castingDie_posz2 );
945 G4Transform3D transform_castingDie_2( rot_castingDie, translation_castingDie_2 );
947 name <<
"physical_castingDie_2_m" << kk;
948 new G4PVPlacement( transform_castingDie_2, logical_castingDie, name.str(),
952 G4ThreeVector translation_gasContainer(
953 0, 0, ( container_lowBorder - container_thickness ) / 2 );
955 name <<
"physical_gasContainer_m" << kk;
956 new G4PVPlacement( 0, translation_gasContainer, logical_gasContainer[kk], name.str(),
963 double l_chamber = honeyComb_y * 2 + tape_mrpc_y * 2 + pcbBoard_y0 * 2 + pcbBoard_y1 +
964 mylar_y * 4 + glass0_y * 4 + glass1_y * 10 + gasLayer_y * 12;
966 double z_chamber = ( containerIn_z - pcbBoard_z ) / 2 -
smallL;
967 for (
int kk = 0; kk < 4; kk++ )
969 if ( kk < 2 ) y_chamber = -( containerIn_y - l_chamber ) / 2 + chamber_in_posy;
970 else y_chamber = -( containerIn_y - l_chamber ) / 2 + chamber_out_posy;
971 G4Transform3D transform_bareChamber;
972 if ( kk == 0 || kk == 2 )
974 transform_bareChamber =
975 G4Transform3D(
rot_dummy, G4ThreeVector( 0, y_chamber, z_chamber ) );
979 G4RotationMatrix rot_bareChamber;
980 rot_bareChamber.rotateZ( 180 * deg );
981 transform_bareChamber =
982 G4Transform3D( rot_bareChamber, G4ThreeVector( 0, y_chamber, z_chamber ) );
984 new G4PVPlacement( transform_bareChamber, logical_bareChamber,
"physical_bareChamber",
988 G4double z_bracket = -( containerIn_z - bracket_z ) / 2 +
smallL;
989 new G4PVPlacement( 0, G4ThreeVector( -bracket_posx, 0, z_bracket ), logical_bracket,
990 "physical_bracket_0", logical_gasContainer[kk],
false, 0,
992 new G4PVPlacement( 0, G4ThreeVector( bracket_posx, 0, z_bracket ), logical_bracket,
993 "physical_bracket_1", logical_gasContainer[kk],
false, 0,
997 G4Transform3D transform_sideStopBlock;
998 G4double angle_gasContainerSide =
999 ( atan( ( containerIn_xup - containerIn_xdown ) / 2 / ( containerIn_z ) ) ) *
rad;
1000 G4double x_sideStopBlock = ( containerIn_xup + containerIn_xdown ) / 4 +
1001 sideStopBlock_posz0 *
tan( angle_gasContainerSide ) -
1002 sideStopBlock_x / 2 *
cos( angle_gasContainerSide );
1003 G4double z_sideStopBlock =
1004 sideStopBlock_posz0 + sideStopBlock_x / 2 *
sin( angle_gasContainerSide );
1006 G4RotationMatrix rot_sideStopBlock;
1007 rot_sideStopBlock.rotateY( angle_gasContainerSide );
1008 rot_sideStopBlock.rotateZ( 180 * deg );
1009 transform_sideStopBlock = G4Transform3D(
1010 rot_sideStopBlock, G4ThreeVector( -x_sideStopBlock, 0, z_sideStopBlock ) );
1011 new G4PVPlacement( transform_sideStopBlock, logical_sideStopBlock,
1012 "physical_sideStopBlock_0", logical_gasContainer[kk],
false, 0,
1015 rot_sideStopBlock = G4RotationMatrix( 0, 0, 0 );
1016 rot_sideStopBlock.rotateY( angle_gasContainerSide );
1017 transform_sideStopBlock = G4Transform3D(
1018 rot_sideStopBlock, G4ThreeVector( x_sideStopBlock, 0, z_sideStopBlock ) );
1019 new G4PVPlacement( transform_sideStopBlock, logical_sideStopBlock,
1020 "physical_sideStopBlock_1", logical_gasContainer[kk],
false, 0,
1023 x_sideStopBlock = ( containerIn_xup + containerIn_xdown ) / 4 +
1024 sideStopBlock_posz1 *
tan( angle_gasContainerSide ) -
1025 sideStopBlock_x / 2 *
cos( angle_gasContainerSide );
1027 sideStopBlock_posz1 + sideStopBlock_x / 2 *
sin( angle_gasContainerSide );
1028 rot_sideStopBlock = G4RotationMatrix( 0, 0, 0 );
1029 rot_sideStopBlock.rotateY( angle_gasContainerSide );
1030 rot_sideStopBlock.rotateZ( 180 * deg );
1031 transform_sideStopBlock = G4Transform3D(
1032 rot_sideStopBlock, G4ThreeVector( -x_sideStopBlock, 0, z_sideStopBlock ) );
1033 new G4PVPlacement( transform_sideStopBlock, logical_sideStopBlock,
1034 "physical_sideStopBlock_2", logical_gasContainer[kk],
false, 0,
1037 rot_sideStopBlock = G4RotationMatrix( 0, 0, 0 );
1038 rot_sideStopBlock.rotateY( angle_gasContainerSide );
1039 transform_sideStopBlock = G4Transform3D(
1040 rot_sideStopBlock, G4ThreeVector( x_sideStopBlock, 0, z_sideStopBlock ) );
1041 new G4PVPlacement( transform_sideStopBlock, logical_sideStopBlock,
1042 "physical_sideStopBlock_3", logical_gasContainer[kk],
false, 0,
1048 G4double x_upStopBlock = containerIn_xup / 4;
1049 G4double y_upStopBlock =
1050 pcbBoard_y1 / 2. + mylar_y + glass0_y + glass1_y * 2.5 + gasLayer_y * 3;
1051 G4double z_upStopBlock = ( pcbBoard_z - upStopBlock_z ) / 2 -
smallL;
1052 new G4PVPlacement( 0, G4ThreeVector( -x_upStopBlock, -y_upStopBlock, z_upStopBlock ),
1053 logical_upStopBlock,
"physical_upStopBlock_0", logical_bareChamber,
false,
1055 new G4PVPlacement( 0, G4ThreeVector( -x_upStopBlock, y_upStopBlock, z_upStopBlock ),
1056 logical_upStopBlock,
"physical_upStopBlock_1", logical_bareChamber,
false,
1058 new G4PVPlacement( 0, G4ThreeVector( x_upStopBlock, -y_upStopBlock, z_upStopBlock ),
1059 logical_upStopBlock,
"physical_upStopBlock_2", logical_bareChamber,
false,
1061 new G4PVPlacement( 0, G4ThreeVector( x_upStopBlock, y_upStopBlock, z_upStopBlock ),
1062 logical_upStopBlock,
"physical_upStopBlock_3", logical_bareChamber,
false,
1066 G4LogicalVolume* logical_honeyComb = partProduce->
lg_honeyComb(
"logical_honeyComb" );
1067 G4double y_honeyComb = ( honeyComb_y + pcbBoard_y1 ) / 2 + tape_mrpc_y + pcbBoard_y0 +
1068 mylar_y * 2 + glass0_y * 2 + glass1_y * 5 + gasLayer_y * 6;
1069 G4double z_honeyComb = ( pcbBoard_z - honeyComb_z ) / 2 - honeyComb_posz;
1070 new G4PVPlacement( 0, G4ThreeVector( 0, y_honeyComb, z_honeyComb ), logical_honeyComb,
1071 "physical_honeyComb_0", logical_bareChamber,
false, 0,
checkOverlap );
1072 new G4PVPlacement( 0, G4ThreeVector( 0, -1 * y_honeyComb, z_honeyComb ), logical_honeyComb,
1073 "physical_honeyComb_1", logical_bareChamber,
false, 1,
checkOverlap );
1076 G4LogicalVolume* logical_tape_mrpc = partProduce->
lg_tape_mrpc(
"logical_tape_mrpc" );
1077 G4double y_tape_mrpc = ( tape_mrpc_y + pcbBoard_y1 ) / 2 + pcbBoard_y0 + mylar_y * 2 +
1078 glass0_y * 2 + glass1_y * 5 + gasLayer_y * 6;
1079 G4double z_tape_mrpc = ( pcbBoard_z - tape_mrpc_z ) / 2 - tape_mrpc_posz;
1080 new G4PVPlacement( 0, G4ThreeVector( 0, y_tape_mrpc, z_tape_mrpc ), logical_tape_mrpc,
1081 "physical_tape_mrpc_0", logical_bareChamber,
false, 0,
checkOverlap );
1082 new G4PVPlacement( 0, G4ThreeVector( 0, -1 * y_tape_mrpc, z_tape_mrpc ), logical_tape_mrpc,
1083 "physical_tape_mrpc_1", logical_bareChamber,
false, 1,
checkOverlap );
1086 G4LogicalVolume* logical_pcbBoard0 = partProduce->
lg_pcbBoard( 0,
"logical_pcbBoard0" );
1087 G4double y_pcbBoard = ( pcbBoard_y0 + pcbBoard_y1 ) / 2 + mylar_y * 2 + glass0_y * 2 +
1088 glass1_y * 5 + gasLayer_y * 6;
1089 new G4PVPlacement( 0, G4ThreeVector( 0, y_pcbBoard, 0 ), logical_pcbBoard0,
1090 "physical_pcbBoard0_0", logical_bareChamber,
false, 0,
checkOverlap );
1094 G4RotationMatrix* rot_pcbBoard =
new G4RotationMatrix();
1095 rot_pcbBoard->rotateZ( 180 * degree );
1096 new G4PVPlacement( rot_pcbBoard, G4ThreeVector( 0, -1 * y_pcbBoard, 0 ), logical_pcbBoard0,
1097 "physical_pcbBoard0_1", logical_bareChamber,
false, 1,
checkOverlap );
1099 G4LogicalVolume* logical_pcbBoard1 = partProduce->
lg_pcbBoard( 1,
"logical_pcbBoard1" );
1100 new G4PVPlacement( 0, G4ThreeVector( 0, 0, 0 ), logical_pcbBoard1,
"physical_pcbBoard1",
1104 G4AssemblyVolume* logical_strip = partProduce->
lg_strip(
"logical_strip" );
1105 G4double z_strip = ( pcbBoard_z - 12 * strip_z - 11 * strip_gap ) / 2 - strip_posz;
1106 G4Transform3D transform_strip(
1107 rot_dummy, G4ThreeVector( 0, pcbBoard_y0 / 2. - strip_y / 2 -
smallL, z_strip ) );
1108 logical_strip->MakeImprint( logical_pcbBoard0, transform_strip );
1109 transform_strip = G4Transform3D(
rot_dummy, G4ThreeVector( 0, 0, z_strip ) );
1110 logical_strip->MakeImprint( logical_pcbBoard1, transform_strip );
1113 G4LogicalVolume* logical_mylar = partProduce->
lg_mylar(
"logical_mylar" );
1115 ( mylar_y + pcbBoard_y1 ) / 2 + mylar_y + glass0_y * 2 + glass1_y * 5 + gasLayer_y * 6;
1116 G4double z_mylar = ( pcbBoard_z - mylar_z ) / 2 - mylar_posz;
1117 new G4PVPlacement( 0, G4ThreeVector( 0, y_mylar, z_mylar ), logical_mylar,
1118 "physical_mylar_0", logical_bareChamber,
false, 0,
checkOverlap );
1119 new G4PVPlacement( 0, G4ThreeVector( 0, -y_mylar, z_mylar ), logical_mylar,
1120 "physical_mylar_3", logical_bareChamber,
false, 3,
checkOverlap );
1122 y_mylar = ( mylar_y + pcbBoard_y1 ) / 2;
1123 new G4PVPlacement( 0, G4ThreeVector( 0, y_mylar, z_mylar ), logical_mylar,
1124 "physical_mylar_1", logical_bareChamber,
false, 1,
checkOverlap );
1125 new G4PVPlacement( 0, G4ThreeVector( 0, -y_mylar, z_mylar ), logical_mylar,
1126 "physical_mylar_2", logical_bareChamber,
false, 2,
checkOverlap );
1129 G4LogicalVolume* logical_glass0 = partProduce->
lg_glass( 0,
"logical_glass0" );
1131 ( glass0_y + pcbBoard_y1 ) / 2. + mylar_y + glass0_y + glass1_y * 5 + gasLayer_y * 6;
1132 G4double z_glass = ( pcbBoard_z - glass0_z ) / 2. - glass0_posz;
1133 new G4PVPlacement( 0, G4ThreeVector( 0, y_glass, z_glass ), logical_glass0,
1134 "physical_glass0_0", logical_bareChamber,
false, 0,
checkOverlap );
1135 new G4PVPlacement( 0, G4ThreeVector( 0, -y_glass, z_glass ), logical_glass0,
1136 "physical_glass0_3", logical_bareChamber,
false, 3,
checkOverlap );
1137 y_glass = pcbBoard_y1 / 2. + mylar_y + glass0_y / 2.;
1138 new G4PVPlacement( 0, G4ThreeVector( 0, y_glass, z_glass ), logical_glass0,
1139 "physical_glass0_1", logical_bareChamber,
false, 1,
checkOverlap );
1140 new G4PVPlacement( 0, G4ThreeVector( 0, -y_glass, z_glass ), logical_glass0,
1141 "physical_glass0_2", logical_bareChamber,
false, 2,
checkOverlap );
1143 G4LogicalVolume* logical_glass1 = partProduce->
lg_glass( 1,
"logical_glass1" );
1144 z_glass = ( pcbBoard_z - glass1_z ) / 2. - glass1_posz;
1145 for ( G4int i = 0; i < 5; i++ )
1147 y_glass = pcbBoard_y1 / 2. + mylar_y + glass0_y + glass1_y * ( 4.5 - i ) +
1148 gasLayer_y * ( 5 - i );
1150 name <<
"physical_glass1_" << i;
1151 new G4PVPlacement( 0, G4ThreeVector( 0, y_glass, z_glass ), logical_glass1, name.str(),
1154 name <<
"physical_glass1_" << 9 - i;
1155 new G4PVPlacement( 0, G4ThreeVector( 0, -y_glass, z_glass ), logical_glass1, name.str(),
1160 logical_gasLayer = partProduce->
lg_gasLayer(
"logical_gasLayer" );
1161 G4double y_gasLayer;
1162 G4double z_gasLayer = ( pcbBoard_z - gasLayer_z ) / 2. - gasLayer_posz;
1163 G4VPhysicalVolume* physical_gasLayer[12];
1164 for ( G4int i = 0; i < 6; i++ )
1166 y_gasLayer = pcbBoard_y1 / 2. + mylar_y + glass0_y + glass1_y * ( 5 - i ) +
1167 gasLayer_y * ( 5.5 - i );
1169 name <<
"physical_gasLayer_" << 11 - i;
1170 physical_gasLayer[i] =
1171 new G4PVPlacement( 0, G4ThreeVector( 0, -y_gasLayer, z_gasLayer ), logical_gasLayer,
1172 name.str(), logical_bareChamber,
false, 11 - i,
checkOverlap );
1174 for ( G4int i = 6; i < 12; i++ )
1176 y_gasLayer = pcbBoard_y1 / 2. + mylar_y + glass0_y + glass1_y * ( i - 6 ) +
1177 gasLayer_y * ( -5.5 + i );
1179 name <<
"physical_gasLayer_" << 11 - i;
1180 physical_gasLayer[i] =
1181 new G4PVPlacement( 0, G4ThreeVector( 0, y_gasLayer, z_gasLayer ), logical_gasLayer,
1182 name.str(), logical_bareChamber,
false, 11 - i,
checkOverlap );
1196 const G4int n_module = 36;
1197 G4double angle = 360.0 * deg / n_module;
1198 G4double z_layerIn = endcap_length / 2 - containerOut_y / 2 - lowCover1_y - layer_posz;
1199 G4double z_layerOut = endcap_length / 2 - containerOut_y / 2 - lowCover2_y - layer_posz;
1204 rOffset_east = tofPara->GetVec(
"rOffset_east" );
1205 angle_east = tofPara->GetVec(
"angle_east" );
1206 angleOffset_east = tofPara->GetVec(
"angleOffset_east" );
1207 rOffset_west = tofPara->GetVec(
"rOffset_west" );
1208 angle_west = tofPara->GetVec(
"angle_west" );
1209 angleOffset_west = tofPara->GetVec(
"angleOffset_west" );
1212 for (
int i = 0; i < n_module; i++ )
1214 G4double angle_module = startAngle_east + angle_east[i] + i * angle;
1215 G4double r_module = endcap_r + rOffset_east[i];
1217 G4RotationMatrix rot_layerIn_east;
1218 rot_layerIn_east.rotateX( 90. * deg );
1219 rot_layerIn_east.rotateZ( 90. * deg );
1220 rot_layerIn_east.rotateZ( angle_module + angleOffset_east[i] );
1222 G4ThreeVector translation_layerIn_east = G4ThreeVector(
1223 r_module *
cos( angle_module ), r_module *
sin( angle_module ), -z_layerIn );
1224 G4Transform3D transform_layerIn_east =
1225 G4Transform3D( rot_layerIn_east, translation_layerIn_east );
1227 G4RotationMatrix rot_layerOut_east;
1228 rot_layerOut_east.rotateZ( 180. * deg );
1229 rot_layerOut_east.rotateX( 90. * deg );
1230 rot_layerOut_east.rotateZ( 90. * deg );
1231 rot_layerOut_east.rotateZ( angle_module + angleOffset_east[i] );
1233 G4ThreeVector translation_layerOut_east = G4ThreeVector(
1234 r_module *
cos( angle_module ), r_module *
sin( angle_module ), z_layerOut );
1235 G4Transform3D transform_layerOut_east =
1236 G4Transform3D( rot_layerOut_east, translation_layerOut_east );
1239 name <<
"physical_mrpc_east_" << i;
1242 new G4PVPlacement( transform_layerOut_east, logical_container[3], name.str(),
1247 new G4PVPlacement( transform_layerIn_east, logical_container[0], name.str(),
1253 for (
int i = 0; i < n_module; i++ )
1255 G4double angle_module = startAngle_west + angle_west[i] + i * angle;
1256 G4double r_module = endcap_r + rOffset_west[i];
1258 G4RotationMatrix rot_layerIn_west;
1259 rot_layerIn_west.rotateZ( 180. * deg );
1260 rot_layerIn_west.rotateX( 90. * deg );
1261 rot_layerIn_west.rotateZ( 90. * deg );
1262 rot_layerIn_west.rotateZ( angle_module + angleOffset_west[i] );
1264 G4ThreeVector translation_layerIn_west = G4ThreeVector(
1265 r_module *
cos( angle_module ), r_module *
sin( angle_module ), z_layerIn );
1266 G4Transform3D transform_layerIn_west =
1267 G4Transform3D( rot_layerIn_west, translation_layerIn_west );
1269 G4RotationMatrix rot_layerOut_west;
1270 rot_layerOut_west.rotateX( 90. * deg );
1271 rot_layerOut_west.rotateZ( 90. * deg );
1272 rot_layerOut_west.rotateZ( angle_module + angleOffset_west[i] );
1274 G4ThreeVector translation_layerOut_west = G4ThreeVector(
1275 r_module *
cos( angle_module ), r_module *
sin( angle_module ), -z_layerOut );
1276 G4Transform3D transform_layerOut_west =
1277 G4Transform3D( rot_layerOut_west, translation_layerOut_west );
1280 name <<
"physical_mrpc_west_" << i;
1283 new G4PVPlacement( transform_layerOut_west, logical_container[2], name.str(),
1288 new G4PVPlacement( transform_layerIn_west, logical_container[1], name.str(),
1296 G4double a, z, density, fraction;
1297 G4int nel, natoms, ncomponents;
1298 G4String name, symbol;
1300 G4Element*
H = G4Element::GetElement(
"Hydrogen" );
1301 if ( !
H )
H =
new G4Element( name =
"Hydrogen", symbol =
"H", z = 1., a = 1.01 * g / mole );
1303 G4Element*
C = G4Element::GetElement(
"Carbon" );
1304 if ( !
C )
C =
new G4Element( name =
"Carbon", symbol =
"C", z = 6., a = 12.01 * g / mole );
1306 G4Element* F = G4Element::GetElement(
"Fluorin" );
1307 if ( !F ) F =
new G4Element( name =
"Fluorin", symbol =
"F", z = 9., a = 18.01 * g / mole );
1309 G4Element* O = G4Element::GetElement(
"Oxygen" );
1310 if ( !O ) O =
new G4Element( name =
"Oxygen", symbol =
"O", z = 8., a = 16.00 * g / mole );
1312 G4Element* N = G4Element::GetElement(
"Nitrogen" );
1313 if ( !N ) N =
new G4Element( name =
"Nitrogen", symbol =
"N", z = 7., a = 14.01 * g / mole );
1315 G4Element* S = G4Element::GetElement(
"Sulfur" );
1316 if ( !S ) S =
new G4Element( name =
"Sulfur", symbol =
"S", z = 16., a = 32.06 * g / mole );
1318 BC404 =
new G4Material(
"BC404", density = 1.032 * g / cm3, nel = 2 );
1319 BC404->AddElement(
C, 10 );
1320 BC404->AddElement(
H, 11 );
1322 BC408 =
new G4Material(
"BC408", density = 1.032 * g / cm3, nel = 2 );
1323 BC408->AddElement(
C, 1000 );
1324 BC408->AddElement(
H, 1104 );
1326 PVF =
new G4Material(
"PVF", density = 1.45 * g / cm3, nel = 3 );
1327 PVF->AddElement(
C, 2 );
1328 PVF->AddElement(
H, 3 );
1329 PVF->AddElement( F, 1 );
1332 G4Material* Cu = G4Material::GetMaterial(
"Copper" );
1333 G4Material* Al = G4Material::GetMaterial(
"Aluminium" );
1339 density = 1.4618815 * g / cm3;
1340 PMTmaterial =
new G4Material( name =
"PMTmaterial", density, 4 );
1341 PMTmaterial->AddMaterial( Al, 0.4495 );
1342 PMTmaterial->AddMaterial( Cu, 0.35 );
1343 PMTmaterial->AddMaterial( G4Material::GetMaterial(
"SiO2" ), 0.2 );
1344 PMTmaterial->AddMaterial( G4Material::GetMaterial(
"Air" ), 0.0005 );
1346 G4cout << PMTmaterial;
1348 density = 1.002 * g / cm3;
1349 G4Material* tape =
new G4Material( name =
"tape", density, nel = 2 );
1350 tape->AddElement(
C, 2 );
1351 tape->AddElement(
H, 5 );
1355 G4Material* Nylon =
new G4Material(
"Nylon", density = 1.15 * g / cm3, ncomponents = 4 );
1356 Nylon->AddElement(
C, natoms = 2 );
1357 Nylon->AddElement(
H, natoms = 3 );
1358 Nylon->AddElement( O, natoms = 1 );
1359 Nylon->AddElement( N, natoms = 1 );
1360 G4cout << Nylon << G4endl;
1363 G4Material* honeycombCore =
1364 new G4Material(
"honeycombCore", density = 0.024 * g / cm3, ncomponents = 3 );
1365 honeycombCore->AddElement(
C, natoms = 6 );
1366 honeycombCore->AddElement(
H, natoms = 10 );
1367 honeycombCore->AddElement( O, natoms = 5 );
1368 G4cout << honeycombCore << G4endl;
1372 G4Material* epoxy =
new G4Material(
"epoxy", density = 1.2 * g / cm3, ncomponents = 3 );
1373 epoxy->AddElement(
C, natoms = 11 );
1374 epoxy->AddElement(
H, natoms = 12 );
1375 epoxy->AddElement( O, natoms = 3 );
1376 G4cout << epoxy << G4endl;
1378 G4Material* insulationBoard =
1379 new G4Material(
"insulationBoard", density = 1.85 * g / cm3, 2 );
1380 insulationBoard->AddMaterial( G4Material::GetMaterial(
"SiO2" ), 0.6 );
1381 insulationBoard->AddMaterial( epoxy, 0.4 );
1382 G4cout << insulationBoard << G4endl;
1385 G4Material* PET =
new G4Material(
"PET", density = 1.39 * g / cm3, ncomponents = 3 );
1386 PET->AddElement(
C, natoms = 10 );
1387 PET->AddElement(
H, natoms = 8 );
1388 PET->AddElement( O, natoms = 4 );
1389 G4cout << PET << G4endl;
1392 G4Material* FreonR134A =
1393 new G4Material(
"FreonR134A", density = 4.241 * mg / cm3, ncomponents = 3 );
1394 FreonR134A->AddElement(
C, natoms = 2 );
1395 FreonR134A->AddElement(
H, natoms = 2 );
1396 FreonR134A->AddElement( F, natoms = 4 );
1397 G4cout << FreonR134A << G4endl;
1399 G4Material* SF6 =
new G4Material(
"SF6", density = 6.14 * mg / cm3, ncomponents = 2 );
1400 SF6->AddElement( S, natoms = 1 );
1401 SF6->AddElement( F, natoms = 6 );
1402 G4cout << SF6 << G4endl;
1404 G4Material* Isobutan =
1405 new G4Material(
"Isobutan", density = 2.487 * mg / cm3, ncomponents = 2 );
1406 Isobutan->AddElement(
C, natoms = 4 );
1407 Isobutan->AddElement(
H, natoms = 10 );
1408 G4cout << Isobutan << G4endl;
1410 G4Material* MRPCGas =
1411 new G4Material( name =
"MRPCGas", density = 4.17 * mg / cm3, ncomponents = 3 );
1412 MRPCGas->AddMaterial( FreonR134A, fraction = 89.69 * perCent );
1413 MRPCGas->AddMaterial( SF6, fraction = 7.34 * perCent );
1414 MRPCGas->AddMaterial( Isobutan, fraction = 2.97 * perCent );
1417 if ( 0.0 == MRPCGas->GetIonisation()->GetMeanEnergyPerIonPair() )
1420 MRPCGas->GetIonisation()->SetMeanEnergyPerIonPair( m_ionE * eV );
1422 G4cout << MRPCGas << G4endl;