5 #include "G4UIdirectory.hh" 6 #include "G4UIcmdWithAString.hh" 7 #include "G4UIcmdWithABool.hh" 8 #include "G4UIcmdWithAnInteger.hh" 9 #include "G4UIcmdWithADoubleAndUnit.hh" 10 #include "G4UIcmdWithoutParameter.hh" 11 #include "G4UnitsTable.hh" 13 #include "G4Material.hh" 16 #include "G4Polycone.hh" 19 #include "G4Polycone.hh" 20 #include "G4GenericPolycone.hh" 22 #include "G4Sphere.hh" 23 #include "G4LogicalVolume.hh" 24 #include "G4ThreeVector.hh" 25 #include "G4PVPlacement.hh" 26 #include "G4SubtractionSolid.hh" 27 #include "G4UnionSolid.hh" 28 #include "G4VisAttributes.hh" 30 #include "G4Transform3D.hh" 31 #include "G4RotationMatrix.hh" 32 #include "G4PVReplica.hh" 33 #include "G4AssemblyVolume.hh" 35 #include "G4PhysicalVolumeStore.hh" 36 #include "G4LogicalVolumeStore.hh" 37 #include "G4PVPlacement.hh" 38 #include "G4RegionStore.hh" 39 #include "G4SolidStore.hh" 40 #include "G4GeometryManager.hh" 41 #include "G4FieldManager.hh" 42 #include "G4SubtractionSolid.hh" 44 #include "G4RunManager.hh" 45 #include "G4ExceptionSeverity.hh" 47 #include "G4VisExtent.hh" 95 const G4double in = 2.54*CLHEP::cm;
193 const double lEffCTubeReturnDownstr = 2.0*(0.6*in) + 15*CLHEP::mm;
194 const double vCTubeReturnDownstrTitanium = lEffCTubeReturnDownstr*M_PI*
196 const double vCTubeReturnDownstrWater = lEffCTubeReturnDownstr*M_PI*
205 vCTubeReturnDownstrTitanium/(M_PI*aWedgeRelSize*aSurfWedge);
207 vCTubeReturnDownstrWater/(M_PI*aWedgeRelSize*aSurfWedge);
282 const double aTotalPseudoTargetHorn1Length =
323 std::cerr <<
"Using the RAL adapt and segment options" <<
std::endl;
331 std::cerr <<
"Using the adapt and segment options for the small target" <<
std::endl;
335 std::cerr <<
"Using the adapt and segment options for the 1p2MW target" <<
std::endl;
391 char* g4lbne_path =
getenv(
"G4LBNE_DIR");
392 if(g4lbne_path == NULL) {
393 std::cout<<
"You have not set $G4LBNE_DIR.... I'm assuming it's your current working directory. Please set $G4LBNE_DIR to the top level directory of your g4lbne installation if that's not the case."<<
std::endl;
394 g4lbne_path =
static_cast<char *
>(malloc(4));
395 strncpy(g4lbne_path,
"./\0",3);
485 std::cerr <<
" LBNEVolumePlacements::SegmentTarget, NuMI style, long tgt, 1p2 MW " <<
std::endl;
486 const G4double in = 2.54*CLHEP::cm;
514 double deltaNumFins = targetNumFinsNominal - (double)
fTargetNumFins;
527 std::cout <<
" LBNEVolumePlacements::segmentTarget: Warning: re-adjust the target length from " <<
528 oldLength <<
" to " << fTargetSLengthGraphite <<
" to get an integer number of 2 cm long segments " << std::endl;
546 if (( fTargetFinLengthSplitDwnstr < 0.) ||
548 (fTargetFinLengthSplitUpstr < 0.) ||
551 std::ostringstream mStrStr;
552 mStrStr <<
" Odd length for the splitted fin ..." << fTargetFinLengthSplitUpstr <<
" Downstr " <<
553 fTargetFinLengthSplitDwnstr <<
" tempNFins = " << tempNFins <<
std::endl;
554 G4String mStr(mStrStr.str());
555 G4Exception(
"LBNEVolumePlacements::SegmentTarget",
" ", JustWarning, mStr.c_str());
584 const G4double in = 2.54*CLHEP::cm;
598 double deltaNumFins = targetNumFinsNominal - (double)
fTargetNumFins;
608 std::cout <<
" LBNEVolumePlacements::setEntireTargetDims: Warning: re-adjust the target length from " <<
609 oldLength <<
" to " << fTargetSLengthGraphite <<
" to get an integer number of 2 cm long segments " <<
std::endl;
644 std::ostringstream mStrStr;
645 mStrStr <<
" Volume named " <<
std::string(name) <<
" Already defined. Fatal ";
646 G4String mStr(mStrStr.str());
647 G4Exception(
"LBNEVolumePlacements::Create",
" ", FatalErrorInArgument, mStr.c_str());
650 const G4double in = 2.54*CLHEP::cm;
657 info.
fPosition = G4ThreeVector(0., 0., 0.);
662 if (name == G4String(
"Tunnel")) {
667 std::cerr <<
" Total half length of the tunnel " << info.
fParams[2]/2. <<
std::endl;
668 std::cerr <<
" Total half Height of the tunnel " << info.
fParams[1]/2. <<
std::endl;
669 std::cerr <<
" Total half Width of the tunnel " << info.
fParams[0]/2. <<
std::endl;
671 info.
fCurrent =
new G4LogicalVolume(hallBox, G4Material::GetMaterial(
"Air"), name);
674 if (name == G4String(
"TargetHallAndHorn1")) {
679 std::cout <<
"We are going to use the Target Module set-up" <<
std::endl;
682 std::cout <<
"We are also going to use a 2nd mirror image target module" <<
std::endl;
688 for (
size_t k=0;
k != 2; ++
k)
705 info.
fParams[2] = totalLengthHorn1 + totalLengthUpstr;
713 " Defining length for mother of Horn1 and Target , fHorn1DownstreamPlateLength " 715 std::cerr <<
" ............. fHorn1Length " <<
fHorn1Length 725 info.
fCurrent =
new G4LogicalVolume(hallBox, G4Material::GetMaterial(
"Air"), volumeName);
731 info.
fPosition[2] = -1.0*distHorn1UpstrToZ0 - 1.84*CLHEP::mm;
750 std::cerr <<
" Placing TargetHallAndHorn1 at " << info.
fPosition[2] <<
" length " << info.
fParams[2]
751 <<
" as upst off " << distHorn1UpstrToZ0 << std::endl <<
" ...... H1 Length " <<
fHorn1Length 756 }
else if (name == G4String(
"UpstreamTargetAssembly")) {
758 info.
fParams[0] = 64*in - 1.0*CLHEP::cm;
759 info.
fParams[1] = 60*in - 1.0*CLHEP::cm;
768 std::cerr <<
" Creating UpstreamTargetAssembly with transv. size " 769 << info.
fParams[0] <<
" fTotalLengthUpstreamAssembly " 782 std::cerr <<
" Correcting.. UpstreamTargetAssembly with transv. size " 783 << info.
fParams[0] <<
" fTotalLengthUpstreamAssembly " 786 info.
fCurrent =
new G4LogicalVolume(hallBox, G4Material::GetMaterial(
"Air"), volumeName);
790 }
else if (name == G4String(
"Baffle")) {
797 G4Tubs* baffleTube =
new G4Tubs(volumeName, info.
fParams[0], info.
fParams[1], info.
fParams[2]/2., 0., 360.*CLHEP::degree);
798 info.
fCurrent =
new G4LogicalVolume(baffleTube, G4Material::GetMaterial(
"GraphiteBaffle"), volumeName);
800 }
else if (name == G4String(
"BaffleWindowUpstr")) {
807 G4Tubs* baffleTubeW =
new G4Tubs(volumeName, info.
fParams[0], info.
fParams[1], info.
fParams[2]/2., 0., 360.*CLHEP::degree);
808 info.
fCurrent =
new G4LogicalVolume(baffleTubeW, G4Material::GetMaterial(
"Beryllium"), volumeName);
810 }
else if (name == G4String(
"BaffleWindowDownstr")) {
817 G4Tubs* baffleTube =
new G4Tubs(volumeName, info.
fParams[0], info.
fParams[1], info.
fParams[2]/2., 0., 360.*CLHEP::degree);
818 info.
fCurrent =
new G4LogicalVolume(baffleTube, G4Material::GetMaterial(
"Beryllium"), volumeName);
824 if (name.find(
"Target") != std::string::npos) {
833 if ((name.find(
"TargetUpstr") != std::string::npos) || (name.find(
"TargetConcept") != std::string::npos)) {
834 if (name == G4String(
"TargetUpstrMTop")) {
841 std::cerr <<
" Creating TargetUpstrMTop .... with radius " << info.
fParams[1] <<
std::endl;
846 std::cerr <<
" Length of TargetUpstrMTop, ( with Horn1 Mother is Polycone) " << info.
fParams[2] <<
std::endl;
848 G4Tubs* aTube =
new G4Tubs(volumeName, info.
fParams[0], info.
fParams[1], info.
fParams[2]/2., 0., 360.*CLHEP::degree);
849 info.
fCurrent =
new G4LogicalVolume(aTube, G4Material::GetMaterial(
"Air"), volumeName);
854 if (name == G4String(
"TargetUpstrM0")) {
862 std::cerr <<
" Length of TargetUpstrMTop, ( with Horn1 Mother is Polycone) " << info.
fParams[2] <<
std::endl;
863 G4Tubs* aTube =
new G4Tubs(volumeName, info.
fParams[0], info.
fParams[1], info.
fParams[2]/2., 0., 360.*CLHEP::degree);
864 info.
fCurrent =
new G4LogicalVolume(aTube, G4Material::GetMaterial(
"HeliumTarget"), volumeName);
867 if (name.find(
"TargetUpstrUpstr") != std::string::npos) {
869 if (name == G4String(
"TargetUpstrUpstrPlate")) {
873 G4Tubs* aTube =
new G4Tubs(volumeName, info.
fParams[0], info.
fParams[1], info.
fParams[2]/2., 0., 360.*CLHEP::degree);
874 info.
fCurrent =
new G4LogicalVolume(aTube, G4Material::GetMaterial(
"Aluminum"), volumeName);
877 if (name == G4String(
"TargetUpstrUpstrCan")) {
881 G4Tubs* aTube =
new G4Tubs(volumeName, info.
fParams[0], info.
fParams[1], info.
fParams[2]/2., 0., 360.*CLHEP::degree);
886 if (name == G4String(
"TargetUpstrUpstrCanEndPlate")) {
890 G4Tubs* aTube =
new G4Tubs(volumeName, info.
fParams[0], info.
fParams[1], info.
fParams[2]/2., 0., 360.*CLHEP::degree);
897 if (name == G4String(
"TargetUpstrUpstrDwstrFlange")) {
901 G4Tubs* aTube =
new G4Tubs(volumeName, info.
fParams[0], info.
fParams[1], info.
fParams[2]/2., 0., 360.*CLHEP::degree);
907 if (name == G4String(
"TargetUpstrUpstrCoolingTube")) {
911 G4Tubs* aTube =
new G4Tubs(volumeName, info.
fParams[0], info.
fParams[1], info.
fParams[2]/2., 0., 360.*CLHEP::degree);
915 if (name == G4String(
"TargetUpstrUpstrCoolingTubeWater")) {
919 G4Tubs* aTube =
new G4Tubs(volumeName, info.
fParams[0], info.
fParams[1], info.
fParams[2]/2., 0., 360.*CLHEP::degree);
920 info.
fCurrent =
new G4LogicalVolume(aTube, G4Material::GetMaterial(
std::string(
"Water")), volumeName);
923 if (name == G4String(
"TargetUpstrUpstrSupportBlockTopLeft")) {
924 info.
fParams[0] = 15.0*CLHEP::mm;
925 info.
fParams[1] = 10.0*CLHEP::mm;
926 info.
fParams[2] = 10.0*CLHEP::mm;
928 info.
fCurrent =
new G4LogicalVolume(aBox, G4Material::GetMaterial(
std::string(
"Steel316")), volumeName);
935 if (name == G4String(
"TargetUpstrUpstrSupportBlockBottomLeft")) {
936 info.
fParams[0] = 15.0*CLHEP::mm;
937 info.
fParams[1] = 10.0*CLHEP::mm;
938 info.
fParams[2] = 11.0*CLHEP::mm;
940 info.
fCurrent =
new G4LogicalVolume(aBox, G4Material::GetMaterial(
std::string(
"Steel316")), volumeName);
947 if (name == G4String(
"TargetUpstrUpstrSupportBlockRight")) {
948 info.
fParams[0] = 10.0*CLHEP::mm;
949 info.
fParams[1] = 15.0*CLHEP::mm;
950 info.
fParams[2] = 11.0*CLHEP::mm;
952 info.
fCurrent =
new G4LogicalVolume(aBox, G4Material::GetMaterial(
std::string(
"Steel316")), volumeName);
959 if (name == G4String(
"TargetUpstrUpstrSupportRod")) {
961 info.
fParams[1] = 12.*CLHEP::mm;
962 info.
fParams[2] = 163.0*CLHEP::mm;
963 G4Tubs* aTube =
new G4Tubs(volumeName, info.
fParams[0], info.
fParams[1], info.
fParams[2]/2., 0., 360.0*CLHEP::degree);
964 info.
fCurrent =
new G4LogicalVolume(aTube, G4Material::GetMaterial(
std::string(
"Steel316")), volumeName);
968 if (name == G4String(
"TargetUpstrUpstrSupportSleeve")) {
971 info.
fParams[2] = 72.0*CLHEP::mm;
972 G4Tubs* aTube =
new G4Tubs(volumeName, info.
fParams[0], info.
fParams[1], info.
fParams[2]/2., 0., 360.0*CLHEP::degree );
973 info.
fCurrent =
new G4LogicalVolume(aTube, G4Material::GetMaterial(
std::string(
"Steel316")), volumeName);
978 if (name == G4String(
"TargetUpstrUstrHorFin")) {
983 info.
fCurrent =
new G4LogicalVolume(aBox, G4Material::GetMaterial(
std::string(
"Target")), volumeName);
990 if (name == G4String(
"TargetUpstrUpstrCoolingTubeBendSection")) {
994 G4Tubs* aTube =
new G4Tubs(volumeName, info.
fParams[0], info.
fParams[1], info.
fParams[2]/2., 0., 360.*CLHEP::degree);
998 if (name == G4String(
"TargetUpstrUpstrCoolingTubeBendSectionWater")) {
1002 G4Tubs* aTube =
new G4Tubs(volumeName, info.
fParams[0], info.
fParams[1], info.
fParams[2]/2., 0., 360.*CLHEP::degree);
1003 info.
fCurrent =
new G4LogicalVolume(aTube, G4Material::GetMaterial(
std::string(
"Water")), volumeName);
1006 if (name == G4String(
"TargetUpstrUpstrCoolingTubeFlangeSection")) {
1010 G4Tubs* aTube =
new G4Tubs(volumeName, info.
fParams[0], info.
fParams[1], info.
fParams[2]/2., 0., 360.*CLHEP::degree);
1014 if (name == G4String(
"TargetUpstrUpstrCoolingTubeFlangeSectionWater")) {
1018 G4Tubs* aTube =
new G4Tubs(volumeName, info.
fParams[0], info.
fParams[1], info.
fParams[2]/2., 0., 360.*CLHEP::degree);
1019 info.
fCurrent =
new G4LogicalVolume(aTube, G4Material::GetMaterial(
std::string(
"Water")), volumeName);
1028 if ((name.find(
"TargetUpstrDownstr") != std::string::npos) || (name.find(
"TargetConceptHelium") != std::string::npos)) {
1029 if (name == G4String(
"TargetUpstrDownstrHeContainer")) {
1032 <<
" Suspicious volume TargetUpstrDownstrHeContainer created in LBNEVolumePlacement .. " <<
std::endl;
1040 G4Tubs* aTube =
new G4Tubs(volumeName, info.
fParams[0], info.
fParams[1], info.
fParams[2]/2., 0., 360.*CLHEP::degree);
1041 info.
fCurrent =
new G4LogicalVolume(aTube, G4Material::GetMaterial(
std::string(
"Beryllium")), volumeName);
1044 if (name == G4String(
"TargetUpstrDownstrHelium")) {
1049 G4Tubs* aTube =
new G4Tubs(volumeName, info.
fParams[0], info.
fParams[1], info.
fParams[2]/2., 0., 360.*CLHEP::degree);
1050 info.
fCurrent =
new G4LogicalVolume(aTube, G4Material::GetMaterial(
std::string(
"HeliumTarget")), volumeName);
1053 if (name == G4String(
"TargetUpstrDownstrCoolingTube")) {
1057 G4Tubs* aTube =
new G4Tubs(volumeName, info.
fParams[0], info.
fParams[1], info.
fParams[2]/2., 0., 360.*CLHEP::degree);
1058 info.
fCurrent =
new G4LogicalVolume(aTube, G4Material::GetMaterial(
std::string(
"Titanium")), volumeName);
1061 if (name == G4String(
"TargetUpstrDownstrCoolingTubeWater")) {
1065 G4Tubs* aTube =
new G4Tubs(volumeName, info.
fParams[0], info.
fParams[1], info.
fParams[2]/2., 0., 360.*CLHEP::degree);
1066 info.
fCurrent =
new G4LogicalVolume(aTube, G4Material::GetMaterial(
std::string(
"Water")), volumeName);
1070 if ((name == G4String(
"TargetConceptHeliumBoxSegment")) ||
1071 (name == G4String(
"TargetConceptHeliumTubWWings")) ||
1072 (name == G4String(
"TargetUpstrDownstrSegment")) ||
1073 (name == G4String(
"TargetUpstrDownstrSegmentLeft")) ||
1074 (name == G4String(
"TargetUpstrDownstrSegmentRight")) ) {
1082 if (
fUse1p2MW && (name == G4String(
"TargetConceptHeliumBoxSegment"))) {
1090 if (name == G4String(
"TargetConceptHeliumTubWWings")) {
1096 std::cerr <<
" Create Volume " << name <<
" fParams " << info.
fParams[0] <<
" / " 1099 if (name == G4String(
"TargetConceptHeliumTubWWings")) {
1101 G4Tubs* aTubs =
new G4Tubs(volumeName, 0., info.
fParams[1], info.
fParams[2]/2., 0., 360.0*CLHEP::degree);
1102 info.
fCurrent =
new G4LogicalVolume(aTubs, G4Material::GetMaterial(
std::string(
"HeliumTarget")), volumeName);
1104 std::cerr <<
" Creation of TargetUpstrDownstrSegment, sizes " 1110 info.
fCurrent =
new G4LogicalVolume(aBox, G4Material::GetMaterial(
std::string(
"Target")), volumeName);
1113 new G4LogicalVolume(aBox, G4Material::GetMaterial(
std::string(
"HeliumTarget")), volumeName);
1116 if (name == G4String(
"TargetUpstrDownstrCoolingTubeLast")) {
1120 G4Tubs* aTube =
new G4Tubs(volumeName, info.
fParams[0], info.
fParams[1], info.
fParams[2]/2., 0., 360.*CLHEP::degree);
1121 info.
fCurrent =
new G4LogicalVolume(aTube, G4Material::GetMaterial(
std::string(
"Titanium")), volumeName);
1124 if (name == G4String(
"TargetUpstrDownstrCoolingTubeLastWater")) {
1128 G4Tubs* aTube =
new G4Tubs(volumeName, info.
fParams[0], info.
fParams[1], info.
fParams[2]/2., 0., 360.*CLHEP::degree);
1129 info.
fCurrent =
new G4LogicalVolume(aTube, G4Material::GetMaterial(
std::string(
"Water")), volumeName);
1131 if ((name == G4String(
"TargetUpstrDownstrSegmentLast")) ||
1132 (name == G4String(
"TargetUpstrDownstrSegmentLastLeft")) ||
1133 (name == G4String(
"TargetUpstrDownstrSegmentLastRight"))) {
1141 info.
fCurrent =
new G4LogicalVolume(aBox, G4Material::GetMaterial(
std::string(
"HeliumTarget")), volumeName);
1142 else info.
fCurrent =
new G4LogicalVolume(aBox, G4Material::GetMaterial(
std::string(
"Target")), volumeName);
1155 if (name.find(
"TargetNoSplit") != std::string::npos) {
1156 std::cerr <<
" As the data card is off, we will be using the normal optimized design of target and cooling systems" <<
std::endl;
1157 if (name == G4String(
"TargetNoSplitM1")) {
1159 std::cerr <<
" Creating TargetNoSplitM1 ... " <<
std::endl;
1175 G4Tubs* aTube =
new G4Tubs(volumeName, info.
fParams[0], info.
fParams[1], info.
fParams[2]/2., 0., 360.*CLHEP::degree);
1176 info.
fCurrent =
new G4LogicalVolume(aTube, G4Material::GetMaterial(
std::string(
"Air")), volumeName);
1177 double lengthMotherNow = 0.;
1182 Find(name, G4String(
"TargetHallAndHorn1"), G4String(
"Create"));
1184 lengthMotherNow = plInfo->
fParams[2];
1203 plInfo =
Find(name, G4String(
"TargetHallAndHorn1"), G4String(
"Create"));
1204 lengthMotherNow = plInfo->
fParams[2];
1224 std::cerr <<
" ...............Done Creating TargetNoSplitM1, length of mother " 1225 << lengthMotherNow <<
" length of TargetNoSplitM1 " << info.
fParams[2] << std::endl
1227 << std::endl <<
" ............. Z pos relative to mother " 1230 if (name == G4String(
"TargetNoSplitHeContainer")) {
1232 Find(name, G4String(
"TargetNoSplitM1"), G4String(
"Create"));
1236 G4Tubs* aTube =
new G4Tubs(volumeName, info.
fParams[0], info.
fParams[1], info.
fParams[2]/2., 0., 360.*CLHEP::degree);
1240 G4Material *myMatTube = G4Material::GetMaterial(
std::string(
"Titanium"));
1243 info.
fCurrent =
new G4LogicalVolume(aTube,myMatTube , volumeName);
1244 std::cerr <<
" Defined TargetNoSplitHeContainer, " << myMatTube->GetName() <<
", with inner radius " 1246 std::cerr <<
" Length Mother " << plInfoM->
fParams[2]
1249 if (name == G4String(
"TargetNoSplitHelium")) {
1254 G4Tubs* aTube =
new G4Tubs(volumeName, info.
fParams[0], info.
fParams[1], info.
fParams[2]/2., 0., 360.*CLHEP::degree);
1255 info.
fCurrent =
new G4LogicalVolume(aTube, G4Material::GetMaterial(
std::string(
"HeliumTarget")), volumeName);
1256 std::cerr <<
" Length of TargetNoSplitHelium " << info.
fParams[2]
1260 if ((name == G4String(
"TargetNoSplitSegment")) ||
1261 (name == G4String(
"TargetNoSplitSegmentLeft")) ||
1262 (name == G4String(
"TargetNoSplitSegmentRight")) ) {
1270 std::cerr <<
" Creating " << name <<
" Height " << info.
fParams[1] <<
std::endl;
1274 info.
fCurrent =
new G4LogicalVolume(aBox, G4Material::GetMaterial(
std::string(
"HeliumTarget")), volumeName);
1275 else info.
fCurrent =
new G4LogicalVolume(aBox, G4Material::GetMaterial(
std::string(
"Target")), volumeName);
1278 if (name == G4String(
"TargetNoSplitCoolingTubeLast")) {
1282 G4Tubs* aTube =
new G4Tubs(volumeName, info.
fParams[0], info.
fParams[1], info.
fParams[2]/2., 0., 360.*CLHEP::degree);
1283 info.
fCurrent =
new G4LogicalVolume(aTube, G4Material::GetMaterial(
std::string(
"Titanium")), volumeName);
1286 if (name == G4String(
"TargetNoSplitCoolingTubeLastWater")) {
1290 G4Tubs* aTube =
new G4Tubs(volumeName, info.
fParams[0], info.
fParams[1], info.
fParams[2]/2., 0., 360.*CLHEP::degree);
1291 info.
fCurrent =
new G4LogicalVolume(aTube, G4Material::GetMaterial(
std::string(
"Water")), volumeName);
1293 if ((name == G4String(
"TargetNoSplitSegmentLast")) ||
1294 (name == G4String(
"TargetNoSplitSegmentLastLeft")) ||
1295 (name == G4String(
"TargetNoSplitSegmentLastRight"))) {
1303 info.
fCurrent =
new G4LogicalVolume(aBox, G4Material::GetMaterial(
std::string(
"HeliumTarget")), volumeName);
1304 else info.
fCurrent =
new G4LogicalVolume(aBox, G4Material::GetMaterial(
std::string(
"Target")), volumeName);
1324 if (name.find(
"TargetNoSplit") != std::string::npos) {
1332 std::cerr <<
" Using RAL configuration for the target and target cooling systems" <<
std::endl;
1334 if (name == G4String(
"TargetNoSplitM1")){
1336 std::cerr <<
"TargetNoSplitM1...: Defines the outermost helium containment vessel" <<
std::endl;
1341 info.
fParams[0] = 0*CLHEP::mm;
1343 info.
fParams[2] = 0*CLHEP::mm;
1347 G4Cons* Outersurface =
new G4Cons(
"Outersurface", info.
fParams[0], info.
fParams[1], info.
fParams[2],
1348 info.
fParams[3], info.
fParams[4]/2., 0.*CLHEP::mm, 360.0*CLHEP::mm);
1362 G4Material *myMatTube = G4Material::GetMaterial(
std::string(
"TitaniumG5"));
1367 G4UnionSolid* unionMoved =
new G4UnionSolid(
"totaloutersurface", aTube, Outersurface, 0, zTrans);
1372 360*CLHEP::degree, 0*CLHEP::degree, 90*CLHEP::degree);
1380 G4UnionSolid* unionMoved2 =
new G4UnionSolid(
"With spherical end", unionMoved, Sphere, 0, zTrans2);
1381 info.
fCurrent =
new G4LogicalVolume(unionMoved2 ,myMatTube ,volumeName);
1383 double lengthMotherNow = 0.;
1389 Find(name, G4String(
"TargetHallAndHorn1"), G4String(
"Create"));
1392 lengthMotherNow = plInfo->
fParams[2];
1402 plInfo =
Find(name, G4String(
"TargetHallAndHorn1"), G4String(
"Create"));
1403 lengthMotherNow = plInfo->
fParams[2];
1406 Find(name, G4String(
"Horn1PolyM1"), G4String(
"Create"));
1413 std::cerr <<
" ...............Done Creating TargetNoSplitM1, length of mother " 1414 << lengthMotherNow <<
" length of TargetNoSplitM1 " << info.
fParams[4] +
1417 << std::endl <<
" ............. Z pos relative to mother " 1422 if (name == G4String(
"TargetNoSplitHeContainer")) {
1433 G4Tubs* InnerHeliumTube =
new G4Tubs(volumeName, info.
fParams[0], info.
fParams[1],
1434 info.
fParams[2]/2., 0.*CLHEP::mm, 360.*CLHEP::degree);
1440 G4Material *myMatTube = G4Material::GetMaterial(
std::string(
"TitaniumG5"));
1442 info.
fCurrent =
new G4LogicalVolume(InnerHeliumTube ,myMatTube , volumeName);
1444 std::cerr <<
" Defined TargetNoSplitHeContainer, " << myMatTube->GetName() <<
", with inner radius " 1452 if (name == G4String(
"TargetNoSplitCoolingTubeLast")) {
1456 Find(name, G4String(
"TargetNoSplitLargeConeHe"), G4String(
"Create"));
1472 G4Tubs* SmallCyl =
new G4Tubs(
"Hetubebafflet", info.
fParams[0], info.
fParams[1], info.
fParams[2]/2.,
1473 0.*CLHEP::degree, 360.*CLHEP::degree);
1474 G4Cons* SmallCone =
new G4Cons(
"Conical section Helium Cont Tube", info.
fParams[3], info.
fParams[4],
1476 0.*CLHEP::degree, 360.0*CLHEP::degree);
1479 G4ThreeVector zTrans(0., 0., info.
fParams[2]/2. + info.
fParams[5]/2.);
1481 G4UnionSolid* HeSection =
new G4UnionSolid(
"Helium Tube Conical", SmallCone, SmallCyl, 0, zTrans);
1488 info.
fCurrent =
new G4LogicalVolume(HeSection, G4Material::GetMaterial(
std::string(
"TitaniumG5")),
1493 if (name == G4String(
"TargetNoSplitLargeCone")) {
1498 Find(name, G4String(
"Horn1PolyM1"), G4String(
"Create"));
1501 Find(name, G4String(
"TargetNoSplitHeContainer"), G4String(
"Create"));
1513 G4Cons* LargeCone =
new G4Cons(
"LargeCone", info.
fParams[0], info.
fParams[1],
1515 0.*CLHEP::degree, 360.0*CLHEP::degree);
1525 G4SubtractionSolid* subtraction =
new G4SubtractionSolid(
"LargeCone-Tube", LargeCone, bafflet, 0, zTrans);
1533 info.
fCurrent =
new G4LogicalVolume(subtraction, G4Material::GetMaterial(
std::string(
"TitaniumG5")),
1538 if (name == G4String(
"TargetNoSplitLargeConeHe")) {
1552 info.
fParams[3], info.
fParams[4]/2., 0.*CLHEP::degree, 360.0*CLHEP::degree);
1562 G4SubtractionSolid* subtraction =
new G4SubtractionSolid(
"Cone-Tube", Cone, bafflet, 0, zTrans);
1565 info.
fCurrent =
new G4LogicalVolume(subtraction, G4Material::GetMaterial(
std::string(
"Helium")),
1571 if (name == G4String(
"TargetNoSplitM1Helium")){
1576 Find(name, G4String(
"TargetNoSplitM1"), G4String(
"Create"));
1590 info.
fParams[3], info.
fParams[4]/2., 0.*CLHEP::mm, 360.0*CLHEP::mm);
1596 G4UnionSolid* unionMoved =
new G4UnionSolid(
"totaloutersurface", aTube, HeOuter, 0, zTrans);
1599 360*CLHEP::degree, 0*CLHEP::degree, 90*CLHEP::degree);
1604 G4UnionSolid* unionMoved2 =
new G4UnionSolid(
"With spherical end", unionMoved, Sphere, 0, zTrans2);
1607 G4Material *myMatTube = G4Material::GetMaterial(
std::string(
"Helium"));
1609 info.
fCurrent =
new G4LogicalVolume(unionMoved2 ,myMatTube ,volumeName);
1616 if (name == G4String(
"TargetNoSplitCoolingTubeFirstMoth")) {
1618 Find(name, G4String(
"Horn1PolyM1"), G4String(
"Create"));
1627 0., 360.*CLHEP::degree);
1628 info.
fCurrent =
new G4LogicalVolume(bafflet, G4Material::GetMaterial(
std::string(
"TitaniumG5")), volumeName);
1634 if (name == G4String(
"TargetNoSplitCoolingTubeFirstHelium")) {
1639 Find(name, G4String(
"TargetNoSplitCoolingTubeFirstMoth"), G4String(
"Create"));
1642 info.
fParams[0] = 0.*CLHEP::mm;
1648 0., 360.*CLHEP::degree);
1649 info.
fCurrent =
new G4LogicalVolume(aTube, G4Material::GetMaterial(
std::string(
"Helium")), volumeName);
1655 if (name == G4String(
"TargetNoSplitSimpleBafflet")) {
1659 Find(name, G4String(
"TargetNoSplitCoolingTubeFirstMoth"), G4String(
"Create"));
1670 0., 360.*CLHEP::degree);
1672 0.*CLHEP::degree, 360.0*CLHEP::degree);
1674 G4ThreeVector zTrans(0., 0., info.
fParams[3]/2.);
1676 G4SubtractionSolid* subtraction =
new G4SubtractionSolid(
"Tube-Cone", aTube, Cone, 0, zTrans);
1678 info.
fCurrent =
new G4LogicalVolume(subtraction, G4Material::GetMaterial(
std::string(
"TitaniumG5")),
1687 if (name == G4String(
"TargetNoSplitSimpleBaffletFlange")) {
1690 Find(name, G4String(
"TargetNoSplitCoolingTubeFirstHelium"), G4String(
"Create"));
1702 plInfoM0->
fParams[1], info.
fParams[3]/2., 0.*CLHEP::degree, 360.0*CLHEP::degree);
1704 info.
fCurrent =
new G4LogicalVolume(Cone2, G4Material::GetMaterial(
std::string(
"TitaniumG5")), volumeName);
1709 if (name == G4String(
"TargetNoSplitBaffletCold")) {
1714 Find(name, G4String(
"TargetNoSplitSimpleBafflet"), G4String(
"Create"));
1716 Find(name, G4String(
"Horn1PolyM1"), G4String(
"Create"));
1722 G4Torus* Torus =
new G4Torus(
"Torus", info.
fParams[0], info.
fParams[1], info.
fParams[2] ,0., M_PI/2.);
1724 info.
fCurrent =
new G4LogicalVolume(Torus, G4Material::GetMaterial(
std::string(
"TitaniumG5")), volumeName);
1738 if (name == G4String(
"TargetNoSplitBaffletColdHe")) {
1743 info.
fParams[0] = 0.*CLHEP::mm;
1747 G4Torus* Torus =
new G4Torus(
"Torus", info.
fParams[0], info.
fParams[1], info.
fParams[2] ,0., M_PI/2.);
1749 info.
fCurrent =
new G4LogicalVolume(Torus, G4Material::GetMaterial(
std::string(
"Helium")), volumeName);
1755 if (name == G4String(
"TargetNoSplitRingTube")) {
1766 info.
fCurrent =
new G4LogicalVolume(RingTube, G4Material::GetMaterial(
std::string(
"TitaniumG5")),
1769 std::cerr <<
"Placing the TitaniumG5 ring between the target and the helium tube. " <<
std::endl;
1774 if (name == G4String(
"TargetNoSplitDSSupportConnectionRing")) {
1781 0., 360.*CLHEP::degree);
1783 G4Sphere* Sphere =
new G4Sphere(
"Sphere", 0,
1785 360*CLHEP::degree, 0*CLHEP::degree, 90*CLHEP::degree);
1790 G4SubtractionSolid* subtraction =
new G4SubtractionSolid(
"Ring-Sphere", aTube, Sphere, 0, zTrans);
1792 info.
fCurrent =
new G4LogicalVolume(subtraction, G4Material::GetMaterial(
std::string(
"TitaniumG5")), volumeName);
1795 Find(name, G4String(
"Horn1PolyM1"), G4String(
"Create"));
1803 if (name == G4String(
"TargetNoSplitDSSupportAlRing")) {
1810 0., 360.*CLHEP::degree);
1812 info.
fCurrent =
new G4LogicalVolume(aTube, G4Material::GetMaterial(
std::string(
"Aluminum")), volumeName);
1815 Find(name, G4String(
"Horn1PolyM1"), G4String(
"Create"));
1824 if (name == G4String(
"TargetNoSplitDSSupportLargeCones")) {
1842 info.
fParams[8], info.
fParams[9]/2., 0.*CLHEP::degree, 360.0*CLHEP::degree);
1847 info.
fParams[3], info.
fParams[4]/2., 0.*CLHEP::degree, 360.0*CLHEP::degree);
1851 G4UnionSolid* UnionMovedx3 =
new G4UnionSolid(
"DSSupportLConeRings", ConeL, ConeS, 0, zTrans2);
1858 Find(name, G4String(
"Horn1PolyM1"), G4String(
"Create"));
1866 info.
fCurrent =
new G4LogicalVolume(UnionMovedx3, G4Material::GetMaterial(
std::string(
"TitaniumG5")), volumeName);
1896 if (name == G4String(
"TargetNoSplitDSSupportHeLargeCone")) {
1902 info.
fParams[0] = 37.72*CLHEP::mm + 0.63850*CLHEP::mm;
1904 info.
fParams[2] = 28.5293*CLHEP::mm;
1906 info.
fParams[4] = 28.1*CLHEP::mm;
1909 G4Cons* ConeL =
new G4Cons(
"DSSupportLargeConeHe", info.
fParams[0], info.
fParams[1], info.
fParams[2],
1910 info.
fParams[3], info.
fParams[4]/2., 0.*CLHEP::degree, 360.0*CLHEP::degree);
1915 26.6*CLHEP::mm + 0.6092559*CLHEP::mm + 3.960163*CLHEP::mm, 5.3*CLHEP::mm/2., 0.*CLHEP::degree, 360.0*CLHEP::degree);
1917 G4ThreeVector zTrans(0., 0., 5.3*CLHEP::mm/2. + info.
fParams[4]/2.);
1919 G4UnionSolid* RingplusConeHe =
new G4UnionSolid(
"DSSupportLConeRingHe", ConeL, ConeS, 0, zTrans);
1922 info.
fCurrent =
new G4LogicalVolume(RingplusConeHe, G4Material::GetMaterial(
std::string(
"Helium")), volumeName);
1928 if (name == G4String(
"TargetNoSplitDSSupportInnerRing")) {
1931 Find(name, G4String(
"Horn1PolyM1"), G4String(
"Create"));
1934 Find(name, G4String(
"TargetNoSplitDSSupportLargeCones"), G4String(
"Create"));
1937 info.
fParams[0] = 2*CLHEP::mm;
1938 info.
fParams[1] = 3*CLHEP::mm;
1940 info.
fParams[3] = 677*CLHEP::mm - plInfoM2->
fParams[6] - 2.0219*CLHEP::mm;
1943 0., 360.*CLHEP::degree);
1945 G4RotationMatrix* xRot =
new G4RotationMatrix;
1946 xRot->rotateX(M_PI/9.*rad);
1947 xRot->rotateY(+ M_PI/75.*rad);
1949 G4RotationMatrix* xRot2 =
new G4RotationMatrix;
1950 xRot2->rotateX(2*M_PI/3.*rad);
1951 xRot2->rotateY(M_PI - 1/200.*M_PI);
1953 G4RotationMatrix* xRot3 =
new G4RotationMatrix;
1954 xRot3->rotateX(14*M_PI/18.*rad);
1955 xRot3->rotateY(M_PI/75.*rad - M_PI/100.*rad);
1957 G4RotationMatrix* xRot4 =
new G4RotationMatrix;
1958 xRot4->rotateX(4*M_PI/3.*rad);
1959 xRot4->rotateY(M_PI - 1/200.*M_PI);
1961 G4RotationMatrix* xRot5 =
new G4RotationMatrix;
1962 xRot5->rotateX(26*M_PI/18.*rad);
1963 xRot5->rotateY(M_PI/75.*rad - M_PI/100.*rad);
1965 G4ThreeVector zTrans(std::sin(M_PI/75.*rad)*info.
fParams[2]/2.,
1966 std::sin(M_PI/9.)*(677*CLHEP::mm/2. + plInfoM2->
fParams[6] + 2.0219*CLHEP::mm),
1967 -(1-std::cos(M_PI/9.))*(677*CLHEP::mm/2. + plInfoM2->
fParams[6] + 2.0219*CLHEP::mm));
1969 G4ThreeVector zTrans2(1*CLHEP::mm + std::sin(M_PI/200.*rad)*info.
fParams[2]/2.,
1973 G4ThreeVector zTrans3(std::sin(M_PI/75.*rad + M_PI/100.*rad)*info.
fParams[2]/2.,
1977 G4ThreeVector zTrans4(1*CLHEP::mm + std::sin(M_PI/200.*rad)*info.
fParams[2]/2.,
1981 G4ThreeVector zTrans5(std::sin(M_PI/75.*rad + M_PI/100.*rad)*info.
fParams[2]/2.,
1982 - std::sin(4*M_PI/9.)*(info.
fParams[3]/2. + plInfoM2->
fParams[6]),
1985 G4UnionSolid* Spikes =
new G4UnionSolid(
"DSSupportSpikes", aTube, aTube, xRot2, zTrans2);
1987 G4UnionSolid* Spikes2 =
new G4UnionSolid(
"DSSupportSpikes", Spikes, aTube, xRot4, zTrans4);
1989 G4UnionSolid* Spikes3 =
new G4UnionSolid(
"DSSupportSpikes", Spikes2, aTube, xRot, zTrans);
1991 G4UnionSolid* Spikes4 =
new G4UnionSolid(
"DSSupportSpikes", Spikes3, aTube, xRot3, zTrans3);
1993 G4UnionSolid* Spikes5 =
new G4UnionSolid(
"DSSupportSpikes", Spikes4, aTube, xRot5, zTrans5);
1996 G4Tubs* OUTERRING =
new G4Tubs(volumeName, 677*CLHEP::mm, 697*CLHEP::mm, 20*CLHEP::mm/2.,
1997 0., 360.*CLHEP::degree);
1999 G4RotationMatrix* xRot6 =
new G4RotationMatrix;
2000 xRot6->rotateY(- 3./2.*M_PI + 1/200.*M_PI);
2002 G4ThreeVector zTrans6(10*CLHEP::mm, 0., -(plInfoM2->
fParams[6] + info.
fParams[2]/2 - 5*CLHEP::mm));
2004 G4UnionSolid* Spikes6 =
new G4UnionSolid(
"DSSupportSpikes", Spikes5, OUTERRING, xRot6, zTrans6);
2012 , 38.7298*CLHEP::mm - 2.0219*CLHEP::mm, 38.7298*CLHEP::mm, 10.*CLHEP::mm/2., 0.*CLHEP::degree, 360.0*CLHEP::degree);
2019 G4UnionSolid* Spikes7 =
new G4UnionSolid(
"DSSupportSpikes", Spikes6, ConeExt, xRot6, zTrans7);
2021 G4SubtractionSolid* subtraction =
new G4SubtractionSolid(
"Ring-Sphere", Spikes7, ConeExt2sub, xRot6, zTrans7);
2025 info.
fCurrent =
new G4LogicalVolume(subtraction, G4Material::GetMaterial(
std::string(
"TitaniumG5")), volumeName);
2036 info.
fRotation.rotateY(3./2.*M_PI - 1/200.*M_PI);
2050 if (name == G4String(
"TargetNormalCoolingTube")) {
2054 G4Tubs* aTube =
new G4Tubs(volumeName, info.
fParams[0], info.
fParams[1], info.
fParams[2]/2., 0., 360.*CLHEP::degree);
2055 info.
fCurrent =
new G4LogicalVolume(aTube, G4Material::GetMaterial(
std::string(
"Titanium")), volumeName);
2059 if (name == G4String(
"TargetNormalCoolingTubeWater")) {
2063 G4Tubs* aTube =
new G4Tubs(volumeName, info.
fParams[0], info.
fParams[1], info.
fParams[2]/2., 0., 360.*CLHEP::degree);
2064 info.
fCurrent =
new G4LogicalVolume(aTube, G4Material::GetMaterial(
std::string(
"Water")), volumeName);
2066 if (name == G4String(
"TargetWWingsCoolingTube")) {
2070 G4Tubs* aTube =
new G4Tubs(volumeName, info.
fParams[0], info.
fParams[1], info.
fParams[2]/2., 0., 360.*CLHEP::degree);
2071 info.
fCurrent =
new G4LogicalVolume(aTube, G4Material::GetMaterial(
std::string(
"Titanium")), volumeName);
2074 if (name == G4String(
"TargetWWingsCoolingTubeWater")) {
2078 G4Tubs* aTube =
new G4Tubs(volumeName, info.
fParams[0], info.
fParams[1], info.
fParams[2]/2., 0., 360.*CLHEP::degree);
2079 info.
fCurrent =
new G4LogicalVolume(aTube, G4Material::GetMaterial(
std::string(
"Water")), volumeName);
2085 if (name == G4String(
"TargetSimpleUpstrTube")) {
2089 G4Tubs* aTube =
new G4Tubs(volumeName, info.
fParams[0], info.
fParams[1], info.
fParams[2]/2., 0., 360.*CLHEP::degree);
2090 info.
fCurrent =
new G4LogicalVolume(aTube, G4Material::GetMaterial(
std::string(
"Target")), volumeName);
2093 if (name == G4String(
"TargetSimpleUpstrBox")) {
2098 info.
fCurrent =
new G4LogicalVolume(aBox, G4Material::GetMaterial(
std::string(
"Target")), volumeName);
2102 if (name == G4String(
"TargetSimpleDownstrTube")) {
2106 G4Tubs* aTube =
new G4Tubs(volumeName, info.
fParams[0], info.
fParams[1], info.
fParams[2]/2., 0., 360.*CLHEP::degree);
2107 info.
fCurrent =
new G4LogicalVolume(aTube, G4Material::GetMaterial(
std::string(
"Target")), volumeName);
2110 if (name == G4String(
"TargetSimpleDownstrBox")) {
2115 info.
fCurrent =
new G4LogicalVolume(aBox, G4Material::GetMaterial(
std::string(
"Target")), volumeName);
2120 if (name == G4String(
"TargetMultiSphere")) {
2124 G4Sphere* aSphere =
new G4Sphere(volumeName,
2127 0.,360.*CLHEP::degree,0.,180.*CLHEP::degree);
2128 info.
fCurrent =
new G4LogicalVolume(aSphere, G4Material::GetMaterial(
std::string(
"Target")), volumeName);
2134 if (name == G4String(
"TargetFinVert")) {
2139 info.
fCurrent =
new G4LogicalVolume(aBox, G4Material::GetMaterial(
std::string(
"Target")), volumeName);
2143 if (name == G4String(
"TargetFinVertExtra")) {
2146 std::ostringstream mStrStr;
2147 mStrStr <<
" Volume named " << name <<
" can not be handled, negative dimension ";
2148 G4String mStr(mStrStr.str());
2149 G4Exception(
"LBNEVolumePlacements::Create",
" ", FatalErrorInArgument, mStr.c_str());
2155 info.
fCurrent =
new G4LogicalVolume(aBox, G4Material::GetMaterial(
std::string(
"Target")), volumeName);
2158 if (name == G4String(
"TargetFinVertHeliumSide")) {
2163 std::ostringstream mStrStr;
2164 mStrStr <<
" Volume named " << name <<
" can not be handled, negative dimension ";
2179 std::cerr <<
" Creating TargetFinVertHeliumSide, width .." << widthHe
2182 info.
fCurrent =
new G4LogicalVolume(aBox, G4Material::GetMaterial(
std::string(
"HeliumTarget")), volumeName);
2185 if (name.find(
"TargetFinVertHeliumRounded") != std::string::npos) {
2198 if (name == G4String(
"TargetFinVertHeliumRoundedDownstrLeft")) {
2199 info.
fParams[6] = 90.*CLHEP::degree;
2200 info.
fParams[7] = 180.*CLHEP::degree;
2203 }
else if (name == G4String(
"TargetFinVertHeliumRoundedDownstrRight")) {
2204 info.
fParams[6] = 0.*CLHEP::degree;
2205 info.
fParams[7] = 90.*CLHEP::degree;
2208 }
else if (name == G4String(
"TargetFinVertHeliumRoundedUpstrRight")) {
2209 info.
fParams[6] = 270.*CLHEP::degree;
2210 info.
fParams[7] = 360.*CLHEP::degree;
2213 }
else if (name == G4String(
"TargetFinVertHeliumRoundedUpstrLeft")) {
2214 info.
fParams[6] = 180.*CLHEP::degree;
2215 info.
fParams[7] = 270.*CLHEP::degree;
2222 G4RotationMatrix Ra;
2223 G4Transform3D transform(Ra, xyTrans);
2224 G4SubtractionSolid* subtraction =
new G4SubtractionSolid(
"Box-Cylinder", aCuboid, aRod, transform);
2225 info.
fCurrent =
new G4LogicalVolume(subtraction, G4Material::GetMaterial(
std::string(
"HeliumTarget")), volumeName);
2226 info.
fTypeName = G4String(
"Subtration");
2227 std::cerr <<
" Target Rounded Corners, defined for name " << name
2229 for (
int k=0;
k != 10;
k++) std::cerr <<
" " << info.
fParams[
k];
2234 if (name.find(
"TargetFinVertTargetCutV2") != std::string::npos) {
2250 if (name == G4String(
"TargetFinVertTargetCutV2UpLeft")) {
2251 info.
fParams[6] = -cTubeShift;
2254 }
else if (name == G4String(
"TargetFinVertTargetCutV2UpRight")) {
2255 info.
fParams[6] = +cTubeShift ;
2257 }
else if (name == G4String(
"TargetFinVertTargetCutV2DwnLeft")) {
2258 info.
fParams[6] = -cTubeShift;
2260 }
else if (name == G4String(
"TargetFinVertTargetCutV2DwnRight")) {
2265 G4Tubs* aRod =
new G4Tubs(aRodName, info.
fParams[3], info.
fParams[4], info.
fParams[5]/2., 0., 360.*CLHEP::degree);
2267 G4RotationMatrix Ra;
2268 G4Transform3D transform(Ra, xyTrans);
2269 G4SubtractionSolid* subtraction =
new G4SubtractionSolid(
"Box-Cylinder", aCuboid, aRod, transform);
2270 info.
fCurrent =
new G4LogicalVolume(subtraction, G4Material::GetMaterial(
std::string(
"Target")), volumeName);
2271 info.
fTypeName = G4String(
"Subtration");
2272 std::cerr <<
" Target Graphite, defined for name " << name
2274 for (
int k=0;
k != 8;
k++) std::cerr <<
" " << info.
fParams[
k];
2278 if (name.find(
"TargetWWingCylinder") != std::string::npos) {
2292 if (name == G4String(
"TargetWWingCylinderUpLeft")) {
2293 info.
fParams[6] = -cTubeShift;
2297 }
else if (name == G4String(
"TargetWWingCylinderUpRight")) {
2298 info.
fParams[6] = +cTubeShift ;
2301 }
else if (name == G4String(
"TargetWWingCylinderDwnLeft")) {
2302 info.
fParams[6] = -cTubeShift;
2305 }
else if (name == G4String(
"TargetWWingCylinderDwnRight")) {
2308 info.
fParams[8] = 3.0*M_PI/2.;
2310 G4Tubs* aTub =
new G4Tubs(volumeName, info.
fParams[0]/2, info.
fParams[1],
2313 G4Tubs* aRod =
new G4Tubs(aRodName, info.
fParams[3], info.
fParams[4],
2314 info.
fParams[5]/2., 0., 360.*CLHEP::degree);
2316 G4RotationMatrix Ra;
2317 G4Transform3D transform(Ra, xyTrans);
2318 G4SubtractionSolid* subtraction =
new G4SubtractionSolid(
"Cylinder-Cylinder", aTub, aRod, transform);
2319 info.
fCurrent =
new G4LogicalVolume(subtraction, G4Material::GetMaterial(
std::string(
"Target")), volumeName);
2320 info.
fTypeName = G4String(
"Subtration");
2321 std::cerr <<
" Target Graphite, defined for name " << name
2323 for (
int k=0;
k != 9;
k++) std::cerr <<
" " << info.
fParams[
k];
2327 if (name == G4String(
"TargetFinVertLastHeliumSide")) {
2332 std::ostringstream mStrStr;
2333 mStrStr <<
" Volume named " << name <<
" can not be handled, negative dimension ";
2334 G4String mStr(mStrStr.str());
2335 G4Exception(
"LBNEVolumePlacements::Create",
" ", FatalErrorInArgument, mStr.c_str());
2341 info.
fCurrent =
new G4LogicalVolume(aBox, G4Material::GetMaterial(
std::string(
"HeliumTarget")), volumeName);
2345 if (name == G4String(
"TargetFinHorizontal")) {
2346 info.
fParams[0] = 62.0*CLHEP::mm;
2350 info.
fCurrent =
new G4LogicalVolume(aBox, G4Material::GetMaterial(
std::string(
"Target")), volumeName);
2361 if (name == G4String(
"TargetFinVertUpstrLast")) {
2366 info.
fCurrent =
new G4LogicalVolume(aBox, G4Material::GetMaterial(
std::string(
"Target")), volumeName);
2371 if (name == G4String(
"TargetFinVertExtraLast")) {
2374 std::ostringstream mStrStr;
2375 mStrStr <<
" Volume named " << name <<
" can not be handled, negative dimension ";
2376 G4String mStr(mStrStr.str());
2377 G4Exception(
"LBNEVolumePlacements::Create",
" ", FatalErrorInArgument, mStr.c_str());
2383 info.
fCurrent =
new G4LogicalVolume(aBox, G4Material::GetMaterial(
std::string(
"Target")), volumeName);
2392 if (name.find(
"TargetFinVertCorner") != std::string::npos) {
2404 if (name.find(
"TargetFinVertCornerUpstrLast") != std::string::npos) {
2408 if (name.find(
"TargetFinVertCornerDownstrFirst") != std::string::npos) {
2412 G4Box* aBox =
new G4Box(volumeName+G4String(
"Box"),
2415 G4Tubs* aTubs =
new G4Tubs(volumeName+G4String(
"Tube"),
2417 G4ThreeVector trans(0., 0., 0.);
2418 if (name.find(
"UpLeft") != std::string::npos) {
2420 }
else if (name.find(
"UpRight") != std::string::npos) {
2422 }
else if (name.find(
"DwnLeft") != std::string::npos) {
2424 }
else if (name.find(
"DwnRight") != std::string::npos) {
2427 G4RotationMatrix unitMatrix;
2428 G4Transform3D transform(unitMatrix, trans);
2429 G4SubtractionSolid *aRoundCorner =
new G4SubtractionSolid(volumeName, aBox, aTubs, transform);
2430 info.
fCurrent =
new G4LogicalVolume(aRoundCorner, G4Material::GetMaterial(
std::string(
"Target")), volumeName);
2431 info.
fTypeName = G4String(
"G4SubtractionSolid");
2435 if (name == G4String(
"TargetAlignmentRingRight")) {
2455 if (name == G4String(
"TargetAlignmentRingLeft")) {
2476 if (name == G4String(
"UpstrHorn1TransInnerOuterCont")) {
2481 0., 360.0*CLHEP::degree);
2482 info.
fCurrent =
new G4LogicalVolume(aTubs, G4Material::GetMaterial(
std::string(
"Air")), volumeName);
2488 double lHorn1Real = -10000.0*
CLHEP::m;
2490 if (*il > lHorn1Real ) lHorn1Real = *il;
2492 std::cerr <<
" Setting position for UpstrHorn1TransInnerOuterCont, length " << info.
fParams[2]
2496 if (name.find(
"UpstrHorn1TransInnerOuterPart") != std::string::npos) {
2497 size_t nameIndex= name.find(
"UpstrHorn1TransInnerOuterPart") + name.length() - 1;
2499 std::istringstream nameIndexStrStr(nameIndexStr);
2501 nameIndexStrStr >> iPart;
2511 info.
fParams[4]/2., 0., 360.0*CLHEP::degree);
2519 0., 360.0*CLHEP::degree);
2530 if ((name == G4String(
"TargetCoolingTubeReturnLoopRight")) ||
2531 (name == G4String(
"TargetCoolingTubeReturnLoopLeft"))) {
2536 if (name.find(
"Right") != std::string::npos) {
2539 }
else if (name.find(
"Left") != std::string::npos) {
2543 std::cerr <<
" Rad max torus.. " << name <<
" = " << info.
fParams[1] <<
" rSweep Torus " << info.
fParams[2] <<
std::endl;
2546 info.
fCurrent =
new G4LogicalVolume(aTorus, G4Material::GetMaterial(
std::string(
"Titanium")), volumeName);
2549 if (name.find(
"Right") != std::string::npos) {
2551 }
else if (name.find(
"Left") != std::string::npos) {
2556 if ((name == G4String(
"TargetCoolingTubeReturnLoopRightWater")) ||
2557 (name == G4String(
"TargetCoolingTubeReturnLoopLeftWater"))) {
2562 std::cerr <<
" Rad max torus.. " << name <<
" = " << info.
fParams[1] <<
" rSweep Torus " << info.
fParams[2] <<
std::endl;
2563 if (name.find(
"Right") != std::string::npos) {
2564 info.
fParams[3] = -M_PI/2. + 3.0e-3;
2565 info.
fParams[4] = M_PI - 6.0e-3;
2566 }
else if (name.find(
"Left") != std::string::npos) {
2567 info.
fParams[3] = M_PI/2. + 3.0e-3;
2568 info.
fParams[4] = M_PI - 6.0e-3;
2573 info.
fCurrent =
new G4LogicalVolume(aTorus, G4Material::GetMaterial(
std::string(
"Water")), volumeName);
2579 if (name.find(
"Horn1") == 0) {
2580 if (name == G4String(
"Horn1Hall")) {
2583 info.
fParams[0] = 64.0*in - 1.0*CLHEP::cm;
2584 info.
fParams[1] = 50.0*in - 1.0*CLHEP::cm;
2586 G4Box* hallBox =
new G4Box(volumeName, info.
fParams[0]/2., info.
fParams[1]/2., info.
fParams[2]/2. );
2587 info.
fCurrent =
new G4LogicalVolume(hallBox, G4Material::GetMaterial(
"Air"), volumeName);
2593 if (name == G4String(
"Horn1TargetCoolingTubeDwnRetTit")) {
2602 info.
fCurrent =
new G4LogicalVolume(aTube, G4Material::GetMaterial(
std::string(
"Titanium")), volumeName);
2609 if (name == G4String(
"Horn1TargetCoolingTubeDwnRetWater")) {
2615 plInfoM =
Find(name, G4String(
"TargetNoSplitHelium"), G4String(
"Create"));
2624 info.
fCurrent =
new G4LogicalVolume(aTube, G4Material::GetMaterial(
std::string(
"Water")), volumeName);
2634 if (name == G4String(
"Horn1TargetDownstrHeContainerCap")) {
2636 plInfoM =
Find(name, G4String(
"TargetNoSplitHelium"), G4String(
"Create"));
2640 G4Tubs* aTube =
new G4Tubs(volumeName, info.
fParams[0], info.
fParams[1], info.
fParams[2]/2., 0., 360.*CLHEP::degree);
2641 info.
fCurrent =
new G4LogicalVolume(aTube, G4Material::GetMaterial(
std::string(
"Beryllium")), volumeName);
2647 if (name.find(
"Horn1IOTrans") == 0) {
2648 if (name == G4String(
"Horn1IOTransCont")) {
2654 std::cerr <<
" Params for " << name <<
" " << info.
fParams[0] <<
" / " << info.
fParams[1]
2656 G4Tubs* aTube =
new G4Tubs(volumeName, info.
fParams[0], info.
fParams[1], info.
fParams[2]/2., 0., 360.*CLHEP::degree);
2657 info.
fCurrent =
new G4LogicalVolume(aTube, G4Material::GetMaterial(
std::string(
"Air")), volumeName);
2660 std::cerr <<
" Checking long offset for " << name <<
" length of mother " 2666 if (name == G4String(
"Horn1TopLevelUpstr")) {
2680 const double rMin = rMinEqn2*ratio0vs1 + (1.0-ratio0vs1)*rMinEqn1;
2683 info.
fParams[0] = rMin - 0.005*CLHEP::mm;
2688 std::ostringstream mStrStr;
2689 mStrStr <<
" Can't create Horn1TopLevelUpstr, radial clash between Horn1 inner conductor, rMin " <<
2690 info.
fParams[0] <<
" Target Helium tube + min. safety = " << rMaxOut <<
std::endl;
2692 G4String mStr(mStrStr.str());
2693 G4Exception(
"LBNEVolumePlacements::Create",
" ", FatalErrorInArgument, mStr.c_str());
2695 std::cerr <<
" Successfull (preliminary check) of targetinto with max Z = " << zMaxDC
2696 <<
" (Drawing CS), rMin = " << rMin <<
std::endl;
2704 G4Tubs* aTube =
new G4Tubs(volumeName, info.
fParams[0], info.
fParams[1], info.
fParams[2]/2., 0., 360.*CLHEP::degree);
2705 info.
fCurrent =
new G4LogicalVolume(aTube, G4Material::GetMaterial(
std::string(
"Air")), volumeName);
2712 if (name == G4String(
"Horn1TopLevelDownstr")) {
2719 G4Tubs* aTube =
new G4Tubs(volumeName, info.
fParams[0], info.
fParams[1], info.
fParams[2]/2., 0., 360.*CLHEP::degree);
2720 info.
fCurrent =
new G4LogicalVolume(aTube, G4Material::GetMaterial(
std::string(
"Air")), volumeName);
2727 double rMin = 1.0e10*CLHEP::mm;
2729 if (*il < rMin) rMin = *il;
2730 info.
fParams[0] = rMin - 0.010*CLHEP::mm ;
2735 std::cerr <<
" Checking long offset for " << name
2736 <<
" length of mother " << plInfoC->
fParams[2] <<
" length " << info.
fParams[2] <<
" ZPos " 2740 if (name == G4String(
"Horn1PolyM1")) {
2743 std::cerr <<
" Horn1Poly Placement, mother info , long. info, length " 2756 std::cerr <<
" .... Total length HornPolyM1 " << info.
fParams[2];
2757 G4GenericPolycone* aPCon =
new G4GenericPolycone(volumeName, 0.*CLHEP::degree, 360.0*CLHEP::degree, static_cast<int>(
fMotherHorn1AllLengths.size()),
2762 info.
fCurrent =
new G4LogicalVolume(aPCon, G4Material::GetMaterial(
std::string(
"Argon")), volumeName);
2764 info.
fCurrent =
new G4LogicalVolume(aPCon, G4Material::GetMaterial(
std::string(
"Air")), volumeName);
2783 std::cerr <<
" Horn1Poly Placed, long. info, length " 2788 if (name.find(
"Horn2") == 0) {
2789 if (name == G4String(
"Horn2Hall")) {
2791 for (
size_t k=0;
k != 2; ++
k)
2795 G4Box* hallBox =
new G4Box(volumeName, info.
fParams[0]/2., info.
fParams[1]/2., info.
fParams[2]/2. );
2796 info.
fCurrent =
new G4LogicalVolume(hallBox, G4Material::GetMaterial(
"Air"), volumeName);
2800 if (name == G4String(
"Horn2TopLevel")) {
2805 G4Tubs* tubs =
new G4Tubs(volumeName, info.
fParams[0], info.
fParams[1],
2806 info.
fParams[2]/2., 0. , 360.0*CLHEP::degree );
2808 info.
fCurrent =
new G4LogicalVolume(tubs, G4Material::GetMaterial(
std::string(
"Argon")), volumeName);
2810 info.
fCurrent =
new G4LogicalVolume(tubs, G4Material::GetMaterial(
std::string(
"Air")), volumeName);
2818 if (name.find(
"LBNFChaseDwnstrHorn1") == 0) {
2820 for (
size_t k=0;
k != 2; ++
k)
2827 info.
fParams[2] = (zEnd - zBeg);
2828 G4Box* hallBox =
new G4Box(volumeName, info.
fParams[0]/2., info.
fParams[1]/2., info.
fParams[2]/2. );
2829 info.
fCurrent =
new G4LogicalVolume(hallBox, G4Material::GetMaterial(
"Air"), volumeName);
2834 if (name.find(
"LBNFSimpleHorn") == 0) {
2835 size_t ii = name.find(
"Horn"); ii+=4;
2836 char hornNumChr = name[ii];
2838 size_t iH = hornNumChr -
'0' - 1;
2848 info.
fParams[0] -= 0.1*CLHEP::mm;
2850 G4Tubs* hallTube =
new G4Tubs(volumeName, info.
fParams[0], info.
fParams[1], info.
fParams[2]/2., 0., 360.0*CLHEP::degree );
2851 info.
fCurrent =
new G4LogicalVolume(hallTube, G4Material::GetMaterial(
"Air"), volumeName);
2854 std::cerr <<
" .... Placing Mother volume " << volumeName <<
" r min " << info.
fParams[0]
2855 <<
" rMax " << info.
fParams[1] <<
" Length " 2859 if (name.find(
"DecayPipe") == 0) {
2860 if (name == G4String(
"DecayPipeHall")) {
2862 for (
size_t k=0;
k != 2; ++
k)
2866 G4Box* hallBox =
new G4Box(volumeName, info.
fParams[0]/2., info.
fParams[1]/2., info.
fParams[2]/2. );
2867 info.
fCurrent =
new G4LogicalVolume(hallBox, G4Material::GetMaterial(
"Air"), volumeName);
2874 <<
" meters from the start of Horn1, without Decay Pipe snout.. " <<
std::endl;
2878 std::cerr <<
" VolumePlacement, decay pipe, position " << info.
fPosition[2] <<
std::endl;
2880 if (name == G4String(
"DecayPipeConcrete")) {
2888 G4Tubs* tubs =
new G4Tubs(volumeName, info.
fParams[0], info.
fParams[1],
2889 info.
fParams[2]/2., 0., 360.0*CLHEP::degree );
2890 info.
fCurrent =
new G4LogicalVolume(tubs, G4Material::GetMaterial(
"Concrete"), volumeName);
2892 if (name == G4String(
"DecayPipeWall")) {
2897 G4Tubs* tubs =
new G4Tubs(volumeName, info.
fParams[0], info.
fParams[1],
2898 info.
fParams[2]/2., 0., 360.*CLHEP::degree);
2899 info.
fCurrent =
new G4LogicalVolume(tubs, G4Material::GetMaterial(
"Steel316"), volumeName);
2901 if (name == G4String(
"DecayPipeOuterWall")) {
2906 G4Tubs* tubs =
new G4Tubs(volumeName, info.
fParams[0], info.
fParams[1],
2907 info.
fParams[2]/2., 0., 360.*CLHEP::degree);
2908 info.
fCurrent =
new G4LogicalVolume(tubs, G4Material::GetMaterial(
"Steel316"), volumeName);
2911 if (name == G4String(
"DecayPipeVolume")) {
2916 G4Tubs* tubs =
new G4Tubs(volumeName, info.
fParams[0], info.
fParams[1],
2917 info.
fParams[2]/2., 0., 360.0*CLHEP::degree);
2918 info.
fCurrent =
new G4LogicalVolume(tubs, G4Material::GetMaterial(
"DecayPipeGas"), volumeName);
2920 if (name == G4String(
"DecayPipeSnout")) {
2937 G4Tubs* tubs =
new G4Tubs(volumeName, info.
fParams[0], info.
fParams[1],
2938 info.
fParams[2]/2., 0., 360.*CLHEP::degree);
2939 info.
fCurrent =
new G4LogicalVolume(tubs, G4Material::GetMaterial(
"DecayPipeGas"), volumeName);
2950 fSubVolumes.insert(std::pair<G4String, LBNEVolumePlacementData>(name, info));
2958 const bool debugIsOn =
false;
2959 G4LogicalVolume *lMother=mother->GetLogicalVolume();
2962 std::ostringstream mStrStr;
2963 mStrStr <<
" Internal error for " << name <<
" Mother Volume not found " <<
std::endl;
2964 G4String mStr(mStrStr.str());
2965 G4Exception(
"LBNEVolumePlacements::PlaceFinal",
" ", FatalErrorInArgument, mStr.c_str());
2968 if (debugIsOn) std::cerr <<
" LBNEVolumePlacements::PlaceFinal, name is " << name <<
std::endl;
2970 if (name == G4String(
"UpstreamTargetAssembly")) surveyedPtName =
std::string(
"Canister");
2971 if (name == G4String(
"TargetUpstrDownstrHeContainer")) surveyedPtName =
std::string(
"HeTube");
2972 if (name == G4String(
"Horn1TargetDownstrHeContainer")) surveyedPtName =
std::string(
"HeTube");
2973 if (name == G4String(
"Horn1TopLevelUpstr")) surveyedPtName =
std::string(
"Horn1");
2974 if (name == G4String(
"Horn1TopLevelDownstr")) surveyedPtName =
std::string(
"Horn1");
2976 if (name == G4String(
"TargetNoSplitHeContainer")) surveyedPtName =
std::string(
"HeTube");
2977 if (name == G4String(
"Horn1PolyM1")) surveyedPtName =
std::string(
"Horn1");
2978 if (name == G4String(
"LBNFSimpleHorn1Container")) surveyedPtName =
std::string(
"Horn1");
2979 if (name == G4String(
"LBNFSimpleHorn2Container")) surveyedPtName =
std::string(
"Horn2");
2980 if (name == G4String(
"LBNFSimpleHorn3Container")) surveyedPtName =
std::string(
"Horn3");
2981 if (name == G4String(
"Horn2Hall")) surveyedPtName =
std::string(
"Horn2");
2982 if (name == G4String(
"DecayPipeHall")) surveyedPtName =
std::string(
"DecayPipe");
2987 std::vector<double> posA(3,0.);
2989 if (debugIsOn) std::cerr <<
" LBNEVolumePlacements::PlaceFinal, Prior to alignment " << name <<
" half size " 2992 if (theSurvey->
size() != 0) {
2993 G4ThreeVector deltaUpstrLeft(0., 0., 0.);
2994 G4ThreeVector deltaUpstrRight(0., 0., 0.);
2995 G4ThreeVector deltaDownstrLeft(0., 0., 0.);
2996 G4ThreeVector deltaDownstrRight(0., 0., 0.);
2997 std::vector<double> deltaUpstr(3, 0.);
2998 std::vector<double> deltaDownstr(3, 0.);
2999 std::vector<double> deltaSlopes(2, 0.);
3002 itSurv != theSurvey->
end(); itSurv++) {
3003 if (itSurv->GetName().find(surveyedPtName) == std::string::npos)
continue;
3004 if (itSurv->GetName().find(
"Upstr") != std::string::npos) {
3005 if (itSurv->GetName().find(
"Left") != std::string::npos) deltaUpstrLeft = itSurv->GetPosition();
3006 else if (itSurv->GetName().find(
"Right") != std::string::npos) deltaUpstrRight = itSurv->GetPosition();
3007 }
else if (itSurv->GetName().find(
"Downstr") != std::string::npos) {
3008 if (itSurv->GetName().find(
"Left") != std::string::npos) deltaDownstrLeft = itSurv->GetPosition();
3009 else if (itSurv->GetName().find(
"Right") != std::string::npos) deltaDownstrRight = itSurv->GetPosition();
3012 for (
size_t k=0;
k != 3; ++
k) {
3013 if ((
std::abs(deltaUpstrLeft[
k]) > 2.0e-3*CLHEP::mm) && (
std::abs(deltaUpstrLeft[k]) > 2.0e-3*CLHEP::mm))
3014 deltaUpstr[
k] = 0.5*(deltaUpstrLeft[
k] + deltaUpstrRight[
k]);
3015 else if (
std::abs(deltaUpstrLeft[k]) > 2.0e-3*CLHEP::mm) deltaUpstr[k] = deltaUpstrLeft[k];
3016 else if (
std::abs(deltaUpstrRight[k]) > 2.0e-3*CLHEP::mm) deltaUpstr[k] = deltaUpstrRight[k];
3017 if ((
std::abs(deltaDownstrLeft[k]) > 2.0e-3*CLHEP::mm) && (
std::abs(deltaDownstrLeft[k]) > 2.0e-3*CLHEP::mm))
3018 deltaDownstr[
k] = 0.5*(deltaDownstrLeft[
k] + deltaDownstrRight[
k]);
3019 else if (
std::abs(deltaDownstrLeft[k]) > 2.0e-3*CLHEP::mm) deltaDownstr[k] = deltaDownstrLeft[k];
3020 else if (
std::abs(deltaDownstrRight[k]) > 2.0e-3*CLHEP::mm) deltaDownstr[k] = deltaDownstrRight[k];
3023 if ((name ==
"TargetUpstrDownstrHeContainer") || (name ==
"Horn1TargetDownstrHeContainer")) {
3036 deltaSlopes[
k] = (deltaDownstr[
k] - deltaUpstr[
k])/aTotalLength;
3037 if(name == G4String(
"Horn1TopLevelUpstr")) {
3039 }
else if(name == G4String(
"Horn1TopLevelDownstr")) {
3047 info.
fPosition[
k] += 0.5*(deltaUpstr[
k] + deltaDownstr[
k]);
3048 deltaSlopes[
k] = (deltaDownstr[
k] - deltaUpstr[
k])/info.
fParams[2];
3053 if ((
std::abs(deltaSlopes[0]) > 2.0e-9) || (
std::abs(deltaSlopes[1]) > 2.0e-9)) {
3055 info.
fRotation.rotateY(-1.0*deltaSlopes[0]);
3065 if (debugIsOn) std::cerr <<
" LBNEVolumePlacements::PlaceFinal, " << name <<
" half size " 3077 G4PVPlacement *placement=0;
3078 G4String vpName(name); vpName += G4String(
"_P");
3079 if (name ==
"Horn1IOTransCont") {
3080 std::cerr <<
" PlaceFinal, Z-offset for " << name <<
" is " << info.
fPosition <<
std::endl;
3085 placement=
new G4PVPlacement((G4RotationMatrix *) 0,
3088 std::cerr <<
" Rotated element, slope X= " << info.
fRotation.xz() <<
" Y " 3112 std::cerr <<
" LBNEVolumePlacements::PlaceFinalUpstrTarget, small NuMI tgt selected " <<
std::endl;
3115 std::cerr <<
" LBNEVolumePlacements::PlaceFinalUpstrTarget, NuMI target, 4mm cooling tube, November 2016. " <<
std::endl;
3120 std::cerr <<
" LBNEVolumePlacements::PlaceFinalUpstrTarget, Simple target, 8mm radius rod, June 2017. " <<
std::endl;
3130 std::cout <<
"======================================================================================" <<
std::endl;
3131 std::cout <<
" Dump of all the Placed Volumes " <<
std::endl;
3136 std::cout <<
" SubVolume " << it->first <<
" of type " << info.
fTypeName;
3137 if (info.
fMother == 0) std::cout <<
" has no assigned mother volume" <<
std::endl;
3138 else std::cout <<
" is in logical volume " << info.
fMother->GetLogicalVolume()->GetName() <<
std::endl;
3139 std::cout <<
" .... Params Values ";
3141 std::cout <<
" " << (*ip) <<
", ";
3143 std::cout <<
" .... Position " << info.
fPosition;
3146 std::cout <<
" .......... Has a rotation matrix ";
3149 std::cout <<
"-----------------------------------------------------------------------------------" <<
std::endl;
3152 std::cout <<
"======================================================================================" <<
std::endl;
3157 const char *motherName,
const char *descr)
const {
3160 std::ostringstream mStrStr;
3161 mStrStr <<
" Internal error for " << name <<
" to be placed in " 3162 << motherName <<
"; mother not found " <<
" descriptor " << G4String(descr) <<
std::endl;
3163 G4String mStr(mStrStr.str());
3164 G4String
origin(
"LBNEVolumePlacements::Find");
3165 G4Exception(origin,
" ", FatalErrorInArgument, mStr.c_str());
3168 return &(itM->second);
3176 if (res<=0) {
return false; }
3178 G4VSolid* solid = plVol->GetLogicalVolume()->GetSolid();
3179 G4LogicalVolume* motherLog = plVol->GetMotherLogical();
3180 if (!motherLog) {
return false; }
3182 G4VSolid* motherSolid = motherLog->GetSolid();
3186 G4cout <<
"Checking overlaps for volume " << plVol->GetName() <<
" ... ";
3191 G4AffineTransform Tm( plVol->GetRotation(), plVol->GetTranslation() );
3193 for (G4int
n=0;
n<res;
n++)
3197 G4ThreeVector point = solid->GetPointOnSurface();
3201 G4ThreeVector mp = Tm.TransformPoint(point);
3205 if (motherSolid->Inside(mp)==kOutside)
3207 G4double distin = motherSolid->DistanceToIn(mp);
3210 if (verbose) G4cout << G4endl;
3211 if (verbose) G4cout <<
"WARNING - G4PVPlacement::CheckOverlaps()" << G4endl
3212 <<
" Overlap is detected for volume " 3213 << plVol->GetName() << G4endl
3214 <<
" with its mother volume " 3215 << motherLog->GetName() << G4endl
3216 <<
" at mother local point " << mp <<
", " 3217 <<
"overlapping by at least: " << G4BestUnit(distin,
"Length")
3219 if (verbose)
G4Exception(
"G4PVPlacement::CheckOverlaps()",
"InvalidSetup",
3220 JustWarning,
"Overlap with mother volume !");
3227 for (G4int
i=0;
i<motherLog->GetNoDaughters();
i++)
3229 G4VPhysicalVolume* daughter = motherLog->GetDaughter(
i);
3231 if (daughter == plVol) {
continue; }
3235 G4AffineTransform Td( daughter->GetRotation(),
3236 daughter->GetTranslation() );
3237 G4ThreeVector
md = Td.Inverse().TransformPoint(mp);
3239 G4VSolid* daughterSolid = daughter->GetLogicalVolume()->GetSolid();
3240 if (daughterSolid->Inside(md)==kInside)
3242 G4double distout = daughterSolid->DistanceToOut(md);
3245 if (verbose) G4cout << G4endl;
3246 if (verbose) G4cout <<
"WARNING - G4PVPlacement::CheckOverlaps()" << G4endl
3247 <<
" Overlap is detected for volume " 3248 << plVol->GetName() << G4endl
3249 <<
" with " << daughter->GetName() <<
" volume's" 3251 <<
" local point " << md <<
", " 3252 <<
"overlapping by at least: " << G4BestUnit(distout,
"Length")
3254 if (verbose)
G4Exception(
"G4PVPlacement::CheckOverlaps()",
"InvalidSetup",
3255 JustWarning,
"Overlap with volume already placed !");
3268 G4ThreeVector dPoint = daughterSolid->GetPointOnSurface();
3273 G4ThreeVector mp2 = Td.TransformPoint(dPoint);
3274 G4ThreeVector msMp2 = Tm.Inverse().TransformPoint(mp2);
3276 if (solid->Inside(msMp2)==kInside)
3278 if (verbose) G4cout << G4endl;
3279 if (verbose) G4cout <<
"WARNING - G4PVPlacement::CheckOverlaps()" << G4endl
3280 <<
" Overlap is detected for volume " 3281 << plVol->GetName() << G4endl
3282 <<
" apparently fully encapsulating volume " 3283 << daughter->GetName() << G4endl
3284 <<
" at the same level !" << G4endl;
3285 if (verbose)
G4Exception(
"G4PVPlacement::CheckOverlaps()",
"InvalidSetup",
3286 JustWarning,
"Overlap with volume already placed !");
3295 G4cout <<
"OK! " << G4endl;
G4double fTargetDistToStartOfFlange
G4double fPlugInnerRadius
bool fInstallUpstreamHorizontalTarget
std::vector< double > fMotherHorn1AllLengths
std::vector< LBNEHornRadialEquation > fHorn1Equations
double fArbitraryOffsetHystericalOne
void SetRCoordOutOfTarget(double r) const
G4double fTargetFinHeight
void SegmentTargetSmallTgt()
G4String fTargetUpstrPlateMaterial
G4double fTargetBaffletLengthNoFlange
G4double fTargetSLengthDownstrEnd
G4double fTargetLengthOutsideHorn
std::vector< LBNESurveyedPt >::const_iterator end() const
G4double fTargetHeContTubeThickness
bool fUseLBNFOptimConceptDesignHornA
std::vector< G4double > fTargetHorn1ZPositions
void InitializeMessenger()
G4double fTargetDSSupportSmallConeSmallOuterRad
double fZHallHorn1ToHorn1PolyM1
G4double fTargetHeContTubeLargeConeLength
G4double fTargetFinWWingRadius
G4double fTargetDownstrCanFlangeInnerRadius
G4double fHorn1DownstreamPlateLength
G4double fCurrentMilindWire
const LBNEVolumePlacementData * Find(const G4String &name, const char *motherName, const char *method) const
G4double fSimpleTargetWidth
G4double fHorn2OuterTubeOuterRadMax
bool fPolyconeHorn1IsParabolic
G4double fTargetFlangeThick
G4double fTargetSpecificLambda
bool fInstallRALShortTarget
G4double fTargetHeContTubeLengthInHorn
std::vector< double > fHornsPolyOuterRadius
std::vector< std::vector< double > > fMotherHornsAllRads
G4LogicalVolume * fCurrent
static LBNEVolumePlacements * Instance()
G4double fTargetCTubeReturnDownstrCutAngleStart
G4double fDecayPipeWindowThickAlum
G4double fHorn1TopUpstrOuterRad
void setMotherVolumeForHorn1()
G4double GetBeamlineAngle() const
std::vector< double > fHornsPolyZStartPos
G4double fTargetFinWidthRequired
G4double fLengthOfRockDownstr
G4double fBaffleOuterRadius
G4double fTargetAlignRingInnerRadius
G4double fHorn1IOTransInnerRad
G4double fTargetHeContTubeLargeConeOuterRad
G4bool fUseSimpleTargetBox
bool fHorn1RadiusBigEnough
G4double fTargetFinContainerWidth
G4double fTargetCTubeReturnDownstrThickTitanium
void adaptTargetFor1p2MW()
G4int fTargetNumFinsUpstr
G4String fHorn1AllCondMat
G4UImessenger * fPlacementMessenger
G4double fTargetCTubeLength
G4double fTargetFinLengthSplitDwnstr
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4double fTargetOutHeContTubeOuterSphericalEndCap
G4String fHorn1InnerCondMat
bool fUseLBNFOptimConceptDesignHornC
G4double fHorn1IOTransLength
G4double fTargetAlignRingThick
G4double fTargetDSSupportSmallConeLargeOuterRad
G4double fTargetCTubeReturnDownstrRadOuter
G4double fHorn1TopUpstrLength
std::vector< G4double > fTargetHorn1InnerRadsUpstr
G4int fHorn1LongRescaleCnt
G4double fTargetZ0Downstr
bool fUseCDR2015Optimized
G4double fTargetDSSupportSmallConeSmallInnerRad
G4double fMultiSphereTargetLength
G4RotationMatrix fRotation
G4double fTargetOutHeContTubeTaperedLength
G4double fExtendChaseLength
G4double fTargetSLengthGraphite
G4double fBaffleWindowThickness
G4double fTargetCTubeReturnDownstrRadInner
G4double fPlugOuterRadius
G4double fBaffleInnerRadius
std::map< G4String, LBNEVolumePlacementData > fSubVolumes
G4double fTargetCTubeInnerRadius
G4double fChaseWidthForLBNF
G4double fHorn1TopDownstrOuterRad
G4double fDecayPipeWallThick
G4double fBaffleZPosition
G4String fHorn2InnerCondMat
G4double fTargetCTubeUpstrLength
G4double fTargetBerylDownstrWindowRadius
G4double fTargetDSSupportLargeConeLength
G4double fTargetCanLength
G4double fTargetCTubeOuterRadius
G4bool fUseMultiSphereTarget
G4double fHorn1NeckInnerRadius
G4double fHorn2LengthMargin
G4double fTargetAlignRingCutAngle
std::vector< double > fParams
G4double fTotalLengthUpstreamAssembly
static LBNESurveyor * Instance()
G4double fTargetHeContTubeSmallCylLength
bool IsVolumeMisaligned(const std::string &vName) const
G4VPhysicalVolume * fMother
G4double fTargetDSSupportAlRingInnerRad
G4double fTargetOutHeContTubeStraightLength
G4bool fUseRoundedTargetFins
std::vector< G4double > fTargetHorn1Lengths
int fUseNumberOfHornsPoly
G4double fTargetDownstrCanFlangeThick
std::string fPlugMaterial
bool fRotationIsUnitMatrix
G4double fTargetCTubeUpstrRadCurve
G4String fHorn3InnerCondMat
G4double fTotalLengthTargetAndHorn1Hall
unsigned int fTargetNumFinsWithWings
G4double fTargetUpstrPlateThick
std::string getenv(std::string const &name)
G4double fTargetFinLength
G4double fHorn2LongPosition
G4double fTargetHeContTubeInnerRadius
G4double fDecayPipeLongPosition
G4double fTargetFlangeInnerRadius
bool fInstallDownstTargetSupport
G4double fTargetUpstrPlateOuterRadius
LBNEVolumePlacementData * Create(const G4String &name)
void setEntireTargetDims()
G4int fHorn1RadialRescaleCnt
G4double fTargetCTubeReturnLengthUpstrEnd
G4double fRadiusMilindWire
G4double fDecayPipeUpstrWindowThick
void PlaceFinalUpstrTarget1p2MW(G4PVPlacement *mother)
G4double fTargetDSSupportLargeConeSmallInnerRad
G4double fTargetHeContTubeLargeConeInnerRad
G4String fMarsTargetHornsGDMLFilename
G4double fTargetHeContTubeBaffletLength
G4double fTargetZOffsetStart
G4double fTargetDSSupportLargeConeLargeOuterRad
bool fRemoveTargetAlltogether
static int max(int a, int b)
G4double fTargetHeContTubeLength
G4String fTargetAlignRingMaterial
void PlaceFinalSmallTarget1p2MW(G4PVPlacement *mother)
G4double fTargetDSSupportAlRingThickness
G4double fTargetFlangeOuterRadius
G4double fTargetBerylUpstrWindowRadius
G4double fMultiSphereTargetRadius
double fZShiftConceptHornAStartIC
G4double fDecayPipeRadius
G4bool fUseSimpleTargetCylinder
static LBNEVolumePlacements * fInstance
G4double fTargetHeContTubeLengthUpstr
bool fUseLBNFOptimConceptDesignHornB
G4double fTargetBerylDownstrWindowThick
G4String fTargetDownstrCanFlangeMaterial
void Initialize(const G4LogicalVolume *matriarch)
G4double fHorn1RadialRescale
G4double fDecayPipeWindowRadiusAlum
G4double fRALTargetRadius
void PlaceRALTGTv1(G4PVPlacement *mother)
bool fCheckVolumeOverLapWC
G4double fSimpleTargetHeight
G4double fTargetCanInnerRadius
G4double fTargetDSSupportLargeConeLargeInnerRad
G4double fTargetCTubeReturnDownstrThickWater
G4double fSimpleTargetRadius
double GetMaxRadiusMotherHorn1()
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
G4double fHorn1IOTransOuterRad
G4double fRALSimpleTargetLength
G4double fDecayPipeWindowThickBeryl
G4double fDecayPipeWindowZLocation
G4double fTargetCTubeReturnLengthUpstr
G4String fTargetCTubeMaterial
G4bool fConstructPlugInHorn1
G4String fTargetMaterialName
G4double fDecayPipeLengthCorrection
G4double fTargetDownstrCanFlangeOuterRadius
G4double fTargetFinSpacingLength
G4double fHorn1TopDownstrLength
std::vector< G4double > fTargetHorn1TransThick
G4double fHorn1LongRescale
bool fRemoveDecayPipeSnout
G4double fTargetLengthOutsideExtra
G4double fTargetCTubeReturnHOffset
G4double fTargetAlignRingOuterRadius
G4PVPlacement * PlaceFinal(const G4String &name, G4VPhysicalVolume *mother)
G4double fTargetCanOuterRadius
G4String fAbsorberGDMLFilename
G4double fTargetBaffletFlangeLength
G4double fHorn2LongRescale
G4double fTargetUpstrPlateHoleRadius
G4double fTargetDSSupportConnRing
G4String fTargetFlangeMaterial
G4double fSimpleTargetLength
std::vector< double > fMotherHorn1AllRads
G4String fTargetCanMaterial
G4int fTargetCTubeUpstrNumSegCurve
void adaptTargetFor1p2MWSmallTgt()
G4double fTargetDSSupportSmallConeLargeInnerRad
const G4LogicalVolume * fTopLogicalVolume
G4String fHorn2AllCondMat
G4double fTargetFinLengthSplitUpstr
G4double fWaterLayerThickInHorns
bool CheckOverlaps(const G4PVPlacement *phys, G4int nres, G4double eps, G4bool verbose) const
G4double fTargetHeContTubeSmallConeOuterRad
G4double fHorn2NeckInnerRadius
void PlaceFinalUpstrTarget(G4PVPlacement *mother)
G4double fThicknessBafflet
G4String fHorn3AllCondMat
G4double fTargetHeContTubeSmallConeLength
G4double fTargetFinExtraWidth
G4double fTargetBaffletOutRadius
G4double fTargetOutHeContTubeOuterRadius
G4double fTargetDSSupportSmallConeLength
G4double fTargetUpstrDwnstrMargin
std::vector< G4double > fTargetHorn1InnerRadsDownstr
G4double fTargetDSSupportLargeConeSmallOuterRad
std::vector< LBNESurveyedPt >::const_iterator begin() const
G4double fTargetBerylUpstrWindowThick
G4double fTargetUpstrUpstrMargin
G4double fTargetAlignRingSpacing
G4double fTargetLengthIntoHorn
G4double fTargetCTubeUpstrOffset
G4double fDecayPipeWindowRadiusBeryl
G4double fTargetCTubeReturnDownstrCutAngleSize
constexpr Point origin()
Returns a origin position with a point of the specified type.
LBNEVolumePlacements_AlignmentAlgo fAlignmentModel
QTextStream & endl(QTextStream &s)
G4int fTargetNumFinsInHorn
G4double fTargetHeContTubeColdHeCurvature
G4double fTargetDistFlangeToTargetStart
G4double fTargetAndBaffleLengthApprox
G4double fHorn2OffsetIOTr1
G4double fTargetHeContTubeSmallConeInnerRad
std::vector< std::vector< double > > fMotherHornsAllLengths
G4double fTargetFracOutHornL
G4double fTargetOutHeContTubeOuterRadiusTapered
G4double fDecayPipeLength
double fHorn1PolyOuterRadius