G4gsdvt2.cc File Reference

#include "G3Division.hh"
#include "G3VolTableEntry.hh"
#include "G3VolTable.hh"
#include "globals.hh"
#include "G3toG4.hh"

Go to the source code of this file.

Functions

void G4CreateCloneVTEWithDivision (G4String vname, G3VolTableEntry *mvte, G3DivType divType, G4int nofDivisions, G4int iaxis, G4int nmed, G4double c0, G4double step)
void PG4gsdvt2 (G4String *tokens)
void G4gsdvt2 (G4String vname, G4String vmoth, G4double step, G4int iaxis, G4double c0, G4int numed, G4int ndvmx)


Function Documentation

void G4CreateCloneVTEWithDivision ( G4String  vname,
G3VolTableEntry mvte,
G3DivType  divType,
G4int  nofDivisions,
G4int  iaxis,
G4int  nmed,
G4double  c0,
G4double  step 
)

Definition at line 52 of file G4gsdvn.cc.

References G3VolTableEntry::AddClone(), G3VolTableEntry::AddDaughter(), G3VolTableEntry::AddMother(), G4String::append(), G3Vol, G3VolTableEntry::GetClone(), G3VolTableEntry::GetNoClones(), G3VolTableEntry::GetShape(), gSeparator, G3VolTable::PutVTE(), G3VolTableEntry::SetDivision(), and G3Division::UpdateVTE().

Referenced by G4gsdvn(), G4gsdvn2(), G4gsdvt(), and G4gsdvt2().

00055 {       
00056   G3VolTableEntry* vte=0;
00057 
00058   // loop over all mothers
00059   for (G4int i=0; i<mvte->GetNoClones(); i++) {
00060     G3VolTableEntry* mvteClone =  mvte->GetClone(i);
00061     G4String shape = mvteClone->GetShape();
00062     G4int    nmed  = mvteClone->GetNmed();
00063     G4String mvteName = mvteClone->GetName();
00064     
00065     G4String newName = vname;
00066     if (i>0) {
00067       char index[5]; sprintf(index, "%d", i);
00068       newName.append(gSeparator); newName = newName + index;
00069     }   
00070 
00071     // create new VTE with 0 solid
00072     // and let vol table know about it
00073     G3VolTableEntry* vteClone
00074       = new G3VolTableEntry(newName, shape, 0, 0, nmed, 0, true);
00075     G3Vol.PutVTE(vteClone);
00076 
00077     // set mother <-> daughter
00078     // (mother/daughter are reset in case an envelope
00079     //  needs to be created in G3Division::UpdateVTE)
00080     mvteClone->AddDaughter(vteClone);
00081     vteClone->AddMother(mvteClone);
00082 
00083     // create new G3Division 
00084     G3Division* division
00085       = new G3Division(divType, vteClone, mvteClone,
00086                        nofDivisions, iaxis, nmed, c0, step);
00087 
00088     // set division to vte and update it
00089     vteClone->SetDivision(division);
00090     division->UpdateVTE();
00091       
00092     if (i == 0) {
00093       // keep the first clone copy
00094       vte = vteClone;
00095     }
00096     else {              
00097       // let vte know about this clone copy
00098       vte->AddClone(vteClone);     
00099     }
00100   }
00101 }    

void G4gsdvt2 ( G4String  vname,
G4String  vmoth,
G4double  step,
G4int  iaxis,
G4double  c0,
G4int  numed,
G4int  ndvmx 
)

Definition at line 58 of file G4gsdvt2.cc.

References FatalException, G3Vol, G4CreateCloneVTEWithDivision(), G4Exception(), G3VolTable::GetVTE(), and kDvt2.

00060 {
00061   // find mother VTE
00062   G3VolTableEntry* mvte = G3Vol.GetVTE(vmoth);
00063   if (mvte == 0) {
00064     G4String text = "G4gsdvt2:'" + vmoth + "' has no VolTableEntry";
00065     G4Exception("G4gsdvt2()", "G3toG40015", FatalException, text);
00066     return;
00067   }    
00068   else {
00069     // a new vte clone copy with division is created
00070     // for each mother (clone copy)
00071     
00072     G4CreateCloneVTEWithDivision(vname, mvte, 
00073                                   kDvt2, ndvmx, iaxis, numed, c0, step); 
00074   }  
00075 }

void PG4gsdvt2 ( G4String tokens  ) 

Definition at line 41 of file G4gsdvt2.cc.

References G3fillParams(), G4gsdvt2(), Ipar, PTgsdvt2, Rpar, and Spar.

Referenced by G3CLEval().

00042 {
00043   // fill the parameter containers
00044   G3fillParams(tokens,PTgsdvt2);
00045   
00046   // interpret the parameters
00047   G4String vname = Spar[0];
00048   G4String vmoth = Spar[1];
00049   G4int iaxis = Ipar[0];
00050   G4int numed = Ipar[1];
00051   G4int ndvmx = Ipar[2];
00052   G4double Step = Rpar[0];
00053   G4double c0 = Rpar[1];
00054   
00055   G4gsdvt2(vname,vmoth,Step,iaxis,c0,numed,ndvmx);
00056 }


Generated on Mon May 27 17:50:46 2013 for Geant4 by  doxygen 1.4.7