outer air, be attention the calculation of the radius and thick of the air cylinder is special
459 {
460 int i(0);
461 double Z(0.),
A(0.),Ionization(0.),Density(0.),Radlen(0.);
462
463 G4LogicalVolume *logicalMdc = 0;
466
467
468 G4Material* mdcMaterial = logicalMdc->GetMaterial();
469
470 for(i=0; i<mdcMaterial->GetElementVector()->size(); i++){
471 Z += (mdcMaterial->GetElement(i)->GetZ())*
472 (mdcMaterial->GetFractionVector()[i]);
473 A += (mdcMaterial->GetElement(i)->GetA())*
474 (mdcMaterial->GetFractionVector()[i]);
475 }
476 Ionization = mdcMaterial->GetIonisation()->GetMeanExcitationEnergy();
477 Density = mdcMaterial->GetDensity()/(g/cm3);
478 Radlen = mdcMaterial->GetRadlen();
479 RkFitMaterial FitMdcMaterial(Z,A/g/mole,Ionization/eV,Density,Radlen/10.);
480 cout<<
"mdcgas: Z: "<<Z<<
" A: "<<(
A/(g/mole))<<
" Ionization: "<<(Ionization/eV)<<
" Density: "<<Density<<
" Radlen: "<<Radlen<<endl;
482
483
484
485 G4LogicalVolume* innerwallVolume = const_cast<G4LogicalVolume*>(GDMLProcessor::GetInstance()->GetLogicalVolume("logicalMdcSegment2"));
486 G4Material* innerwallMaterial = innerwallVolume->GetMaterial();
487 G4Tubs* innerwallTub = dynamic_cast<G4Tubs*>(innerwallVolume->GetSolid());
488
489 Z = 0.;
491 for(i=0; i<innerwallMaterial->GetElementVector()->size(); i++){
492 Z += (innerwallMaterial->GetElement(i)->GetZ())*
493 (innerwallMaterial->GetFractionVector()[i]);
494 A += (innerwallMaterial->GetElement(i)->GetA())*
495 (innerwallMaterial->GetFractionVector()[i]);
496 }
497
498 Ionization = innerwallMaterial->GetIonisation()->GetMeanExcitationEnergy();
499 Density = innerwallMaterial->GetDensity()/(g/cm3);
500 Radlen = innerwallMaterial->GetRadlen();
501 cout<<
"Mdc innerwall, Al: Z: "<<Z<<
" A: "<<(
A/(g/mole))<<
" Ionization: "<<(Ionization/eV)<<
" Density: "<<Density<<
" Radlen: "<<Radlen<<endl;
502 RkFitMaterial FitInnerwallMaterial(Z,A/g/mole,Ionization/eV,Density,Radlen/10.);
504
505
506 G4LogicalVolume *logicalBes = 0;
509
510
511 G4LogicalVolume* logicalAirVolume = const_cast<G4LogicalVolume*>(GDMLProcessor::GetInstance()->GetLogicalVolume("logicalWorld"));
512 G4Material* airMaterial = logicalAirVolume->GetMaterial();
513 Z = 0.;
515 for(i=0; i<airMaterial->GetElementVector()->size(); i++){
516 Z += (airMaterial->GetElement(i)->GetZ())*
517 (airMaterial->GetFractionVector()[i]);
518 A += (airMaterial->GetElement(i)->GetA())*
519 (airMaterial->GetFractionVector()[i]);
520 }
521 Ionization = airMaterial->GetIonisation()->GetMeanExcitationEnergy();
522 Density = airMaterial->GetDensity()/(g/cm3);
523 Radlen = airMaterial->GetRadlen();
524 cout<<
"air: Z: "<<Z<<
" A: "<<(
A/(g/mole))<<
" Ionization: "<<(Ionization/eV)<<
" Density: "<<Density<<
" Radlen: "<<Radlen<<endl;
525 RkFitMaterial FitAirMaterial(Z,A/g/mole,Ionization/eV,Density,Radlen/10.);
527
528
529 G4LogicalVolume* logicalOuterBeVolume = const_cast<G4LogicalVolume*>(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 Z += (outerBeMaterial->GetElement(i)->GetZ())*
537 (outerBeMaterial->GetFractionVector()[i]);
538 A += (outerBeMaterial->GetElement(i)->GetA())*
539 (outerBeMaterial->GetFractionVector()[i]);
540 }
541 Ionization = outerBeMaterial->GetIonisation()->GetMeanExcitationEnergy();
542 Density = outerBeMaterial->GetDensity()/(g/cm3);
543 Radlen = outerBeMaterial->GetRadlen();
544 cout<<
"outer beryllium: Z: "<<Z<<
" A: "<<(
A/(g/mole))<<
" Ionization: "<<(Ionization/eV)<<
" Density: "<<Density<<
" Radlen: "<<Radlen<<endl;
545 RkFitMaterial FitOuterBeMaterial(Z,A/g/mole,Ionization/eV,Density,Radlen/10.);
547
548
549 G4LogicalVolume* logicalOilLayerVolume = const_cast<G4LogicalVolume*>(GDMLProcessor::GetInstance()->GetLogicalVolume("logicaloilLayer"));
550 G4Material* oilLayerMaterial = logicalOilLayerVolume->GetMaterial();
551 G4Tubs* oilLayerTub = dynamic_cast<G4Tubs*>(logicalOilLayerVolume->GetSolid());
552
553 Z = 0.;
555 for(i=0; i<oilLayerMaterial->GetElementVector()->size(); i++){
556 Z += (oilLayerMaterial->GetElement(i)->GetZ())*
557 (oilLayerMaterial->GetFractionVector()[i]);
558 A += (oilLayerMaterial->GetElement(i)->GetA())*
559 (oilLayerMaterial->GetFractionVector()[i]);
560 }
561 Ionization = oilLayerMaterial->GetIonisation()->GetMeanExcitationEnergy();
562 Density = oilLayerMaterial->GetDensity()/(g/cm3);
563 Radlen = oilLayerMaterial->GetRadlen();
564 cout<<
"cooling oil: Z: "<<Z<<
" A: "<<(
A/(g/mole))<<
" Ionization: "<<(Ionization/eV)<<
" Density: "<<Density<<
" Radlen: "<<Radlen<<endl;
565 RkFitMaterial FitOilLayerMaterial(Z,A/g/mole,Ionization/eV,Density,Radlen/10.);
567
568
569
570 G4LogicalVolume* logicalInnerBeVolume = const_cast<G4LogicalVolume*>(GDMLProcessor::GetInstance()->GetLogicalVolume("logicalinnerBe"));
571
572 G4Material* innerBeMaterial = logicalInnerBeVolume->GetMaterial();
573 G4Tubs* innerBeTub = dynamic_cast<G4Tubs*>(logicalInnerBeVolume->GetSolid());
574 Z = 0.;
576 for(i=0; i<innerBeMaterial->GetElementVector()->size(); i++){
577 Z += (innerBeMaterial->GetElement(i)->GetZ())*
578 (innerBeMaterial->GetFractionVector()[i]);
579 A += (innerBeMaterial->GetElement(i)->GetA())*
580 (innerBeMaterial->GetFractionVector()[i]);
581 }
582 Ionization = innerBeMaterial->GetIonisation()->GetMeanExcitationEnergy();
583 Density = innerBeMaterial->GetDensity()/(g/cm3);
584 Radlen = innerBeMaterial->GetRadlen();
585 cout<<
"inner beryllium: Z: "<<Z<<
" A: "<<(
A/(g/mole))<<
" Ionization: "<<(Ionization/eV)<<
" Density: "<<Density<<
" Radlen: "<<Radlen<<endl;
586 RkFitMaterial FitInnerBeMaterial(Z,A/g/mole,Ionization/eV,Density,Radlen/10.);
588
589
590
591 G4LogicalVolume* logicalGoldLayerVolume = const_cast<G4LogicalVolume*>(GDMLProcessor::GetInstance()->GetLogicalVolume("logicalgoldLayer"));
592 G4Material* goldLayerMaterial = logicalGoldLayerVolume->GetMaterial();
593 G4Tubs* goldLayerTub = dynamic_cast<G4Tubs*>(logicalGoldLayerVolume->GetSolid());
594
595 Z = 0.;
597 for(i=0; i<goldLayerMaterial->GetElementVector()->size(); i++){
598 Z += (goldLayerMaterial->GetElement(i)->GetZ())*
599 (goldLayerMaterial->GetFractionVector()[i]);
600 A += (goldLayerMaterial->GetElement(i)->GetA())*
601 (goldLayerMaterial->GetFractionVector()[i]);
602 }
603 Ionization = goldLayerMaterial->GetIonisation()->GetMeanExcitationEnergy();
604 Density = goldLayerMaterial->GetDensity()/(g/cm3);
605 Radlen = goldLayerMaterial->GetRadlen();
606 cout<<
"gold layer: Z: "<<Z<<
" A: "<<(
A/(g/mole))<<
" Ionization: "<<(Ionization/eV)<<
" Density: "<<Density<<
" Radlen: "<<Radlen<<endl;
607 RkFitMaterial FitGoldLayerMaterial(Z,A/g/mole,Ionization/eV,Density,Radlen/10.);
609
610
611
612 double radius, thick, length , z0;
613
614
615 radius = innerwallTub->GetInnerRadius()/(cm);
616 thick = innerwallTub->GetOuterRadius()/(cm) - innerwallTub->GetInnerRadius()/(cm);
617 length = 2.0*innerwallTub->GetZHalfLength()/(cm);
618 z0 = 0.0;
619 cout<<"innerwall: "<<" radius: "<<radius<<" thick:"<<thick<<" length: "<<length<<endl;
622
623
624 radius = outerBeTub->GetOuterRadius()/(cm);
625 thick = innerwallTub->GetInnerRadius()/(cm) - outerBeTub->GetOuterRadius()/(cm);
626 length = 2.0*innerwallTub->GetZHalfLength()/(cm);
627 z0 = 0.0;
628 cout<<"outer air: "<<" radius: "<<radius<<" thick:"<<thick<<" length: "<<length<<endl;
631
632
633 radius = outerBeTub->GetInnerRadius()/(cm);
634 thick = outerBeTub->GetOuterRadius()/(cm) - outerBeTub->GetInnerRadius()/(cm);
635 length = 2.0*outerBeTub->GetZHalfLength()/(cm);
636 z0 = 0.0;
637 cout<<"outer Be: "<<" radius: "<<radius<<" thick:"<<thick<<" length: "<<length<<endl;
640
641
642 radius = oilLayerTub->GetInnerRadius()/(cm);
643 thick = oilLayerTub->GetOuterRadius()/(cm) - oilLayerTub->GetInnerRadius()/(cm);
644 length = 2.0*oilLayerTub->GetZHalfLength()/(cm);
645 z0 = 0.0;
646 cout<<"oil layer: "<<" radius: "<<radius<<" thick:"<<thick<<" length: "<<length<<endl;
649
650
651 radius = innerBeTub->GetInnerRadius()/(cm);
652 thick = innerBeTub->GetOuterRadius()/(cm) - innerBeTub->GetInnerRadius()/(cm);
653 length = 2.0*innerBeTub->GetZHalfLength()/(cm);
654 z0 = 0.0;
655 cout<<"inner Be: "<<" radius: "<<radius<<" thick:"<<thick<<" length: "<<length<<endl;
658
659
660 radius = goldLayerTub->GetInnerRadius()/(cm);
661 thick = goldLayerTub->GetOuterRadius()/(cm) - goldLayerTub->GetInnerRadius()/(cm);
662 length = 2.0*goldLayerTub->GetZHalfLength()/(cm);
663 z0 = 0.0;
664 cout<<"gold layer: "<<" radius: "<<radius<<" thick:"<<thick<<" length: "<<length<<endl;
667 delete aMdcG4Geo;
668 delete aBesG4Geo;
669}
Cylinder is an Element whose shape is a cylinder.
G4LogicalVolume * GetTopVolume()
Get the top(world) volume;.