Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4tgbGeometryDumper.cc
Go to the documentation of this file.
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26// G4tgbGeometryDumper implementation
27//
28// Author: P.Arce, CIEMAT (November 2007)
29// --------------------------------------------------------------------
30
32
33#include "G4tgrMessenger.hh"
34
35#include "G4UIcommand.hh"
36#include "G4Material.hh"
37#include "G4Element.hh"
38#include "G4VSolid.hh"
39#include "G4Box.hh"
40#include "G4Tubs.hh"
41#include "G4Cons.hh"
42#include "G4Trap.hh"
43#include "G4Sphere.hh"
44#include "G4Orb.hh"
45#include "G4Trd.hh"
46#include "G4Para.hh"
47#include "G4Torus.hh"
48#include "G4Hype.hh"
49#include "G4Polycone.hh"
50#include "G4GenericPolycone.hh"
51#include "G4Polyhedra.hh"
52#include "G4EllipticalTube.hh"
53#include "G4Ellipsoid.hh"
54#include "G4EllipticalCone.hh"
55#include "G4Hype.hh"
56#include "G4Tet.hh"
57#include "G4TwistedBox.hh"
58#include "G4TwistedTrap.hh"
59#include "G4TwistedTrd.hh"
60#include "G4TwistedTubs.hh"
61#include "G4PVPlacement.hh"
62#include "G4PVParameterised.hh"
63#include "G4PVReplica.hh"
64#include "G4BooleanSolid.hh"
66#include "G4ReflectedSolid.hh"
71#include "G4SystemOfUnits.hh"
72#include <iomanip>
73
74// --------------------------------------------------------------------
75G4ThreadLocal G4tgbGeometryDumper* G4tgbGeometryDumper::theInstance = nullptr;
76
77// --------------------------------------------------------------------
78G4tgbGeometryDumper::G4tgbGeometryDumper()
79{
80}
81
82// --------------------------------------------------------------------
84{
85 if(theInstance == nullptr)
86 {
87 theInstance = new G4tgbGeometryDumper;
88 }
89 return theInstance;
90}
91
92// --------------------------------------------------------------------
94{
95 theFile = new std::ofstream(fname);
96
98 DumpPhysVol(pv); // dump volume and recursively it will dump all hierarchy
99}
100
101// --------------------------------------------------------------------
103{
105 G4VPhysicalVolume* pv = *(pvstore->cbegin());
106 for(;;)
107 {
109 if(lv == 0)
110 {
111 break;
112 }
113
114 //----- look for one PV of this LV
115 for(auto ite = pvstore->cbegin(); ite != pvstore->cend(); ++ite)
116 {
117 pv = (*ite);
118 if(pv->GetLogicalVolume() == lv)
119 {
120 break;
121 }
122 }
123 }
124
125 return pv;
126}
127
128// --------------------------------------------------------------------
130{
131}
132
133// --------------------------------------------------------------------
135{
136 //--- Dump logical volume first
138
140
141 //--- It is not needed to dump _refl volumes created when parent is reflected
142 // !!WARNING : it must be avoided to reflect a volume hierarchy if children
143 // has also been reflected, as both will have same name
144
145 if(reffact->IsReflected(lv) && reffact->IsReflected(pv->GetMotherLogical()))
146 {
147 return;
148 }
149
150 G4bool bVolExists = CheckIfLogVolExists(lv->GetName(), lv);
151
152 //---- Construct this PV
153 if(pv->GetMotherLogical() != nullptr) // not WORLD volume
154 {
155 if(!pv->IsReplicated())
156 {
157 G4String lvName = lv->GetName();
158 if(!bVolExists)
159 {
160 lvName = DumpLogVol(lv);
161 }
162 DumpPVPlacement(pv, lvName);
163 }
164 else if(pv->IsParameterised())
165 {
166 G4PVParameterised* pvparam = (G4PVParameterised*) (pv);
167 DumpPVParameterised(pvparam);
168 }
169 else
170 {
171 G4String lvName = lv->GetName();
172 if(!bVolExists)
173 {
174 lvName = DumpLogVol(lv);
175 }
176 G4PVReplica* pvrepl = (G4PVReplica*) (pv);
177 DumpPVReplica(pvrepl, lvName);
178 }
179 }
180 else
181 {
182 DumpLogVol(lv);
183 }
184
185 if(!bVolExists)
186 {
187 //---- Construct PV's who has this LV as mother
188 std::vector<G4VPhysicalVolume*> pvChildren = GetPVChildren(lv);
189 for(auto ite = pvChildren.cbegin(); ite != pvChildren.cend(); ++ite)
190 {
191 DumpPhysVol(*ite);
192 }
193 }
194}
195
196// --------------------------------------------------------------------
198 const G4String& lvName, G4int copyNo)
199{
200 G4String pvName = pv->GetName();
201
202 G4RotationMatrix* rotMat = pv->GetRotation();
203 if(rotMat == nullptr)
204 rotMat = new G4RotationMatrix();
205
206 //---- Check if it is reflected
209 if(reffact->IsReflected(lv))
210 {
211#ifdef G4VERBOSE
213 {
214 G4cout << " G4tgbGeometryDumper::DumpPVPlacement() - Reflected volume: "
215 << pv->GetName() << G4endl;
216 }
217#endif
218 G4ThreeVector colx = rotMat->colX();
219 G4ThreeVector coly = rotMat->colY();
220 G4ThreeVector colz = rotMat->colZ();
221 // apply a Z reflection (reflection matrix is decomposed in new
222 // reflection-free rotation + z-reflection)
223 colz *= -1.;
224 G4Rep3x3 rottemp(colx.x(), coly.x(), colz.x(), colx.y(), coly.y(), colz.y(),
225 colx.z(), coly.z(), colz.z());
226 // matrix representation (inverted)
227 *rotMat = G4RotationMatrix(rottemp);
228 *rotMat = (*rotMat).inverse();
229 pvName += "_refl";
230 }
231 G4String rotName = DumpRotationMatrix(rotMat);
232 G4ThreeVector pos = pv->GetTranslation();
233
234 if(copyNo == -999) // for parameterisations copy number is provided
235 {
236 copyNo = pv->GetCopyNo();
237 }
238
239 G4String fullname = pvName + "#" + G4UIcommand::ConvertToString(copyNo) +
240 "/" + pv->GetMotherLogical()->GetName();
241
242 if(!CheckIfPhysVolExists(fullname, pv))
243 {
244 (*theFile) << ":PLACE " << SubstituteRefl(AddQuotes(lvName)) << " "
245 << copyNo << " "
246 << SubstituteRefl(AddQuotes(pv->GetMotherLogical()->GetName()))
247 << " " << AddQuotes(rotName) << " " << pos.x() << " " << pos.y()
248 << " " << pos.z() << G4endl;
249
250 thePhysVols[fullname] = pv;
251 }
252}
253
254// --------------------------------------------------------------------
256{
257 G4String pvName = pv->GetName();
258
259 EAxis axis;
260 G4int nReplicas;
261 G4double width;
262 G4double offset;
263 G4bool consuming;
264 pv->GetReplicationData(axis, nReplicas, width, offset, consuming);
265
267
269 G4VSolid* solid1st = param->ComputeSolid(0, pv);
270 G4Material* mate1st = param->ComputeMaterial(0, pv);
271 std::vector<G4double> params1st = GetSolidParams(solid1st);
272 std::vector<G4double> newParams;
273 G4VSolid* newSolid = solid1st;
274 G4String lvName;
275
276 for(G4int ii = 0; ii < nReplicas; ++ii)
277 {
278 G4Material* newMate = param->ComputeMaterial(ii, pv);
279 if(solid1st->GetEntityType() == "G4Box")
280 {
281 G4Box* box = (G4Box*) (solid1st);
282 param->ComputeDimensions(*box, ii, pv);
283 newParams = GetSolidParams(box);
284 newSolid = (G4VSolid*) box;
285 }
286 else if(solid1st->GetEntityType() == "G4Tubs")
287 {
288 G4Tubs* tubs = (G4Tubs*) (solid1st);
289 param->ComputeDimensions(*tubs, ii, pv);
290 newParams = GetSolidParams(tubs);
291 newSolid = (G4VSolid*) tubs;
292 }
293 else if(solid1st->GetEntityType() == "G4Trd")
294 {
295 G4Trd* trd = (G4Trd*) (solid1st);
296 param->ComputeDimensions(*trd, ii, pv);
297 newParams = GetSolidParams(trd);
298 newSolid = (G4VSolid*) trd;
299 }
300 else if(solid1st->GetEntityType() == "G4Trap")
301 {
302 G4Trap* trap = (G4Trap*) (solid1st);
303 param->ComputeDimensions(*trap, ii, pv);
304 newParams = GetSolidParams(trap);
305 newSolid = (G4VSolid*) trap;
306 }
307 else if(solid1st->GetEntityType() == "G4Cons")
308 {
309 G4Cons* cons = (G4Cons*) (solid1st);
310 param->ComputeDimensions(*cons, ii, pv);
311 newParams = GetSolidParams(cons);
312 newSolid = (G4VSolid*) cons;
313 }
314 else if(solid1st->GetEntityType() == "G4Sphere")
315 {
316 G4Sphere* sphere = (G4Sphere*) (solid1st);
317 param->ComputeDimensions(*sphere, ii, pv);
318 newParams = GetSolidParams(sphere);
319 newSolid = (G4VSolid*) sphere;
320 }
321 else if(solid1st->GetEntityType() == "G4Orb")
322 {
323 G4Orb* orb = (G4Orb*) (solid1st);
324 param->ComputeDimensions(*orb, ii, pv);
325 newParams = GetSolidParams(orb);
326 newSolid = (G4VSolid*) orb;
327 }
328 else if(solid1st->GetEntityType() == "G4Torus")
329 {
330 G4Torus* torus = (G4Torus*) (solid1st);
331 param->ComputeDimensions(*torus, ii, pv);
332 newParams = GetSolidParams(torus);
333 newSolid = (G4VSolid*) torus;
334 }
335 else if(solid1st->GetEntityType() == "G4Para")
336 {
337 G4Para* para = (G4Para*) (solid1st);
338 param->ComputeDimensions(*para, ii, pv);
339 newParams = GetSolidParams(para);
340 newSolid = (G4VSolid*) para;
341 }
342 else if(solid1st->GetEntityType() == "G4Polycone")
343 {
344 G4Polycone* polycone = (G4Polycone*) (solid1st);
345 param->ComputeDimensions(*polycone, ii, pv);
346 newParams = GetSolidParams(polycone);
347 newSolid = (G4VSolid*) polycone;
348 }
349 else if(solid1st->GetEntityType() == "G4Polyhedra")
350 {
351 G4Polyhedra* polyhedra = (G4Polyhedra*) (solid1st);
352 param->ComputeDimensions(*polyhedra, ii, pv);
353 newParams = GetSolidParams(polyhedra);
354 newSolid = (G4VSolid*) polyhedra;
355 }
356 else if(solid1st->GetEntityType() == "G4Hype")
357 {
358 G4Hype* hype = (G4Hype*) (solid1st);
359 param->ComputeDimensions(*hype, ii, pv);
360 newParams = GetSolidParams(hype);
361 newSolid = (G4VSolid*) hype;
362 }
363 if(ii == 0 || mate1st != newMate || params1st[0] != newParams[0])
364 {
365 G4String extraName = "";
366 if(ii != 0)
367 {
368 extraName = "#" + G4UIcommand::ConvertToString(ii) + "/" +
369 pv->GetMotherLogical()->GetName();
370 }
371 lvName = DumpLogVol(lv, extraName, newSolid, newMate);
372 }
373
374 param->ComputeTransformation(ii, pv);
375 DumpPVPlacement(pv, lvName, ii);
376 }
377}
378
379// --------------------------------------------------------------------
381{
382 EAxis axis;
383 G4int nReplicas;
384 G4double width;
385 G4double offset;
386 G4bool consuming;
387 pv->GetReplicationData(axis, nReplicas, width, offset, consuming);
388 G4String axisName;
389 switch(axis)
390 {
391 case kXAxis:
392 axisName = "X";
393 break;
394 case kYAxis:
395 axisName = "Y";
396 break;
397 case kZAxis:
398 axisName = "Z";
399 break;
400 case kRho:
401 axisName = "R";
402 break;
403 case kPhi:
404 axisName = "PHI";
405 break;
406 case kRadial3D:
407 case kUndefined:
408 G4String ErrMessage =
409 "Unknown axis of replication for volume" + pv->GetName();
410 G4Exception("G4tgbGeometryDumper::DumpPVReplica", "Wrong axis ",
411 FatalException, ErrMessage);
412 break;
413 }
414
415 G4String fullname = lvName + "/" + pv->GetMotherLogical()->GetName();
416
417 if(!CheckIfPhysVolExists(fullname, pv))
418 {
419 (*theFile) << ":REPL " << SubstituteRefl(AddQuotes(lvName)) << " "
420 << SubstituteRefl(AddQuotes(pv->GetMotherLogical()->GetName()))
421 << " " << axisName << " " << nReplicas;
422 if(axis != kPhi)
423 {
424 (*theFile) << " " << width << " " << offset << G4endl;
425 }
426 else
427 {
428 (*theFile) << " " << width / deg << "*deg"
429 << " " << offset / deg << "*deg" << G4endl;
430 }
431
432 thePhysVols[fullname] = pv;
433 }
434}
435
436// --------------------------------------------------------------------
438 const G4String& extraName,
439 G4VSolid* solid,
440 G4Material* mate)
441{
442 G4String lvName;
443
444 if(extraName == "") //--- take out the '_refl' in the name
445 {
446 lvName = GetObjectName(lv, theLogVols);
447 }
448 else
449 {
450 lvName = lv->GetName() + extraName;
451 }
452
453 if(theLogVols.find(lvName) != theLogVols.cend()) // alredy dumped
454 {
455 return lvName;
456 }
457
458 if(solid == nullptr)
459 {
460 solid = lv->GetSolid();
461 }
462
463 //---- Dump solid
464 G4String solidName = DumpSolid(solid, extraName);
465
466 //---- Dump material
467 if(mate == nullptr)
468 {
469 mate = lv->GetMaterial();
470 }
471 G4String mateName = DumpMaterial(mate);
472
473 //---- Dump logical volume (solid + material)
474 (*theFile) << ":VOLU " << SubstituteRefl(AddQuotes(lvName)) << " "
475 << SupressRefl(AddQuotes(solidName)) << " " << AddQuotes(mateName)
476 << G4endl;
477
478 theLogVols[lvName] = lv;
479
480 return lvName;
481}
482
483// --------------------------------------------------------------------
485{
486 G4String mateName = GetObjectName(mat, theMaterials);
487 if(theMaterials.find(mateName) != theMaterials.cend()) // alredy dumped
488 {
489 return mateName;
490 }
491
492 std::size_t numElements = mat->GetNumberOfElements();
493 G4double density = mat->GetDensity() / g * cm3;
494
495 // start tag
496 //
497 if(numElements == 1)
498 {
499 (*theFile) << ":MATE " << AddQuotes(mateName) << " " << mat->GetZ() << " "
500 << mat->GetA() / (g / mole) << " " << density << G4endl;
501 }
502 else
503 {
504 const G4ElementVector* elems = mat->GetElementVector();
505 const G4double* fractions = mat->GetFractionVector();
506 for(std::size_t ii = 0; ii < numElements; ++ii)
507 {
508 DumpElement((*elems)[ii]);
509 }
510
511 (*theFile) << ":MIXT " << AddQuotes(mateName) << " " << density << " "
512 << numElements << G4endl;
513 // close start element tag and get ready to do composit "parts"
514 for(std::size_t ii = 0; ii < numElements; ++ii)
515 {
516 (*theFile) << " " << AddQuotes(GetObjectName((*elems)[ii], theElements))
517 << " " << fractions[ii] << G4endl;
518 }
519 }
520
521 (*theFile) << ":MATE_MEE " << AddQuotes(mateName) << " "
522 << mat->GetIonisation()->GetMeanExcitationEnergy() / eV << "*eV"
523 << G4endl;
524
525 (*theFile) << ":MATE_TEMPERATURE " << AddQuotes(mateName) << " "
526 << mat->GetTemperature() / kelvin << "*kelvin" << G4endl;
527
528 (*theFile) << ":MATE_PRESSURE " << AddQuotes(mateName) << " "
529 << mat->GetPressure() / atmosphere << "*atmosphere" << G4endl;
530
531 G4State state = mat->GetState();
532 G4String stateStr;
533 switch(state)
534 {
535 case kStateUndefined:
536 stateStr = "Undefined";
537 break;
538 case kStateSolid:
539 stateStr = "Solid";
540 break;
541 case kStateLiquid:
542 stateStr = "Liquid";
543 break;
544 case kStateGas:
545 stateStr = "Gas";
546 break;
547 }
548
549 (*theFile) << ":MATE_STATE " << AddQuotes(mateName) << " " << stateStr
550 << G4endl;
551
552 theMaterials[mateName] = mat;
553
554 return mateName;
555}
556
557// --------------------------------------------------------------------
559{
560 G4String elemName = GetObjectName(ele, theElements);
561
562 if(theElements.find(elemName) != theElements.cend()) // alredy dumped
563 {
564 return;
565 }
566
567 //--- Add symbol name: Material mixtures store the components as elements
568 // (even if the input are materials), but without symbol
569 //
570 G4String symbol = ele->GetSymbol();
571 if(symbol == "" || symbol == " ")
572 {
573 symbol = elemName;
574 }
575
576 if(ele->GetNumberOfIsotopes() == 0)
577 {
578 (*theFile) << ":ELEM " << AddQuotes(elemName) << " " << AddQuotes(symbol)
579 << " " << ele->GetZ() << " " << ele->GetA() / (g / mole) << " "
580 << G4endl;
581 }
582 else
583 {
584 const G4IsotopeVector* isots = ele->GetIsotopeVector();
585 for(std::size_t ii = 0; ii < ele->GetNumberOfIsotopes(); ++ii)
586 {
587 DumpIsotope((*isots)[ii]);
588 }
589
590 (*theFile) << ":ELEM_FROM_ISOT " << AddQuotes(elemName) << " "
591 << AddQuotes(symbol) << " " << ele->GetNumberOfIsotopes()
592 << G4endl;
593 const G4double* fractions = ele->GetRelativeAbundanceVector();
594 for(std::size_t ii = 0; ii < ele->GetNumberOfIsotopes(); ++ii)
595 {
596 (*theFile) << " " << AddQuotes(GetObjectName((*isots)[ii], theIsotopes))
597 << " " << fractions[ii] << G4endl;
598 }
599 }
600 theElements[elemName] = ele;
601}
602
603// --------------------------------------------------------------------
605{
606 G4String isotName = GetObjectName(isot, theIsotopes);
607 if(theIsotopes.find(isotName) != theIsotopes.cend()) // alredy dumped
608 {
609 return;
610 }
611
612 (*theFile) << ":ISOT " << AddQuotes(isotName) << " " << isot->GetZ() << " "
613 << isot->GetN() << " " << isot->GetA() / (g / mole) << " "
614 << G4endl;
615
616 theIsotopes[isotName] = isot;
617}
618
619// --------------------------------------------------------------------
621 const G4String& extraName)
622{
623 G4String solidName;
624 if(extraName == "")
625 {
626 solidName = GetObjectName(solid, theSolids);
627 }
628 else
629 {
630 solidName = solid->GetName() + extraName;
631 }
632
633 if(theSolids.find(solidName) != theSolids.cend()) // alredy dumped
634 {
635 return solidName;
636 }
637
638 G4String solidType = solid->GetEntityType();
639 solidType = GetTGSolidType(solidType);
640
641 if(solidType == "UNIONSOLID")
642 {
643 DumpBooleanVolume("UNION", solid);
644 }
645 else if(solidType == "SUBTRACTIONSOLID")
646 {
647 DumpBooleanVolume("SUBTRACTION", solid);
648 }
649 else if(solidType == "INTERSECTIONSOLID")
650 {
651 DumpBooleanVolume("INTERSECTION", solid);
652 }
653 else if(solidType == "REFLECTEDSOLID")
654 {
655 G4ReflectedSolid* solidrefl = dynamic_cast<G4ReflectedSolid*>(solid);
656 if(solidrefl == nullptr)
657 {
658 G4Exception("G4tgbGeometryDumper::DumpSolid()", "InvalidType",
659 FatalException, "Invalid reflected solid!");
660 return solidName;
661 }
662 G4VSolid* solidori = solidrefl->GetConstituentMovedSolid();
663 DumpSolid(solidori);
664 }
665 else
666 {
667 (*theFile) << ":SOLID " << AddQuotes(solidName) << " ";
668 (*theFile) << AddQuotes(solidType) << " ";
669 DumpSolidParams(solid);
670 theSolids[solidName] = solid;
671 }
672
673 return solidName;
674}
675
676// --------------------------------------------------------------------
678 G4VSolid* so)
679{
680 G4BooleanSolid* bso = dynamic_cast<G4BooleanSolid*>(so);
681 if(bso == nullptr)
682 {
683 return;
684 }
685 G4VSolid* solid0 = bso->GetConstituentSolid(0);
686 G4VSolid* solid1 = bso->GetConstituentSolid(1);
687 G4DisplacedSolid* solid1Disp = nullptr;
688 G4bool displaced = dynamic_cast<G4DisplacedSolid*>(solid1);
689 if(displaced)
690 {
691 solid1Disp = dynamic_cast<G4DisplacedSolid*>(solid1);
692 if(solid1Disp != nullptr)
693 {
694 solid1 = solid1Disp->GetConstituentMovedSolid();
695 }
696 else
697 {
698 return;
699 }
700 }
701 DumpSolid(solid0);
702 DumpSolid(solid1);
703
704 G4String rotName;
705 G4ThreeVector pos;
706 if(displaced)
707 {
708 pos = solid1Disp->GetObjectTranslation(); // translation is of mother frame
710 (solid1Disp->GetTransform().NetRotation()).inverse()));
711 }
712 else // no displacement
713 {
715 pos = G4ThreeVector();
716 }
717
718 G4String bsoName = GetObjectName(so, theSolids);
719 if(theSolids.find(bsoName) != theSolids.cend())
720 return; // alredy dumped
721 G4String solid0Name = FindSolidName(solid0);
722 G4String solid1Name = FindSolidName(solid1);
723
724 (*theFile) << ":SOLID " << AddQuotes(bsoName) << " " << AddQuotes(solidType)
725 << " " << AddQuotes(solid0Name) << " " << AddQuotes(solid1Name)
726 << " " << AddQuotes(rotName) << " " << approxTo0(pos.x()) << " "
727 << approxTo0(pos.y()) << " " << approxTo0(pos.z()) << " "
728 << G4endl;
729
730 theSolids[bsoName] = bso;
731}
732
733// --------------------------------------------------------------------
735{
736 std::vector<G4double> params = GetSolidParams(so);
737 for(std::size_t ii = 0; ii < params.size(); ++ii)
738 {
739 (*theFile) << params[ii] << " ";
740 }
741 (*theFile) << G4endl;
742}
743
744// --------------------------------------------------------------------
745std::vector<G4double> G4tgbGeometryDumper::GetSolidParams(const G4VSolid* so)
746{
747 std::vector<G4double> params;
748
749 G4String solidType = so->GetEntityType();
750 solidType = GetTGSolidType(solidType);
751
752 if(solidType == "BOX")
753 {
754 const G4Box* sb = dynamic_cast<const G4Box*>(so);
755 if(sb != nullptr)
756 {
757 params.push_back(sb->GetXHalfLength());
758 params.push_back(sb->GetYHalfLength());
759 params.push_back(sb->GetZHalfLength());
760 }
761 }
762 else if(solidType == "TUBS")
763 {
764 const G4Tubs* tu = dynamic_cast<const G4Tubs*>(so);
765 if(tu != nullptr)
766 {
767 params.push_back(tu->GetInnerRadius());
768 params.push_back(tu->GetOuterRadius());
769 params.push_back(tu->GetZHalfLength());
770 params.push_back(tu->GetStartPhiAngle() / deg);
771 params.push_back(tu->GetDeltaPhiAngle() / deg);
772 }
773 }
774 else if(solidType == "TRAP")
775 {
776 const G4Trap* trp = dynamic_cast<const G4Trap*>(so);
777 if(trp != nullptr)
778 {
779 G4ThreeVector symAxis(trp->GetSymAxis());
780 params.push_back(trp->GetZHalfLength());
781 params.push_back(symAxis.theta() / deg);
782 params.push_back(symAxis.phi() / deg);
783 params.push_back(trp->GetYHalfLength1());
784 params.push_back(trp->GetXHalfLength1());
785 params.push_back(trp->GetXHalfLength2());
786 params.push_back(std::atan(trp->GetTanAlpha1()) / deg);
787 params.push_back(trp->GetYHalfLength2());
788 params.push_back(trp->GetXHalfLength3());
789 params.push_back(trp->GetXHalfLength4());
790 params.push_back(std::atan(trp->GetTanAlpha2()) / deg);
791 }
792 }
793 else if(solidType == "TRD")
794 {
795 const G4Trd* tr = dynamic_cast<const G4Trd*>(so);
796 if(tr != nullptr)
797 {
798 params.push_back(tr->GetXHalfLength1());
799 params.push_back(tr->GetXHalfLength2());
800 params.push_back(tr->GetYHalfLength1());
801 params.push_back(tr->GetYHalfLength2());
802 params.push_back(tr->GetZHalfLength());
803 }
804 }
805 else if(solidType == "PARA")
806 {
807 const G4Para* para = dynamic_cast<const G4Para*>(so);
808 if(para != nullptr)
809 {
810 G4ThreeVector symAxis(para->GetSymAxis());
811 params.push_back(para->GetXHalfLength());
812 params.push_back(para->GetYHalfLength());
813 params.push_back(para->GetZHalfLength());
814 params.push_back(std::atan(para->GetTanAlpha()) / deg);
815 params.push_back(symAxis.theta() / deg);
816 params.push_back(symAxis.phi() / deg);
817 }
818 }
819 else if(solidType == "CONS")
820 {
821 const G4Cons* cn = dynamic_cast<const G4Cons*>(so);
822 if(cn != nullptr)
823 {
824 params.push_back(cn->GetInnerRadiusMinusZ());
825 params.push_back(cn->GetOuterRadiusMinusZ());
826 params.push_back(cn->GetInnerRadiusPlusZ());
827 params.push_back(cn->GetOuterRadiusPlusZ());
828 params.push_back(cn->GetZHalfLength());
829 params.push_back(cn->GetStartPhiAngle() / deg);
830 params.push_back(cn->GetDeltaPhiAngle() / deg);
831 }
832 }
833 else if(solidType == "SPHERE")
834 {
835 const G4Sphere* sphere = dynamic_cast<const G4Sphere*>(so);
836 if(sphere != nullptr)
837 {
838 params.push_back(sphere->GetInnerRadius());
839 params.push_back(sphere->GetOuterRadius());
840 params.push_back(sphere->GetStartPhiAngle() / deg);
841 params.push_back(sphere->GetDeltaPhiAngle() / deg);
842 params.push_back(sphere->GetStartThetaAngle() / deg);
843 params.push_back(sphere->GetDeltaThetaAngle() / deg);
844 }
845 }
846 else if(solidType == "ORB")
847 {
848 const G4Orb* orb = dynamic_cast<const G4Orb*>(so);
849 if(orb != nullptr)
850 {
851 params.push_back(orb->GetRadius());
852 }
853 }
854 else if(solidType == "TORUS")
855 {
856 const G4Torus* torus = dynamic_cast<const G4Torus*>(so);
857 if(torus != nullptr)
858 {
859 params.push_back(torus->GetRmin());
860 params.push_back(torus->GetRmax());
861 params.push_back(torus->GetRtor());
862 params.push_back(torus->GetSPhi() / deg);
863 params.push_back(torus->GetDPhi() / deg);
864 }
865 }
866 else if(solidType == "POLYCONE")
867 {
868 //--- Dump RZ corners, as original parameters will not be present
869 // if it was build from RZ corners
870 const G4Polycone* plc = dynamic_cast<const G4Polycone*>(so);
871 if(plc != nullptr)
872 {
873 G4double angphi = plc->GetStartPhi() / deg;
874 if(angphi > 180 * deg)
875 {
876 angphi -= 360 * deg;
877 }
878 G4int ncor = plc->GetNumRZCorner();
879 params.push_back(angphi);
880 params.push_back(plc->GetOriginalParameters()->Opening_angle / deg);
881 params.push_back(ncor);
882
883 for(G4int ii = 0; ii < ncor; ++ii)
884 {
885 params.push_back(plc->GetCorner(ii).r);
886 params.push_back(plc->GetCorner(ii).z);
887 }
888 }
889 }
890 else if(solidType == "GENERICPOLYCONE")
891 {
892 //--- Dump RZ corners
893 const G4GenericPolycone* plc = dynamic_cast<const G4GenericPolycone*>(so);
894 if(plc != nullptr)
895 {
896 G4double angphi = plc->GetStartPhi() / deg;
897 if(angphi > 180 * deg)
898 {
899 angphi -= 360 * deg;
900 }
901 G4double endphi = plc->GetEndPhi() / deg;
902 if(endphi > 180 * deg)
903 {
904 endphi -= 360 * deg;
905 }
906 G4int ncor = plc->GetNumRZCorner();
907 params.push_back(angphi);
908 params.push_back(endphi - angphi);
909 params.push_back(ncor);
910
911 for(G4int ii = 0; ii < ncor; ++ii)
912 {
913 params.push_back(plc->GetCorner(ii).r);
914 params.push_back(plc->GetCorner(ii).z);
915 }
916 }
917 }
918 else if(solidType == "POLYHEDRA")
919 {
920 //--- Dump RZ corners, as original parameters will not be present
921 // if it was build from RZ corners
922 const G4Polyhedra* ph = (dynamic_cast<const G4Polyhedra*>(so));
923 if(ph != nullptr)
924 {
925 G4double angphi = ph->GetStartPhi() / deg;
926 if(angphi > 180 * deg)
927 angphi -= 360 * deg;
928
929 G4int ncor = ph->GetNumRZCorner();
930
931 params.push_back(angphi);
932 params.push_back(ph->GetOriginalParameters()->Opening_angle / deg);
933 params.push_back(ph->GetNumSide());
934 params.push_back(ncor);
935
936 for(G4int ii = 0; ii < ncor; ++ii)
937 {
938 params.push_back(ph->GetCorner(ii).r);
939 params.push_back(ph->GetCorner(ii).z);
940 }
941 }
942 }
943 else if(solidType == "ELLIPTICALTUBE")
944 {
945 const G4EllipticalTube* eltu = dynamic_cast<const G4EllipticalTube*>(so);
946 if(eltu != nullptr)
947 {
948 params.push_back(eltu->GetDx());
949 params.push_back(eltu->GetDy());
950 params.push_back(eltu->GetDz());
951 }
952 }
953 else if(solidType == "ELLIPSOID")
954 {
955 const G4Ellipsoid* dso = dynamic_cast<const G4Ellipsoid*>(so);
956 if(dso != nullptr)
957 {
958 params.push_back(dso->GetSemiAxisMax(0));
959 params.push_back(dso->GetSemiAxisMax(1));
960 params.push_back(dso->GetSemiAxisMax(2));
961 params.push_back(dso->GetZBottomCut());
962 params.push_back(dso->GetZTopCut());
963 }
964 }
965 else if(solidType == "ELLIPTICAL_CONE")
966 {
967 const G4EllipticalCone* elco = dynamic_cast<const G4EllipticalCone*>(so);
968 if(elco != nullptr)
969 {
970 params.push_back(elco->GetSemiAxisX());
971 params.push_back(elco->GetSemiAxisY());
972 params.push_back(elco->GetZMax());
973 params.push_back(elco->GetZTopCut());
974 }
975 }
976 else if(solidType == "HYPE")
977 {
978 const G4Hype* hype = dynamic_cast<const G4Hype*>(so);
979 if(hype != nullptr)
980 {
981 params.push_back(hype->GetInnerRadius());
982 params.push_back(hype->GetOuterRadius());
983 params.push_back(hype->GetInnerStereo() / deg);
984 params.push_back(hype->GetOuterStereo() / deg);
985 params.push_back(2 * hype->GetZHalfLength());
986 }
987 // } else if( solidType == "TET" ) {
988 }
989 else if(solidType == "TWISTEDBOX")
990 {
991 const G4TwistedBox* tbox = dynamic_cast<const G4TwistedBox*>(so);
992 if(tbox != nullptr)
993 {
994 params.push_back(tbox->GetPhiTwist() / deg);
995 params.push_back(tbox->GetXHalfLength());
996 params.push_back(tbox->GetYHalfLength());
997 params.push_back(tbox->GetZHalfLength());
998 }
999 }
1000 else if(solidType == "TWISTEDTRAP")
1001 {
1002 const G4TwistedTrap* ttrap = dynamic_cast<const G4TwistedTrap*>(so);
1003 if(ttrap != nullptr)
1004 {
1005 params.push_back(ttrap->GetPhiTwist() / deg);
1006 params.push_back(ttrap->GetZHalfLength());
1007 params.push_back(ttrap->GetPolarAngleTheta() / deg);
1008 params.push_back(ttrap->GetAzimuthalAnglePhi() / deg);
1009 params.push_back(ttrap->GetY1HalfLength());
1010 params.push_back(ttrap->GetX1HalfLength());
1011 params.push_back(ttrap->GetX2HalfLength());
1012 params.push_back(ttrap->GetY2HalfLength());
1013 params.push_back(ttrap->GetX3HalfLength());
1014 params.push_back(ttrap->GetX4HalfLength());
1015 params.push_back(ttrap->GetTiltAngleAlpha() / deg);
1016 }
1017 }
1018 else if(solidType == "TWISTEDTRD")
1019 {
1020 const G4TwistedTrd* ttrd = dynamic_cast<const G4TwistedTrd*>(so);
1021 if(ttrd != nullptr)
1022 {
1023 params.push_back(ttrd->GetX1HalfLength());
1024 params.push_back(ttrd->GetX2HalfLength());
1025 params.push_back(ttrd->GetY1HalfLength());
1026 params.push_back(ttrd->GetY2HalfLength());
1027 params.push_back(ttrd->GetZHalfLength());
1028 params.push_back(ttrd->GetPhiTwist() / deg);
1029 }
1030 }
1031 else if(solidType == "TWISTEDTUBS")
1032 {
1033 const G4TwistedTubs* ttub = dynamic_cast<const G4TwistedTubs*>(so);
1034 if(ttub != nullptr)
1035 {
1036 params.push_back(ttub->GetInnerRadius());
1037 params.push_back(ttub->GetOuterRadius());
1038 params.push_back(ttub->GetZHalfLength());
1039 params.push_back(ttub->GetDPhi() / deg);
1040 params.push_back(ttub->GetPhiTwist() / deg);
1041 }
1042 }
1043 else
1044 {
1045 G4String ErrMessage = "Solid type not supported, sorry... " + solidType;
1046 G4Exception("G4tgbGeometryDumpe::DumpSolidParams()", "NotImplemented",
1047 FatalException, ErrMessage);
1048 }
1049
1050 return params;
1051}
1052
1053// --------------------------------------------------------------------
1055{
1056 if(rotm == nullptr)
1057 {
1058 rotm = new G4RotationMatrix();
1059 }
1060
1061 G4double de = MatDeterminant(rotm);
1062 G4String rotName = LookForExistingRotation(rotm);
1063 if(rotName != "")
1064 {
1065 return rotName;
1066 }
1067
1068 G4ThreeVector v(1., 1., 1.);
1069 if(de < -0.9) // a reflection ....
1070 {
1071 (*theFile) << ":ROTM ";
1072 rotName = "RRM";
1073 rotName += G4UIcommand::ConvertToString(theRotationNumber++);
1074
1075 (*theFile) << AddQuotes(rotName) << std::setprecision(9) << " "
1076 << approxTo0(rotm->xx()) << " " << approxTo0(rotm->yx()) << " "
1077 << approxTo0(rotm->zx()) << " " << approxTo0(rotm->xy()) << " "
1078 << approxTo0(rotm->yy()) << " " << approxTo0(rotm->zy()) << " "
1079 << approxTo0(rotm->xz()) << " " << approxTo0(rotm->yz()) << " "
1080 << approxTo0(rotm->zz()) << G4endl;
1081 }
1082 else if(de > 0.9) // a rotation ....
1083 {
1084 (*theFile) << ":ROTM ";
1085 rotName = "RM";
1086 rotName += G4UIcommand::ConvertToString(theRotationNumber++);
1087
1088 (*theFile) << AddQuotes(rotName) << " " << approxTo0(rotm->thetaX() / deg)
1089 << " " << approxTo0(rotm->phiX() / deg) << " "
1090 << approxTo0(rotm->thetaY() / deg) << " "
1091 << approxTo0(rotm->phiY() / deg) << " "
1092 << approxTo0(rotm->thetaZ() / deg) << " "
1093 << approxTo0(rotm->phiZ() / deg) << G4endl;
1094 }
1095
1096 theRotMats[rotName] = rotm;
1097
1098 return rotName;
1099}
1100
1101// --------------------------------------------------------------------
1102std::vector<G4VPhysicalVolume*>
1103G4tgbGeometryDumper::GetPVChildren(G4LogicalVolume* lv)
1104{
1106 std::vector<G4VPhysicalVolume*> children;
1107 for(auto ite = pvstore->cbegin(); ite != pvstore->cend(); ++ite)
1108 {
1109 if((*ite)->GetMotherLogical() == lv)
1110 {
1111 children.push_back(*ite);
1112#ifdef G4VERBOSE
1114 {
1115 G4cout << " G4tgbGeometryDumper::GetPVChildren() - adding children: "
1116 << (*ite)->GetName() << " of " << lv->GetName() << G4endl;
1117 }
1118#endif
1119 }
1120 }
1121
1122 return children;
1123}
1124
1125// --------------------------------------------------------------------
1126G4String G4tgbGeometryDumper::GetTGSolidType(const G4String& solidType)
1127{
1128 G4String newsolidType = solidType.substr(2, solidType.length());
1129 for(std::size_t ii = 0; ii < newsolidType.length(); ++ii)
1130 {
1131 newsolidType[ii] = toupper(newsolidType[ii]);
1132 }
1133 return newsolidType;
1134}
1135
1136// --------------------------------------------------------------------
1137G4double G4tgbGeometryDumper::MatDeterminant(G4RotationMatrix* ro)
1138{
1139 G4Rep3x3 r = ro->rep3x3();
1140 return r.xx_ * (r.yy_ * r.zz_ - r.zy_ * r.yz_) -
1141 r.yx_ * (r.xy_ * r.zz_ - r.zy_ * r.xz_) +
1142 r.zx_ * (r.xy_ * r.yz_ - r.yy_ * r.xz_);
1143}
1144
1145// --------------------------------------------------------------------
1146G4double G4tgbGeometryDumper::approxTo0(G4double val)
1147{
1148 G4double precision =
1150
1151 if(std::fabs(val) < precision)
1152 {
1153 val = 0.0;
1154 }
1155 return val;
1156}
1157
1158// --------------------------------------------------------------------
1159G4String G4tgbGeometryDumper::AddQuotes(const G4String& str)
1160{
1161 //--- look if there is a separating blank
1162
1163 G4bool bBlank = FALSE;
1164 std::size_t siz = str.length();
1165 for(std::size_t ii = 0; ii < siz; ++ii)
1166 {
1167 if(str.substr(ii, 1) == " ")
1168 {
1169 bBlank = TRUE;
1170 break;
1171 }
1172 }
1173 G4String str2 = str;
1174 if(bBlank)
1175 {
1176 str2 = G4String("\"") + str2 + G4String("\"");
1177 }
1178 return str2;
1179}
1180
1181// --------------------------------------------------------------------
1182G4String G4tgbGeometryDumper::SupressRefl(G4String name)
1183{
1184 G4int irefl = name.rfind("_refl");
1185 if(irefl != -1)
1186 {
1187 name = name.substr(0, irefl);
1188 }
1189 return name;
1190}
1191
1192// --------------------------------------------------------------------
1193G4String G4tgbGeometryDumper::SubstituteRefl(G4String name)
1194{
1195 G4int irefl = name.rfind("_refl");
1196 if(irefl != -1)
1197 {
1198 name = name.substr(0, irefl) + "_REFL";
1199 }
1200 return name;
1201}
1202
1203// --------------------------------------------------------------------
1204G4String G4tgbGeometryDumper::GetIsotopeName(G4Isotope* isot)
1205{
1206 G4String isotName = isot->GetName();
1207 // first look if this is isotope is already dumped,
1208 // with original isotope name or new one
1209 //
1210 std::map<G4String, G4Isotope*>::const_iterator ite;
1211 for(ite = theIsotopes.cbegin(); ite != theIsotopes.cend(); ++ite)
1212 {
1213 if(isot == (*ite).second)
1214 {
1215 return (*ite).first;
1216 }
1217 }
1218
1219 // Now look if there is another isotope dumped with same name,
1220 // and if found add _N to the name
1221 //
1222 ite = theIsotopes.find(isotName);
1223 if(ite != theIsotopes.cend()) // Isotope found with same name
1224 {
1225 G4Isotope* isotold = (*ite).second;
1226 if(isot != isotold) // new isotope it is not the really
1227 { // the same one as isotope found
1228 if(!Same2G4Isotopes(isot, isotold))
1229 { // if the two have same data, use the old one
1230 G4int ii = 2; // G4Nist does names isotopes of same element
1231 // with same name
1232 for(;; ++ii)
1233 {
1234 G4String newIsotName =
1235 isotName + "_" + G4UIcommand::ConvertToString(ii);
1236 std::map<G4String, G4Isotope*>::const_iterator ite2 =
1237 theIsotopes.find(newIsotName);
1238 if(ite2 == theIsotopes.cend())
1239 {
1240 isotName = newIsotName;
1241 break;
1242 }
1243 else
1244 {
1245 if(Same2G4Isotopes(isot, (*ite2).second))
1246 {
1247 isotName = newIsotName;
1248 break;
1249 }
1250 }
1251 }
1252 }
1253 }
1254 }
1255 return isotName;
1256}
1257
1258// --------------------------------------------------------------------
1259template <class TYP>
1260G4String G4tgbGeometryDumper::GetObjectName(
1261 TYP* obj, std::map<G4String, TYP*> objectsDumped)
1262{
1263 G4String objName = obj->GetName();
1264
1265 // first look if this is objecy is already dumped,
1266 // with original object name or new one
1267 //
1268 typename std::map<G4String, TYP*>::const_iterator ite;
1269 for(ite = objectsDumped.cbegin(); ite != objectsDumped.cend(); ++ite)
1270 {
1271 if(obj == (*ite).second)
1272 {
1273 return (*ite).first;
1274 }
1275 }
1276
1277 // Now look if there is another object dumped with same name,
1278 // and if found add _N to the name
1279 //
1280 ite = objectsDumped.find(objName);
1281
1282 if(ite != objectsDumped.cend()) // Object found with same name
1283 {
1284 TYP* objold = (*ite).second;
1285 if(obj != objold) // new object it is not the really
1286 { // the same one as object found
1287 G4int ii = 2;
1288 for(;; ++ii)
1289 {
1290 G4String newObjName = objName + "_" + G4UIcommand::ConvertToString(ii);
1291 typename std::map<G4String, TYP*>::const_iterator ite2 =
1292 objectsDumped.find(newObjName);
1293 if(ite2 == objectsDumped.cend())
1294 {
1295 objName = newObjName;
1296 break;
1297 }
1298 }
1299 }
1300 }
1301 return objName;
1302}
1303
1304// --------------------------------------------------------------------
1305G4bool G4tgbGeometryDumper::CheckIfLogVolExists(const G4String& name,
1306 G4LogicalVolume* pt)
1307{
1308 if(theLogVols.find(name) != theLogVols.cend())
1309 {
1310 G4LogicalVolume* lvnew = (*(theLogVols.find(name))).second;
1311 if(lvnew != pt)
1312 {
1313 /*
1314 //---- Reflected volumes are repeated
1315
1316 G4ReflectionFactory* reffact = G4ReflectionFactory::Instance();
1317 if( !reffact->IsReflected( pt ) && !reffact->IsReflected( lvnew ) )
1318 {
1319 G4String ErrMessage = "LogVol found but not same as before: " + name;
1320 G4Exception("G4tgbGeometryDumper::CheckIfLogVolExists()",
1321 "InvalidSetup", FatalException, ErrMessage);
1322 }
1323 */
1324 }
1325 return true;
1326 }
1327 else
1328 {
1329 return false;
1330 }
1331}
1332
1333// --------------------------------------------------------------------
1334G4bool G4tgbGeometryDumper::CheckIfPhysVolExists(const G4String& name,
1336{
1337#ifdef G4VERBOSE
1339 {
1340 G4cout << " G4tgbGeometryDumper::CheckIfPhysVolExists() - " << name
1341 << G4endl;
1342 }
1343#endif
1344 if(thePhysVols.find(name) != thePhysVols.cend())
1345 {
1346 if((*(thePhysVols.find(name))).second != pt)
1347 {
1348 // G4String ErrMessage = "Placement found but not same as before: "
1349 // + name;
1350 // G4Exception("G4tgbGeometryDumper::CheckIfPhysVolExists()",
1351 // "InvalidSetup", FatalException, ErrMessage);
1352 G4cerr << " G4tgbGeometryDumper::CheckIfPhysVolExists () -"
1353 << " Placement found but not same as before : " << name << G4endl;
1354 }
1355 return true;
1356 }
1357 else
1358 {
1359 return false;
1360 }
1361}
1362
1363// --------------------------------------------------------------------
1365G4tgbGeometryDumper::LookForExistingRotation(const G4RotationMatrix* rotm)
1366{
1367 G4String rmName = "";
1368
1369 for(auto ite = theRotMats.cbegin(); ite != theRotMats.cend(); ++ite)
1370 {
1371 if((*ite).second->isNear(*rotm))
1372 {
1373 rmName = (*ite).first;
1374 break;
1375 }
1376 }
1377 return rmName;
1378}
1379
1380// --------------------------------------------------------------------
1381G4bool G4tgbGeometryDumper::Same2G4Isotopes(G4Isotope* isot1, G4Isotope* isot2)
1382{
1383 if((isot1->GetZ() != isot2->GetZ()) || (isot1->GetN() != isot2->GetN()) ||
1384 (isot1->GetA() != isot2->GetA()))
1385 {
1386 return false;
1387 }
1388 else
1389 {
1390 return true;
1391 }
1392}
1393
1394// --------------------------------------------------------------------
1395const G4String& G4tgbGeometryDumper::FindSolidName(G4VSolid* solid)
1396{
1397 std::map<G4String, G4VSolid*>::const_iterator ite;
1398 for(ite = theSolids.cbegin(); ite != theSolids.cend(); ++ite)
1399 {
1400 if(solid == (*ite).second)
1401 {
1402 return (*ite).first;
1403 }
1404 }
1405
1406 if(ite == theSolids.cend())
1407 {
1408 G4Exception("G4tgbGeometryDumper::FindSolidName()", "ReadError",
1409 FatalException, "Programming error.");
1410 }
1411 return (*ite).first;
1412}
std::vector< G4Element * > G4ElementVector
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35
std::vector< G4Isotope * > G4IsotopeVector
G4State
Definition: G4Material.hh:111
@ kStateSolid
Definition: G4Material.hh:111
@ kStateLiquid
Definition: G4Material.hh:111
@ kStateGas
Definition: G4Material.hh:111
@ kStateUndefined
Definition: G4Material.hh:111
CLHEP::HepRotation G4RotationMatrix
CLHEP::Hep3Vector G4ThreeVector
double G4double
Definition: G4Types.hh:83
bool G4bool
Definition: G4Types.hh:86
int G4int
Definition: G4Types.hh:85
G4GLOB_DLL std::ostream G4cerr
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
#define TRUE
Definition: Globals.hh:27
#define FALSE
Definition: Globals.hh:23
double z() const
double phi() const
double theta() const
double x() const
double y() const
double zz() const
double yz() const
Hep3Vector colX() const
double zx() const
double thetaY() const
Definition: Rotation.cc:140
HepRotation inverse() const
Hep3Vector colY() const
double phiY() const
Definition: Rotation.cc:128
double yx() const
HepRep3x3 rep3x3() const
double zy() const
double thetaX() const
Definition: Rotation.cc:136
Hep3Vector colZ() const
double xx() const
double phiX() const
Definition: Rotation.cc:124
double yy() const
double xz() const
double thetaZ() const
Definition: Rotation.cc:144
double xy() const
double phiZ() const
Definition: Rotation.cc:132
G4RotationMatrix NetRotation() const
virtual const G4VSolid * GetConstituentSolid(G4int no) const
Definition: G4Box.hh:56
G4double GetYHalfLength() const
G4double GetZHalfLength() const
G4double GetXHalfLength() const
Definition: G4Cons.hh:78
G4double GetOuterRadiusPlusZ() const
G4double GetStartPhiAngle() const
G4double GetDeltaPhiAngle() const
G4double GetInnerRadiusMinusZ() const
G4double GetInnerRadiusPlusZ() const
G4double GetOuterRadiusMinusZ() const
G4double GetZHalfLength() const
G4VSolid * GetConstituentMovedSolid() const
G4AffineTransform GetTransform() const
G4ThreeVector GetObjectTranslation() const
G4double GetSemiAxisMax(G4int i) const
G4double GetZTopCut() const
G4double GetZBottomCut() const
G4double GetSemiAxisX() const
G4double GetSemiAxisY() const
G4double GetZMax() const
G4double GetZTopCut() const
G4double GetDy() const
G4double GetDx() const
G4double GetDz() const
G4double GetStartPhi() const
G4double GetEndPhi() const
G4int GetNumRZCorner() const
G4PolyconeSideRZ GetCorner(G4int index) const
G4double GetSurfaceTolerance() const
static G4GeometryTolerance * GetInstance()
Definition: G4Hype.hh:69
G4double GetInnerStereo() const
G4double GetZHalfLength() const
G4double GetOuterStereo() const
G4double GetOuterRadius() const
G4double GetInnerRadius() const
G4double GetMeanExcitationEnergy() const
G4int GetZ() const
Definition: G4Isotope.hh:90
G4int GetN() const
Definition: G4Isotope.hh:93
const G4String & GetName() const
Definition: G4Isotope.hh:87
G4double GetA() const
Definition: G4Isotope.hh:96
G4VSolid * GetSolid() const
G4Material * GetMaterial() const
const G4String & GetName() const
G4double GetPressure() const
Definition: G4Material.hh:181
G4double GetDensity() const
Definition: G4Material.hh:178
const G4ElementVector * GetElementVector() const
Definition: G4Material.hh:188
G4State GetState() const
Definition: G4Material.hh:179
G4double GetTemperature() const
Definition: G4Material.hh:180
G4double GetZ() const
Definition: G4Material.cc:701
const G4double * GetFractionVector() const
Definition: G4Material.hh:192
G4IonisParamMat * GetIonisation() const
Definition: G4Material.hh:224
size_t GetNumberOfElements() const
Definition: G4Material.hh:184
G4double GetA() const
Definition: G4Material.cc:714
Definition: G4Orb.hh:56
G4double GetRadius() const
void GetReplicationData(EAxis &axis, G4int &nReplicas, G4double &width, G4double &offset, G4bool &consuming) const
G4VPVParameterisation * GetParameterisation() const
virtual void GetReplicationData(EAxis &axis, G4int &nReplicas, G4double &width, G4double &offset, G4bool &consuming) const
Definition: G4PVReplica.cc:297
Definition: G4Para.hh:79
G4double GetTanAlpha() const
G4ThreeVector GetSymAxis() const
G4double GetYHalfLength() const
G4double GetZHalfLength() const
G4double GetXHalfLength() const
static G4PhysicalVolumeStore * GetInstance()
G4double GetStartPhi() const
G4PolyconeHistorical * GetOriginalParameters() const
G4int GetNumRZCorner() const
G4PolyconeSideRZ GetCorner(G4int index) const
G4int GetNumRZCorner() const
G4int GetNumSide() const
G4PolyhedraHistorical * GetOriginalParameters() const
G4PolyhedraSideRZ GetCorner(const G4int index) const
G4double GetStartPhi() const
G4VSolid * GetConstituentMovedSolid() const
G4bool IsReflected(G4LogicalVolume *lv) const
static G4ReflectionFactory * Instance()
G4double GetStartPhiAngle() const
G4double GetDeltaPhiAngle() const
G4double GetInnerRadius() const
G4double GetOuterRadius() const
G4double GetDeltaThetaAngle() const
G4double GetStartThetaAngle() const
std::size_t first(char) const
G4double GetDPhi() const
G4double GetRmin() const
G4double GetRtor() const
G4double GetRmax() const
G4double GetSPhi() const
G4double GetYHalfLength1() const
G4double GetTanAlpha2() const
G4double GetXHalfLength2() const
G4ThreeVector GetSymAxis() const
G4double GetXHalfLength4() const
G4double GetZHalfLength() const
G4double GetYHalfLength2() const
G4double GetTanAlpha1() const
G4double GetXHalfLength3() const
G4double GetXHalfLength1() const
Definition: G4Trd.hh:63
G4double GetXHalfLength2() const
G4double GetYHalfLength2() const
G4double GetXHalfLength1() const
G4double GetYHalfLength1() const
G4double GetZHalfLength() const
Definition: G4Tubs.hh:75
G4double GetZHalfLength() const
G4double GetInnerRadius() const
G4double GetOuterRadius() const
G4double GetStartPhiAngle() const
G4double GetDeltaPhiAngle() const
G4double GetPhiTwist() const
Definition: G4TwistedBox.hh:65
G4double GetXHalfLength() const
Definition: G4TwistedBox.hh:62
G4double GetZHalfLength() const
Definition: G4TwistedBox.hh:64
G4double GetYHalfLength() const
Definition: G4TwistedBox.hh:63
G4double GetPolarAngleTheta() const
G4double GetAzimuthalAnglePhi() const
G4double GetTiltAngleAlpha() const
G4double GetZHalfLength() const
G4double GetX1HalfLength() const
G4double GetX2HalfLength() const
G4double GetX3HalfLength() const
G4double GetX4HalfLength() const
G4double GetY2HalfLength() const
G4double GetPhiTwist() const
G4double GetY1HalfLength() const
G4double GetX2HalfLength() const
Definition: G4TwistedTrd.hh:67
G4double GetY2HalfLength() const
Definition: G4TwistedTrd.hh:69
G4double GetY1HalfLength() const
Definition: G4TwistedTrd.hh:68
G4double GetZHalfLength() const
Definition: G4TwistedTrd.hh:70
G4double GetPhiTwist() const
Definition: G4TwistedTrd.hh:71
G4double GetX1HalfLength() const
Definition: G4TwistedTrd.hh:66
G4double GetOuterRadius() const
G4double GetZHalfLength() const
G4double GetPhiTwist() const
G4double GetInnerRadius() const
G4double GetDPhi() const
static G4String ConvertToString(G4bool boolVal)
Definition: G4UIcommand.cc:430
virtual G4VSolid * ComputeSolid(const G4int, G4VPhysicalVolume *)
virtual G4Material * ComputeMaterial(const G4int repNo, G4VPhysicalVolume *currentVol, const G4VTouchable *parentTouch=nullptr)
virtual void ComputeTransformation(const G4int, G4VPhysicalVolume *) const =0
virtual void ComputeDimensions(G4Box &, const G4int, const G4VPhysicalVolume *) const
G4LogicalVolume * GetMotherLogical() const
virtual G4bool IsReplicated() const =0
const G4RotationMatrix * GetRotation() const
const G4ThreeVector GetTranslation() const
G4LogicalVolume * GetLogicalVolume() const
virtual G4int GetCopyNo() const =0
const G4String & GetName() const
virtual G4bool IsParameterised() const =0
G4String GetName() const
virtual G4GeometryType GetEntityType() const =0
static G4tgbGeometryDumper * GetInstance()
void DumpIsotope(G4Isotope *ele)
void DumpGeometry(const G4String &fname)
G4String DumpLogVol(G4LogicalVolume *lv, const G4String &extraName="", G4VSolid *solid=nullptr, G4Material *mate=nullptr)
void DumpPhysVol(G4VPhysicalVolume *pv)
G4String DumpRotationMatrix(G4RotationMatrix *rotm)
void DumpBooleanVolume(const G4String &solidType, G4VSolid *so)
G4String DumpMaterial(G4Material *mat)
void DumpPVReplica(G4PVReplica *pv, const G4String &lvName)
void DumpPVParameterised(G4PVParameterised *pv)
G4VPhysicalVolume * GetTopPhysVol()
G4String DumpSolid(G4VSolid *solid, const G4String &extraName="")
void DumpElement(G4Element *ele)
void DumpSolidParams(G4VSolid *so)
void DumpPVPlacement(G4VPhysicalVolume *pv, const G4String &lvName, G4int copyNo=-999)
std::vector< G4double > GetSolidParams(const G4VSolid *so)
static G4int GetVerboseLevel()
EAxis
Definition: geomdefs.hh:54
@ kPhi
Definition: geomdefs.hh:60
@ kYAxis
Definition: geomdefs.hh:56
@ kRadial3D
Definition: geomdefs.hh:59
@ kXAxis
Definition: geomdefs.hh:55
@ kZAxis
Definition: geomdefs.hh:57
@ kUndefined
Definition: geomdefs.hh:61
@ kRho
Definition: geomdefs.hh:58
const char * name(G4int ptype)
#define G4ThreadLocal
Definition: tls.hh:77