Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
G4tgbGeometryDumper.hh
이 파일의 문서화 페이지로 가기
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 // class G4tgbGeometryDumper
28 //
29 // Class description:
30 //
31 // Class for dumping the whole geometry.
32 
33 // History:
34 // - Created. P.Arce, CIEMAT (November 2007)
35 // -------------------------------------------------------------------------
36 
37 #ifndef G4tgbGeometryDumper_HH
38 #define G4tgbGeometryDumper_HH
39 
40 #include "globals.hh"
41 #include "G4RotationMatrix.hh"
42 
43 #include <fstream>
44 #include <map>
45 #include <vector>
46 
47 class G4Material;
48 class G4Element;
49 class G4Isotope;
50 class G4VSolid;
51 class G4LogicalVolume;
52 class G4VPhysicalVolume;
53 class G4PVParameterised;
54 class G4PVReplica;
55 
57 {
58 
59  public: // with description
60 
63 
64  void DumpGeometry(const G4String& fname );
66  void DumpPhysVol( G4VPhysicalVolume* pv );
67  void DumpPVPlacement( G4VPhysicalVolume* pv, const G4String& lvName,
68  G4int copyNo = -999 );
70  void DumpPVReplica( G4PVReplica* pv, const G4String& lvName );
71  G4String DumpLogVol( G4LogicalVolume* lv, G4String extraName = "",
72  G4VSolid* solid = 0, G4Material* mate = 0);
74  void DumpElement( G4Element* ele);
75  void DumpIsotope( G4Isotope* ele);
76  G4String DumpSolid( G4VSolid* solid, const G4String& extraName = "" );
77  void DumpBooleanVolume( const G4String& solidType, G4VSolid* so );
78  void DumpSolidParams(G4VSolid * so);
79  std::vector<G4double> GetSolidParams( const G4VSolid * so);
80  void DumpPolySections(G4int zPlanes, G4double* z,
81  G4double *rmin, G4double *rmax);
83 
84  private:
85 
87 
88  private:
89 
90  std::vector<G4VPhysicalVolume*> GetPVChildren( G4LogicalVolume* lv );
91  G4String GetTGSolidType( const G4String& solidtype );
94  G4String AddQuotes( const G4String& str );
95 
97  template< class TYP> G4String GetObjectName( TYP* obj,
98  std::map<G4String,TYP*> objectsDumped );
102  G4String SupressRefl( G4String name );
105  const G4String& FindSolidName( G4VSolid* solid );
106 
107  private:
108 
110 
111  std::ofstream* theFile;
112 
113  std::map<G4String,G4Material*> theMaterials;
114  std::map<G4String,G4Element*> theElements;
115  std::map<G4String,G4Isotope*> theIsotopes;
116  std::map<G4String,G4VSolid*> theSolids;
117  std::map<G4String,G4LogicalVolume*> theLogVols;
118  std::map<G4String,G4VPhysicalVolume*> thePhysVols;
119  std::map<G4String,G4RotationMatrix*> theRotMats;
120 
122 };
123 
124 #endif
const XML_Char * name
Definition: expat.h:151
static const G4double ele2
G4String GetTGSolidType(const G4String &solidtype)
G4double MatDeterminant(G4RotationMatrix *ro)
G4String DumpSolid(G4VSolid *solid, const G4String &extraName="")
G4String AddQuotes(const G4String &str)
void DumpPVPlacement(G4VPhysicalVolume *pv, const G4String &lvName, G4int copyNo=-999)
std::map< G4String, G4Material * > theMaterials
Double_t z
std::map< G4String, G4Element * > theElements
static G4ThreadLocal G4tgbGeometryDumper * theInstance
G4String GetIsotopeName(G4Isotope *)
void DumpPhysVol(G4VPhysicalVolume *pv)
G4String DumpMaterial(G4Material *mat)
void DumpPolySections(G4int zPlanes, G4double *z, G4double *rmin, G4double *rmax)
#define G4ThreadLocal
Definition: tls.hh:69
G4bool CheckIfLogVolExists(const G4String &name, G4LogicalVolume *pt)
G4String LookForExistingRotation(const G4RotationMatrix *rotm)
static G4tgbGeometryDumper * GetInstance()
double G4double
Definition: G4Types.hh:76
bool G4bool
Definition: G4Types.hh:79
void DumpElement(G4Element *ele)
G4bool Same2G4Isotopes(G4Isotope *ele1, G4Isotope *ele2)
TMarker * pt
Definition: egs.C:25
G4String SubstituteRefl(G4String name)
std::vector< G4double > GetSolidParams(const G4VSolid *so)
static const G4double ele1
Float_t mat
void DumpPVParameterised(G4PVParameterised *pv)
void DumpSolidParams(G4VSolid *so)
const G4String & FindSolidName(G4VSolid *solid)
G4bool CheckIfPhysVolExists(const G4String &name, G4VPhysicalVolume *)
G4VPhysicalVolume * GetTopPhysVol()
std::map< G4String, G4RotationMatrix * > theRotMats
void DumpIsotope(G4Isotope *ele)
int G4int
Definition: G4Types.hh:78
G4String DumpRotationMatrix(G4RotationMatrix *rotm)
void DumpGeometry(const G4String &fname)
std::vector< G4VPhysicalVolume * > GetPVChildren(G4LogicalVolume *lv)
std::map< G4String, G4VSolid * > theSolids
void DumpBooleanVolume(const G4String &solidType, G4VSolid *so)
G4String SupressRefl(G4String name)
G4String GetObjectName(TYP *obj, std::map< G4String, TYP * > objectsDumped)
G4String DumpLogVol(G4LogicalVolume *lv, G4String extraName="", G4VSolid *solid=0, G4Material *mate=0)
std::map< G4String, G4VPhysicalVolume * > thePhysVols
G4double approxTo0(G4double val)
std::map< G4String, G4Isotope * > theIsotopes
void DumpPVReplica(G4PVReplica *pv, const G4String &lvName)
std::map< G4String, G4LogicalVolume * > theLogVols
static const G4double ele