outer air, be attention the calculation of the radius and thick of the air cylinder is special
461 {
462 int i(0);
463 double Z(0.),
A(0.),Ionization(0.),Density(0.),Radlen(0.);
464
465 G4LogicalVolume *logicalMdc = 0;
468
469
470 G4Material* mdcMaterial = logicalMdc->GetMaterial();
471
472 for(i=0; i<mdcMaterial->GetElementVector()->size(); i++){
473 Z += (mdcMaterial->GetElement(i)->GetZ())*
474 (mdcMaterial->GetFractionVector()[i]);
475 A += (mdcMaterial->GetElement(i)->GetA())*
476 (mdcMaterial->GetFractionVector()[i]);
477 }
478 Ionization = mdcMaterial->GetIonisation()->GetMeanExcitationEnergy();
479 Density = mdcMaterial->GetDensity()/(g/cm3);
480 Radlen = mdcMaterial->GetRadlen();
481 RkFitMaterial FitMdcMaterial(Z,A/g/mole,Ionization/eV,Density,Radlen/10.);
482 cout<<
"mdcgas: Z: "<<Z<<
" A: "<<(
A/(g/mole))<<
" Ionization: "<<(Ionization/eV)<<
" Density: "<<Density<<
" Radlen: "<<Radlen<<endl;
484
485
486
487 G4LogicalVolume* innerwallVolume = const_cast<G4LogicalVolume*>(GDMLProcessor::GetInstance()->GetLogicalVolume("logicalMdcSegment2"));
488 G4Material* innerwallMaterial = innerwallVolume->GetMaterial();
489 G4Tubs* innerwallTub = dynamic_cast<G4Tubs*>(innerwallVolume->GetSolid());
490
491 Z = 0.;
493 for(i=0; i<innerwallMaterial->GetElementVector()->size(); i++){
494 Z += (innerwallMaterial->GetElement(i)->GetZ())*
495 (innerwallMaterial->GetFractionVector()[i]);
496 A += (innerwallMaterial->GetElement(i)->GetA())*
497 (innerwallMaterial->GetFractionVector()[i]);
498 }
499
500 Ionization = innerwallMaterial->GetIonisation()->GetMeanExcitationEnergy();
501 Density = innerwallMaterial->GetDensity()/(g/cm3);
502 Radlen = innerwallMaterial->GetRadlen();
503 cout<<
"Mdc innerwall, Al: Z: "<<Z<<
" A: "<<(
A/(g/mole))<<
" Ionization: "<<(Ionization/eV)<<
" Density: "<<Density<<
" Radlen: "<<Radlen<<endl;
504 RkFitMaterial FitInnerwallMaterial(Z,A/g/mole,Ionization/eV,Density,Radlen/10.);
506
507
508 G4LogicalVolume *logicalBes = 0;
511
512
513 G4LogicalVolume* logicalAirVolume = const_cast<G4LogicalVolume*>(GDMLProcessor::GetInstance()->GetLogicalVolume("logicalWorld"));
514 G4Material* airMaterial = logicalAirVolume->GetMaterial();
515 Z = 0.;
517 for(i=0; i<airMaterial->GetElementVector()->size(); i++){
518 Z += (airMaterial->GetElement(i)->GetZ())*
519 (airMaterial->GetFractionVector()[i]);
520 A += (airMaterial->GetElement(i)->GetA())*
521 (airMaterial->GetFractionVector()[i]);
522 }
523 Ionization = airMaterial->GetIonisation()->GetMeanExcitationEnergy();
524 Density = airMaterial->GetDensity()/(g/cm3);
525 Radlen = airMaterial->GetRadlen();
526 cout<<
"air: Z: "<<Z<<
" A: "<<(
A/(g/mole))<<
" Ionization: "<<(Ionization/eV)<<
" Density: "<<Density<<
" Radlen: "<<Radlen<<endl;
527 RkFitMaterial FitAirMaterial(Z,A/g/mole,Ionization/eV,Density,Radlen/10.);
529
530
531 G4LogicalVolume* logicalOuterBeVolume = const_cast<G4LogicalVolume*>(GDMLProcessor::GetInstance()->GetLogicalVolume("logicalouterBe"));
532 G4Material* outerBeMaterial = logicalOuterBeVolume->GetMaterial();
533
534 G4Tubs* outerBeTub = dynamic_cast<G4Tubs*>(logicalOuterBeVolume->GetSolid());
535 Z = 0.;
537 for(i=0; i<outerBeMaterial->GetElementVector()->size(); i++){
538 Z += (outerBeMaterial->GetElement(i)->GetZ())*
539 (outerBeMaterial->GetFractionVector()[i]);
540 A += (outerBeMaterial->GetElement(i)->GetA())*
541 (outerBeMaterial->GetFractionVector()[i]);
542 }
543 Ionization = outerBeMaterial->GetIonisation()->GetMeanExcitationEnergy();
544 Density = outerBeMaterial->GetDensity()/(g/cm3);
545 Radlen = outerBeMaterial->GetRadlen();
546 cout<<
"outer beryllium: Z: "<<Z<<
" A: "<<(
A/(g/mole))<<
" Ionization: "<<(Ionization/eV)<<
" Density: "<<Density<<
" Radlen: "<<Radlen<<endl;
547 RkFitMaterial FitOuterBeMaterial(Z,A/g/mole,Ionization/eV,Density,Radlen/10.);
549
550
551 G4LogicalVolume* logicalOilLayerVolume = const_cast<G4LogicalVolume*>(GDMLProcessor::GetInstance()->GetLogicalVolume("logicaloilLayer"));
552 G4Material* oilLayerMaterial = logicalOilLayerVolume->GetMaterial();
553 G4Tubs* oilLayerTub = dynamic_cast<G4Tubs*>(logicalOilLayerVolume->GetSolid());
554
555 Z = 0.;
557 for(i=0; i<oilLayerMaterial->GetElementVector()->size(); i++){
558 Z += (oilLayerMaterial->GetElement(i)->GetZ())*
559 (oilLayerMaterial->GetFractionVector()[i]);
560 A += (oilLayerMaterial->GetElement(i)->GetA())*
561 (oilLayerMaterial->GetFractionVector()[i]);
562 }
563 Ionization = oilLayerMaterial->GetIonisation()->GetMeanExcitationEnergy();
564 Density = oilLayerMaterial->GetDensity()/(g/cm3);
565 Radlen = oilLayerMaterial->GetRadlen();
566 cout<<
"cooling oil: Z: "<<Z<<
" A: "<<(
A/(g/mole))<<
" Ionization: "<<(Ionization/eV)<<
" Density: "<<Density<<
" Radlen: "<<Radlen<<endl;
567 RkFitMaterial FitOilLayerMaterial(Z,A/g/mole,Ionization/eV,Density,Radlen/10.);
569
570
571
572 G4LogicalVolume* logicalInnerBeVolume = const_cast<G4LogicalVolume*>(GDMLProcessor::GetInstance()->GetLogicalVolume("logicalinnerBe"));
573
574 G4Material* innerBeMaterial = logicalInnerBeVolume->GetMaterial();
575 G4Tubs* innerBeTub = dynamic_cast<G4Tubs*>(logicalInnerBeVolume->GetSolid());
576 Z = 0.;
578 for(i=0; i<innerBeMaterial->GetElementVector()->size(); i++){
579 Z += (innerBeMaterial->GetElement(i)->GetZ())*
580 (innerBeMaterial->GetFractionVector()[i]);
581 A += (innerBeMaterial->GetElement(i)->GetA())*
582 (innerBeMaterial->GetFractionVector()[i]);
583 }
584 Ionization = innerBeMaterial->GetIonisation()->GetMeanExcitationEnergy();
585 Density = innerBeMaterial->GetDensity()/(g/cm3);
586 Radlen = innerBeMaterial->GetRadlen();
587 cout<<
"inner beryllium: Z: "<<Z<<
" A: "<<(
A/(g/mole))<<
" Ionization: "<<(Ionization/eV)<<
" Density: "<<Density<<
" Radlen: "<<Radlen<<endl;
588 RkFitMaterial FitInnerBeMaterial(Z,A/g/mole,Ionization/eV,Density,Radlen/10.);
590
591
592
593 G4LogicalVolume* logicalGoldLayerVolume = const_cast<G4LogicalVolume*>(GDMLProcessor::GetInstance()->GetLogicalVolume("logicalgoldLayer"));
594 G4Material* goldLayerMaterial = logicalGoldLayerVolume->GetMaterial();
595 G4Tubs* goldLayerTub = dynamic_cast<G4Tubs*>(logicalGoldLayerVolume->GetSolid());
596
597 Z = 0.;
599 for(i=0; i<goldLayerMaterial->GetElementVector()->size(); i++){
600 Z += (goldLayerMaterial->GetElement(i)->GetZ())*
601 (goldLayerMaterial->GetFractionVector()[i]);
602 A += (goldLayerMaterial->GetElement(i)->GetA())*
603 (goldLayerMaterial->GetFractionVector()[i]);
604 }
605 Ionization = goldLayerMaterial->GetIonisation()->GetMeanExcitationEnergy();
606 Density = goldLayerMaterial->GetDensity()/(g/cm3);
607 Radlen = goldLayerMaterial->GetRadlen();
608 cout<<
"gold layer: Z: "<<Z<<
" A: "<<(
A/(g/mole))<<
" Ionization: "<<(Ionization/eV)<<
" Density: "<<Density<<
" Radlen: "<<Radlen<<endl;
609 RkFitMaterial FitGoldLayerMaterial(Z,A/g/mole,Ionization/eV,Density,Radlen/10.);
611
612
613
614 double radius, thick, length , z0;
615
616
617 radius = innerwallTub->GetInnerRadius()/(cm);
618 thick = innerwallTub->GetOuterRadius()/(cm) - innerwallTub->GetInnerRadius()/(cm);
619 length = 2.0*innerwallTub->GetZHalfLength()/(cm);
620 z0 = 0.0;
621 cout<<"innerwall: "<<" radius: "<<radius<<" thick:"<<thick<<" length: "<<length<<endl;
624
625
626 radius = outerBeTub->GetOuterRadius()/(cm);
627 thick = innerwallTub->GetInnerRadius()/(cm) - outerBeTub->GetOuterRadius()/(cm);
628 length = 2.0*innerwallTub->GetZHalfLength()/(cm);
629 z0 = 0.0;
630 cout<<"outer air: "<<" radius: "<<radius<<" thick:"<<thick<<" length: "<<length<<endl;
633
634
635 radius = outerBeTub->GetInnerRadius()/(cm);
636 thick = outerBeTub->GetOuterRadius()/(cm) - outerBeTub->GetInnerRadius()/(cm);
637 length = 2.0*outerBeTub->GetZHalfLength()/(cm);
638 z0 = 0.0;
639 cout<<"outer Be: "<<" radius: "<<radius<<" thick:"<<thick<<" length: "<<length<<endl;
642
643
644 radius = oilLayerTub->GetInnerRadius()/(cm);
645 thick = oilLayerTub->GetOuterRadius()/(cm) - oilLayerTub->GetInnerRadius()/(cm);
646 length = 2.0*oilLayerTub->GetZHalfLength()/(cm);
647 z0 = 0.0;
648 cout<<"oil layer: "<<" radius: "<<radius<<" thick:"<<thick<<" length: "<<length<<endl;
651
652
653 radius = innerBeTub->GetInnerRadius()/(cm);
654 thick = innerBeTub->GetOuterRadius()/(cm) - innerBeTub->GetInnerRadius()/(cm);
655 length = 2.0*innerBeTub->GetZHalfLength()/(cm);
656 z0 = 0.0;
657 cout<<"inner Be: "<<" radius: "<<radius<<" thick:"<<thick<<" length: "<<length<<endl;
660
661
662 radius = goldLayerTub->GetInnerRadius()/(cm);
663 thick = goldLayerTub->GetOuterRadius()/(cm) - goldLayerTub->GetInnerRadius()/(cm);
664 length = 2.0*goldLayerTub->GetZHalfLength()/(cm);
665 z0 = 0.0;
666 cout<<"gold layer: "<<" radius: "<<radius<<" thick:"<<thick<<" length: "<<length<<endl;
669 delete aMdcG4Geo;
670 delete aBesG4Geo;
671}
Cylinder is an Element whose shape is a cylinder.
G4LogicalVolume * GetTopVolume()
Get the top(world) volume;.