3 #include "G4UIdirectory.hh" 4 #include "G4UIcmdWithAString.hh" 5 #include "G4UIcmdWithABool.hh" 6 #include "G4UIcmdWithAnInteger.hh" 7 #include "G4UIcmdWithADoubleAndUnit.hh" 8 #include "G4UIcmdWithoutParameter.hh" 9 #include "G4UnitsTable.hh" 11 #include "G4Material.hh" 15 #include "G4Polycone.hh" 16 #include "G4GenericPolycone.hh" 20 #include "G4LogicalVolume.hh" 21 #include "G4ThreeVector.hh" 22 #include "G4PVPlacement.hh" 23 #include "G4SubtractionSolid.hh" 24 #include "G4UnionSolid.hh" 25 #include "G4VisAttributes.hh" 27 #include "G4Transform3D.hh" 28 #include "G4RotationMatrix.hh" 29 #include "G4PVReplica.hh" 30 #include "G4AssemblyVolume.hh" 32 #include "G4PhysicalVolumeStore.hh" 33 #include "G4LogicalVolumeStore.hh" 34 #include "G4PVPlacement.hh" 35 #include "G4RegionStore.hh" 36 #include "G4SolidStore.hh" 37 #include "G4GeometryManager.hh" 38 #include "G4FieldManager.hh" 39 #include "G4SubtractionSolid.hh" 41 #include "G4RunManager.hh" 42 #include "G4ExceptionSeverity.hh" 44 #include "G4VisExtent.hh" 99 std::cerr <<
" Adapting for the NuMI target, short version length of graphite " 121 fRotVertical.set(CLHEP::HepRotationX(-90.0*CLHEP::deg));
129 std::cerr <<
" Adapting for the RAL target, length of graphite " 211 fRotVertical.set(CLHEP::HepRotationX(-90.0*CLHEP::deg));
218 std::cerr <<
" Adapting for the NuMI target, long version, as Optimized horns are requested. " <<
std::endl;
239 std::cerr <<
" .... done target for HornA Rev2, fTargetLengthIntoHorn " 260 Create(
"TargetUpstrMTop");
263 G4Exception(
"LBNEVolumePlacements::PlaceFinalUpstrTarget1p2MW",
"No target! ", JustWarning,
"Target has been removed");
268 Create(
"TargetNoSplitM1");
271 Create(
"TargetNoSplitHeContainer");
287 std::cerr <<
" TargetUpstrM0 placed ... " <<
std::endl;
300 plM1 =
Create(targetTopStr);
302 std::cerr <<
" .. " << targetTopStr
303 <<
" is now placed in PlaceFinalUpstrTarget1p2MW...in fTargetHorn1HallPhysPtr " <<
std::endl;
323 G4String nameTmp5(tUpUp +
std::string(
"CoolingTube"));
326 G4ThreeVector posTmp;
332 G4String vpNameTmp5(nameTmp5);
335 G4PVPlacement *vCoolingTubeTop =
new G4PVPlacement((G4RotationMatrix *) 0,
336 posTmp, infoTmp.
fCurrent, vpNameTmp5+G4String(
"_PTop"),
339 G4PVPlacement *vCoolingTubeBottom =
new G4PVPlacement((G4RotationMatrix *) 0,
354 infoTmp = itTmp->second;
356 posTmp[0] = -20.5*CLHEP::mm;
357 posTmp[1] = 24.0*CLHEP::mm;
361 G4String vpNameTmp10(nameTmp10);
362 new G4PVPlacement((G4RotationMatrix *) 0,
365 posTmp[0] = -15.5*CLHEP::mm;
366 posTmp[1] = -36.0*CLHEP::mm;
367 new G4PVPlacement((G4RotationMatrix *) 0,
370 posTmp[0] = 33.0*CLHEP::mm;
371 posTmp[1] = 5.0*CLHEP::mm;
372 new G4PVPlacement((G4RotationMatrix *) 0,
401 std::cerr <<
" Defined the container for target fin + section of cooling tube, name " 403 std::cerr <<
" Defined the container for winged target fin + section of cooling tube, name " 405 G4String nameTgtUpDownSegLeft(
"");
406 G4String nameTgtUpDownSegRight(
"");
410 plTargetCoolingTube =
Create(G4String(
"TargetNormalCoolingTube"));
411 plTargetCoolingTubeWater =
Create(G4String(
"TargetNormalCoolingTubeWater"));
418 std::vector< std::string > namesSegment(4,
"");
419 namesSegment[0] =
std::string(
"TargetFinVertTargetCutV2UpLeft");
420 namesSegment[1] =
std::string(
"TargetFinVertTargetCutV2UpRight");
421 namesSegment[2] =
std::string(
"TargetFinVertTargetCutV2DwnLeft");
422 namesSegment[3] =
std::string(
"TargetFinVertTargetCutV2DwnRight");
428 G4PVPlacement *vSegTgt[4];
430 double zCoordTmp = -1.0*plM1->
fParams[2]/2.0;
431 zCoordTmp += 0.050*CLHEP::mm;
434 std::cerr <<
" LBNEVolumePlacements::PlaceFinalUpstrTarget1p2MW, numSegHere " 444 G4ThreeVector zeroTmp(0., 0., 0.);
445 plTargetTargetWWingUpLeft =
Create(G4String(
"TargetWWingCylinderUpLeft"));
446 std::cerr <<
" plTargetTargetWWingUpLeft.... defined ... name " 448 new G4PVPlacement((G4RotationMatrix *) 0,
449 zeroTmp, plTargetTargetWWingUpLeft->
fCurrent,
452 std::cerr <<
" plTargetTargetWWingUpLeft.... Placed ... name " 454 plTargetTargetWWingUpRight =
Create(G4String(
"TargetWWingCylinderUpRight"));
455 new G4PVPlacement((G4RotationMatrix *) 0,
456 zeroTmp, plTargetTargetWWingUpRight->
fCurrent,
460 plTargetTargetWWingDwnLeft =
Create(G4String(
"TargetWWingCylinderDwnLeft"));
461 new G4PVPlacement((G4RotationMatrix *) 0,
462 zeroTmp, plTargetTargetWWingDwnLeft->
fCurrent,
465 plTargetTargetWWingDwnRight =
Create(G4String(
"TargetWWingCylinderDwnRight"));
466 new G4PVPlacement((G4RotationMatrix *) 0,
467 zeroTmp, plTargetTargetWWingDwnRight->
fCurrent,
475 posTmp[0] = -0.5*plTargetTargetCutV2UpLeft->
fParams[0] - 0.003*CLHEP::mm;
476 posTmp[1] = 0.5*plTargetTargetCutV2UpLeft->
fParams[1] + 0.003*CLHEP::mm;
478 std::cerr <<
" Placing target segments, no wings ... in volume = " << plTargetSegmentBox->
fCurrent->GetName() <<
std::endl;
479 vSegTgt[0] =
new G4PVPlacement((G4RotationMatrix *) 0,
480 posTmp, plTargetTargetCutV2UpLeft->
fCurrent,
484 vSegTgt[1] =
new G4PVPlacement((G4RotationMatrix *) 0,
485 posTmp, plTargetTargetCutV2UpRight->
fCurrent,
488 posTmp[0] = -0.5*plTargetTargetCutV2UpLeft->
fParams[0] - 0.003*CLHEP::mm;
489 posTmp[1] = -0.5*plTargetTargetCutV2UpLeft->
fParams[1] - 0.003*CLHEP::mm;
490 vSegTgt[2] =
new G4PVPlacement((G4RotationMatrix *) 0,
491 posTmp, plTargetTargetCutV2DwnLeft->
fCurrent,
495 vSegTgt[3] =
new G4PVPlacement((G4RotationMatrix *) 0,
496 posTmp, plTargetTargetCutV2DwnRight->
fCurrent,
500 G4LogicalVolume *motherForCoolingTube = 0;
501 G4LogicalVolume *theCoolingTubeV = 0;
504 for (
int kType=0; kType != 2; kType++) {
506 motherForCoolingTube = plTargetSegmentTubWWings->
fCurrent;
509 motherForCoolingTube = plTargetSegmentBox->
fCurrent;
510 theCoolingTubeV = plTargetCoolingTube->
fCurrent;
513 motherForCoolingTube = plTargetSegmentTubWWings->
fCurrent;
514 theCoolingTubeV = plTargetCoolingTubeWW->
fCurrent;
521 std::cerr <<
" Placing Cooling tube... At XYZ = " << posTmp[0]<<
"/" << posTmp[1] <<
"/" << posTmp[2] <<
" name " 522 << theCoolingTubeV->GetName() <<
std::endl;
523 std::cerr <<
" In volume " << motherForCoolingTube->GetName()
524 <<
" placing " << theCoolingTubeV->GetName() <<
std::endl;
525 new G4PVPlacement((G4RotationMatrix *) 0,
526 posTmp, theCoolingTubeV,
530 new G4PVPlacement((G4RotationMatrix *) 0,
531 posTmp, theCoolingTubeV,
536 new G4PVPlacement((G4RotationMatrix *) 0,
537 posTmp, theCoolingTubeV,
541 new G4PVPlacement((G4RotationMatrix *) 0,
542 posTmp, theCoolingTubeV,
549 G4ThreeVector posTmpWater(0., 0., 0.);
550 new G4PVPlacement((G4RotationMatrix *) 0,
551 posTmpWater, plTargetCoolingTubeWater->
fCurrent,
555 new G4PVPlacement((G4RotationMatrix *) 0,
556 posTmpWater, plTargetCoolingTubeWWWater->
fCurrent,
566 const double widthCornerOff =
fTargetFinWidth * std::sqrt(1.0 - M_PI/4);
578 const double lengthCornerOff = widthCornerOff;
579 std::cerr <<
" Dimensions for cut corners Width " << widthCornerOff
580 <<
" height " << heightCornerOff <<
std::endl;
582 G4Box* aBoxCornerOff =
new G4Box(aNameCornerOff,
583 0.5*widthCornerOff, 0.5*heightCornerOff, 0.5*lengthCornerOff);
584 G4LogicalVolume *aBoxCornerOffLV =
585 new G4LogicalVolume(aBoxCornerOff,
586 G4Material::GetMaterial(
std::string(
"HeliumTarget")), aNameCornerOff);
588 double xOffTmpUpR = 0.5*plTargetTargetCutV2UpLeft->
fParams[0] - 0.5*widthCornerOff - 0.005*CLHEP::mm;
589 double yOffTmpUpR = -0.5*plTargetTargetCutV2UpLeft->
fParams[1] + 0.5*heightCornerOff + 0.005*CLHEP::mm;
590 std::cerr <<
" .... Position of these in CutV2 volumes X = " << xOffTmpUpR <<
" Y = " << yOffTmpUpR <<
std::endl;
591 for (
size_t kCorners=0; kCorners !=4; kCorners++) {
592 double xOffTmp = xOffTmpUpR;
double yOffTmp = yOffTmpUpR;
608 const double zOffTmp = plTargetTargetCutV2UpLeft->
fParams[2]/2. - 0.5*lengthCornerOff - 0.002*CLHEP::mm;
609 G4ThreeVector posTmpOffC(xOffTmp, yOffTmp, -1.0*zOffTmp);
610 std::cerr <<
" ...locate cut corners Width X = " << xOffTmp <<
" Y " << yOffTmp <<
" Z " << zOffTmp <<
std::endl;
611 new G4PVPlacement((G4RotationMatrix *) 0,
612 posTmpOffC, aBoxCornerOffLV,
615 posTmpOffC[2] *= -1.0;
616 new G4PVPlacement((G4RotationMatrix *) 0,
617 posTmpOffC, aBoxCornerOffLV,
625 double zLastSegment = 0.;
626 std::cerr <<
"Using the container for target fin + section of cooling tube, name " 628 for (
unsigned int iSeg=0; iSeg !=
static_cast<unsigned int>(numSegHere); iSeg++, copyNumberT++) {
630 std::ostringstream cNumStrStr; cNumStrStr <<
"_Seg" << iSeg <<
"_P";
633 posTmp[2] = zCoordTmp
635 zLastSegment = posTmp[2];
638 new G4PVPlacement((G4RotationMatrix *) 0,
639 posTmp, plTargetSegmentTubWWings->
fCurrent,
640 std::string(
"TargetWWingCylinder")+cNumStrStr.str(),
642 std::cerr <<
" The cooling tube volume name is " << theCoolingTubeV->GetName() <<
std::endl;
649 new G4PVPlacement((G4RotationMatrix *) 0,
650 posTmp, plTargetSegmentBox->
fCurrent,
651 plTargetSegmentBox->
fCurrent->GetName()+cNumStrStr.str(),
662 G4ThreeVector zeroTmp(0., 0., 0.);
663 new G4PVPlacement((G4RotationMatrix *) 0,
664 zeroTmp, plCoolingTubeReturnLeftWater->
fCurrent,
665 G4String(
"TargetCoolingTubeReturnLoopLeftWater_P"),
668 new G4PVPlacement((G4RotationMatrix *) 0,
669 zeroTmp, plCoolingTubeReturnRightWater->
fCurrent,
670 G4String(
"TargetCoolingTubeReturnLoopRightWater_P"),
675 posTmp[2] = plHelium->
fParams[2]/2 -
680 std::cerr <<
" Placing TargetCoolingTubeReturnLoopLeft, front, length of helium " << plHelium->
fParams[2]/2
682 new G4PVPlacement(&plCoolingTubeReturnLeft->
fRotation,
683 posTmp, plCoolingTubeReturnLeft->
fCurrent,
684 G4String(
"TargetCoolingTubeReturnLoopLeft_P"),
687 new G4PVPlacement(&plCoolingTubeReturnRight->
fRotation,
688 posTmp, plCoolingTubeReturnRight->
fCurrent,
689 G4String(
"TargetCoolingTubeReturnLoopRight_P"),
697 Create(
"Horn1TargetDownstrHeContainerCap");
698 PlaceFinal(
"Horn1TargetDownstrHeContainerCap", vHelium);
712 const double radHRingAll = 23.85*CLHEP::mm;
713 const double radHoleLighter = 2.5*CLHEP::mm;
714 const double radCoolingTube = 3.9688*CLHEP::mm;
715 const double widthCentralPlate = 32.*CLHEP::mm;
716 const double heightCentralPlate = 26*CLHEP::mm;
717 const double StotRing = M_PI*radHRingAll*radHRingAll;
718 const double SRealRing = StotRing
719 - M_PI*(10.0*radHoleLighter*radHoleLighter + 2*radCoolingTube*radCoolingTube)
720 - widthCentralPlate*heightCentralPlate
721 + 4.0*CLHEP::mm*CLHEP::mm*(2.0*2.0)*(1.0-M_PI/4.);
723 const double radHRingInside = 21.75*CLHEP::mm;
724 const double SEffRing = StotRing - M_PI*(radHRingInside*radHRingInside);
725 const double lengthHRing = 6.0*CLHEP::mm * (SRealRing/SEffRing);
726 std::cerr <<
" Installation of holding ring. Check: SRealRing " << SRealRing
727 <<
" Seff " << SEffRing <<
" eff Length " << lengthHRing <<
std::endl;
730 G4Tubs* aHRingTub =
new G4Tubs(aHRingName, radHRingInside, radHRingAll,
731 0.5*lengthHRing, 0., 360.0*CLHEP::degree);
732 G4LogicalVolume *aHRingVolLG =
733 new G4LogicalVolume(aHRingTub, G4Material::GetMaterial(
std::string(
"Aluminum")), aHRingName);
734 const unsigned int numHRing = 7;
735 const double zHRSpacing = (zLastSegment - zCoordTmp - 15*CLHEP::mm)/(numHRing-1);
736 for (
size_t kHR=0; kHR!= 7; kHR++) {
737 const double zzHR = zCoordTmp + kHR*zHRSpacing + 7.5*CLHEP::mm;
738 G4ThreeVector posHR(0., 0., zzHR);
739 new G4PVPlacement((G4RotationMatrix *) 0, posHR, aHRingVolLG,
751 std::cerr <<
" LBNEVolumePlacements::PlaceFinalDownstrTarget1p2MW, Obsolete, do not use .. " <<
std::endl;
753 Create(
"Horn1TargetDownstrHeContainer");
774 plTargetFinExtra = &itM5->second;
777 G4ThreeVector posTmp(3, 0.);
779 G4String nameTgtUpDownSegFirst(
"Horn1TargetDownstrSegmentFirst");
782 Create(G4String(
"Horn1TargetFinVertExtraFirst")) : 0;
783 infoTargSegFirstLeft =
Create(
"Horn1TargetSegmentFirstLeft");
785 G4PVPlacement *vTargSegFirst[2];
788 posTmp[2] = infoTargSegFirstLeft->
fPosition[2];
789 vTargSegFirst[0] =
new G4PVPlacement((G4RotationMatrix *) 0,
790 posTmp, infoTargSegFirstLeft->
fCurrent,
791 G4String(
"TargetUpstrDowstrSegmentFirstLeft"),
794 vTargSegFirst[1] =
new G4PVPlacement((G4RotationMatrix *) 0,
795 posTmp, infoTargSegFirstRight->
fCurrent,
796 G4String(
"TargetUpstrDowstrSegmentFirstRight"),
798 if (plTargetFinExtr2 != 0) {
800 posTmp[1] = 0.; posTmp[2] = infoTargSegFirstLeft->
fPosition[2];
801 new G4PVPlacement((G4RotationMatrix *) 0,
806 new G4PVPlacement((G4RotationMatrix *) 0,
816 Create(G4String(
"Horn1TargetFinVertFirstHeliumSide")) : 0;
817 for (
size_t kLeftRight=0; kLeftRight !=2; kLeftRight++) {
820 G4PVPlacement *vTubeUp =
new G4PVPlacement((G4RotationMatrix *) 0,
821 posTmp, plCoolingTubeFirst->fCurrent,
822 G4String(
"Horn1TargetSegmentCoolingTubeFirst_PTop"),
825 G4PVPlacement *vTubeDown =
new G4PVPlacement((G4RotationMatrix *) 0,
826 posTmp, plCoolingTubeFirst->fCurrent,
827 G4String(
"Horn1TargetSegmentCoolingTubeFirst_PBottom"),
829 posTmp[0] = 0.; posTmp[1] = 0.; posTmp[2] = 0.;
830 new G4PVPlacement((G4RotationMatrix *) 0,
831 posTmp, plCoolingTubeWaterFirst->
fCurrent,
832 nameTgtUpDownSegFirst+G4String(
"CoolingTubeWater_PTop"),
834 new G4PVPlacement((G4RotationMatrix *) 0,
835 posTmp, plCoolingTubeWaterFirst->
fCurrent,
836 nameTgtUpDownSegFirst+G4String(
"CoolingTubeWater_PBottom"),
850 if (plTargetFinHeSide != 0) {
851 const double heThick = plTargetFinHeSide->
fParams[0];
853 posTmp[0] = (kLeftRight == 0) ? heThickShift : -1.0*heThickShift;
856 new G4PVPlacement((G4RotationMatrix *) 0,
857 posTmp, plTargetFinHeSide->
fCurrent,
858 nameTgtUpDownSegFirst+G4String(
"TargetFinVertHeSide_P"),
868 fSubVolumes.find(G4String(
"TargetUpstrDownstrSegmentLeft"));
870 fSubVolumes.find(G4String(
"TargetUpstrDownstrSegmentRight"));
874 double zCoordTmp = (infoTargSegFirstLeft == 0) ?
875 (-1.0*plDowstrHe->
fParams[2]/2. + plTargetUpstrDownstrSegmentLeft->
fParams[2]/2. + 0.005*CLHEP::mm) :
876 ( infoTargSegFirstLeft->
fPosition[2] + infoTargSegFirstLeft->
fParams[2]/2. +
877 plTargetUpstrDownstrSegmentLeft->
fParams[2]/2. + 0.002*CLHEP::mm);
878 int copyNumberT = 100;
880 std::string nameTgtUpDownSegLeft(
"Horn1TargetDownstrSegLeft");
881 std::string nameTgtUpDownSegRight(
"Horn1TargetDownstrSegRight");
885 plTargetFinExtra = &itExtraThin->second;
890 posTmp[2] = zCoordTmp;
891 std::ostringstream cNumStrStr; cNumStrStr <<
"_PDwnstr" << iSeg;
892 new G4PVPlacement((G4RotationMatrix *) 0,
893 posTmp, plTargetUpstrDownstrSegmentLeft->
fCurrent,
894 nameTgtUpDownSegLeft+cNumStrStr.str(),
898 new G4PVPlacement((G4RotationMatrix *) 0,
899 posTmp, plTargetUpstrDownstrSegmentRight->
fCurrent,
900 nameTgtUpDownSegRight+cNumStrStr.str(),
903 if (plTargetFinExtra != 0) {
906 new G4PVPlacement((G4RotationMatrix *) 0,
908 nameTgtUpDownSegLeft +
std::string(
"Extra")+cNumStrStr.str(),
911 new G4PVPlacement((G4RotationMatrix *) 0,
913 nameTgtUpDownSegRight +
std::string(
"Extra")+cNumStrStr.str(),
922 posTmp[0] = 0.; posTmp[1] = 0.;
923 posTmp[2] = plDowstrHe->
fParams[2]/2 -
926 new G4PVPlacement(&plCoolingTubeReturn->
fRotation,
927 posTmp, plCoolingTubeReturn->
fCurrent,
928 G4String(
"Horn1TargetCoolingTubeDwnRetTit_PFront"),
931 new G4PVPlacement(&plCoolingTubeReturn->
fRotation,
932 posTmp, plCoolingTubeReturn->
fCurrent,
933 G4String(
"Horn1TargetCoolingTubeDwnRetTit_PBack"),
936 Create(
"Horn1TargetCoolingTubeDwnRetWater");
937 PlaceFinal(
"Horn1TargetCoolingTubeDwnRetWater", vMHe);
939 Create(
"Horn1TargetDownstrHeContainerCap");
940 PlaceFinal(
"Horn1TargetDownstrHeContainerCap", vMHe);
945 std::vector<double> fParams(3,0.);
953 fParams[2] = 1500*CLHEP::mm;}
957 G4Tubs* aTube =
new G4Tubs(volumeName, fParams[0], fParams[1], fParams[2]/2., 0., 360.*CLHEP::deg);
959 G4LogicalVolume* fCurrent =
new G4LogicalVolume(aTube, G4Material::GetMaterial(
"Target"), volumeName);
961 G4ThreeVector posTmp; posTmp[1] = 0.; posTmp[1] = 0.;
965 new G4PVPlacement((G4RotationMatrix *) 0,
967 G4String(
"TargetSimpleCylinder_P"),
977 std::vector<double> fParams(3,0.);
980 std::string volumeName(
"TargetUsptreamSimpleCylinder");
981 G4Tubs* aTube =
new G4Tubs(volumeName, fParams[0], fParams[1], fParams[2]/2., 0., 360.*CLHEP::deg);
982 G4LogicalVolume* fCurrent =
new G4LogicalVolume(aTube, G4Material::GetMaterial(
"Target"), volumeName);
983 G4ThreeVector posTmp; posTmp[1] = 0.; posTmp[1] = 0.; posTmp[2] = 0.;
984 new G4PVPlacement((G4RotationMatrix *) 0,
986 G4String(
"TargetUsptreamSimpleCylinder_P"),
997 std::vector<double> fParams(3,0.);
1001 std::string volumeName(
"TargetUsptreamSimpleBox");
1002 G4Box* aBox =
new G4Box(volumeName, fParams[0]/2, fParams[1]/2, fParams[2]/2.);
1003 G4LogicalVolume* fCurrent =
new G4LogicalVolume(aBox, G4Material::GetMaterial(
"Target"), volumeName);
1004 G4ThreeVector posTmp; posTmp[1] = 0.; posTmp[1] = 0.; posTmp[2] = 0.;
1005 new G4PVPlacement((G4RotationMatrix *) 0,
1007 G4String(
"TargetUsptreamSimpleCylinder_P"),
1027 std::cout <<
"---Nominal number of Sphere: "<< targetNumSphereNominal <<
std::endl;
1032 double deltaNumSphere = targetNumSphereNominal - (double)
fTargetNumSphere;
1034 std::cout <<
"LBNEVolumePlacements::AdaptForMultiSphereTarget, total number of sphere: " <<
fTargetNumSphere <<
1035 "---Delta Num of Sphere: " << deltaNumSphere <<
std::endl;
1036 std::cout <<
"fTargetSLength: " <<
fTargetSLength <<
"---fTargetLengthOutsideHorn before adjustment: " 1040 std::cout <<
"Input fTargetsLengthGraphite: "<< oldLength <<
std::endl;
1043 << fMultiSphereTargetRadius<<
"x 2 + 0.005mm)"<<
std::endl;
1047 std::cout <<
"LBNEVolumePlacements::AdaptForMultiSphereTarget: Warning: re-adjust the target length from " <<
1058 G4ThreeVector posTmp;
1061 posTmp[0] = 0.; posTmp[1] = 0.;
1064 std::ostringstream cNumStrStr; cNumStrStr << iSphere;
1065 new G4PVPlacement((G4RotationMatrix *) 0, posTmp, plInfo->
fCurrent,
1066 (G4String(
"TargetUsptreamMultiSphere_P") + cNumStrStr.str()),
1074 std::cerr <<
" Entering LBNEVolumePlacements::PlaceFinalNoSplitHorn1, mother name " <<
1075 mother->GetLogicalVolume()->GetName() <<
std::endl;
1078 std::cerr <<
" Obsolete data card /LBNE/det/TargetAndHorn1RadiusBigEnough used, quit here for good ! " <<
std::endl;
1079 G4Exception(
"LBNEVolumePlacements::PlaceFinalNoSplitHorn1",
"InvalidSetup", FatalErrorInArgument,
"Wrong data card");
1081 const bool doCheckOverlapNoG4ConsBug =
false;
1089 G4ThreeVector posTmp; posTmp[0] =0.; posTmp[1] =0.;
1091 G4LogicalVolume *plugl =
new G4LogicalVolume(plugTube, G4Material::GetMaterial(
fPlugMaterial.c_str()),
"PlugInHorn1");
1093 const double posHorn1 = plMotherTop->
fPosition[2];
1095 new G4PVPlacement((G4RotationMatrix *) 0, posTmp, plugl,
"PlugInHorn1_P",
1099 std::cerr <<
"LBNEVolumePlacements::PlaceFinalNoSplitHorn1, calling for Simple Horn PolyNumber 1 " <<
std::endl;
1107 G4String nameHorn1IO(
"UpstrHorn1TransInnerOuter");
1108 G4String nameHorn1IOCont(nameHorn1IO + G4String(
"Cont"));
1110 G4PVPlacement *vHorn1IOCont =
PlaceFinal(nameHorn1IOCont, mother);
1112 std::ostringstream nameStrStr; nameStrStr << nameHorn1IO <<
"Part" << iPartIO;
1113 G4String nameStr(nameStrStr.str());
1118 const double in = 2.54*CLHEP::cm;
1129 G4PVPlacement *vTrUpst = this->
PlaceFinal(
"Horn1IOTransCont", mother);
1135 std::ostringstream nameStrStr; nameStrStr <<
"Horn1IOTransInnerPart" <<
k;
1136 G4String nameStr(nameStrStr.str());
1142 G4LogicalVolume *pCurrent =
new G4LogicalVolume(aCons, G4Material::GetMaterial(
fHorn1InnerCondMat), nameStr);
1143 G4ThreeVector posTmp; posTmp[0] = 0.; posTmp[1] = 0.;
1145 new G4PVPlacement((G4RotationMatrix *) 0, posTmp, pCurrent, nameStr +
std::string(
"_P"),
1160 std::ostringstream nameStrStr; nameStrStr <<
"Horn1IOTransOuterPart" <<
k;
1161 G4String nameStr(nameStrStr.str());
1165 G4ThreeVector posTmp; posTmp[0] = 0.; posTmp[1] = 0.;
1167 G4LogicalVolume *pCurrent =
new G4LogicalVolume(aTubs, G4Material::GetMaterial(
fHorn1AllCondMat), nameStr);
1168 new G4PVPlacement( (G4RotationMatrix *) 0, posTmp, pCurrent, nameStr +
std::string(
"_P"),
1174 G4PVPlacement *vUpst = mother;
1185 const double z21p088 = fHorn1LongRescale*21.088*in;
1188 double lengthInnerConductUpstr = z21p088 - (3.316*in*
fHorn1LongRescale) - 0.010*CLHEP::mm;
1193 double deltaZ = lengthInnerConductUpstr/numSubSect;
1194 for (
int iSub=0; iSub != numSubSect; iSub++) {
1197 const double zzEnd = zzBegin + deltaZ;
1198 std::ostringstream nameStrStr; nameStrStr <<
"Horn1UpstrSubSect" << iSub;
1199 G4String nameStr(nameStrStr.str());
1206 const double ratio10vs1 =
std::min(1.0, (zzBegin/(21.0888*in*fHorn1LongRescale)));
1207 double rMin1 = rMin1Eqn2*ratio10vs1 + (1.0-ratio10vs1)*rMin1Eqn1;
1208 const double ratio20vs1 =
std::min(1.0, (zzEnd/(21.0888*in*fHorn1LongRescale)));
1209 double rMin2 = rMin2Eqn2*ratio20vs1 + (1.0-ratio20vs1)*rMin2Eqn1;
1213 std::cerr <<
" Inner radius for section " << nameStr <<
" At zzBegin " << zzBegin <<
" to " << zzEnd
1214 <<
" rMin1 " << rMin1 <<
" rMin2 " << rMin2
1215 <<
" rMax1 " << rMax1 <<
" rMax2 " << rMax2 <<
std::endl;
1216 G4Cons *aCons =
new G4Cons(nameStr, rMin1, rMax1,rMin2, rMax2,
1217 (deltaZ - 0.005*CLHEP::mm)/2., 0., 360.0*CLHEP::deg);
1218 G4LogicalVolume *pCurrent =
new G4LogicalVolume(aCons, G4Material::GetMaterial(
fHorn1InnerCondMat), nameStr);
1219 G4ThreeVector posTmp; posTmp[0] = 0.; posTmp[1] = 0.;
1221 posTmp[2] = -1.0*(plHUpst->
fParams[2])/2. + zOffsetDrawingUpstrEdge + deltaZ/2. + iSub*deltaZ + 0.055*CLHEP::mm;
1222 std::cerr <<
" Placing section " << nameStr <<
" at z = " << posTmp[2] <<
std::endl;
1223 std::cerr <<
" Beginning of the volume with respect to upstre edge " 1224 << posTmp[2] + plHUpst->
fParams[2]/2 - deltaZ/2. <<
" downstrEdge " <<
1230 G4PVPlacement *vSub =
new G4PVPlacement((G4RotationMatrix *) 0, posTmp, pCurrent, nameStr +
std::string(
"_P"),
1234 nameStrStr.str(
""); nameStrStr.clear(); nameStrStr <<
"Horn1UpstrSubSect" << iSub <<
"Water";
1235 nameStr = nameStrStr.str();
1239 (deltaZ - 0.0075*CLHEP::mm)/2., 0., 360.0*CLHEP::deg);
1240 G4LogicalVolume *pCurrentW =
new G4LogicalVolume(aConsW, G4Material::GetMaterial(
std::string(
"Water")), nameStr);
1241 posTmp[0] = 0.; posTmp[1] = 0.; posTmp[2] =0.;
1242 new G4PVPlacement((G4RotationMatrix *) 0, posTmp, pCurrentW, nameStr +
std::string(
"_P"),
1250 G4String nameStr(
"Horn1UpstrSubSect0WeldUpstr");
1251 const double length = 12.0*CLHEP::mm;
1256 const double rTmp2 = rTmp1 + 1.8*CLHEP::mm;
1257 G4Tubs *aTubs =
new G4Tubs(nameStr, rTmp1, rTmp2,
1258 length/2. , 0., 360.0*CLHEP::deg);
1259 G4LogicalVolume *pCurrent =
new G4LogicalVolume(aTubs, G4Material::GetMaterial(
fHorn1InnerCondMat), nameStr);
1260 G4ThreeVector posTmp; posTmp[0] = 0.; posTmp[1] = 0.;
1261 posTmp[2] = -1.0*(plHUpst->
fParams[2])/2. + zOffsetDrawingUpstrEdge + length/2. + 1.0*CLHEP::mm;
1263 std::cerr <<
" Placing section " << nameStr <<
" at z = " << posTmp[2] <<
" radii " 1264 << rTmp1 <<
" , " << rTmp2 <<
" length " << length <<
std::endl;
1265 new G4PVPlacement((G4RotationMatrix *) 0, posTmp, pCurrent, nameStr +
std::string(
"_P"),
1270 const double lengthHangerRing = fHorn1LongRescale*0.750*in;
1271 std::cerr <<
" First Spider Hanger is in Horn1Upstr section " <<
std::endl;
1273 G4String nameStrFirstHanger(
"Horn1UpstrSpiderHanger");
1274 const double zPosCenterMotherVolume = -1.0*(plHUpst->
fParams[2])/2. + 2.436*in + 0.5*CLHEP::mm +
1275 19.347*in*fHorn1LongRescale + lengthHangerRing/2. ;
1279 zPosCenterMotherVolume, vUpst );
1284 G4String nameStr(
"Horn1OutrTube");
1285 const double lengthOutT = (127.550 - 1.510)*in*fHorn1LongRescale - 1.0*CLHEP::mm;
1289 G4LogicalVolume *pCurrent =
new G4LogicalVolume(aTubs, G4Material::GetMaterial(
fHorn1AllCondMat), nameStr);
1290 G4ThreeVector posTmp; posTmp[0] = 0.; posTmp[1] = 0.;
1292 posTmp[2] = -1.0*(plHUpst->
fParams[2])/2. + zShiftDrawingDownstr + zOffOut + lengthOutT/2. + 0.25*CLHEP::mm;
1293 std::cerr <<
" Installing Outer tube sptream at " << posTmp[2] <<
" lengthOutT " << lengthOutT <<
std::endl;
1294 new G4PVPlacement((G4RotationMatrix *) 0, posTmp, pCurrent, nameStr +
std::string(
"_P"),
1298 G4String nameStrOutFlUpstr(
"Horn1UpstrOutrTubeFlange");
1302 aTubs =
new G4Tubs(nameStrOutFlUpstr, rTmpOutFlUpstrInner, rTmpOutFlUpstrOuter, lengthOutFlUpstr/2.0, 0., 360.0*CLHEP::deg);
1303 pCurrent =
new G4LogicalVolume(aTubs, G4Material::GetMaterial(
fHorn1AllCondMat), nameStrOutFlUpstr);
1304 posTmp[0] = 0.; posTmp[1] = 0.;
1305 posTmp[2] = -1.0*(plHUpst->
fParams[2])/2. + zShiftDrawingDownstr + zOffOut + lengthOutFlUpstr + 0.055*CLHEP::mm;
1306 new G4PVPlacement((G4RotationMatrix *) 0, posTmp, pCurrent, nameStrOutFlUpstr +
std::string(
"_P"),
1321 deltaZ = lengthToTheNeck/numSubSect;
1322 const double zOffStart = 21.088*in*fHorn1LongRescale + 0.025*CLHEP::mm;
1324 for (
int iSub = 0; iSub != numSubSect; iSub++) {
1325 const double zzBegin = z21p088 + iSub*deltaZ;
1326 const double zzEnd = zzBegin + deltaZ;
1327 std::ostringstream nameStrStr; nameStrStr <<
"Horn1ToNeckPartM0SubSect" << iSub;
1328 nameStr = nameStrStr.str();
1333 const double rMin1 = ((numSubSect - iSub -1)*rMin1Eqn1 + ((iSub+1)*rMin1Eqn2))/numSubSect;
1334 const double rMin2 = ((numSubSect - iSub -1)*rMin2Eqn1 + ((iSub+1)*rMin2Eqn2))/numSubSect;
1338 const double lengthTmp = deltaZ - 0.050*CLHEP::mm;
1339 G4Cons *aCons =
new G4Cons(nameStr, rMin1, rMax1,rMin2, rMax2, lengthTmp/2., 0., 360.0*CLHEP::deg);
1340 G4LogicalVolume *pCurrentSu =
new G4LogicalVolume(aCons, G4Material::GetMaterial(
fHorn1InnerCondMat), nameStr);
1341 posTmp[0] = 0.; posTmp[1] = 0.;
1342 posTmp[2] = -1.0*(plHUpst->
fParams[2])/2. + zShiftDrawingDownstr + zOffStart + deltaZ/2. + iSub*deltaZ;
1343 std::cerr <<
" Installing mid section Horn1, length " << lengthTmp <<
" at Z = " << posTmp[2]
1344 <<
" Rads " << rMin1 <<
" , " << rMin2 <<
" max " << rMax1 <<
" " << rMax2 <<
std::endl;
1345 G4PVPlacement *vSub =
new G4PVPlacement((G4RotationMatrix *) 0, posTmp, pCurrentSu, nameStr +
std::string(
"_P"),
1349 nameStrStr.str(
""); nameStrStr.clear(); nameStrStr <<
"Horn1ToNeckPartM0SubSect" << iSub <<
"Water";
1350 nameStr=nameStrStr.str();
1353 (lengthTmp - 0.0075*CLHEP::mm)/2., 0., 360.0*CLHEP::deg);
1354 G4LogicalVolume *pCurrentW =
new G4LogicalVolume(aConsW, G4Material::GetMaterial(
std::string(
"Water")), nameStr);
1355 posTmp[0] = 0.; posTmp[1] = 0.; posTmp[2] =0.;
1356 new G4PVPlacement((G4RotationMatrix *) 0, posTmp, pCurrentW, nameStr +
std::string(
"_P"),
1364 posTmp[0] = 0.; posTmp[1] = 0.;
1365 double length = 24.0*CLHEP::mm;
1366 posTmp[2] = -1.0*(plHUpst->
fParams[2])/2. + z21p088 + length/2 + zShiftDrawingDownstr;
1367 double rTmp1 =
fHorn1Equations[5].GetVal(z21p088 - length - 1.0*CLHEP::mm)
1370 double rTmp2 = rTmp1 + 1.8*CLHEP::mm;
1371 G4Tubs *aTubsW =
new G4Tubs(nameStr, rTmp1, rTmp2, length/2. , 0., 360.0*CLHEP::deg);
1372 std::cerr <<
" Installing the weld " << nameStr <<
" at Z " << posTmp[2] <<
std::endl;
1373 G4LogicalVolume *pCurrentW =
new G4LogicalVolume(aTubsW, G4Material::GetMaterial(
fHorn1InnerCondMat), nameStr);
1374 new G4PVPlacement((G4RotationMatrix *) 0, posTmp, pCurrentW, nameStr +
std::string(
"_P"),
1386 nameStr = G4String(
"Horn1Neck");
1388 const double zNeckDrawing = fHorn1LongRescale*(30.3150)*in;
1389 double rTmp1 = fHorn1RadialRescale*(0.709*in/2.);
1396 const double length = fHorn1LongRescale*1.5680*in - 0.050*CLHEP::mm;
1398 G4Tubs *aTubsNe1 =
new G4Tubs(nameStr, rTmp1, rTmp2,
1399 length/2. , 0., 360.0*CLHEP::deg);
1400 G4LogicalVolume *pCurrentNe1 =
new G4LogicalVolume(aTubsNe1, G4Material::GetMaterial(
fHorn1InnerCondMat), nameStr);
1401 posTmp[0] = 0.; posTmp[1] = 0.;
1402 posTmp[2] = -1.0*(plHUpst->
fParams[2])/2. + zNeckDrawing + zShiftDrawingDownstr + length/2. + 0.025*CLHEP::mm;
1404 G4PVPlacement* vSub =
new G4PVPlacement((G4RotationMatrix *) 0, posTmp, pCurrentNe1, nameStr +
std::string(
"_P"),
1407 G4String nameStrW(nameStr); nameStrW += G4String(
"Water");
1409 length/2. , 0., 360.0*CLHEP::deg);
1410 G4LogicalVolume *pCurrentW =
new G4LogicalVolume(aTubsW,
1411 G4Material::GetMaterial(
std::string(
"Water")), nameStrW);
1412 posTmp[0] = 0.; posTmp[1] = 0.; posTmp[2] =0.;
1413 new G4PVPlacement((G4RotationMatrix *) 0, posTmp, pCurrentW, nameStrW +
std::string(
"_P"),
1419 const double zStartDrawing = fHorn1LongRescale*31.8827*in;
1420 const double zEndDrawing = fHorn1LongRescale*(41.0776)*in;
1424 deltaZ = (zEndDrawing - zStartDrawing)/numSubSect;
1425 for (
int iSub = 0; iSub != numSubSect; iSub++) {
1426 const double zzBegin = zStartDrawing + iSub*deltaZ;
1427 const double zzEnd = zzBegin + deltaZ;
1428 std::ostringstream nameStrStr; nameStrStr <<
"Horn1DownstrPart1SubSect" << iSub;
1429 nameStr = nameStrStr.str();
1436 G4Cons *aConsSuU =
new G4Cons(nameStr, rMin1, rMax1,rMin2, rMax2,
1437 (deltaZ - 0.005*CLHEP::mm)/2., 0., 360.0*CLHEP::deg);
1438 G4LogicalVolume *pCurrentSuU =
new G4LogicalVolume(aConsSuU, G4Material::GetMaterial(
fHorn1InnerCondMat), nameStr);
1439 posTmp[0] = 0.; posTmp[1] = 0.;
1440 posTmp[2] = -1.0*(plHUpst->
fParams[2])/2. + zzBegin + zShiftDrawingDownstr + deltaZ/2.;
1441 G4PVPlacement *vSub =
new G4PVPlacement((G4RotationMatrix *) 0, posTmp, pCurrentSuU, nameStr +
std::string(
"_P"),
1445 nameStrStr.str(
""); nameStrStr.clear(); nameStrStr <<
"Horn1DownstrPart1SubSect" << iSub <<
"Water";
1446 nameStr = nameStrStr.str();
1449 (deltaZ - 0.0075*CLHEP::mm)/2., 0., 360.0*CLHEP::deg);
1450 G4LogicalVolume *pCurrentWa =
new G4LogicalVolume(aConsWa, G4Material::GetMaterial(
std::string(
"Water")), nameStr);
1451 posTmp[0] = 0.; posTmp[1] = 0.; posTmp[2] =0.;
1452 new G4PVPlacement((G4RotationMatrix *) 0, posTmp, pCurrentWa, nameStr +
std::string(
"_P"),
1460 const double zWW = fHorn1LongRescale*(41.0776)*in;;
1461 const double length = 24.0*CLHEP::mm;
1464 const double rTmp2 = rTmp1 + 1.8*CLHEP::mm;
1465 G4Tubs *aTubsWW =
new G4Tubs(nameStr, rTmp1, rTmp2,
1466 length/2. , 0., 360.0*CLHEP::deg);
1467 G4LogicalVolume *pCurrentWW =
new G4LogicalVolume(aTubsWW, G4Material::GetMaterial(
fHorn1InnerCondMat), nameStr);
1468 posTmp[0] = 0.; posTmp[1] = 0.;
1469 posTmp[2] = -1.0*(plHUpst->
fParams[2])/2. + zWW + zShiftDrawingDownstr + length/2.;
1470 new G4PVPlacement((G4RotationMatrix *) 0, posTmp, pCurrentWW, nameStr +
std::string(
"_P"),
1478 const double zStartDrawing = fHorn1LongRescale*41.108*in;
1479 const double zEndDrawing = fHorn1LongRescale*117.126*in;
1483 deltaZ = (zEndDrawing - zStartDrawing)/numSubSect;
1486 for (
int iSub = 0; iSub != numSubSect; iSub++) {
1487 const double zzBegin = zStartDrawing + iSub*deltaZ;
1488 const double zzEnd = zzBegin + deltaZ;
1489 std::ostringstream nameStrStr; nameStrStr <<
"Horn1DownstrPart1SubSect" << iSub;
1490 nameStr = nameStrStr.str();
1497 G4Cons *aConsSu =
new G4Cons(nameStr, rMin1, rMax1,rMin2, rMax2,
1498 (deltaZ - 0.005*CLHEP::mm)/2., 0., 360.0*CLHEP::deg);
1499 G4LogicalVolume *pCurrentSu =
new G4LogicalVolume(aConsSu, G4Material::GetMaterial(
fHorn1InnerCondMat), nameStr);
1500 posTmp[0] = 0.; posTmp[1] = 0.;
1501 posTmp[2] = -1.0*(plHUpst->
fParams[2])/2. + zzBegin + zShiftDrawingDownstr + deltaZ/2.;
1502 G4PVPlacement *vSub =
new G4PVPlacement((G4RotationMatrix *) 0, posTmp, pCurrentSu, nameStr +
std::string(
"_P"),
1506 nameStrStr.str(
""); nameStrStr.clear(); nameStrStr <<
"Horn1DownstrPart1SubSect" << iSub <<
"Water";
1507 nameStr = nameStrStr.str();
1510 (deltaZ - 0.0075*CLHEP::mm)/2., 0., 360.0*CLHEP::deg);
1511 G4LogicalVolume *pCurrentWa =
new G4LogicalVolume(aConsWa, G4Material::GetMaterial(
std::string(
"Water")), nameStr);
1512 posTmp[0] = 0.; posTmp[1] = 0.; posTmp[2] =0.;
1513 new G4PVPlacement((G4RotationMatrix *) 0, posTmp, pCurrentWa, nameStr +
std::string(
"_P"),
1520 G4String nameStr2ndHanger(
"Horn1DownstrSecondSpiderHanger");
1521 double zLocDrawing = zStartDrawing + fHorn1LongRescale*1.416*in;
1522 double zLocPosM = -1.0*(plHUpst->
fParams[2])/2. + zLocDrawing + zShiftDrawingDownstr + 0.375*in*fHorn1LongRescale;
1526 G4String nameStrSecondHanger(
"Horn1DownstrThirdSpiderHanger");
1527 zLocDrawing = fHorn1LongRescale*(80.9951 + 1.791)*in;
1530 zLocPosM = -1.0*(plHUpst->
fParams[2])/2. + zLocDrawing + zShiftDrawingDownstr + 0.375*in*fHorn1LongRescale;
1534 std::vector<double> zLocWelds(4,0.);
1535 zLocWelds[0] = fHorn1LongRescale*61.0464*in;
1536 zLocWelds[1] = fHorn1LongRescale*81.0151*in;
1537 zLocWelds[2] = fHorn1LongRescale*100.9839*in;
1538 zLocWelds[3] = fHorn1LongRescale*116.5*in;
1542 zLocWelds[3] = fHorn1LongRescale*117.1126*in - 12.0*CLHEP::mm;
1544 for (
size_t iW=0; iW !=zLocWelds.size(); iW++) {
1545 std::ostringstream nameStrStr; nameStrStr <<
"Horn1DownstrPart1Weld" << iW+2;
1546 nameStr = nameStrStr.str();
1548 const double length = 24.0*CLHEP::mm;
1549 const double zW = zLocWelds[iW];
1552 if (iW == 3) rTmp1 += 0.150*CLHEP::mm;
1553 const double rTmp2 = rTmp1 + 1.8*CLHEP::mm;
1554 G4Tubs *aTubsWn =
new G4Tubs(nameStr, rTmp1, rTmp2,
1555 length/2. , 0., 360.0*CLHEP::deg);
1556 std::cerr <<
" Horn1, Weld " << iW <<
" volume name " << nameStr <<
" rTmp1 " 1557 << rTmp1 <<
" rTmp2 " << rTmp2 <<
std::endl;
1558 G4LogicalVolume *pCurrentWn =
new G4LogicalVolume(aTubsWn, G4Material::GetMaterial(
fHorn1InnerCondMat), nameStr);
1559 posTmp[0] = 0.; posTmp[1] = 0.;
1560 posTmp[2] = -1.0*(plHUpst->
fParams[2])/2. + zW + zShiftDrawingDownstr + length/2.;
1561 new G4PVPlacement((G4RotationMatrix *) 0, posTmp, pCurrentWn, nameStr +
std::string(
"_P"),
1568 nameStr =
std::string(
"Horn1InnerDownstrFlangePart0");
1570 const double rTmp1 = fHorn1RadialRescale*(7.750*in/2.0);
1571 const double rTmp2 = fHorn1RadialRescale*(8.50*in/2.0);;
1572 const double length = fHorn1LongRescale*(12.244 - 1.10)*in - 12.5*CLHEP::mm;
1574 G4Tubs *aTubsFl0 =
new G4Tubs(nameStr, rTmp1, rTmp2, length/2. , 0., 360.0*CLHEP::deg);
1575 G4LogicalVolume *pCurrentFl0 =
new G4LogicalVolume(aTubsFl0, G4Material::GetMaterial(
fHorn1InnerCondMat), nameStr);
1576 posTmp[0] = 0.; posTmp[1] = 0.;
1577 const double zDrawing = fHorn1LongRescale*(117.1126*in) + 12.5*CLHEP::mm;
1578 posTmp[2] = -1.0*(plHUpst->
fParams[2])/2. + zDrawing + zShiftDrawingDownstr + length/2.;
1579 new G4PVPlacement((G4RotationMatrix *) 0, posTmp, pCurrentFl0, nameStr +
std::string(
"_P"),
1584 nameStr =
std::string(
"Horn1InnerDownstrFlangePart1");
1586 const double rTmp1 = fHorn1RadialRescale*7.750*in/2.0 + 1.0*CLHEP::mm;
1587 const double rTmp2 = fHorn1RadialRescale*11.271*in/2.0 + 1.0*CLHEP::mm;
1588 const double length = fHorn1LongRescale*(1.25)*in;
1589 G4Tubs *aTubsFl1 =
new G4Tubs(nameStr, rTmp1, rTmp2, length/2. , 0., 360.0*CLHEP::deg);
1590 G4LogicalVolume *pCurrentFl1 =
new G4LogicalVolume(aTubsFl1, G4Material::GetMaterial(
fHorn1InnerCondMat), nameStr);
1591 posTmp[0] = 0.; posTmp[1] = 0.;
1592 const double zDrawing = fHorn1LongRescale*117.1126*in + fHorn1LongRescale*((12.244 - 1.10)*in + 0.5*CLHEP::mm);
1593 posTmp[2] = -1.0*(plHUpst->
fParams[2])/2. + zDrawing + zShiftDrawingDownstr + length/2.;
1594 new G4PVPlacement((G4RotationMatrix *) 0, posTmp, pCurrentFl1, nameStr +
std::string(
"_P"),
1603 nameStr = G4String(
"Horn1OuterTubeDowsntreamFlanges");
1605 const double rTmp2 = 23.5*in/2.;
1606 const double length = 3.0*in;
1608 G4Tubs *aTubsFl =
new G4Tubs(nameStr, rTmp1, rTmp2, length/2. , 0., 360.0*CLHEP::deg);
1609 G4LogicalVolume *pCurrentFl =
new G4LogicalVolume(aTubsFl, G4Material::GetMaterial(
fHorn1AllCondMat), nameStr);
1610 posTmp[0] = 0.; posTmp[1] = 0.;
1611 posTmp[2] =-1.0*(plHUpst->
fParams[2])/2. + zDrawing + zShiftDrawingDownstr + length/2.; ;
1612 new G4PVPlacement((G4RotationMatrix *) 0, posTmp, pCurrentFl, nameStr +
std::string(
"_P"),
1631 G4Exception(
"LBNEVolumePlacements::UpdateParamsForHorn1MotherPoly",
1632 " ", FatalErrorInArgument,
"Inconsistency in sizing Hor1 Polycone ");
1634 const double epsil = 0.050*CLHEP::mm;
1658 G4Exception(
"LBNEVolumePlacements::UpdateParamsForHorn1MotherPoly",
1659 " ", FatalErrorInArgument,
" The first point must be at Z =0., for consistency... ");
1668 std::cerr <<
" LBNEVolumePlacements::UpdateParamsForHorn1MotherPoly, total length of Horn1 " <<
1669 zLast <<
" Outer Radius " << rOut <<
std::endl;
1678 const bool debugIsOn =
false;
1679 if (debugIsOn) std::cerr <<
" LBNEVolumePlacements::UpdateParamsForHornMotherPolyNum, index " << iH <<
std::endl;
1681 G4Exception(
"LBNEVolumePlacements::UpdateParamsForHornsMotherPoly",
1682 " ", FatalErrorInArgument,
"Inconsistency in the number of simple Polycone Horns ");
1685 G4Exception(
"LBNEVolumePlacements::UpdateParamsForHornsMotherPoly",
1686 " ", FatalErrorInArgument,
"Inconsistency in indexing simple Polycone Horns number");
1693 std::ostringstream
message; message <<
" Inconsistency in sizing Horn Polycone " << iH;
1695 G4Exception(
"LBNEVolumePlacements::UpdateParamsForHornsMotherPoly",
1696 " ", FatalErrorInArgument, messStr.c_str());
1707 const double epsil = 0.050*CLHEP::mm;
1714 if (debugIsOn) std::cerr<<
" LBNEVolumePlacements::UpdateParamsForHornMotherPolyNum... for IH " 1727 if (debugIsOn) std::cerr<<
" ..... Delta R at k "<<
k <<
" to " <<
k+1 <<
" = " <<
1736 if (debugIsOn) std::cerr<<
" ....radial jump... at k "<<
k <<
" a " << a <<
std::endl;
1745 int np=((
int)
std::abs(fHornsPolyListRinThickZVects[iH][
k][0]-fHornsPolyListRinThickZVects[iH][
k+1][0]))+1;
1746 double rstep=(fHornsPolyListRinThickZVects[iH][
k][0]-fHornsPolyListRinThickZVects[iH][
k+1][0])/(
double)np;
1747 if (debugIsOn) std::cerr<<
" ..... ..... Parabolic section intiated at k... "<<
k <<
" a " << a <<
" c " << c <<
1749 for(
int numr=0; numr<np; numr++){
1750 double radTmp1=fHornsPolyListRinThickZVects[iH][
k][0]-numr*rstep;
1751 double zl=a*(radTmp1*radTmp1)+c-epsil;
1752 double rl = (radTmp1 > epsil) ? (radTmp1 - epsil) : radTmp1;
1778 if (dataRZT[2] > 1.0e-10) {
1780 message <<
" The first point must be at Z =0., for consistency.. Horn " << (iH +1)
1781 <<
" Z-begin " <<dataRZT[2];
1783 G4Exception(
"LBNEVolumePlacements::UpdateParamsForHornMotherPoly",
1784 " ", FatalErrorInArgument, messStr.c_str());
1791 if (debugIsOn) std::cerr <<
" LBNEVolumePlacements::UpdateParamsForHornMotherPoly, total length of Horn " << (iH + 1) <<
1801 std::ostringstream mStrStr; mStrStr
1802 <<
" The Polycones Horns must be declared in sequential order along the beam axis, \n " 1803 <<
" Upstream to downstream. Problem for Horn " 1804 << (iHH) <<
" to " << (iHH+1);
1806 G4Exception(
"LBNEVolumePlacements::UpdateParamsForHornMotherPolyNum",
1807 " ", FatalErrorInArgument, mStr.c_str());
1812 bool badLength=
false;
1813 std::ostringstream mblStrStr;
1817 mblStrStr <<
" Likely longitudinal overlap for Horn " 1818 << (iHH+1) <<
" Z End of this horn " << zCurr/
CLHEP::m <<
" meters" << std::endl
1824 mblStrStr <<
" Likely longitudinal overlap for Horn " 1825 << (iHH+1) <<
" Z End of this horn " << zCurr/
CLHEP::m <<
" meters" << std::endl
1831 G4Exception(
"LBNEVolumePlacements::UpdateParamsForHornMotherPolyNum",
1832 " ", FatalErrorInArgument, mblStr.c_str());
1837 std::ostringstream mStrStr;
1838 mStrStr <<
" Horn " << (iHH+1)
1839 <<
" will not fit easily into the Chase, outer radius too big, " <<
fHornsPolyOuterRadius[iH] <<
" meters";
1841 G4Exception(
"LBNEVolumePlacements::UpdateParamsForHornMotherPolyNum",
1842 " ", FatalErrorInArgument, mStr.c_str());
1851 if (debugIsOn) std::cerr <<
" LBNEVolumePlacements::UpdateParamsForHornMotherPolyNum, setting Horn1 length to " <<
1859 const double epsil = 0.050*CLHEP::mm;
1861 std::ostringstream aNStrStr; aNStrStr <<
"./AllHornsPolyconeParametersHorn_" << (iH+1) <<
".txt";
1863 std::ofstream fOut(aNStr.c_str());
1882 const bool debugIsOn =
false;
1883 if (debugIsOn) std::cerr <<
" LBNEVolumePlacements::PlaceFinalSimpleHornPolyNumber " << iH <<
" num segments " 1888 if (debugIsOn) std::cerr <<
" ................. innerRads size " << innerRads.size() <<
std::endl;
1893 std::vector<double> allRads(innerRads);
1894 std::vector<double> allZs(innerZs);
1895 std::vector<double> outerRads(innerRads.size(), 0.);
1896 const double epsil = 0.050*CLHEP::mm;
1897 double zMax = -1.0e23;
1898 double zMin = 1.0e23;
1899 for (
size_t k=0;
k != allZs.size();
k++) {
1900 allRads[
k] += epsil;
1902 innerRads[
k] += epsil;
1903 innerZs[
k] -= epsil;
1909 innerZs[0] += epsil;
1910 innerZs[innerZs.size()-1] -= epsil;
1912 allZs[allZs.size()-1] -= epsil;
1917 size_t nPtsHalf = innerZs.size();
1921 if (debugIsOn) std::cerr <<
" Vertical Flange thicknesses, upstream " 1922 << thickUsptream <<
" downstream " << thickDownstream <<
std::endl;
1923 for (
size_t k=0;
k != nPtsHalf;
k++) {
1924 size_t kk = nPtsHalf -1 -
k;
1925 double zzLocal = innerZs[kk];
1926 if (k == 0) zzLocal -= thickDownstream;
1927 if (kk == 0) zzLocal += thickUsptream;
1929 if (k == 1) zzLocal -= thickDownstream;
1930 if (kk == 1) zzLocal += thickUsptream;
1931 double radius = outerRads[kk];
1932 if (k == 0) radius = outerRads[kk] - thickDownstream;
1933 if (kk == 0) radius = outerRads[kk] - thickUsptream;
1934 allRads.push_back(radius);
1935 allZs.push_back(zzLocal);
1941 std::vector<double> zz(allZs);
1942 const double zMiddle = (zMax + zMin)/2.;
1943 if (debugIsOn) std::cerr <<
" .................. Zmin " << zMin <<
" max " <<
" zMax " 1944 << zMax <<
" zMiddle " << zMiddle << std::endl
1945 <<
" .................. InnerRads size " << innerRads.size() <<
std::endl;
1948 std::ostringstream aNStrStr; aNStrStr <<
"./AllHornsPolyconeParametersHornInner_" << (iH+1) <<
".txt";
1950 std::ofstream fOut(aNStr.c_str());
1952 for (
size_t k=0;
k != allZs.size();
k++) {
1953 fOut <<
" " <<
k <<
" " << zz[
k] <<
" " << allRads[
k] <<
" " <<
std::endl;
1958 std::ostringstream vNameInnerStr; vNameInnerStr <<
"Horn" << (iH+1) <<
"PolyInnerC";
1959 G4String vNameInner(vNameInnerStr.str());
1961 G4GenericPolycone* aPCon =
new G4GenericPolycone(vNameInner, 0., 360.0*CLHEP::deg, static_cast<int>(zz.size()),
1962 &allRads[0], &zz[0]);
1963 G4ThreeVector posTmp; posTmp[0] = 0.; posTmp[1] = 0.; posTmp[2] = 0.;
1964 G4LogicalVolume *pCurrent =
new G4LogicalVolume(aPCon,
1966 new G4PVPlacement((G4RotationMatrix *) 0,
1970 if (debugIsOn) std::cerr <<
" LBNEVolumePlacements::PlaceFinalSimpleHornPolyNumber ... Inner conductor placed " <<
std::endl;
1973 if (innerRads.size() < 2) {
1974 std::ostringstream mStrStr;
1975 mStrStr <<
" Horn " << (iH+1)
1976 <<
" has to few segments ( " << innerRads.size() <<
" ) to support a water layer.. Review the geometry. ";
1978 G4Exception(
"LBNEVolumePlacements::PlaceFinalSimpleHornPolyNumber",
1979 " ", JustWarning, mStr.c_str());
1984 std::vector<double> innerWaterRads((outerRads.size()-2), 0.);
1985 std::vector<double> innerWaterZs(innerWaterRads.size(), 0.);
1986 for (
size_t k=1;
k != innerRads.size()-1;
k++) {
1987 innerWaterRads[
k-1] = outerRads[
k] + 2.0*epsil;
1988 innerWaterZs[
k-1] = zz[
k];
1989 if (
k == 1) innerWaterZs[
k-1] += 2.0*thickUsptream;
1990 else if (
k == (innerRads.size()-2)) innerWaterZs[
k-1] -= 2.0*thickDownstream;
1995 size_t nPtsWHalf = innerWaterZs.size();
1996 std::vector<double> allWaterRads(innerWaterRads);
1997 std::vector<double> allWaterZs(innerWaterZs);
1999 for (
size_t k=0;
k != nPtsWHalf;
k++) {
2000 size_t kk = nPtsWHalf -1 -
k;
2002 allWaterZs.push_back(innerWaterZs[kk]);
2010 std::vector<double> zzWater(allWaterZs);
2016 std::cerr <<
".......... ... Water layer placed, nPtsWHalf " << nPtsWHalf <<
std::endl;
2017 std::ostringstream aNStrStr; aNStrStr <<
"./AllHornsPolyconeParametersHornInnerWater_" << (iH+1) <<
".txt";
2019 std::ofstream fOut(aNStr.c_str());
2021 for (
size_t k=0;
k != zzWater.size();
k++) {
2022 fOut <<
" " <<
k <<
" " << zzWater[
k] <<
" " << allWaterRads[
k] <<
" " <<
std::endl;
2026 std::ostringstream vNameInnerWStr; vNameInnerWStr <<
"Horn" << (iH+1) <<
"PolyInnerCWaterL";
2027 G4String vNameInnerW(vNameInnerWStr.str());
2028 G4GenericPolycone* aPConW5 =
new G4GenericPolycone(vNameInnerW, 0.*CLHEP::deg, 360.0*CLHEP::deg, static_cast<int>(allWaterRads.size()),
2029 &allWaterRads[0], &zzWater[0]);
2030 posTmp[0] = 0.; posTmp[1] = 0.; posTmp[2] = 0.;
2031 G4LogicalVolume *pCurrentW5 =
new G4LogicalVolume(aPConW5,
2032 G4Material::GetMaterial(
std::string(
"Water")), vNameInnerW);
2033 new G4PVPlacement((G4RotationMatrix *) 0,
2034 posTmp, pCurrentW5, vNameInnerW +
std::string(
"_P"),
2044 std::ostringstream nameOTStr; nameOTStr <<
"Horn" << (iH+1) <<
"OuterC";
2045 G4String nameOT(nameOTStr.str());
2046 G4Tubs *aTubs =
new G4Tubs(nameOT, rOuterInner, rOuterOuter, lengthOT/2., 0., 360.0*CLHEP::deg);
2047 G4LogicalVolume *pCurrentOT =
new G4LogicalVolume(aTubs, G4Material::GetMaterial(
fHorn1InnerCondMat), nameOT);
2048 new G4PVPlacement((G4RotationMatrix *) 0,
2058 const G4double in = 2.54*CLHEP::cm;
2065 double deltaNumFins = targetNumFinsNominal - (double)
fTargetNumFins;
2068 std::cerr <<
" LBNEVolumePlacements::SegmentTargetSmallTgt, total number of segments " <<
fTargetNumFins <<
2069 " Delta Num fins " << deltaNumFins <<
std::endl;
2076 std::cout <<
" LBNEVolumePlacements::SegmentTargetSmallTgt: Warning: re-adjust the target length from " <<
2077 oldLength <<
" to " << fTargetSLengthGraphite <<
" to get an integer number of 2 cm long segments " << std::endl;
2103 <<
" fTargetDistFlangeToTargetStart " << fTargetDistFlangeToTargetStart
2105 std::cerr <<
" End of LBNEVolumePlacements::SegmentTargetSmallTgt " <<
std::endl;
2114 const G4LogicalVolume *lVolMother = mother->GetLogicalVolume();
2115 std::cerr <<
" Installing the RAL target version 1 " 2121 std::cerr <<
" Installing TargetNoSplitM1 in " 2122 << lVolMotherForTargetNoSPlitM1->GetName() <<
std::endl;
2132 G4String targetNSStr =
std::string(
"TargetNoSplitM1");
2135 std::cerr <<
" .. " << targetNSStr
2136 <<
" is now placed in PlaceFinalUpstrTarget1p2MW...in fTargetHorn1HallPhysPtr " <<
std::endl;
2141 G4String targetNSHelium(
"TargetNoSplitM1Helium");
2143 G4PVPlacement *TNSvmt1 =
PlaceFinal(targetNSHelium, vMt2);
2148 G4String targetNSHeCont(
"TargetNoSplitHeContainer");
2160 G4String targetNSBaffletMoth(
"TargetNoSplitCoolingTubeFirstMoth");
2161 Create(targetNSBaffletMoth);
2167 G4String targetNSBaffletMothHe(
"TargetNoSplitCoolingTubeFirstHelium");
2168 Create(targetNSBaffletMothHe);
2169 G4PVPlacement *MothHelium =
PlaceFinal(targetNSBaffletMothHe, HeCont2);
2175 G4String targetNSBafflet(
"TargetNoSplitSimpleBafflet");
2182 G4String targetNSBaffletFlangeOut(
"TargetNoSplitSimpleBaffletFlange");
2183 Create(targetNSBaffletFlangeOut);
2185 PlaceFinal(targetNSBaffletFlangeOut, MothHelium);
2190 G4String targetNSBaffletCold(
"TargetNoSplitBaffletCold");
2191 Create(targetNSBaffletCold);
2197 G4String targetNSBaffletColdHe(
"TargetNoSplitBaffletColdHe");
2198 Create(targetNSBaffletColdHe);
2206 G4String targetBaffletFlange(
"TargetNoSplitLargeCone");
2207 Create(targetBaffletFlange);
2213 G4String targetBaffletFlangeHe(
"TargetNoSplitLargeConeHe");
2214 Create(targetBaffletFlangeHe);
2215 G4PVPlacement* vmt3 =
PlaceFinal(targetBaffletFlangeHe, HeCont3);
2219 G4String targetRingTube(
"TargetNoSplitRingTube");
2226 G4String targetNSCTube(
"TargetNoSplitCoolingTubeLast");
2235 G4String DSSupportConnection(
"TargetNoSplitDSSupportConnectionRing");
2236 Create(DSSupportConnection);
2239 G4String DSSupportAlRing(
"TargetNoSplitDSSupportAlRing");
2243 G4String DSSupportLargeCone1(
"TargetNoSplitDSSupportLargeCones");
2244 Create(DSSupportLargeCone1);
2247 G4String DSSupportHeliumLargeCone(
"TargetNoSplitDSSupportHeLargeCone");
2248 Create(DSSupportHeliumLargeCone);
2251 G4String DSSupportInnerRing(
"TargetNoSplitDSSupportInnerRing");
2252 Create(DSSupportInnerRing);
2270 const G4LogicalVolume *lVolMother = mother->GetLogicalVolume();
2271 std::cerr <<
" Installing the short (~ 1 m. long ) target, circa Feb. 2014 in mother " 2274 std::cerr <<
" Installing TargetNoSplitM1 in " 2275 << lVolMotherForTargetNoSPlitM1->GetName() <<
std::endl;
2280 G4PVPlacement *vMTop =
PlaceFinal(targetTopStr, mother);
2283 G4PVPlacement *vM0 =
PlaceFinal(targetTopStrM0, vMTop);
2284 std::cerr <<
" .. " << targetTopStr
2285 <<
" is now placed in.... " << lVolMother->GetName() <<
std::endl;
2286 G4String targetNSStr =
std::string(
"TargetNoSplitM1");
2289 std::cerr <<
" .. " << targetNSStr
2290 <<
" is now placed in PlaceFinalUpstrTarget1p2MW...in fTargetHorn1HallPhysPtr " <<
std::endl;
2329 G4String nameTmp5(tUpUp +
std::string(
"CoolingTube"));
2332 G4ThreeVector posTmp;
2344 G4String vpNameTmp5(nameTmp5);
2347 G4PVPlacement *vCoolingTubeTop =
new G4PVPlacement((G4RotationMatrix *) 0,
2348 posTmp, infoTmp.
fCurrent, vpNameTmp5+G4String(
"_PTop"),
2351 G4PVPlacement *vCoolingTubeBottom =
new G4PVPlacement((G4RotationMatrix *) 0,
2371 infoTmp = itTmp->second;
2373 posTmp[0] = -20.5*CLHEP::mm;
2374 posTmp[1] = 24.0*CLHEP::mm;
2378 G4String vpNameTmp10(nameTmp10);
2379 new G4PVPlacement((G4RotationMatrix *) 0,
2382 posTmp[0] = -15.5*CLHEP::mm;
2383 posTmp[1] = -36.0*CLHEP::mm;
2384 new G4PVPlacement((G4RotationMatrix *) 0,
2387 posTmp[0] = 33.0*CLHEP::mm;
2388 posTmp[1] = 5.0*CLHEP::mm;
2389 new G4PVPlacement((G4RotationMatrix *) 0,
2437 G4String nameTgtUpDownSegLeft(
"TargetUpstrDownstrSegmentLeft");
2439 G4String nameTgtUpDownSegRight(
"TargetUpstrDownstrSegmentRight");
2440 std::vector< std::string > namesSegment(2,
"");
2441 namesSegment[0] = nameTgtUpDownSegLeft;
2442 namesSegment[1] = nameTgtUpDownSegRight;
2444 std::cerr <<
"LBNEVolumePlacements::PlaceFinalSmallTarget1p2MW, fTargetFinExtraWidth " 2447 Create(G4String(
"TargetFinVertExtra")) : 0;
2449 Create(G4String(
"TargetFinVertHeliumSide")) : 0;
2451 Create(G4String(
"TargetFinVertHeliumRoundedUpstrLeft")) : 0;
2453 Create(G4String(
"TargetFinVertHeliumRoundedUpstrRight")) : 0;
2455 Create(G4String(
"TargetFinVertHeliumRoundedDownstrLeft")) : 0;
2457 Create(G4String(
"TargetFinVertHeliumRoundedDownstrRight")) : 0;
2458 G4PVPlacement *vSeg[2];
2459 const double zCoordTmp = -1.0*plM1->
fParams[2]/2.0 + 0.0075*CLHEP::mm;
2460 int copyNumberT = 0;
2463 posTmp[2] = zCoordTmp
2466 std::ostringstream cNumStrStrL; cNumStrStrL <<
"_PLeft" << iSeg;
2467 vSeg[0] =
new G4PVPlacement((G4RotationMatrix *) 0,
2468 posTmp, plTargetUpstrDownstrSegmentLeft->
fCurrent,
2469 nameTgtUpDownSegLeft+cNumStrStrL.str(),
2473 std::ostringstream cNumStrStrR; cNumStrStrR <<
"_PRight" << iSeg;
2474 vSeg[1] =
new G4PVPlacement((G4RotationMatrix *) 0,
2475 posTmp, plTargetUpstrDownstrSegmentRight->
fCurrent,
2476 nameTgtUpDownSegRight+cNumStrStrR.str(),
2479 if (plTargetFinExtra != 0) {
2481 new G4PVPlacement((G4RotationMatrix *) 0,
2482 posTmp, plTargetFinExtra->
fCurrent,
2483 namesSegment[0] +
std::string(
"Extra")+cNumStrStrL.str(),
2486 new G4PVPlacement((G4RotationMatrix *) 0,
2487 posTmp, plTargetFinExtra->
fCurrent,
2488 namesSegment[1] +
std::string(
"Extra")+cNumStrStrR.str(),
2495 for (
size_t kLeftRight=0; kLeftRight !=2; kLeftRight++) {
2497 std::cerr <<
" Height of the cooling tube Up... .. " << posTmp[1] <<
std::endl;
2498 std::cerr <<
" Placing cooling tube in " << vSeg[kLeftRight]->GetLogicalVolume()->GetName() <<
2500 <<
" pos H. " << posTmp[1] <<
std::endl;
2502 G4PVPlacement *vTubeUp =
new G4PVPlacement((G4RotationMatrix *) 0,
2503 posTmp, plTargetCoolingTube->
fCurrent,
2504 namesSegment[kLeftRight]+G4String(
"CoolingTubeUp_PTop"),
2508 std::cerr <<
" Height of the cooling tube Down... .. "<< posTmp[1] <<
std::endl;
2509 G4PVPlacement *vTubeDwn =
new G4PVPlacement((G4RotationMatrix *) 0,
2510 posTmp, plTargetCoolingTube->
fCurrent,
2511 namesSegment[kLeftRight]+ G4String(
"CoolingTubeUp_PBottom"),
2513 posTmp[0] = 0.; posTmp[1] = 0.; posTmp[2] = 0.;
2514 new G4PVPlacement((G4RotationMatrix *) 0,
2515 posTmp, plTargetCoolingTubeWater->
fCurrent,
2516 namesSegment[kLeftRight]+ G4String(
"CoolingTubeWater_PUp"),
2519 new G4PVPlacement((G4RotationMatrix *) 0,
2520 posTmp, plTargetCoolingTubeWater->
fCurrent,
2521 namesSegment[kLeftRight]+ G4String(
"CoolingTubeWater_PDwn"),
2539 if (plTargetFinHeSide != 0) {
2540 const double heThick = plTargetFinHeSide->
fParams[0];
2542 std::cerr <<
" Helium back fill.. width " << heThick
2544 posTmp[0] = (kLeftRight == 0) ? heThickShift : -1.0*heThickShift;
2546 new G4PVPlacement((G4RotationMatrix *) 0,
2547 posTmp, plTargetFinHeSide->
fCurrent,
2548 namesSegment[kLeftRight]+G4String(
"TargetFinVertHeSide_P"),
2554 if (kLeftRight == 0) {
2555 posTmp[2] = plTargetUpstrDownstrSegmentLeft->
fParams[2]/2. - plTargetRoundCornerDownstrLeft->
fParams[1]/2. - 0.001*CLHEP::mm;
2556 std::cerr <<
" Z shift for round cornres .. DownstrLeft " << posTmp[2] <<
" half length Target " <<
2557 plTargetUpstrDownstrSegmentLeft->
fParams[2]/2. <<
" cuboid width " <<
2560 plTargetRoundCornerDownstrLeft->
fCurrent,
2561 namesSegment[kLeftRight]+G4String(
"TargetFinVertRoundCornerDL_P"),
2565 plTargetRoundCornerUpstrLeft->
fCurrent,
2566 namesSegment[kLeftRight]+G4String(
"TargetFinVertRoundCornerUL_P"),
2569 posTmp[2] = plTargetUpstrDownstrSegmentRight->
fParams[2]/2. - plTargetRoundCornerDownstrRight->
fParams[1]/2. - 0.001*CLHEP::mm;
2571 plTargetRoundCornerDownstrRight->
fCurrent,
2572 namesSegment[kLeftRight]+G4String(
"TargetFinVertRoundCornerDR_P"),
2576 plTargetRoundCornerUpstrRight->
fCurrent,
2577 namesSegment[kLeftRight]+G4String(
"TargetFinVertRoundCornerUR_P"),
2592 std::cerr <<
" Installing the last target segment upstream of Horn1 .. " <<
std::endl;
2596 G4String nameTgtUpDownSegLastLeft(
"TargetUpstrDownstrSegmentLastLeft");
2598 G4String nameTgtUpDownSegLastRight(
"TargetUpstrDownstrSegmentLastRight");
2601 Create(G4String(
"TargetFinVertExtraLast")) : 0;
2602 namesSegment[0] = nameTgtUpDownSegLastLeft;
2603 namesSegment[1] = nameTgtUpDownSegLastRight;
2605 Create(G4String(
"TargetFinVertLastHeliumSide")) : 0;
2607 posTmp[2] = zCoordTmp + plTargetUpstrDownstrSegmentLastLeft->
fParams[2]/2. +
2609 vSeg[0] =
new G4PVPlacement((G4RotationMatrix *) 0,
2610 posTmp, plTargetUpstrDownstrSegmentLastLeft->
fCurrent,
2611 G4String(
"TargetUpstrDowstrSegmentLastLeft"),
2614 vSeg[1] =
new G4PVPlacement((G4RotationMatrix *) 0,
2615 posTmp, plTargetUpstrDownstrSegmentLastRight->
fCurrent,
2616 G4String(
"TargetUpstrDowstrSegmentLastRight"),
2618 if (plTargetFinExtraLast != 0) {
2620 new G4PVPlacement((G4RotationMatrix *) 0,
2621 posTmp, plTargetFinExtraLast->
fCurrent,
2622 std::string(
"TargetUpstrDowstrSegmentLastExtraFinLeft"),
2625 new G4PVPlacement((G4RotationMatrix *) 0,
2626 posTmp, plTargetFinExtraLast->
fCurrent,
2627 std::string(
"TargetUpstrDowstrSegmentLastExtraFinRight"),
2631 for (
size_t kLeftRight=0; kLeftRight !=2; kLeftRight++) {
2633 G4PVPlacement *vTubeUp =
new G4PVPlacement((G4RotationMatrix *) 0,
2634 posTmp, plTargetCoolingTubeLast->
fCurrent,
2635 G4String(
"TargetUpstrDownstrCoolingTubeUpLast_PTop"),
2639 G4PVPlacement *vTubeDwn =
new G4PVPlacement((G4RotationMatrix *) 0,
2640 posTmp, plTargetCoolingTubeLast->
fCurrent,
2641 G4String(
"TargetUpstrDownstrCoolingTubeUpLast_PBottom"),
2643 posTmp[0] = 0.; posTmp[1] = 0.; posTmp[2] = 0.;
2644 new G4PVPlacement((G4RotationMatrix *) 0,
2645 posTmp, plTargetCoolingTubeWaterLast->
fCurrent,
2646 namesSegment[kLeftRight]+G4String(
"CoolingTubeWater_P"),
2648 new G4PVPlacement((G4RotationMatrix *) 0,
2649 posTmp, plTargetCoolingTubeWaterLast->
fCurrent,
2650 namesSegment[kLeftRight]+G4String(
"CoolingTubeWater_P"),
2662 if (plTargetFinHeSideLast != 0) {
2663 const double heThick = plTargetFinHeSideLast->
fParams[0];
2665 posTmp[0] = (kLeftRight == 0) ? heThickShift : -1.0*heThickShift;
2667 new G4PVPlacement((G4RotationMatrix *) 0,
2668 posTmp, plTargetFinHeSideLast->
fCurrent,
2669 namesSegment[kLeftRight]+G4String(
"TargetFinVertHeSide_P"),
int GetNumberOfInnerHornSubSections(size_t eqn, double z1, double z2, int nMax) const
G4double fPlugInnerRadius
bool fInstallUpstreamHorizontalTarget
std::vector< double > fMotherHorn1AllLengths
std::vector< LBNEHornRadialEquation > fHorn1Equations
double fArbitraryOffsetHystericalOne
G4double fTargetFinHeight
void SegmentTargetSmallTgt()
G4double fTargetBaffletLengthNoFlange
G4double fTargetSLengthDownstrEnd
G4double fTargetOutHeContTubeInnerRadiusTapered
G4double fTargetLengthOutsideHorn
G4double fTargetDSSupportOuterRingLength
std::vector< G4ThreeVector > fHorn1PolyListRinThickZVects
G4double fTargetHeContTubeThickness
bool fUseLBNFOptimConceptDesignHornA
G4double fTargetDSSupportSmallConeSmallOuterRad
G4double fTargetHeContTubeLargeConeLength
G4double fTargetFinWWingRadius
void Horn1InstallSpiderHanger(const G4String &name, double zFromStartInnerConduct, double zPos, G4PVPlacement *vMother)
void PlaceFinalDownstrTarget1p2MW(G4PVPlacement *mother)
std::vector< std::vector< G4ThreeVector > > fHornsPolyListRinThickZVects
G4double fHorn1ZDEndNeckRegion
const LBNEVolumePlacementData * Find(const G4String &name, const char *motherName, const char *method) const
void PlaceFinalRALTarget(G4PVPlacement *mother)
G4double fSimpleTargetWidth
G4double fTargetFlangeThick
bool fInstallRALShortTarget
G4double fTargetHeContTubeLengthInHorn
std::vector< double > fHornsPolyOuterRadius
std::vector< G4double > fHorn1UpstrOuterIOTransPositions
std::vector< std::vector< double > > fMotherHornsAllRads
G4LogicalVolume * fCurrent
std::vector< G4double > fHorn1UpstrOuterIOTransLengths
std::vector< double > fHornsPolyZStartPos
G4double fTargetFinWidthRequired
G4double fTargetHeContTubeLargeConeOuterRad
G4bool fUseSimpleTargetBox
bool fHorn1RadiusBigEnough
G4double fTargetFinContainerWidth
G4double fTargetCTubeReturnDownstrThickTitanium
void adaptTargetFor1p2MW()
G4int fTargetNumFinsUpstr
G4String fHorn1AllCondMat
void UpdateParamsForHornMotherPolyNum(size_t iH)
G4double fTargetOutHeContTubeInnerRadius
G4double fTargetCTubeLength
G4double fTargetFinLengthSplitDwnstr
std::vector< int > fUseHornsPolyNumInnerPts
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4double fTargetOutHeContTubeOuterSphericalEndCap
G4String fHorn1InnerCondMat
void PlaceFinalNoSplitHorn1(G4PVPlacement *mother, G4PVPlacement *motherTop)
G4double fTargetDSSupportSmallConeLargeOuterRad
std::vector< G4double > fTargetHorn1InnerRadsUpstr
G4double fTargetZ0Downstr
G4double fTargetDSSupportOuterRingOuterRad
bool fUseCDR2015Optimized
G4double fTargetDSSupportSmallConeSmallInnerRad
G4RotationMatrix fRotation
G4double fTargetOutHeContTubeTaperedLength
G4double fTargetSLengthGraphite
G4double fPlugOuterRadius
G4double fBaffleInnerRadius
std::map< G4String, LBNEVolumePlacementData > fSubVolumes
std::vector< G4double > fHorn1UpstrOuterIOTransInnerRads
G4double fTargetCTubeInnerRadius
G4double fChaseWidthForLBNF
void PlaceTargetModule(int number=1)
void PlaceFinalUpstrTargetSimpleCylinder(G4PVPlacement *mother)
void DumpAllHornsPolyconeParameters()
G4double fTargetDSSupportLargeConeLength
G4double fTargetCanLength
G4double fTargetCTubeOuterRadius
G4double fZHorn1ACRNT1Shift
G4double fHorn1OuterTubeOuterRad
void PlaceFinalMultiSphereTarget(LBNEVolumePlacementData *plHelium, G4PVPlacement *mother)
G4bool fUseMultiSphereTarget
G4double fHorn1NeckInnerRadius
void AdaptForMultiSphereTarget()
std::vector< double > fParams
G4double fTargetHeContTubeSmallCylLength
G4double fTargetDSSupportAlRingInnerRad
G4double fTargetOutHeContTubeStraightLength
G4bool fUseRoundedTargetFins
int fUseNumberOfHornsPoly
G4double fTargetDownstrCanFlangeThick
std::string fPlugMaterial
unsigned int fTargetNumFinsWithWings
G4double fTargetUpstrPlateThick
std::vector< bool > fPolyconeHornsAreParabolic
G4double fTargetFinLength
G4double fTargetHeContTubeInnerRadius
G4double fDecayPipeLongPosition
void CheckHorn1InnerConductAndTargetRadii()
LBNEVolumePlacementData * Create(const G4String &name)
G4double fTargetOutHeContTubeInnerSphericalEndCap
void PlaceFinalUpstrTarget1p2MW(G4PVPlacement *mother)
G4double fTargetDSSupportLargeConeSmallInnerRad
G4double fTargetHeContTubeLargeConeInnerRad
G4double fHorn1RadialSafetyMargin
int fUseHorn1PolyNumInnerPts
G4double fTargetHeContTubeBaffletLength
G4double fTargetDSSupportLargeConeLargeOuterRad
bool fRemoveTargetAlltogether
static int max(int a, int b)
void UpdateParamsForHorn1MotherPoly()
std::vector< G4double > fHorn1UpstrInnerRadsOuterUpstr
std::vector< double > fMotherHorn1AllThick
void PlaceFinalSmallTarget1p2MW(G4PVPlacement *mother)
G4double fTargetDSSupportAlRingThickness
G4double fMultiSphereTargetRadius
void PlaceFinalSimpleHornPolyNumber(size_t iHorn, G4PVPlacement *mother)
std::vector< double > fHornsLength
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
G4bool fUseSimpleTargetCylinder
G4double fTargetHeContTubeLengthUpstr
G4double fHorn1NeckOuterRadius
G4double fHorn1RadialRescale
G4double fRALTargetRadius
void PlaceRALTGTv1(G4PVPlacement *mother)
void PlaceFinalUpstrTargetSimpleBox(G4PVPlacement *mother)
std::vector< G4double > fHorn1UpstrInnerRadsOuterDownstr
bool fCheckVolumeOverLapWC
std::vector< std::vector< double > > fMotherHornsAllThick
G4double fSimpleTargetHeight
G4double fTargetDSSupportLargeConeLargeInnerRad
G4double fTargetCTubeReturnDownstrThickWater
G4double fSimpleTargetRadius
std::vector< G4double > fHorn1UpstrOuterIOTransThicks
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
G4double fRALSimpleTargetLength
G4RotationMatrix fRotVertical
std::vector< G4double > fHorn1UpstrInnerRadsDownstr
G4bool fConstructPlugInHorn1
G4double fTargetFinSpacingLength
std::vector< G4double > fHorn1UpstrZPositions
G4double fHorn1LongRescale
std::vector< G4double > fHorn1UpstrInnerRadsUpstr
G4double fTargetLengthOutsideExtra
G4PVPlacement * PlaceFinal(const G4String &name, G4VPhysicalVolume *mother)
G4double fTargetBaffletFlangeLength
std::vector< G4double > fHorn1UpstrLengths
G4VPhysicalVolume * fTargetHorn1HallPhysPtr
G4double fTargetDSSupportConnRing
G4double fSimpleTargetLength
std::vector< double > fMotherHorn1AllRads
G4double fTargetDSSupportOuterRingInnerRad
void adaptTargetFor1p2MWSmallTgt()
G4double fTargetDSSupportSmallConeLargeInnerRad
G4double fTargetFinLengthSplitUpstr
G4double fWaterLayerThickInHorns
void configureTargetForConceptHornARev2()
G4double fTargetHeContTubeSmallConeOuterRad
G4double fTargetHeContTubeSmallConeLength
G4double fTargetFinExtraWidth
G4double fTargetBaffletOutRadius
G4double fTargetOutHeContTubeOuterRadius
G4double fTargetDSSupportSmallConeLength
G4double fTargetUpstrDwnstrMargin
G4double fTargetDSSupportLargeConeSmallOuterRad
G4double fHorn1OuterTubeInnerRad
G4double fTargetUpstrUpstrMargin
G4double fTargetAlignRingSpacing
G4double fTargetLengthIntoHorn
QTextStream & endl(QTextStream &s)
G4int fTargetNumFinsInHorn
G4double fTargetHeContTubeColdHeCurvature
G4double fTargetDistFlangeToTargetStart
G4double fTargetAndBaffleLengthApprox
G4double fTargetHeContTubeSmallConeInnerRad
std::vector< std::vector< double > > fMotherHornsAllLengths
std::vector< G4String > fHorn1IC
G4double fTargetOutHeContTubeOuterRadiusTapered
double fHorn1PolyOuterRadius