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