LBNEDetectorConstructionAdd1.cc
Go to the documentation of this file.
1 #include <fstream>
2 #include <vector>
3 #include <string>
4 #include <sstream>
5 
7 
8 #include "G4UIdirectory.hh"
9 #include "G4UIcmdWithAString.hh"
10 #include "G4UIcmdWithABool.hh"
11 #include "G4UIcmdWithAnInteger.hh"
12 #include "G4UIcmdWithADoubleAndUnit.hh"
13 #include "G4UIcmdWithoutParameter.hh"
14 #include "G4UnitsTable.hh"
15 
16 #include "G4Material.hh"
17 #include "G4Box.hh"
18 #include "G4Tubs.hh"
19 #include "G4Sphere.hh"
20 #include "G4LogicalVolume.hh"
21 #include "G4ThreeVector.hh"
22 #include "G4PVPlacement.hh"
23 #include "G4SubtractionSolid.hh"
24 #include "G4UnionSolid.hh"
25 #include "G4VisAttributes.hh"
26 #include "globals.hh"
27 #include "G4Transform3D.hh"
28 #include "G4RotationMatrix.hh"
29 #include "G4PVReplica.hh"
30 #include "G4AssemblyVolume.hh"
31 #include "LBNEMagneticField.hh"
32 #include "G4PhysicalVolumeStore.hh"
33 #include "G4LogicalVolumeStore.hh"
34 
35 #include "G4RegionStore.hh"
36 #include "G4SolidStore.hh"
37 #include "G4GeometryManager.hh"
38 #include "G4FieldManager.hh"
39 #include "LBNEVolumePlacements.hh"
40 #include "LBNEDetectorMessenger.hh"
41 #include "LBNERunManager.hh"
42 #include "G4GDMLParser.hh"
43 #include "G4UIcmdWithADouble.hh"
44 
45 #include "G4RunManager.hh"
46 
47 #include "G4VisExtent.hh"
48 
50 {
51  const double in = 25.4*CLHEP::mm;
52  G4cout << "LBNF Absorber, Aluminium, Sculpted, January 2015 " << G4endl;
53  const LBNEVolumePlacementData *plTop =
54  fPlacementHandler->Find(G4String("Absorber"), mother->GetLogicalVolume()->GetName(),
55  G4String("LBNEDetectorConstruction::ConstructLBNEHadronAbsorberSculpted"));
56  const double halfHeight = plTop->fParams[1]/2.;
57  const double halfWidth = plTop->fParams[0]/2.;
58 
59  const double airBufferLength = std::abs(halfHeight*std::tan(fBeamlineAngle)) + 5.0*CLHEP::mm; // to avoid wrong material in fron of the
60  // spoiler ( or Hadron Monitor) due to the rotation.
61  const double totalLength =
62  2.0*airBufferLength + 357.0*in/std::cos(fBeamlineAngle) + 36*in/std::cos(fBeamlineAngle) + 2.0*CLHEP::cm;
63  //
64  // Last term is the concrete wall // Drawing received from Vladimir Sidorov, April 2015.
65  // See also LBNE doc-db 10095. This does not include the ~ 2 feet of concrete at the back.
66  // August 2015: The ~ 2 feet was too inaccurate, and I left off the 60 inch of steel at the end.
67  // more orver, I also have to carve an airbuffer at the end..
68  // The 36 inch is the correct thickness of the back wall. The 2 cm is extra gaps..
69  //
70  // Start the top volume
71  G4String topVStr("HadronAbsorberSculpTop");
72  G4Box* topBox = new G4Box(topVStr, halfWidth-10., halfHeight-10., totalLength/2.);
73  G4LogicalVolume* topVol = new G4LogicalVolume(topBox, G4Material::GetMaterial("Concrete"), topVStr);
74  const LBNEVolumePlacementData *plDecayPipe =
75  fPlacementHandler->Find(G4String("Absorber"), G4String("DecayPipeHall"),
76  G4String("LBNEDetectorConstruction::ConstructLBNEHadronAbsorberSculpted"));
77  const double zLocTop = plDecayPipe->fPosition[2] + plDecayPipe->fParams[2]/2. + totalLength/2. + 15.0*CLHEP::mm;
78  // last term is correction to avoid clashs with alcove or decay pipe..
79  std::cerr << " LBNEDetectorConstruction::ConstructLBNEHadronAbsorberSculpted, zLocTop "
80  << zLocTop << " Length of mother " << plTop->fParams[2] << std::endl
81  << " Total length of Abosrber " << totalLength << " airbuffer lenfth " << airBufferLength << std::endl
82  << " ........... pipe Lengtgh " << plDecayPipe->fParams[2]
83  << " Pipe position " << plDecayPipe->fPosition[2] << std::endl;
84  const G4ThreeVector locTopV(0., 0., zLocTop);
85  // decay pipe and the muon alcove.
86  new G4PVPlacement((G4RotationMatrix *) 0, locTopV,
87  topVol, topVStr + std::string("_P"),
88  mother->GetLogicalVolume(), false, 1, true);
89  const double aFoot = 12.0*in;
90  const double longSpacing = 5.0*CLHEP::mm;
91  const double tranSpacing = 10.0*CLHEP::mm;
92  //
93  // Construct a subtraction from a box aligned whose long. axis is aligned with the beam direction,
94  // and a rotated box. The dimension is the decaypiperadius.
95  const double radPipe = fPlacementHandler->GetDecayPipeRadius();
96  const double lengthCylBuffer = (halfHeight + radPipe)*std::abs(std::tan(fBeamlineAngle));
97  const double shortLengthCylBuffer = (2.0*radPipe)*std::abs(std::tan(fBeamlineAngle));
98  double zCurrentSl = - totalLength/2. + lengthCylBuffer/2. + 0.2*CLHEP::mm ;
99  std::cerr << " lengthCylBuffer " << lengthCylBuffer << " shortLengthCylBuffer "
100  << shortLengthCylBuffer << " .. zCurrentSl " << zCurrentSl << std::endl;
101  {
102  const G4String aAirBuffTStrT("HadronAbsorberSculpAibufferTop");
103  const G4String aAirBuffTStrS("HadronAbsorberSculpAibufferSub");
104  const G4String aAirBuffTStrD("HadronAbsorberSculpAibufferDiag");
105  G4Tubs* aTubeAirbufferA = new G4Tubs(aAirBuffTStrT, 0., radPipe, lengthCylBuffer/2., 0., 360.0*CLHEP::degree);
106  G4Box* aBoxAirbufferB = new G4Box(aAirBuffTStrS, radPipe, radPipe, 1.05*shortLengthCylBuffer/2.); // could a bit longer..
107  G4ThreeVector shiftZ(0., 0., lengthCylBuffer/2.);
108  G4SubtractionSolid* aSectionSubAirbufferA =
109  new G4SubtractionSolid(aAirBuffTStrD, aTubeAirbufferA, aBoxAirbufferB, &fRotBeamlineAngle, shiftZ);
110 
111  G4LogicalVolume* airBuffVol = new G4LogicalVolume(aSectionSubAirbufferA, G4Material::GetMaterial("Air"), aAirBuffTStrD);
112  G4ThreeVector shiftZby2(0., 0., zCurrentSl );
113  new G4PVPlacement((G4RotationMatrix *) 0, shiftZby2, airBuffVol, aAirBuffTStrD+std::string("_P") , topVol, false, 1, true);
114  }
115  zCurrentSl += lengthCylBuffer/2. - shortLengthCylBuffer/2. + aFoot/2. ;
116  for (size_t kSlice=0; kSlice != 23-fRemoveLayers; kSlice++) {
117  const double halfHSl = halfHeight - 2.0*CLHEP::cm - std::abs((aFoot/2.)*std::sin(fBeamlineAngle));
118  const double halfWSl = halfWidth - 2.0*CLHEP::cm;
119  std::ostringstream aSlVStrStr; aSlVStrStr << "HadronAbsorberSculpSlice-" << kSlice;
120  std::ostringstream akSlVStrStr; akSlVStrStr << kSlice;
121  const G4String aSlVStr(aSlVStrStr.str());
122  G4Box* aBoxSlice = new G4Box(aSlVStr, halfWSl, halfHSl, aFoot/2. + longSpacing/2.);
123  const G4ThreeVector locSliceV(0., 0., zCurrentSl);
124  const G4String aSlVStrP = aSlVStr + std::string("_P");
125  switch (kSlice) {
126  case 0 : // The spoiler
127  {
128 
129  G4LogicalVolume* slVol = new G4LogicalVolume(aBoxSlice, G4Material::GetMaterial("Iron"), topVStr);
130  new G4PVPlacement(&fRotBeamlineAngle, locSliceV,
131  slVol, aSlVStr + std::string("_P"), topVol, false, 1, true);
132  std::string spoilVAStr("HadronAbsorberSculpSpoilerAir");
133  const double halfWidthSpoil = 40.0*in/2.; const double halfHeightSpoil = 40.0*in/2.;
134  G4Box* spoilerBoxAir = new G4Box(spoilVAStr, halfWidthSpoil+tranSpacing/2., halfHeightSpoil+tranSpacing/2.,
135  aFoot/2. + longSpacing/2. - 0.1*CLHEP::mm);
136  G4LogicalVolume* slSpoilAir = new G4LogicalVolume(spoilerBoxAir, G4Material::GetMaterial("Air"), spoilVAStr);
137  const G4ThreeVector spV(0., 0., 0.);
138  new G4PVPlacement((G4RotationMatrix*) 0, spV, slSpoilAir, spoilVAStr + std::string("_P"), slVol , false, 1, true);
139  if (!fDisableSpoiler){
140  std::string spoilVStr("HadronAbsorberSculpSpoilerAl");
141  G4Box* spoilerBoxAlum = new G4Box(spoilVStr, halfWidthSpoil, halfHeightSpoil, aFoot/2. - 0.2*CLHEP::mm);
142  G4LogicalVolume* slSpoilAl = new G4LogicalVolume(spoilerBoxAlum, G4Material::GetMaterial("Aluminum"), spoilVAStr);
143  new G4PVPlacement((G4RotationMatrix *) 0, spV, slSpoilAl, spoilVStr + std::string("_P"), slSpoilAir, false, 1, true);
144  }else{
145  G4cout << "Skipping construction of the spoiler!" <<G4endl;
146  }
147  break;
148  }
149  case 1 :
150  case 2 :
151  case 3 :
152  case 4 :
153  case 5 : // The Masks
154  {
155  G4LogicalVolume* slVol = new G4LogicalVolume(aBoxSlice, G4Material::GetMaterial("Iron"), topVStr);
156  new G4PVPlacement(&fRotBeamlineAngle, locSliceV,
157  slVol, aSlVStr + std::string("_P"), topVol, false, 1, true);
158  std::string maskVAStr("HadronAbsorberSculpMaskAir-"); maskVAStr += akSlVStrStr.str();
159  const double halfWidthMask = (kSlice%2 == 1) ? 79.0*in/2. : 77.0*in/2.;
160  const double halfHeightMask = 77.0*in/2.;
161  G4Box* maskerBoxAir = new G4Box(maskVAStr, halfWidthMask+tranSpacing/2., halfHeightMask+tranSpacing/2.,
162  aFoot/2. + longSpacing/2. - 0.1*CLHEP::mm);
163  G4LogicalVolume* slMaskAir = new G4LogicalVolume(maskerBoxAir, G4Material::GetMaterial("Air"), maskVAStr);
164  const G4ThreeVector spV(0., 0., 0.);
165  new G4PVPlacement((G4RotationMatrix *) 0, spV, slMaskAir, maskVAStr + std::string("_P"), slVol , false, 1, true);
166 
167  if (!fDisableMask){
168  std::string maskVAlStr("HadronAbsorberSculpMaskAl-"); maskVAlStr += akSlVStrStr.str();
169  G4Box* maskerBoxAlum = new G4Box(maskVAlStr, halfWidthMask, halfHeightMask, aFoot/2. - 0.2*CLHEP::mm);
170  G4LogicalVolume* slMaskAl = new G4LogicalVolume(maskerBoxAlum, G4Material::GetMaterial("Aluminum"), maskVAlStr);
171  new G4PVPlacement((G4RotationMatrix *) 0, spV, slMaskAl , maskVAlStr + std::string("_P"), slMaskAir, false, 1, true);
172 
173  double holeDiam = 30*in;
174  if ((kSlice == 3) || (kSlice == 4)) holeDiam = 20*in;
175  if ((kSlice == 5) || (kSlice == 6)) holeDiam = 12*in; // An educated guess !.
176  std::string maskHVStr("HadronAbsorberSculpMaskHole-"); maskHVStr += akSlVStrStr.str();
177  G4Tubs* maskerTubsHole = new G4Tubs(maskHVStr, 0., holeDiam/2. , aFoot/2. - 0.2*CLHEP::mm, 0., 360.0*CLHEP::degree);
178  G4LogicalVolume* slMaskHole = new G4LogicalVolume(maskerTubsHole, G4Material::GetMaterial("Air"), maskHVStr);
179  new G4PVPlacement((G4RotationMatrix *) 0, spV, slMaskHole , maskHVStr + std::string("_P"), slMaskAl, false, 1, true);
180  }
181  break;
182  }
183  case 6 :
184  case 7 :
185  case 8 :
186  case 9 :
187  case 10 :
188  case 11 :
189  case 12 :
190  case 13 :
191  case 14 : // The Sculpted Aluminnum
192  {
193  G4LogicalVolume* slVol = new G4LogicalVolume(aBoxSlice, G4Material::GetMaterial("Iron"), topVStr);
194  new G4PVPlacement(&fRotBeamlineAngle, locSliceV,
195  slVol, aSlVStr + std::string("_P"), topVol, false, 1, true);
196  std::string maskVAStr("HadronAbsorberSculpSculpAir-"); maskVAStr += akSlVStrStr.str();
197  const double halfWidthMask = (kSlice%2 == 1) ? 62.0*in/2. : 60.0*in/2.;
198  const double halfHeightMask = 60.0*in/2.;
199  G4Box* maskerBoxAir;
200  if (fExpandAlLayers){
201  double halfWidthMask2 = (kSlice%2 == 1) ? 2.9*CLHEP::m/2. : 2.8*CLHEP::m/2.;
202  double halfHeightMask2 = 2.8*CLHEP::m/2.;
203  G4cout <<"Creating expanded Al Layer"<<G4endl;
204  maskerBoxAir = new G4Box(maskVAStr, halfWidthMask2+tranSpacing/2., halfHeightMask2+tranSpacing/2.,
205  aFoot/2. + longSpacing/2. - 0.1*CLHEP::mm);
206 
207  }else{
208  maskerBoxAir = new G4Box(maskVAStr, halfWidthMask+tranSpacing/2., halfHeightMask+tranSpacing/2.,
209  aFoot/2. + longSpacing/2. - 0.1*CLHEP::mm);
210  }
211 
212  G4LogicalVolume* slMaskAir = new G4LogicalVolume(maskerBoxAir, G4Material::GetMaterial("Air"), maskVAStr);
213  const G4ThreeVector spV(0., 0., 0.);
214  new G4PVPlacement((G4RotationMatrix *) 0, spV, slMaskAir, maskVAStr + std::string("_P"), slVol , false, 1, true);
215 
216  std::string maskVBStr("HadronAbsorberSculpBoxAl-"); maskVBStr += akSlVStrStr.str();
217  std::string maskVSStr("HadronAbsorberSculpSphAl-"); maskVSStr += akSlVStrStr.str();
218  std::string maskVTmpStr("HadronAbsorberSculpSculpAlTmp-"); maskVTmpStr += akSlVStrStr.str();
219  std::string maskVFinalStr("HadronAbsorberSculpSculpAl-"); maskVFinalStr += akSlVStrStr.str();
221  G4Box* maskerBoxAlum;
222  if (fExpandAlLayers){
223  double halfWidthMask2 = (kSlice%2 == 1) ? 2.9*CLHEP::m/2. : 2.8*CLHEP::m/2.;
224  double halfHeightMask2 = 2.8*CLHEP::m/2.;
225  G4cout <<"Creating expanded Al Layer"<<G4endl;
226  maskerBoxAlum = new G4Box(maskVBStr, halfWidthMask2, halfHeightMask2, aFoot/2. - 0.2*CLHEP::mm);
227  }else{
228  maskerBoxAlum = new G4Box(maskVBStr, halfWidthMask, halfHeightMask, aFoot/2. - 0.2*CLHEP::mm);
229  }
230 
231  const double radSphere = 6.89286*in; // Solving (d+6)^2 = R^2, d + 3.5 = R Docdb 10095, page 7
232  G4Sphere *aSphere= new G4Sphere (maskVSStr, 0., radSphere, 0., 360.*CLHEP::degree, 0., 360.*CLHEP::degree);
233 
234  G4ThreeVector transLeft(0., 0., (-6.0*in - radSphere + 3.5*in)); // Docdb 10095, page 7
235  G4ThreeVector transRight(0., 0., (+6.0*in + radSphere - 3.5*in));
236  G4SubtractionSolid* maskerTmpAlum =
237  new G4SubtractionSolid(maskVTmpStr, maskerBoxAlum, aSphere, (G4RotationMatrix *) 0, transLeft);
238  G4SubtractionSolid* maskerScupltedBoxAlum =
239  new G4SubtractionSolid(maskVFinalStr, maskerTmpAlum, aSphere, (G4RotationMatrix *) 0, transRight);
240 
241  G4LogicalVolume* slMaskAl = new G4LogicalVolume(maskerScupltedBoxAlum, G4Material::GetMaterial("Aluminum"), maskVFinalStr);
242  new G4PVPlacement((G4RotationMatrix *) 0, spV, slMaskAl , maskVFinalStr + std::string("_P"), slMaskAir, false, 1, true);
243  }else{
244  G4cout << "Only using simple aluminum panels with no scallops"<<G4endl;
245  G4Box* maskerBoxAlum;
246  if (fExpandAlLayers){
247  double halfWidthMask2 = (kSlice%2 == 1) ? 2.9*CLHEP::m/2. : 2.8*CLHEP::m/2.;
248  double halfHeightMask2 = 2.8*CLHEP::m/2.;
249  maskerBoxAlum = new G4Box(maskVFinalStr, halfWidthMask2, halfHeightMask2, aFoot/2. - 0.2*CLHEP::mm);
250  }else{
251  maskerBoxAlum = new G4Box(maskVFinalStr, halfWidthMask, halfHeightMask, aFoot/2. - 0.2*CLHEP::mm);
252  }
253  G4LogicalVolume* slMaskAl = new G4LogicalVolume(maskerBoxAlum, G4Material::GetMaterial("Aluminum"), maskVFinalStr);
254  new G4PVPlacement((G4RotationMatrix *) 0, spV, slMaskAl , maskVFinalStr + std::string("_P"), slMaskAir, false, 1, true);
255 
256 
257  }
258  break;
259  }
260  case 15 :
261  case 16 :
262  case 17 :
263  case 19 : // The solid aAl
264  {
265 
266  G4LogicalVolume* slVol = new G4LogicalVolume(aBoxSlice, G4Material::GetMaterial("Iron"), topVStr);
267  new G4PVPlacement(&fRotBeamlineAngle, locSliceV,
268  slVol, aSlVStr + std::string("_P"), topVol, false, 1, true);
269  std::string maskVAStr("HadronAbsorberSculpSolidAir-"); maskVAStr += akSlVStrStr.str();
270  const double halfWidthMask = (kSlice%2 == 1) ? 62.0*in/2. : 60.0*in/2.;
271  const double halfHeightMask = 60.0*in/2.;
272  G4Box* maskerBoxAir;
273  if (fExpandAlLayers){
274  double halfWidthMask2 = (kSlice%2 == 1) ? 2.9*CLHEP::m/2. : 2.8*CLHEP::m/2.;
275  double halfHeightMask2 = 2.8*CLHEP::m/2.;
276  G4cout <<"Creating expanded Al Layer"<<G4endl;
277  maskerBoxAir = new G4Box(maskVAStr, halfWidthMask2+tranSpacing/2., halfHeightMask2+tranSpacing/2.,
278  aFoot/2. + longSpacing/2. - 0.1*CLHEP::mm);
279  }else{
280  maskerBoxAir = new G4Box(maskVAStr, halfWidthMask+tranSpacing/2., halfHeightMask+tranSpacing/2.,
281  aFoot/2. + longSpacing/2. - 0.1*CLHEP::mm);
282  }
283 
284  G4LogicalVolume* slMaskAir = new G4LogicalVolume(maskerBoxAir, G4Material::GetMaterial("Air"), maskVAStr);
285  const G4ThreeVector spV(0., 0., 0.);
286  new G4PVPlacement((G4RotationMatrix *) 0, spV, slMaskAir, maskVAStr + std::string("_P"), slVol , false, 1, true);
287 
288  std::string maskVStr("HadronAbsorberSculpSolidAl-"); maskVStr += akSlVStrStr.str();
289  G4Box* maskerBoxAlum;
290  if (fExpandAlLayers){
291  double halfWidthMask2 = (kSlice%2 == 1) ? 2.9*CLHEP::m/2. : 2.8*CLHEP::m/2.;
292  double halfHeightMask2 = 2.8*CLHEP::m/2.;
293  maskerBoxAlum = new G4Box(maskVStr, halfWidthMask2, halfHeightMask2, aFoot/2. - 0.2*CLHEP::mm);
294  }else{
295  maskerBoxAlum = new G4Box(maskVStr, halfWidthMask, halfHeightMask, aFoot/2. - 0.2*CLHEP::mm);
296  }
297 
298  G4LogicalVolume* slMaskAl = new G4LogicalVolume(maskerBoxAlum, G4Material::GetMaterial("Aluminum"), maskVStr);
299  new G4PVPlacement((G4RotationMatrix *) 0, spV, slMaskAl , maskVStr + std::string("_P"), slMaskAir, false, 1, true);
300  break;
301  }
302  default : // The rest of it. Just Steel
303  {
304 
305  G4LogicalVolume* slVol = new G4LogicalVolume(aBoxSlice, G4Material::GetMaterial("Iron"), topVStr);
306  new G4PVPlacement(&fRotBeamlineAngle, locSliceV,
307  slVol, aSlVStr + std::string("_P"), topVol, false, 1, true);
308  std::string maskVAStr("HadronAbsorberSculpEndAir-"); maskVAStr += akSlVStrStr.str();
309  const double halfWidthMask = 62.0*in/2.; const double halfHeightMask = 60.0*in/2.;
310  G4Box* maskerBoxAir = new G4Box(maskVAStr, halfWidthMask+tranSpacing/2., halfHeightMask+tranSpacing/2.,
311  aFoot/2. + longSpacing/2. - 0.1*CLHEP::mm);
312  G4LogicalVolume* slMaskAir = new G4LogicalVolume(maskerBoxAir, G4Material::GetMaterial("Air"), maskVAStr);
313  const G4ThreeVector spV(0., 0., 0.);
314  new G4PVPlacement((G4RotationMatrix *) 0, spV, slMaskAir, maskVAStr + std::string("_P"), slVol , false, 1, true);
315 
316  std::string maskVStr("HadronAbsorberSculpEndIron-"); maskVStr += akSlVStrStr.str();
317  G4Box* maskerBoxSteel = new G4Box(maskVStr, halfWidthMask, halfHeightMask, aFoot/2. - 0.2*CLHEP::mm);
318  G4LogicalVolume* slMaskIron = new G4LogicalVolume(maskerBoxSteel, G4Material::GetMaterial("Iron"), maskVStr);
319  new G4PVPlacement((G4RotationMatrix *) 0, spV, slMaskIron , maskVStr + std::string("_P"), slMaskAir, false, 1, true);
320  break;
321  }
322  } // type of slices (switch)
323  zCurrentSl += aFoot + longSpacing + 2.0*CLHEP::mm;
324  } // On longitudinal slices.
325  {
326  // August 25 2015.
327  // We now the air-cooled steel at the end of HA. (approximated as ~ 4.5 of concrete. Let us do it right..
328  // (or at least try to... )
329  //
330  const double lengthSteelLast = 60.0*in + 5*CLHEP::mm;
331  const double halfHSl = halfHeight - 2.0*CLHEP::cm - std::abs((aFoot/2.)*std::sin(fBeamlineAngle));
332  const double halfWSl = halfWidth - 2.0*CLHEP::cm;
333  std::string ACIronVStr("HadronAbsorberSculpEndIronAC");
334  G4Box* aBoxSlice = new G4Box(ACIronVStr, halfWSl, halfHSl, lengthSteelLast/2. );
335  G4LogicalVolume* slVol = new G4LogicalVolume(aBoxSlice, G4Material::GetMaterial("Iron"), ACIronVStr);
336  zCurrentSl += (-aFoot/2.) + lengthSteelLast/2. + 0.25*CLHEP::mm;
337  G4ThreeVector posEndIron(0., 0., zCurrentSl);
338  new G4PVPlacement(&fRotBeamlineAngle, posEndIron,
339  slVol, ACIronVStr + std::string("_P"), topVol, false, 1, true);
340  std::cerr << " Placing Air cooled Iron at Z = " << zCurrentSl << std::endl;
341  zCurrentSl += lengthSteelLast/2. + longSpacing + 2.0*CLHEP::mm;
342  }
343  {
344  const double lengthConcBackWall = 36.0*in + 5*CLHEP::mm;
345  const double halfHSl = halfHeight - 2.0*CLHEP::cm - std::abs((aFoot/2.)*std::sin(fBeamlineAngle));
346  const double halfWSl = halfWidth - 2.0*CLHEP::cm;
347  std::string ACConcVStr("HadronAbsorberSculpBackWall");
348  G4Box* aBoxSlice = new G4Box(ACConcVStr, halfWSl, halfHSl, lengthConcBackWall/2. );
349  G4LogicalVolume* slVol = new G4LogicalVolume(aBoxSlice, G4Material::GetMaterial("Concrete"), ACConcVStr);
350  zCurrentSl += lengthConcBackWall/2. + 1.0*CLHEP::mm;
351  G4ThreeVector posBackWall(0., 0., zCurrentSl);
352  std::cerr << " Placing Concrete Back wall at Z = " << zCurrentSl << std::endl;
353  new G4PVPlacement(&fRotBeamlineAngle, posBackWall,
354  slVol, ACConcVStr + std::string("_P"), topVol, false, 1, true);
355  zCurrentSl += lengthConcBackWall/2. + 1.0*CLHEP::mm;
356 
357  }
358  //
359  // Now we finish the carving the downstream air buffer, to avoid extra concrete..
360  // We assume a simple alvove, 1.5 m. radius.
361  //
362  /*
363  ** This seems to cause the complete loss of muons at the back wall, over a radius of 1.5 m...
364  ** There is an overlap.. to be fixed.. When we have a design for the muon wall.
365  {
366  const double radAlcove = 1.5*CLHEP::m;
367  std::cerr << " Final air buffer... " << lengthCylBuffer << " shortLengthCylBuffer "
368  << shortLengthCylBuffer << " .. zCurrentSl " << zCurrentSl << std::endl;
369  {
370  const G4String aAirBuffTStrT("HadronAbsorberSculpAibufferLastTop");
371  const G4String aAirBuffTStrS("HadronAbsorberSculpAibufferLastSub");
372  const G4String aAirBuffTStrD("HadronAbsorberSculpAibufferLastEff");
373  G4Tubs* aTubeAirbufferA = new G4Tubs(aAirBuffTStrT, 0., radAlcove, lengthCylBuffer/2., 0., 360.0*CLHEP::degree);
374  G4Box* aBoxAirbufferB = new G4Box(aAirBuffTStrS, radPipe, radAlcove, 1.05*shortLengthCylBuffer/2.); // could a bit longer..
375  G4ThreeVector shiftZ(0., 0., lengthCylBuffer/2.);
376  G4SubtractionSolid* aSectionSubAirbufferA =
377  new G4SubtractionSolid(aAirBuffTStrD, aTubeAirbufferA, aBoxAirbufferB, &fRotBeamlineAngle, shiftZ);
378 
379  G4LogicalVolume* airBuffVol = new G4LogicalVolume(aSectionSubAirbufferA, G4Material::GetMaterial("Air"), aAirBuffTStrD);
380  G4ThreeVector shiftZby2(0., 0., zCurrentSl );
381  new G4PVPlacement((G4RotationMatrix *) 0, shiftZby2, airBuffVol, aAirBuffTStrD+std::string("_P") , topVol, false, 1, true);
382  }
383  }
384  */
385  {
386  const double heightAlcove = 6*CLHEP::m;
387  const double lengthAlcove = 1.5 * CLHEP::m;
388  std::cerr << " Final air buffer... " << lengthAlcove << " height/width "
389  << heightAlcove << " .. zCurrentSl " << zCurrentSl << "Total volume length: "<<totalLength<<" Half width: "<<halfWidth<<" Half Height: "<<halfHeight<<std::endl;
390  {
391  const G4String aAirBuffTStrT("HadronAbsorberSculpAirBufferBox");
392  const G4String aAirBuffTStrD("HadronAbsorberSculpAirBuffer");
393  G4Box* aBoxAirBufferA = new G4Box(aAirBuffTStrT, heightAlcove/2, heightAlcove/2, lengthAlcove/2);
394 
395  G4LogicalVolume* airBuffVol = new G4LogicalVolume(aBoxAirBufferA, G4Material::GetMaterial("Air"), aAirBuffTStrD);
396  zCurrentSl += (lengthAlcove/2 + 2*CLHEP::mm)/fabs(cos(fBeamlineAngle));
397  G4ThreeVector shiftZby2(0., 0., zCurrentSl );
398  new G4PVPlacement(&fRotBeamlineAngle, shiftZby2, airBuffVol, aAirBuffTStrD+std::string("_P") , topVol, false, 1, true);
399 
400  //Add muon tracking plane
401  G4Box* muonTrackingBox = new G4Box("MuonTrackingBox",heightAlcove*0.45,heightAlcove*0.45,1*CLHEP::cm);
402  G4LogicalVolume* muonTrackingVol = new G4LogicalVolume(muonTrackingBox,G4Material::GetMaterial("Argon"),"MuonTrackingVol");
403  G4ThreeVector shiftZ(0,0,-lengthAlcove/2 + 30*CLHEP::cm);//5 cm from the upstream face of the alcove volume
404  G4RotationMatrix* rot = new G4RotationMatrix(fRotBeamlineAngle.inverse());
405  G4cout <<"Upstream face: "<<-lengthAlcove/2<<G4endl;
406  G4cout <<"Z Shift: "<<shiftZ.z()<<G4endl;
407  G4cout <<"Distance: "<<heightAlcove*0.4<<G4endl;
408  new G4PVPlacement(rot,shiftZ,muonTrackingVol,"MuonTrackingVol_P",airBuffVol,false,1,true);
409 
410  }
411  }
412 
413 }
const LBNEVolumePlacementData * Find(const G4String &name, const char *motherName, const char *method) const
std::string string
Definition: nybbler.cc:12
void ConstructLBNEHadronAbsorberSculpted(G4VPhysicalVolume *vPhys)
T abs(T value)
std::vector< double > fParams
LBNEVolumePlacements * fPlacementHandler
double GetDecayPipeRadius() const
QTextStream & endl(QTextStream &s)