Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
G3VolTableEntry.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 // $Id: G3VolTableEntry.hh 67982 2013-03-13 10:36:03Z gcosmo $
28 //
29 // ----------------------
30 // Class description:
31 //
32 // This class is a temporary representation of G3 volume.
33 // Its methods enables successive updating of its instances
34 // during the phase of filling the G3 tables (defining G3 geometry,
35 // eg. by parsing the G3 input via clparse.cc).
36 // See G3VolTable class description, too.
37 //
38 // Data members:
39 // fVname volume name;
40 // fShape G3 shape name;
41 // fRpar array of G3 volumes parameters;
42 // fNpar number of G3 volumes parameters;
43 // fNmed G3 tracking medium number;
44 // fSolid the G4VSolid of this volume;
45 // fLV the G4LogicalVolume;
46 // fHasNegPars true if G3 volume was defined with incomplete
47 // parameters;
48 // fDaughters vector of daughter VTEs (VTEs of volumes placed inside
49 // this volume);
50 // fMothers vector of mother VTEs (VTEs of volumes inside which this
51 // volume is placed);
52 // fClones vector of clone VTEs (see explanation below);
53 // fG3Pos vector of G3 positions (G3Pos objects)
54 // fDivision G3Division object created in case the G4 volume
55 // was defined as division;
56 //
57 // Clone volumes:
58 // In case a G3 volume (e.g. XYZ) has changed its solid parameters
59 // with its new position (placement with GSPOSP) a new G3VolTableEntry
60 // (associated with this new solid) with a new name (XYZ_N)
61 // is created and registered as a clone volume in the fClones vector
62 // data member of its master G3VolTableEntry object.
63 
64 // ----------------------
65 //
66 // by I.Hrivnacova, 13.10.99
67 
68 #ifndef G3VOLTABLEENTRY_HH
69 #define G3VOLTABLEENTRY_HH 1
70 
71 #include "globals.hh"
72 #include "G3Pos.hh"
73 #include "G3Division.hh"
74 #include <vector>
75 
76 class G4LogicalVolume;
77 class G4Material;
78 class G4VSolid;
79 
81 {
82  public: // with description
83 
84  G3VolTableEntry(G4String& vname, G4String& shape, G4double* rpar,
85  G4int npar, G4int nmed, G4VSolid* solid,
86  G4bool hasNegPars);
87  virtual ~G3VolTableEntry();
88 
89  // operators
90  G4bool operator == ( const G3VolTableEntry& vte) const;
91 
92  // methods
93  void AddG3Pos(G3Pos* aG3Pos);
94  void AddDaughter(G3VolTableEntry* aDaughter);
95  void AddMother(G3VolTableEntry* aDaughter);
96  void AddClone(G3VolTableEntry* aDaughter);
97  void AddOverlap(G3VolTableEntry* aOverlap);
98  void ReplaceDaughter(G3VolTableEntry* vteOld, G3VolTableEntry* vteNew);
99  void ReplaceMother(G3VolTableEntry* vteOld, G3VolTableEntry* vteNew);
100  G3VolTableEntry* FindDaughter(const G4String& vname);
101  G3VolTableEntry* FindMother(const G4String& vname);
102  G3VolTableEntry* FindClone(const G4String& vname);
103  void PrintSolidInfo();
104 
105  // set methods
106  void SetName(G4String name);
107  void SetLV(G4LogicalVolume* lv);
108  void SetSolid(G4VSolid* solid);
109  void SetNmed(G4int nmed);
110  void SetNRpar(G4int npar, G4double* Rpar);
111  void SetDivision(G3Division* division);
112  void SetHasNegPars(G4bool hasNegPars);
113  void SetHasMANY(G4bool hasMANY);
114  void ClearG3PosCopy(G4int copy);
115  void ClearDivision();
116 
117  // get methods
118  G4String GetName();
119  G4String GetShape();
120  G4int GetNmed();
121  G4int GetNpar();
122  G4double* GetRpar();
123  G4int NPCopies();
124  G3Pos* GetG3PosCopy(G4int copy=0);
126  G4bool HasNegPars();
127  G4bool HasMANY();
128  G4VSolid* GetSolid();
132  G4int GetNoClones();
137  // return the first mother - to be removed
140  std::vector<G3VolTableEntry*>* GetOverlaps();
141 
142  private:
152  std::vector<G3VolTableEntry*> fDaughters;
153  std::vector<G3VolTableEntry*> fMothers;
154  std::vector<G3VolTableEntry*> fClones;
155  std::vector<G3VolTableEntry*> fOverlaps;
156  std::vector<G3Pos*> fG3Pos;
158 };
159 
160 // inline methods
161 
163 { fDivision = division; }
164 
166 { return fDivision; }
167 
168 #endif
G4LogicalVolume * GetLV()
const XML_Char * name
Definition: expat.h:151
G3VolTableEntry * GetClone(G4int i)
void ReplaceDaughter(G3VolTableEntry *vteOld, G3VolTableEntry *vteNew)
void SetLV(G4LogicalVolume *lv)
G3VolTableEntry * FindDaughter(const G4String &vname)
void SetNmed(G4int nmed)
void SetSolid(G4VSolid *solid)
G3VolTableEntry * FindMother(const G4String &vname)
G3Pos * GetG3PosCopy(G4int copy=0)
G3VolTableEntry * GetDaughter(G4int i)
G3VolTableEntry * GetMother()
G3VolTableEntry(G4String &vname, G4String &shape, G4double *rpar, G4int npar, G4int nmed, G4VSolid *solid, G4bool hasNegPars)
G3Division * GetDivision()
void AddMother(G3VolTableEntry *aDaughter)
void AddClone(G3VolTableEntry *aDaughter)
G4VSolid * GetSolid()
std::vector< G3VolTableEntry * > * GetOverlaps()
double G4double
Definition: G4Types.hh:76
bool G4bool
Definition: G4Types.hh:79
std::vector< G3VolTableEntry * > fClones
G3Division * fDivision
void ClearG3PosCopy(G4int copy)
std::vector< G3VolTableEntry * > fOverlaps
void AddDaughter(G3VolTableEntry *aDaughter)
void ReplaceMother(G3VolTableEntry *vteOld, G3VolTableEntry *vteNew)
Definition: G3Pos.hh:43
void AddOverlap(G3VolTableEntry *aOverlap)
void AddG3Pos(G3Pos *aG3Pos)
G3G4DLL_API G4double Rpar[1000]
Definition: clparse.cc:67
virtual ~G3VolTableEntry()
int G4int
Definition: G4Types.hh:78
G4bool operator==(const G3VolTableEntry &vte) const
void SetHasMANY(G4bool hasMANY)
std::vector< G3VolTableEntry * > fMothers
void SetNRpar(G4int npar, G4double *Rpar)
void SetName(G4String name)
void SetDivision(G3Division *division)
G4double * GetRpar()
std::vector< G3Pos * > fG3Pos
std::vector< G3VolTableEntry * > fDaughters
G3VolTableEntry * FindClone(const G4String &vname)
void SetHasNegPars(G4bool hasNegPars)
G4LogicalVolume * fLV
G3VolTableEntry * GetMasterClone()