HGCal Test Beam  03a93d6239a951948e06fb3ef8dae4cbdebfad30
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
DetectorConstruction.cc
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // read geometry from a config file 04-28-2016 HBP
3 // ----------------------------------------------------------------------------
4 #include "HGCal/TBStandaloneSimulator/interface/DetectorConstruction.hh"
5 #include "HGCal/TBStandaloneSimulator/interface/DetectorMessenger.hh"
6 #include "HGCal/TBStandaloneSimulator/interface/HGCSSSimHit.hh"
7 #include "TMath.h"
8 
9 #include "G4Material.hh"
10 #include "G4NistManager.hh"
11 #include "G4VSolid.hh"
12 #include "G4Box.hh"
13 #include "G4Tubs.hh"
14 #include "G4Polyhedra.hh"
15 #include "G4LogicalVolume.hh"
16 #include "G4PVPlacement.hh"
17 #include "G4PVReplica.hh"
18 #include "G4UniformMagField.hh"
19 #include "G4GeometryManager.hh"
20 #include "G4PhysicalVolumeStore.hh"
21 #include "G4LogicalVolumeStore.hh"
22 #include "G4SolidStore.hh"
23 #include "G4VisAttributes.hh"
24 #include "G4Colour.hh"
25 #include "G4PhysicalConstants.hh"
26 #include "G4SystemOfUnits.hh"
27 #include "G4FieldManager.hh"
28 #include "G4TransportationManager.hh"
29 #include "G4PhysicalConstants.hh"
30 
31 using namespace std;
32 
33 //
34 DetectorConstruction::DetectorConstruction(TBGeometry& geometry,
35  TBConfig& config)
36  : m_geometry(geometry),
37  m_config(config)
38 {
39  //radiation lengths: cf. http://pdg.lbl.gov/2012/AtomicNuclearProperties/
40  //W 3.504 mm
41  //Pb 5.612 mm
42  //Cu 14.36 mm
43 
44  G4cout << "BEGIN(DetectorConstruction)" << G4endl;
45 
46  vector<TBGeometry::Element> elements;
47  for(size_t c = 0; c < m_geometry.size(); c++) {
48  TBGeometry::Element e = m_geometry("geometry", c);
49  if ( e.imap["first"] ) elements.clear();
50 
51  elements.push_back(e);
52 
53  if ( e.imap["last"] )
54  m_caloStruct.push_back( SamplingSection(elements) );
55  }
56 
57  DefineMaterials();
58  SetMagField(0);
59  UpdateCalorSize();
60  m_detectorMessenger = new DetectorMessenger(this);
61 
62  G4cout << "END(DetectorConstruction)" << G4endl;
63 }
64 
65 DetectorConstruction::~DetectorConstruction()
66 {
67  delete m_detectorMessenger;
68 }
69 
70 //
71 void DetectorConstruction::DefineMaterials()
72 {
73  G4NistManager* nistManager = G4NistManager::Instance();
74  m_materials["Abs"]
75  = nistManager->FindOrBuildMaterial(m_geometry.material("Abs"), false);
76  m_materials["AbsHCAL"]
77  = nistManager->FindOrBuildMaterial(m_geometry.material("AbsHCAL"), false);
78  m_materials["Al"] = nistManager->FindOrBuildMaterial("G4_Al", false);
79  m_dEdx["Al"] = 0.4358;
80  m_materials["W"] = nistManager->FindOrBuildMaterial("G4_W", false);
81  m_dEdx["W"] = 2.210;
82  m_materials["Pb"] = nistManager->FindOrBuildMaterial("G4_Pb", false);
83  m_dEdx["Pb"] = 1.274;
84  m_materials["Cu"] = nistManager->FindOrBuildMaterial("G4_Cu", false);
85  m_dEdx["Cu"] = 1.257;
86  m_materials["Si"] = nistManager->FindOrBuildMaterial("G4_Si", false);
87  m_dEdx["Si"] = 0.3876;
88  m_materials["Zn"] = nistManager->FindOrBuildMaterial("G4_Zn", false);
89  m_dEdx["Zn"] = 1.007;
90  m_materials["Air"] = nistManager->FindOrBuildMaterial("G4_AIR", false);
91  m_dEdx["Air"] = 0;
92  m_materials["Fe"] = nistManager->FindOrBuildMaterial("G4_Fe", false);
93  m_dEdx["Fe"] = 1.143;
94  m_materials["Mn"] = nistManager->FindOrBuildMaterial("G4_Mn", false);
95  m_dEdx["Mn"] = 1.062 ;
96  m_materials["C"] = nistManager->FindOrBuildMaterial("G4_C", false);
97  m_dEdx["C"] = 0.3952;
98  m_materials["H"] = nistManager->FindOrBuildMaterial("G4_H", false);
99  m_dEdx["H"] = 0;
100  m_materials["Cl"] = nistManager->FindOrBuildMaterial("G4_Cl", false);
101  m_dEdx["Cl"] = 0;
102  m_materials["Cr"] = nistManager->FindOrBuildMaterial("G4_Cr", false);
103  m_dEdx["Cr"] = 1.046;
104  m_materials["Ni"] = nistManager->FindOrBuildMaterial("G4_Ni", false);
105  m_dEdx["Ni"] = 1.307;
106 
107 
108  //from http://www.physi.uni-heidelberg.de/~adler/TRD/
109  //TRDunterlagen/RadiatonLength/tgc2.htm
110 
111  G4Element* H = new G4Element("Hydrogen", "H", 1., 1.01*g/mole);
112  G4Element* C = new G4Element("Carbon", "C", 6., 12.01*g/mole);
113  G4Element* O = new G4Element("Oxygen", "O" , 8., 16.00*g/mole);
114  G4Element* Si = new G4Element("Silicon", "Si", 14.,28.09*g/mole);
115 
116  m_materials["SiO2"] = new G4Material("SiO2", 2.200*g/cm3, 2);
117  m_materials["SiO2"]->AddElement(Si, 1);
118  m_materials["SiO2"]->AddElement(O , 2);
119  m_dEdx["SiO2"] = 5.938; // MeV/cm
120 
121  //Epoxy
122  m_materials["Epoxy"] = new G4Material("Epoxy", 1.2*g/cm3, 2);
123  m_materials["Epoxy"]->AddElement(H, 2);
124  m_materials["Epoxy"]->AddElement(C, 2);
125  m_dEdx["Epoxy"] = 2.0; // JUST A GUESS
126 
127  //FR4
128  m_materials["FR4"] = new G4Material("FR4", 1.86*g/cm3, 2);
129  m_materials["FR4"]->AddMaterial(m_materials["SiO2"], 0.528);
130  m_materials["FR4"]->AddMaterial(m_materials["Epoxy"], 0.472);
131  m_dEdx["FR4"] = 0.528*m_dEdx["SiO2"] + 0.472*m_dEdx["Epoxy"];
132 
133  //G10
134  m_materials["G10"] = new G4Material("G10", 1.700 * g / cm3, 4);
135  m_materials["G10"]->AddElement(nistManager->FindOrBuildElement(14), 1);
136  m_materials["G10"]->AddElement(nistManager->FindOrBuildElement(8) , 2);
137  m_materials["G10"]->AddElement(nistManager->FindOrBuildElement(6) , 3);
138  m_materials["G10"]->AddElement(nistManager->FindOrBuildElement(1) , 3);
139  m_dEdx["PCB"] = 3.179; // MeV/cm
140 
141  m_materials["PCB"] = m_materials["G10"];
142  m_dEdx["PCB"] = m_dEdx["G10"];
143 
144 
145  m_materials["Brass"] = new G4Material("Brass", 8.5 * g / cm3, 2);
146  m_materials["Brass"]->AddMaterial(m_materials["Cu"] , 70 * perCent);
147  m_materials["Brass"]->AddMaterial(m_materials["Zn"] , 30 * perCent);
148  m_dEdx["Brass"] = 0.7 * m_dEdx["Cu"] + 0.3 * m_dEdx["Zn"];
149  m_materials["Steel"] = new G4Material("Steel", 7.87 * g / cm3, 3);
150  m_materials["Steel"]->AddMaterial(m_materials["Fe"] , 0.9843);
151  m_materials["Steel"]->AddMaterial(m_materials["Mn"], 0.014);
152  m_materials["Steel"]->AddMaterial(m_materials["C"], 0.0017);
153  m_dEdx["Steel"] = 0.9843 * m_dEdx["Fe"] + 0.014 * m_dEdx["Mn"] + 0.0017 * m_dEdx["C"];
154  m_materials["SSteel"] = new G4Material("SSteel", 8.02 * g / cm3, 4);
155  m_materials["SSteel"]->AddMaterial(m_materials["Fe"] , 0.70);
156  m_materials["SSteel"]->AddMaterial(m_materials["Mn"], 0.01);
157  m_materials["SSteel"]->AddMaterial(m_materials["Cr"], 0.19);
158  m_materials["SSteel"]->AddMaterial(m_materials["Ni"], 0.10);
159  m_dEdx["SSteel"]
160  = 0.7 * m_dEdx["Fe"] + 0.01 * m_dEdx["Mn"] + 0.19 * m_dEdx["Cr"] + 0.1 * m_dEdx["Ni"];
161  m_materials["Scintillator"]
162  = nistManager->FindOrBuildMaterial("G4_POLYSTYRENE", false);
163  m_dEdx["Scintillator"] = m_dEdx["C"];
164  G4cout << m_materials["Scintillator"] << G4endl;
165  m_materials["Polystyrole"] = new G4Material("Polystyrole", 1.065 * g / cm3, 2);
166  m_materials["Polystyrole"]->AddMaterial(m_materials["H"] , 50 * perCent);
167  m_materials["Polystyrole"]->AddMaterial(m_materials["C"] , 50 * perCent);
168  m_dEdx["Polystyrole"] = 0.5 * m_dEdx["C"];
169 
170  m_materials["PVC"] = new G4Material("PVC", 1.350 * g / cm3, 3);
171  m_materials["PVC"]->AddMaterial(m_materials["H"] , 50 * perCent);
172  m_materials["PVC"]->AddMaterial(m_materials["C"] , 33.33 * perCent);
173  m_materials["PVC"]->AddMaterial(m_materials["Cl"] , 16.67 * perCent);
174  m_dEdx["PVC"] = 0.33 * m_dEdx["C"];
175 
176  m_materials["CFMix"] = new G4Material("CFMix", 0.120 * g / cm3, 3);
177  m_materials["CFMix"]->AddMaterial(m_materials["Air"] , 0.009);
178  m_materials["CFMix"]->AddMaterial(m_materials["PVC"] , 0.872);
179  m_materials["CFMix"]->AddMaterial(m_materials["Polystyrole"] , 0.119);
180  m_dEdx["CFMix"] = 0;
181 
182  m_materials["Foam"] = new G4Material("Foam", 0.0999 * g / cm3, 2);
183  m_materials["Foam"]->AddMaterial(m_materials["C"] , 0.856);
184  m_materials["Foam"]->AddMaterial(m_materials["H"] , 0.144);
185  m_dEdx["Foam"] = 1.749 * 0.856 * 0.0999 / 10.;
186 
187  m_materials["WCu"] = new G4Material("WCu", 14.979 * g / cm3, 2);
188  m_materials["WCu"]->AddMaterial(m_materials["W"] , 75 * perCent);
189  m_materials["WCu"]->AddMaterial(m_materials["Cu"] , 25 * perCent);
190  m_dEdx["WCu"] = 0.75 * m_dEdx["W"] + 0.25 * m_dEdx["Cu"];
191 
192  m_materials["NeutMod"] = new G4Material("NeutMod", 0.950 * g / cm3, 2);
193  m_materials["NeutMod"]->AddMaterial(m_materials["C"] , 0.85628);
194  m_materials["NeutMod"]->AddMaterial(m_materials["H"] , 0.14372);
195  m_dEdx["NeutMod"] = 1.749 * 0.86 * 0.950 / 10.;
196 
197 }
198 
199 //
200 void DetectorConstruction::UpdateCalorSize()
201 {
202  size_t nsections = m_caloStruct.size();
203 
204  // compute Z extent of detector
205  TBGeometry::Element efirst = m_caloStruct[0].getElement(0);
206  TBGeometry::Element elast = m_caloStruct[nsections - 1].getElement(-1);
207 
208  G4double units = getUnits(m_caloStruct[0].ele_name[0], efirst);
209  G4double center = (elast.dmap["z"] + efirst.dmap["z"]) * units / 2;
210  m_CalorSizeZ
211  = (elast.dmap["z"] - efirst.dmap["z"]
212  + (elast.dmap["thickness"] + efirst.dmap["thickness"]) / 2) * units;
213 
214  // get XY extent of detector
215  m_CellSize = 0;
216  m_CalorSizeXY = 0;
217  for(size_t i = 0; i < nsections; i++) {
218  SamplingSection& section = m_caloStruct[i];
219  size_t nEle = section.n_elements;
220  for (unsigned ie(0); ie < nEle; ++ie) {
221  TBGeometry::Element e = section.getElement(ie);
222 
223 
224 
225  // get the XY extent of the sensitive layers
226  bool isSensitive = false;
227  if ( e.imap.find("sensitive") != e.imap.end() )
228  isSensitive = static_cast<bool>(e.imap["sensitive"]);
229 
230  G4double units = getUnits(section.ele_name[ie], e);
231  if ( e.smap["shape"] == "cylinder" ) {
232  if ( isSensitive ) {
233  G4double maxR = getParameter(section.ele_name[ie],
234  e, "maxRadius") * units;
235  if ( maxR > m_CalorSizeXY ) m_CalorSizeXY = maxR;
236  }
237  } else if ( e.smap["shape"] == "hexagon" ) {
238  if ( isSensitive ) {
239  m_CellSize = getParameter(section.ele_name[ie],
240  e, "cellsize") * units;
241  assert(m_CellSize > 0);
242 
243  // get center-to-corner distance
244  G4double width = 2 * getParameter(section.ele_name[ie],
245  e, "side") * units;
246  if ( width > m_CalorSizeXY ) m_CalorSizeXY = width;
247  }
248  } else if ( e.smap["shape"] == "square" ) {
249  if ( isSensitive ) {
250  G4double side = getParameter(section.ele_name[ie],
251  e, "side") * units;
252  if ( side > m_CalorSizeXY ) m_CalorSizeXY = side;
253  }
254  }
255  }
256  }
257 
258  std::string u = efirst.smap["units"];
259  G4cout << " XY extent of detector: " << m_CalorSizeXY << u << G4endl;
260  G4cout << " Z extent of detector: " << m_CalorSizeZ << u << G4endl;
261  G4cout << " Z location of detector: " << center << u << G4endl;
262  G4cout << " cell size of detector: " << m_CellSize << u << G4endl;
263 }
264 
265 //
266 G4VPhysicalVolume* DetectorConstruction::Construct()
267 {
268 
269  //clean old geometry
270  G4GeometryManager::GetInstance()->OpenGeometry();
271  G4PhysicalVolumeStore::GetInstance()->Clean();
272  G4LogicalVolumeStore::GetInstance()->Clean();
273  G4SolidStore::GetInstance()->Clean();
274 
275  //world
276  TBGeometry::Element world = m_geometry("world");
277 
278  G4double units = getUnits("World", world);
279  G4double expHall_x = world.dmap["xside"] * units;
280  G4double expHall_y = world.dmap["yside"] * units;
281  G4double expHall_z = world.dmap["zside"] * units;
282 
283  G4Box* experimentalHall_box = new G4Box("expHall_box",
284  expHall_x / 2,
285  expHall_y / 2,
286  expHall_z / 2);
287 
288  G4LogicalVolume* experimentalHall_log
289  = new G4LogicalVolume(experimentalHall_box, m_materials["Air"],
290  "expHall_log");
291 
292  G4VPhysicalVolume* experimentalHall_phys
293  = new G4PVPlacement(0, // no rotation
294  G4ThreeVector(0., 0., 0.), // translation position
295  experimentalHall_log, // its logical volume
296  "expHall", // its name
297  0, // its mother volume
298  false, // no boolean operations
299  0); // its copy number
300 
301  // define detector's world volume, basically its
302  // bounding box
303  m_WorldSizeXY = 0.99 * expHall_x;
304  m_WorldSizeZ = 0.99 * expHall_z;
305  m_solidWorld = new G4Box("Wbox",
306  m_WorldSizeXY / 2,
307  m_WorldSizeXY / 2,
308  m_WorldSizeZ / 2);
309 
310  m_logicWorld = new G4LogicalVolume(m_solidWorld,
311  m_materials["Air"],
312  "Wlog");
313  m_logicWorld->SetVisAttributes(G4VisAttributes::Invisible);
314 
315 
316  G4double xpos = 0.*mm;
317  G4double ypos = 0.*mm;
318  G4double zpos = 0.*mm;
319 
320  m_physWorld = new G4PVPlacement(0,
321  G4ThreeVector(xpos, ypos, zpos),
322  m_logicWorld,
323  "Wphys",
324  experimentalHall_log,
325  false, 0);
326  // build the solids that define the geometry
327  buildSectorStack();
328 
329  return experimentalHall_phys;
330 }
331 
332 void DetectorConstruction::buildSectorStack()
333 {
334  char nameBuf[80];
335  G4VSolid* solid = 0;
336  G4double totalLengthX0 = 0;
337  G4double totalLengthL0 = 0;
338 
339  // A section comprises an ordered sequence of elements.
340  // An element is either an air gap, an absorber, or a sensor.
341 
342  G4cout << "== buildSectorStack == " << G4endl;
343  G4cout << "number of sections: " << m_caloStruct.size()
344  << G4endl;
345 
346  for(size_t i = 0; i < m_caloStruct.size(); i++) {
347  G4cout << " ==> section: " << i << G4endl;
348  const size_t nEle = m_caloStruct[i].n_elements;
349  G4cout << " number of elements/section: " << nEle << G4endl;
350 
351 
352  //index for counting sensitive elements/section
353  int idx = 0;
354 
355  // loop over elements of current section
356  for (size_t ie(0); ie < nEle; ++ie) {
357  // NOTE: must be a reference, NOT a copy!
358  SamplingSection& section = m_caloStruct[i];
359 
360  TBGeometry::Element element = section.getElement(ie);
361  G4double units = getUnits(section.ele_name[ie], element);
362 
363  // construct a name for the current element based on its
364  // material
365  std::string eleName = element.smap["material"];
366  sprintf(nameBuf, "%s%d", eleName.c_str(), int(i + 1));
367  // if the element is sensitive, give it a slightly different
368  // name.
369  bool isSensitive = static_cast<bool>(element.imap["sensitive"]);
370  if ( isSensitive ) {
371  sprintf(nameBuf, "%s%d_%d", eleName.c_str(), int(i + 1), idx);
372  idx++;
373  }
374  std::string baseName(nameBuf);
375 
376  G4double thick = element.dmap["thickness"] * units;
377  G4cout << " \telement number: " << ie
378  << "\tname: " << nameBuf
379  << "\tthickness: " << thick << "mm" << G4endl;
380 
381  // build the solid corresponding to the current element
382  solid = constructSolid(baseName, element);
383 
384  // build the logical volume that defines everything about
385  // the element except its location
386  G4LogicalVolume* logi = new G4LogicalVolume(solid,
387  m_materials[eleName],
388  baseName + "log");
389 
390  // cache various quantities for this element: radiation length,
391  // dE/dx, and nuclear interaction length
392  section.ele_X0[ie] = m_materials[eleName]->GetRadlen();
393  section.ele_dEdx[ie] = m_dEdx[eleName];
394  section.ele_L0[ie] = m_materials[eleName]->GetNuclearInterLength();
395  totalLengthX0 += thick / section.ele_X0[ie];
396  totalLengthL0 += thick / section.ele_L0[ie];
397 
398  G4cout << " \t" << eleName
399  << " dEdx=" << section.ele_dEdx[ie]
400  << " X0=" << section.ele_X0[ie]
401  << G4endl
402  << " \tL0=" << section.ele_L0[ie]
403  << G4endl
404  << " \tTotX0=" << totalLengthX0
405  << " \tTotLambda=" << totalLengthL0 << G4endl;
406 
407  // keep track of volumes of sensitive elements
408  if ( isSensitive ) m_logicSi.push_back(logi);
409 
410  // now place volume
411  G4double xpos = getParameter(baseName, element, "x") * units;
412  G4double ypos = getParameter(baseName, element, "y") * units;
413  G4double zpos = getParameter(baseName, element, "z") * units;
414  section.ele_vol[ie] =
415  new G4PVPlacement(0,
416  G4ThreeVector(xpos, ypos, zpos),
417  logi,
418  baseName + "phys",
419  m_logicWorld, false, 0);
420  G4cout << " \tpositioning element at (" << xpos
421  << ", " << ypos << ", " << zpos << ")"
422  << G4endl << G4endl;
423 
424  // make air invisible
425  if ( element.smap["material"] == string("Air") )
426  logi->SetVisAttributes(G4VisAttributes::Invisible);
427  else {
428  G4VisAttributes* simpleBoxVisAtt =
429  new G4VisAttributes(section.g4Colour(ie));
430  simpleBoxVisAtt->SetVisibility(true);
431  logi->SetVisAttributes(simpleBoxVisAtt);
432  }
433 
434 
435  //for sensitive volumes
436  //add region to be able to set specific cuts for it
437  //just for Si
438  if ( isSensitive ) {
439  unsigned nlogicsi = m_logicSi.size();
440  G4Region* aRegion = new G4Region(baseName + "Reg");
441  m_logicSi[nlogicsi - 1]->SetRegion(aRegion);
442  aRegion->AddRootLogicalVolume(m_logicSi[nlogicsi - 1]);
443  }
444  }//loop over elements
445  }//loop over sections
446 }//buildstack
447 
448 
449 void DetectorConstruction::SetMagField(G4double fieldValue)
450 {
451 
452  if(fieldValue <= 0) return;
453 
454  //apply a global uniform magnetic field along Z axis
455  G4FieldManager* fieldMgr
456  = G4TransportationManager::GetTransportationManager()->GetFieldManager();
457  if(m_magField) delete m_magField; //delete the existing magn field
458  m_magField = new G4UniformMagField(G4ThreeVector(0., 0., fieldValue));
459  fieldMgr->SetDetectorField(m_magField);
460  fieldMgr->CreateChordFinder(m_magField);
461  fieldMgr->SetDetectorField(m_magField);
462 }
463 
464 void DetectorConstruction::SetDetModel(G4int model)
465 {
466  if (model <= 0) return;
467  G4cout << " -- Setting detector model to " << model << G4endl;
468  model_ = model;
469 }
470 
471 
472 double DetectorConstruction::getParameter(std::string name,
474  std::string param)
475 {
476  double x = 0;
477  try {
478  x = e.dmap[param];
479  } catch (...) {
480  G4cout << "** DetectorConstruction ** problem building "
481  << "detector element " << name << G4endl
482  << "** parameter " << param << " is missing. Check config file."
483  << G4endl;
484  exit(0);
485  }
486  return x;
487 }
488 
489 
490 G4double DetectorConstruction::getUnits(std::string name,
492 {
493  std::string units;
494  try {
495  units = e.smap["units"];
496  } catch (...) {
497  G4cout << "** DetectorConstruction ** no units given for"
498  << "detector element " << name << G4endl;
499  exit(0);
500  }
501 
502  G4double unit = mm;
503  if ( units == "m" )
504  unit = m;
505  else if ( units == "cm" )
506  unit = cm;
507  return unit;
508 }
509 
510 
511 G4VSolid* DetectorConstruction::constructSolid (std::string baseName,
513 {
514  G4double units = getUnits(baseName, e);
515  G4VSolid* solid = 0;
516  if ( e.smap["shape"] == "cylinder" ) {
517  G4double minR = getParameter(baseName, e, "minRadius") * units;
518  G4double maxR = getParameter(baseName, e, "maxRadius") * units;
519  G4double thickness = getParameter(baseName, e, "thickness") * units;
520  solid = new G4Tubs(baseName + "cyl",
521  minR, maxR, thickness / 2, 0.*deg, 360.0 * deg);
522  } else if ( e.smap["shape"] == "hexagon" ) {
523  G4double thickness = getParameter(baseName, e, "thickness") * units;
524  G4double zPlane[2] = { -thickness / 2, thickness / 2};
525  // feed center-to-side distance to G4Polyhedra
526  // Note: side is full length of hexagon side
527  G4double side = getParameter(baseName, e, "side") * units;
528  double minRadius = (side / 2) * sqrt(3.0) / 2;
529  G4double rInner[2] = {0, 0};
530  G4double rOuter[2] = {minRadius, minRadius};
531  solid = new G4Polyhedra(baseName + "hexa",
532  0,
533  2 * TMath::Pi(),
534  6,
535  2, zPlane,
536  rInner, rOuter);
537  } else if ( e.smap["shape"] == "square" ) {
538  G4double thickness = getParameter(baseName, e, "thickness") * units;
539  G4double side = getParameter(baseName, e, "side") * units;
540  solid = new G4Box(baseName + "box", side / 2, side / 2, thickness / 2);
541  } else {
542  G4cout << "** DetectorConstruction ** problem building "
543  << "detector element " << baseName << G4endl
544  << "** shape " << e.smap["shape"] << " not yet implemented"
545  << G4endl;
546  exit(0);
547  }
548  return solid;
549 }
std::map< std::string, double > dmap
Definition: TBGeometry.h:13
std::map< std::string, int > imap
Definition: TBGeometry.h:14
std::map< std::string, std::string > smap
Definition: TBGeometry.h:12