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