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,v 1.9 2006/06/29 18:12:28 gunter Exp $ |
---|
28 | // GEANT4 tag $Name: geant4-09-02-ref-02 $ |
---|
29 | // |
---|
30 | // ---------------------- |
---|
31 | // Class description: |
---|
32 | // |
---|
33 | // This class is a temporary representation of G3 volume. |
---|
34 | // Its methods enables successive updating of its instances |
---|
35 | // during the phase of filling the G3 tables (defining G3 geometry, |
---|
36 | // eg. by parsing the G3 input via clparse.cc). |
---|
37 | // See G3VolTable class description, too. |
---|
38 | // |
---|
39 | // Data members: |
---|
40 | // fVname volume name; |
---|
41 | // fShape G3 shape name; |
---|
42 | // fRpar array of G3 volumes parameters; |
---|
43 | // fNpar number of G3 volumes parameters; |
---|
44 | // fNmed G3 tracking medium number; |
---|
45 | // fSolid the G4VSolid of this volume; |
---|
46 | // fLV the G4LogicalVolume; |
---|
47 | // fHasNegPars true if G3 volume was defined with incomplete |
---|
48 | // parameters; |
---|
49 | // fDaughters vector of daughter VTEs (VTEs of volumes placed inside |
---|
50 | // this volume); |
---|
51 | // fMothers vector of mother VTEs (VTEs of volumes inside which this |
---|
52 | // volume is placed); |
---|
53 | // fClones vector of clone VTEs (see explanation below); |
---|
54 | // fG3Pos vector of G3 positions (G3Pos objects) |
---|
55 | // fDivision G3Division object created in case the G4 volume |
---|
56 | // was defined as division; |
---|
57 | // |
---|
58 | // Clone volumes: |
---|
59 | // In case a G3 volume (e.g. XYZ) has changed its solid parameters |
---|
60 | // with its new position (placement with GSPOSP) a new G3VolTableEntry |
---|
61 | // (associated with this new solid) with a new name (XYZ_N) |
---|
62 | // is created and registered as a clone volume in the fClones vector |
---|
63 | // data member of its master G3VolTableEntry object. |
---|
64 | |
---|
65 | // ---------------------- |
---|
66 | // |
---|
67 | // by I.Hrivnacova, 13.10.99 |
---|
68 | |
---|
69 | #ifndef G3VOLTABLEENTRY_HH |
---|
70 | #define G3VOLTABLEENTRY_HH 1 |
---|
71 | |
---|
72 | #include "globals.hh" |
---|
73 | #include "G3Pos.hh" |
---|
74 | #include "G3Division.hh" |
---|
75 | #include <vector> |
---|
76 | |
---|
77 | class G4LogicalVolume; |
---|
78 | class G4Material; |
---|
79 | class G4VSolid; |
---|
80 | |
---|
81 | class G3VolTableEntry |
---|
82 | { |
---|
83 | public: // with description |
---|
84 | |
---|
85 | G3VolTableEntry(G4String& vname, G4String& shape, G4double* rpar, |
---|
86 | G4int npar, G4int nmed, G4VSolid* solid, |
---|
87 | G4bool hasNegPars); |
---|
88 | virtual ~G3VolTableEntry(); |
---|
89 | |
---|
90 | // operators |
---|
91 | G4bool operator == ( const G3VolTableEntry& vte) const; |
---|
92 | |
---|
93 | // methods |
---|
94 | void AddG3Pos(G3Pos* aG3Pos); |
---|
95 | void AddDaughter(G3VolTableEntry* aDaughter); |
---|
96 | void AddMother(G3VolTableEntry* aDaughter); |
---|
97 | void AddClone(G3VolTableEntry* aDaughter); |
---|
98 | void AddOverlap(G3VolTableEntry* aOverlap); |
---|
99 | void ReplaceDaughter(G3VolTableEntry* vteOld, G3VolTableEntry* vteNew); |
---|
100 | void ReplaceMother(G3VolTableEntry* vteOld, G3VolTableEntry* vteNew); |
---|
101 | G3VolTableEntry* FindDaughter(const G4String& vname); |
---|
102 | G3VolTableEntry* FindMother(const G4String& vname); |
---|
103 | G3VolTableEntry* FindClone(const G4String& vname); |
---|
104 | void PrintSolidInfo(); |
---|
105 | |
---|
106 | // set methods |
---|
107 | void SetName(G4String name); |
---|
108 | void SetLV(G4LogicalVolume* lv); |
---|
109 | void SetSolid(G4VSolid* solid); |
---|
110 | void SetNmed(G4int nmed); |
---|
111 | void SetNRpar(G4int npar, G4double* Rpar); |
---|
112 | void SetDivision(G3Division* division); |
---|
113 | void SetHasNegPars(G4bool hasNegPars); |
---|
114 | void SetHasMANY(G4bool hasMANY); |
---|
115 | void ClearG3PosCopy(G4int copy); |
---|
116 | void ClearDivision(); |
---|
117 | |
---|
118 | // get methods |
---|
119 | G4String GetName(); |
---|
120 | G4String GetShape(); |
---|
121 | G4int GetNmed(); |
---|
122 | G4int GetNpar(); |
---|
123 | G4double* GetRpar(); |
---|
124 | G4int NPCopies(); |
---|
125 | G3Pos* GetG3PosCopy(G4int copy=0); |
---|
126 | G3Division* GetDivision(); |
---|
127 | G4bool HasNegPars(); |
---|
128 | G4bool HasMANY(); |
---|
129 | G4VSolid* GetSolid(); |
---|
130 | G4LogicalVolume* GetLV(); |
---|
131 | G4int GetNoDaughters(); |
---|
132 | G4int GetNoMothers(); |
---|
133 | G4int GetNoClones(); |
---|
134 | G4int GetNoOverlaps(); |
---|
135 | G3VolTableEntry* GetDaughter(G4int i); |
---|
136 | G3VolTableEntry* GetMother(G4int i); |
---|
137 | G3VolTableEntry* GetMother(); |
---|
138 | // return the first mother - to be removed |
---|
139 | G3VolTableEntry* GetClone(G4int i); |
---|
140 | G3VolTableEntry* GetMasterClone(); |
---|
141 | std::vector<G3VolTableEntry*>* GetOverlaps(); |
---|
142 | |
---|
143 | private: |
---|
144 | G4String fVname; |
---|
145 | G4String fShape; |
---|
146 | G4double* fRpar; |
---|
147 | G4int fNpar; |
---|
148 | G4int fNmed; |
---|
149 | G4VSolid* fSolid; |
---|
150 | G4LogicalVolume* fLV; |
---|
151 | G4bool fHasNegPars; |
---|
152 | G4bool fHasMANY; |
---|
153 | std::vector<G3VolTableEntry*> fDaughters; |
---|
154 | std::vector<G3VolTableEntry*> fMothers; |
---|
155 | std::vector<G3VolTableEntry*> fClones; |
---|
156 | std::vector<G3VolTableEntry*> fOverlaps; |
---|
157 | std::vector<G3Pos*> fG3Pos; |
---|
158 | G3Division* fDivision; |
---|
159 | }; |
---|
160 | |
---|
161 | // inline methods |
---|
162 | |
---|
163 | inline void G3VolTableEntry::SetDivision(G3Division* division) |
---|
164 | { fDivision = division; } |
---|
165 | |
---|
166 | inline G3Division* G3VolTableEntry::GetDivision() |
---|
167 | { return fDivision; } |
---|
168 | |
---|
169 | #endif |
---|