Import Geant4 0.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-01 15:25:35 +02:00
parent 54d6b71f95
commit b97f8d0df7
3237 changed files with 807095 additions and 0 deletions
@@ -0,0 +1,52 @@
// This code implementation is the intellectual property of
// the RD44 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: G4PPVParameterised.cc,v 2.1 1998/11/10 18:31:07 morita Exp $
// GEANT4 tag $Name: geant4-00 $
//
//
//
#include "G4PPVParameterised.hh"
#include "HepODBMS/clustering/HepClustering.h"
#include "globals.hh"
#include "G4RotationMatrix.hh"
#include "G4ThreeVector.hh"
#include "G4PVParameterised.hh"
#include "G4VPhysicalVolume.hh"
#include "G4LogicalVolume.hh"
#include "G4PLogicalVolume.hh"
G4PPVParameterised::G4PPVParameterised( G4VPhysicalVolume* PhysVol,
HepRef(G4PLogicalVolume) persLogVol)
: G4PPVReplica(PhysVol, persLogVol)
{
// G4VPVParameterisation class has no data member
// fparam = NULL;
}
G4PPVParameterised::~G4PPVParameterised()
{
}
G4VPhysicalVolume* G4PPVParameterised::MakeTransientObject(
G4LogicalVolume* aLogical,
G4VPhysicalVolume* aMother)
{
const G4String pName = (const char *) GetName();
EAxis pAxis = faxis;
G4int nReplicas = fnReplicas;
G4VPhysicalVolume* aPhysVol = new G4PVParameterised(
pName, aLogical, aMother, pAxis, nReplicas, NULL);
return aPhysVol;
}
@@ -0,0 +1,69 @@
// This code implementation is the intellectual property of
// the RD44 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: G4PPVPlacement.cc,v 2.5 1998/11/10 18:31:06 morita Exp $
// GEANT4 tag $Name: geant4-00 $
//
//
//
#include "G4PPVPlacement.hh"
#include "HepODBMS/clustering/HepClustering.h"
#include "globals.hh"
#include "G4RotationMatrix.hh"
#include "G4ThreeVector.hh"
#include "G4PVPlacement.hh"
#include "G4VPhysicalVolume.hh"
#include "G4LogicalVolume.hh"
#include "G4PLogicalVolume.hh"
G4PPVPlacement::G4PPVPlacement(
G4VPhysicalVolume* PhysVol,
HepRef(G4PLogicalVolume) persLogVol)
: G4PVPhysicalVolume(PhysVol, persLogVol)
{
fcopyNo = PhysVol->GetCopyNo();
fmany = PhysVol->IsMany();
}
G4PPVPlacement::~G4PPVPlacement()
{
}
G4VPhysicalVolume* G4PPVPlacement::MakeTransientObject(
G4LogicalVolume* aLogical,
G4VPhysicalVolume* aMother )
{
G4RotationMatrix* pRot = GetRotation();
G4ThreeVector tlate = GetTranslation();
G4String pName;
G4VPhysicalVolume* aPhysVol = new G4PVPlacement(
pRot, tlate, pName = fname, aLogical, aMother, false, 0);
return aPhysVol;
}
G4bool G4PPVPlacement::IsMany() const
{
return fmany;
}
G4int G4PPVPlacement::GetCopyNo() const
{
return fcopyNo;
}
void G4PPVPlacement::SetCopyNo(G4int newCopyNo)
{
fcopyNo= newCopyNo;
}
@@ -0,0 +1,79 @@
// This code implementation is the intellectual property of
// the RD44 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: G4PPVReplica.cc,v 2.1 1998/11/10 18:31:07 morita Exp $
// GEANT4 tag $Name: geant4-00 $
//
//
//
#include "G4PPVReplica.hh"
#include "HepODBMS/clustering/HepClustering.h"
#include "globals.hh"
#include "G4RotationMatrix.hh"
#include "G4ThreeVector.hh"
#include "G4PVReplica.hh"
#include "G4VPhysicalVolume.hh"
#include "G4LogicalVolume.hh"
#include "G4PLogicalVolume.hh"
G4PPVReplica::G4PPVReplica( G4VPhysicalVolume* PhysVol,
HepRef(G4PLogicalVolume) persLogVol)
: G4PVPhysicalVolume(PhysVol, persLogVol)
{
EAxis axis;
G4int nReplicas;
G4double width;
G4double offset;
G4bool consuming;
PhysVol->GetReplicationData(axis, nReplicas, width, offset, consuming);
faxis = axis;
fnReplicas = nReplicas;
fwidth = width;
foffset = offset;
fcopyNo = PhysVol->GetCopyNo();
}
G4PPVReplica::~G4PPVReplica()
{
}
G4VPhysicalVolume* G4PPVReplica::MakeTransientObject(
G4LogicalVolume* aLogical,
G4VPhysicalVolume* aMother)
{
const G4String pName = (const char *) GetName();
EAxis pAxis = faxis;
G4int nReplicas = fnReplicas;
G4double width = fwidth;
G4double offset = foffset;
G4VPhysicalVolume* aPhysVol = new G4PVReplica(
pName, aLogical, aMother, pAxis, nReplicas, width, offset);
return aPhysVol;
}
G4bool G4PPVReplica::IsMany() const
{
return false;
}
G4int G4PPVReplica::GetCopyNo() const
{
return fcopyNo;
}
void G4PPVReplica::SetCopyNo(G4int newCopyNo)
{
fcopyNo= newCopyNo;
}
@@ -0,0 +1,142 @@
// This code implementation is the intellectual property of
// the RD44 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: G4PVPhysicalVolume.cc,v 2.6 1998/11/15 14:04:17 morita Exp $
// GEANT4 tag $Name: geant4-00 $
//
//
// Takashi.Sasaki@kek.jp
#include "G4PVPhysicalVolume.hh"
#include "globals.hh"
#include "G4RotationMatrix.hh"
#include "G4ThreeVector.hh"
#include "G4PVPlacement.hh"
#include "G4VPhysicalVolume.hh"
#include "G4LogicalVolume.hh"
#include "G4PLogicalVolume.hh"
#ifndef OO_VARRAY_D_DOUBLE
implement(HepVArray,d_Double)
#endif
G4PVPhysicalVolume::G4PVPhysicalVolume()
: flogical(NULL), fname(NULL), fmother(NULL)
{
frot.resize(9);
ftrans.resize(3);
}
G4PVPhysicalVolume::G4PVPhysicalVolume(
const G4VPhysicalVolume *PhysVol,
const HepRef(G4PLogicalVolume) persLogVol)
{
const G4RotationMatrix* aRot = PhysVol->GetRotation();
if ( aRot )
SetRotation( PhysVol->GetRotation() );
const G4ThreeVector atrans = PhysVol->GetTranslation();
SetTranslation( atrans );
flogical = persLogVol;
fname = PhysVol->GetName();
// fmother = LookUp(PhysVol->GetMother());
}
G4PVPhysicalVolume::~G4PVPhysicalVolume()
{
}
void G4PVPhysicalVolume::SetMother(const HepRef(G4PVPhysicalVolume) persMother)
{
fmother = persMother;
}
G4VPhysicalVolume* G4PVPhysicalVolume::MakeTransientObject(
G4LogicalVolume* aLogical,
G4VPhysicalVolume* aMother )
{
G4RotationMatrix* pRot = GetRotation();
G4ThreeVector tlate = GetTranslation();
G4String pName;
// Need to call concrete Phys Vol class according to the physics
// volume type. For now, a simple physical volume is assumed for
// quick solution.
G4VPhysicalVolume* aPhysVol = new G4PVPlacement(
pRot, tlate, pName = fname, aLogical, NULL, false, 0);
aPhysVol->SetMother(aMother);
return aPhysVol;
}
G4PString G4PVPhysicalVolume::GetName()
{
return fname;
}
void G4PVPhysicalVolume::SetName(const G4PString aName)
{
fname = aName;
}
HepRef(G4PLogicalVolume) G4PVPhysicalVolume::GetLogicalVolume()
{
return flogical;
}
G4RotationMatrix* G4PVPhysicalVolume::GetRotation()
{
// create unit matrix with default constructor
G4RotationMatrix* aRot = new G4RotationMatrix();
// setup the transient rotation matrix
aRot->rotateAxes( Hep3Vector(frot[0],frot[3],frot[6]),
Hep3Vector(frot[1],frot[4],frot[7]),
Hep3Vector(frot[2],frot[5],frot[8]) );
return aRot;
}
G4ThreeVector& G4PVPhysicalVolume::GetTranslation()
{
G4ThreeVector atrans(ftrans[0],ftrans[1],ftrans[2]); // local variable
ftransvector = G4ThreeVector(atrans); // cast by copy constructor
return ftransvector;
}
void G4PVPhysicalVolume::SetRotation(const G4RotationMatrix* aRot)
{
frot.resize(9);
frot[0] = aRot->xx();
frot[1] = aRot->xy();
frot[2] = aRot->xz();
frot[3] = aRot->yx();
frot[4] = aRot->yy();
frot[5] = aRot->yz();
frot[6] = aRot->zx();
frot[7] = aRot->zy();
frot[8] = aRot->zz();
frot.update();
}
void G4PVPhysicalVolume::SetTranslation(G4ThreeVector atrans)
{
ftrans.resize(3);
ftrans[0] = atrans.x();
ftrans[1] = atrans.y();
ftrans[2] = atrans.z();
ftrans.update();
}
@@ -0,0 +1,43 @@
// This code implementation is the intellectual property of
// the RD44 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: G4PVSolid.cc,v 2.3 1998/07/12 03:01:22 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
//
// class G4PVSolid
//
// Implementation for persistent solid base class
//
//
// History:
// 19.06.98 A.Kimura Converted G4VSolid.cc
#include "G4PVSolid.hh"
// Constructor
// - Copies name
G4PVSolid::G4PVSolid(const G4String& name)
: fshapeName(name)
{
}
// Destructor (virtual)
// - Remove ourselves from solid Store
G4PVSolid::~G4PVSolid()
{
}
// Returns name by value
G4String G4PVSolid::GetName() const
{
return (const char*) fshapeName;
}
void G4PVSolid::SetName(const G4String& name)
{
fshapeName = name;
}