Import Geant4 1.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 15:28:20 +02:00
parent aaa409b6ee
commit ca1c8cb059
2995 changed files with 106830 additions and 299600 deletions
+30 -73
View File
@@ -1,25 +1,26 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4gsdvt2.cc,v 1.3 1999/05/22 06:31:49 lockman Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4gsdvt2.cc,v 1.5 1999/12/05 17:50:13 gcosmo Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
#include "G4ios.hh"
#include "globals.hh"
#include "G4LogicalVolume.hh"
#include "G4VPhysicalVolume.hh"
#include "G4PVReplica.hh"
#include "G4PVParameterised.hh"
#include "G4VPVParameterisation.hh"
#include "G3toG4.hh"
#include "G3VolTable.hh"
#include "G3CalcParams.hh"
// by I.Hrivnacova, V.Berejnoi, 29 Oct 99
void PG4gsdvt2(RWCString tokens[])
#include "G3Division.hh"
#include "G3VolTableEntry.hh"
#include "G3VolTable.hh"
#include "globals.hh"
#include "G3toG4.hh"
void G4CreateCloneVTEWithDivision(G4String vname, G3VolTableEntry* mvte,
G3DivType divType, G4int nofDivisions, G4int iaxis, G4int nmed,
G4double c0, G4double step);
void PG4gsdvt2(G4String tokens[])
{
// fill the parameter containers
G3fillParams(tokens,PTgsdvt2);
@@ -36,63 +37,19 @@ void PG4gsdvt2(RWCString tokens[])
G4gsdvt2(vname,vmoth,Step,iaxis,c0,numed,ndvmx);
}
void G4gsdvt2(G4String vname, G4String vmoth, G4double Step, G4int iaxis,
G4double c0, G4int numed, G4int ndvmx){
/*
// get the physical volume pointer of the mother from the name
G4int npv=0;
G4VPhysicalVolume* mothPV;
G3Vol.FindPV(&npv, &vmoth);
if (npv == 0) {
G4cout << " G4gsdvt2 error: No physical volume for " << vmoth << endl;
return;
}
for (G4int ipv=0; ipv<npv; ipv++) {
mothPV = G3Vol.GetPV(ipv);
// extract the needed parameters from the mother's logical volume
G4double rangehi;
G4double rangelo;
EAxis axiscode;
G4String shape;
G4int nmed;
G4double *Rpar = NULL;
G4int npar;
G4int zeronpar=0;
G4VSolid *solid = NULL;
G3Vol.GetLVPars(&vmoth, iaxis, &rangehi, &rangelo, &axiscode, &shape,
&nmed, &Rpar, &npar, solid);
// Calculate the number of divisions
G4int ndiv = int(( rangehi - c0 ) / Step);
if (ndiv > ndvmx && ndvmx > 0 ) ndiv = ndvmx;
if (ndiv > 255) ndiv = 255;
// nullify parameter valus
for (G4int i=0; i<npar; i++) Rpar[i] = 0.;
// Generate the logical volume for the subvolumes
G4gsvolu(vname, shape, numed, Rpar, zeronpar);
// and obtain the pointer
G4LogicalVolume *lvol = G3Vol.GetLVx(vname);
// check for negative parameters in volume definition
G4double *pars = NULL;
// G4bool negpars = G3NegVolPars(pars,&npar,vname,vmoth,"GSDVN");
G4bool negpars = false;
G4double width = rangehi - c0;
G4double offset = (rangehi + c0)/2.;
if ( ! negpars ) {
// Generate replicas
G4PVReplica *pvol = new G4PVReplica(
vname, lvol, mothPV, axiscode, ndiv, width, offset);
G3Vol.PutPV1(&vname, pvol);
} else {
G4VPVParameterisation *dvnParam = new G3CalcParams(ndiv, width, offset);
G4PVParameterised *pvol = new G4PVParameterised(
vname, lvol, mothPV, axiscode, ndiv, dvnParam);
G3Vol.PutPV1(&vname, pvol);
}
}
*/
G4cerr << "G4gsdvt2 currently not supported." << endl;
void G4gsdvt2(G4String vname, G4String vmoth, G4double step, G4int iaxis,
G4double c0, G4int numed, G4int ndvmx)
{
// find mother VTE
G3VolTableEntry* mvte = G3Vol.GetVTE(vmoth);
if (mvte == 0) {
G4Exception("G4gsdtn2:'" + vmoth + "' has no VolTableEntry");
}
else {
// a new vte clone copy with division is created
// for each mother (clone copy)
G4CreateCloneVTEWithDivision(vname, mvte,
kDvt2, ndvmx, iaxis, numed, c0, step);
}
}