Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G3VolTableEntry Class Reference

#include <G3VolTableEntry.hh>

Public Member Functions

 G3VolTableEntry (G4String &vname, G4String &shape, G4double *rpar, G4int npar, G4int nmed, G4VSolid *solid, G4bool hasNegPars)
 
virtual ~G3VolTableEntry ()
 
G4bool operator== (const G3VolTableEntry &vte) const
 
void AddG3Pos (G3Pos *aG3Pos)
 
void AddDaughter (G3VolTableEntry *aDaughter)
 
void AddMother (G3VolTableEntry *aDaughter)
 
void AddClone (G3VolTableEntry *aDaughter)
 
void AddOverlap (G3VolTableEntry *aOverlap)
 
void ReplaceDaughter (G3VolTableEntry *vteOld, G3VolTableEntry *vteNew)
 
void ReplaceMother (G3VolTableEntry *vteOld, G3VolTableEntry *vteNew)
 
G3VolTableEntryFindDaughter (const G4String &vname)
 
G3VolTableEntryFindMother (const G4String &vname)
 
G3VolTableEntryFindClone (const G4String &vname)
 
void PrintSolidInfo ()
 
void SetName (G4String name)
 
void SetLV (G4LogicalVolume *lv)
 
void SetSolid (G4VSolid *solid)
 
void SetNmed (G4int nmed)
 
void SetNRpar (G4int npar, G4double *Rpar)
 
void SetDivision (G3Division *division)
 
void SetHasNegPars (G4bool hasNegPars)
 
void SetHasMANY (G4bool hasMANY)
 
void ClearG3PosCopy (G4int copy)
 
void ClearDivision ()
 
G4String GetName ()
 
G4String GetShape ()
 
G4int GetNmed ()
 
G4int GetNpar ()
 
G4doubleGetRpar ()
 
G4int NPCopies ()
 
G3PosGetG3PosCopy (G4int copy=0)
 
G3DivisionGetDivision ()
 
G4bool HasNegPars ()
 
G4bool HasMANY ()
 
G4VSolidGetSolid ()
 
G4LogicalVolumeGetLV ()
 
G4int GetNoDaughters ()
 
G4int GetNoMothers ()
 
G4int GetNoClones ()
 
G4int GetNoOverlaps ()
 
G3VolTableEntryGetDaughter (G4int i)
 
G3VolTableEntryGetMother (G4int i)
 
G3VolTableEntryGetMother ()
 
G3VolTableEntryGetClone (G4int i)
 
G3VolTableEntryGetMasterClone ()
 
std::vector< G3VolTableEntry * > * GetOverlaps ()
 

Detailed Description

Definition at line 80 of file G3VolTableEntry.hh.

Constructor & Destructor Documentation

G3VolTableEntry::G3VolTableEntry ( G4String vname,
G4String shape,
G4double rpar,
G4int  npar,
G4int  nmed,
G4VSolid solid,
G4bool  hasNegPars 
)

Definition at line 40 of file G3VolTableEntry.cc.

43  : fVname(vname), fShape(shape), fRpar(0), fNpar(npar), fNmed(nmed),
44  fSolid(solid), fLV(0), fHasNegPars(hasNegPars), fHasMANY(false),
45  fDivision(0)
46 {
47  if (npar>0 && rpar!=0) {
48  fRpar = new G4double[npar];
49  for (G4int i=0; i<npar; i++) fRpar[i] = rpar[i];
50  }
51  fClones.push_back(this);
52 }
int G4int
Definition: G4Types.hh:78
double G4double
Definition: G4Types.hh:76
G3VolTableEntry::~G3VolTableEntry ( )
virtual

Definition at line 54 of file G3VolTableEntry.cc.

54  {
55  if (fRpar!=0) delete [] fRpar;
56  delete fDivision;
57 }

Member Function Documentation

void G3VolTableEntry::AddClone ( G3VolTableEntry aDaughter)

Definition at line 91 of file G3VolTableEntry.cc.

91  {
92  if (FindClone(itsClone->GetName()) == 0) {
93  fClones.push_back(itsClone);
94  }
95 }
G3VolTableEntry * FindClone(const G4String &vname)

Here is the call graph for this function:

Here is the caller graph for this function:

void G3VolTableEntry::AddDaughter ( G3VolTableEntry aDaughter)

Definition at line 77 of file G3VolTableEntry.cc.

77  {
78  if (FindDaughter(aDaughter->GetName()) == 0) {
79  fDaughters.push_back(aDaughter);
80  }
81 }
G3VolTableEntry * FindDaughter(const G4String &vname)
G4String GetName()

Here is the call graph for this function:

Here is the caller graph for this function:

void G3VolTableEntry::AddG3Pos ( G3Pos aG3Pos)

Definition at line 65 of file G3VolTableEntry.cc.

