Belle II Software  release-05-01-25
GeoARICHCreator.cc
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2010 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Luka Santelj *
7  * Leonid Burmistrov *
8  * *
9  * This software is provided "as is" without any warranty. *
10  **************************************************************************/
11 
12 #include <arich/geometry/GeoARICHCreator.h>
13 #include <arich/dbobjects/tessellatedSolidStr.h>
14 
15 #include <geometry/Materials.h>
16 #include <geometry/CreatorFactory.h>
17 #include <geometry/utilities.h>
18 #include <framework/gearbox/Unit.h>
19 #include <framework/logging/Logger.h>
20 #include <arich/simulation/SensitiveDetector.h>
21 #include <arich/simulation/SensitiveAero.h>
22 #include <simulation/background/BkgSensitiveDetector.h>
23 #include <arich/dbobjects/ARICHPositionElement.h>
24 
25 #include <cmath>
26 #include <boost/format.hpp>
27 #include <boost/foreach.hpp>
28 #include <boost/algorithm/string.hpp>
29 
30 // Geant4
31 #include <G4LogicalVolume.hh>
32 #include <G4PVPlacement.hh>
33 #include <G4AssemblyVolume.hh>
34 #include <G4UnionSolid.hh>
35 #include <G4LogicalSkinSurface.hh>
36 #include <G4OpticalSurface.hh>
37 
38 // Geant4 Shapes
39 #include <G4Box.hh>
40 #include <G4Tubs.hh>
41 #include <G4Trap.hh>
42 #include <G4Torus.hh>
43 #include <G4TessellatedSolid.hh>
44 #include <G4TriangularFacet.hh>
45 
46 #include <G4SubtractionSolid.hh>
47 #include <G4Region.hh>
48 #include <G4Material.hh>
49 #include <TVector3.h>
50 
51 using namespace std;
52 using namespace boost;
53 using namespace CLHEP;
54 
55 namespace Belle2 {
61  using namespace geometry;
62 
63  namespace arich {
64 
65  //-----------------------------------------------------------------
66  // Register the Creator
67  //-----------------------------------------------------------------
68 
69  geometry::CreatorFactory<GeoARICHCreator> GeoARICHFactory("ARICHCreator");
70 
71  //-----------------------------------------------------------------
72  // Implementation
73  //-----------------------------------------------------------------
74 
75  GeoARICHCreator::GeoARICHCreator(): m_isBeamBkgStudy(0)
76  {
77  m_sensitive = NULL;
78  m_sensitiveAero = NULL;
79  }
80 
82  {
83  delete m_sensitive;
84  delete m_sensitiveAero;
85  G4LogicalSkinSurface::CleanSurfaceTable();
86 
87  }
88 
89 
90  void GeoARICHCreator::createGeometry(G4LogicalVolume& topVolume, GeometryTypes)
91  {
92 
96 
97  // print geometry configuration
98  // m_config.print();
99 
100  //Build envelope
101  G4Tubs* envelopeTube = new G4Tubs("Envelope", m_config.getMasterVolume().getInnerRadius(),
103  G4Material* material = Materials::get(m_config.getMasterVolume().getMaterial());
104 
105  // check of material and its refractive index
106  if (!material) { B2FATAL("Material ARICH_Air required for ARICH master volume could not be found");}
107  if (!getAvgRINDEX(material))
108  B2WARNING("Material ARICH_Air required by ARICH master volume has no specified refractive index. Continuing, but no photons in ARICH will be propagated.");
109 
110  // create and place
111  G4LogicalVolume* masterLV = new G4LogicalVolume(envelopeTube, material, "ARICH.masterVolume");
112  setVisibility(*masterLV, false);
113 
114  // Set up region for production cuts
115  G4Region* aRegion = new G4Region("ARICHEnvelope");
116  masterLV->SetRegion(aRegion);
117  aRegion->AddRootLogicalVolume(masterLV);
118 
119  G4RotationMatrix rotMaster;
120  double rot_x = m_config.getMasterVolume().getRotationX();
121  double rot_y = m_config.getMasterVolume().getRotationX();
122  double rot_z = m_config.getMasterVolume().getRotationX();
123  double tr_x = m_config.getMasterVolume().getPosition().X();
124  double tr_y = m_config.getMasterVolume().getPosition().Y();
125  double tr_z = m_config.getMasterVolume().getPosition().Z();
126 
127  if (m_config.useGlobalDisplacement()) {
131  tr_x += m_config.getGlobalDisplacement().getX();
132  tr_y += m_config.getGlobalDisplacement().getY();
133  tr_z += m_config.getGlobalDisplacement().getZ();
134  B2WARNING("ARICH global displacement parameters from DB will be taken into account.");
135  }
136  rotMaster.rotateX(rot_x);
137  rotMaster.rotateX(rot_y);
138  rotMaster.rotateX(rot_z);
139 
140  G4ThreeVector transMaster(tr_x, tr_y, tr_z);
141 
142  new G4PVPlacement(G4Transform3D(rotMaster, transMaster), masterLV, "ARICH.MasterVolume", &topVolume, false, 1);
143 
145 
146  // Z shift for placing volumes in ARICH master volume
147  double zShift = 0;
148 
149  // build photon detector logical volume
150  G4LogicalVolume* detPlaneLV = buildDetectorPlane(m_config);
151  G4LogicalVolume* detSupportPlateLV = buildDetectorSupportPlate(m_config);
152 
153  // Build merger PCB logical volume
154  G4LogicalVolume* mergerLV = buildMergerPCBEnvelopePlane(m_config);
155 
156  // Build the cables envelop with effective material describing cables
157  G4LogicalVolume* cablesLV = buildCables(m_config.getCablesEnvelope());
158 
159  // Build cooling system assembly envelope plane
160  //G4LogicalVolume* coolingLV = buildCoolingEnvelopePlane(m_config.getCoolingGeometry());
161 
162  // Build aerogel logical volume
163  G4LogicalVolume* aeroPlaneLV;
164  if (!m_config.getAerogelPlane().isSimple()) {
165  aeroPlaneLV = buildAerogelPlane(m_config);
166  } else {
167  B2INFO("GeoARICHCreator: using simple cosmic test geometry.");
168  aeroPlaneLV = buildSimpleAerogelPlane(m_config);
169  }
170 
171  G4RotationMatrix rotDetPlane;
172  rotDetPlane.rotateX(m_config.getDetectorPlane().getRotationX());
173  rotDetPlane.rotateY(m_config.getDetectorPlane().getRotationY());
174  rotDetPlane.rotateZ(m_config.getDetectorPlane().getRotationZ());
175 
176  //
177  // For the moment rotation of merger PCB board envelope is not foreseen.
178  //
179  G4RotationMatrix rotMergerPlane;
180  rotMergerPlane.rotateX(0.0);
181  rotMergerPlane.rotateY(0.0);
182  rotMergerPlane.rotateZ(0.0);
183 
184  //
185  // For the moment rotation of cables envelope is not foreseen.
186  //
187  G4RotationMatrix rotCablesPlane;
188  rotCablesPlane.rotateX(0.0);
189  rotCablesPlane.rotateY(0.0);
190  rotCablesPlane.rotateZ(0.0);
191 
192  G4RotationMatrix rotCoolingPlane;
193  rotCoolingPlane.rotateX(0.0);
194  rotCoolingPlane.rotateY(0.0);
195  rotCoolingPlane.rotateZ(0.0);
196 
197  G4RotationMatrix rotAeroPlane;
198  rotAeroPlane.rotateX(m_config.getAerogelPlane().getRotationX());
199  rotAeroPlane.rotateY(m_config.getAerogelPlane().getRotationY());
200  rotAeroPlane.rotateZ(m_config.getAerogelPlane().getRotationZ());
201 
202  G4ThreeVector transDetPlane(m_config.getDetectorPlane().getPosition().X(), m_config.getDetectorPlane().getPosition().Y(),
203  m_config.getDetectorPlane().getPosition().Z() + zShift);
204 
205  G4ThreeVector transDetSupportPlate(m_config.getDetectorPlane().getPosition().X(), m_config.getDetectorPlane().getPosition().Y(),
207 
208  G4ThreeVector transMergerPlate(m_config.getMergerGeometry().getEnvelopeCenterPosition().X() * mm,
211 
212  G4ThreeVector transCablesPlate(m_config.getCablesEnvelope().getEnvelopeCenterPosition().X(),
215 
216  G4ThreeVector transCoolingPlate(m_config.getCoolingGeometry().getEnvelopeCenterPosition().X() * mm,
219 
220  G4ThreeVector transAeroPlane(m_config.getAerogelPlane().getPosition().X(),
222  m_config.getAerogelPlane().getPosition().Z() + zShift);
223 
224 
225  new G4PVPlacement(G4Transform3D(rotDetPlane, transDetPlane), detPlaneLV, "ARICH.detPlane", masterLV, false, 1);
226  new G4PVPlacement(G4Transform3D(rotDetPlane, transDetSupportPlate), detSupportPlateLV, "ARICH.detSupportPlane", masterLV, false, 1);
227  if (mergerLV) new G4PVPlacement(G4Transform3D(rotMergerPlane, transMergerPlate), mergerLV, "ARICH.mergerPlane", masterLV, false, 1);
228  new G4PVPlacement(G4Transform3D(rotCablesPlane, transCablesPlate), cablesLV, "ARICH.cablesPlane", masterLV, false, 1);
229  //new G4PVPlacement(G4Transform3D(rotCoolingPlane, transCoolingPlate), coolingLV, "ARICH.coolingPlane", masterLV, false, 1);
230  new G4PVPlacement(G4Transform3D(rotAeroPlane, transAeroPlane), aeroPlaneLV, "ARICH.aeroPlane", masterLV, false, 1);
231 
232  /*
233  // build and place cooling test plates
234  G4LogicalVolume* coolingTestPlatesLV = buildCoolingTestPlate(m_config.getCoolingGeometry());
235  double coolingTestPlateAngle = 0.0;
236  double coolingTestPlateR = 0.0;
237  for (unsigned i = 0; i < m_config.getCoolingGeometry().getCoolingTestPlatePosR().size(); i++) {
238  coolingTestPlateAngle = m_config.getCoolingGeometry().getCoolingTestPlatePosPhi().at(i) * deg;
239  coolingTestPlateR = m_config.getCoolingGeometry().getCoolingTestPlatePosR().at(i) * mm;
240  G4RotationMatrix rotCoolingTestPlate;
241  rotCoolingTestPlate.rotateZ(coolingTestPlateAngle);
242  G4ThreeVector transCoolingTestPlate(coolingTestPlateR * cos(coolingTestPlateAngle),
243  coolingTestPlateR * sin(coolingTestPlateAngle),
244  m_config.getCoolingGeometry().getCoolingTestPlatePosZ0().at(i) * mm + zShift);
245  new G4PVPlacement(G4Transform3D(rotCoolingTestPlate, transCoolingTestPlate), coolingTestPlatesLV, "ARICH.coolingTestPlates",
246  masterLV, false, i);
247  }
248  */
249 
250  // build and place mirrors
251  G4LogicalVolume* mirrorLV = buildMirror(m_config);
252  int nMirrors = m_config.getMirrors().getNMirrors();
253  int mirStart = m_config.getMirrors().getStartAngle();
254  int mirZPos = m_config.getMirrors().getZPosition();
255  int mirRad = m_config.getMirrors().getRadius();
256 
257  double angl = mirStart;
258  double dphi = 2 * M_PI / nMirrors;
259  if (m_config.useMirrorDisplacement()) B2WARNING("ARICH mirrors displacement parameters from DB will be used.");
260  for (int i = 1; i < nMirrors + 1; i++) {
261  double mrot_x = 0;
262  double mrot_y = 0;
263  double mrot_z = angl;
264  double mtr_x = mirRad * cos(angl);
265  double mtr_y = mirRad * sin(angl);
266  double mtr_z = mirZPos + zShift;
267  if (m_config.useMirrorDisplacement()) {
269  mrot_x += displ.getAlpha();
270  mrot_y += displ.getBeta();
271  mrot_z += displ.getGamma();
272  mtr_x += displ.getX();
273  mtr_y += displ.getY();
274  mtr_z += displ.getZ();
275  }
276  G4RotationMatrix rotMirror;
277  rotMirror.rotateX(mrot_x);
278  rotMirror.rotateY(mrot_y);
279  rotMirror.rotateZ(mrot_z);
280  G4ThreeVector transMirror(mtr_x, mtr_y, mtr_z);
281  new G4PVPlacement(G4Transform3D(rotMirror, transMirror), mirrorLV, "ARICH.mirrorPlate", masterLV, false, i);
282  angl += dphi;
283  }
284 
285  // build additional components of support structure
286 
287  const ARICHGeoSupport& supportPar = m_config.getSupportStructure();
288  std::vector<G4LogicalVolume*> shieldLV(2);
289  std::vector<double> shieldZ(2);
290  int nTubes = supportPar.getNTubes();
291  for (int i = 0; i < nTubes; i++) {
292  G4Tubs* tube = new G4Tubs(supportPar.getTubeName(i), supportPar.getTubeInnerR(i), supportPar.getTubeOuterR(i),
293  supportPar.getTubeLength(i) / 2., 0, 2.*M_PI);
294  G4Material* tubeMaterial = Materials::get(supportPar.getTubeMaterial(i));
295 
296  if (supportPar.getTubeName(i) == "ARICH.NeutronShield1") {
297  shieldLV[0] = new G4LogicalVolume(tube, tubeMaterial, supportPar.getTubeName(i));
298  shieldZ[0] = supportPar.getTubeZPosition(i) + supportPar.getTubeLength(i) / 2.;
299  continue;
300  } else if (supportPar.getTubeName(i) == "ARICH.NeutronShield2") {
301  shieldLV[1] = new G4LogicalVolume(tube, tubeMaterial, supportPar.getTubeName(i));
302  shieldZ[1] = supportPar.getTubeZPosition(i) + supportPar.getTubeLength(i) / 2.;
303  continue;
304  }
305 
306  G4LogicalVolume* tubeLV = new G4LogicalVolume(tube, tubeMaterial, supportPar.getTubeName(i));
307 
308  new G4PVPlacement(G4Transform3D(G4RotationMatrix(), G4ThreeVector(0, 0,
309  supportPar.getTubeZPosition(i) + supportPar.getTubeLength(i) / 2. + zShift)), tubeLV, supportPar.getTubeName(i), masterLV, false,
310  1);
311  }
312 
313  const std::vector<double> wedge1 = supportPar.getWedge(1);
314  const std::vector<double> wedge2 = supportPar.getWedge(2);
315  G4Material* wedge1Material = Materials::get(supportPar.getWedgeMaterial(1));
316  G4Material* wedge2Material = Materials::get(supportPar.getWedgeMaterial(2));
317  G4AssemblyVolume* assemblyWedge1 = makeJoint(wedge1Material, wedge1);
318  G4AssemblyVolume* assemblyWedge2 = makeJoint(wedge2Material, wedge2);
319 
320  G4Transform3D Tr;
321  int nWedge = supportPar.getNWedges();
322  for (int i = 0; i < nWedge; i++) {
323  G4RotationMatrix Rx;
324  int wgtype = supportPar.getWedgeType(i);
325  double phi = supportPar.getWedgePhi(i);
326  Rx.rotateZ(phi);
327  double r = supportPar.getWedgeR(i);
328  double z = supportPar.getWedgeZ(i);
329  G4ThreeVector Tb(r * cos(phi), r * sin(phi), z);
330 
331  if (shieldLV[0]) {
332  z -= shieldZ[0];
333  Tb.setZ(z);
334  Tr = G4Transform3D(Rx, Tb);
335  if (wgtype == 1) assemblyWedge1->MakeImprint(shieldLV[0], Tr);
336  else if (wgtype == 2) assemblyWedge2->MakeImprint(shieldLV[0], Tr);
337  continue;
338  }
339 
340  Tr = G4Transform3D(Rx, Tb);
341  if (wgtype == 1) assemblyWedge1->MakeImprint(masterLV, Tr);
342  else if (wgtype == 2) assemblyWedge2->MakeImprint(masterLV, Tr);
343  else B2ERROR("GeoARICHCreator: invalid support wedge type!");
344  }
345 
346  // place neutron shield volumes
347  if (shieldLV[0])
348  new G4PVPlacement(G4Transform3D(G4RotationMatrix(), G4ThreeVector(0, 0, shieldZ[0])), shieldLV[0], "ARICH.NeutronShield1", masterLV,
349  false, 1);
350  if (shieldLV[1])
351  new G4PVPlacement(G4Transform3D(G4RotationMatrix(), G4ThreeVector(0, 0, shieldZ[1])), shieldLV[1], "ARICH.NeutronShield2", masterLV,
352  false, 1);
353 
354  // place mirror holders, for now skip
355  /*
356  double mirSupX = 17.;
357  double mirSupY = 14.;
358  double mirSupLen = 131;
359  double mirSupLen1 = 201;
360 
361  std::vector<G4TwoVector> polygon;
362  polygon.assign(12, G4TwoVector());
363  polygon[11] = G4TwoVector(-mirSupX / 2., -mirSupY / 2.);
364  polygon[10] = G4TwoVector(-mirSupX / 2., 2.);
365  polygon[9] = G4TwoVector(-mirSupX / 4., 2. - 0.75);
366  polygon[8] = G4TwoVector(-mirSupX / 4., 5. - 0.75);
367  polygon[7] = G4TwoVector(-mirSupX / 2., 5);
368  polygon[6] = G4TwoVector(-mirSupX / 2., mirSupY / 2.);
369  polygon[5] = G4TwoVector(mirSupX / 2., mirSupY / 2.);
370  polygon[4] = G4TwoVector(mirSupX / 2., 6);
371  polygon[3] = G4TwoVector(mirSupX / 4., 6. - 0.75);
372  polygon[2] = G4TwoVector(mirSupX / 4., 2. - 0.75);
373  polygon[1] = G4TwoVector(mirSupX / 2., 2.);
374  polygon[0] = G4TwoVector(mirSupX / 2., -mirSupY / 2.);
375 
376  std::vector<G4ExtrudedSolid::ZSection> zsections;
377  zsections.push_back(G4ExtrudedSolid::ZSection(-mirSupLen / 2., G4TwoVector(0, 0), 1));
378  zsections.push_back(G4ExtrudedSolid::ZSection(mirSupLen / 2., G4TwoVector(0, 0), 1));
379 
380  G4ExtrudedSolid* shape = new G4ExtrudedSolid("bla", polygon, zsections);
381  G4LogicalVolume* shapeLV = new G4LogicalVolume(shape, wedge1Material, "mirrorsupport");
382 
383  G4Box* shape1 = new G4Box("shape1", mirSupX / 2., 2. / 2., mirSupLen1 / 2.);
384  G4LogicalVolume* shape1LV = new G4LogicalVolume(shape1, wedge1Material, "mirrorholder");
385 
386  G4AssemblyVolume* mirroHolder = new G4AssemblyVolume();
387  G4RotationMatrix Rh;
388  G4ThreeVector Th(0, 0, 0);
389  Tr = G4Transform3D(Rh, Th);
390  mirroHolder->AddPlacedVolume(shapeLV, Tr);
391 
392  Th.setZ(-35.0);
393  Th.setY(-mirSupY / 2. - 1.);
394  Tr = G4Transform3D(Rh, Th);
395  mirroHolder->AddPlacedVolume(shape1LV, Tr);
396 
397  double rholder = m_config.getDetectorPlane().getSupportOuterR() - mirSupY / 2.;
398 
399  angl = dphi / 2.;
400  for (int i = 1; i < nMirrors + 1; i++) {
401  G4RotationMatrix rotMirror;
402  rotMirror.rotateX(M_PI);
403  rotMirror.rotateZ(-M_PI / 2. + angl);
404  G4ThreeVector transMirror(rholder * cos(angl), rholder * sin(angl), mirZPos + zShift);
405  Tr = G4Transform3D(rotMirror, transMirror);
406  mirroHolder->MakeImprint(masterLV, Tr);
407  angl += dphi;
408  }
409  */
410 
411  // temporary for simple cosmic test
412  // if using simple configuration, place scinitilators
414  int nBoxes = supportPar.getNBoxes();
415  for (int i = 0; i < nBoxes; i++) {
416  ARICHGeoSupport::box box = supportPar.getBox(i);
417  G4Box* scintBox = new G4Box("scintBox", box.size[0] * 10. / 2., box.size[1] * 10. / 2., box.size[2] * 10. / 2.);
418  G4Material* scintMaterial = Materials::get(box.material);
419  G4LogicalVolume* scintLV = new G4LogicalVolume(scintBox, scintMaterial, box.name);
420  scintLV->SetSensitiveDetector(m_sensitiveAero);
421  G4RotationMatrix rotScint;
422  rotScint.rotateX(box.rotation[0]);
423  rotScint.rotateY(box.rotation[1]);
424  rotScint.rotateZ(box.rotation[2]);
425  TVector3 transScintTV(box.position[0], box.position[1], box.position[2]);
426  transScintTV = m_config.getMasterVolume().pointToGlobal(transScintTV);
427  B2INFO("GeoARICHCreator: Scintilator " << box.name << " placed at global: " << transScintTV.X() << " " << transScintTV.Y() << " " <<
428  transScintTV.Z());
429  G4ThreeVector transScint(box.position[0] * 10., box.position[1] * 10., box.position[2] * 10.);
430  new G4PVPlacement(G4Transform3D(rotScint, transScint), scintLV, "scintilator", masterLV, false, 1);
431  }
432  }
433 
435 
436  return;
437 
438  }
439 
440 
442  {
443 
444  const ARICHGeoAerogelPlane& aeroGeo = detectorGeo.getAerogelPlane();
445 
446  const std::vector<double>& params = aeroGeo.getSimpleParams();
447 
448  // support plane
449  double rin = aeroGeo.getSupportInnerR();
450  double rout = aeroGeo.getSupportOuterR();
451  double thick = aeroGeo.getSupportThickness();
452  string supportMat = aeroGeo.getSupportMaterial();
453  double wallHeight = aeroGeo.getWallHeight();
454  G4Material* supportMaterial = Materials::get(supportMat);
455  G4Material* gapMaterial = Materials::get("Air"); // Air without refractive index (to kill photons, to mimic black paper around tile)
456 
457  // master volume
458  G4Tubs* aerogelTube = new G4Tubs("aerogelTube", rin, rout, (thick + wallHeight) / 2., 0, 2 * M_PI);
459  G4LogicalVolume* aerogelPlaneLV = new G4LogicalVolume(aerogelTube, gapMaterial, "ARICH.AaerogelPlane");
460 
461  // support plate
462  G4Tubs* supportTube = new G4Tubs("aeroSupportTube", rin, rout, thick / 2., 0, 2 * M_PI);
463  G4LogicalVolume* supportTubeLV = new G4LogicalVolume(supportTube, supportMaterial, "ARICH.AerogelSupportPlate");
464  //supportTubeLV->SetSensitiveDetector(m_sensitiveAero);
465 
466  unsigned nLayer = aeroGeo.getNLayers();
467 
468  // loop over layers
469  double zLayer = 0;
470  for (unsigned iLayer = 1; iLayer < nLayer + 1; iLayer++) {
471  double layerThick = aeroGeo.getLayerThickness(iLayer);
472  std::stringstream tileName;
473  tileName << "aerogelTile_" << iLayer;
474 
475  G4Box* tileShape = new G4Box(tileName.str(), params[0] * 10. / 2., params[1] * 10. / 2., layerThick / 2.);
476 
477  G4Material* aeroMaterial = Materials::get(aeroGeo.getLayerMaterial(iLayer));
478 
479  G4LogicalVolume* tileLV = new G4LogicalVolume(tileShape, aeroMaterial, string("ARICH.") + tileName.str());
480 
481  G4ThreeVector transTile(params[2] * 10., params[3] * 10., (thick + layerThick - wallHeight) / 2. + zLayer);
482  G4RotationMatrix Ra;
483  Ra.rotateZ(params[4]);
484  new G4PVPlacement(G4Transform3D(Ra, transTile), tileLV, string("ARICH.") + tileName.str(), aerogelPlaneLV, false, iLayer);
485 
486  zLayer += layerThick;
487  }
488 
489  new G4PVPlacement(G4Translate3D(0., 0., -wallHeight / 2.), supportTubeLV, "ARICH.AerogelSupportPlate", aerogelPlaneLV, false, 1);
490 
491  return aerogelPlaneLV;
492  }
493 
494  G4LogicalVolume* GeoARICHCreator::buildAerogelPlane(const ARICHGeometryConfig& detectorGeo)
495  {
496  if (detectorGeo.getAerogelPlane().getFullAerogelMaterialDescriptionKey() == 0)
497  return buildAerogelPlaneAveragedOverLayers(detectorGeo);
498  else if (detectorGeo.getAerogelPlane().getFullAerogelMaterialDescriptionKey() == 1)
499  return buildAerogelPlaneWithIndividualTilesProp(detectorGeo);
500  else
501  B2ERROR("GeoARICHCreator::buildAerogelPlane --> getFullAerogelMaterialDescriptionKey() is wrong");
502  return NULL;
503  }
504 
506  {
507 
508  //cout<<"GeoARICHCreator::buildAerogelPlaneAveragedOverLayers(const ARICHGeometryConfig& detectorGeo)"<<endl;
509 
510  const ARICHGeoAerogelPlane& aeroGeo = detectorGeo.getAerogelPlane();
511 
512  // support plane
513  double rin = aeroGeo.getSupportInnerR();
514  double rout = aeroGeo.getSupportOuterR();
515  double thick = aeroGeo.getSupportThickness();
516  double wallThick = aeroGeo.getWallThickness();
517  double wallHeight = aeroGeo.getWallHeight();
518  string supportMat = aeroGeo.getSupportMaterial();
519  G4Material* supportMaterial = Materials::get(supportMat);
520  G4Material* gapMaterial = Materials::get("Air"); // Air without refractive index (to kill photons, to mimic black paper around tile)
521  G4Material* imgMaterial = Materials::get("ARICH_Air");
522  // master volume
523 
524  //double imgTubeLen = 0.5; // if changed, change position of aerogel plane also in main function!!
525  double imgTubeLen = aeroGeo.getImgTubeThickness();
526  G4Tubs* aerogelTube = new G4Tubs("aerogelTube", rin, rout, (thick + wallHeight + imgTubeLen) / 2., 0, 2 * M_PI);
527  G4LogicalVolume* aerogelPlaneLV = new G4LogicalVolume(aerogelTube, gapMaterial, "ARICH.AaerogelPlane");
528 
529  // support plate
530  G4Tubs* supportTube = new G4Tubs("aeroSupportTube", rin, rout, thick / 2., 0, 2 * M_PI);
531  G4LogicalVolume* supportTubeLV = new G4LogicalVolume(supportTube, supportMaterial, "ARICH.AerogelSupportPlate");
532  //supportTubeLV->SetSensitiveDetector(m_sensitiveAero);
533 
534  // imaginary tube after aerogel layers (used as volume to which tracks are extrapolated by ext module)
535  G4Tubs* imgTube = new G4Tubs("imgTube", rin, rout, imgTubeLen / 2., 0, 2 * M_PI);
536  G4LogicalVolume* imgTubeLV = new G4LogicalVolume(imgTube, imgMaterial, "ARICH.AerogelImgPlate");
537  imgTubeLV->SetSensitiveDetector(m_sensitiveAero);
538 
539 
540  // read radiuses of aerogel slot aluminum walls
541  std::vector<double> wallR;
542  unsigned nRing = aeroGeo.getNRings();
543  for (unsigned iRing = 1; iRing < nRing + 1; iRing++) {
544  wallR.push_back(aeroGeo.getRingRadius(iRing));
545  }
546 
547  unsigned nLayer = aeroGeo.getNLayers();
548  double tileGap = aeroGeo.getTileGap();
549  G4Transform3D transform = G4Translate3D(0., 0., (thick - imgTubeLen) / 2.);
550 
551  for (unsigned iRing = 0; iRing < nRing; iRing++) {
552 
553  // aluminum walls between tile rings (r wall)
554  std::stringstream wallName;
555  wallName << "supportWallR_" << iRing + 1;
556  G4Tubs* supportWall = new G4Tubs(wallName.str().c_str(), wallR[iRing], wallR[iRing] + wallThick, wallHeight / 2., 0, 2 * M_PI);
557  G4LogicalVolume* supportWallLV = new G4LogicalVolume(supportWall, supportMaterial, string("ARICH.") + wallName.str().c_str());
558 
559  new G4PVPlacement(transform, supportWallLV, string("ARICH.") + wallName.str().c_str(), aerogelPlaneLV, false, 0);
560 
561  if (iRing == 0) continue;
562 
563  // place phi aluminum walls
564  double dphi = aeroGeo.getRingDPhi(iRing);
565 
566  wallName.str("");
567  wallName << "supportWallPhi_" << iRing + 1;
568  G4Box* wall = new G4Box(wallName.str(), (wallR[iRing] - wallR[iRing - 1] - wallThick) / 2. - 1., thick / 2., wallHeight / 2.);
569  G4LogicalVolume* wallLV = new G4LogicalVolume(wall, supportMaterial, string("ARICH.") + wallName.str());
570  double r = (wallR[iRing - 1] + wallThick + wallR[iRing]) / 2.;
571  double zLayer = 0;
572 
573  // loop over layers
574  int iSlot = 1;
575  for (unsigned iLayer = 1; iLayer < nLayer + 1; iLayer++) {
576  double iphi = 0;
577  double layerThick = aeroGeo.getLayerThickness(iLayer);
578 
579  std::stringstream tileName;
580  tileName << "aerogelTile_" << iRing << "_" << iLayer;
581 
582  G4Tubs* tileShape = new G4Tubs(tileName.str(), wallR[iRing - 1] + wallThick + tileGap, wallR[iRing] - tileGap, layerThick / 2.,
583  (tileGap + wallThick / 2.) / wallR[iRing], dphi - (2.*tileGap + wallThick) / wallR[iRing]);
584 
585  G4Material* aeroMaterial = Materials::get(aeroGeo.getLayerMaterial(iLayer));
586  G4LogicalVolume* tileLV = new G4LogicalVolume(tileShape, aeroMaterial, string("ARICH.") + tileName.str());
587 
588  while (iphi < 2 * M_PI - 0.0001) {
589  G4ThreeVector trans(r * cos(iphi), r * sin(iphi), (thick - imgTubeLen) / 2.);
590  G4RotationMatrix Ra;
591  Ra.rotateZ(iphi);
592 
593  if (iLayer == 1) new G4PVPlacement(G4Transform3D(Ra, trans), wallLV, string("ARICH.") + wallName.str(), aerogelPlaneLV, false,
594  iSlot);
595 
596  G4ThreeVector transTile(0, 0, (thick + layerThick - wallHeight - imgTubeLen) / 2. + zLayer);
597  new G4PVPlacement(G4Transform3D(Ra, transTile), tileLV, string("ARICH.") + tileName.str(), aerogelPlaneLV, false, iSlot);
598  iphi += dphi;
599  iSlot++;
600  }
601  zLayer += layerThick;
602  }
603  }
604 
605  new G4PVPlacement(G4Translate3D(0., 0., -(wallHeight + imgTubeLen) / 2.), supportTubeLV, "ARICH.AerogelSupportPlate",
606  aerogelPlaneLV,
607  false, 1);
608 
609  new G4PVPlacement(G4Translate3D(0., 0., (wallHeight + thick) / 2.), imgTubeLV, "ARICH.AerogelImgPlate", aerogelPlaneLV, false, 1);
610 
611  return aerogelPlaneLV;
612 
613  }
614 
616  {
617 
618  //cout << "GeoARICHCreator::buildAerogelPlaneWithIndividualTilesProp(const ARICHGeometryConfig& detectorGeo)" << endl;
619 
620  const ARICHGeoAerogelPlane& aeroGeo = detectorGeo.getAerogelPlane();
621 
622  // support plane
623  double rin = aeroGeo.getSupportInnerR();
624  double rout = aeroGeo.getSupportOuterR();
625  double thick = aeroGeo.getSupportThickness();
626  double wallThick = aeroGeo.getWallThickness();
627  // Maximum total (up and down) thickness of the aerogel tiles
628  double maxTotalAerogelThick = aeroGeo.getMaximumTotalTileThickness();
629  //cout<<"maxTotalAerogelThick "<<maxTotalAerogelThick<<endl
630  // <<"wallHeight "<<wallHeight<<endl;
631  // In case of individual thickness of the tiles we need to define compensation
632  // volume with ARICH air. This volume situated between aerogel tile and image plane (imgTube).
633  // Minimum thickness of the compensation volume with ARICH air
634  double compensationARICHairVolumeThick_min = aeroGeo.getCompensationARICHairVolumeThick_min(); // mm
635  // Please note redefinition of wallHeight value
636  double wallHeight = maxTotalAerogelThick + compensationARICHairVolumeThick_min;
637 
638  string supportMat = aeroGeo.getSupportMaterial();
639  G4Material* supportMaterial = Materials::get(supportMat);
640 
641  G4Material* gapMaterial =
642  Materials::get("Air"); // Air without refractive index (to kill photons, to mimic black paper around tile)
643  G4Material* imgMaterial = Materials::get("ARICH_Air"); // Air with defined optical properties to propagate cherenkov photons
644 
645  // master volume
646  double imgTubeLen = aeroGeo.getImgTubeThickness(); // if changed, change position of aerogel plane also in main function!!
647  G4Tubs* aerogelTube = new G4Tubs("aerogelTube", rin, rout, (thick + wallHeight + imgTubeLen) / 2., 0, 2 * M_PI);
648  G4LogicalVolume* aerogelPlaneLV = new G4LogicalVolume(aerogelTube, gapMaterial, "ARICH.AaerogelPlane");
649 
650  // support plate
651  G4Tubs* supportTube = new G4Tubs("aeroSupportTube", rin, rout, thick / 2., 0, 2 * M_PI);
652  G4LogicalVolume* supportTubeLV = new G4LogicalVolume(supportTube, supportMaterial, "ARICH.AerogelSupportPlate");
653  //supportTubeLV->SetSensitiveDetector(m_sensitiveAero);
654 
655  // imaginary tube after aerogel layers (used as volume to which tracks are extrapolated by ext module)
656  G4Tubs* imgTube = new G4Tubs("imgTube", rin, rout, imgTubeLen / 2., 0, 2 * M_PI);
657  G4LogicalVolume* imgTubeLV = new G4LogicalVolume(imgTube, imgMaterial, "ARICH.AerogelImgPlate");
658  imgTubeLV->SetSensitiveDetector(m_sensitiveAero);
659 
660  // read radiuses of aerogel slot aluminum walls
661  std::vector<double> wallR;
662  unsigned nRing = aeroGeo.getNRings();
663  for (unsigned iRing = 1; iRing < nRing + 1; iRing++) {
664  wallR.push_back(aeroGeo.getRingRadius(iRing));
665  }
666 
667  unsigned nLayer = aeroGeo.getNLayers();
668  double tileGap = aeroGeo.getTileGap();
669  G4Transform3D transform = G4Translate3D(0., 0., (thick - imgTubeLen) / 2.);
670 
671  for (unsigned iRing = 0; iRing < nRing; iRing++) {
672 
673  // Aluminum walls between tile rings (r wall)
674  std::stringstream wallName;
675  wallName << "supportWallR_" << iRing + 1;
676  //cout<<"wallName = "<<wallName.str().c_str()<<endl;
677  G4Tubs* supportWall = new G4Tubs(wallName.str().c_str(), wallR[iRing], wallR[iRing] + wallThick, wallHeight / 2., 0, 2 * M_PI);
678  G4LogicalVolume* supportWallLV = new G4LogicalVolume(supportWall, supportMaterial, string("ARICH.") + wallName.str().c_str());
679  new G4PVPlacement(transform, supportWallLV, string("ARICH.") + wallName.str().c_str(), aerogelPlaneLV, false, 0);
681 
682  // There are only 4 rings of aerogel - the first one is only for mechanical support
683  if (iRing == 0) continue;
684 
685  // dphi - distance between centers of two consecutive aluminum walls (diaphragm) in one ring
686  double dphi = aeroGeo.getRingDPhi(iRing);
687 
688  // Aluminum walls (diaphragm) between two neighboring tile in one ring (phi wall)
689  wallName.str("");
690  wallName << "supportWallPhi_" << iRing + 1;
691  G4Box* wall = new G4Box(wallName.str(), (wallR[iRing] - wallR[iRing - 1] - wallThick) / 2. - 1., thick / 2., wallHeight / 2.);
692  G4LogicalVolume* wallLV = new G4LogicalVolume(wall, supportMaterial, string("ARICH.") + wallName.str());
693  double r = (wallR[iRing - 1] + wallThick + wallR[iRing]) / 2.;
695 
696  // loop over layers
697  int icopyNumber = 0;
698  for (unsigned iLayer = 1; iLayer < nLayer + 1; iLayer++) {
699  //int iSlot = 1;
700  double iphi = 0;
701 
702  int iicolumn = 0;
703  // loop over phi (over tile slots from same ring)
704  while (iphi < 2 * M_PI - 0.0001) {
705 
706  // Define layer thickness as -1 in case it will not be defined
707  // below in the code with a appropriate value - Geant4 will trigger error
708  double layerThick = -1.0;
709  double tileUpThick = -1.0;
710  double tileDownThick = -1.0;
711  //cout<<" double layerThick = aeroGeo.getLayerThickness(iLayer) = "<<layerThick<<endl;
712 
713  // Define material and thickness
714  G4Material* aeroMaterial = NULL;
715  int ati_ring = iRing;
716  int ati_column = iicolumn + 1;
717  int ati_layerN = iLayer - 1;
718 
719  //cout<<setw(5)<<ati_layerN<<setw(5)<<ati_ring<<setw(5)<<ati_column<<endl;
720  if (detectorGeo.getAerogelPlane().getFullAerogelMaterialDescriptionKey() == 1) {
721  aeroMaterial = Materials::get(aeroGeo.getTileMaterialName(ati_ring, ati_column, ati_layerN).c_str());
722  } else {
723  B2ERROR("GeoARICHCreator::buildAerogelPlaneWithIndividualTilesProp --> getFullAerogelMaterialDescriptionKey() is wrong");
724  }
725  //cout<<"-----------------"<<endl
726  // <<"iLayer = "<<iLayer<<endl
727  // <<aeroMaterial->GetName()<<endl;
728  //cout<<setw(5)<<ati_layerN<<setw(5)<<ati_ring<<setw(5)<<ati_column<<endl;
729  //aeroMaterial->GetMaterialPropertiesTable()->DumpTable();
730  //zcout<<"ooooooooooooooooo"<<endl;
731  layerThick = aeroGeo.getTileThickness(ati_ring, ati_column, ati_layerN);
732  tileUpThick = aeroGeo.getTileThickness(ati_ring, ati_column, 0);
733  tileDownThick = aeroGeo.getTileThickness(ati_ring, ati_column, 1);
734 
735  // Placement of the aluminum walls (diaphragm) between two neighboring tile in one ring (phi wall)
736  // please note that we place single wall for two aerogel layers
737  G4ThreeVector trans(r * cos(iphi), r * sin(iphi), (thick - imgTubeLen) / 2.);
738  G4RotationMatrix Ra;
739  Ra.rotateZ(iphi);
740  if (iLayer == 1) {
741  new G4PVPlacement(G4Transform3D(Ra, trans), //transformation
742  wallLV, //its logical
743  string("ARICH.") + wallName.str(), //name
744  aerogelPlaneLV, //mother logical
745  false, //always false
746  icopyNumber); //should be set to 0 for the first volume of a given type.
748 
749  // In case of individual thickness
750  // (if aeroGeo.getFullAerogelMaterialDescriptionKey() == 1) or
751  // (if aeroGeo.getFullAerogelMaterialDescriptionKey() == 2)
752  // of the tiles we need to define compensation volume with ARICH air.
753  // This volume situated between aerogel tile and image plane (imgTube).
754  // This volume have same shape as earogel tile but different thickness.
755  // Build Compensation tiles only one time
756  // Compensation tile shape
757  double compTileUpThick = wallHeight - tileUpThick - tileDownThick;
758  std::stringstream compTileName;
759  //compTileName << "aerogelCompTile_" << ati_layerN << "_" << ati_ring << "_" << ati_column;
760  // In the end of the name we have Layer(L), Ring(R), Slot/Column(S) id's
761  // L : 1-2
762  // R : 1-4
763  // S : 1-22 @ R = 1
764  // S : 1-28 @ R = 2
765  // S : 1-34 @ R = 3
766  // S : 1-40 @ R = 4
767  compTileName << "aerogelCompTile_" << iLayer << "_" << ati_ring << "_" << ati_column;
768  //cout<<compTileName.str()<<endl;
769  G4Tubs* compTileShape = new G4Tubs(compTileName.str(), //name
770  wallR[iRing - 1] + wallThick + tileGap, //Rmin
771  wallR[iRing] - tileGap, //Rmax
772  compTileUpThick / 2.0, //Thikness
773  (tileGap + wallThick / 2.0) / wallR[iRing], //phi start
774  dphi - (2.0 * tileGap + wallThick) / wallR[iRing]); //delta phi
775 
776  // Logical volume of the compensation tiles
777  G4LogicalVolume* compTileLV = new G4LogicalVolume(compTileShape, //Its solid
778  imgMaterial, //G4 material
779  string("ARICH.") + compTileName.str()); //name
780 
781  // Placement of the compensation tiles
782  G4ThreeVector transCompTile(0, 0, (thick + wallHeight - compTileUpThick - imgTubeLen) / 2.0);
783  G4RotationMatrix compRa;
784  compRa.rotateZ(iphi);
785  new G4PVPlacement(G4Transform3D(compRa, transCompTile), //transformation
786  compTileLV, //its logical
787  string("ARICH.") + compTileName.str(), //name
788  aerogelPlaneLV, //mother logical
789  false, //always false
790  0); //should be set to 0 for the first volume of a given type.
791  }
792 
793  // Tile shape
794  std::stringstream tileName;
795  tileName << "aerogelTile_" << iLayer << "_" << ati_ring << "_" << ati_column;
796  //cout<<tileName.str()<<endl;
797  G4Tubs* tileShape = new G4Tubs(tileName.str(), //name
798  wallR[iRing - 1] + wallThick + tileGap, //Rmin
799  wallR[iRing] - tileGap, //Rmax
800  layerThick / 2.0, //Thikness
801  (tileGap + wallThick / 2.0) / wallR[iRing], //phi start
802  dphi - (2.0 * tileGap + wallThick) / wallR[iRing]); //delta phi
803 
804  // Logical volume of the aerogel tiles
805  G4LogicalVolume* tileLV = new G4LogicalVolume(tileShape, //Its solid
806  aeroMaterial, //G4 material
807  string("ARICH.") + tileName.str()); //name
808 
809  // Placement of the aerogel tiles
810  double zLayer = 0.0;
811  if (iLayer == 2)
812  zLayer = tileUpThick;
813  G4ThreeVector transTile(0, 0, (thick + layerThick - wallHeight - imgTubeLen) / 2.0 + zLayer);
814  new G4PVPlacement(G4Transform3D(Ra, transTile), //transformation
815  tileLV, //its logical
816  string("ARICH.") + tileName.str(), //name
817  aerogelPlaneLV, //mother logical
818  false, //always false
819  0); //should be set to 0 for the first volume of a given type.
821 
822  iphi += dphi;
823  //iSlot++;
824  icopyNumber++;
825  iicolumn++;
826  }
827  }
828  }
829 
830  // Placement of the support tube
831  new G4PVPlacement(G4Translate3D(0., 0., -(wallHeight + imgTubeLen) / 2.), //transformation
832  supportTubeLV, //its logical
833  "ARICH.AerogelSupportPlate", //name
834  aerogelPlaneLV, //mother logical
835  false, //always false
836  0); //should be set to 0 for the first volume of a given type.
837 
838  // Placement of the imaginary tube after aerogel layers (used as volume to which tracks are extrapolated by ext module)
839  new G4PVPlacement(G4Translate3D(0., 0., (wallHeight + thick) / 2.), //transformation
840  imgTubeLV, //its logical
841  "ARICH.AerogelImgPlate", //name
842  aerogelPlaneLV, //mother logical
843  false, //always false
844  0); //should be set to 0 for the first volume of a given type.
845 
846  return aerogelPlaneLV;
847 
848  }
849 
850  G4LogicalVolume* GeoARICHCreator::buildHAPD(const ARICHGeoHAPD& hapdGeo)
851  {
852 
853  // get module materials
854  string wallMat = hapdGeo.getWallMaterial();
855  string winMat = hapdGeo.getWinMaterial();
856  string apdMat = hapdGeo.getAPDMaterial();
857  string fillMat = hapdGeo.getFillMaterial();
858  string febMat = hapdGeo.getFEBMaterial();
859  G4Material* wallMaterial = Materials::get(wallMat);
860  G4Material* windowMaterial = Materials::get(winMat);
861  G4Material* apdMaterial = Materials::get(apdMat);
862  G4Material* fillMaterial = Materials::get(fillMat);
863  G4Material* febMaterial = Materials::get(febMat);
864  G4Material* moduleFill = Materials::get("ARICH_Air");
865 
866  // check that module window material has specified refractive index
867  double wref = getAvgRINDEX(windowMaterial);
868  if (!wref) B2WARNING("Material '" << winMat <<
869  "', required for ARICH photon detector window as no specified refractive index. Continuing, but no photons in ARICH will be detected.");
870 
871  // get module dimensions
872  const double hapdSizeX = hapdGeo.getSizeX();
873  const double hapdSizeY = hapdGeo.getSizeY();
874  const double hapdSizeZ = hapdGeo.getSizeZ();
875  const double wallThick = hapdGeo.getWallThickness();
876  const double winThick = hapdGeo.getWinThickness();
877  const double apdSizeX = hapdGeo.getAPDSizeX();
878  const double apdSizeY = hapdGeo.getAPDSizeY();
879  const double apdSizeZ = hapdGeo.getAPDSizeZ();
880  const double botThick = wallThick;
881  const double modHeight = hapdGeo.getModuleSizeZ();
882 
883  // module master volume
884  G4Box* moduleBox = new G4Box("moduleBox", hapdSizeX / 2., hapdSizeY / 2., modHeight / 2.);
885  G4LogicalVolume* lmoduleBox = new G4LogicalVolume(moduleBox, moduleFill, "ARICH.HAPDModule");
886 
887  // build HAPD box
888  G4Box* hapdBox = new G4Box("hapdBox", hapdSizeX / 2., hapdSizeY / 2., hapdSizeZ / 2.);
889  G4LogicalVolume* lhapdBox = new G4LogicalVolume(hapdBox, fillMaterial, "ARICH.HAPD");
890 
891  // build HAPD walls
892  G4Box* tempBox2 = new G4Box("tempBox2", hapdSizeX / 2. - wallThick, hapdSizeY / 2. - wallThick,
893  hapdSizeZ / 2. + 0.1); // Dont't care about "+0.1", needs to be there.
894  G4SubtractionSolid* moduleWall = new G4SubtractionSolid("Box-tempBox", hapdBox, tempBox2);
895  G4LogicalVolume* lmoduleWall = new G4LogicalVolume(moduleWall, wallMaterial, "ARICH.HAPDWall");
896  setColor(*lmoduleWall, "rgb(1.0,0.0,0.0,1.0)");
897  new G4PVPlacement(G4Transform3D(), lmoduleWall, "ARICH.HAPDWall", lhapdBox, false, 1);
898 
899  // build HAPD window
900  G4Box* winBox = new G4Box("winBox", hapdSizeX / 2. - wallThick, hapdSizeY / 2. - wallThick, winThick / 2.);
901  G4LogicalVolume* lmoduleWin = new G4LogicalVolume(winBox, windowMaterial, "ARICH.HAPDWindow");
902  setColor(*lmoduleWin, "rgb(0.7,0.7,0.7,1.0)");
903  lmoduleWin->SetSensitiveDetector(m_sensitive);
904  G4Transform3D transform = G4Translate3D(0., 0., (-hapdSizeZ + winThick) / 2.);
905  new G4PVPlacement(transform, lmoduleWin, "ARICH.HAPDWindow", lhapdBox, false, 1);
906 
907  // build module bottom
908  G4Box* botBox = new G4Box("botBox", hapdSizeX / 2. - wallThick, hapdSizeY / 2. - wallThick, botThick / 2.);
909  G4LogicalVolume* lmoduleBot = new G4LogicalVolume(botBox, wallMaterial, "ARICH.HAPDBottom");
910  setColor(*lmoduleBot, "rgb(0.0,1.0,0.0,1.0)");
911  G4Transform3D transform1 = G4Translate3D(0., 0., (hapdSizeZ - botThick) / 2.);
912  new G4PVPlacement(transform1, lmoduleBot, "ARICH.HAPDBottom", lhapdBox, false, 1);
913 
914  // build apd
915  G4Box* apdBox = new G4Box("apdBox", apdSizeX / 2., apdSizeY / 2., apdSizeZ / 2.);
916  G4LogicalVolume* lApd = new G4LogicalVolume(apdBox, apdMaterial, "ARICH.HAPDApd");
917  if (m_isBeamBkgStudy) lApd->SetSensitiveDetector(new BkgSensitiveDetector("ARICH", 1));
918 
919  // add APD surface optical properties
920  Materials& materials = Materials::getInstance();
921 
922  G4OpticalSurface* optSurf = materials.createOpticalSurface(hapdGeo.getAPDSurface());
923 
924  new G4LogicalSkinSurface("apdSurface", lApd, optSurf);
925  G4Transform3D transform2 = G4Translate3D(0., 0., (hapdSizeZ - apdSizeZ) / 2. - botThick);
926  new G4PVPlacement(transform2, lApd, "ARICH.HAPDApd", lhapdBox, false, 1);
927 
928  // build FEB
929  double febSizeX = hapdGeo.getFEBSizeX();
930  double febSizeY = hapdGeo.getFEBSizeY();
931  double febSizeZ = hapdGeo.getFEBSizeZ();
932  G4Box* febBox = new G4Box("febBox", febSizeX / 2., febSizeY / 2., febSizeZ / 2.);
933  G4LogicalVolume* lfeb = new G4LogicalVolume(febBox, febMaterial, "ARICH.HAPDFeb");
934  if (m_isBeamBkgStudy) lfeb->SetSensitiveDetector(new BkgSensitiveDetector("ARICH"));
935  setColor(*lfeb, "rgb(0.0,0.6,0.0,1.0)");
936  G4Transform3D transform3 = G4Translate3D(0., 0., (modHeight - febSizeZ) / 2.);
937  new G4PVPlacement(transform3, lfeb, "ARICH.HAPDFeb", lmoduleBox, false, 1);
938  G4Transform3D transform4 = G4Translate3D(0., 0., - (modHeight - hapdSizeZ) / 2.);
939  new G4PVPlacement(transform4, lhapdBox, "ARICH.HAPD", lmoduleBox, false, 1);
940 
941  return lmoduleBox;
942 
943  }
944 
945  G4LogicalVolume* GeoARICHCreator::buildDetectorPlane(const ARICHGeometryConfig& detectorGeo)
946  {
947 
948  const ARICHGeoHAPD& hapdGeo = detectorGeo.getHAPDGeometry();
949  G4LogicalVolume* hapdLV = buildHAPD(hapdGeo);
950 
951  const ARICHGeoDetectorPlane& detGeo = detectorGeo.getDetectorPlane();
952 
953  G4Tubs* detTube = new G4Tubs("detTube", detGeo.getRingR(1) - hapdGeo.getSizeX() * 1.4 / 2.,
954  detGeo.getRingR(detGeo.getNRings()) + hapdGeo.getSizeX() * 1.4 / 2. , hapdGeo.getModuleSizeZ() / 2., 0, 2 * M_PI);
955  G4LogicalVolume* detPlaneLV = new G4LogicalVolume(detTube, Materials::get("ARICH_Air"), "ARICH.detectorPlane");
956 
957  unsigned nSlots = detGeo.getNSlots();
958 
959  for (unsigned iSlot = 1; iSlot < nSlots + 1; iSlot++) {
960  if (!m_modInfo->isInstalled(iSlot)) continue;
961  double r = detGeo.getSlotR(iSlot);
962  double phi = detGeo.getSlotPhi(iSlot);
963  G4ThreeVector trans(r * cos(phi), r * sin(phi), 0);
964  G4RotationMatrix Ra;
965  Ra.rotateZ(phi);
966  G4ThreeVector trans1(r * cos(phi), r * sin(phi), 0.0);
967  new G4PVPlacement(G4Transform3D(Ra, trans1), hapdLV, "ARICH.HAPDModule", detPlaneLV, false, iSlot);
968  }
969 
970  return detPlaneLV;
971 
972  }
973 
974  G4LogicalVolume* GeoARICHCreator::buildMerger(const ARICHGeoMerger& mergerGeo)
975  {
976 
977  // This is a screw hole on the merger board.
978  // This high precision of the geometry description is needed
979  // only for the correct placement of the merger cooling bodies.
980  // Volume to subtract (screw hole on the merger board)
981  double screwholeR = mergerGeo.getMergerPCBscrewholeR() * mm;
982  double screwholedY = mergerGeo.getMergerPCBscrewholePosdY() * mm;
983  double screwholedX1 = mergerGeo.getMergerPCBscrewholePosdX1() * mm;
984  double screwholedX2 = mergerGeo.getMergerPCBscrewholePosdX2() * mm;
985 
986  G4VSolid* screwHoleTubeSubtracted_solid = new G4Tubs("screwHoleTubeSubtracted_solid",
987  0.0,
988  screwholeR,
989  mergerGeo.getThickness() * mm / 2.0,
990  0, 360.0 * deg);
991 
992  // Volume to add (merger box)
993  G4Box* merger_solid = new G4Box("merger_solid",
994  mergerGeo.getSizeW() * mm / 2.0,
995  mergerGeo.getSizeL() * mm / 2.0,
996  mergerGeo.getThickness() * mm / 2.0);
997 
998  G4RotationMatrix Ra_sub;
999  G4ThreeVector Ta_sub;
1000  G4Transform3D Tr_sub;
1001  Ta_sub.setX(-mergerGeo.getSizeW() * mm / 2.0 + screwholedX1);
1002  Ta_sub.setY(mergerGeo.getSizeL() * mm / 2.0 - screwholedY);
1003  Ta_sub.setZ(0.0);
1004  Tr_sub = G4Transform3D(Ra_sub, Ta_sub);
1005  G4SubtractionSolid* substraction_solid = new G4SubtractionSolid("substraction_solid", merger_solid, screwHoleTubeSubtracted_solid,
1006  Tr_sub);
1007  Ta_sub.setX(mergerGeo.getSizeW() * mm / 2.0 - screwholedX2);
1008  Ta_sub.setY(mergerGeo.getSizeL() * mm / 2.0 - screwholedY);
1009  Ta_sub.setZ(0.0);
1010  Tr_sub = G4Transform3D(Ra_sub, Ta_sub);
1011  substraction_solid = new G4SubtractionSolid("substraction_solid", substraction_solid, screwHoleTubeSubtracted_solid, Tr_sub);
1012  Ta_sub.setX(mergerGeo.getSizeW() * mm / 2.0 - screwholedX2);
1013  Ta_sub.setY(-mergerGeo.getSizeL() * mm / 2.0 + screwholedY);
1014  Ta_sub.setZ(0.0);
1015  Tr_sub = G4Transform3D(Ra_sub, Ta_sub);
1016  substraction_solid = new G4SubtractionSolid("substraction_solid", substraction_solid, screwHoleTubeSubtracted_solid, Tr_sub);
1017  Ta_sub.setX(-mergerGeo.getSizeW() * mm / 2.0 + screwholedX1);
1018  Ta_sub.setY(-mergerGeo.getSizeL() * mm / 2.0 + screwholedY);
1019  Ta_sub.setZ(0.0);
1020  Tr_sub = G4Transform3D(Ra_sub, Ta_sub);
1021  substraction_solid = new G4SubtractionSolid("substraction_solid", substraction_solid, screwHoleTubeSubtracted_solid, Tr_sub);
1022 
1023  return new G4LogicalVolume(substraction_solid, Materials::get(mergerGeo.getMergerPCBMaterialName()), "ARICH.mergerPCB");
1024  }
1025 
1026 
1027  G4LogicalVolume* GeoARICHCreator::buildMergerCooling(unsigned iType)
1028  {
1029 
1030  if (!m_mergerCooling) {
1031  B2WARNING("ARICH geometry: no data available for merger " << iType << " cooling body geometry. Cooling body will not be placed.");
1032  return NULL;
1033  }
1034 
1035  std::stringstream shpName;
1036  shpName << "TessellatedSolid_" << + iType;
1037 
1038  G4TessellatedSolid* volume_solid = new G4TessellatedSolid(shpName.str().c_str());
1039 
1040  G4ThreeVector point_1;
1041  G4ThreeVector point_2;
1042  G4ThreeVector point_3;
1043 
1044  tessellatedSolidStr mergerCoolingStr = m_mergerCooling->getMergerCoolingBodiesInfo(iType);
1045 
1046  if (mergerCoolingStr.nCells == 0) {
1047  B2WARNING("ARICH geometry: no data available for merger " << iType << " cooling body geometry. Cooling body will not be placed.");
1048  return NULL;
1049  }
1050 
1051  for (unsigned int i = 0; i < mergerCoolingStr.nCells; i++) {
1052  //
1053  point_1.setX(mergerCoolingStr.posV1[0][i]);
1054  point_1.setY(mergerCoolingStr.posV1[1][i]);
1055  point_1.setZ(mergerCoolingStr.posV1[2][i]);
1056  //
1057  point_2.setX(mergerCoolingStr.posV2[0][i]);
1058  point_2.setY(mergerCoolingStr.posV2[1][i]);
1059  point_2.setZ(mergerCoolingStr.posV2[2][i]);
1060  //
1061  point_3.setX(mergerCoolingStr.posV3[0][i]);
1062  point_3.setY(mergerCoolingStr.posV3[1][i]);
1063  point_3.setZ(mergerCoolingStr.posV3[2][i]);
1064  //
1065  G4TriangularFacet* facet = new G4TriangularFacet(point_1, point_2, point_3, ABSOLUTE);
1066  volume_solid->AddFacet((G4VFacet*) facet);
1067  }
1068 
1069  volume_solid->SetSolidClosed(true);
1070  std::stringstream volName;
1071  volName << "ARICH.mergerCooling_" << + iType;
1072  G4LogicalVolume* volume_logical = new G4LogicalVolume(volume_solid,
1073  Materials::get(m_mergerCooling->getMergerCoolingBodiesMaterialName()), volName.str().c_str());
1074 
1075  setColor(*volume_logical, "rgb(0.6,0.0,0.2,1.0)"); //From the top (farther from IP, downstream)
1076 
1077  return volume_logical;
1078  }
1079 
1080  G4LogicalVolume* GeoARICHCreator::buildMergerEnvelope(const ARICHGeoMerger& mergerGeo, int iType)
1081  {
1082  // Volume to add single merger and merger cooling body envelope box
1083  G4Box* singlemergerenvelope_solid = new G4Box("singlemergerenvelope_solid",
1084  mergerGeo.getSingleMergerEnvelopeSizeW() * mm / 2.0,
1085  mergerGeo.getSingleMergerEnvelopeSizeL() * mm / 2.0,
1086  mergerGeo.getSingleMergerEnvelopeThickness() * mm / 2.0);
1087  std::stringstream volName;
1088  volName << "ARICH.singleMergerEnvelope_" << + iType;
1089  return new G4LogicalVolume(singlemergerenvelope_solid, Materials::get("ARICH_Air"), volName.str().c_str());
1090  }
1091 
1093  {
1094 
1095  const ARICHGeoMerger& mergerGeo = detectorGeo.getMergerGeometry();
1096 
1097  if (mergerGeo.getSingleMergerEnvelopeSizeW() < 1e-9) {
1098  B2WARNING("GeoARICHCreator: Merger and merger cooling geometry will not be build as it is not availible in geometry configuration (ARICHGeometryConfig with ClasDef>4 is needed).");
1099  return NULL;
1100  }
1101 
1102  G4Tubs* envelope_solid = new G4Tubs("envelope_solid", mergerGeo.getEnvelopeInnerRadius() * mm,
1103  mergerGeo.getEnvelopeOuterRadius() * mm, mergerGeo.getEnvelopeThickness() * mm / 2.0, 0.0, 2.0 * M_PI);
1104 
1105  G4LogicalVolume* envelope_logical = new G4LogicalVolume(envelope_solid, Materials::get("ARICH_Air"), "ARICH.mergerEnvelope");
1106 
1107 
1108  G4LogicalVolume* merger_logical = buildMerger(mergerGeo);
1109  G4LogicalVolume* mergerCooling_logical[12] = {NULL};
1110  G4LogicalVolume* mergerEnvelope_logical[12] = {NULL};
1111  G4ThreeVector TaPCB(mergerGeo.getSingleMergeEnvelopePosition().X() * mm, mergerGeo.getSingleMergeEnvelopePosition().Y() * mm,
1112  mergerGeo.getSingleMergeEnvelopePosition().Z() * mm);
1113  G4RotationMatrix RaPCB;
1114  G4ThreeVector TaMergerCooling(mergerGeo.getSingleMergeEnvelopePosition().X() * mm,
1115  mergerGeo.getSingleMergeEnvelopePosition().Y() * mm, -mergerGeo.getSingleMergeEnvelopePosition().Z() * mm);
1116  G4RotationMatrix RaMergerCooling;
1117  RaMergerCooling.rotateY(180 * deg);
1118  RaMergerCooling.rotateZ(-90 * deg);
1119 
1120  // build 12 different merger+cooling body volumes
1121  for (int iType = 1; iType < 13; iType++) {
1122  mergerCooling_logical[iType - 1] = buildMergerCooling(iType);
1123  mergerEnvelope_logical[iType - 1 ] = buildMergerEnvelope(mergerGeo, iType); //Single merger and merger cooling body envelope box
1124  setColor(*mergerEnvelope_logical[iType - 1], "rgb(0.0,0.0,1.0,1.0)");
1125 
1126  new G4PVPlacement(G4Transform3D(RaPCB, TaPCB), //Transformation
1127  merger_logical, //its logical volume
1128  "ARICH.mergerPCB", //its name
1129  mergerEnvelope_logical[iType - 1], //its mother volume
1130  false, //no boolean operation
1131  iType); //copy number
1132 
1133  if (mergerCooling_logical[iType - 1] == NULL) continue;
1134 
1135  new G4PVPlacement(G4Transform3D(RaMergerCooling, TaMergerCooling), //Transformation
1136  mergerCooling_logical[iType - 1], //its logical volume
1137  "ARICH.mergerCooling", //its name
1138  mergerEnvelope_logical[iType - 1], //its mother volume
1139  false, //no boolean operation
1140  iType); //copy number
1141  }
1142 
1143  // place all 72 merger+cooling body packages
1144  for (unsigned iSlot = 0; iSlot < mergerGeo.getMergerSlotID().size(); iSlot++) {
1145 
1146  int type = 1; // if no merger cooling is available...
1147  if (m_mergerCooling) type = (int)m_mergerCooling->getMergerCoolingPositionID().at(iSlot);
1148 
1149  //Placement of the single volume envelope
1150  G4ThreeVector Ta(mergerGeo.getMergerPosR().at(iSlot) * mm * cos(mergerGeo.getMergerAngle().at(iSlot) * deg),
1151  mergerGeo.getMergerPosR().at(iSlot) * mm * sin(mergerGeo.getMergerAngle().at(iSlot) * deg),
1152  mergerGeo.getSingleMergerenvelopeDeltaZ().at(iSlot) * mm);
1153  G4RotationMatrix Ra;
1154  Ra.rotateZ(mergerGeo.getMergerAngle().at(iSlot) * deg + mergerGeo.getMergerOrientation().at(iSlot) * deg);
1155  new G4PVPlacement(G4Transform3D(Ra, Ta), //Transformation
1156  mergerEnvelope_logical[type - 1], //its logical volume
1157  "ARICH.singleMergerEnvelope", //its name
1158  envelope_logical, //its mother volume
1159  false, //no boolean operation
1160  iSlot); //copy number
1161  }
1162 
1163  return envelope_logical;
1164 
1165  }
1166 
1167  G4LogicalVolume* GeoARICHCreator::buildCables(const ARICHGeoCablesEnvelope& cablesGeo)
1168  {
1169 
1170  G4Tubs* cablesEnvelope_solid = new G4Tubs("cablesEnvelope_solid",
1171  cablesGeo.getEnvelopeInnerRadius(),
1172  cablesGeo.getEnvelopeOuterRadius(),
1173  cablesGeo.getEnvelopeThickness() / 2.0,
1174  0.0,
1175  2.0 * M_PI);
1176  G4LogicalVolume* cablesEnvelope_logical = new G4LogicalVolume(cablesEnvelope_solid,
1178  "ARICH.cablesEnvelope");
1179 
1180  return cablesEnvelope_logical;
1181 
1182  }
1183 
1184  G4LogicalVolume* GeoARICHCreator::buildFEBCoolingBody(const ARICHGeoFEBCooling& coolingv2Geo)
1185  {
1186 
1187  //FEB aluminum cooling envelope for single object
1188  double feb_alcooling_singleObjectEnvelope_sizeX = (2 * coolingv2Geo.getSmallSquareSize() + coolingv2Geo.getBigSquareSize() + 2.0) *
1189  mm;
1190  double feb_alcooling_singleObjectEnvelope_sizeY = feb_alcooling_singleObjectEnvelope_sizeX * mm;
1191  double feb_alcooling_singleObjectEnvelope_sizeZ = (coolingv2Geo.getSmallSquareThickness() + coolingv2Geo.getRectangleThickness()) *
1192  mm;
1193 
1194  double feb_alcooling_box1_sizeX = coolingv2Geo.getSmallSquareSize() * mm;
1195  double feb_alcooling_box1_sizeY = feb_alcooling_box1_sizeX;
1196  double feb_alcooling_box1_sizeZ = coolingv2Geo.getSmallSquareThickness() * mm;
1197 
1198  double feb_alcooling_box2_sizeX = coolingv2Geo.getBigSquareSize() * mm;
1199  double feb_alcooling_box2_sizeY = feb_alcooling_box2_sizeX;
1200  double feb_alcooling_box2_sizeZ = coolingv2Geo.getBigSquareThickness() * mm;
1201 
1202  double feb_alcooling_box3_sizeX = coolingv2Geo.getRectangleW() * mm;
1203  double feb_alcooling_box3_sizeY = coolingv2Geo.getRectangleL() * mm;
1204  double feb_alcooling_box3_sizeZ = coolingv2Geo.getRectangleThickness() * mm;
1205 
1206  double feb_alcooling_box1_X0 = feb_alcooling_box2_sizeX / 2.0 + feb_alcooling_box1_sizeX / 2.0;
1207  double feb_alcooling_box1_Y0 = feb_alcooling_box2_sizeY / 2.0 + feb_alcooling_box1_sizeY / 2.0;
1208  double feb_alcooling_box1_Z0 = 0.0 * mm;
1209 
1210  //double feb_alcooling_box2_X0 = 0.0*mm;
1211  //double feb_alcooling_box2_Y0 = 0.0*mm;
1212  //double feb_alcooling_box2_Z0 = 0.0*mm;
1213 
1214  double feb_alcooling_box3_X0 = coolingv2Geo.getRectangleDistanceFromCenter() / sqrt(2.0) * mm;
1215  double feb_alcooling_box3_Y0 = feb_alcooling_box3_X0;
1216  double feb_alcooling_box3_Z0 = feb_alcooling_box1_sizeZ / 2.0 + feb_alcooling_box3_sizeZ / 2.0;
1217  double feb_alcooling_box3_angle = 45.0 * deg;
1218 
1219  G4RotationMatrix Ra;
1220  G4ThreeVector Ta;
1221  G4Transform3D Tr;
1222 
1223  //
1224  // Define single FEB aluminum cooling envelope
1225  //
1226  G4VSolid* feb_alcoolingEnvelope_solid = new G4Box("feb_alcoolingEnvelope_solid",
1227  feb_alcooling_singleObjectEnvelope_sizeX / 2.0,
1228  feb_alcooling_singleObjectEnvelope_sizeY / 2.0,
1229  feb_alcooling_singleObjectEnvelope_sizeZ / 2.0);
1230  G4LogicalVolume* feb_alcoolingEnvelope_logical = new G4LogicalVolume(feb_alcoolingEnvelope_solid, Materials::get("Air"),
1231  "feb_alcoolingEnvelope_logical");
1232 
1233  G4VSolid* feb_alcooling_box1_solid = new G4Box("feb_alcooling_box1_solid", feb_alcooling_box1_sizeX / 2.0,
1234  feb_alcooling_box1_sizeY / 2.0, feb_alcooling_box1_sizeZ / 2.0);
1235  G4VSolid* feb_alcooling_box2_solid = new G4Box("feb_alcooling_box2_solid", feb_alcooling_box2_sizeX / 2.0,
1236  feb_alcooling_box2_sizeY / 2.0, feb_alcooling_box2_sizeZ / 2.0);
1237  G4VSolid* feb_alcooling_box3_solid = new G4Box("feb_alcooling_box3_solid", feb_alcooling_box3_sizeX / 2.0,
1238  feb_alcooling_box3_sizeY / 2.0, feb_alcooling_box3_sizeZ / 2.0);
1239 
1240  //
1241  //Box 1 A
1242  //
1243  Ta.setX(feb_alcooling_box1_X0);
1244  Ta.setY(feb_alcooling_box1_Y0);
1245  Ta.setZ(feb_alcooling_box1_Z0);
1246  Tr = G4Transform3D(Ra, Ta);
1247  G4UnionSolid* feb_alcooling_assembly01_solid = new G4UnionSolid("feb_alcooling_assembly01_solid", feb_alcooling_box2_solid,
1248  feb_alcooling_box1_solid, Tr);
1249  //
1250  //Box 1 B
1251  //
1252  Ta.setX(-feb_alcooling_box1_X0);
1253  Ta.setY(-feb_alcooling_box1_Y0);
1254  Ta.setZ(feb_alcooling_box1_Z0);
1255  Tr = G4Transform3D(Ra, Ta);
1256  G4UnionSolid* feb_alcooling_assembly02_solid = new G4UnionSolid("feb_alcooling_assembly02_solid", feb_alcooling_assembly01_solid,
1257  feb_alcooling_box1_solid, Tr);
1258  //
1259  //Box 3 A
1260  //
1261  Ta.setX(feb_alcooling_box3_X0);
1262  Ta.setY(feb_alcooling_box3_Y0);
1263  Ta.setZ(feb_alcooling_box3_Z0);
1264  Ra.rotateZ(-feb_alcooling_box3_angle);
1265  Tr = G4Transform3D(Ra, Ta);
1266  G4UnionSolid* feb_alcooling_assembly03_solid = new G4UnionSolid("feb_alcooling_assembly03_solid", feb_alcooling_assembly02_solid,
1267  feb_alcooling_box3_solid, Tr);
1268  Ra.rotateZ(feb_alcooling_box3_angle);
1269  //
1270  //Box 3 B
1271  //
1272  Ta.setX(-feb_alcooling_box3_X0);
1273  Ta.setY(-feb_alcooling_box3_Y0);
1274  Ta.setZ(feb_alcooling_box3_Z0);
1275  Ra.rotateZ(-feb_alcooling_box3_angle);
1276  Tr = G4Transform3D(Ra, Ta);
1277  G4UnionSolid* feb_alcooling_assembly_solid = new G4UnionSolid("feb_alcooling_assembly_solid", feb_alcooling_assembly03_solid,
1278  feb_alcooling_box3_solid, Tr);
1279  Ra.rotateZ(feb_alcooling_box3_angle);
1280 
1281  G4LogicalVolume* feb_alcooling_assembly_logical = new G4LogicalVolume(feb_alcooling_assembly_solid, Materials::get("Al"),
1282  "feb_alcooling_assembly_logical");
1283  Ta.setX(0.0);
1284  Ta.setY(0.0);
1285  Ta.setZ(-feb_alcooling_box3_sizeZ / 2.0);
1286 
1287  Tr = G4Transform3D(Ra, Ta);
1288  new G4PVPlacement(Tr, //Transformation
1289  feb_alcooling_assembly_logical, //its logical volume
1290  "feb_alcooling_assembly", //its name
1291  feb_alcoolingEnvelope_logical, //its mother volume
1292  false, //no boolean operation
1293  0); //copy number
1294 
1295  return feb_alcoolingEnvelope_logical;
1296  }
1297 
1298  G4LogicalVolume* GeoARICHCreator::buildCoolingTube(const unsigned i_volumeID, const ARICHGeoCooling& coolingGeo)
1299  {
1300 
1301  B2ASSERT("ARICH cooling geometry ID (G4Tube) is wrong : coolingGeo.getCoolingGeometryID.at(i_volumeID) != 1",
1302  coolingGeo.getCoolingGeometryID().at(i_volumeID) == 1);
1303  G4Tubs* coolingTube_solid = new G4Tubs("coolingTube_solid",
1304  coolingGeo.getRmin() * mm,
1305  coolingGeo.getRmax() * mm,
1306  coolingGeo.getCoolingL().at(i_volumeID) * mm / 2.0,
1307  0.0,
1308  2.0 * M_PI);
1309  return new G4LogicalVolume(coolingTube_solid, Materials::get(coolingGeo.getCoolingPipeMaterialName()), "ARICH.coolingTube");
1310 
1311  }
1312 
1313  G4LogicalVolume* GeoARICHCreator::buildCoolingTorus(const unsigned i_volumeID, const ARICHGeoCooling& coolingGeo)
1314  {
1315 
1316  B2ASSERT("ARICH cooling geometry ID (G4Torus) is wrong : coolingGeo.getCoolingGeometryID.at(i_volumeID) != 2",
1317  coolingGeo.getCoolingGeometryID().at(i_volumeID) == 2);
1318 
1319  double pSPhi = coolingGeo.getCoolingPosPhi().at(i_volumeID) * deg - coolingGeo.getCoolingL().at(
1320  i_volumeID) / coolingGeo.getCoolingPosR().at(i_volumeID) / 2.0;
1321  //double pDPhi = coolingGeo.getCoolingPosPhi().at(i_volumeID)*deg + coolingGeo.getCoolingL().at(i_volumeID) / coolingGeo.getCoolingPosR().at(i_volumeID) / 2.0;
1322  double pDPhi = coolingGeo.getCoolingL().at(i_volumeID) / coolingGeo.getCoolingPosR().at(i_volumeID);
1323 
1324  G4Torus* coolingTorus_solid = new G4Torus("coolingTorus_solid", // name
1325  coolingGeo.getRmin(), // pRmin
1326  coolingGeo.getRmax(), // pRmax
1327  coolingGeo.getCoolingPosR().at(i_volumeID), // pRtor
1328  pSPhi, // pSPhi
1329  pDPhi); // pDPhi
1330 
1331  return new G4LogicalVolume(coolingTorus_solid, Materials::get(coolingGeo.getCoolingPipeMaterialName()), "ARICH.coolingTorus");
1332 
1333  }
1334 
1336  {
1337 
1338  G4Tubs* coolingEnvelope_solid = new G4Tubs("coolingEnvelope_solid",
1339  coolingGeo.getEnvelopeInnerRadius(),
1340  coolingGeo.getEnvelopeOuterRadius(),
1341  coolingGeo.getEnvelopeThickness() / 2.0,
1342  0.0,
1343  2.0 * M_PI);
1344  G4LogicalVolume* coolingEnvelope_logical = new G4LogicalVolume(coolingEnvelope_solid,
1345  Materials::get("Air"),
1346  "ARICH.coolingEnvelope");
1347 
1348  unsigned nComponents = coolingGeo.getCoolingGeometryID().size();
1349 
1350  for (unsigned i = 0; i < nComponents; i++) {
1351  double r = coolingGeo.getCoolingPosR().at(i) * mm;
1352  double phi = coolingGeo.getCoolingPosPhi().at(i) * deg;
1353  G4ThreeVector Ta;
1354  G4RotationMatrix Ra;
1355  G4LogicalVolume* coolingComponentLV;
1356  if (coolingGeo.getCoolingGeometryID().at(i) == 1) {
1357  //<!-- 1 -> G4Tubs --> build a tube
1358  Ta.set(r * cos(phi), r * sin(phi), 0);
1359  //First need to rotate around y axis
1360  //to make the tube parallel with x axis
1361  Ra.rotateY(90.0 * deg);
1362  Ra.rotateZ(coolingGeo.getCoolinRotationAngle().at(i) * deg);
1363  coolingComponentLV = buildCoolingTube(i, coolingGeo);
1364  } else if (coolingGeo.getCoolingGeometryID().at(i) == 2) {
1365  //<!-- 2 -> G4Torus --> build a torus
1366  coolingComponentLV = buildCoolingTorus(i, coolingGeo);
1367  } else {
1368  B2FATAL("ARICH cooling geometry component ID is wrong");
1369  }
1370  new G4PVPlacement(G4Transform3D(Ra, Ta), //Transformation
1371  coolingComponentLV, //its logical volume
1372  "ARICH.cooling", //its name
1373  coolingEnvelope_logical, //its mother volume
1374  false, //no boolean operation
1375  i); //copy number
1376  }
1377 
1378  return coolingEnvelope_logical;
1379 
1380  }
1381 
1382  G4LogicalVolume* GeoARICHCreator::buildCoolingTestPlate(const ARICHGeoCooling& coolingGeo)
1383  {
1384 
1385  G4Box* coolingTestPlateEnvelop_solid = new G4Box("coolingTestPlateEnvelop_solid",
1386  coolingGeo.getCoolingTestPlateslengths().X() / 2.0 * mm,
1387  coolingGeo.getCoolingTestPlateslengths().Y() / 2.0 * mm,
1388  coolingGeo.getCoolingTestPlateslengths().Z() / 2.0 * mm);
1389  G4LogicalVolume* coolingTestPlateEnvelop_logical = new G4LogicalVolume(coolingTestPlateEnvelop_solid, Materials::get("Air"),
1390  "ARICH.coolingTestPlateEnvelop");
1391 
1392  G4Box* coolingTestPlate_solid = new G4Box("coolingTestPlate_solid",
1393  coolingGeo.getCoolingTestPlateslengths().X() / 2.0 * mm,
1394  coolingGeo.getCoolingTestPlateslengths().Y() / 2.0 * mm,
1395  coolingGeo.getCoolingTestPlateslengths().Z() / 2.0 * mm);
1396 
1397  // Volume to subtract
1398  G4VSolid* coldTubeSubtracted_solid = new G4Tubs("coldTubeSubtracted_solid",
1399  0.0,
1400  coolingGeo.getColdTubeSubtractedR() * mm,
1401  (coolingGeo.getCoolingTestPlateslengths().X() + 1) / 2.0 * mm,
1402  0, 360.0 * deg);
1403 
1404  // Volume to add (cold tube)
1405  G4VSolid* coldTube_solid = new G4Tubs("coldTube_solid",
1406  (coolingGeo.getColdTubeR() - coolingGeo.getColdTubeWallThickness()) * mm,
1407  coolingGeo.getColdTubeR() * mm,
1408  coolingGeo.getCoolingTestPlateslengths().X() / 2.0 * mm,
1409  0, 360.0 * deg);
1410  G4LogicalVolume* coldTube_logical = new G4LogicalVolume(coldTube_solid, Materials::get(coolingGeo.getColdTubeMaterialName()),
1411  "ARICH.coldTube");
1412 
1413  G4RotationMatrix Ra_sub;
1414  G4ThreeVector Ta_sub;
1415  G4Transform3D Tr_sub;
1416  Ta_sub.setX(0.0);
1417  Ta_sub.setY((coolingGeo.getCoolingTestPlateslengths().Y() / 2.0 - coolingGeo.getColdTubeSpacing()) * mm);
1418  Ta_sub.setZ((coolingGeo.getCoolingTestPlateslengths().Z() / 2.0 - coolingGeo.getDepthColdTubeInPlate()) * mm);
1419  Ra_sub.rotateY(90.0 * deg);
1420  Tr_sub = G4Transform3D(Ra_sub, Ta_sub);
1421  G4SubtractionSolid* substraction_solid = new G4SubtractionSolid("substraction_solid", coolingTestPlate_solid,
1422  coldTubeSubtracted_solid, Tr_sub);
1423  for (int i = 1; i < coolingGeo.getColdTubeNumber(); i++) {
1424  Ta_sub.setX(0.0);
1425  Ta_sub.setY((coolingGeo.getCoolingTestPlateslengths().Y() / 2.0 - coolingGeo.getColdTubeSpacing() - coolingGeo.getColdTubeSpacing()
1426  * 2 * i) * mm);
1427  Ta_sub.setZ((coolingGeo.getCoolingTestPlateslengths().Z() / 2.0 - coolingGeo.getDepthColdTubeInPlate()) * mm);
1428  Tr_sub = G4Transform3D(Ra_sub, Ta_sub);
1429  substraction_solid = new G4SubtractionSolid("substraction_solid", substraction_solid, coldTubeSubtracted_solid, Tr_sub);
1430  }
1431 
1432  G4LogicalVolume* coolingTestPlate_logical = new G4LogicalVolume(substraction_solid,
1433  Materials::get(coolingGeo.getCoolingTestPlateMaterialName()), "ARICH.coolingTestPlate");
1434 
1435  new G4PVPlacement(G4Transform3D(), //Transformation
1436  coolingTestPlate_logical, //its logical volume
1437  "ARICH.coolingTestPlate", //its name
1438  coolingTestPlateEnvelop_logical, //its mother volume
1439  false, //no boolean operation
1440  0); //copy number
1441  //Add cold tubes
1442  G4RotationMatrix Ra;
1443  G4ThreeVector Ta;
1444  G4Transform3D Tr;
1445  Ra.rotateY(90.0 * deg);
1446  for (int i = 0; i < coolingGeo.getColdTubeNumber(); i++) {
1447  Ta.setX(0.0);
1448  Ta.setY((coolingGeo.getCoolingTestPlateslengths().Y() / 2.0 - coolingGeo.getColdTubeSpacing() - coolingGeo.getColdTubeSpacing() *
1449  2 * i) * mm);
1450  Ta.setZ((coolingGeo.getCoolingTestPlateslengths().Z() / 2.0 - coolingGeo.getDepthColdTubeInPlate()) * mm);
1451  Tr = G4Transform3D(Ra, Ta);
1452  new G4PVPlacement(Tr, //Transformation
1453  coldTube_logical, //its logical volume
1454  "ARICH.coldTube", //its name
1455  coolingTestPlateEnvelop_logical, //its mother volume
1456  false, //no boolean operation
1457  0); //copy number
1458  }
1459 
1460  return coolingTestPlateEnvelop_logical;
1461 
1462  }
1463 
1465  {
1466 
1467  const ARICHGeoDetectorPlane& detGeo = detectorGeo.getDetectorPlane();
1468 
1469  G4Tubs* supportTube = new G4Tubs("supportTube", detGeo.getSupportInnerR(), detGeo.getSupportOuterR(),
1470  (detGeo.getSupportThickness() + detGeo.getSupportBackWallHeight()) / 2., 0, 2 * M_PI);
1471  G4Material* supportMaterial = Materials::get(detGeo.getSupportMaterial());
1472  G4LogicalVolume* detSupportLV = new G4LogicalVolume(supportTube, supportMaterial, "ARICH.detectorSupportPlate");
1473 
1474  G4Tubs* supportPlate = new G4Tubs("supportPlate", detGeo.getSupportInnerR(), detGeo.getSupportOuterR(),
1475  detGeo.getSupportThickness() / 2., 0, 2 * M_PI);
1476 
1477  G4Box* hole = new G4Box("hole", detGeo.getModuleHoleSize() / 2., detGeo.getModuleHoleSize() / 2.,
1478  detGeo.getSupportThickness() / 2.); // +1 for thickness for subtraction solid
1479  G4LogicalVolume* holeLV = new G4LogicalVolume(hole, Materials::get("Air"), "ARICH.detectorSupportHole");
1480 
1481  int nRings = detGeo.getNRings();
1482  std::vector<G4LogicalVolume*> hapdBackRadialWallLV;
1483  double backWallThick = detGeo.getSupportBackWallThickness();
1484  double backWallHeight = detGeo.getSupportBackWallHeight();
1485 
1486  G4LogicalVolume* hapdSupportPlateLV = new G4LogicalVolume(supportPlate, supportMaterial, "hapdSupport");
1487 
1488  std::vector<double> wallR;
1489  wallR.assign(nRings + 1, 0);
1490  std::vector<double> thickR;
1491  thickR.assign(nRings + 1, 0);
1492 
1493  for (int i = 1; i < nRings; i++) {
1494  double rm1 = detGeo.getRingR(i);
1495  double rp1 = detGeo.getRingR(i + 1);
1496  wallR[i] = (rp1 + rm1) / 2.;
1497  if (i == 1) {
1498  wallR[0] = rm1 - (rp1 - rm1) / 2.;
1499  }
1500  if (i == nRings - 1) {
1501  wallR[i + 1] = rp1 + (rp1 - rm1) / 2.;
1502  }
1503  }
1504 
1505  for (int i = 0; i < nRings + 1; i++) {
1506  std::stringstream ringName1;
1507  ringName1 << "backWall_" << i;
1508  thickR[i] = backWallThick;
1509  if (i == nRings) {
1510  thickR[i] = 2.*backWallThick;
1511  wallR[i] = detGeo.getSupportOuterR() - thickR[i] / 2.;
1512  }
1513  G4Tubs* backTube = new G4Tubs("hapdBackRing", wallR[i] - thickR[i] / 2., wallR[i] + thickR[i] / 2., backWallHeight / 2., 0,
1514  2 * M_PI);
1515  G4LogicalVolume* hapdBackTubeLV = new G4LogicalVolume(backTube, supportMaterial, "backTube");
1516  G4Transform3D transform3 = G4Translate3D(0., 0., detGeo.getSupportThickness() / 2.);
1517  new G4PVPlacement(transform3, hapdBackTubeLV, "backTube", detSupportLV, false, 1);
1518  if (i == 0) continue;
1519 
1520  G4Box* backRadial = new G4Box("backRadialBox", (wallR[i] - wallR[i - 1] - thickR[i] / 2. - thickR[i - 1] / 2.) / 2. - 1.,
1521  backWallThick / 2., backWallHeight / 2.);
1522  hapdBackRadialWallLV.push_back(new G4LogicalVolume(backRadial, supportMaterial, ringName1.str().c_str()));
1523  }
1524 
1525  G4SubtractionSolid* substraction = NULL;
1526  unsigned nSlots = detGeo.getNSlots();
1527 
1528  if (nSlots > detectorGeo.getFEBCoolingGeometry().getFebcoolingv2GeometryID().size()) {
1529  B2WARNING("GeoARICHCreator: No FEB colling body geometry available so they will not be placed (ARICHGeometryConfig with ClasDef>4 is needed).");
1530  return detSupportLV;
1531  }
1532 
1533  // drill holes in support plate
1534  // add FEB cooling bodies
1535  for (unsigned iSlot = 1; iSlot < nSlots + 1; iSlot++) {
1536  unsigned iRing = detGeo.getSlotRing(iSlot);
1537  double r = (wallR[iRing] + wallR[iRing - 1]) / 2. - (thickR[iRing] - thickR[iRing - 1]) / 2.;
1538 
1539  double phi = detGeo.getSlotPhi(iSlot);
1540  G4ThreeVector trans(r * cos(phi), r * sin(phi), 0);
1541  G4RotationMatrix Ra;
1542  Ra.rotateZ(phi);
1543 
1544  new G4PVPlacement(G4Transform3D(Ra, trans), holeLV, "hole", hapdSupportPlateLV, false, iSlot);
1545  if (substraction) substraction = new G4SubtractionSolid("Box+CylinderMoved", substraction, hole, G4Transform3D(Ra, trans));
1546  else substraction = new G4SubtractionSolid("Box+CylinderMoved", supportPlate, hole, G4Transform3D(Ra, trans));
1547 
1548  phi = phi + detGeo.getRingDPhi(iRing) / 2.;
1549  G4ThreeVector transBack(r * cos(phi), r * sin(phi), detGeo.getSupportThickness() / 2.);
1550  G4RotationMatrix RaBack;
1551  RaBack.rotateZ(phi);
1552  new G4PVPlacement(G4Transform3D(RaBack, transBack), hapdBackRadialWallLV[iRing - 1], "hapdBack", detSupportLV, false, iSlot);
1553 
1554  // add FEB cooling bodies
1555  G4ThreeVector febCoolingTa;
1556  G4Transform3D febCoolingTr;
1557  febCoolingTa.setX(r * cos(detGeo.getSlotPhi(iSlot)));
1558  febCoolingTa.setY(r * sin(detGeo.getSlotPhi(iSlot)));
1559 
1560  double supportTube_envelope_dZ = (detGeo.getSupportThickness() + detGeo.getSupportBackWallHeight());
1561  double febCooling_envelope_dZ = (detectorGeo.getFEBCoolingGeometry().getBigSquareThickness() +
1563  double febCooling_envelope_Z0 = -supportTube_envelope_dZ / 2.0 + febCooling_envelope_dZ / 2.0 + detGeo.getSupportThickness();
1564  febCoolingTa.setZ(febCooling_envelope_Z0);
1565 
1566  int febcoolingv2GeometryID = detectorGeo.getFEBCoolingGeometry().getFebcoolingv2GeometryID().at(iSlot - 1);
1567 
1568  if (febcoolingv2GeometryID == 2) Ra.rotateZ(90.0 * deg);
1569 
1570  febCoolingTr = G4Transform3D(Ra, febCoolingTa);
1571 
1572  if (febcoolingv2GeometryID != 0) {
1573  G4LogicalVolume* febCoolingLV = buildFEBCoolingBody(detectorGeo.getFEBCoolingGeometry());
1574 
1575  new G4PVPlacement(febCoolingTr, //Transformation
1576  febCoolingLV, //its logical volume
1577  "febCoolingLV", //its name
1578  detSupportLV, //its mother volume
1579  false, //no boolean operation
1580  iSlot); //copy number
1581  }
1582  }
1583 
1584  // G4LogicalVolume* hapdSupportPlateLV = new G4LogicalVolume(substraction, supportMaterial, "hapdSupport");
1585 
1586  G4Transform3D transform3 = G4Translate3D(0., 0., - backWallHeight / 2.);
1587  new G4PVPlacement(transform3, hapdSupportPlateLV, "supportPlate", detSupportLV, false, 1);
1588 
1589  // place electronics side neutron shield - for now hardcoded here, pending for more proper implementation!
1590  G4Box* shieldBox1 = new G4Box("shieldBox1", 20. / 2., 75. / 2., backWallHeight / 2.);
1591  G4Box* shieldBox2 = new G4Box("shieldBox2", 55. / 2., 40. / 2., backWallHeight / 2.);
1592  G4LogicalVolume* shield1 = new G4LogicalVolume(shieldBox1, Materials::get("BoratedPoly"), "ARICH.FWDShield1");
1593  G4LogicalVolume* shield2 = new G4LogicalVolume(shieldBox2, Materials::get("BoratedPoly"), "ARICH.FWDShield2");
1594  double dphi = 2 * M_PI / 36.;
1595  double r1 = wallR[0] - 15.;
1596  double r2 = wallR[0] - 15. - 20. / 2. - 55. / 2.;
1597  for (int i = 0; i < 36; i++) {
1598  double phi = (i + 0.5) * dphi;
1599  G4RotationMatrix rot;
1600  rot.rotateZ(phi);
1601  G4ThreeVector trans(r1 * cos(phi), r1 * sin(phi), detGeo.getSupportThickness() / 2.);
1602  G4ThreeVector trans1(r2 * cos(phi), r2 * sin(phi), detGeo.getSupportThickness() / 2.);
1603  new G4PVPlacement(G4Transform3D(rot, trans), shield1, "ARICH.FWDShield1", detSupportLV, false, i);
1604  new G4PVPlacement(G4Transform3D(rot, trans1), shield2, "ARICH.FWDShield2", detSupportLV, false, i);
1605  }
1606 
1607  return detSupportLV;
1608  }
1609 
1610 
1611  G4LogicalVolume* GeoARICHCreator::buildMirror(const ARICHGeometryConfig& detectorGeo)
1612  {
1613 
1614  const ARICHGeoMirrors& mirrGeo = detectorGeo.getMirrors();
1615 
1616  // read m_config
1617  string mirrMat = mirrGeo.getMaterial();
1618  G4Material* mirrorMaterial = Materials::get(mirrMat);
1619 
1620  double mThick = mirrGeo.getPlateThickness();
1621  double mLength = mirrGeo.getPlateLength();
1622  double mWidth = mirrGeo.getPlateWidth();
1623 
1624  G4Box* mirrPlate = new G4Box("mirrPlate", mThick / 2., mLength / 2., mWidth / 2.);
1625 
1626  G4LogicalVolume* lmirror = new G4LogicalVolume(mirrPlate, mirrorMaterial, "ARICH.mirrorPlate");
1627 
1628  Materials& materials = Materials::getInstance();
1629 
1630  G4OpticalSurface* optSurf = materials.createOpticalSurface(mirrGeo.getMirrorSurface());
1631  new G4LogicalSkinSurface("mirrorSurface", lmirror, optSurf);
1632 
1633  return lmirror;
1634 
1635  }
1636 
1637  double GeoARICHCreator::getAvgRINDEX(G4Material* material)
1638  {
1639  G4MaterialPropertiesTable* mTable = material->GetMaterialPropertiesTable();
1640  if (!mTable) return 0;
1641  G4MaterialPropertyVector* mVector = mTable->GetProperty("RINDEX");
1642  if (!mVector) return 0;
1643  G4bool b;
1644  return mVector->GetValue(2 * Unit::eV / Unit::MeV, b);
1645  }
1646 
1647  G4AssemblyVolume* GeoARICHCreator::makeJoint(G4Material* supportMaterial, const std::vector<double>& par)
1648  {
1649 
1650  int size = par.size();
1651  if (size < 4 || size > 8) B2ERROR("GeoARICHCreator::makeJoint: invalid number of joint wedge parameters");
1652  double lenx = par.at(0);
1653  double leny = par.at(1);
1654  double lenz = par.at(2);
1655  double thick = par.at(3);
1656 
1657  G4Box* wedgeBox1 = new G4Box("wedgeBox1", thick / 2., lenx / 2., leny / 2.);
1658  G4Box* wedgeBox2 = new G4Box("wedgeBox2", lenz / 2., lenx / 2., thick / 2.);
1659 
1660  G4LogicalVolume* wedgeBox1LV = new G4LogicalVolume(wedgeBox1, supportMaterial, "ARICH.supportWedge");
1661  G4LogicalVolume* wedgeBox2LV = new G4LogicalVolume(wedgeBox2, supportMaterial, "ARICH.supportWedge");
1662 
1663  G4AssemblyVolume* assemblyWedge = new G4AssemblyVolume();
1664 
1665  G4RotationMatrix Rm;
1666  G4ThreeVector Ta(0, 0, 0);
1667  G4Transform3D Tr;
1668  Tr = G4Transform3D(Rm, Ta);
1669 
1670  assemblyWedge->AddPlacedVolume(wedgeBox1LV, Tr);
1671 
1672  Ta.setX(lenz / 2. + thick / 2.);
1673  Ta.setZ(leny / 2. - thick / 2.);
1674  Tr = G4Transform3D(Rm, Ta);
1675  assemblyWedge->AddPlacedVolume(wedgeBox2LV, Tr);
1676 
1677  if (size == 4) return assemblyWedge;
1678  double edge = par.at(4);
1679 
1680  G4Box* wedgeBox3 = new G4Box("wedgeBox3", lenz / 2., edge / 2., thick / 2.);
1681  G4LogicalVolume* wedgeBox3LV = new G4LogicalVolume(wedgeBox3, supportMaterial, "ARICH.supportWedge");
1682 
1683  Ta.setZ(leny / 2. - thick - thick / 2.);
1684  Tr = G4Transform3D(Rm, Ta);
1685  assemblyWedge->AddPlacedVolume(wedgeBox3LV, Tr);
1686 
1687  G4Trap* wedgeBoxTmp = new G4Trap("wedgeBoxTmp", thick, leny - 2 * thick, lenz, edge);
1688  G4LogicalVolume* wedgeBox4LV;
1689  if (size == 8) {
1690  G4Tubs* wedgeBoxTmp1 = new G4Tubs("wedgeBoxTmp1", 0.0, par.at(5), thick, 0, 2.*M_PI);
1691  G4RotationMatrix rotHole;
1692  G4ThreeVector transHole(par.at(6), par.at(7), 0);
1693  G4SubtractionSolid* wedgeBox4 = new G4SubtractionSolid("wedgeBox4", wedgeBoxTmp, wedgeBoxTmp1, G4Transform3D(rotHole, transHole));
1694  wedgeBox4LV = new G4LogicalVolume(wedgeBox4, supportMaterial, "ARICH.supportWedge");
1695  } else wedgeBox4LV = new G4LogicalVolume(wedgeBoxTmp, supportMaterial, "ARICH.supportWedge");
1696 
1697  Rm.rotateX(-M_PI / 2.);
1698  Ta.setX(thick / 2. + edge / 4. + lenz / 4.);
1699  Ta.setZ(-thick / 2. - edge / 2.);
1700  Tr = G4Transform3D(Rm, Ta);
1701  assemblyWedge->AddPlacedVolume(wedgeBox4LV, Tr);
1702 
1703  return assemblyWedge;
1704 
1705  }
1706 
1707  // simple geometry for beamtest setup
1708  /* void GeoARICHCreator::createSimple(const GearDir& content, G4LogicalVolume& topVolume)
1709  {
1710 
1711  B2INFO("ARICH simple (beamtest) geometry will be built.")
1712  GearDir envelopeParams(content, "Envelope");
1713  double xSize = envelopeParams.getLength("xSize") / Unit::mm;
1714  double ySize = envelopeParams.getLength("ySize") / Unit::mm;
1715  double zSize = envelopeParams.getLength("zSize") / Unit::mm;
1716  string envMat = envelopeParams.getString("material");
1717  G4Material* envMaterial = Materials::get(envMat);
1718 
1719  G4Box* envBox = new G4Box("envBox", xSize / 2., ySize / 2., zSize / 2.);
1720  G4LogicalVolume* lenvBox = new G4LogicalVolume(envBox, envMaterial, "ARICH.envelope");
1721  new G4PVPlacement(G4Transform3D(), lenvBox, "ARICH.envelope", &topVolume, false, 1);
1722  setVisibility(*lenvBox, false);
1723  ARICHGeometryPar* m_arichgp = ARICHGeometryPar::Instance();
1724  m_arichgp->Initialize(content);
1725  GearDir moduleParam(content, "Detector/Module");
1726  G4LogicalVolume* detModule = buildModule(moduleParam);
1727 
1728  double detZpos = content.getLength("Detector/Plane/zPosition") / Unit::mm;
1729  double detThick = content.getLength("Detector/Module/moduleZSize") / Unit::mm;
1730  int nModules = m_arichgp->getNMCopies();
1731  for (int i = 1; i <= nModules; i++) {
1732  G4ThreeVector origin = m_arichgp->getOriginG4(i); origin.setZ(detZpos + detThick / 2.);
1733  double angle = m_arichgp->getModAngle(i);
1734  G4RotationMatrix Ra;
1735  Ra.rotateZ(angle);
1736  G4Transform3D trans = G4Transform3D(Ra, origin);
1737  new G4PVPlacement(G4Transform3D(Ra, origin), detModule, "detModule", lenvBox, false, i);
1738  }
1739 
1740  // place aerogel tiles
1741  GearDir aerogelParam(content, "Aerogel");
1742  double sizeX = aerogelParam.getLength("tileXSize") / Unit::mm;
1743  double sizeY = aerogelParam.getLength("tileYSize") / Unit::mm;
1744  double posX = aerogelParam.getLength("tileXPos") / Unit::mm;
1745  double posY = aerogelParam.getLength("tileYPos") / Unit::mm;
1746  int ilayer = 0;
1747  BOOST_FOREACH(const GearDir & layer, aerogelParam.getNodes("Layers/Layer")) {
1748  double posZ = layer.getLength("zPosition");
1749  double sizeZ = layer.getLength("thickness");
1750  string tileMat = layer.getString("material");
1751  G4Material* tileMaterial = Materials::get(tileMat);
1752  double rInd = getAvgRINDEX(tileMaterial);
1753  m_arichgp->setAeroRefIndex(ilayer, rInd);
1754  m_arichgp->setAerogelZPosition(ilayer, posZ);
1755  m_arichgp->setAerogelThickness(ilayer, sizeZ);
1756 
1757  G4MaterialPropertiesTable* mTable = tileMaterial->GetMaterialPropertiesTable();
1758  G4MaterialPropertyVector* mVector = mTable->GetProperty("RAYLEIGH");
1759  double lambda0 = 400;
1760  double e0 = 1240. / lambda0 * Unit::eV / Unit::MeV;
1761  G4bool b;
1762  m_arichgp->setAeroTransLength(ilayer, mVector->GetValue(e0, b)*Unit::mm);
1763  G4Box* tileBox = new G4Box("tileBox", sizeX / 2., sizeY / 2., sizeZ / 2. / Unit::mm);
1764  G4LogicalVolume* lTile = new G4LogicalVolume(tileBox, tileMaterial, "Tile", 0, m_sensitiveAero);
1765  setColor(*lTile, "rgb(0.0, 1.0, 1.0,1.0)");
1766  G4Transform3D trans = G4Translate3D(posX, posY, posZ / Unit::mm + sizeZ / 2. / Unit::mm);
1767  ilayer++;
1768  new G4PVPlacement(trans, lTile, "ARICH.tile", lenvBox, false, ilayer);
1769  }
1770 
1771  // place mirrors
1772  GearDir mirrorsParam(content, "Mirrors");
1773  double height = mirrorsParam.getLength("height") / Unit::mm;
1774  double width = mirrorsParam.getLength("width") / Unit::mm;
1775  double thickness = mirrorsParam.getLength("thickness") / Unit::mm;
1776  string mirrMat = mirrorsParam.getString("material");
1777  G4Material* mirrMaterial = Materials::get(mirrMat);
1778  G4Box* mirrBox = new G4Box("mirrBox", thickness / 2., height / 2., width / 2.);
1779  G4LogicalVolume* lmirror = new G4LogicalVolume(mirrBox, mirrMaterial, "mirror");
1780 
1781  Materials& materials = Materials::getInstance();
1782  GearDir surface(mirrorsParam, "Surface");
1783  G4OpticalSurface* optSurf = materials.createOpticalSurface(surface);
1784  new G4LogicalSkinSurface("mirrorsSurface", lmirror, optSurf);
1785  int iMirror = 0;
1786  BOOST_FOREACH(const GearDir & mirror, mirrorsParam.getNodes("Mirror")) {
1787  double xpos = mirror.getLength("xPos") / Unit::mm;
1788  double ypos = mirror.getLength("yPos") / Unit::mm;
1789  double zpos = mirror.getLength("zPos") / Unit::mm;
1790  double angle = mirror.getAngle("angle") / Unit::rad;
1791  G4ThreeVector origin(xpos, ypos, zpos + width / 2.);
1792  G4RotationMatrix Ra;
1793  Ra.rotateZ(angle);
1794  G4Transform3D trans = G4Transform3D(Ra, origin);
1795  new G4PVPlacement(G4Transform3D(Ra, origin), lmirror, "ARICH.mirror", lenvBox, false, iMirror);
1796  iMirror++;
1797  }
1798  }
1799  */
1800 
1801  } // namespace aricih
1803 } // namespace belleII
Belle2::ARICHGeoMirrors::getRadius
double getRadius() const
Get nominal radius at which mirror plates are placed (center of plate)
Definition: ARICHGeoMirrors.h:112
Belle2::ARICHGeoMerger::getEnvelopeInnerRadius
double getEnvelopeInnerRadius() const
Returns Inner radius of merger PCB assembly envelope.
Definition: ARICHGeoMerger.h:258
Belle2::ARICHPositionElement
Position element for ARICH.
Definition: ARICHPositionElement.h:36
Belle2::ARICHGeometryConfig
The Class for ARICH Geometry Parameters.
Definition: ARICHGeometryConfig.h:42
Belle2::ARICHGeoMirrors::getMaterial
const std::string & getMaterial() const
Get material name of mirror plates.
Definition: ARICHGeoMirrors.h:174
Belle2::ARICHGeometryConfig::getFEBCoolingGeometry
const ARICHGeoFEBCooling & getFEBCoolingGeometry() const
Get ARICH FEB cooling system (v2) geometry parameters.
Definition: ARICHGeometryConfig.h:146
Belle2::ARICHGeoCooling::getColdTubeMaterialName
const std::string & getColdTubeMaterialName() const
Returns material name of cold tube.
Definition: ARICHGeoCooling.h:278
Belle2::tessellatedSolidStr
Structure which holds apexes of the tessellation volumes.
Definition: tessellatedSolidStr.h:36
Belle2::ARICHGeoCooling::getColdTubeWallThickness
double getColdTubeWallThickness() const
Returns cold tube wall thickness.
Definition: ARICHGeoCooling.h:302
Belle2::ARICHGeoDetectorPlane::getRotationY
double getRotationY() const
Get angle of rotation around Y axis.
Definition: ARICHGeoDetectorPlane.h:145
Belle2::arich::GeoARICHCreator::m_config
ARICHGeometryConfig m_config
geometry configuration
Definition: GeoARICHCreator.h:163
Belle2::ARICHGeometryConfig::getDetectorPlane
const ARICHGeoDetectorPlane & getDetectorPlane() const
Get geometry configuration of HAPD plane.
Definition: ARICHGeometryConfig.h:92
Belle2::ARICHGeoMasterVolume::getMaterial
const std::string & getMaterial() const
Get material of ARICH master volume.
Definition: ARICHGeoMasterVolume.h:148
Belle2::ARICHGeoFEBCooling::getRectangleW
double getRectangleW() const
Returns width of the rectangle in mm.
Definition: ARICHGeoFEBCooling.h:143
Belle2::ARICHGeoMerger::getEnvelopeThickness
double getEnvelopeThickness() const
Returns Thickness of merger PCB assembly envelope.
Definition: ARICHGeoMerger.h:264
Belle2::ARICHGeoAerogelPlane::isSimple
bool isSimple() const
Use simple aerogel configuration.
Definition: ARICHGeoAerogelPlane.h:334
Belle2::ARICHGeoMirrors::getZPosition
double getZPosition() const
Get nominal Z position of mirror plates (center point in ARICH local frame)
Definition: ARICHGeoMirrors.h:106
Belle2::ARICHGeoAerogelPlane::getRotationY
double getRotationY() const
Get angle of rotation around Y axis.
Definition: ARICHGeoAerogelPlane.h:170
Belle2::ARICHGeoMirrors::getPlateWidth
double getPlateWidth() const
Get width of mirror plate.
Definition: ARICHGeoMirrors.h:130
Belle2::ARICHGeoDetectorPlane::getRotationZ
double getRotationZ() const
Get angle of rotation around Z axis.
Definition: ARICHGeoDetectorPlane.h:151
Belle2::ARICHGeoFEBCooling::getRectangleL
double getRectangleL() const
Returns length of the rectangle in mm.
Definition: ARICHGeoFEBCooling.h:137
Belle2::ARICHGeoHAPD::getFillMaterial
const std::string & getFillMaterial() const
Returns fill (inside) material name.
Definition: ARICHGeoHAPD.h:281
Belle2::ARICHGeoGlobalDisplacement::getBeta
double getBeta() const
Returns rotation angle around y.
Definition: ARICHGeoGlobalDisplacement.h:125
Belle2::ARICHGeoMerger::getEnvelopeCenterPosition
TVector3 getEnvelopeCenterPosition() const
Returns position vector (TVector3) of merger PCB assembly envelope.
Definition: ARICHGeoMerger.h:270
Belle2::ARICHGeoHAPD::getAPDSurface
const GeoOpticalSurface & getAPDSurface() const
Returns APD reflective optical surface.
Definition: ARICHGeoHAPD.h:305
Belle2::ARICHGeometryConfig::doBeamBackgroundStudy
int doBeamBackgroundStudy() const
returns 1 if beam background study (to add additional sensitive modules, detect neutrons,...
Definition: ARICHGeometryConfig.h:276
Belle2::ARICHGeoAerogelPlane::getRotationZ
double getRotationZ() const
Get angle of rotation around Z axis.
Definition: ARICHGeoAerogelPlane.h:176
Belle2::ARICHGeoFEBCooling::getFebcoolingv2GeometryID
const std::vector< double > & getFebcoolingv2GeometryID() const
Returns vector of feb cooling configuration/geometry ID.
Definition: ARICHGeoFEBCooling.h:161
Belle2::ARICHGeoCooling::getCoolingPosR
const std::vector< double > & getCoolingPosR() const
Returns vector of radial distance (r, pho) of the cooling system object center in polar coordinate sy...
Definition: ARICHGeoCooling.h:260
Belle2::ARICHGeoCablesEnvelope::getCablesEffectiveMaterialName
const std::string & getCablesEffectiveMaterialName() const
Returns Effective material name describing cables.
Definition: ARICHGeoCablesEnvelope.h:82
Belle2::ARICHGeoSupport::getWedgeZ
double getWedgeZ(unsigned i) const
Get Z position of i-th wedge.
Definition: ARICHGeoSupport.h:195
Belle2::ARICHGeoMasterVolume::getOuterRadius
double getOuterRadius() const
Get ARICH master volume outer radius.
Definition: ARICHGeoMasterVolume.h:136
Belle2::ARICHGeoDetectorPlane::getSlotR
double getSlotR(unsigned modID) const
Get radial position of module with given module ID number.
Definition: ARICHGeoDetectorPlane.h:222
Belle2::ARICHGeoCooling::getEnvelopeInnerRadius
double getEnvelopeInnerRadius() const
Returns Inner radius of cooling system assembly envelope.
Definition: ARICHGeoCooling.h:224
Belle2::arich::SensitiveDetector
The Class for ARICH Sensitive Detector.
Definition: SensitiveDetector.h:36
Belle2::geometry::setColor
void setColor(G4LogicalVolume &volume, const std::string &color)
Set the color of a logical volume.
Definition: utilities.cc:107
Belle2::ARICHGeoAerogelPlane::getWallThickness
double getWallThickness() const
Get thickness of aluminum walls between aerogel tiles.
Definition: ARICHGeoAerogelPlane.h:200
Belle2::ARICHGeoMirrorDisplacement::getDisplacementElement
const ARICHPositionElement & getDisplacementElement(int mirrorID) const
Returns displacement parameters for given mirror plate.
Definition: ARICHGeoMirrorDisplacement.h:59
Belle2::ARICHGeometryConfig::getMirrorDisplacement
const ARICHGeoMirrorDisplacement & getMirrorDisplacement() const
Get mirror displacement parameters.
Definition: ARICHGeometryConfig.h:158
Belle2::ARICHGeoCooling::getCoolingTestPlateMaterialName
const std::string & getCoolingTestPlateMaterialName() const
Returns material name of cooling test plates.
Definition: ARICHGeoCooling.h:272
Belle2::ARICHGeoSupport::getTubeOuterR
double getTubeOuterR(unsigned i) const
Get tube outer radius.
Definition: ARICHGeoSupport.h:147
Belle2::arich::GeoARICHCreator::buildMirror
G4LogicalVolume * buildMirror(const ARICHGeometryConfig &detectorGeo)
build mirrors
Definition: GeoARICHCreator.cc:1611
Belle2::ARICHGeoFEBCooling::getRectangleDistanceFromCenter
double getRectangleDistanceFromCenter() const
Returns distance from center of the rectangle in mm.
Definition: ARICHGeoFEBCooling.h:155
Belle2::ARICHGeoCooling::getColdTubeR
double getColdTubeR() const
Returns radius of cold tubes.
Definition: ARICHGeoCooling.h:290
Belle2::ARICHGeoMerger::getMergerPCBscrewholePosdX1
double getMergerPCBscrewholePosdX1() const
Returns merger PCB screw hole position from the bottom edge.
Definition: ARICHGeoMerger.h:240
Belle2::ARICHGeoMerger::getMergerPCBscrewholePosdY
double getMergerPCBscrewholePosdY() const
Returns merger PCB screw hole position from the left and right sides.
Definition: ARICHGeoMerger.h:234
Belle2::arich::GeoARICHCreator::buildDetectorPlane
G4LogicalVolume * buildDetectorPlane(const ARICHGeometryConfig &detectorGeo)
build detector plane
Definition: GeoARICHCreator.cc:945
Belle2::ARICHGeoMasterVolume::getRotationX
double getRotationX() const
Get angle of rotation around X axis.
Definition: ARICHGeoMasterVolume.h:112
Belle2::arich::GeoARICHCreator::buildCables
G4LogicalVolume * buildCables(const ARICHGeoCablesEnvelope &cablesGeo)
build the cables envelop with effective material describing cables
Definition: GeoARICHCreator.cc:1167
Belle2::ARICHGeometryConfig::getHAPDGeometry
const ARICHGeoHAPD & getHAPDGeometry() const
Get HAPD geometry parameters.
Definition: ARICHGeometryConfig.h:122
Belle2::ARICHGeometryConfig::useBasf2Units
static void useBasf2Units()
Use basf2 units when returning geometry parameters.
Definition: ARICHGeometryConfig.h:64
Belle2::ARICHGeoMerger::getSingleMergerEnvelopeThickness
double getSingleMergerEnvelopeThickness() const
Returns single merger PCB and merger cooling envelop thickness.
Definition: ARICHGeoMerger.h:216
Belle2::arich::GeoARICHCreator::buildFEBCoolingBody
G4LogicalVolume * buildFEBCoolingBody(const ARICHGeoFEBCooling &coolingv2Geo)
build FEB cooling bodies (cooling system update after phase 2)
Definition: GeoARICHCreator.cc:1184
Belle2::arich::GeoARICHCreator::m_modInfo
DBObjPtr< ARICHModulesInfo > m_modInfo
information on installed modules from the DB
Definition: GeoARICHCreator.h:174
Belle2::ARICHGeoAerogelPlane::getPosition
TVector3 getPosition() const
get position vector of aerogel plane in ARICH local frame
Definition: ARICHGeoAerogelPlane.h:147
Belle2::arich::GeoARICHCreator::buildCoolingTorus
G4LogicalVolume * buildCoolingTorus(const unsigned i_volumeID, const ARICHGeoCooling &coolingGeo)
build cooling tube (G4Torus)
Definition: GeoARICHCreator.cc:1313
Belle2::ARICHGeometryConfig::getCablesEnvelope
const ARICHGeoCablesEnvelope & getCablesEnvelope() const
Get ARICH cables envelop geometry parameters.
Definition: ARICHGeometryConfig.h:134
Belle2::ARICHGeoMirrors::getMirrorSurface
const GeoOpticalSurface & getMirrorSurface() const
Returns mirror reflective optical surface.
Definition: ARICHGeoMirrors.h:180
Belle2::ARICHGeoDetectorPlane::getNRings
unsigned getNRings() const
Get number of module slot rings.
Definition: ARICHGeoDetectorPlane.h:241
Belle2::arich::GeoARICHCreator::createGeometry
void createGeometry(G4LogicalVolume &topVolume, geometry::GeometryTypes type)
Create detector geometry.
Definition: GeoARICHCreator.cc:90
Belle2::ARICHGeoMerger::getMergerPCBscrewholeR
double getMergerPCBscrewholeR() const
Returns merger PCB screw hole radius.
Definition: ARICHGeoMerger.h:228
Belle2::ARICHGeoAerogelPlane::getRingRadius
double getRingRadius(unsigned iRing) const
Get radius of i-th aluminum ring between aerogel tiles (inner radius of ring)
Definition: ARICHGeoAerogelPlane.h:273
Belle2::ARICHGeoCooling::getCoolingPosPhi
const std::vector< double > & getCoolingPosPhi() const
Returns vector of azimuthal angle of the cooling system object center in polar coordinate system in d...
Definition: ARICHGeoCooling.h:254
Belle2::ARICHGeoCooling::getRmax
double getRmax() const
Returns Size of cooling system pipe : outer radius in mm.
Definition: ARICHGeoCooling.h:212
Belle2::ARICHGeoHAPD::getWallThickness
double getWallThickness() const
Returns wall thickness.
Definition: ARICHGeoHAPD.h:190
Belle2::ARICHGeoAerogelPlane::getTileThickness
double getTileThickness(int ring, int column, int layerN) const
Get thickness of individual tile.
Definition: ARICHGeoAerogelPlane.cc:176
Belle2::ARICHGeoCooling::getColdTubeNumber
int getColdTubeNumber() const
Returns number of cold tubes in one plate.
Definition: ARICHGeoCooling.h:320
Belle2::arich::GeoARICHCreator::buildHAPD
G4LogicalVolume * buildHAPD(const ARICHGeoHAPD &hapdPar)
build the HAPD modules
Definition: GeoARICHCreator.cc:850
Belle2::ARICHGeoSupport::getNBoxes
unsigned getNBoxes() const
Get number of box volumes.
Definition: ARICHGeoSupport.h:262
Belle2::ARICHGeometryConfig::getMirrors
const ARICHGeoMirrors & getMirrors() const
Get mirrors geometry configuration.
Definition: ARICHGeometryConfig.h:104
Belle2::ARICHGeoHAPD::getSizeZ
double getSizeZ() const
Returns HAPD size in z.
Definition: ARICHGeoHAPD.h:184
Belle2::BkgSensitiveDetector
The Class for BeamBackground Sensitive Detector.
Definition: BkgSensitiveDetector.h:34
Belle2::arich::GeoARICHCreator::buildCoolingTestPlate
G4LogicalVolume * buildCoolingTestPlate(const ARICHGeoCooling &coolingGeo)
build cooling test plates
Definition: GeoARICHCreator.cc:1382
Belle2::ARICHGeoHAPD::getWinMaterial
const std::string & getWinMaterial() const
Returns window material name.
Definition: ARICHGeoHAPD.h:287
Belle2::ARICHGeoAerogelPlane::getNLayers
unsigned getNLayers() const
Get number of aerogel layers.
Definition: ARICHGeoAerogelPlane.h:260
Belle2::ARICHGeoMerger::getMergerPCBscrewholePosdX2
double getMergerPCBscrewholePosdX2() const
Returns merger PCB screw hole position from the top edge.
Definition: ARICHGeoMerger.h:246
Belle2::arich::GeoARICHCreator::buildAerogelPlaneWithIndividualTilesProp
G4LogicalVolume * buildAerogelPlaneWithIndividualTilesProp(const ARICHGeometryConfig &detectorGeo)
with individual properties of aerogel tiles
Definition: GeoARICHCreator.cc:615
Belle2::ARICHGeoCablesEnvelope::getEnvelopeCenterPosition
TVector3 getEnvelopeCenterPosition() const
Returns position vector (TVector3) of cables envelop.
Definition: ARICHGeoCablesEnvelope.h:106
Belle2::ARICHGeoCooling::getCoolingPipeMaterialName
const std::string & getCoolingPipeMaterialName() const
Returns material name of cooling pipe.
Definition: ARICHGeoCooling.h:200
Belle2::ARICHGeoSupport::getTubeMaterial
const std::string & getTubeMaterial(unsigned i) const
Get material of i-th tube.
Definition: ARICHGeoSupport.h:202
Belle2::ARICHGeoDetectorPlane::getModuleHoleSize
double getModuleHoleSize() const
Get size of module hole in support plate.
Definition: ARICHGeoDetectorPlane.h:181
Belle2::ARICHGeoDetectorPlane::getSupportInnerR
double getSupportInnerR() const
Get support plate inner radius.
Definition: ARICHGeoDetectorPlane.h:157
Belle2::geometry::Materials::get
static G4Material * get(const std::string &name)
Find given material.
Definition: Materials.h:65
Belle2::ARICHGeoMirrors::getNMirrors
unsigned getNMirrors() const
Get number of mirror plates.
Definition: ARICHGeoMirrors.h:142
Belle2::ARICHGeoMirrors
Geometry parameters of HAPD.
Definition: ARICHGeoMirrors.h:40
Belle2::ARICHGeoFEBCooling::getBigSquareSize
double getBigSquareSize() const
Returns size of the big square in mm.
Definition: ARICHGeoFEBCooling.h:125
Belle2::ARICHGeoAerogelPlane::getRotationX
double getRotationX() const
Get angle of rotation around X axis.
Definition: ARICHGeoAerogelPlane.h:164
Belle2::ARICHGeoDetectorPlane::getSupportOuterR
double getSupportOuterR() const
Get support plate outer radius.
Definition: ARICHGeoDetectorPlane.h:163
Belle2::ARICHGeometryConfig::getAerogelPlane
const ARICHGeoAerogelPlane & getAerogelPlane() const
Get geometry configuration of aerogel plane.
Definition: ARICHGeometryConfig.h:98
Belle2::ARICHGeoAerogelPlane::getFullAerogelMaterialDescriptionKey
int getFullAerogelMaterialDescriptionKey() const
Get full aerogel material description key.
Definition: ARICHGeoAerogelPlane.h:383
Belle2::ARICHGeoMerger::getMergerPCBMaterialName
const std::string & getMergerPCBMaterialName() const
Returns merger PCB material name.
Definition: ARICHGeoMerger.h:180
Belle2::ARICHGeoCablesEnvelope::getEnvelopeOuterRadius
double getEnvelopeOuterRadius() const
Returns Outer radius of cables envelop.
Definition: ARICHGeoCablesEnvelope.h:88
Belle2::ARICHGeoHAPD::getFEBSizeY
double getFEBSizeY() const
Returns FEB size in y.
Definition: ARICHGeoHAPD.h:226
Belle2::ARICHGeoMerger::getSizeW
double getSizeW() const
Returns merger PCB width.
Definition: ARICHGeoMerger.h:192
Belle2::ARICHGeoSupport::getWedgeMaterial
const std::string & getWedgeMaterial(unsigned i) const
Get material of i-th wedge.
Definition: ARICHGeoSupport.h:209
Belle2::ARICHGeoGlobalDisplacement::getGamma
double getGamma() const
Returns rotation angle around z.
Definition: ARICHGeoGlobalDisplacement.h:131
Belle2::arich::GeoARICHCreator::m_mergerCooling
OptionalDBObjPtr< ARICHGeoMergerCooling > m_mergerCooling
merger cooling bodies geometry from the DB
Definition: GeoARICHCreator.h:175
Belle2::ARICHGeoSupport::getTubeName
const std::string & getTubeName(unsigned i) const
Get name of i-th tube.
Definition: ARICHGeoSupport.h:216
Belle2::ARICHGeoAerogelPlane::getSupportInnerR
double getSupportInnerR() const
Get support plate inner radius.
Definition: ARICHGeoAerogelPlane.h:182
Belle2::ARICHGeoFEBCooling::getBigSquareThickness
double getBigSquareThickness() const
Returns thickness of the big square in mm.
Definition: ARICHGeoFEBCooling.h:131
Belle2::ARICHGeoCablesEnvelope::getEnvelopeInnerRadius
double getEnvelopeInnerRadius() const
Returns Inner radius of cables envelop.
Definition: ARICHGeoCablesEnvelope.h:94
Belle2::ARICHGeoHAPD::getSizeX
double getSizeX() const
Returns HAPD size in x.
Definition: ARICHGeoHAPD.h:172
Belle2::ARICHGeoDetectorPlane::getRingDPhi
double getRingDPhi(unsigned iRing) const
Get phi (angle) distance between module slots in i-th ring.
Definition: ARICHGeoDetectorPlane.h:215
Belle2::Unit::MeV
static const double MeV
[megaelectronvolt]
Definition: Unit.h:124
Belle2::ARICHGeoMasterVolume::getPosition
TVector3 getPosition() const
Get position of ARICH master volume center point in global Belle II coordinates.
Definition: ARICHGeoMasterVolume.h:95
Belle2::ARICHGeoCooling::getEnvelopeThickness
double getEnvelopeThickness() const
Returns Thickness of cooling system assembly envelope.
Definition: ARICHGeoCooling.h:230
Belle2::ARICHGeoAerogelPlane::getImgTubeThickness
double getImgTubeThickness() const
Get imaginary tube thikness just after aerogel layers used as volume to which tracks are extrapolated...
Definition: ARICHGeoAerogelPlane.h:449
Belle2::ARICHGeometryConfig::getCoolingGeometry
const ARICHGeoCooling & getCoolingGeometry() const
Get ARICH cooling system geometry parameters.
Definition: ARICHGeometryConfig.h:140
Belle2::arich::GeoARICHCreator::buildMergerCooling
G4LogicalVolume * buildMergerCooling(unsigned iType)
build merger cooling bodies (cooling system update after phase 2)
Definition: GeoARICHCreator.cc:1027
Belle2::ARICHGeoAerogelPlane::getTileGap
double getTileGap() const
Get gap between aerogel tile and aluminum wall.
Definition: ARICHGeoAerogelPlane.h:212
Belle2::Unit::eV
static const double eV
[electronvolt]
Definition: Unit.h:122
Belle2::ARICHGeoCooling::getCoolinRotationAngle
const std::vector< double > & getCoolinRotationAngle() const
Returns vector of azimuthal angle of rotation aroud Z - axis of the cooling system object in polar co...
Definition: ARICHGeoCooling.h:266
Belle2::ARICHGeoAerogelPlane::getMaximumTotalTileThickness
double getMaximumTotalTileThickness() const
Get maximum total thickness of the aerogel tiles tile_up + tile_down for all the slots.
Definition: ARICHGeoAerogelPlane.cc:223
Belle2::ARICHGeoMasterVolume::getLength
double getLength() const
Get ARICH master volume length.
Definition: ARICHGeoMasterVolume.h:142
Belle2::ARICHGeoHAPD::getAPDSizeX
double getAPDSizeX() const
Returns APD size in x.
Definition: ARICHGeoHAPD.h:202
Belle2::ARICHGeoAerogelPlane::getSupportOuterR
double getSupportOuterR() const
Get support plate outer radius.
Definition: ARICHGeoAerogelPlane.h:188
Belle2::ARICHGeoDetectorPlane::getRingR
double getRingR(unsigned iRing) const
Get radius of i-th module slot ring (radius of center point)
Definition: ARICHGeoDetectorPlane.h:208
Belle2::arich::GeoARICHCreator::makeJoint
G4AssemblyVolume * makeJoint(G4Material *supportMaterial, const std::vector< double > &pars)
build joints of the ARICH support structure
Definition: GeoARICHCreator.cc:1647
Belle2::ARICHGeoSupport::getWedgePhi
double getWedgePhi(unsigned i) const
Get phi angle at which i-th wedge is placed.
Definition: ARICHGeoSupport.h:188
Belle2::ARICHGeoGlobalDisplacement::getAlpha
double getAlpha() const
Returns rotation angle around x.
Definition: ARICHGeoGlobalDisplacement.h:119
Belle2::ARICHGeoHAPD::getWallMaterial
const std::string & getWallMaterial() const
Returns wall (casing) material name.
Definition: ARICHGeoHAPD.h:275
Belle2::arich::GeoARICHCreator::buildMergerPCBEnvelopePlane
G4LogicalVolume * buildMergerPCBEnvelopePlane(const ARICHGeometryConfig &detectorGeo)
build merger PCB assembly envelope plane
Definition: GeoARICHCreator.cc:1092
Belle2::ARICHGeoFEBCooling::getSmallSquareThickness
double getSmallSquareThickness() const
Returns thickness of the small square in mm.
Definition: ARICHGeoFEBCooling.h:119
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::geometry::Materials::getInstance
static Materials & getInstance()
Get a reference to the singleton instance.
Definition: Materials.cc:87
Belle2::ARICHGeoCooling::getEnvelopeCenterPosition
TVector3 getEnvelopeCenterPosition() const
Returns position vector (TVector3) of cooling system assembly envelope.
Definition: ARICHGeoCooling.h:236
Belle2::ARICHGeoSupport::getTubeZPosition
double getTubeZPosition(unsigned i) const
Get tube Z position.
Definition: ARICHGeoSupport.h:161
Belle2::geometry::setVisibility
void setVisibility(G4LogicalVolume &volume, bool visible)
Helper function to quickly set the visibility of a given volume.
Definition: utilities.cc:115
Belle2::arich::GeoARICHCreator::buildSimpleAerogelPlane
G4LogicalVolume * buildSimpleAerogelPlane(const ARICHGeometryConfig &detectorGeo)
build simple aerogel plane (for cosmic test)
Definition: GeoARICHCreator.cc:441
Belle2::arich::GeoARICHCreator::buildMerger
G4LogicalVolume * buildMerger(const ARICHGeoMerger &mergerGeo)
build the merger PCB logical volume
Definition: GeoARICHCreator.cc:974
Belle2::arich::GeoARICHCreator::m_sensitiveAero
SensitiveAero * m_sensitiveAero
pointer to sensitive aerogel - used instead of tracking
Definition: GeoARICHCreator.h:169
Belle2::ARICHGeoSupport::getWedgeType
int getWedgeType(unsigned i) const
Get type of i-th wedge.
Definition: ARICHGeoSupport.h:174
Belle2::ARICHGeoMasterVolume::getInnerRadius
double getInnerRadius() const
Get ARICH master volume inner radius.
Definition: ARICHGeoMasterVolume.h:130
Belle2::ARICHGeoMerger::getMergerAngle
const std::vector< double > & getMergerAngle() const
Returns vector of merger boarts azimuthal angles in polar coordinate system in deg.
Definition: ARICHGeoMerger.h:294
Belle2::ARICHGeoMirrors::getPlateLength
double getPlateLength() const
Get length of mirror plate.
Definition: ARICHGeoMirrors.h:136
Belle2::ARICHGeoMerger
Geometry parameters of Merger PCB.
Definition: ARICHGeoMerger.h:36
Belle2::geometry::Materials::createOpticalSurface
G4OpticalSurface * createOpticalSurface(const gearbox::Interface &parameters)
Create an optical surface from parameters, will abort on error.
Definition: Materials.cc:288
Belle2::ARICHGeoHAPD::getAPDSizeZ
double getAPDSizeZ() const
Returns APD size in z.
Definition: ARICHGeoHAPD.h:214
Belle2::ARICHGeoHAPD::getSizeY
double getSizeY() const
Returns HAPD size in y.
Definition: ARICHGeoHAPD.h:178
Belle2::ARICHGeoMerger::getMergerSlotID
const std::vector< double > & getMergerSlotID() const
Returns vector of merger boards slot numbers.
Definition: ARICHGeoMerger.h:282
Belle2::ARICHGeoSupport::getWedge
const std::vector< double > getWedge(unsigned i) const
Get parameters of wedge.
Definition: ARICHGeoSupport.h:229
Belle2::geometry::Materials
Thin wrapper around the Geant4 Material system.
Definition: Materials.h:50
Belle2::arich::GeoARICHCreator::~GeoARICHCreator
virtual ~GeoARICHCreator()
The destructor of the GeoARICHreator class.
Definition: GeoARICHCreator.cc:81
Belle2::arich::GeoARICHCreator::m_sensitive
SensitiveDetector * m_sensitive
pointer to sensitive detector
Definition: GeoARICHCreator.h:166
Belle2::ARICHGeoSupport::getTubeLength
double getTubeLength(unsigned i) const
Get tube length.
Definition: ARICHGeoSupport.h:154
Belle2::arich::GeoARICHCreator::buildAerogelPlane
G4LogicalVolume * buildAerogelPlane(const ARICHGeometryConfig &detectorGeo)
build aerogel plane
Definition: GeoARICHCreator.cc:494
Belle2::ARICHGeoFEBCooling::getRectangleThickness
double getRectangleThickness() const
Returns thickness of the rectangle in mm.
Definition: ARICHGeoFEBCooling.h:149
Belle2::ARICHGeometryConfig::getMasterVolume
const ARICHGeoMasterVolume & getMasterVolume() const
Get ARICH master volume geometry configuration.
Definition: ARICHGeometryConfig.h:110
Belle2::ARICHGeoMerger::getSingleMergerEnvelopeSizeW
double getSingleMergerEnvelopeSizeW() const
Returns single merger PCB and merger cooling envelop width.
Definition: ARICHGeoMerger.h:210
Belle2::ARICHGeoAerogelPlane::getSupportThickness
double getSupportThickness() const
Get support plate thickness.
Definition: ARICHGeoAerogelPlane.h:194
Belle2::ARICHGeoDetectorPlane::getSupportThickness
double getSupportThickness() const
Get support plate thickness.
Definition: ARICHGeoDetectorPlane.h:169
Belle2::ARICHGeoCooling::getEnvelopeOuterRadius
double getEnvelopeOuterRadius() const
Returns Outer radius of cooling system assembly envelope.
Definition: ARICHGeoCooling.h:218
Belle2::ARICHGeoCooling::getDepthColdTubeInPlate
double getDepthColdTubeInPlate() const
Returns depth of the cold tube in the cooling plate.
Definition: ARICHGeoCooling.h:308
Belle2::ARICHGeoMerger::getThickness
double getThickness() const
Returns merger PCB thickness.
Definition: ARICHGeoMerger.h:198
Belle2::ARICHGeoHAPD::getFEBSizeZ
double getFEBSizeZ() const
Returns FEB size in z.
Definition: ARICHGeoHAPD.h:232
Belle2::ARICHGeoHAPD::getModuleSizeZ
double getModuleSizeZ() const
Returns module size in z (HAPD + FEB height)
Definition: ARICHGeoHAPD.h:238
Belle2::arich::GeoARICHCreator::buildAerogelPlaneAveragedOverLayers
G4LogicalVolume * buildAerogelPlaneAveragedOverLayers(const ARICHGeometryConfig &detectorGeo)
build aerogel plane with average properties of aerogel per layer
Definition: GeoARICHCreator.cc:505
Belle2::ARICHGeoAerogelPlane::getNRings
unsigned getNRings() const
Get number of aluminum wall rings (should be number of tile rings + 1)
Definition: ARICHGeoAerogelPlane.h:266
Belle2::arich::SensitiveAero
This is optional (temporary) class that provides information on track parameters on aerogel plane,...
Definition: SensitiveAero.h:32
Belle2::ARICHGeoSupport::getWedgeR
double getWedgeR(unsigned i) const
Get radius at which i-th wedge is placed.
Definition: ARICHGeoSupport.h:181
Belle2::ARICHGeometryConfig::getGlobalDisplacement
const ARICHGeoGlobalDisplacement & getGlobalDisplacement() const
Get global displacement parameters.
Definition: ARICHGeometryConfig.h:152
Belle2::arich::GeoARICHCreator::buildCoolingTube
G4LogicalVolume * buildCoolingTube(const unsigned i_volumeID, const ARICHGeoCooling &coolingGeo)
build cooling tube (G4Tubs)
Definition: GeoARICHCreator.cc:1298
Belle2::ARICHGeoCooling::getRmin
double getRmin() const
Returns Size of cooling system pipe : inner radius in mm.
Definition: ARICHGeoCooling.h:206
Belle2::ARICHGeoHAPD::getWinThickness
double getWinThickness() const
Returns window thickness.
Definition: ARICHGeoHAPD.h:196
Belle2::ARICHGeoMerger::getEnvelopeOuterRadius
double getEnvelopeOuterRadius() const
Returns Outer radius of merger PCB assembly envelope.
Definition: ARICHGeoMerger.h:252
Belle2::ARICHGeoCablesEnvelope
Geometry parameters of cable envelope.
Definition: ARICHGeoCablesEnvelope.h:36
Belle2::ARICHGeoHAPD::getAPDMaterial
const std::string & getAPDMaterial() const
Returns APD material name.
Definition: ARICHGeoHAPD.h:293
Belle2::ARICHGeoDetectorPlane::getRotationX
double getRotationX() const
Get angle of rotation around X axis.
Definition: ARICHGeoDetectorPlane.h:139
Belle2::ARICHGeoFEBCooling::getSmallSquareSize
double getSmallSquareSize() const
Returns size of the small square in mm.
Definition: ARICHGeoFEBCooling.h:113
Belle2::arich::GeoARICHCreator::m_isBeamBkgStudy
int m_isBeamBkgStudy
flag the beam background study
Definition: GeoARICHCreator.h:172
Belle2::ARICHGeoSupport::getBox
box getBox(unsigned i) const
Get box paramaters.
Definition: ARICHGeoSupport.h:272
Belle2::ARICHGeoMerger::getSingleMergeEnvelopePosition
TVector3 getSingleMergeEnvelopePosition() const
Returns position vector (TVector3) of merger PCB inside the single merger envelope.
Definition: ARICHGeoMerger.h:276
Belle2::ARICHGeoGlobalDisplacement::getZ
double getZ() const
Returns translation in z.
Definition: ARICHGeoGlobalDisplacement.h:113
Belle2::ARICHGeoHAPD::getAPDSizeY
double getAPDSizeY() const
Returns APD size in y.
Definition: ARICHGeoHAPD.h:208
Belle2::ARICHGeoCooling::getColdTubeSpacing
double getColdTubeSpacing() const
Returns distance from center of the cold tube to edge of cooling plate.
Definition: ARICHGeoCooling.h:314
Belle2::ARICHGeoDetectorPlane
Geometry parameters of ARICH photon detector plane.
Definition: ARICHGeoDetectorPlane.h:37
Belle2::ARICHGeoSupport::getTubeInnerR
double getTubeInnerR(unsigned i) const
Get tube inner radius.
Definition: ARICHGeoSupport.h:140
Belle2::ARICHGeoCooling::getCoolingTestPlateslengths
TVector3 getCoolingTestPlateslengths() const
Returns sizes vector (TVector3) of cooling test plates.
Definition: ARICHGeoCooling.h:284
Belle2::arich::GeoARICHCreator::getAvgRINDEX
double getAvgRINDEX(G4Material *material)
get refractive index of the material
Definition: GeoARICHCreator.cc:1637
Belle2::ARICHGeoCablesEnvelope::getEnvelopeThickness
double getEnvelopeThickness() const
Returns Thickness of cables envelop.
Definition: ARICHGeoCablesEnvelope.h:100
Belle2::ARICHGeoMirrors::getStartAngle
double getStartAngle() const
Get phi angle of position of the first mirror plate.
Definition: ARICHGeoMirrors.h:118
Belle2::ARICHGeoCooling::getCoolingGeometryID
const std::vector< double > & getCoolingGeometryID() const
Returns vector of cooling system object geometry ID.
Definition: ARICHGeoCooling.h:242
Belle2::ARICHGeoDetectorPlane::getSupportBackWallHeight
double getSupportBackWallHeight() const
Get height of the aluminum walls between modules on the electronics side of aluminum support plate.
Definition: ARICHGeoDetectorPlane.h:188
Belle2::ARICHGeoCooling
Geometry parameters of Cooling System.
Definition: ARICHGeoCooling.h:36
Belle2::ARICHGeoDetectorPlane::getSlotRing
unsigned getSlotRing(unsigned slotID) const
Get ring number of slot with slot ID.
Definition: ARICHGeoDetectorPlane.cc:35
Belle2::ARICHGeoDetectorPlane::getPosition
TVector3 getPosition() const
Get center point.
Definition: ARICHGeoDetectorPlane.h:122
Belle2::arich::GeoARICHCreator::buildMergerEnvelope
G4LogicalVolume * buildMergerEnvelope(const ARICHGeoMerger &mergerGeo, int type)
build single merger and merger cooling body envelope logical volume
Definition: GeoARICHCreator.cc:1080
Belle2::ARICHGeoSupport::getNTubes
unsigned getNTubes() const
Get number of tube volumes to be placed.
Definition: ARICHGeoSupport.h:133
Belle2::ARICHGeoSupport::box
Struct to hold parameters of box volumes (examples, scintilators for cosmic test)
Definition: ARICHGeoSupport.h:70
Belle2::ARICHGeoMerger::getMergerOrientation
const std::vector< double > & getMergerOrientation() const
Returns vector of merger boarts orientations in deg.
Definition: ARICHGeoMerger.h:300
Belle2::ARICHGeoSupport::getNWedges
unsigned getNWedges() const
Get number of wedges to be placed.
Definition: ARICHGeoSupport.h:167
Belle2::ARICHGeoHAPD::getFEBSizeX
double getFEBSizeX() const
Returns FEB size in x.
Definition: ARICHGeoHAPD.h:220
Belle2::ARICHGeoGlobalDisplacement::getY
double getY() const
Returns translation in y.
Definition: ARICHGeoGlobalDisplacement.h:107
Belle2::ARICHGeoGlobalDisplacement::getX
double getX() const
Returns translation in x.
Definition: ARICHGeoGlobalDisplacement.h:101
Belle2::ARICHGeometryConfig::useGeantUnits
static void useGeantUnits()
Use Geant4 units when returning geometry parameters.
Definition: ARICHGeometryConfig.h:70
Belle2::ARICHGeoMerger::getSingleMergerEnvelopeSizeL
double getSingleMergerEnvelopeSizeL() const
Returns single merger PCB and merger cooling envelop length.
Definition: ARICHGeoMerger.h:204
Belle2::ARICHGeoAerogelPlane
Geometry parameters of HAPD.
Definition: ARICHGeoAerogelPlane.h:37
Belle2::ARICHGeoAerogelPlane::getLayerMaterial
const std::string & getLayerMaterial(unsigned iLayer) const
Get material name of tiles i-th aerogel layer.
Definition: ARICHGeoAerogelPlane.h:308
Belle2::ARICHGeoAerogelPlane::getLayerThickness
double getLayerThickness(unsigned iLayer) const
Get thickness of tiles i-th aerogel layer.
Definition: ARICHGeoAerogelPlane.h:287
Belle2::ARICHGeoAerogelPlane::getWallHeight
double getWallHeight() const
Get height of aluminum walls between aerogel tiles.
Definition: ARICHGeoAerogelPlane.h:206
Belle2::ARICHGeometryConfig::getSupportStructure
const ARICHGeoSupport & getSupportStructure() const
Get ARICH support structure geometry configuration.
Definition: ARICHGeometryConfig.h:116
Belle2::ARICHGeoMerger::getSizeL
double getSizeL() const
Returns merger PCB lenght.
Definition: ARICHGeoMerger.h:186
Belle2::ARICHGeoCooling::getColdTubeSubtractedR
double getColdTubeSubtractedR() const
Returns outer radius of subtracted tubes for cold tube.
Definition: ARICHGeoCooling.h:296
Belle2::ARICHGeoCooling::getCoolingL
const std::vector< double > & getCoolingL() const
Returns vector of lengs of the cooling system object with given geometry ID.
Definition: ARICHGeoCooling.h:248
Belle2::ARICHGeoMerger::getSingleMergerenvelopeDeltaZ
const std::vector< double > & getSingleMergerenvelopeDeltaZ() const
Returns vector of Z position of the single merger and merger cooling body envelope inside global merg...
Definition: ARICHGeoMerger.h:222
Belle2::ARICHGeoMirrors::getPlateThickness
double getPlateThickness() const
Get thickness of mirror plate.
Definition: ARICHGeoMirrors.h:124
Belle2::arich::GeoARICHCreator::buildCoolingEnvelopePlane
G4LogicalVolume * buildCoolingEnvelopePlane(const ARICHGeoCooling &coolingGeo)
build cooling system assembly envelope plane
Definition: GeoARICHCreator.cc:1335
Belle2::ARICHGeoDetectorPlane::getNSlots
unsigned getNSlots() const
Get total number of module slots.
Definition: ARICHGeoDetectorPlane.h:235
Belle2::ARICHGeoHAPD
Geometry parameters of HAPD.
Definition: ARICHGeoHAPD.h:34
Belle2::ARICHGeoAerogelPlane::getRingDPhi
double getRingDPhi(unsigned iRing) const
Get phi (angle) distance between "phi" aluminum wall between aerogel tiles in i-th tile ring.
Definition: ARICHGeoAerogelPlane.h:280
Belle2::geometry::GeometryTypes
GeometryTypes
Flag indiciating the type of geometry to be used.
Definition: GeometryManager.h:39
Belle2::ARICHGeoAerogelPlane::getTileMaterialName
std::string getTileMaterialName(int ring, int column, int layerN) const
Get material name of individual tile.
Definition: ARICHGeoAerogelPlane.cc:191
Belle2::ARICHGeoDetectorPlane::getSupportMaterial
const std::string & getSupportMaterial() const
Get material of support plate.
Definition: ARICHGeoDetectorPlane.h:201
Belle2::ARICHGeoDetectorPlane::getSupportZPosition
double getSupportZPosition() const
Get Z position of support plate (start point in Z)
Definition: ARICHGeoDetectorPlane.h:175
Belle2::ARICHGeoDetectorPlane::getSlotPhi
double getSlotPhi(unsigned modID) const
Get phi (angle) position of module with given module ID number.
Definition: ARICHGeoDetectorPlane.h:229
Belle2::ARICHGeoHAPD::getFEBMaterial
const std::string & getFEBMaterial() const
Returns FEB material name.
Definition: ARICHGeoHAPD.h:299
Belle2::arich::GeoARICHCreator::buildDetectorSupportPlate
G4LogicalVolume * buildDetectorSupportPlate(const ARICHGeometryConfig &detectorGeo)
build detector support plate
Definition: GeoARICHCreator.cc:1464
Belle2::ARICHGeoSupport
Geometry parameters of ARICH support structures and neutron shield.
Definition: ARICHGeoSupport.h:35
Belle2::ARICHGeometryConfig::getMergerGeometry
const ARICHGeoMerger & getMergerGeometry() const
Get Merger PCB geometry parameters.
Definition: ARICHGeometryConfig.h:128
Belle2::ARICHGeoAerogelPlane::getSupportMaterial
const std::string & getSupportMaterial() const
Get material of support plate.
Definition: ARICHGeoAerogelPlane.h:218
Belle2::ARICHGeoDetectorPlane::getSupportBackWallThickness
double getSupportBackWallThickness() const
Get thickness of aluminum walls between modules on the electronics side of aluminum support plate.
Definition: ARICHGeoDetectorPlane.h:195
Belle2::ARICHGeoAerogelPlane::getCompensationARICHairVolumeThick_min
double getCompensationARICHairVolumeThick_min() const
Get minimum thickness of the compensation volume with ARICH air.
Definition: ARICHGeoAerogelPlane.h:467
Belle2::ARICHGeoAerogelPlane::getSimpleParams
const std::vector< double > & getSimpleParams() const
Get parameters of simple aerogel configuration.
Definition: ARICHGeoAerogelPlane.h:343
Belle2::ARICHGeoFEBCooling
Geometry parameters of Cooling System - version2 (v2).
Definition: ARICHGeoFEBCooling.h:42
Belle2::ARICHGeoMerger::getMergerPosR
const std::vector< double > & getMergerPosR() const
Returns vector of merger boards distances from the center in mm.
Definition: ARICHGeoMerger.h:288