11 #include "G4UIdirectory.hh" 12 #include "G4UIcmdWithAString.hh" 13 #include "G4UIcmdWithABool.hh" 14 #include "G4UIcmdWithAnInteger.hh" 15 #include "G4UIcmdWithADoubleAndUnit.hh" 16 #include "G4UIcmdWithoutParameter.hh" 17 #include "G4UnitsTable.hh" 19 #include "G4Material.hh" 22 #include "G4Polycone.hh" 26 #include "G4LogicalVolume.hh" 27 #include "G4ThreeVector.hh" 28 #include "G4PVPlacement.hh" 29 #include "G4SubtractionSolid.hh" 30 #include "G4UnionSolid.hh" 31 #include "G4VisAttributes.hh" 33 #include "G4Transform3D.hh" 34 #include "G4RotationMatrix.hh" 35 #include "G4PVReplica.hh" 36 #include "G4AssemblyVolume.hh" 39 #include "G4PhysicalVolumeStore.hh" 40 #include "G4LogicalVolumeStore.hh" 42 #include "G4RegionStore.hh" 43 #include "G4SolidStore.hh" 44 #include "G4GeometryManager.hh" 45 #include "G4FieldManager.hh" 49 #include "G4GDMLParser.hh" 50 #include "G4UIcmdWithADouble.hh" 52 #include "G4RunManager.hh" 54 #include "G4VisExtent.hh" 162 G4Element* elH =
new G4Element(
"Hydrogen",
"H" , 1., 1.01*CLHEP::g/CLHEP::mole);
163 new G4Element(
"Helium",
"He" , 2., 4.003*CLHEP::g/CLHEP::mole);
164 elC =
new G4Element(
"Carbon",
"C" , 6., 12.01*CLHEP::g/CLHEP::mole);
165 elN =
new G4Element(
"Nitrogen",
"N" , 7., 14.01*CLHEP::g/CLHEP::mole);
166 elO =
new G4Element(
"Oxygen" ,
"O" , 8., 16.00*CLHEP::g/CLHEP::mole);
167 G4Element* elNa =
new G4Element(
"Sodium" ,
"Na" , 11., 22.99*CLHEP::g/CLHEP::mole);
168 G4Element* elMg =
new G4Element(
"Magnesium" ,
"Mg" , 12., 24.305*CLHEP::g/CLHEP::mole);
169 G4Element* elAl =
new G4Element(
"Aluminum" ,
"Al" , 13., 26.98*CLHEP::g/CLHEP::mole);
170 G4Element* elSi =
new G4Element(
"Silicon" ,
"Si" , 14., 28.09*CLHEP::g/CLHEP::mole);
171 G4Element* elP =
new G4Element(
"Phosphorus" ,
"P" , 15., 30.974*CLHEP::g/CLHEP::mole);
172 G4Element* elS =
new G4Element(
"Sulfur" ,
"S" , 16., 32.065*CLHEP::g/CLHEP::mole);
173 G4Element* elK =
new G4Element(
"Potassium" ,
"K" , 19., 39.1*CLHEP::g/CLHEP::mole);
174 G4Element* elCa =
new G4Element(
"Calcium" ,
"Ca" , 20., 40.09*CLHEP::g/CLHEP::mole);
175 G4Element* elTi =
new G4Element(
"Titanium" ,
"Ti" , 22., 47.867*CLHEP::g/CLHEP::mole);
176 G4Element* elCr =
new G4Element(
"Chromium" ,
"Cr" , 24., 51.9961*CLHEP::g/CLHEP::mole);
177 G4Element* elMn =
new G4Element(
"Manganese" ,
"Mn" , 25., 54.938*CLHEP::g/CLHEP::mole);
178 elFe =
new G4Element(
"Iron" ,
"Fe" , 26., 55.85*CLHEP::g/CLHEP::mole);
179 G4Element* elNi =
new G4Element(
"Nickel" ,
"Ni" , 28., 58.6934*CLHEP::g/CLHEP::mole);
180 G4Element* elCu =
new G4Element(
"Copper" ,
"Cu" , 29., 63.546*CLHEP::g/CLHEP::mole);
181 G4Element* elHg =
new G4Element(
"Mercury" ,
"Hg" , 80., 200.59*CLHEP::g/CLHEP::mole);
182 G4Element* elMo =
new G4Element(
"Molybdenum" ,
"Mo" , 42., 95.96*CLHEP::g/CLHEP::mole);
183 G4Element* elNiob =
new G4Element(
"Niobium" ,
"Nb" , 41., 92.90637*CLHEP::g/CLHEP::mole);
184 G4Element* elCo =
new G4Element(
"Cobalt" ,
"Nb" , 27., 58.9932*CLHEP::g/CLHEP::mole);
185 G4Element* elV =
new G4Element(
"Vanadium" ,
"V" , 23, 50.9415*CLHEP::g/CLHEP::mole);
188 Air =
new G4Material(
"Air" , 1.290*CLHEP::mg/CLHEP::cm3, 2);
189 Air->AddElement(
elN, 0.7);
190 Air->AddElement(
elO, 0.3);
192 CT852 =
new G4Material(
"CT852", 7.75*CLHEP::g/CLHEP::cm3, 10);
194 CT852->AddElement(elSi, 0.008);
195 CT852->AddElement(elMn, 0.008);
196 CT852->AddElement(elCr, 0.13);
197 CT852->AddElement(elS, 0.00025);
198 CT852->AddElement(elP, 0.0003);
199 CT852->AddElement(elTi, 0.002);
200 CT852->AddElement(elCu, 0.003);
201 CT852->AddElement(elNi, 0.006);
204 Steel316 =
new G4Material(
"Steel316", 8.0*CLHEP::g/CLHEP::cm3, 9);
216 Titanium =
new G4Material(
"Titanium", 22, 47.867*CLHEP::g/CLHEP::mole, 4.506*CLHEP::g/CLHEP::cm3);
218 TitaniumG5 =
new G4Material(
"TitaniumG5", 4.42*CLHEP::g/CLHEP::cm3, 3);
224 Slab_Stl =
new G4Material(
"Slab_Stl", 7.8416*CLHEP::g/CLHEP::cm3, 6);
233 Blu_Stl =
new G4Material(
"Blu_Stl", 7.25*CLHEP::g/CLHEP::cm3, 1);
236 Water =
new G4Material(
"Water", 1.0*CLHEP::g/CLHEP::cm3, 2);
237 Water->AddElement(elH, 2);
240 Vacuum =
new G4Material(
"Vacuum", 2.376e-15*CLHEP::g/CLHEP::cm3,1,kStateGas,300.*CLHEP::kelvin,2.0e-7*CLHEP::bar);
243 new G4Material(
"Helium", 2, 4.0026*CLHEP::g/CLHEP::mole, 2.55*0.1785*CLHEP::kg/CLHEP::m3, kStateGas,
244 300*CLHEP::kelvin, 2.55*CLHEP::atmosphere);
246 new G4Material(
"HeliumTarget", 2, 4.0026*CLHEP::g/CLHEP::mole, 1.7436*0.1785*CLHEP::kg/CLHEP::m3, kStateGas,
247 350*CLHEP::kelvin, 1.36*CLHEP::atmosphere);
250 new G4Material(
"Aluminum", 13, 26.98*CLHEP::g/CLHEP::mole, 2.7*CLHEP::g/CLHEP::cm3);
251 new G4Material(
"Argon", 18, 39.948*CLHEP::g/CLHEP::mole, 1.784*CLHEP::kg/CLHEP::m3, kStateGas,
252 300*CLHEP::kelvin, CLHEP::atmosphere);
253 new G4Material(
"Lead", 82, 207.19*CLHEP::g/CLHEP::mole, 11.35*CLHEP::g/CLHEP::cm3);
254 new G4Material(
"Iron", 26, 55.85*CLHEP::g/CLHEP::mole, 7.86999*CLHEP::g/CLHEP::cm3);
255 new G4Material(
"Uranium", 92, 238.028*CLHEP::g/CLHEP::mole, 19.1*CLHEP::g/CLHEP::cm3);
257 Concrete =
new G4Material(
"Concrete", 2.03*CLHEP::g/CLHEP::cm3, 10);
269 G4Material *rockMat =
new G4Material(
"rockMat", 2.78*CLHEP::g/CLHEP::cm3, 4 );
270 rockMat->AddElement( elCa, 1);
271 rockMat->AddElement( elMg, 1);
272 rockMat->AddElement(
elC, 2);
273 rockMat->AddElement(
elO, 6);
275 G4Material *aluminaMat =
new G4Material(
"Alumina", 3.92*CLHEP::g/CLHEP::cm3, 2 );
277 aluminaMat->AddElement( elAl, 2);
278 aluminaMat->AddElement(
elO, 3);
280 G4Material *inconelMat =
new G4Material(
"Inconel718", 8.1933*CLHEP::g/CLHEP::cm3, 8 );
282 inconelMat->AddElement( elNi, 0.525);
283 inconelMat->AddElement( elCr, 0.19);
284 inconelMat->AddElement(
elFe, 0.17925);
285 inconelMat->AddElement( elNiob, 0.05125);
286 inconelMat->AddElement( elMo, 0.0305);
287 inconelMat->AddElement( elTi, 0.009);
288 inconelMat->AddElement( elAl, 0.005);
289 inconelMat->AddElement( elCo, 0.01);
292 graphiteBaffle =
new G4Material(
"GraphiteBaffle", 1.78*CLHEP::g/CLHEP::cm3, 3 );
297 G4Material* graphite =
new G4Material(
"Graphite", 1.78*CLHEP::g/CLHEP::cm3, 3 );
298 graphite->AddElement(
elC, 0.99);
299 graphite->AddElement(
elN, 0.007);
300 graphite->AddElement(
elO, 0.003);
302 new G4Material(
"Beryllium", 4, 9.0122*CLHEP::g/CLHEP::mole, 1.85*CLHEP::g/CLHEP::cm3);
304 G4Material *Mylar =
new G4Material(
"Mylar", 1.397*CLHEP::g/CLHEP::cm3, 3);
305 Mylar->AddElement(
elC, 10);
306 Mylar->AddElement(elH, 8);
307 Mylar->AddElement(
elO, 4);
316 if ((aNameT == G4String(
"Graphite")) || (aNameT == G4String(
"graphite")) ||
317 (aNameT == G4String(
"Carbon")) || (aNameT == G4String(
"carbon"))) {
319 Target =
new G4Material(
"Target",
325 }
else if ((aNameT == G4String(
"Beryllium"))
326 || (aNameT == G4String(
"beryllium"))) {
327 new G4Material(
"Target", 4, 9.0122*CLHEP::g/CLHEP::mole, 1.85*CLHEP::g/CLHEP::cm3);
333 }
else if ((aNameT == G4String(
"Aluminium"))
334 || (aNameT == G4String(
"aluminium"))) {
335 new G4Material(
"Target", 13, 26.98*CLHEP::g/CLHEP::mole, 2.7*CLHEP::g/CLHEP::cm3);
341 }
else if (aNameT == G4String(
"lightCarbon")) {
342 Target =
new G4Material(
"Target",
348 G4String mess(
" Non-standard material for the target: ");
349 mess += aNameT + G4String (
" . \n");
350 mess += G4String(
"... Please upgrade the code after consultation with mechanical engineers\n.");
351 G4Exception(
"LBNEDetectorConstruction::InitializeMaterialsPostPreIdle",
352 " ", FatalErrorInArgument, mess.c_str());
356 if ((aNameG == G4String(
"Air")) || (aNameG == G4String(
"air"))) {
357 G4Material *gas =
new G4Material(
"DecayPipeGas" , 1.290*CLHEP::mg/CLHEP::cm3, 2);
358 gas->AddElement(
elN, 0.7);
359 gas->AddElement(
elO, 0.3);
360 }
else if ((aNameG == G4String(
"Helium")) || (aNameG == G4String(
"helium"))) {
361 new G4Material(
"DecayPipeGas", 2, 4.0026*CLHEP::g/CLHEP::mole, 0.1785*CLHEP::kg/CLHEP::m3, kStateGas,
362 300*CLHEP::kelvin, 1.0*CLHEP::atmosphere);
364 G4String mess(
" Non-standard gas : ");
365 mess += aNameG + G4String (
" in the decay pipe . \n");
366 mess += G4String(
"... Please upgrade the code after consultation with mechanical engineers\n. ");
367 G4Exception(
"LBNEDetectorConstruction::InitializeMaterialsPostPreIdle",
368 " ", FatalErrorInArgument, mess.c_str());
372 new G4Material(
"Silicon", 14, 28.0855*CLHEP::g/CLHEP::mole, 2.329*CLHEP::g/CLHEP::cm3);
373 G4Element* elSr =
new G4Element(
"Strontium" ,
"Sr" , 38., 87.62*CLHEP::g/CLHEP::mole);
374 G4Material* myFerrite =
new G4Material(
"FerriteC8", 5.*CLHEP::g/CLHEP::cm3, 3);
375 myFerrite->AddElement(elSr, 1);
376 myFerrite->AddElement(
elO, 19);
377 myFerrite->AddElement(
elFe, 12);
391 if (matName == G4String(
"graphite")) {
394 G4Material* target1 =
new G4Material(
"Target1", 1.78*CLHEP::g/CLHEP::cm3, 3);
395 target1->AddElement(
elC, 0.99);
396 target1->AddElement(
elN, 0.007);
397 target1->AddElement(
elO, 0.003);
401 }
else if (matName == G4String(
"beryllium")) {
403 new G4Material(
"Target1", 4, 9.0122*CLHEP::g/CLHEP::mole, 1.85*CLHEP::g/CLHEP::cm3);
409 }
else if (matName == G4String(
"aluminium")) {
411 new G4Material(
"Target1", 13, 26.98*CLHEP::g/CLHEP::mole, 2.7*CLHEP::g/CLHEP::cm3);
428 if (matName == G4String(
"graphite")) {
431 G4Material* target2 =
new G4Material(
"Target2", 1.78*CLHEP::g/CLHEP::cm3, 3);
432 target2->AddElement(
elC, 0.99);
433 target2->AddElement(
elN, 0.007);
434 target2->AddElement(
elO, 0.003);
438 }
else if (matName == G4String(
"beryllium")) {
440 new G4Material(
"Target2", 4, 9.0122*CLHEP::g/CLHEP::mole, 1.85*CLHEP::g/CLHEP::cm3);
446 }
else if (matName == G4String(
"aluminium")) {
448 new G4Material(
"Target2", 13, 26.98*CLHEP::g/CLHEP::mole, 2.7*CLHEP::g/CLHEP::cm3);
454 }
else if (matName == G4String(
"tantalum")) {
456 new G4Material(
"Target2", 73, 180.94788*CLHEP::g/CLHEP::mole, 16.65*CLHEP::g/CLHEP::cm3);
462 }
else if (matName == G4String(
"tungsten")) {
464 new G4Material(
"Target2", 74, 183.84*CLHEP::g/CLHEP::mole, 19.3*CLHEP::g/CLHEP::cm3);
478 G4VisAttributes* visAtt;
479 if(mName ==
"Vacuum") visAtt =
new G4VisAttributes(
false);
480 else if(mName==
"Aluminum") visAtt =
new G4VisAttributes(G4Color(0.2, 0.8, 1));
481 else if(mName==
"Air") visAtt =
new G4VisAttributes(G4Color(0.6,0.7,0.8));
482 else if(mName==
"Iron" || mName==
"Slab_Stl") visAtt=
new G4VisAttributes(G4Color(0.5,0.3,0));
483 else if(mName==
"Concrete") visAtt =
new G4VisAttributes(G4Color(0.75,0.85,0.95));
484 else visAtt =
new G4VisAttributes(G4Color(1,0,0));
492 G4MaterialTable* matTable = (G4MaterialTable*)G4Material::GetMaterialTable();
493 for(i=0;i<matTable->size();i++)
494 {
delete (*(matTable))[
i]; }
496 G4ElementTable* elemTable = (G4ElementTable*)G4Element::GetElementTable();
497 for(i=0;i<elemTable->size();i++)
498 {
delete (*(elemTable))[
i]; }
505 std::cerr <<
" WARNING: LBNEDetectorConstruction::Construct, already done, skip " <<
std::endl;
511 std::cout <<
" LBNEDetectorConstruction::Construct, Start !!! " <<
std::endl;
512 std::cerr <<
" LBNEDetectorConstruction::Construct, Start !!! " <<
std::endl;
521 G4LogicalVolume *RockLogical =
522 new G4LogicalVolume(ROCK_solid,
523 G4Material::GetMaterial(
"Concrete"),
524 "RockLogical",0,0,0);
527 fRock =
new G4PVPlacement(0,G4ThreeVector(),RockLogical,
"ROCK",0,
false,0);
534 std::cerr <<
" Placement data for volume Tunnel, half length " 545 const bool useHornsPolycone = usedNumberOfHornsPoly > 0;
546 bool implementHorn1AsLBNEHorn = !useHornsPolycone;
550 if (useHornsPolycone) {
551 for (
size_t iH=0; iH != usedNumberOfHornsPoly; iH++) {
560 std::cerr <<
" Placement data for volume TargetHallAndHorn1, half length " 567 std::cerr <<
" Placement data for volume UpstreamTargetAssembly, half length " 574 std::cerr <<
" Detector Construction, TargetHallAndHorn1 is placed " <<
std::endl;
577 G4PVPlacement * upstreamTargetAssPhys =
579 std::cerr <<
" Detector Construction, UpstreamTargetAssembly is placed " <<
std::endl;
585 std::vector<G4PVPlacement*> vHornsAfterHornX;
589 std::cerr <<
" Horn1PolyM1 Half Length " << plH1PolyDat->
fParams[2]/2. <<
" At position " << plH1PolyDat->
fPosition[2] <<
std::endl;
599 if (implementHorn1AsLBNEHorn)
600 vHornsAfterHornX.push_back(0);
601 else vHornsAfterHornX.push_back(vHorn1);
603 G4PVPlacement *vHorn2 = 0;
606 std::cerr <<
" Old Horn2 installation... " <<
std::endl;
617 std::cerr <<
" Polycone Horn2/Horn3 (or B & C) installation...usedNumberOfHornsPoly " << usedNumberOfHornsPoly <<
std::endl;
618 if (usedNumberOfHornsPoly > 1) {
619 for (
size_t iH=1; iH != usedNumberOfHornsPoly; iH++) {
620 std::cerr <<
" ... Placing Horn " << (iH+1) <<
" in the tunnel.. " << std::endl;
621 std::ostringstream nameHStr; nameHStr <<
"LBNFSimpleHorn" << (iH+1) <<
"Container";
625 vHornsAfterHornX.push_back(vHorn);
626 std::cerr <<
" ... Mother volume placed... " <<
std::endl;
644 G4ThreeVector posTmp; posTmp[0] =0.; posTmp[1] =0.;
649 G4Tubs* plugTube =
new G4Tubs(
"PlugOr2ndTgt", aRadIn, aRadOut, aLength*.5, 0., 360.*CLHEP::deg);
650 G4LogicalVolume *plugl =
new G4LogicalVolume(plugTube, G4Material::GetMaterial(aPlugMaterial.c_str()),
"PlugOr2ndTgt");
652 G4String motherVolForPlug(
"TargetHallAndHorn1");
655 G4String(
"LBNEDetectorConstruction::Construct"));
659 new G4PVPlacement((G4RotationMatrix *) 0, posTmp, plugl,
"PlugOr2ndTgt_P",
660 targethorn1Phys->GetLogicalVolume(),
false, 1,
true);
661 std::cerr <<
" ..... Plug (e.g., 2nd target) installed in Horn1 starting at Z = " << posTmp[2]-aLength/2. <<
std::endl;
663 new G4PVPlacement((G4RotationMatrix *) 0, posTmp, plugl,
"PlugOr2ndTgt_P",
664 tunnel->GetLogicalVolume(),
false, 1,
true);
665 std::cerr <<
" ..... Plug (e.g., 2nd target) installed in Tunnel starting at Z = " << posTmp[2]-aLength/2. <<
std::endl;
670 if (implementHorn1AsLBNEHorn) {
677 G4FieldManager* aFieldMgr =
new G4FieldManager(fieldHorn1);
678 aFieldMgr->SetDetectorField(fieldHorn1);
679 aFieldMgr->CreateChordFinder(fieldHorn1);
682 plH1Dat->
fCurrent->SetFieldManager(aFieldMgr,
true);
694 G4FieldManager* aFieldMgr2 =
new G4FieldManager(fieldHorn2);
695 aFieldMgr2->SetDetectorField(fieldHorn2);
696 aFieldMgr2->CreateChordFinder(fieldHorn2);
697 plH2Dat->
fCurrent->SetFieldManager(aFieldMgr2,
true);
708 std::cerr <<
" Defining Polycone Mag field, usedNumberOfHornsPoly " << usedNumberOfHornsPoly <<
std::endl;
709 for (
size_t iH=0; iH != usedNumberOfHornsPoly; iH++) {
710 if (implementHorn1AsLBNEHorn)
continue;
712 std::ostringstream vStrStr; vStrStr <<
"LBNFSimpleHorn" << iH+1 <<
"Container";
717 const double zStart = plHxPolyDat->
fPosition[2] - plHxPolyDat->
fParams[2]/2.;
719 std::cerr <<
" Horn1 will start at Z =" << zStart <<
std::endl;
732 G4FieldManager* aFieldMgr =
new G4FieldManager(fieldHorn);
733 aFieldMgr->SetDetectorField(fieldHorn);
734 aFieldMgr->CreateChordFinder(fieldHorn);
740 targethorn1Phys->GetLogicalVolume()->SetFieldManager(aFieldMgr,
true);
741 std::cerr <<
" Magnetic field attached to volume " <<
742 targethorn1Phys->GetLogicalVolume()->GetName() <<
" Expecting field inside inner inner conductor " <<
std::endl;
744 vHornsAfterHornX[iH]->GetLogicalVolume()->SetFieldManager(aFieldMgr,
true);
745 std::cerr <<
" Magnetic field attached to volume " <<
746 vHornsAfterHornX[iH]->GetLogicalVolume()->GetName() <<
std::endl;
814 G4FieldManager* aFieldMgr3 =
new G4FieldManager(fieldDecayPipe);
815 aFieldMgr3->SetDetectorField(fieldDecayPipe);
816 aFieldMgr3->CreateChordFinder(fieldDecayPipe);
819 plDCV->
fCurrent->SetFieldManager(aFieldMgr3,
true);
854 Parser.Write(
"g4lbnf.gdml",tunnel);
862 G4cout <<
"Importing hadron absorber gdml file... " << G4endl;
865 std::ifstream gdmlfile(
filename.c_str());
866 if (!gdmlfile.is_open()) {
868 mess +=
filename + G4String(
" could not be found \n");
869 G4Exception(
"LBNEDetectorConstruction::ConstructLBNEHadronAbsorber",
" ",
870 FatalErrorInArgument, mess.c_str());
880 G4LogicalVolume *topAbs = parser.GetVolume(
"TOP" );
930 const G4Box *topSol =
static_cast<const G4Box *
>(topAbs->GetSolid());
934 std::cerr <<
" Dimension of top level Hadron absorber MARS container, X " << topSol->GetXHalfLength() <<
935 " Y " << topSol->GetYHalfLength() <<
" Z " << topSol->GetZHalfLength() <<
std::endl;
936 std::cerr <<
" Number of daughters for TOP " << topAbs->GetNoDaughters() <<
std::endl;
937 double maxHalfHeight = -1.0;
938 double maxHalfWidth = -1.0;
939 double maxHalfLength = -1.0;
940 for (
int i=0;
i != topAbs->GetNoDaughters(); ++
i) {
941 G4VPhysicalVolume *pVol = topAbs->GetDaughter(
i);
942 G4LogicalVolume *lVol = pVol->GetLogicalVolume();
943 std::cerr <<
" Daughther " << lVol->GetName();
944 const G4Box *aBox =
static_cast<const G4Box *
>(lVol->GetSolid());
945 G4ThreeVector
loc = pVol->GetObjectTranslation();
946 std::cerr <<
" at MARS coordinates " << loc[0] <<
", " <<loc[1] <<
", " << loc[2] <<
947 " zLength " << 2.0*aBox->GetZHalfLength() <<
std::endl;
949 if ((
std::abs(loc[2]) + aBox->GetZHalfLength()) > maxHalfLength)
950 maxHalfLength =
std::abs(loc[2]) + aBox->GetZHalfLength();
951 if ((
std::abs(loc[1]) + aBox->GetYHalfLength()) > maxHalfWidth)
952 maxHalfWidth =
std::abs(loc[1]) + aBox->GetYHalfLength();
953 if ((
std::abs(loc[0]) + aBox->GetXHalfLength()) > maxHalfHeight)
954 maxHalfHeight =
std::abs(loc[0]) + aBox->GetXHalfLength();
957 maxHalfHeight += 5.0*CLHEP::cm;
958 maxHalfWidth += 5.0*CLHEP::cm;
960 std::cerr <<
" Container volume for Hadron absorber, 1/2 width " 961 << maxHalfWidth <<
" 1/2 Height " << maxHalfHeight
962 <<
" 1/2 length " << maxHalfLength <<
std::endl;
963 G4Box *aHABoxTop =
new G4Box(G4String(
"HadronAbsorberTop"), maxHalfWidth, maxHalfHeight, maxHalfLength);
964 G4LogicalVolume *aHATopL =
965 new G4LogicalVolume(aHABoxTop, G4Material::GetMaterial(
"Air"), G4String(
"HadronAbsorberTop"));
968 G4String(
"LBNEDetectorConstruction::ConstructLBNEHadronAbsorber"));
969 const double zzz = maxHalfLength + plDecayPipe->
fParams[2]/2 + plDecayPipe->
fPosition[2] +
972 std::cerr <<
" half length Decay Pipe " << plDecayPipe->
fParams[2]/2
973 <<
" Position in tunnel (center) " << plDecayPipe->
fPosition[2]
974 <<
" half width decay pipe " << plDecayPipe->
fParams[0]/2 <<
" 1/2 height " << plDecayPipe->
fParams[1]/2
981 G4ThreeVector posTopHA(0., yyy, zzz);
984 mother->GetLogicalVolume(),
false, 1,
true);
986 G4RotationMatrix *marsRot =
new G4RotationMatrix;
987 marsRot->rotateZ(-M_PI/2.);
988 for (
int i=0;
i != topAbs->GetNoDaughters(); ++
i) {
989 G4VPhysicalVolume *pVol = topAbs->GetDaughter(
i);
990 G4LogicalVolume *lVol = pVol->GetLogicalVolume();
992 G4ThreeVector
loc = pVol->GetObjectTranslation();
994 double yyyI = loc[0] ;
995 const double xxx = loc[1];
999 double zzzI = loc[2] - 27.9*
CLHEP::m;
1000 if (lVol->GetName().find(
"AH_top") != std::string::npos) {
1001 yyyI += 0.1*CLHEP::mm;
1006 G4ThreeVector posTmp(xxx, yyyI, zzzI);
1016 new G4PVPlacement(marsRot, posTmp, lVol, lVol->GetName() +
std::string(
"_P"), aHATopL,
false, 1,
true);
1025 for (
int i=0;
i != topAbs->GetNoDaughters(); ++
i) {
1026 G4VPhysicalVolume *pVol1 = topAbs->GetDaughter(
i);
1027 G4LogicalVolume *lVol1 = pVol1->GetLogicalVolume();
1030 for (
int ii=0; ii != lVol1->GetNoDaughters(); ++ii) {
1031 G4VPhysicalVolume *pVol2 = lVol1->GetDaughter(ii);
1032 G4LogicalVolume *lVol2 = pVol2->GetLogicalVolume();
1034 if (aVolNameTmp2 !=
std::string(
"AH_Muon_alkair"))
continue;
1035 std::cerr <<
" Found AH_Muon_alk again ... " <<
std::endl;
1037 G4Box *detSolid =
new G4Box(
"detSolid",2.5*
CLHEP::m,2.5*
CLHEP::m,1.0*CLHEP::cm);
1039 TrackingPlaneLogical=
new G4LogicalVolume(detSolid , G4Material::GetMaterial(
"Air"),
"detLogical", 0,0,0);
1041 G4ThreeVector posTmp; posTmp[0] =0.; posTmp[1] =0.;
1044 std::cerr <<
" Placing test planes in absorber hall" <<
std::endl;
1046 "trackPln1",lVol2,
false, 1,
true);
1048 G4ThreeVector posTmp2; posTmp2[0] =0.; posTmp2[1] =0.;
1051 "trackPln2",lVol2,
false, 1,
true);
1052 std::cerr <<
" Top level daughter # " <<
i <<
" Name " << lVol1->GetName();
1060 topAbs->ClearDaughters();
1075 G4double air_box_x = 16.223*
CLHEP::m;
1076 G4double air_box_y = 19.355*
CLHEP::m;
1080 G4Box *air_Box =
new G4Box(
"AirBox",air_box_x/2,air_box_y/2,air_box_z/2);
1081 G4ThreeVector air_posBox; air_posBox[0] =0.; air_posBox[1] =0.45*
CLHEP::m; air_posBox[2] = 231.0*
CLHEP::m;
1083 G4LogicalVolume *air_logBox =
1084 new G4LogicalVolume(air_Box, G4Material::GetMaterial(
"Air"), G4String(
"LogicalVAirBox"),0,0,0);
1088 "PhysAirBox",mother->GetLogicalVolume(),
false, 1,
true);
1101 G4double AH_ConcreteX = 10.23*
CLHEP::m;
1102 G4double AH_ConcreteY = 12.125*
CLHEP::m;
1103 G4double AH_ConcreteZ = 6.24*
CLHEP::m + SteelWidth + ConcWidth;
1105 G4Box *ConcreteBox1=
new G4Box(
"ConcreteBox1",AH_ConcreteX/2,AH_ConcreteY/2,AH_ConcreteZ/2);
1108 G4SubtractionSolid *AH_Concrete=
1109 new G4SubtractionSolid(
"AH_Concrete",ConcreteBox1,box1,0,G4ThreeVector(0.,0.1*
CLHEP::m,-4.37*
CLHEP::m-AH_ConcreteZ/2));
1111 G4ThreeVector posAH_Concrete; posAH_Concrete[0] =0.; posAH_Concrete[1] =0.4*
CLHEP::m; posAH_Concrete[2] =AH_ConcreteZ/2-air_box_z/2;
1113 G4ThreeVector posAH_AirBox1; posAH_AirBox1[0] =0.; posAH_AirBox1[1] =0.1*
CLHEP::m; posAH_AirBox1[2] = (0.63/2)*
CLHEP::m-AH_ConcreteZ/2;
1115 G4LogicalVolume *AH_ConcreteLV=
1116 new G4LogicalVolume(AH_Concrete, G4Material::GetMaterial(
"Concrete"), G4String(
"LV_AHConcrete"),0,0,0);
1117 new G4PVPlacement((G4RotationMatrix *) 0,posAH_Concrete,AH_ConcreteLV,
1118 "PV_AHConcrete",air_logBox,
false, 1,
true);
1123 G4VisAttributes *AHConcrete_Att =
new G4VisAttributes(G4Colour(G4Colour::Magenta()));
1124 AHConcrete_Att->G4VisAttributes::SetForceWireframe(
true);
1125 AH_ConcreteLV->SetVisAttributes(AHConcrete_Att);
1131 G4double AH_ShieldStlX = 5.46*
CLHEP::m;
1132 G4double AH_ShieldStlY = 5.59*
CLHEP::m;
1133 G4double AH_ShieldStlZ = 5.41*
CLHEP::m+SteelWidth;
1135 G4Box *AH_ShieldStl=
new G4Box(
"AH_ShieldStl",AH_ShieldStlX/2,AH_ShieldStlY/2,AH_ShieldStlZ/2);
1138 G4ThreeVector posAH_ShieldStl; posAH_ShieldStl[0] =0.;
1139 posAH_ShieldStl[1] =0.; posAH_ShieldStl[2] =AH_ShieldStlZ/2-AH_ConcreteZ/2+0.63*
CLHEP::m;
1141 G4LogicalVolume *AH_ShieldStlLV=
1142 new G4LogicalVolume(AH_ShieldStl,G4Material::GetMaterial(
"Slab_Stl"), G4String(
"LV_AHShieldStl"),0,0,0);
1143 new G4PVPlacement((G4RotationMatrix *) 0,posAH_ShieldStl,AH_ShieldStlLV,
1144 "PV_AHShieldStl",AH_ConcreteLV,
false, 1,
true);
1148 G4VisAttributes *AHShieldStl_Att =
new G4VisAttributes(G4Colour(0.,1.,0.));
1149 AHShieldStl_Att->G4VisAttributes::SetForceWireframe(
true);
1150 AH_ShieldStlLV->SetVisAttributes(AHShieldStl_Att);
1156 G4double AH_AlholeX = 1.96*
CLHEP::m;
1157 G4double AH_AlholeY = 2.18*
CLHEP::m;
1158 G4double AH_AlholeZ = 1.83*
CLHEP::m;
1160 G4Box *AH_Alhole=
new G4Box(
"AH_Alhole",AH_AlholeX/2,AH_AlholeY/2,AH_AlholeZ/2);
1164 G4double posZ [8];posZ[0]=al; posZ[1]=al+0.305*
CLHEP::m;
1168 G4double Irad [8];Irad[0]=0.; Irad[1]=0.; Irad[2]=0.;Irad[3]=0.;Irad[4]=0.;Irad[5]=0.;Irad[6]=0.;Irad[7]=0.;
1173 std::vector<double> zzPolycone(16, 0.);
1174 std::vector<double> rrPolycone(16, 0.);
1175 for (
size_t kPoly=0; kPoly != 8; kPoly++) {
1176 zzPolycone[kPoly] = posZ[kPoly];
1177 zzPolycone[kPoly+8] = posZ[7-kPoly];
1178 rrPolycone[kPoly] = Irad[kPoly];
1179 rrPolycone[kPoly+8] = Orad[kPoly];
1182 G4Polycone* pcone =
new G4Polycone(
"pcone", 0.,2*M_PI*CLHEP::rad,8, &rrPolycone[0], &zzPolycone[0]);
1184 G4ThreeVector posAH_Alhole; posAH_Alhole[0] =0.; posAH_Alhole[1] =0.; posAH_Alhole[2] =AH_AlholeZ/2-AH_ShieldStlZ/2;
1186 G4LogicalVolume *AH_AlholeLV=
1187 new G4LogicalVolume(AH_Alhole, G4Material::GetMaterial(
"Aluminum"), G4String(
"LV_AHAlhole"),0,0,0);
1188 new G4PVPlacement((G4RotationMatrix *) 0,posAH_Alhole,AH_AlholeLV,
1189 "PV_AHAlhole",AH_ShieldStlLV,
false, 1,
true);
1192 G4LogicalVolume *AH_AirholeLV=
1193 new G4LogicalVolume(pcone, G4Material::GetMaterial(
"Air"), G4String(
"LV_AHAirhole"),0,0,0);
1194 new G4PVPlacement((G4RotationMatrix *) 0,G4ThreeVector(0,0,0),AH_AirholeLV,
1195 "PV_AHAirhole",AH_AlholeLV,
false, 1,
true);
1199 G4VisAttributes *AHAlhole_Att =
new G4VisAttributes(G4Colour(0.,192.,255.));
1200 AHAlhole_Att->G4VisAttributes::SetForceWireframe(
true);
1201 AH_AlholeLV->SetVisAttributes(AHAlhole_Att);
1206 G4double AH_AlcoreX = 1.52*
CLHEP::m;
1207 G4double AH_AlcoreY = 1.52*
CLHEP::m;
1208 G4double AH_AlcoreZ = 2.46*
CLHEP::m;
1210 G4Box *AH_Alcore=
new G4Box(
"AH_Alcore",AH_AlcoreX/2,AH_AlcoreY/2,AH_AlcoreZ/2);
1213 G4ThreeVector posAH_Alcore; posAH_Alcore[0] =0.;
1214 posAH_Alcore[1] =-0.2*
CLHEP::m; posAH_Alcore[2] =AH_AlcoreZ/2-AH_ShieldStlZ/2+AH_AlholeZ;
1216 G4LogicalVolume *AH_AlcoreLV=
1217 new G4LogicalVolume(AH_Alcore,G4Material::GetMaterial(
"Aluminum"), G4String(
"LV_AHAlcore"),0,0,0);
1218 new G4PVPlacement((G4RotationMatrix *) 0,posAH_Alcore,AH_AlcoreLV,
1219 "PV_AHAlcore",AH_ShieldStlLV,
false, 1,
true);
1222 G4VisAttributes *AHAlcore_Att =
new G4VisAttributes(G4Colour(0.,0.,1.));
1223 AHAlcore_Att->G4VisAttributes::SetForceWireframe(
true);
1224 AH_AlcoreLV->SetVisAttributes(AHAlcore_Att);
1229 G4double AH_SteelX = 1.52*
CLHEP::m;
1230 G4double AH_SteelY = 1.52*
CLHEP::m;
1231 G4double AH_SteelZ = 1.22*
CLHEP::m;
1233 G4Box *AH_Steel=
new G4Box(
"Ah_Steel",AH_SteelX/2,AH_SteelY/2,AH_SteelZ/2);
1235 G4ThreeVector posAH_Steel; posAH_Steel[0] =0.;
1236 posAH_Steel[1] =-0.2*
CLHEP::m; posAH_Steel[2] =AH_SteelZ/2-AH_ShieldStlZ/2+(AH_AlholeZ+AH_AlcoreZ);
1238 G4LogicalVolume *AH_SteelLV=
1239 new G4LogicalVolume(AH_Steel, G4Material::GetMaterial(
"Slab_Stl"), G4String(
"LV_AHSteel"),0,0,0);
1240 new G4PVPlacement((G4RotationMatrix *) 0,posAH_Steel,AH_SteelLV,
1241 "PV_AHSteel",AH_ShieldStlLV,
false, 1,
true);
1244 G4VisAttributes *AHSteel_Att =
new G4VisAttributes(G4Colour(1.,0.,0.));
1245 AHSteel_Att->G4VisAttributes::SetForceWireframe(
true);
1246 AH_SteelLV->SetVisAttributes(AHSteel_Att);
1253 G4Box *detSolid =
new G4Box(
"detSolid",2.5*
CLHEP::m,2.5*
CLHEP::m,1.0*CLHEP::cm);
1255 TrackingPlaneLogical=
new G4LogicalVolume(detSolid , G4Material::GetMaterial(
"Air"),
"detLogical", 0,0,0);
1257 G4ThreeVector posTmp; posTmp[0] =0.; posTmp[1] =-0.45*
CLHEP::m;
1259 std::cerr <<
" Placing test planes in absorber hall" <<
std::endl;
1261 "trackPln1",air_logBox,
false, 1,
true);
1263 G4ThreeVector posTmp2; posTmp2[0] =0.; posTmp2[1] =-0.45*
CLHEP::m;
1264 posTmp2[2] =posTmp[2]+2.7*
CLHEP::m;
1266 "trackPln2",air_logBox,
false, 1,
true);
1279 const double in = 25.4*CLHEP::mm;
1290 G4String(
"LBNEDetectorConstruction::ConstructLBNEShieldingHorn2"));
1291 const G4String nameM = mother->GetLogicalVolume()->GetName();
1294 G4String(
"LBNEDetectorConstruction::ConstructLBNEShieldingHorn1"));
1296 const double horn1HeightAtMCZERO = 66.7*in;
1300 G4String bName = G4String(
"ShieldingHorn1Bottom");
1301 const double bWidth = 208*in;
1302 const double bHeight = 72.0*in;
1304 G4Box *bBox =
new G4Box(bName, bWidth/2., bHeight/2., bLength/2.);
1305 G4LogicalVolume *bLVol =
new G4LogicalVolume(bBox, G4Material::GetMaterial(
std::string(
"Slab_Stl")), bName);
1306 G4ThreeVector posTmp(0., 0., 0.);
1307 posTmp[1] = -horn1HeightAtMCZERO - bHeight/2.;
1310 const double zShift = -1.0*plTop->
fPosition[2];
1317 mother->GetLogicalVolume(),
false, 1,
true);
1321 G4String sName = G4String(
"ShieldingHorn1Side");
1322 const double sWidth = 65.0*in;
1324 const double sHeight = 270.8*in - 72.0*in - 4.0*CLHEP::cm;
1326 G4Box *sBox =
new G4Box(sName, sWidth/2., sHeight/2., sLength/2.);
1327 G4LogicalVolume *sLVol =
new G4LogicalVolume(sBox, G4Material::GetMaterial(
std::string(
"Slab_Stl")), sName);
1328 posTmp[0] = -maxR1 - 15.0*CLHEP::cm - sWidth/2.;
1329 posTmp[1] = sHeight/2. - horn1HeightAtMCZERO + 2.0*CLHEP::cm;
1338 mother->GetLogicalVolume(),
false, 1,
true);
1339 posTmp[0] = maxR1 + 15.0*CLHEP::cm + sWidth/2.;
1345 mother->GetLogicalVolume(),
false, 2,
true);
1349 G4String tName = G4String(
"ShieldingHorn1Top");
1350 const double tWidth = 208*in;
1351 const double tHeight = 94.0*in;
1353 G4Box *tBox =
new G4Box(tName, tWidth/2., tHeight/2., tLength/2.);
1354 G4LogicalVolume *tLVol =
new G4LogicalVolume(tBox, G4Material::GetMaterial(
std::string(
"Slab_Stl")), tName);
1357 posTmp[1] += sHeight/2. + tHeight/2. + 4.0*CLHEP::cm;
1359 mother->GetLogicalVolume(),
false, 1,
true);
1367 const G4String nameM = mother->GetLogicalVolume()->GetName();
1368 if(nameM != G4String(
"Tunnel")){
1370 <<
"Unexpected Mother Volume in LBNEDetectorConstruction::ConstructLBNEHorn1TrackingPlane(G4VPhysicalVolume *mother)"<<
std::endl;
1374 G4String(
"LBNEDetectorConstruction::ConstructLBNEHorn1TrackingPlane"));
1377 G4String(
"LBNEDetectorConstruction::ConstructLBNEHorn1TrackingPlane"));
1380 const double widthTop = 80.00*CLHEP::cm;
1381 const double heightTop = 80.00*CLHEP::cm;
1384 G4Box *topBox =
new G4Box(
"Horn1TrackingPlane", widthTop/2., heightTop/2.,0.5*CLHEP::mm);
1386 G4ThreeVector posTopLevel (0., 0., z);
1390 <<
"Width of Horn1TrackingPlane is:" <<widthTop/2<<
" Height of Horn1TrackingPlane is: "<<heightTop/2<<
std::endl;
1391 G4PVPlacement *vTopLevel =
new G4PVPlacement((G4RotationMatrix *) 0, posTopLevel,
1393 mother->GetLogicalVolume(),
false, 1,
true);
1395 std::cerr <<
" Can't place Horn1 tracking plane.. Unexpected.. " <<
std::endl;
1404 const double in = 25.4*CLHEP::mm;
1413 const G4String nameM = mother->GetLogicalVolume()->GetName();
1416 G4String(
"LBNEDetectorConstruction::ConstructLBNEShieldingHorn2"));
1420 G4String(
"LBNEDetectorConstruction::ConstructLBNEShieldingHorn2"));
1425 const double horn2Height = (37. + 17.3)*in;
1431 G4String bName = G4String(
"ShieldingHorn2Bottom");
1432 const double bWidth = 168*in;
1433 const double bHeight = 52.0*in;
1435 G4Box *bBox =
new G4Box(bName, bWidth/2., bHeight/2., bLength/2.);
1436 G4LogicalVolume *bLVol =
new G4LogicalVolume(bBox, G4Material::GetMaterial(
std::string(
"Slab_Stl")), bName);
1437 G4ThreeVector posTmp(0., 0., 0.);
1438 posTmp[1] = -horn2Height - bHeight/2.;
1443 const double yCorr = 0;
1450 mother->GetLogicalVolume(),
false, 1,
true);
1460 G4String sName = G4String(
"ShieldingHorn2Side");
1461 double sWidth = 52.0*in;
1462 double sHeight = 256.8*in - 52.0*in - 4.0*CLHEP::cm;
1463 double transvShift = plHorn2->
fParams[1] + 1.0*CLHEP::cm;
1472 G4Box *sBox =
new G4Box(sName, sWidth/2., sHeight/2., sLength/2.);
1473 G4LogicalVolume *sLVol =
new G4LogicalVolume(sBox, G4Material::GetMaterial(
std::string(
"Slab_Stl")), sName);
1474 posTmp[0] = -transvShift - sWidth/2.;
1475 posTmp[1] = sHeight/2. - horn2Height + 2.0*CLHEP::cm;
1484 mother->GetLogicalVolume(),
false, 1,
true);
1485 posTmp[0] = transvShift + sWidth/2.;
1491 mother->GetLogicalVolume(),
false, 2,
true);
1495 G4String tName = G4String(
"ShieldingHorn2Top");
1496 const double tWidth = 168*in;
1497 const double tHeight = 94.0*in;
1499 G4Box *tBox =
new G4Box(tName, tWidth/2., tHeight/2., tLength/2.);
1500 G4LogicalVolume *tLVol =
new G4LogicalVolume(tBox, G4Material::GetMaterial(
std::string(
"Slab_Stl")), tName);
1503 posTmp[1] += sHeight/2. + tHeight/2. + 4.0*CLHEP::cm;
1505 mother->GetLogicalVolume(),
false, 1,
true);
1512 const G4String nameM = mother->GetLogicalVolume()->GetName();
1513 std::cerr<<
"Logical Volumes are as follows: "<<nameM<<
std::endl;
1514 if(nameM != G4String(
"Tunnel")){
1516 <<
"Unexpected Mother Volume in LBNEDetectorConstruction::ConstructLBNEHorn2TrackingPlane(G4VPhysicalVolume *mother)"<<
std::endl;
1525 G4String(
"LBNEDetectorConstruction::ConstructLBNEHorn2TrackingPlane"));
1531 if (usedNumberOfHornsPoly > 1) {
1532 std::cerr <<
" .. Using Conceptual Design 2015, fixed position of the HornBtracking place at z = 7500. mm " <<
std::endl;
1533 z = 75000*CLHEP::mm;
1537 G4String(
"LBNEDetectorConstruction::ConstructLBNEHorn2TrackingPlane"));
1540 const double widthTop = 400*CLHEP::cm;
1541 const double heightTop =400*CLHEP::cm;
1543 G4Box *topBox =
new G4Box(
"Horn2TrackingPlane", widthTop/2., heightTop/2.,0.5*CLHEP::mm);
1545 G4ThreeVector posTopLevel (0., 0., z);
1549 <<
"Width of Horn2TrackingPlane is:" <<widthTop/2<<
" Height of Horn2TrackingPlane is: "<<heightTop/2<<
std::endl;
1550 new G4PVPlacement((G4RotationMatrix *) 0, posTopLevel,
1552 mother->GetLogicalVolume(),
false, 1,
true);
1560 const double in = 25.4*CLHEP::mm;
1561 const G4String nameM = mother->GetLogicalVolume()->GetName();
1562 if (nameM != G4String(
"Tunnel")) {
1564 <<
" Unexpected Mother volume in LBNEDetectorConstruction::ConstructLBNEShieldingBetweenHorns !" <<
std::endl;
1569 G4String(
"LBNEDetectorConstruction::ConstructLBNEShieldingBetweenHorns"));
1572 G4String(
"LBNEDetectorConstruction::ConstructLBNEShieldingHorn1"));
1575 G4String(
"LBNEDetectorConstruction::ConstructLBNEShieldingBetweenHorns"));
1576 const double zStart = plH1->
fPosition[2] + plH1->
fParams[2]/2.0 + 5.0*CLHEP::cm;
1577 const double zEnd = plH2->
fPosition[2] - plH2->
fParams[2]/2.0 - 5.0*CLHEP::cm;
1578 const double lengthTop = zEnd - zStart;
1580 const double widthTop = plMother->
fParams[0] - 10.0*CLHEP::cm;
1581 const double heightTop = plMother->
fParams[1] - 10.0*CLHEP::cm;
1582 G4String topNameBetween = G4String(
"Horn1ToHorn2Corridor");
1583 G4Box *topBox =
new G4Box(topNameBetween, widthTop/2., heightTop/2.,lengthTop/2.);
1584 G4LogicalVolume *topLevVol =
new G4LogicalVolume(topBox, G4Material::GetMaterial(G4String(
"Air")), topNameBetween);
1585 G4ThreeVector posTopLevel (0., 0., 0.5*(zStart + zEnd));
1586 G4PVPlacement *vTopLevel =
new G4PVPlacement((G4RotationMatrix *) 0, posTopLevel,
1588 mother->GetLogicalVolume(),
false, 1,
true);
1592 const double beamlineHeight = 0.5*(60.6 + 66.7)*in;
1596 G4String bName = G4String(
"ShieldingHornCorridorBottom");
1597 const double bWidth = 168*in;
1598 const double bHeight = 52.0*in;
1600 G4Box *bBox =
new G4Box(bName, bWidth/2., bHeight/2., bLength/2.);
1601 G4LogicalVolume *bLVol =
new G4LogicalVolume(bBox, G4Material::GetMaterial(
std::string(
"Slab_Stl")), bName);
1602 G4ThreeVector posTmp(0., 0., 0.);
1603 posTmp[1] = -beamlineHeight - bHeight/2.;
1608 vTopLevel->GetLogicalVolume(),
false, 1,
true);
1612 G4String sName = G4String(
"ShieldingHornCorridorSide");
1613 const double sWidth = 52.0*in;
1614 const double sHeight = 256.8*in - 52.0*in - 5.0*CLHEP::cm ;
1616 G4Box *sBox =
new G4Box(sName, sWidth/2., sHeight/2., sLength/2.);
1617 G4LogicalVolume *sLVol =
new G4LogicalVolume(sBox, G4Material::GetMaterial(
std::string(
"Slab_Stl")), sName);
1618 posTmp[0] = (-32.0 - 26.0)*in;
1619 posTmp[1] = sHeight/2. - beamlineHeight + 2.0*CLHEP::cm;
1623 vTopLevel->GetLogicalVolume(),
false, 1,
true);
1624 posTmp[0] = (+32.0 + 26.0)*in;
1626 vTopLevel->GetLogicalVolume(),
false, 2,
true);
1630 G4String tName = G4String(
"ShieldingHornCorridorTop");
1631 const double tWidth = 168*in;
1632 const double tHeight = 94.0*in;
1634 G4Box *tBox =
new G4Box(tName, tWidth/2., tHeight/2., tLength/2.);
1635 G4LogicalVolume *tLVol =
new G4LogicalVolume(tBox, G4Material::GetMaterial(
std::string(
"Slab_Stl")), tName);
1638 posTmp[1] += sHeight/2. + tHeight/2. + 4.0*CLHEP::cm;
1640 vTopLevel->GetLogicalVolume(),
false, 1,
true);
1646 const G4String nameM = mother->GetLogicalVolume()->GetName();
1647 if (nameM != G4String(
"Tunnel")) {
1649 <<
" Unexpected Mother volume in LBNEDetectorConstruction::ConstructLBNEShieldingBetweenHorns !" <<
std::endl;
1654 G4String(
"LBNEDetectorConstruction::ConstructLBNFShielding"));
1657 G4String(
"LBNEDetectorConstruction::ConstructLBNFShielding"));
1658 const double zStart = plH1->
fPosition[2] + plH1->
fParams[2]/2.0 + 5.0*CLHEP::cm;
1660 const double lengthAll = zEnd - zStart;
1663 const double widthTopBot = plMother->
fParams[0] - 2.0*CLHEP::cm;
1664 const double heightSide = (plMother->
fParams[1] - 1.0*CLHEP::cm - 2.0*heightTopBot);
1665 std::cerr <<
" Shielding parameters, width " << widthSide <<
" htB " << heightTopBot
1666 <<
" widthTopBot " << widthTopBot <<
" heightSide " << heightSide <<
std::endl;
1668 G4String botName = G4String(
"LBNFChaseShieldBottom");
1669 G4Box *botBox =
new G4Box(botName, widthTopBot/2., heightTopBot/2., lengthAll/2.);
1670 G4LogicalVolume *botLevVol =
new G4LogicalVolume(botBox, G4Material::GetMaterial(G4String(
"Slab_Stl")), botName);
1671 const double botY = -1.0*(plMother->
fParams[1]/2. - heightTopBot/2. - 0.5*CLHEP::cm);
1672 G4ThreeVector botPosV (0., botY, 0.5*(zStart + zEnd));
1673 new G4PVPlacement((G4RotationMatrix *) 0, botPosV, botLevVol , botName +
std::string(
"_P"),
1674 mother->GetLogicalVolume(),
false, 1,
true);
1675 G4String topName = G4String(
"LBNFChaseShieldTop");
1676 G4Box *topBox =
new G4Box(topName, widthTopBot/2., heightTopBot/2., lengthAll/2.);
1677 G4LogicalVolume *topLevVol =
new G4LogicalVolume(topBox, G4Material::GetMaterial(G4String(
"Slab_Stl")), topName);
1678 const double topY = -botY;
1679 G4ThreeVector topPosV (0., topY, 0.5*(zStart + zEnd));
1680 new G4PVPlacement((G4RotationMatrix *) 0, topPosV, topLevVol , topName +
std::string(
"_P"),
1681 mother->GetLogicalVolume(),
false, 1,
true);
1685 G4String sideName = G4String(
"LBNFChaseShieldSide");
1686 G4Box *sideBox =
new G4Box(sideName, widthSide/2., heightSide/2., lengthAll/2.);
1687 G4LogicalVolume *sideVol =
new G4LogicalVolume(sideBox, G4Material::GetMaterial(G4String(
"Slab_Stl")), sideName);
1688 const double sideX = -1.0 *(plMother->
fParams[0]/2. - widthSide/2. -0.5*CLHEP::cm);
1689 G4ThreeVector sidePosV (-sideX, 0., 0.5*(zStart + zEnd));
1690 new G4PVPlacement((G4RotationMatrix *) 0, sidePosV, sideVol , sideName +
std::string(
"_PxN"),
1691 mother->GetLogicalVolume(),
false, 1,
true);
1692 G4ThreeVector sidePosV2 (sideX, 0., 0.5*(zStart + zEnd));
1693 new G4PVPlacement((G4RotationMatrix *) 0, sidePosV2, sideVol , sideName +
std::string(
"_PxP"),
1694 mother->GetLogicalVolume(),
false, 2,
true);
1698 const G4String nameM = mother->GetLogicalVolume()->GetName();
1699 if(nameM != G4String(
"Tunnel")){
1701 <<
"Unexpected Mother Volume in LBNEDetectorConstruction::ConstructLBNEDecayPipeTrackingPlane(G4VPhysicalVolume *mother)"<<
std::endl;
1705 G4String(
"LBNEDetectorConstruction::ConstructLBNEDecayPipeTrackingPlane"));
1708 G4String(
"LBNEDetectorConstruction::ConstructLBNEDecayPipeTrackingPlane"));
1711 const double widthTop = 250.00*CLHEP::cm;
1712 const double heightTop = 250.00*CLHEP::cm;
1715 G4Box *topBox =
new G4Box(
"DPTrackingPlane", widthTop/2., heightTop/2.,0.5*CLHEP::mm);
1717 G4ThreeVector posTopLevel (0., 0., z);
1721 <<
" Half Width of DecayPipeTrackingPlane is (mm):" <<widthTop/2<<
"Half Height of DecayPipeTrackingPlane is (mm): "<<heightTop/2<<
std::endl;
1722 new G4PVPlacement((G4RotationMatrix *) 0, posTopLevel,
1724 mother->GetLogicalVolume(),
false, 1,
true);
1732 G4cout <<
"Importing mars target/horn gdml file... " << G4endl;
1735 std::ifstream gdmlfile(
filename.c_str());
1736 if (!gdmlfile.is_open()) {
1738 mess +=
filename + G4String(
" could not be found \n");
1739 G4Exception(
"LBNEDetectorConstruction::DropMarsTargetHorns",
" ",
1740 FatalErrorInArgument, mess.c_str());
1749 G4LogicalVolume *topMars = parser.GetVolume(
"Marstop" );
1753 for (
int i=0;
i != topMars->GetNoDaughters(); ++
i) {
1754 G4VPhysicalVolume *pVol = topMars->GetDaughter(
i);
1755 G4LogicalVolume *lVol = pVol->GetLogicalVolume();
1756 std::cerr <<
" Top level daughter # " <<
i <<
" Name " << lVol->GetName()
1757 <<
" at " << pVol->GetObjectTranslation() <<
std::endl;
1758 if (lVol->GetName().find(
"Airbox") != std::string::npos) {
1759 G4Box *aBox =
static_cast<G4Box*
>(lVol->GetSolid());
1760 std::cerr <<
" Airbox size " << aBox->GetXHalfLength()
1761 <<
" / " << aBox->GetYHalfLength() <<
" / " << aBox->GetZHalfLength() <<
std::endl;
1763 for (
int ii=0; ii != lVol->GetNoDaughters(); ++ii) {
1764 G4VPhysicalVolume *pVol2 = lVol->GetDaughter(ii);
1765 G4LogicalVolume *lVol2 = pVol2->GetLogicalVolume();
1766 std::cerr <<
" .. 2nd level daughter # " << ii <<
" Name " << lVol2->GetName()
1767 <<
" at " << pVol2->GetObjectTranslation() <<
std::endl;
1768 if (lVol2->GetName().find(
"Airbox") != std::string::npos) {
1769 G4Box *aBox =
static_cast<G4Box*
>(lVol2->GetSolid());
1770 std::cerr <<
" Airbox size " << aBox->GetXHalfLength()
1771 <<
" / " << aBox->GetYHalfLength() <<
" / " << aBox->GetZHalfLength() <<
std::endl;
1773 for (
int iii=0; iii != lVol2->GetNoDaughters(); ++iii) {
1774 G4VPhysicalVolume *pVol3 = lVol2->GetDaughter(iii);
1775 G4LogicalVolume *lVol3 = pVol3->GetLogicalVolume();
1776 std::cerr <<
" ... 3rd level daughter # " << iii <<
" Name " << lVol3->GetName()
1777 <<
" at " << pVol3->GetObjectTranslation() <<
std::endl;
1778 for (
int i4=0; i4 != lVol3->GetNoDaughters(); ++i4) {
1779 G4VPhysicalVolume *pVol4 = lVol3->GetDaughter(i4);
1780 G4LogicalVolume *lVol4 = pVol4->GetLogicalVolume();
1781 std::cerr <<
" .... 4rth level daughter # " << i4 <<
" Name " << lVol4->GetName()
1782 <<
" at " << pVol4->GetObjectTranslation() <<
std::endl;
1783 for (
int i5=0; i5 != lVol4->GetNoDaughters(); ++i5) {
1784 G4VPhysicalVolume *pVol5 = lVol4->GetDaughter(i5);
1785 G4LogicalVolume *lVol5 = pVol5->GetLogicalVolume();
1786 std::cerr <<
" ..... 5rth level daughter # " << i5 <<
" Name " << lVol5->GetName()
1787 <<
" at " << pVol5->GetObjectTranslation() <<
std::endl;
1788 for (
int i6=0; i6 != lVol5->GetNoDaughters(); ++i6) {
1789 G4VPhysicalVolume *pVol6 = lVol5->GetDaughter(i6);
1790 G4LogicalVolume *lVol6 = pVol6->GetLogicalVolume();
1791 std::cerr <<
" ...... 6rth level daughter # " << i6 <<
" Name " << lVol6->GetName() <<
std::endl;
1799 G4LogicalVolume *marsHorn1 = parser.GetVolume(
"horn1" );
1801 const G4Box *horn1Sol =
static_cast<const G4Box *
>(marsHorn1->GetSolid());
1805 std::cerr <<
" Dimension of horn1 level MARS container, X " << horn1Sol->GetXHalfLength() <<
1806 " Y " << horn1Sol->GetYHalfLength() <<
" Z " << horn1Sol->GetZHalfLength() <<
std::endl;
1807 std::cerr <<
" Number of daughters for HORN1 " << marsHorn1->GetNoDaughters() <<
std::endl;
1808 double maxHalfHeight = -1.0;
1809 double maxHalfWidth = -1.0;
1810 double maxHalfLength = -1.0;
1811 for (
int i=0;
i != marsHorn1->GetNoDaughters(); ++
i) {
1812 G4VPhysicalVolume *pVol = marsHorn1->GetDaughter(
i);
1813 G4LogicalVolume *lVol = pVol->GetLogicalVolume();
1814 std::cerr <<
" Daughther " << lVol->GetName();
1815 const G4Tubs *aTube =
static_cast<const G4Tubs *
>(lVol->GetSolid());
1817 G4ThreeVector
loc = pVol->GetObjectTranslation();
1818 std::cerr <<
" at MARS coordinates " << loc[0] <<
", " <<loc[1] <<
", " << loc[2] <<
1819 " zLength " << 2.0*aTube->GetZHalfLength() <<
std::endl;
1821 if ((
std::abs(loc[2]) + aTube->GetZHalfLength()) > maxHalfLength)
1822 maxHalfLength =
std::abs(loc[2]) + aTube->GetZHalfLength();
1823 if ((
std::abs(loc[1]) + aTube->GetOuterRadius()) > maxHalfWidth)
1824 maxHalfWidth =
std::abs(loc[1]) + aTube->GetOuterRadius();
1825 if ((
std::abs(loc[0]) + aTube->GetOuterRadius()) > maxHalfHeight)
1826 maxHalfHeight =
std::abs(loc[0]) + aTube->GetOuterRadius();
1829 maxHalfHeight += 5.0*CLHEP::cm;
1830 maxHalfWidth += 5.0*CLHEP::cm;
1832 std::cerr <<
" Container volume for MARS, 1/2 width " 1833 << maxHalfWidth <<
" 1/2 Height " << maxHalfHeight
1834 <<
" 1/2 length " << maxHalfLength <<
std::endl;
1838 G4Box *aMarsBoxHorn1 =
new G4Box(G4String(
"MarsHorn1"), maxHalfWidth, maxHalfHeight, maxHalfLength);
1839 G4LogicalVolume *aMarsHorn1L =
1840 new G4LogicalVolume(aMarsBoxHorn1, G4Material::GetMaterial(
"Air"), G4String(
"MarsHorn1"));
1843 G4String(
"LBNEDetectorConstruction::DropMarsTargetHorns"));
1849 std::cerr <<
" Position in tunnel (center) " << plTunnel->
fPosition[2]
1855 const double yyy = 0.;
1856 G4ThreeVector posHorn1Mars(0., yyy, zzz);
1858 new G4PVPlacement(0, posHorn1Mars, aMarsHorn1L,
"MarsHorn1",
1859 tunnel->GetLogicalVolume(),
false, 1,
true);
1861 G4RotationMatrix *marsRot =
new G4RotationMatrix;
1862 marsRot->rotateZ(-M_PI/2.);
1863 for (
int i=0;
i != marsHorn1->GetNoDaughters(); ++
i) {
1864 G4VPhysicalVolume *pVol = marsHorn1->GetDaughter(
i);
1865 G4LogicalVolume *lVol = pVol->GetLogicalVolume();
1866 const G4Tubs *aBox =
static_cast<const G4Tubs *
>(lVol->GetSolid());
1867 G4ThreeVector
loc = pVol->GetObjectTranslation();
1869 double yyyI = loc[0] ;
1870 const double xxx = loc[1];
1874 double zzzI = loc[2];
1875 if (lVol->GetName().find(
"AH_horn1") != std::string::npos) {
1876 yyyI += 0.1*CLHEP::mm;
1880 G4ThreeVector posTmp(xxx, yyyI, zzzI);
1881 std::cerr <<
" Placing volume " << lVol->GetName() <<
" at " << posTmp <<
" 1/2 length (G4 coord) " 1889 new G4PVPlacement(marsRot, posTmp, lVol, lVol->GetName() +
std::string(
"_P"), aMarsHorn1L,
false, 1,
true);
1899 G4LogicalVolume *marsHorn2 = parser.GetVolume(
"horn2" );
1901 const G4Box *horn2Sol =
static_cast<const G4Box *
>(marsHorn2->GetSolid());
1905 std::cerr <<
" Dimension of horn2 level MARS container, X " << horn2Sol->GetXHalfLength() <<
1906 " Y " << horn2Sol->GetYHalfLength() <<
" Z " << horn2Sol->GetZHalfLength() <<
std::endl;
1907 std::cerr <<
" Number of daughters for HORN2 " << marsHorn2->GetNoDaughters() <<
std::endl;
1908 maxHalfHeight = -1.0;
1909 maxHalfWidth = -1.0;
1910 maxHalfLength = -1.0;
1911 for (
int i=0;
i != marsHorn2->GetNoDaughters(); ++
i) {
1912 G4VPhysicalVolume *pVol = marsHorn2->GetDaughter(
i);
1913 G4LogicalVolume *lVol = pVol->GetLogicalVolume();
1914 std::cerr <<
" Daughther " << lVol->GetName();
1915 const G4Tubs *aTube =
static_cast<const G4Tubs *
>(lVol->GetSolid());
1917 G4ThreeVector
loc = pVol->GetObjectTranslation();
1918 std::cerr <<
" at MARS coordinates " << loc[0] <<
", " <<loc[1] <<
", " << loc[2] <<
1919 " zLength " << 2.0*aTube->GetZHalfLength() <<
std::endl;
1921 if ((
std::abs(loc[2]) + aTube->GetZHalfLength()) > maxHalfLength)
1922 maxHalfLength =
std::abs(loc[2]) + aTube->GetZHalfLength();
1923 if ((
std::abs(loc[1]) + aTube->GetOuterRadius()) > maxHalfWidth)
1924 maxHalfWidth =
std::abs(loc[1]) + aTube->GetOuterRadius();
1925 if ((
std::abs(loc[0]) + aTube->GetOuterRadius()) > maxHalfHeight)
1926 maxHalfHeight =
std::abs(loc[0]) + aTube->GetOuterRadius();
1929 maxHalfHeight += 5.0*CLHEP::cm;
1930 maxHalfWidth += 5.0*CLHEP::cm;
1932 std::cerr <<
" Container volume for MARS, 1/2 width " 1933 << maxHalfWidth <<
" 1/2 Height " << maxHalfHeight
1934 <<
" 1/2 length " << maxHalfLength <<
std::endl;
1938 G4Box *aMarsBoxHorn2 =
new G4Box(G4String(
"MarsHorn2"), maxHalfWidth, maxHalfHeight, maxHalfLength);
1939 G4LogicalVolume *aMarsHorn2L =
1940 new G4LogicalVolume(aMarsBoxHorn2, G4Material::GetMaterial(
"Air"), G4String(
"MarsHorn2"));
1943 G4String(
"LBNEDetectorConstruction::DropMarsTargetHorns"));
1949 std::cerr <<
" Position in tunnel (center) " << plTunnel2->
fPosition[2]
1954 const double yyy2 = 0;
1955 G4ThreeVector posHorn2Mars(0., yyy2, zzz);
1957 new G4PVPlacement(0, posHorn2Mars, aMarsHorn2L,
"MarsHorn2",
1958 tunnel->GetLogicalVolume(),
false, 1,
true);
1960 G4RotationMatrix *marsRot2 =
new G4RotationMatrix;
1961 marsRot2->rotateZ(-M_PI/2.);
1962 for (
int i=0;
i != marsHorn2->GetNoDaughters(); ++
i) {
1963 G4VPhysicalVolume *pVol = marsHorn2->GetDaughter(
i);
1964 G4LogicalVolume *lVol = pVol->GetLogicalVolume();
1965 const G4Tubs *aBox =
static_cast<const G4Tubs *
>(lVol->GetSolid());
1966 G4ThreeVector
loc = pVol->GetObjectTranslation();
1968 double yyy3 = loc[0] ;
1969 const double xxx = loc[1];
1973 double zzz3 = loc[2];
1974 if (lVol->GetName().find(
"AH_horn2") != std::string::npos) {
1975 yyy3 += 0.1*CLHEP::mm;
1979 G4ThreeVector posTmp(xxx, yyy3, zzz3);
1980 std::cerr <<
" Placing volume " << lVol->GetName() <<
" at " << posTmp <<
" 1/2 length (G4 coord) " 1988 new G4PVPlacement(marsRot2, posTmp, lVol, lVol->GetName() +
std::string(
"_P"), aMarsHorn2L,
false, 1,
true);
2031 LBNEDir =
new G4UIdirectory(
"/LBNE/");
2032 LBNEDir->SetGuidance(
"UI commands for detector geometry");
2034 detDir =
new G4UIdirectory(
"/LBNE/det/");
2035 detDir->SetGuidance(
"detector control");
2038 ConstructTarget =
new G4UIcmdWithABool(
"/LBNE/det/constructTarget",
this);
2045 G4UIcmdWithADoubleAndUnit(
"/LBNE/det/setBeamlineAngle",
this);
2049 UpdateCmd =
new G4UIcmdWithoutParameter(
"/LBNE/det/update",
this);
2050 UpdateCmd->SetGuidance(
"Update or Construct LBNE geometry. Same difference ");
2051 UpdateCmd->SetGuidance(
"This command MUST be applied before \"beamOn\" ");
2052 UpdateCmd->SetGuidance(
"if you changed geometrical value(s).");
2053 UpdateCmd->AvailableForStates(G4State_PreInit);
2055 ConstructCmd =
new G4UIcmdWithoutParameter(
"/LBNE/det/construct",
this);
2056 ConstructCmd->SetGuidance(
"Construct LBNE geometry. Should be one and only time ");
2057 ConstructCmd->SetGuidance(
"This command MUST be applied before \"beamOn\" ");
2058 ConstructCmd->SetGuidance(
"if you changed geometrical value(s).");
2064 ConstructSimpAbsorber->SetGuidance(
"Set geometry of Hadron Absorber. If true simulate simple version of absorber");
2074 DisableSpoiler =
new G4UIcmdWithABool(
"/LBNE/det/DisableSpoiler",
this);
2076 DisableSpoiler->SetGuidance(
"If true simulate the 2015 Sculpted absorber without the spoiler");
2078 DisableSpoiler->AvailableForStates(G4State_PreInit,G4State_Idle);
2082 DisableSculptedLayers->SetGuidance(
"If true simulate the 2015 Sculpted absorber without the sculpting on the aluminum layers");
2086 DisableMask =
new G4UIcmdWithABool(
"/LBNE/det/DisableMask",
this);
2087 DisableMask->SetParameterName(
"Remove sculpting",
true);
2088 DisableMask->SetGuidance(
"If true simulate the 2015 Sculpted absorber without the mask layers between the spoiler and core part of the absorber");
2090 DisableMask->AvailableForStates(G4State_PreInit,G4State_Idle);
2092 ExpandAlLayers =
new G4UIcmdWithABool(
"/LBNE/det/ExpandAlLayers",
this);
2093 ExpandAlLayers->SetParameterName(
"Expand Sculpted Absorber Al layers to 2.8x2.8 m",
true);
2094 ExpandAlLayers->SetGuidance(
"If true simulate the 2015 Sculpted absorber with a core region to the size of the decay pipe");
2096 ExpandAlLayers->AvailableForStates(G4State_PreInit,G4State_Idle);
2098 RemoveLayers =
new G4UIcmdWithAnInteger(
"/LBNE/det/RemoveLayers",
this);
2099 RemoveLayers->SetParameterName(
"Number of layers to remove from the downstream end of the absorber",
true);
2100 RemoveLayers->SetGuidance(
"Simulate the 2015 Sculpted absorber with fewer layers");
2102 RemoveLayers->AvailableForStates(G4State_PreInit,G4State_Idle);
2104 DwStrAbsSteelWidth =
new G4UIcmdWithADoubleAndUnit(
"/LBNE/det/DwStrAbsSteelWidth",
this);
2106 DwStrAbsSteelWidth->SetGuidance(
"Define the downstream width (m) of the steel volume in the simple geometry of absorber. Default value is ...");
2113 DwStrAbsConcreteWidth->SetGuidance(
"Define the downstream width (m) of the concrete volume in the simple geometry of absorber. Default value is ...");
2118 new G4UnitDefinition(
"kiloampere" ,
"kA",
"Electric current", 1000.*CLHEP::ampere);
2120 G4UIcmdWithADoubleAndUnit(
"/LBNE/det/seHornCurrent",
this);
2122 SetHornCurrent->SetGuidance(
" The current for the horn system. (Horn1 and Horn2 are in series.");
2129 std::string aGuidance(
"The skin depth for the inner conductor. \n ");
2130 aGuidance +=
std::string(
" The default assumes infinite. Using Zarko' thesis model, \n");
2131 aGuidance +=
std::string(
" MINOS Document 5694-v1, section 5.2.4, p150 - 156 \n");
2138 for (
size_t kH=0; kH != 3; kH++) {
2139 std::ostringstream aNStrStr; aNStrStr <<
"/LBNE/det/SetHorn" << (kH+1) <<
"DeltaEccentricityIO";
2141 G4UIcmdWithADoubleAndUnit* aGUICmd =
new G4UIcmdWithADoubleAndUnit(aNStr.c_str(),
this);
2142 std::ostringstream aNGStrStr; aNGStrStr
2143 <<
"The Eccentricity between Inner/Outer conductors for Horn number " << (kH+1) <<
"\n.";
2145 aGUICmd->SetGuidance(aNGStr.c_str());
2146 aGUICmd->SetParameterName(
"SetHornxDeltaEccentricityIO",
true);
2147 aGUICmd->SetDefaultValue (0.);
2148 aGUICmd->AvailableForStates(G4State_PreInit);
2155 for (
size_t kH=0; kH != 3; kH++) {
2156 std::ostringstream aNStrStr; aNStrStr <<
"/LBNE/det/SetHorn" << (kH+1) <<
"DeltaEllipticityI";
2158 G4UIcmdWithADoubleAndUnit* aGUICmd =
new G4UIcmdWithADoubleAndUnit(aNStr.c_str(),
this);
2159 std::ostringstream aNGStrStr; aNGStrStr
2160 <<
"The Ellipticity of the Inner conductor for Horn number " << (kH+1) <<
"\n.";
2162 aGUICmd->SetGuidance(aNGStr.c_str());
2163 aGUICmd->SetParameterName(
"SetHornxDeltaEllipticityI",
true);
2164 aGUICmd->SetDefaultValue (0.);
2165 aGUICmd->AvailableForStates(G4State_PreInit);
2170 for (
size_t kH=0; kH != 3; kH++) {
2171 std::ostringstream aNStrStr;
2172 aNStrStr <<
"/LBNE/det/SetHorn" << (kH+1) <<
"CurrentMultipiler";
2174 G4UIcmdWithADouble* aGUICmd =
new G4UIcmdWithADouble(aNStr.c_str(),
this);
2175 std::ostringstream aNGStrStr; aNGStrStr
2176 <<
"A magic current amplifier to increase/decrease the current for Horn number " << (kH+1) <<
"\n.";
2178 aGUICmd->SetGuidance(aNGStr.c_str());
2179 aGUICmd->SetParameterName(
"SetHornxCurrentMultiplier",
true);
2180 aGUICmd->SetDefaultValue (1.);
2181 aGUICmd->AvailableForStates(G4State_PreInit);
2186 for (
size_t kH=0; kH != 3; kH++) {
2187 std::ostringstream aNStrStr;
2188 aNStrStr <<
"/LBNE/det/SetHorn" << (kH+1) <<
"CurrentEqualizerLongAbsLength";
2190 G4UIcmdWithADoubleAndUnit* aGUICmd =
new G4UIcmdWithADoubleAndUnit(aNStr.c_str(),
this);
2191 std::ostringstream aNGStrStr; aNGStrStr
2192 <<
"The charact. length of the decrease of the azimuthal anisotropy \n " 2193 <<
" due imperfect current equal. section for Horn number " << (kH+1) <<
"\n.";
2195 aGUICmd->SetGuidance(aNGStr.c_str());
2196 aGUICmd->SetParameterName(
"SetHornxCurrentEqualizerLongAbsLength",
true);
2197 aGUICmd->SetDefaultValue (100.);
2198 aGUICmd->AvailableForStates(G4State_PreInit);
2203 for (
size_t kH=0; kH != 3; kH++) {
2204 std::ostringstream aNStrStr;
2205 aNStrStr <<
"/LBNE/det/SetHorn" << (kH+1) <<
"CurrentEqualizerQuadAmpl";
2207 G4UIcmdWithADouble* aGUICmd =
new G4UIcmdWithADouble(aNStr.c_str(),
this);
2208 std::ostringstream aNGStrStr; aNGStrStr
2209 <<
"The amplitude of the azimuthal, quadrupolar, anisotropy \n " 2210 <<
" due imperfect current equal. section for Horn number " << (kH+1) <<
"\n.";
2212 aGUICmd->SetGuidance(aNGStr.c_str());
2213 aGUICmd->SetParameterName(
"SetHornxCurrentEqualizerQuadAmpl",
true);
2214 aGUICmd->SetDefaultValue (0.);
2215 aGUICmd->AvailableForStates(G4State_PreInit);
2220 for (
size_t kH=0; kH != 3; kH++) {
2221 std::ostringstream aNStrStr;
2222 aNStrStr <<
"/LBNE/det/SetHorn" << (kH+1) <<
"CurrentEqualizerOctAmpl";
2224 G4UIcmdWithADouble* aGUICmd =
new G4UIcmdWithADouble(aNStr.c_str(),
this);
2225 std::ostringstream aNGStrStr; aNGStrStr
2226 <<
"The amplitude of the azimuthal, quadrupolar, anisotropy \n " 2227 <<
" due imperfect current equal. section for Horn number " << (kH+1) <<
"\n.";
2229 aGUICmd->SetGuidance(aNGStr.c_str());
2230 aGUICmd->SetParameterName(
"SetHornxCurrentEqualizerOctAmpl",
true);
2231 aGUICmd->SetDefaultValue (0.);
2232 aGUICmd->AvailableForStates(G4State_PreInit);
2237 for (
size_t kH=0; kH != 3; kH++) {
2238 std::ostringstream aNStrStr;
2239 aNStrStr <<
"/LBNE/det/SetHorn" << (kH+1) <<
"CurrentEqualizerMapFileName";
2241 G4UIcmdWithAString* aGUICmd =
new G4UIcmdWithAString(aNStr.c_str(),
this);
2242 std::ostringstream aNGStrStr; aNGStrStr
2243 <<
"The file name for the field map created from a priot run, \n " 2244 <<
" related to imperfect current equal. section for Horn number " << (kH+1) <<
"\n.";
2246 aGUICmd->SetGuidance(aNGStr.c_str());
2247 aGUICmd->SetParameterName(
"SetHornxCurrentEqualizerFileName",
true);
2248 aGUICmd->SetDefaultValue(
"?");
2249 aGUICmd->AvailableForStates(G4State_PreInit);
2255 std::string aGuidance(
"The Z-location at which the perfect focusing process set the track polar angle to zero \n ");
2256 aGuidance +=
std::string(
" If this Z is > 0. , we trigger the instantaneous foucing at this Z \n");
2257 aGuidance +=
std::string(
" else, Z < 0., we trigger the instantaneous foucing at the radius of Target Canister \n");
2258 aGuidance +=
std::string(
" which, for the LBNE 1.2 MW option is 17.6 mm \n");
2292 for (
size_t kH=0; kH != 3; kH++) {
2353 G4UIcmdWithADoubleAndUnit* cmdSteelDwStr =
dynamic_cast<G4UIcmdWithADoubleAndUnit*
> (
command);
2361 G4UIcmdWithADoubleAndUnit* cmdConcreteDwStr =
dynamic_cast<G4UIcmdWithADoubleAndUnit*
> (
command);
2377 G4UIcmdWithADoubleAndUnit* cmdWD =
dynamic_cast<G4UIcmdWithADoubleAndUnit*
> (
command);
2381 G4UIcmdWithADoubleAndUnit* cmdWD =
dynamic_cast<G4UIcmdWithADoubleAndUnit*
> (
command);
2384 for (
size_t kH=0; kH != 3; kH++) {
2386 G4UIcmdWithADoubleAndUnit* cmdWD =
dynamic_cast<G4UIcmdWithADoubleAndUnit*
> (
command);
2390 G4UIcmdWithADoubleAndUnit* cmdWD =
dynamic_cast<G4UIcmdWithADoubleAndUnit*
> (
command);
2394 G4UIcmdWithADoubleAndUnit* cmdWD =
dynamic_cast<G4UIcmdWithADoubleAndUnit*
> (
command);
2398 G4UIcmdWithADouble* cmdWD =
dynamic_cast<G4UIcmdWithADouble*
> (
command);
2405 G4UIcmdWithADouble* cmdWD =
dynamic_cast<G4UIcmdWithADouble*
> (
command);
2409 G4UIcmdWithADouble* cmdWD =
dynamic_cast<G4UIcmdWithADouble*
> (
command);
2414 G4UIcmdWithADoubleAndUnit* cmdWD =
dynamic_cast<G4UIcmdWithADoubleAndUnit*
> (
command);
2415 double val = cmdWD->GetNewDoubleValue(newValue);
2418 std::cout <<
" You have chosen a near perfect focus exiting the target Helium containment vessel " <<
std::endl;
2419 std::cout <<
" This only make sens if the real horn current is vanishlingly small.. " <<
std::endl;
2421 std::cout <<
" ...Done.. Also, Horn's conductors are made of air " <<
std::endl;
2423 G4String matAir(
"Air");
2428 }
else if (val > 22499.*CLHEP::mm) {
2429 std::cout <<
" You have chosen a near perfect focus entering the decay channel at Z = " << val <<
std::endl;
double GetCurrentMilindWire() const
void SetRemoveLayers(G4int anInt)
void SetCurrentEqualizerLongAbsLength(double v)
void PlaceFinalLBNFConceptStripLinesConnectHornB()
void PlaceFinalLBNFConceptTgtSupport()
void SetDeltaEccentricityIO(G4double f)
double GetChaseWidthForLBNF() const
G4UImessenger * fDetectorMessenger
bool fInstallLBNFNanoUpstreamMicroStrip
bool GetUseTargetModule() const
double GetTargetDensity() const
G4UIcmdWithADoubleAndUnit * SetHornCurrent
double GetDwStrAbsSteelWidth() const
void SetSkinDepthInnerRad(G4double f)
void SetWireCurrent(G4double iC)
bool fInstallLBNFNanoMagnetUpstr
G4Material * graphiteBaffle
void SetConstructSimpAbsorber(G4bool aBool)
bool fInstallLBNFNanoDownstreamMicroStrip
double fZCoordForPerfectFocusing
LBNEDetectorConstruction * LBNEDetector
bool fConstructSculptedAbsorber
void SetEffectiveLength(double z)
const LBNEVolumePlacementData * Find(const G4String &name, const char *motherName, const char *method) const
G4UIcmdWithABool * ConstructTarget
bool GetUseLBNFOptimConceptDesignHornB() const
bool fDisableSculptedLayers
void ConstructLBNEShieldingHorn2(G4PVPlacement *vPhys)
std::vector< G4UIcmdWithAString * > SetFileNameFieldMapForCE
std::vector< double > fCurrentEqualizerLongAbsLength
void SetSkinDepthInnerRad(G4double f)
double GetPlugZPosition() const
double GetDecayPipeLongPosition() const
G4LogicalVolume * fCurrent
static LBNEVolumePlacements * Instance()
void SetTargetHorn1HallPhysPtr(G4VPhysicalVolume *p)
void SetCurrentEqualizerOctAmpl(size_t kH, double v)
G4VPhysicalVolume * fRock
void SetCurrentEqualizerQuadAmpl(size_t kH, double v)
G4String GetMarsTargetHornsGDMLFilename() const
LBNEDetectorMessenger(LBNEDetectorConstruction *)
void PlaceFinalLBNFConceptStripLinesConnectHornC()
void ConstructLBNEShieldingBetweenHorns(G4VPhysicalVolume *tunnel)
std::vector< G4UIcmdWithADoubleAndUnit * > SetHornsDeltaEccentricityIO
bool GetUseLBNFOptimConceptDesignHornC() const
void ConstructLBNEHadronAbsorberSimple(G4VPhysicalVolume *vPhys)
void DropMarsTargetHorns(G4VPhysicalVolume *mother)
void SetExpandAlLayers(G4bool aBool)
bool fInstallLBNFNanoCerenkov
LBNEDetectorConstruction()
G4UIcmdWithoutParameter * ConstructCmd
void UpdateParamsForHornMotherPolyNum(size_t iH)
bool GetUseHorn1Polycone() const
std::vector< G4UIcmdWithADouble * > SetHornsCurrentEqualizerOctAmpl
G4UIcmdWithADoubleAndUnit * SetSkinDepthInnerRad
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
void SetNewValue(G4UIcommand *, G4String)
void PlaceFinalNoSplitHorn1(G4PVPlacement *mother, G4PVPlacement *motherTop)
void ConstructLBNEHadronAbsorberSculpted(G4VPhysicalVolume *vPhys)
G4UIcmdWithADoubleAndUnit * ZCoordForPerfectFocusing
std::vector< G4UIcmdWithADoubleAndUnit * > SetHornsDeltaEllipticityI
bool fConstructSimpAbsorber
G4String GetAbsorberGDMLFilename() const
std::vector< G4UIcmdWithADouble * > SetHornsCurrentMultiplier
void SetDeltaEccentricityIO(size_t kH, G4double val)
double GetDwStrAbsConcreteWidth() const
void SetTarget2SpecificLambda(double l)
void ConstructLBNEShieldingHorn1(G4VPhysicalVolume *vPhys)
bool GetUseLBNFOptimConceptDesignHornA() const
void ConstructLBNEHadronAbsorber(G4VPhysicalVolume *vPhys)
bool GetInstallBaffle() const
G4UIcmdWithADoubleAndUnit * SetBeamlineAngle
bool GetUseSimpleTargetBox() const
void SetHornCurrent(G4double val)
void SetTargetSpecificLambda(double l)
void SetFileNameFieldMapForCE(std::string s)
std::vector< double > fDeltaEccentricityIO
void ConstructLBNEHorn2TrackingPlane(G4VPhysicalVolume *tunnel)
void ExtendChaseLengthForHorn2()
void SetHornCurrent(G4double ihorn)
double GetPlugLength() const
G4String GetDecayPipeGas() const
bool GetUseMarsTargetHorns() const
void SetDisableSpoiler(G4bool aBool)
std::vector< double > fCurrentEqualizerOctAmpl
std::vector< double > fParams
void SetHorn2AllConductorMaterial(G4String &name)
G4LogicalVolume * TrackingPlaneDPLogical
double GetTotalLengthOfRock() const
void SetCurrentEqualizerQuadAmpl(double v)
LBNEVolumePlacements * fPlacementHandler
void SetDwStrAbsSteelWidth(G4double l)
G4String GetTargetMaterialName() const
G4double fSkinDepthInnerRad
G4UIcmdWithADoubleAndUnit * DwStrAbsConcreteWidth
G4UIcmdWithABool * ExpandAlLayers
void SetTargetDensity(double l)
void SetTotalLengthOfRock(double l)
void SetDwStrAbsConcreteWidth(G4double l)
LBNEVolumePlacementData * Create(const G4String &name)
void SetHorn2InnerConductorMaterial(G4String &name)
G4String GetTarget2MaterialName() const
std::vector< double > fCurrentEqualizerQuadAmpl
G4LogicalVolume * TrackingPlaneLogical
void PlaceFinalLBNFConceptHornB()
void SetSkinDepthInnerRad(G4double val)
void ConstructLBNFShielding(G4VPhysicalVolume *vPhys)
void PlaceFinalHorn2(G4PVPlacement *mother)
G4UIcmdWithAnInteger * RemoveLayers
void SetDisableSculptedLayers(G4bool aBool)
void SetConstructSculptedAbsorber(G4bool aBool)
std::vector< G4UIcmdWithADoubleAndUnit * > SetHornsCurrentEqualizerLongAbsLength
void UpdateParamsForHorn1MotherPoly()
void SetDisableMask(G4bool aBool)
std::vector< double > fCurrentMultiplier
bool GetRemoveDecayPipeSnout() const
bool fInstallLBNFNanoCalorimeter
G4VPhysicalVolume * Construct()
bool GetDoInstallShield() const
void PlaceFinalSimpleHornPolyNumber(size_t iHorn, G4PVPlacement *mother)
void SetHorn1InnerConductorMaterial(G4String &name)
void InitializeMaterials()
std::string GetPlugMaterial() const
bool GetUseCDR2015Optimized() const
void SetCurrentEqualizerOctAmpl(double v)
void PlaceFinalLBNFConceptHornA()
void Initialize(const G4LogicalVolume *matriarch)
G4VisAttributes * GetMaterialVisAttrib(G4String matName)
G4UIcmdWithABool * DisableSpoiler
void SetZShiftDrawingCoordinate(double z)
G4UIcmdWithoutParameter * UpdateCmd
double GetMaxRadiusMotherHorn1()
void PlaceFinalLBNFConceptHornC()
void SetCurrentEqualizerLongAbsLength(size_t kH, double v)
G4LogicalVolume * HadrBox_log
G4UIcmdWithABool * ConstructSculptedAbsorber
void SetHorn1HallPhysPtr(G4PVPlacement *p)
void SetFileNameFieldMapForCE(size_t kH, std::string s)
void SetDeltaEllipticityI(size_t kH, G4double val)
G4UIcmdWithABool * ConstructSimpAbsorber
double GetRadiusMilindWire() const
G4UIcmdWithABool * DisableSculptedLayers
bool GetConstructPlug() const
G4LogicalVolume * TrackingPlaneH2Logical
std::vector< G4UIcmdWithADouble * > SetHornsCurrentEqualizerQuadAmpl
G4UIcmdWithABool * DisableMask
bool fInstallLBNFNanoMiddleMicroStrip
G4PVPlacement * PlaceFinal(const G4String &name, G4VPhysicalVolume *mother)
void SetTarget2Density(double l)
G4UIcmdWithADoubleAndUnit * DwStrAbsSteelWidth
std::vector< double > fDeltaEllipticityI
G4RotationMatrix fRotBeamlineAngle
void SetHornCurrent(G4double ihorn)
void SetDeltaEllipticityI(G4double f)
bool GetUseSimpleTargetCylinder() const
G4LogicalVolume * TrackingPlaneH1Logical
void SetWireRadius(G4double r)
void InitializeMaterialsPostPreIdle()
bool fInstallLBNFNanoMagnetDwnstr
void SetCurrentMultipiler(size_t kH, double v)
void PlaceFinalUpstrTarget(G4PVPlacement *mother)
double GetPlugInnerRadius() const
int GetNumberOfHornsPolycone() const
void InitializeSubVolumes()
void PlaceFinalDecayPipeSnout(G4PVPlacement *mother)
bool GetUseTarget2Module() const
~LBNEDetectorConstruction()
double GetPlugOuterRadius() const
void ConstructLBNEHorn1TrackingPlane(G4VPhysicalVolume *tunnel)
void SetZCoordForPerfectFocusing(double z)
void ConstructLBNEDecayPipeTrackingPlane(G4VPhysicalVolume *tunnel)
bool GetWriteGDMLFile() const
std::vector< std::string > fFileNameFieldMapForCE
QTextStream & endl(QTextStream &s)
void SetHorn1AllConductorMaterial(G4String &name)