65  {
66 
67  // insert this position to the vector
68  G3Vol.CountG3Pos();
69  fG3Pos.push_back(aG3Pos);
70 
71  // pass MANY info
72  G4String vonly = aG3Pos->GetOnly();
73  if (vonly == "MANY") SetHasMANY(true);
74 }
void SetHasMANY(G4bool hasMANY)
void CountG3Pos()
Definition: G3VolTable.cc:92
G4String & GetOnly()
Definition: G3Pos.cc:78
G3G4DLL_API G3VolTable G3Vol
Definition: clparse.cc:54

Here is the call graph for this function:

Here is the caller graph for this function:

void G3VolTableEntry::AddMother ( G3VolTableEntry aDaughter)

Definition at line 84 of file G3VolTableEntry.cc.

84  {
85  if (FindMother(itsMother->GetName()) == 0) {
86  fMothers.push_back(itsMother);
87  }
88 }
G3VolTableEntry * FindMother(const G4String &vname)

Here is the call graph for this function:

Here is the caller graph for this function:

void G3VolTableEntry::AddOverlap ( G3VolTableEntry aOverlap)

Definition at line 98 of file G3VolTableEntry.cc.

98  {
99  fOverlaps.push_back(overlap);
100 }

Here is the caller graph for this function:

void G3VolTableEntry::ClearDivision ( )

Definition at line 223 of file G3VolTableEntry.cc.

223  {
224  delete fDivision;
225  fDivision = 0;
226 }

Here is the caller graph for this function:

void G3VolTableEntry::ClearG3PosCopy ( G4int  copy)

Definition at line 213 of file G3VolTableEntry.cc.

213  {
214  if (fG3Pos.size()>0 && copy>=0 && copy<G4int(fG3Pos.size())) {
215  std::vector<G3Pos*>::iterator it=fG3Pos.begin();
216  for(G4int j=0;j<copy;j++) it++;
217  if(it!=fG3Pos.end()) {
218  fG3Pos.erase(it);
219  }
220  }
221 }
int G4int
Definition: G4Types.hh:78

Here is the caller graph for this function:

G3VolTableEntry * G3VolTableEntry::FindClone ( const G4String vname)

Definition at line 156 of file G3VolTableEntry.cc.

156  {
157  for (G4int i=0; i<GetNoClones(); i++){
158  G3VolTableEntry* cvte = GetClone(i);
159  if (cvte->GetName() == Cname) return cvte;
160  }
161  return 0;
162 }
G3VolTableEntry * GetClone(G4int i)
int G4int
Definition: G4Types.hh:78
G4int GetNoClones()
G4String GetName()

Here is the call graph for this function:

Here is the caller graph for this function:

G3VolTableEntry * G3VolTableEntry::FindDaughter ( const G4String vname)

Definition at line 139 of file G3VolTableEntry.cc.

139  {
140  for (G4int idau=0; idau<GetNoDaughters(); idau++){
141  if (GetDaughter(idau)->GetName() == Dname) return GetDaughter(idau);
142  }
143  return 0;
144 }
int G4int
Definition: G4Types.hh:78
G3VolTableEntry * GetDaughter(G4int i)
G4int GetNoDaughters()
G4String GetName()

Here is the call graph for this function:

Here is the caller graph for this function:

G3VolTableEntry * G3VolTableEntry::FindMother ( const G4String vname)

Definition at line 147 of file G3VolTableEntry.cc.

147  {
148  for (G4int i=0; i<GetNoMothers(); i++){
149  G3VolTableEntry* mvte = GetMother(i);
150  if (mvte->GetName() == Mname) return mvte;
151  }
152  return 0;
153 }
G4int GetNoMothers()
G3VolTableEntry * GetMother()
int G4int
Definition: G4Types.hh:78
G4String GetName()

Here is the call graph for this function:

Here is the caller graph for this function:

G3VolTableEntry * G3VolTableEntry::GetClone ( G4int  i)

Definition at line 332 of file G3VolTableEntry.cc.

332  {
333  if (i<G4int(fClones.size()) && i>=0)
334  return fClones[i];
335  else
336  return 0;
337 }
int G4int
Definition: G4Types.hh:78

Here is the caller graph for this function:

G3VolTableEntry * G3VolTableEntry::GetDaughter ( G4int  i)

Definition at line 307 of file G3VolTableEntry.cc.

307  {
308  if (i<G4int(fDaughters.size()) && i>=0)
309  return fDaughters[i];
310  else
311  return 0;
312 }
int G4int
Definition: G4Types.hh:78

Here is the caller graph for this function:

G3Division * G3VolTableEntry::GetDivision ( )
inline

Definition at line 165 of file G3VolTableEntry.hh.

166 { return fDivision; }

Here is the caller graph for this function:

