outer air, be attention the calculation of the radius and thick of the air cylinder is special
450 {
451 int i( 0 );
452 double Z( 0. ),
A( 0. ), Ionization( 0. ), Density( 0. ), Radlen( 0. );
453
454 G4LogicalVolume* logicalMdc = 0;
455 MdcG4Geo* aMdcG4Geo = new MdcG4Geo();
457
458
459 G4Material* mdcMaterial = logicalMdc->GetMaterial();
460
461 for ( i = 0; i < mdcMaterial->GetElementVector()->size(); i++ )
462 {
463 Z += ( mdcMaterial->GetElement( i )->GetZ() ) * ( mdcMaterial->GetFractionVector()[i] );
464 A += ( mdcMaterial->GetElement( i )->GetA() ) * ( mdcMaterial->GetFractionVector()[i] );
465 }
466 Ionization = mdcMaterial->GetIonisation()->GetMeanExcitationEnergy();
467 Density = mdcMaterial->GetDensity() / ( g / cm3 );
468 Radlen = mdcMaterial->GetRadlen();
469 RkFitMaterial FitMdcMaterial( Z, A / g / mole, Ionization / eV, Density, Radlen / 10. );
470 cout <<
"mdcgas: Z: " << Z <<
" A: " << (
A / ( g / mole ) )
471 << " Ionization: " << ( Ionization / eV ) << " Density: " << Density
472 << " Radlen: " << Radlen << endl;
474
475
476
477 G4LogicalVolume* innerwallVolume = const_cast<G4LogicalVolume*>(
478 GDMLProcessor::GetInstance()->GetLogicalVolume( "logicalMdcSegment2" ) );
479 G4Material* innerwallMaterial = innerwallVolume->GetMaterial();
480 G4Tubs* innerwallTub = dynamic_cast<G4Tubs*>( innerwallVolume->GetSolid() );
481
482 Z = 0.;
484 for ( i = 0; i < innerwallMaterial->GetElementVector()->size(); i++ )
485 {
486 Z += ( innerwallMaterial->GetElement( i )->GetZ() ) *
487 ( innerwallMaterial->GetFractionVector()[i] );
488 A += ( innerwallMaterial->GetElement( i )->GetA() ) *
489 ( innerwallMaterial->GetFractionVector()[i] );
490 }
491
492 Ionization = innerwallMaterial->GetIonisation()->GetMeanExcitationEnergy();
493 Density = innerwallMaterial->GetDensity() / ( g / cm3 );
494 Radlen = innerwallMaterial->GetRadlen();
495 cout <<
"Mdc innerwall, Al: Z: " << Z <<
" A: " << (
A / ( g / mole ) )
496 << " Ionization: " << ( Ionization / eV ) << " Density: " << Density
497 << " Radlen: " << Radlen << endl;
498 RkFitMaterial FitInnerwallMaterial( Z, A / g / mole, Ionization / eV, Density,
499 Radlen / 10. );
501
502
503 G4LogicalVolume* logicalBes = 0;
504 BesG4Geo* aBesG4Geo = new BesG4Geo();
506
507
508 G4LogicalVolume* logicalAirVolume = const_cast<G4LogicalVolume*>(
509 GDMLProcessor::GetInstance()->GetLogicalVolume( "logicalWorld" ) );
510 G4Material* airMaterial = logicalAirVolume->GetMaterial();
511 Z = 0.;
513 for ( i = 0; i < airMaterial->GetElementVector()->size(); i++ )
514 {
515 Z += ( airMaterial->GetElement( i )->GetZ() ) * ( airMaterial->GetFractionVector()[i] );
516 A += ( airMaterial->GetElement( i )->GetA() ) * ( airMaterial->GetFractionVector()[i] );
517 }
518 Ionization = airMaterial->GetIonisation()->GetMeanExcitationEnergy();
519 Density = airMaterial->GetDensity() / ( g / cm3 );
520 Radlen = airMaterial->GetRadlen();
521 cout <<
"air: Z: " << Z <<
" A: " << (
A / ( g / mole ) )
522 << " Ionization: " << ( Ionization / eV ) << " Density: " << Density
523 << " Radlen: " << Radlen << endl;
524 RkFitMaterial FitAirMaterial( Z, A / g / mole, Ionization / eV, Density, Radlen / 10. );
526
527
528 G4LogicalVolume* logicalOuterBeVolume = const_cast<G4LogicalVolume*>(
529 GDMLProcessor::GetInstance()->GetLogicalVolume( "logicalouterBe" ) );
530 G4Material* outerBeMaterial = logicalOuterBeVolume->GetMaterial();
531
532 G4Tubs* outerBeTub = dynamic_cast<G4Tubs*>( logicalOuterBeVolume->GetSolid() );
533 Z = 0.;
535 for ( i = 0; i < outerBeMaterial->GetElementVector()->size(); i++ )
536 {
537 Z += ( outerBeMaterial->GetElement( i )->GetZ() ) *
538 ( outerBeMaterial->GetFractionVector()[i] );
539 A += ( outerBeMaterial->GetElement( i )->GetA() ) *
540 ( outerBeMaterial->GetFractionVector()[i] );
541 }
542 Ionization = outerBeMaterial->GetIonisation()->GetMeanExcitationEnergy();
543 Density = outerBeMaterial->GetDensity() / ( g / cm3 );
544 Radlen = outerBeMaterial->GetRadlen();
545 cout <<
"outer beryllium: Z: " << Z <<
" A: " << (
A / ( g / mole ) )
546 << " Ionization: " << ( Ionization / eV ) << " Density: " << Density
547 << " Radlen: " << Radlen << endl;
548 RkFitMaterial FitOuterBeMaterial( Z, A / g / mole, Ionization / eV, Density, Radlen / 10. );
550
551
552 G4LogicalVolume* logicalOilLayerVolume = const_cast<G4LogicalVolume*>(
553 GDMLProcessor::GetInstance()->GetLogicalVolume( "logicaloilLayer" ) );
554 G4Material* oilLayerMaterial = logicalOilLayerVolume->GetMaterial();
555 G4Tubs* oilLayerTub = dynamic_cast<G4Tubs*>( logicalOilLayerVolume->GetSolid() );
556
557 Z = 0.;
559 for ( i = 0; i < oilLayerMaterial->GetElementVector()->size(); i++ )
560 {
561 Z += ( oilLayerMaterial->GetElement( i )->GetZ() ) *
562 ( oilLayerMaterial->GetFractionVector()[i] );
563 A += ( oilLayerMaterial->GetElement( i )->GetA() ) *
564 ( oilLayerMaterial->GetFractionVector()[i] );
565 }
566 Ionization = oilLayerMaterial->GetIonisation()->GetMeanExcitationEnergy();
567 Density = oilLayerMaterial->GetDensity() / ( g / cm3 );
568 Radlen = oilLayerMaterial->GetRadlen();
569 cout <<
"cooling oil: Z: " << Z <<
" A: " << (
A / ( g / mole ) )
570 << " Ionization: " << ( Ionization / eV ) << " Density: " << Density
571 << " Radlen: " << Radlen << endl;
572 RkFitMaterial FitOilLayerMaterial( Z, A / g / mole, Ionization / eV, Density, Radlen / 10. );
574
575
576 G4LogicalVolume* logicalInnerBeVolume = const_cast<G4LogicalVolume*>(
577 GDMLProcessor::GetInstance()->GetLogicalVolume( "logicalinnerBe" ) );
578
579 G4Material* innerBeMaterial = logicalInnerBeVolume->GetMaterial();
580 G4Tubs* innerBeTub = dynamic_cast<G4Tubs*>( logicalInnerBeVolume->GetSolid() );
581 Z = 0.;
583 for ( i = 0; i < innerBeMaterial->GetElementVector()->size(); i++ )
584 {
585 Z += ( innerBeMaterial->GetElement( i )->GetZ() ) *
586 ( innerBeMaterial->GetFractionVector()[i] );
587 A += ( innerBeMaterial->GetElement( i )->GetA() ) *
588 ( innerBeMaterial->GetFractionVector()[i] );
589 }
590 Ionization = innerBeMaterial->GetIonisation()->GetMeanExcitationEnergy();
591 Density = innerBeMaterial->GetDensity() / ( g / cm3 );
592 Radlen = innerBeMaterial->GetRadlen();
593 cout <<
"inner beryllium: Z: " << Z <<
" A: " << (
A / ( g / mole ) )
594 << " Ionization: " << ( Ionization / eV ) << " Density: " << Density
595 << " Radlen: " << Radlen << endl;
596 RkFitMaterial FitInnerBeMaterial( Z, A / g / mole, Ionization / eV, Density, Radlen / 10. );
598
599
600 G4LogicalVolume* logicalGoldLayerVolume = const_cast<G4LogicalVolume*>(
601 GDMLProcessor::GetInstance()->GetLogicalVolume( "logicalgoldLayer" ) );
602 G4Material* goldLayerMaterial = logicalGoldLayerVolume->GetMaterial();
603 G4Tubs* goldLayerTub = dynamic_cast<G4Tubs*>( logicalGoldLayerVolume->GetSolid() );
604
605 Z = 0.;
607 for ( i = 0; i < goldLayerMaterial->GetElementVector()->size(); i++ )
608 {
609 Z += ( goldLayerMaterial->GetElement( i )->GetZ() ) *
610 ( goldLayerMaterial->GetFractionVector()[i] );
611 A += ( goldLayerMaterial->GetElement( i )->GetA() ) *
612 ( goldLayerMaterial->GetFractionVector()[i] );
613 }
614 Ionization = goldLayerMaterial->GetIonisation()->GetMeanExcitationEnergy();
615 Density = goldLayerMaterial->GetDensity() / ( g / cm3 );
616 Radlen = goldLayerMaterial->GetRadlen();
617 cout <<
"gold layer: Z: " << Z <<
" A: " << (
A / ( g / mole ) )
618 << " Ionization: " << ( Ionization / eV ) << " Density: " << Density
619 << " Radlen: " << Radlen << endl;
620 RkFitMaterial FitGoldLayerMaterial( Z, A / g / mole, Ionization / eV, Density,
621 Radlen / 10. );
623
624
625 double radius, thick, length, z0;
626
627
628 radius = innerwallTub->GetInnerRadius() / ( cm );
629 thick = innerwallTub->GetOuterRadius() / (cm)-innerwallTub->GetInnerRadius() / ( cm );
630 length = 2.0 * innerwallTub->GetZHalfLength() / ( cm );
631 z0 = 0.0;
632 cout << "innerwall: "
633 << " radius: " << radius << " thick:" << thick << " length: " << length << endl;
636
637
638
639 radius = outerBeTub->GetOuterRadius() / ( cm );
640 thick = innerwallTub->GetInnerRadius() / (cm)-outerBeTub->GetOuterRadius() / ( cm );
641 length = 2.0 * innerwallTub->GetZHalfLength() / ( cm );
642 z0 = 0.0;
643 cout << "outer air: "
644 << " radius: " << radius << " thick:" << thick << " length: " << length << endl;
647
648
649 radius = outerBeTub->GetInnerRadius() / ( cm );
650 thick = outerBeTub->GetOuterRadius() / (cm)-outerBeTub->GetInnerRadius() / ( cm );
651 length = 2.0 * outerBeTub->GetZHalfLength() / ( cm );
652 z0 = 0.0;
653 cout << "outer Be: "
654 << " radius: " << radius << " thick:" << thick << " length: " << length << endl;
657
658
659 radius = oilLayerTub->GetInnerRadius() / ( cm );
660 thick = oilLayerTub->GetOuterRadius() / (cm)-oilLayerTub->GetInnerRadius() / ( cm );
661 length = 2.0 * oilLayerTub->GetZHalfLength() / ( cm );
662 z0 = 0.0;
663 cout << "oil layer: "
664 << " radius: " << radius << " thick:" << thick << " length: " << length << endl;
667
668
669 radius = innerBeTub->GetInnerRadius() / ( cm );
670 thick = innerBeTub->GetOuterRadius() / (cm)-innerBeTub->GetInnerRadius() / ( cm );
671 length = 2.0 * innerBeTub->GetZHalfLength() / ( cm );
672 z0 = 0.0;
673 cout << "inner Be: "
674 << " radius: " << radius << " thick:" << thick << " length: " << length << endl;
677
678
679 radius = goldLayerTub->GetInnerRadius() / ( cm );
680 thick = goldLayerTub->GetOuterRadius() / (cm)-goldLayerTub->GetInnerRadius() / ( cm );
681 length = 2.0 * goldLayerTub->GetZHalfLength() / ( cm );
682 z0 = 0.0;
683 cout << "gold layer: "
684 << " radius: " << radius << " thick:" << thick << " length: " << length << endl;
687 delete aMdcG4Geo;
688 delete aBesG4Geo;
689}
G4LogicalVolume * GetTopVolume()
Get the top(world) volume;.