Import Geant4 10.3.0 source tree
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
// 21-04-16, created by E.Bagli
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "G4AtomicBond.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4AtomicBond::G4AtomicBond(theBondType aType,
|
||||
G4Element* firstAtomKind,
|
||||
G4int firstAtomNumber,
|
||||
G4Element* secondAtomKind,
|
||||
G4int secondAtomNumber):
|
||||
theFirstAtomKind(firstAtomKind),
|
||||
theFirstAtomNumber(firstAtomNumber),
|
||||
theSecondAtomKind(secondAtomKind),
|
||||
theSecondAtomNumber(secondAtomNumber),
|
||||
theType(aType),
|
||||
theAromaticity(0){;}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4AtomicBond::~G4AtomicBond(){;}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -0,0 +1,50 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4CrystalLattice.hh 94016 2015-11-05 10:14:49Z gcosmo $
|
||||
//
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
// ClassName: G4AtomicFormFactor
|
||||
//
|
||||
// Description: Contains the function for the evaluation of the atomic form
|
||||
// factor. The tabulated data are available on IUCr website
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
// XXX
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
// 21-04-16, created by E.Bagli
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "G4AtomicFormFactor.hh"
|
||||
|
||||
G4AtomicFormFactor *G4AtomicFormFactor::s_G4AtomicFormFactorManager = 0;
|
||||
@@ -0,0 +1,158 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4CrystalExtension.hh 94016 2015-11-05 10:14:49Z gcosmo $
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
// 21-04-16, created by E.Bagli
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "G4CrystalExtension.hh"
|
||||
#include "G4AtomicFormFactor.hh"
|
||||
|
||||
|
||||
G4CrystalExtension::G4CrystalExtension(G4Material* mat,const G4String& name):
|
||||
G4VMaterialExtension(name),
|
||||
fMaterial(mat),
|
||||
theUnitCell(0){;}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4CrystalExtension::~G4CrystalExtension(){;}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4complex G4CrystalExtension::
|
||||
ComputeStructureFactor(G4double kScatteringVector,
|
||||
G4int h,
|
||||
G4int k,
|
||||
G4int l){
|
||||
//SF == Structure Factor
|
||||
//AFF == Atomic Form Factor
|
||||
//GFS == Geometrical Structure Factor
|
||||
G4complex SF = G4complex(0.,0.);
|
||||
|
||||
for(auto anElement: *(fMaterial->GetElementVector())){
|
||||
G4double AFF = G4AtomicFormFactor::GetManager()->Get(kScatteringVector,anElement->GetZ());
|
||||
|
||||
G4complex GFS = G4complex(0.,0.);
|
||||
|
||||
for(auto anAtomPos: GetAtomBase(anElement)->GetPos())
|
||||
{
|
||||
G4double aDouble = h * anAtomPos.x()
|
||||
+ k * anAtomPos.y()
|
||||
+ l * anAtomPos.z();
|
||||
GFS += G4complex(std::cos(2 * CLHEP::pi * aDouble),
|
||||
std::sin(2 * CLHEP::pi * aDouble));
|
||||
}
|
||||
|
||||
|
||||
SF += G4complex(AFF * GFS.real(),AFF * GFS.imag());
|
||||
}
|
||||
return SF;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4complex G4CrystalExtension::
|
||||
ComputeStructureFactorGeometrical(G4int h,
|
||||
G4int k,
|
||||
G4int l){
|
||||
//GFS == Geometrical Structure Form Factor
|
||||
G4complex GFS = G4complex(0.,0.);
|
||||
|
||||
for(auto anElement: *(fMaterial->GetElementVector())){
|
||||
for(auto anAtomPos: GetAtomBase(anElement)->GetPos())
|
||||
{
|
||||
G4double aDouble = h * anAtomPos.x()
|
||||
+ k * anAtomPos.y()
|
||||
+ l * anAtomPos.z();
|
||||
GFS += G4complex(std::cos(2 * CLHEP::pi * aDouble),
|
||||
std::sin(2 * CLHEP::pi * aDouble));
|
||||
}
|
||||
}
|
||||
return GFS;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void G4CrystalExtension::SetElReduced(const ReducedElasticity& mat) {
|
||||
for (size_t i=0; i<6; i++) {
|
||||
for (size_t j=0; j<6; j++) {
|
||||
fElReduced[i][j] = mat[i][j];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void G4CrystalExtension::SetCpq(G4int p, G4int q, G4double value) {
|
||||
if (p>0 && p<7 && q>0 && q<7) fElReduced[p-1][q-1] = value;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4CrystalAtomBase* G4CrystalExtension::GetAtomBase(const G4Element* anElement){
|
||||
if((theCrystalAtomBaseMap.count(anElement)<1)){
|
||||
G4String astring = "Atom base for element " + anElement->GetName()
|
||||
+ " is not registered." ;
|
||||
G4Exception ("G4CrystalExtension::GetAtomBase()", "cry001", JustWarning,astring);
|
||||
|
||||
AddAtomBase(anElement, new G4CrystalAtomBase());
|
||||
}
|
||||
return theCrystalAtomBaseMap[anElement];
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4bool G4CrystalExtension::GetAtomPos(const G4Element* anEl, std::vector<G4ThreeVector>& vecout){
|
||||
std::vector<G4ThreeVector> pos;
|
||||
for(auto asinglepos: GetAtomBase(anEl)->GetPos()){
|
||||
pos.clear();
|
||||
theUnitCell->FillAtomicPos(asinglepos,pos);
|
||||
vecout.insert(std::end(vecout), std::begin(pos), std::end(pos));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4bool G4CrystalExtension::GetAtomPos(std::vector<G4ThreeVector>& vecout){
|
||||
std::vector<G4ThreeVector> pos;
|
||||
vecout.clear();
|
||||
for(auto anElement: *(fMaterial->GetElementVector())){
|
||||
pos.clear();
|
||||
GetAtomPos(anElement,pos);
|
||||
vecout.insert(std::end(vecout), std::begin(pos), std::end(pos));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -0,0 +1,624 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
// 21-04-16, created by E.Bagli
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "G4CrystalUnitCell.hh"
|
||||
#include "G4PhysicalConstants.hh"
|
||||
#include <cmath>
|
||||
|
||||
G4CrystalUnitCell::G4CrystalUnitCell(G4double sizeA,
|
||||
G4double sizeB,
|
||||
G4double sizeC,
|
||||
G4double alpha,
|
||||
G4double beta,
|
||||
G4double gamma,
|
||||
G4int spacegroup):
|
||||
theSpaceGroup(spacegroup),
|
||||
theSize(G4ThreeVector(sizeA,sizeB,sizeC)),
|
||||
theAngle(G4ThreeVector(alpha,beta,gamma))
|
||||
{
|
||||
|
||||
nullVec = G4ThreeVector(0.,0.,0.);
|
||||
theUnitBasis[0] = CLHEP::HepXHat;
|
||||
theUnitBasis[1] = CLHEP::HepYHat;
|
||||
theUnitBasis[2] = CLHEP::HepZHat;
|
||||
|
||||
theRecUnitBasis[0] = CLHEP::HepXHat;
|
||||
theRecUnitBasis[1] = CLHEP::HepYHat;
|
||||
theRecUnitBasis[2] = CLHEP::HepZHat;
|
||||
|
||||
cosa=std::cos(alpha), cosb=std::cos(beta), cosg=std::cos(gamma);
|
||||
sina=std::sin(alpha), sinb=std::sin(beta), sing=std::sin(gamma);
|
||||
|
||||
cosar = (cosb*cosg-cosa)/(sinb*sing);
|
||||
cosbr = (cosa*cosg-cosb)/(sina*sing);
|
||||
cosgr = (cosa*cosb-cosg)/(sina*sinb);
|
||||
|
||||
theVolume = ComputeCellVolume();
|
||||
theRecVolume = 1. / theVolume;
|
||||
|
||||
theRecSize[0] = sizeB * sizeC * sina / theVolume;
|
||||
theRecSize[1] = sizeC * sizeA * sinb / theVolume;
|
||||
theRecSize[2] = sizeA * sizeB * sing / theVolume;
|
||||
|
||||
theRecAngle[0] = std::acos(cosar);
|
||||
theRecAngle[1] = std::acos(cosbr);
|
||||
theRecAngle[2] = std::acos(cosgr);
|
||||
|
||||
G4double x3,y3,z3;
|
||||
|
||||
switch (GetLatticeSystem(theSpaceGroup)) {
|
||||
case Amorphous:
|
||||
break;
|
||||
case Cubic: // Cubic, C44 set
|
||||
break;
|
||||
case Tetragonal:
|
||||
break;
|
||||
case Orthorhombic:
|
||||
break;
|
||||
case Rhombohedral:
|
||||
theUnitBasis[1].rotateZ(gamma-CLHEP::halfpi); // X-Y opening angle
|
||||
// Z' axis computed by hand to get both opening angles right
|
||||
// X'.Z' = cos(alpha), Y'.Z' = cos(beta), solve for Z' components
|
||||
x3=cosa, y3=(cosb-cosa*cosg)/sing, z3=std::sqrt(1.-x3*x3-y3*y3);
|
||||
theUnitBasis[2] = G4ThreeVector(x3, y3, z3).unit();
|
||||
break;
|
||||
case Monoclinic:
|
||||
theUnitBasis[2].rotateX(beta-CLHEP::halfpi); // Z-Y opening angle
|
||||
break;
|
||||
case Triclinic:
|
||||
theUnitBasis[1].rotateZ(gamma-CLHEP::halfpi); // X-Y opening angle
|
||||
// Z' axis computed by hand to get both opening angles right
|
||||
// X'.Z' = cos(alpha), Y'.Z' = cos(beta), solve for Z' components
|
||||
x3=cosa, y3=(cosb-cosa*cosg)/sing, z3=std::sqrt(1.-x3*x3-y3*y3);
|
||||
theUnitBasis[2] = G4ThreeVector(x3, y3, z3).unit();
|
||||
break;
|
||||
case Hexagonal: // Tetragonal, C16=0
|
||||
theUnitBasis[1].rotateZ(30.*CLHEP::deg); // X-Y opening angle
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
for(auto i:{0,1,2}){
|
||||
theBasis[i] = theUnitBasis[i] * theSize[i];
|
||||
theRecBasis[i] = theRecUnitBasis[i] * theRecSize[i];
|
||||
}
|
||||
|
||||
// Initialize sgInfo
|
||||
/* at first some initialization for SgInfo */
|
||||
/*
|
||||
const T_TabSgName *tsgn = NULL;
|
||||
|
||||
SgInfo.MaxList = 192;
|
||||
SgInfo.ListSeitzMx = malloc( SgInfo.MaxList * sizeof(*SgInfo.ListSeitzMx) );
|
||||
|
||||
// no list info needed here
|
||||
SgInfo.ListRotMxInfo = NULL;
|
||||
tsgn = FindTabSgNameEntry(SchoenfliesSymbols[theSpaceGroup], 'A');
|
||||
|
||||
// initialize SgInfo struct
|
||||
InitSgInfo( &SgInfo );
|
||||
SgInfo.TabSgName = tsgn;
|
||||
if ( tsgn ){
|
||||
SgInfo.GenOption = 1;
|
||||
}
|
||||
|
||||
ParseHallSymbol( SchoenfliesSymbols[theSpaceGroup], &SgInfo );
|
||||
CompleteSgInfo( &SgInfo );
|
||||
Set_si( &SgInfo );
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4CrystalUnitCell::~G4CrystalUnitCell(){;}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
theLatticeSystemType G4CrystalUnitCell::GetLatticeSystem(G4int aGroup){
|
||||
|
||||
if( aGroup >= 1 && aGroup <= 2 ) {return Triclinic;}
|
||||
else if(aGroup >= 3 && aGroup <= 15 ) {return Monoclinic;}
|
||||
else if(aGroup >= 16 && aGroup <= 74 ) {return Orthorhombic;}
|
||||
else if(aGroup >= 75 && aGroup <= 142) {return Tetragonal;}
|
||||
else if(aGroup == 146 || aGroup == 148 ||
|
||||
aGroup == 155 || aGroup == 160 ||
|
||||
aGroup == 161 || aGroup == 166 ||
|
||||
aGroup == 167) {return Rhombohedral;}
|
||||
else if(aGroup >= 143 && aGroup <= 167) {return Hexagonal;}
|
||||
else if(aGroup >= 168 && aGroup <= 194) {return Hexagonal;}
|
||||
else if(aGroup >= 195 && aGroup <= 230) {return Cubic;}
|
||||
|
||||
return Amorphous;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
/*
|
||||
theBravaisLatticeType G4CrystalUnitCell::GetBravaisLattice(G4int aGroup){
|
||||
;
|
||||
}
|
||||
*/
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
const G4ThreeVector& G4CrystalUnitCell::GetUnitBasis(G4int idx) const {
|
||||
return (idx>=0 && idx<3 ? theUnitBasis[idx] : nullVec);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
const G4ThreeVector& G4CrystalUnitCell::GetBasis(G4int idx) const {
|
||||
return (idx>=0 && idx<3 ? theBasis[idx] : nullVec);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
const G4ThreeVector& G4CrystalUnitCell::GetRecUnitBasis(G4int idx) const {
|
||||
return (idx>=0 && idx<3 ? theRecUnitBasis[idx] : nullVec);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
const G4ThreeVector& G4CrystalUnitCell::GetRecBasis(G4int idx) const {
|
||||
return (idx>=0 && idx<3 ? theRecBasis[idx] : nullVec);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4ThreeVector G4CrystalUnitCell::GetUnitBasisTrigonal(){
|
||||
// Z' axis computed by hand to get both opening angles right
|
||||
// X'.Z' = cos(alpha), Y'.Z' = cos(beta), solve for Z' components
|
||||
G4double x3=cosa, y3=(cosb-cosa*cosg)/sing, z3=std::sqrt(1.-x3*x3-y3*y3);
|
||||
return G4ThreeVector(x3, y3, z3).unit();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4bool G4CrystalUnitCell::FillAtomicUnitPos(G4ThreeVector& pos, std::vector<G4ThreeVector>& vecout){
|
||||
// Just for testing the infrastructure
|
||||
G4ThreeVector aaa = pos;
|
||||
vecout.push_back(aaa);
|
||||
vecout.push_back(G4ThreeVector(2.,5.,3.));
|
||||
return true;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4bool G4CrystalUnitCell::FillAtomicPos(G4ThreeVector& posin, std::vector<G4ThreeVector>& vecout){
|
||||
FillAtomicUnitPos(posin,vecout);
|
||||
for(auto &vec:vecout){
|
||||
vec.setX(vec.x()*theSize[0]);
|
||||
vec.setY(vec.y()*theSize[1]);
|
||||
vec.setZ(vec.z()*theSize[2]);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4bool G4CrystalUnitCell::FillElReduced(G4double Cij[6][6]) {
|
||||
switch (GetLatticeSystem()) {
|
||||
case Amorphous:
|
||||
return FillAmorphous(Cij);
|
||||
break;
|
||||
case Cubic: // Cubic, C44 set
|
||||
return FillCubic(Cij);
|
||||
break;
|
||||
case Tetragonal:
|
||||
return FillTetragonal(Cij);
|
||||
break;
|
||||
case Orthorhombic:
|
||||
return FillOrthorhombic(Cij);
|
||||
break;
|
||||
case Rhombohedral:
|
||||
return FillRhombohedral(Cij);
|
||||
break;
|
||||
case Monoclinic:
|
||||
return FillMonoclinic(Cij);
|
||||
break;
|
||||
case Triclinic:
|
||||
return FillTriclinic(Cij);
|
||||
break;
|
||||
case Hexagonal: // Tetragonal, C16=0
|
||||
return FillHexagonal(Cij);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4bool G4CrystalUnitCell::FillAmorphous(G4double Cij[6][6]) const {
|
||||
Cij[3][3] = 0.5*(Cij[0][0]-Cij[0][1]);
|
||||
return true;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4bool G4CrystalUnitCell::FillCubic(G4double Cij[6][6]) const {
|
||||
G4double C11=Cij[0][0], C12=Cij[0][1], C44=Cij[3][3];
|
||||
|
||||
for (size_t i=0; i<6; i++) {
|
||||
for (size_t j=i; j<6; j++) {
|
||||
if (i<3 && j<3) Cij[i][j] = (i==j) ? C11 : C12;
|
||||
else if (i==j && i>=3) Cij[i][i] = C44;
|
||||
else Cij[i][j] = 0.;
|
||||
}
|
||||
}
|
||||
|
||||
ReflectElReduced(Cij);
|
||||
|
||||
return (C11!=0. && C12!=0. && C44!=0.);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4bool G4CrystalUnitCell::FillTetragonal(G4double Cij[6][6]) const {
|
||||
G4double C11=Cij[0][0], C12=Cij[0][1], C13=Cij[0][2], C16=Cij[0][5];
|
||||
G4double C33=Cij[2][2], C44=Cij[3][3], C66=Cij[5][5];
|
||||
|
||||
Cij[1][1] = C11; // Copy small number of individual elements
|
||||
Cij[1][2] = C13;
|
||||
Cij[1][5] = -C16;
|
||||
Cij[4][4] = C44;
|
||||
|
||||
ReflectElReduced(Cij);
|
||||
|
||||
// NOTE: Do not test for C16 != 0., to allow calling from Hexagonal
|
||||
return (C11!=0. && C12!=0. && C13!=0. && C33!=0. && C44!=0. && C66!=0.);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4bool G4CrystalUnitCell::FillOrthorhombic(G4double Cij[6][6]) const {
|
||||
// No degenerate elements; just check for all non-zero
|
||||
ReflectElReduced(Cij);
|
||||
|
||||
G4bool good = true;
|
||||
for (size_t i=0; i<6; i++) {
|
||||
for (size_t j=i+1; j<3; j++)
|
||||
good &= (Cij[i][j] != 0);
|
||||
}
|
||||
|
||||
return good;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4bool G4CrystalUnitCell::FillRhombohedral(G4double Cij[6][6]) const {
|
||||
G4double C11=Cij[0][0], C12=Cij[0][1], C13=Cij[0][2], C14=Cij[0][3];
|
||||
G4double C15=Cij[0][4], C33=Cij[2][2], C44=Cij[3][3], C66=0.5*(C11-C12);
|
||||
|
||||
Cij[1][1] = C11; // Copy small number of individual elements
|
||||
Cij[1][2] = C13;
|
||||
Cij[1][3] = -C14;
|
||||
Cij[1][4] = -C15;
|
||||
Cij[3][5] = -C15;
|
||||
Cij[4][4] = C44;
|
||||
Cij[4][5] = C14;
|
||||
|
||||
// NOTE: C15 may be zero (c.f. rhombohedral(I) vs. (II))
|
||||
return (C11!=0 && C12!=0 && C13!=0 && C14!=0. &&
|
||||
C33!=0. && C44!=0. && C66!=0.);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4bool G4CrystalUnitCell::FillMonoclinic(G4double Cij[6][6]) const {
|
||||
// The monoclinic matrix has 13 independent elements with no degeneracies
|
||||
// Sanity condition is same as orthorhombic, plus C45, C(1,2,3)6
|
||||
|
||||
return (FillOrthorhombic(Cij) && Cij[0][5]!=0. && Cij[1][5]!=0. &&
|
||||
Cij[2][5] != 0. && Cij[3][4]!=0.);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4bool G4CrystalUnitCell::FillTriclinic(G4double Cij[6][6]) const {
|
||||
// The triclinic matrix has the entire upper half filled (21 elements)
|
||||
|
||||
ReflectElReduced(Cij);
|
||||
|
||||
G4bool good = true;
|
||||
for (size_t i=0; i<6; i++) {
|
||||
for (size_t j=i; j<6; j++) good &= (Cij[i][j] != 0);
|
||||
}
|
||||
|
||||
return good;
|
||||
}
|
||||
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4bool G4CrystalUnitCell::FillHexagonal(G4double Cij[6][6]) const {
|
||||
Cij[0][5] = 0.;
|
||||
Cij[4][5] = 0.5*(Cij[0][0] - Cij[0][1]);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4bool G4CrystalUnitCell::ReflectElReduced(G4double Cij[6][6]) const {
|
||||
for (size_t i=1; i<6; i++) {
|
||||
for (size_t j=i+1; j<6; j++) {
|
||||
Cij[j][i] = Cij[i][j];
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4double G4CrystalUnitCell::ComputeCellVolume(){
|
||||
G4double a = theSize[0], b = theSize[1], c = theSize[2];
|
||||
|
||||
switch(GetLatticeSystem())
|
||||
{
|
||||
case Amorphous:
|
||||
return 0.;
|
||||
break;
|
||||
case Cubic:
|
||||
return a * a * a;
|
||||
break;
|
||||
case Tetragonal:
|
||||
return a * a * c;
|
||||
break;
|
||||
case Orthorhombic:
|
||||
return a * b * c;
|
||||
break;
|
||||
case Rhombohedral:
|
||||
return a*a*a*std::sqrt(1.-3.*cosa*cosa+2.*cosa*cosa*cosa);
|
||||
break;
|
||||
case Monoclinic:
|
||||
return a*b*c*sinb;
|
||||
break;
|
||||
case Triclinic:
|
||||
return a*b*c*std::sqrt(1.-cosa*cosa-cosb*cosb-cosg*cosg*2.*cosa*cosb*cosg);
|
||||
break;
|
||||
case Hexagonal:
|
||||
return std::sqrt(3.0)/2.*a*a*c;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return 0.;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4double G4CrystalUnitCell::GetIntSp2(G4int h,
|
||||
G4int k,
|
||||
G4int l){
|
||||
|
||||
/* Reference:
|
||||
Table 2.4, pag. 65
|
||||
|
||||
@Inbook{Ladd2003,
|
||||
author="Ladd, Mark and Palmer, Rex",
|
||||
title="Lattices and Space-Group Theory",
|
||||
bookTitle="Structure Determination by X-ray Crystallography",
|
||||
year="2003",
|
||||
publisher="Springer US",
|
||||
address="Boston, MA",
|
||||
pages="51--116",
|
||||
isbn="978-1-4615-0101-5",
|
||||
doi="10.1007/978-1-4615-0101-5_2",
|
||||
url="http://dx.doi.org/10.1007/978-1-4615-0101-5_2"
|
||||
}
|
||||
*/
|
||||
|
||||
G4double a = theSize[0], b = theSize[1], c = theSize[2];
|
||||
G4double a2 = a*a, b2 = b*b, c2 = c*c;
|
||||
G4double h2 = h*h, k2 = k*k, l2 = l*l;
|
||||
|
||||
G4double cos2a,sin2a,sin2b;
|
||||
G4double R,T;
|
||||
|
||||
switch(GetLatticeSystem())
|
||||
{
|
||||
case Amorphous:
|
||||
return 0.;
|
||||
break;
|
||||
case Cubic:
|
||||
return a2 / ( h2+k2+l2 );
|
||||
break;
|
||||
case Tetragonal:
|
||||
return 1.0 / ( (h2 + k2)/a2 + l2/c2 );
|
||||
break;
|
||||
case Orthorhombic:
|
||||
return 1.0 / ( h2/a2 + k2/b2 + l2/c2 );
|
||||
break;
|
||||
case Rhombohedral:
|
||||
cos2a=cosa*cosa; sin2a=sina*sina;
|
||||
T = h2+k2+l2+2.*(h*k+k*l+h*l) * ((cos2a-cosa)/sin2a);
|
||||
R = sin2a / (1. - 3*cos2a + 2.*cos2a*cosa);
|
||||
return a*a / (T*R);
|
||||
break;
|
||||
case Monoclinic:
|
||||
sin2b=sinb*sinb;
|
||||
return 1./(1./sin2b * (h2/a2+l2/c2-2*h*l*cosb/(a*c)) + k2/b2);
|
||||
break;
|
||||
case Triclinic:
|
||||
return 1./GetRecIntSp2(h,k,l);
|
||||
break;
|
||||
case Hexagonal:
|
||||
return 1. / ( (4.*(h2+k2+h*k) / (3.*a2)) + l2/c2 );
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return 0.;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4double G4CrystalUnitCell::GetRecIntSp2(G4int h,
|
||||
G4int k,
|
||||
G4int l){
|
||||
/* Reference:
|
||||
Table 2.4, pag. 65
|
||||
|
||||
@Inbook{Ladd2003,
|
||||
author="Ladd, Mark and Palmer, Rex",
|
||||
title="Lattices and Space-Group Theory",
|
||||
bookTitle="Structure Determination by X-ray Crystallography",
|
||||
year="2003",
|
||||
publisher="Springer US",
|
||||
address="Boston, MA",
|
||||
pages="51--116",
|
||||
isbn="978-1-4615-0101-5",
|
||||
doi="10.1007/978-1-4615-0101-5_2",
|
||||
url="http://dx.doi.org/10.1007/978-1-4615-0101-5_2"
|
||||
}
|
||||
*/
|
||||
|
||||
G4double a = theRecSize[0], b = theRecSize[1], c = theRecSize[2];
|
||||
G4double a2 = a*a, b2 = b*b, c2 = c*c;
|
||||
G4double h2 = h*h, k2 = k*k, l2 = l*l;
|
||||
|
||||
switch(GetLatticeSystem())
|
||||
{
|
||||
case Amorphous:
|
||||
return 0.;
|
||||
break;
|
||||
case Cubic:
|
||||
return a2 * (h2+k2+l2);
|
||||
break;
|
||||
case Tetragonal:
|
||||
return (h2+k2)*a2 + l2*c2 ;
|
||||
break;
|
||||
case Orthorhombic:
|
||||
return h2*a2 + k2+b2 + h2*c2;
|
||||
break;
|
||||
case Rhombohedral:
|
||||
return (h2+k2+l2+2.*(h*k+k*l+h*l) * cosar)*a2;
|
||||
break;
|
||||
case Monoclinic:
|
||||
return h2*a2+k2*b2+l2*c2+2.*h*l*a*c*cosbr;
|
||||
break;
|
||||
case Triclinic:
|
||||
return h2*a2+k2*b2+l2*c2+2.*k*l*b*c*cosar+2.*l*h*c*a*cosbr+2.*h*k*a*b*cosgr;
|
||||
break;
|
||||
case Hexagonal:
|
||||
return (h2+k2+h*k)*a2 + l2*c2;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return 0.;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4double G4CrystalUnitCell::GetIntCosAng(G4int h1,
|
||||
G4int k1,
|
||||
G4int l1,
|
||||
G4int h2,
|
||||
G4int k2,
|
||||
G4int l2){
|
||||
|
||||
/* Reference:
|
||||
Table 2.4, pag. 65
|
||||
|
||||
@Inbook{Kelly2012,
|
||||
author="Anthony A. Kelly and Kevin M. Knowles",
|
||||
title="Appendix 3 Interplanar Spacings and Interplanar Angles",
|
||||
bookTitle="Crystallography and Crystal Defects, 2nd Edition",
|
||||
year="2012",
|
||||
publisher="John Wiley & Sons, Ltd.",
|
||||
isbn="978-0-470-75014-8",
|
||||
doi="10.1002/9781119961468",
|
||||
url="http://onlinelibrary.wiley.com/book/10.1002/9781119961468"
|
||||
}
|
||||
*/
|
||||
|
||||
G4double a = theRecSize[0], b = theRecSize[1], c = theRecSize[2];
|
||||
G4double a2 = a*a, b2 = b*b, c2 = c*c;
|
||||
G4double dsp1dsp2;
|
||||
switch(GetLatticeSystem())
|
||||
{
|
||||
case Amorphous:
|
||||
return 0.;
|
||||
break;
|
||||
case Cubic:
|
||||
return (h1*h2 + k1*k2 + l1+l2) / (std::sqrt(h1*h1 + k1*k1 + l1*l1) * std::sqrt(h2*h2 + k2*k2 + l2*l2));
|
||||
break;
|
||||
case Tetragonal:
|
||||
dsp1dsp2 = std::sqrt(GetIntSp2(h1,k1,l1)*GetIntSp2(h2,k2,l2));
|
||||
return 0. ;
|
||||
break;
|
||||
case Orthorhombic:
|
||||
dsp1dsp2 = std::sqrt(GetIntSp2(h1,k1,l1)*GetIntSp2(h2,k2,l2));
|
||||
return dsp1dsp2 * (h1*h2*a2 + k1*k2*a2 + l1*l2*c2);
|
||||
break;
|
||||
case Rhombohedral:
|
||||
dsp1dsp2 = std::sqrt(GetIntSp2(h1,k1,l1)*GetIntSp2(h2,k2,l2));
|
||||
return dsp1dsp2 * (h1*h2*a2 + k1*k2*b2 + l1*l2*c2+
|
||||
(k1*l2+k2*l1)*b*c*cosar+
|
||||
(h1*l2+h2*l1)*a*c*cosbr+
|
||||
(h1*k2+h2*k1)*a*b*cosgr);
|
||||
break;
|
||||
case Monoclinic:
|
||||
dsp1dsp2 = std::sqrt(GetIntSp2(h1,k1,l1)*GetIntSp2(h2,k2,l2));
|
||||
return dsp1dsp2 * (h1*h2*a2 + k1*k2*b2 + l1*l2*c2+
|
||||
(k1*l2+k2*l1)*b*c*cosar+
|
||||
(h1*l2+h2*l1)*a*c*cosbr+
|
||||
(h1*k2+h2*k1)*a*b*cosgr);
|
||||
break;
|
||||
case Triclinic:
|
||||
dsp1dsp2 = std::sqrt(GetIntSp2(h1,k1,l1)*GetIntSp2(h2,k2,l2));
|
||||
return dsp1dsp2 * (h1*h2*a2 + k1*k2*b2 + l1*l2*c2+
|
||||
(k1*l2+k2*l1)*b*c*cosar+
|
||||
(h1*l2+h2*l1)*a*c*cosbr+
|
||||
(h1*k2+h2*k1)*a*b*cosgr);
|
||||
break;
|
||||
case Hexagonal:
|
||||
dsp1dsp2 = std::sqrt(GetIntSp2(h1,k1,l1)*GetIntSp2(h2,k2,l2));
|
||||
return dsp1dsp2 *( (h1*h2 + k1*k2 + 0.5*(h1*k2+k1*h2))*a2 + l1*l2*c2);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return 0.;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -0,0 +1,134 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4ExtendedMaterial.cc 96792 2016-05-09 09:18:43Z vnivanch $
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//
|
||||
// 18-10-07, move definition of material index to InitialisePointers (V.Ivanchenko)
|
||||
// 13-08-08, do not use fixed size arrays (V.Ivanchenko)
|
||||
// 26-10-11, new scheme for G4Exception (mma)
|
||||
// 13-04-12, map<G4Material*,G4double> fMatComponents, filled in AddMaterial()
|
||||
// 21-04-12, fMassOfMolecule, computed for AtomsCount (mma)
|
||||
//
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "G4ExtendedMaterial.hh"
|
||||
#include "G4VMaterialExtension.hh"
|
||||
#include "G4PhysicsModelCatalog.hh"
|
||||
|
||||
// Constructor to create an extended material from the base-class G4Material
|
||||
|
||||
G4ExtendedMaterial::G4ExtendedMaterial(const G4String& name,
|
||||
const G4Material* baseMaterial)
|
||||
: G4Material(name,baseMaterial->GetDensity(),baseMaterial,
|
||||
baseMaterial->GetState(),baseMaterial->GetTemperature(),
|
||||
baseMaterial->GetPressure())
|
||||
{;}
|
||||
|
||||
// Constructor to create an extended material from single element
|
||||
|
||||
G4ExtendedMaterial::G4ExtendedMaterial(const G4String& name, G4double z,
|
||||
G4double a, G4double density,
|
||||
G4State state, G4double temp, G4double pressure)
|
||||
: G4Material(name,z,a,density,state,temp,pressure)
|
||||
{;}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
// Constructor to create an extended material from a combination of elements
|
||||
// (elements and/or materials) added with AddElement or AddMaterial
|
||||
|
||||
G4ExtendedMaterial::G4ExtendedMaterial(const G4String& name, G4double density,
|
||||
G4int nComponents,
|
||||
G4State state, G4double temp, G4double pressure)
|
||||
: G4Material(name,density,nComponents,state,temp,pressure)
|
||||
{;}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
// Constructor to create an extended material from the base extended material
|
||||
|
||||
G4ExtendedMaterial::G4ExtendedMaterial(const G4String& name, G4double density,
|
||||
const G4ExtendedMaterial* bmat,
|
||||
G4State state, G4double temp, G4double pressure)
|
||||
: G4Material(name,density,bmat,state,temp,pressure)
|
||||
{;}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
|
||||
// register G4VMaterialExtension
|
||||
|
||||
void G4ExtendedMaterial::RegisterExtension(std::unique_ptr<G4VMaterialExtension> extension)
|
||||
{
|
||||
auto iter = fExtensionMap.find(extension->GetName());
|
||||
if(iter!=fExtensionMap.end())
|
||||
{
|
||||
G4ExceptionDescription msg;
|
||||
msg << "G4ExtendedMaterial <"<<GetName()<<"> already has extension for "
|
||||
<< extension->GetName()
|
||||
<< ". Extension is replaced.";
|
||||
G4Exception("G4ExtendedMaterial::RegisterExtension(...)","MatExt001",JustWarning,msg);
|
||||
}
|
||||
fExtensionMap.insert(std::make_pair(extension->GetName(),std::move(extension)));
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
// retrieve G4VMaterialExtension, null pointer is returned if model is not available
|
||||
|
||||
G4VMaterialExtension* G4ExtendedMaterial::RetrieveExtension(const G4String& name)
|
||||
{
|
||||
const auto iter = fExtensionMap.find(name);
|
||||
if(iter!=fExtensionMap.end())
|
||||
{ return iter->second.get(); }
|
||||
else
|
||||
{
|
||||
G4ExceptionDescription msg;
|
||||
msg << "G4ExtendedMAterial <"<<GetName()<<"> cannot find extension for "
|
||||
<< name;
|
||||
G4Exception("G4ExtendedMaterial::RetreiveExtension(...)","MatExt002",JustWarning,msg);
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4bool G4ExtendedMaterial::IsExtended() const
|
||||
{ return true; }
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void G4ExtendedMaterial::Print(std::ostream& flux) const
|
||||
{
|
||||
flux << "\n Registered material extensions :\n";
|
||||
auto iter = fExtensionMap.begin();
|
||||
for(;iter!=fExtensionMap.end();iter++)
|
||||
{ flux << " " << iter->first << "\n"; }
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4Material.cc 96794 2016-05-09 10:09:30Z gcosmo $
|
||||
// $Id: G4Material.cc 100662 2016-10-31 10:21:14Z gcosmo $
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//
|
||||
@@ -645,6 +645,7 @@ G4double G4Material::GetA() const
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
#include "G4ExtendedMaterial.hh"
|
||||
|
||||
std::ostream& operator<<(std::ostream& flux, const G4Material* material)
|
||||
{
|
||||
@@ -688,7 +689,10 @@ std::ostream& operator<<(std::ostream& flux, const G4Material* material)
|
||||
}
|
||||
flux.precision(prec);
|
||||
flux.setf(mode,std::ios::floatfield);
|
||||
|
||||
|
||||
if(material->IsExtended())
|
||||
{ static_cast<const G4ExtendedMaterial*>(material)->Print(flux); }
|
||||
|
||||
return flux;
|
||||
}
|
||||
|
||||
@@ -716,3 +720,8 @@ std::ostream& operator<<(std::ostream& flux, G4MaterialTable MaterialTable)
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4bool G4Material::IsExtended() const
|
||||
{ return false; }
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4MaterialPropertiesTable.cc 96794 2016-05-09 10:09:30Z gcosmo $
|
||||
// $Id: G4MaterialPropertiesTable.cc 99765 2016-10-05 08:49:47Z gcosmo $
|
||||
//
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
@@ -79,19 +79,20 @@ G4MaterialPropertiesTable::~G4MaterialPropertiesTable()
|
||||
// Methods
|
||||
////////////
|
||||
|
||||
G4double G4MaterialPropertiesTable::GetConstProperty(const char *key)
|
||||
G4double G4MaterialPropertiesTable::GetConstProperty(const char *key) const
|
||||
{
|
||||
// Returns the constant material property corresponding to a key
|
||||
|
||||
MPTCiterator j;
|
||||
j = MPTC.find(G4String(key));
|
||||
if ( j != MPTC.end() ) return j->second;
|
||||
G4cout << "key: " << G4String(key) << G4endl;
|
||||
G4Exception("G4MaterialPropertiesTable::GetConstProperty()","mat202",
|
||||
FatalException, "Constant Material Property not found.");
|
||||
return 0.;
|
||||
}
|
||||
|
||||
G4bool G4MaterialPropertiesTable::ConstPropertyExists(const char *key)
|
||||
G4bool G4MaterialPropertiesTable::ConstPropertyExists(const char *key) const
|
||||
{
|
||||
// Returns true if a const property 'key' exists
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4NistMaterialBuilder.cc 97248 2016-05-30 15:00:11Z gcosmo $
|
||||
// $Id: G4NistMaterialBuilder.cc 99413 2016-09-21 09:02:30Z gcosmo $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -1919,15 +1919,28 @@ void G4NistMaterialBuilder::SpaceMaterials()
|
||||
AddMaterial("G4_NEOPRENE" , 1.23, 0, 0.0, 3); // POLYCLOROPRENE
|
||||
AddElementByAtomCount("C", 4);
|
||||
AddElementByAtomCount("H", 5);
|
||||
AddElementByAtomCount("Cl", 1);
|
||||
AddElementByAtomCount("Cl",1);
|
||||
|
||||
nSpace = nMaterials;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
/**
|
||||
Build biochemical materials used in G4DNA Applications.
|
||||
Materials are defined in bonded and unbonded forms according to the
|
||||
following schema:
|
||||
G4_MATERIAL: Molecule in its free state
|
||||
G4_DNA_MATERIAL: Molecule, considering atoms lost in bonding
|
||||
*/
|
||||
|
||||
void G4NistMaterialBuilder::BioChemicalMaterials()
|
||||
{
|
||||
// BEGIN MATERIALS IN THEIR UNBONDED FORM
|
||||
|
||||
// G4_ADENINE, G4_GUANINE are defined in
|
||||
// G4NistMaterialBuilder::NistCompoundMaterials()
|
||||
|
||||
AddMaterial("G4_CYTOSINE", 1.55, 0, 72., 4);
|
||||
AddElementByAtomCount("H", 5);
|
||||
AddElementByAtomCount("C", 4);
|
||||
@@ -1946,13 +1959,31 @@ void G4NistMaterialBuilder::BioChemicalMaterials()
|
||||
AddElementByAtomCount("N", 2);
|
||||
AddElementByAtomCount("O", 2);
|
||||
|
||||
// DNA_Nucleobase (Nucleobase-1H)
|
||||
AddMaterial("G4_DEOXYRIBOSE", 1, 0, 72, 3);
|
||||
AddElementByAtomCount("H", 10);
|
||||
AddElementByAtomCount("C", 5);
|
||||
AddElementByAtomCount("O", 3);
|
||||
|
||||
// END UNBONDED MATERIALS / BEGIN BONDED MATERIALS
|
||||
|
||||
// Deoxyribose loses 3 OH groups in bonding to bond with PO4 and a base pair
|
||||
AddMaterial("G4_DNA_DEOXYRIBOSE", 1, 0, 72., 3);
|
||||
AddElementByAtomCount("H", 7);
|
||||
AddElementByAtomCount("C", 5);
|
||||
AddElementByAtomCount("O", 1);
|
||||
|
||||
// Typically there are no H atoms considered in the Phosphate group
|
||||
AddMaterial("G4_DNA_PHOSPHATE", 1, 0, 72., 2);
|
||||
AddElementByAtomCount("P", 1);
|
||||
AddElementByAtomCount("O", 4);
|
||||
|
||||
// GATCU bases bonded to a deoxyribose (they drop one H)
|
||||
AddMaterial("G4_DNA_ADENINE", 1, 0, 72., 3);
|
||||
AddElementByAtomCount("H",4 );
|
||||
AddElementByAtomCount("C",5 );
|
||||
AddElementByAtomCount("N",5 );
|
||||
|
||||
AddMaterial("G4_DNA_GUANINE", 1, 0, 72. ,4);
|
||||
AddMaterial("G4_DNA_GUANINE", 1, 0, 72., 4);
|
||||
AddElementByAtomCount("H",4 );
|
||||
AddElementByAtomCount("C",5 );
|
||||
AddElementByAtomCount("N",5 );
|
||||
@@ -1976,75 +2007,8 @@ void G4NistMaterialBuilder::BioChemicalMaterials()
|
||||
AddElementByAtomCount("N", 2);
|
||||
AddElementByAtomCount("O", 2);
|
||||
|
||||
// DNA_Nucleoside (Nucleoside-3H)
|
||||
AddMaterial("G4_DNA_ADENOSINE", 1, 0, 72., 4);
|
||||
AddElementByAtomCount("H", 10);
|
||||
AddElementByAtomCount("C", 10);
|
||||
AddElementByAtomCount("N", 5);
|
||||
AddElementByAtomCount("O", 4);
|
||||
// END BONDED MATERIALS
|
||||
|
||||
AddMaterial("G4_DNA_GUANOSINE", 1, 0, 72. ,4);
|
||||
AddElementByAtomCount("H", 10);
|
||||
AddElementByAtomCount("C", 10);
|
||||
AddElementByAtomCount("N", 5);
|
||||
AddElementByAtomCount("O", 5);
|
||||
|
||||
AddMaterial("G4_DNA_CYTIDINE", 1, 0, 72., 4);
|
||||
AddElementByAtomCount("H", 10);
|
||||
AddElementByAtomCount("C", 9);
|
||||
AddElementByAtomCount("N", 3);
|
||||
AddElementByAtomCount("O", 5);
|
||||
|
||||
AddMaterial("G4_DNA_URIDINE", 1, 0, 72., 4);
|
||||
AddElementByAtomCount("H", 9);
|
||||
AddElementByAtomCount("C", 9);
|
||||
AddElementByAtomCount("N", 2);
|
||||
AddElementByAtomCount("O", 6);
|
||||
|
||||
AddMaterial("G4_DNA_METHYLURIDINE", 1, 0, 72., 4);
|
||||
AddElementByAtomCount("H", 11);
|
||||
AddElementByAtomCount("C", 10);
|
||||
AddElementByAtomCount("N", 2);
|
||||
AddElementByAtomCount("O", 6);
|
||||
|
||||
AddMaterial("G4_DNA_MONOPHOSPHATE", 1, 0, 72., 2);
|
||||
AddElementByAtomCount("P", 1);
|
||||
AddElementByAtomCount("O", 3);
|
||||
|
||||
AddMaterial("G4_DNA_A", 1, 0, 72., 5); //Adenine base
|
||||
AddElementByAtomCount("H", 10);
|
||||
AddElementByAtomCount("C", 10);
|
||||
AddElementByAtomCount("N", 5);
|
||||
AddElementByAtomCount("O", 7);
|
||||
AddElementByAtomCount("P", 1);
|
||||
|
||||
AddMaterial("G4_DNA_G", 1, 0, 72. ,5); //Guanine base
|
||||
AddElementByAtomCount("H", 10);
|
||||
AddElementByAtomCount("C", 10);
|
||||
AddElementByAtomCount("N", 5);
|
||||
AddElementByAtomCount("O", 8);
|
||||
AddElementByAtomCount("P", 1);
|
||||
|
||||
AddMaterial("G4_DNA_C", 1, 0, 72., 5); // Cytosine base
|
||||
AddElementByAtomCount("H", 10);
|
||||
AddElementByAtomCount("C", 9);
|
||||
AddElementByAtomCount("N", 3);
|
||||
AddElementByAtomCount("O", 8);
|
||||
AddElementByAtomCount("P", 1);
|
||||
|
||||
AddMaterial("G4_DNA_U", 1, 0, 72., 5); // Uracil base
|
||||
AddElementByAtomCount("H", 9);
|
||||
AddElementByAtomCount("C", 9);
|
||||
AddElementByAtomCount("N", 2);
|
||||
AddElementByAtomCount("O", 9);
|
||||
AddElementByAtomCount("P", 1);
|
||||
|
||||
AddMaterial("G4_DNA_MU", 1, 0, 72., 5); // MethaUracil base
|
||||
AddElementByAtomCount("H", 11);
|
||||
AddElementByAtomCount("C", 10);
|
||||
AddElementByAtomCount("N", 2);
|
||||
AddElementByAtomCount("O", 9);
|
||||
AddElementByAtomCount("P", 1);
|
||||
/*
|
||||
// Complete 70 kg body of adult men from en.wikipedia.org/ see References there
|
||||
AddMaterial("G4_BODY", 1.8, 0, 78, 12);
|
||||
|
||||
@@ -272,9 +272,9 @@ G4double G4UCNMaterialPropertiesTable::
|
||||
// theta_i in columns
|
||||
|
||||
//G4cout << "E_pos: " << E_pos << " theta_i_pos: " << theta_i_pos << G4endl;
|
||||
//G4cout << "Probability: " << *(theMicroRoughnessTable+E_pos+theta_i_pos*noE) << G4endl;
|
||||
//G4cout << "Probability: " << *(theMicroRoughnessTable+E_pos+theta_i_pos*(noE-1)) << G4endl;
|
||||
|
||||
return *(theMicroRoughnessTable+E_pos+theta_i_pos*noE);
|
||||
return *(theMicroRoughnessTable+E_pos+theta_i_pos*(noE - 1));
|
||||
}
|
||||
|
||||
G4double G4UCNMaterialPropertiesTable::
|
||||
@@ -297,7 +297,7 @@ G4double G4UCNMaterialPropertiesTable::
|
||||
// lookup table is onedimensional (1 row), energy is in rows,
|
||||
// theta_i in columns
|
||||
|
||||
return *(theMicroRoughnessTransTable+E_pos+theta_i_pos*noE);
|
||||
return *(theMicroRoughnessTransTable+E_pos+theta_i_pos*(noE - 1));
|
||||
}
|
||||
|
||||
G4double G4UCNMaterialPropertiesTable::
|
||||
|
||||
@@ -79,7 +79,7 @@ G4UCNMicroRoughnessHelper::S2(G4double costheta2, G4double klk2) const
|
||||
if (costheta2>=klk2)
|
||||
return 4*costheta2/(2*costheta2-klk2+2*std::sqrt(costheta2*(costheta2-klk2)));
|
||||
else
|
||||
return 4*costheta2/klk2;
|
||||
return std::norm(2*std::sqrt(costheta2)/(std::sqrt(costheta2) + std::sqrt(std::complex<G4double>(costheta2 - klk2))));
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -300,7 +300,7 @@ G4double G4UCNMicroRoughnessHelper::IntIminus(G4double E, G4double fermipot,
|
||||
*max = 0.;
|
||||
G4double wkeit=0.;
|
||||
|
||||
if (E*costheta_i_squared < fermipot) return wkeit;
|
||||
if (E < fermipot) return wkeit;
|
||||
|
||||
//k_l^4/4
|
||||
G4double kl4d4=neutron_mass_c2/hbarc_squared*neutron_mass_c2/
|
||||
|
||||
Reference in New Issue
Block a user