G3Pos * G3VolTableEntry::GetG3PosCopy ( G4int  copy = 0)

Definition at line 259 of file G3VolTableEntry.cc.

259  {
260  if (fG3Pos.size()>0 && copy>=0)
261  return fG3Pos[copy];
262  else
263  return 0;
264 }

Here is the caller graph for this function:

G4LogicalVolume * G3VolTableEntry::GetLV ( )

Definition at line 282 of file G3VolTableEntry.cc.

282  {
283  return fLV;
284 }

Here is the caller graph for this function:

G3VolTableEntry * G3VolTableEntry::GetMasterClone ( )

Definition at line 340 of file G3VolTableEntry.cc.

340  {
341  G3VolTableEntry* master;
342  G4String name = fVname;
343  if (name.contains(gSeparator)) {
344  name = name(0, name.first(gSeparator));
345  master = G3Vol.GetVTE(name);
346  }
347  else
348  master = this;
349 
350  return master;
351 }
const XML_Char * name
Definition: expat.h:151
G4int first(char) const
G3VolTableEntry * GetVTE(const G4String &Vname)
Definition: G3VolTable.cc:54
G4bool contains(const std::string &) const
G3G4DLL_API char gSeparator
G3G4DLL_API G3VolTable G3Vol
Definition: clparse.cc:54

Here is the call graph for this function:

Here is the caller graph for this function:

G3VolTableEntry * G3VolTableEntry::GetMother ( G4int  i)

Definition at line 315 of file G3VolTableEntry.cc.

315  {
316  if (i<G4int(fMothers.size()) && i>=0)
317  return fMothers[i];
318  else
319  return 0;
320 }
int G4int
Definition: G4Types.hh:78

Here is the caller graph for this function:

G3VolTableEntry * G3VolTableEntry::GetMother ( )

Definition at line 324 of file G3VolTableEntry.cc.

324  {
325  if (fMothers.size()>0)
326  return fMothers[0];
327  else
328  return 0;
329 }

Here is the caller graph for this function:

G4String G3VolTableEntry::GetName ( )

Definition at line 229 of file G3VolTableEntry.cc.

229  {
230  return fVname;
231 }

Here is the caller graph for this function:

G4int G3VolTableEntry::GetNmed ( )

Definition at line 239 of file G3VolTableEntry.cc.

239  {
240  return fNmed;
241 }

Here is the caller graph for this function:

G4int G3VolTableEntry::GetNoClones ( )

Definition at line 297 of file G3VolTableEntry.cc.

297  {
298  return fClones.size();
299 }

Here is the caller graph for this function:

G4int G3VolTableEntry::GetNoDaughters ( )

Definition at line 287 of file G3VolTableEntry.cc.

287  {
288  return fDaughters.size();
289 }

Here is the caller graph for this function:

G4int G3VolTableEntry::GetNoMothers ( )

Definition at line 292 of file G3VolTableEntry.cc.

292  {
293  return fMothers.size();
294 }

Here is the caller graph for this function:

G4int G3VolTableEntry::GetNoOverlaps ( )

Definition at line 302 of file G3VolTableEntry.cc.

302  {
303  return fOverlaps.size();
304 }

Here is the caller graph for this function:

G4int G3VolTableEntry::GetNpar ( )

Definition at line 244 of file G3VolTableEntry.cc.

244  {
245  return fNpar;
246 }

Here is the caller graph for this function:

std::vector< G3VolTableEntry * > * G3VolTableEntry::GetOverlaps ( )

Definition at line 354 of file G3VolTableEntry.cc.

354  {
355  return &fOverlaps;
356 }

Here is the caller graph for this function:

G4double * G3VolTableEntry::GetRpar ( )

Definition at line 249 of file G3VolTableEntry.cc.

249  {
250  return fRpar;
251 }

Here is the caller graph for this function:

G4String G3VolTableEntry::GetShape ( )

Definition at line 234 of file G3VolTableEntry.cc.

234  {
235  return fShape;
236 }

Here is the caller graph for this function:

G4VSolid * G3VolTableEntry::GetSolid ( )

Definition at line 277 of file G3VolTableEntry.cc.

277  {
278  return fSolid;
279 }

Here is the caller graph for this function:

G4bool G3VolTableEntry::HasMANY ( )

Definition at line 272 of file G3VolTableEntry.cc.

272  {
273  return fHasMANY;
274 }

Here is the caller graph for this function:

G4bool G3VolTableEntry::HasNegPars ( )

Definition at line 267 of file G3VolTableEntry.cc.

267  {
268  return fHasNegPars;
269 }

Here is the caller graph for this function:

G4int G3VolTableEntry::NPCopies ( )

Definition at line 254 of file G3VolTableEntry.cc.

254  {
255  return fG3Pos.size();
256 }

Here is the caller graph for this function:

G4bool G3VolTableEntry::operator== ( const G3VolTableEntry vte) const

Definition at line 60 of file G3VolTableEntry.cc.

60  {
61  return (this==&lv) ? true : false;
62 }
void G3VolTableEntry::PrintSolidInfo ( )

Definition at line 164 of file G3VolTableEntry.cc.

164  {
165 // only parameters related to solid definition
166 // are printed
167  G4cout << "VTE: " << fVname << " " << this << G4endl;
168  G4cout << "Solid: " << fSolid << G4endl;
169  G4cout << "Parameters (npar = " << fNpar << ") fRpar: ";
170  for (G4int i=0; i<fNpar; i++) G4cout << fRpar[i] << " ";
171  G4cout << G4endl;
172  G4cout << "HasNegPars: " << fHasNegPars << G4endl;
173  G4cout << "HasMANY: " << fHasMANY << G4endl;
174  G4cout << "================================= " << G4endl;
175 }
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
void G3VolTableEntry::ReplaceDaughter ( G3VolTableEntry vteOld,
G3VolTableEntry vteNew 
)

Definition at line 103 of file G3VolTableEntry.cc.

105 {
106  G4int index = -1;
107  for (G4int i=0; i<GetNoDaughters(); i++){
108  if (fDaughters[i]->GetName() == vteOld->GetName()) index = i;
109  }
110  if (index<0) {
111  G4String err_message = "Old daughter " + vteOld->GetName()
112  + " does not exist.";
113  G4Exception("G3VolTableEntry::ReplaceDaughter()", "G3toG40007",
114  FatalException, err_message);
115  return;
116  }
117  fDaughters[index] = vteNew;
118 }
int G4int
Definition: G4Types.hh:78
G4int GetNoDaughters()
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
G4String GetName()

Here is the call graph for this function:

Here is the caller graph for this function:

void G3VolTableEntry::ReplaceMother ( G3VolTableEntry vteOld,
G3VolTableEntry vteNew 
)

Definition at line 121 of file G3VolTableEntry.cc.

123 {
124  G4int index = -1;
125  for (G4int i=0; i<GetNoMothers(); i++){
126  if (fMothers[i]->GetName() == vteOld->GetName()) index = i;
127  }
128  if (index<0) {
129  G4String err_message = "Old mother " + vteOld->GetName()
130  + " does not exist.";
131  G4Exception("G3VolTableEntry::ReplaceMother()", "G3toG40008",
132  FatalException, err_message);
133  return;
134  }
135  fMothers[index] = vteNew;
136 }
G4int GetNoMothers()
int G4int
Definition: G4Types.hh:78
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
G4String GetName()

Here is the call graph for this function:

Here is the caller graph for this function:

void G3VolTableEntry::SetDivision ( G3Division division)
inline

Definition at line 162 of file G3VolTableEntry.hh.

163 { fDivision = division; }

Here is the caller graph for this function:

void G3VolTableEntry::SetHasMANY ( G4bool  hasMANY)

Definition at line 209 of file G3VolTableEntry.cc.

209  {
210  fHasMANY = hasMANY;
211 }

Here is the caller graph for this function:

void G3VolTableEntry::SetHasNegPars ( G4bool  hasNegPars)

Definition at line 205 of file G3VolTableEntry.cc.

205  {
206  fHasNegPars = hasNegPars;
207 }

Here is the caller graph for this function:

void G3VolTableEntry::SetLV ( G4LogicalVolume lv)

Definition at line 183 of file G3VolTableEntry.cc.

183  {
184  fLV = lv;
185 }

Here is the caller graph for this function:

void G3VolTableEntry::SetName ( G4String  name)

Definition at line 178 of file G3VolTableEntry.cc.

178  {
179  fVname = name;
180 }
const XML_Char * name
Definition: expat.h:151

Here is the caller graph for this function:

void G3VolTableEntry::SetNmed ( G4int  nmed)

Definition at line 192 of file G3VolTableEntry.cc.

192  {
193  fNmed = nmed;
194 }

Here is the caller graph for this function:

void G3VolTableEntry::SetNRpar ( G4int  npar,
G4double Rpar 
)

Definition at line 196 of file G3VolTableEntry.cc.

196  {
197  if (npar != fNpar) {
198  fNpar = npar;
199  delete [] fRpar;
200  fRpar = new G4double[fNpar];
201  }
202  for (G4int i=0; i<fNpar; i++) fRpar[i] = rpar[i];
203 }
int G4int
Definition: G4Types.hh:78
double G4double
Definition: G4Types.hh:76

Here is the caller graph for this function:

void G3VolTableEntry::SetSolid ( G4VSolid solid)

Definition at line 188 of file G3VolTableEntry.cc.

188  {
189  fSolid = solid;
190 }

Here is the caller graph for this function:


The documentation for this class was generated from the following files: