Import Geant4 10.7.0.beta source tree
This commit is contained in:
@@ -269,7 +269,7 @@ void G4ScoreQuantityMessenger::SetNewValue(G4UIcommand * command,G4String newVal
|
||||
} else if(command== qCellChgCmd) {
|
||||
if ( CheckMeshPS(mesh,token[0],command) ){
|
||||
G4PSCellCharge* ps = nullptr;
|
||||
if(shape==MeshShape::realWorldLogVol)
|
||||
if(shape==MeshShape::realWorldLogVol || shape==MeshShape::probe)
|
||||
{ ps = new G4PSCellCharge(token[0],mesh->GetCopyNumberLevel()); }
|
||||
else
|
||||
{ ps = new G4PSCellCharge3D(token[0]); }
|
||||
@@ -293,6 +293,8 @@ void G4ScoreQuantityMessenger::SetNewValue(G4UIcommand * command,G4String newVal
|
||||
ed<<"Cell flux for real world volume is not yet supported. Command ignored.";
|
||||
command->CommandFailed(ed);
|
||||
return;
|
||||
} else if(shape==MeshShape::probe) {
|
||||
ps = new G4PSCellFlux(token[0]);
|
||||
}
|
||||
ps->SetUnit(token[1]);
|
||||
mesh->SetPrimitiveScorer(ps);
|
||||
@@ -314,6 +316,8 @@ void G4ScoreQuantityMessenger::SetNewValue(G4UIcommand * command,G4String newVal
|
||||
ed<<"Passing cell flux for real world volume is not yet supported. Command ignored.";
|
||||
command->CommandFailed(ed);
|
||||
return;
|
||||
} else if(shape==MeshShape::probe) {
|
||||
ps = new G4PSPassageCellFlux(token[0]);
|
||||
}
|
||||
ps->SetUnit(token[1]);
|
||||
mesh->SetPrimitiveScorer(ps);
|
||||
@@ -321,7 +325,7 @@ void G4ScoreQuantityMessenger::SetNewValue(G4UIcommand * command,G4String newVal
|
||||
} else if(command==qeDepCmd) {
|
||||
if ( CheckMeshPS(mesh,token[0],command) ){
|
||||
G4PSEnergyDeposit* ps = nullptr;
|
||||
if(shape==MeshShape::realWorldLogVol)
|
||||
if(shape==MeshShape::realWorldLogVol || shape==MeshShape::probe)
|
||||
{ ps =new G4PSEnergyDeposit(token[0],mesh->GetCopyNumberLevel()); }
|
||||
else
|
||||
{ ps =new G4PSEnergyDeposit3D(token[0]); }
|
||||
@@ -342,7 +346,7 @@ void G4ScoreQuantityMessenger::SetNewValue(G4UIcommand * command,G4String newVal
|
||||
mesh->GetNumberOfSegments(nSeg);
|
||||
pps->SetNumberOfSegments(nSeg);
|
||||
ps = pps;
|
||||
} else if(shape==MeshShape::realWorldLogVol) {
|
||||
} else if(shape==MeshShape::realWorldLogVol || shape==MeshShape::probe) {
|
||||
ps = new G4PSDoseDeposit(token[0],mesh->GetCopyNumberLevel());
|
||||
}
|
||||
ps->SetUnit(token[1]);
|
||||
@@ -351,7 +355,7 @@ void G4ScoreQuantityMessenger::SetNewValue(G4UIcommand * command,G4String newVal
|
||||
} else if(command== qnOfStepCmd) {
|
||||
if ( CheckMeshPS(mesh,token[0],command) ){
|
||||
G4PSNofStep* ps = nullptr;
|
||||
if(shape==MeshShape::realWorldLogVol)
|
||||
if(shape==MeshShape::realWorldLogVol || shape==MeshShape::probe)
|
||||
{ ps = new G4PSNofStep(token[0],mesh->GetCopyNumberLevel()); }
|
||||
else
|
||||
{ ps = new G4PSNofStep3D(token[0]); }
|
||||
@@ -361,7 +365,7 @@ void G4ScoreQuantityMessenger::SetNewValue(G4UIcommand * command,G4String newVal
|
||||
} else if(command== qnOfSecondaryCmd) {
|
||||
if ( CheckMeshPS(mesh,token[0],command) ){
|
||||
G4PSNofSecondary* ps = nullptr;
|
||||
if(shape==MeshShape::realWorldLogVol)
|
||||
if(shape==MeshShape::realWorldLogVol || shape==MeshShape::probe)
|
||||
{ ps = new G4PSNofSecondary(token[0],mesh->GetCopyNumberLevel()); }
|
||||
else
|
||||
{ ps = new G4PSNofSecondary3D(token[0]); }
|
||||
@@ -370,7 +374,7 @@ void G4ScoreQuantityMessenger::SetNewValue(G4UIcommand * command,G4String newVal
|
||||
} else if(command== qTrackLengthCmd) {
|
||||
if ( CheckMeshPS(mesh,token[0],command) ){
|
||||
G4PSTrackLength* ps = nullptr;
|
||||
if(shape==MeshShape::realWorldLogVol)
|
||||
if(shape==MeshShape::realWorldLogVol || shape==MeshShape::probe)
|
||||
{ ps = new G4PSTrackLength(token[0],mesh->GetCopyNumberLevel()); }
|
||||
else
|
||||
{ ps = new G4PSTrackLength3D(token[0]); }
|
||||
@@ -383,7 +387,7 @@ void G4ScoreQuantityMessenger::SetNewValue(G4UIcommand * command,G4String newVal
|
||||
} else if(command== qPassCellCurrCmd){
|
||||
if( CheckMeshPS(mesh,token[0],command) ) {
|
||||
G4PSPassageCellCurrent* ps = nullptr;
|
||||
if(shape==MeshShape::realWorldLogVol)
|
||||
if(shape==MeshShape::realWorldLogVol || shape==MeshShape::probe)
|
||||
{ ps = new G4PSPassageCellCurrent(token[0],mesh->GetCopyNumberLevel()); }
|
||||
else
|
||||
{ ps = new G4PSPassageCellCurrent3D(token[0]); }
|
||||
@@ -393,7 +397,7 @@ void G4ScoreQuantityMessenger::SetNewValue(G4UIcommand * command,G4String newVal
|
||||
} else if(command== qPassTrackLengthCmd){
|
||||
if( CheckMeshPS(mesh,token[0],command) ) {
|
||||
G4PSPassageTrackLength* ps = nullptr;
|
||||
if(shape==MeshShape::realWorldLogVol)
|
||||
if(shape==MeshShape::realWorldLogVol || shape==MeshShape::probe)
|
||||
{ ps = new G4PSPassageTrackLength(token[0],mesh->GetCopyNumberLevel()); }
|
||||
else
|
||||
{ ps = new G4PSPassageTrackLength3D(token[0]); }
|
||||
@@ -404,7 +408,7 @@ void G4ScoreQuantityMessenger::SetNewValue(G4UIcommand * command,G4String newVal
|
||||
} else if(command== qFlatSurfCurrCmd){
|
||||
if( CheckMeshPS(mesh,token[0],command)) {
|
||||
G4PSFlatSurfaceCurrent* ps = nullptr;
|
||||
if(shape==MeshShape::realWorldLogVol)
|
||||
if(shape==MeshShape::realWorldLogVol || shape==MeshShape::probe)
|
||||
{ ps = new G4PSFlatSurfaceCurrent(token[0],StoI(token[1]),mesh->GetCopyNumberLevel()); }
|
||||
else
|
||||
{ ps = new G4PSFlatSurfaceCurrent3D(token[0],StoI(token[1])); }
|
||||
@@ -420,7 +424,7 @@ void G4ScoreQuantityMessenger::SetNewValue(G4UIcommand * command,G4String newVal
|
||||
} else if(command== qFlatSurfFluxCmd){
|
||||
if( CheckMeshPS(mesh, token[0],command )) {
|
||||
G4PSFlatSurfaceFlux* ps = nullptr;
|
||||
if(shape==MeshShape::realWorldLogVol)
|
||||
if(shape==MeshShape::realWorldLogVol || shape==MeshShape::probe)
|
||||
{ ps = new G4PSFlatSurfaceFlux(token[0],StoI(token[1]),mesh->GetCopyNumberLevel()); }
|
||||
else
|
||||
{ ps = new G4PSFlatSurfaceFlux3D(token[0],StoI(token[1])); }
|
||||
@@ -487,7 +491,7 @@ void G4ScoreQuantityMessenger::SetNewValue(G4UIcommand * command,G4String newVal
|
||||
} else if(command== qNofCollisionCmd){
|
||||
if( CheckMeshPS(mesh,token[0],command)) {
|
||||
G4PSNofCollision* ps = nullptr;
|
||||
if(shape==MeshShape::realWorldLogVol)
|
||||
if(shape==MeshShape::realWorldLogVol || shape==MeshShape::probe)
|
||||
{ ps = new G4PSNofCollision3D(token[0],mesh->GetCopyNumberLevel()); }
|
||||
else
|
||||
{ ps = new G4PSNofCollision3D(token[0]); }
|
||||
@@ -497,7 +501,7 @@ void G4ScoreQuantityMessenger::SetNewValue(G4UIcommand * command,G4String newVal
|
||||
} else if(command== qPopulationCmd){
|
||||
if( CheckMeshPS(mesh,token[0],command) ) {
|
||||
G4PSPopulation* ps = nullptr;
|
||||
if(shape==MeshShape::realWorldLogVol)
|
||||
if(shape==MeshShape::realWorldLogVol || shape==MeshShape::probe)
|
||||
{ ps = new G4PSPopulation(token[0],mesh->GetCopyNumberLevel()); }
|
||||
else
|
||||
{ ps = new G4PSPopulation3D(token[0]); }
|
||||
@@ -507,7 +511,7 @@ void G4ScoreQuantityMessenger::SetNewValue(G4UIcommand * command,G4String newVal
|
||||
} else if(command== qTrackCountCmd){
|
||||
if( CheckMeshPS(mesh,token[0],command)) {
|
||||
G4PSTrackCounter* ps = nullptr;
|
||||
if(shape==MeshShape::realWorldLogVol)
|
||||
if(shape==MeshShape::realWorldLogVol || shape==MeshShape::probe)
|
||||
{ ps = new G4PSTrackCounter(token[0],StoI(token[1]),mesh->GetCopyNumberLevel()); }
|
||||
else
|
||||
{ ps = new G4PSTrackCounter3D(token[0],StoI(token[1])); }
|
||||
@@ -517,7 +521,7 @@ void G4ScoreQuantityMessenger::SetNewValue(G4UIcommand * command,G4String newVal
|
||||
} else if(command== qTerminationCmd){
|
||||
if( CheckMeshPS(mesh,token[0],command)) {
|
||||
G4PSTermination* ps = nullptr;
|
||||
if(shape==MeshShape::realWorldLogVol)
|
||||
if(shape==MeshShape::realWorldLogVol || shape==MeshShape::probe)
|
||||
{ ps = new G4PSTermination(token[0],mesh->GetCopyNumberLevel()); }
|
||||
else
|
||||
{ ps = new G4PSTermination3D(token[0]); }
|
||||
@@ -528,7 +532,7 @@ void G4ScoreQuantityMessenger::SetNewValue(G4UIcommand * command,G4String newVal
|
||||
} else if(command== qMinKinEAtGeneCmd){
|
||||
if( CheckMeshPS(mesh,token[0],command) ){
|
||||
G4PSMinKinEAtGeneration* ps = nullptr;
|
||||
if(shape==MeshShape::realWorldLogVol)
|
||||
if(shape==MeshShape::realWorldLogVol || shape==MeshShape::probe)
|
||||
{ ps = new G4PSMinKinEAtGeneration(token[0],mesh->GetCopyNumberLevel()); }
|
||||
else
|
||||
{ ps = new G4PSMinKinEAtGeneration3D(token[0]); }
|
||||
@@ -538,7 +542,7 @@ void G4ScoreQuantityMessenger::SetNewValue(G4UIcommand * command,G4String newVal
|
||||
} else if(command== qStepCheckerCmd){
|
||||
if( CheckMeshPS(mesh,token[0],command) ){
|
||||
G4PSStepChecker* ps = nullptr;
|
||||
if(shape==MeshShape::realWorldLogVol)
|
||||
if(shape==MeshShape::realWorldLogVol || shape==MeshShape::probe)
|
||||
{ ps = new G4PSStepChecker(token[0],mesh->GetCopyNumberLevel()); }
|
||||
else
|
||||
{ ps = new G4PSStepChecker3D(token[0]); }
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#include "G4ScoringBox.hh"
|
||||
#include "G4ScoringCylinder.hh"
|
||||
#include "G4ScoringRealWorld.hh"
|
||||
#include "G4ScoringProbe.hh"
|
||||
|
||||
#include "G4UIdirectory.hh"
|
||||
#include "G4UIcmdWithoutParameter.hh"
|
||||
@@ -66,9 +67,6 @@ G4ScoringMessenger::G4ScoringMessenger(G4ScoringManager* SManager)
|
||||
verboseCmd->SetGuidance(" 0) errors or warnings,");
|
||||
verboseCmd->SetGuidance(" 1) information with 0)");
|
||||
|
||||
meshDir = new G4UIdirectory("/score/mesh/");
|
||||
meshDir->SetGuidance(" Mesh processing commands.");
|
||||
|
||||
meshCreateDir = new G4UIdirectory("/score/create/");
|
||||
meshCreateDir->SetGuidance(" Mesh creation commands.");
|
||||
//
|
||||
@@ -98,6 +96,20 @@ G4ScoringMessenger::G4ScoringMessenger(G4ScoringManager* SManager)
|
||||
param->SetDefaultValue(0);
|
||||
meshRWLogVolCreateCmd->SetParameter(param);
|
||||
//
|
||||
probeCreateCmd = new G4UIcommand("/score/create/probe",this);
|
||||
probeCreateCmd->SetGuidance("Define scoring probe.");
|
||||
probeCreateCmd->SetGuidance(" halfSize defines the half-width of the probing cube.");
|
||||
param = new G4UIparameter("pname",'s',false);
|
||||
probeCreateCmd->SetParameter(param);
|
||||
param = new G4UIparameter("halfSize",'d',false);
|
||||
probeCreateCmd->SetParameter(param);
|
||||
param = new G4UIparameter("unit",'s',true);
|
||||
param->SetDefaultUnit("mm");
|
||||
probeCreateCmd->SetParameter(param);
|
||||
param = new G4UIparameter("checkOverlap",'b',true);
|
||||
param->SetDefaultValue(false);
|
||||
probeCreateCmd->SetParameter(param);
|
||||
//
|
||||
meshOpnCmd = new G4UIcmdWithAString("/score/open",this);
|
||||
meshOpnCmd->SetGuidance("Open scoring mesh.");
|
||||
meshOpnCmd->SetParameterName("MeshName",false);
|
||||
@@ -108,6 +120,9 @@ G4ScoringMessenger::G4ScoringMessenger(G4ScoringManager* SManager)
|
||||
// meshActCmd = new G4UIcmdWithABool("/score/mesh/activate",this);
|
||||
// meshActCmd->SetGuidance("Activate scoring mesh.");
|
||||
// meshActCmd->SetParameterName("MeshName",false);
|
||||
//
|
||||
meshDir = new G4UIdirectory("/score/mesh/");
|
||||
meshDir->SetGuidance(" Mesh processing commands.");
|
||||
//
|
||||
mBoxSizeCmd = new G4UIcmdWith3VectorAndUnit("/score/mesh/boxSize",this);
|
||||
mBoxSizeCmd->SetGuidance("Define size of the scoring mesh.");
|
||||
@@ -192,6 +207,23 @@ G4ScoringMessenger::G4ScoringMessenger(G4ScoringManager* SManager)
|
||||
mRotZCmd->SetParameterName("Rz",false);
|
||||
mRotZCmd->SetDefaultUnit("deg");
|
||||
//
|
||||
probeDir = new G4UIdirectory("/score/probe/");
|
||||
probeDir->SetGuidance("Probe commands");
|
||||
|
||||
probeMatCmd = new G4UIcmdWithAString("/score/probe/material",this);
|
||||
probeMatCmd->SetGuidance("Specify a material to the probe cube.");
|
||||
probeMatCmd->SetGuidance("Material name has to be taken from G4NistManager.");
|
||||
probeMatCmd->SetGuidance("Once this command is used, the specified material overlays the material in the mass geometry");
|
||||
probeMatCmd->SetGuidance("with \"Layered Mass Geometry\" mechanism so that physics quantities such as energy deposition");
|
||||
probeMatCmd->SetGuidance("or dose will be calculated with this material.");
|
||||
probeMatCmd->SetGuidance("To switch-off this overlaying, use \"none\".");
|
||||
probeMatCmd->SetParameterName("matName",true);
|
||||
probeMatCmd->SetDefaultValue("none");
|
||||
|
||||
probeLocateCmd = new G4UIcmdWith3VectorAndUnit("/score/probe/locate",this);
|
||||
probeLocateCmd->SetGuidance("Locate a probe in the global coordinate system.");
|
||||
probeLocateCmd->SetParameterName("x","y","z",false);
|
||||
probeLocateCmd->SetDefaultUnit("mm");
|
||||
|
||||
// Draw Scoring result
|
||||
drawCmd = new G4UIcommand("/score/drawProjection",this);
|
||||
@@ -335,10 +367,11 @@ G4ScoringMessenger::~G4ScoringMessenger()
|
||||
delete listCmd;
|
||||
delete verboseCmd;
|
||||
//
|
||||
delete meshCreateDir;
|
||||
delete meshBoxCreateCmd;
|
||||
delete meshCylinderCreateCmd;
|
||||
delete meshRWLogVolCreateCmd;
|
||||
delete probeCreateCmd;
|
||||
delete meshCreateDir;
|
||||
// delete meshSphereCreateCmd;
|
||||
//
|
||||
delete meshOpnCmd;
|
||||
@@ -362,6 +395,10 @@ G4ScoringMessenger::~G4ScoringMessenger()
|
||||
delete mRotZCmd;
|
||||
delete mRotDir;
|
||||
//
|
||||
delete probeLocateCmd;
|
||||
delete probeMatCmd;
|
||||
delete probeDir;
|
||||
//
|
||||
//delete chartCmd;
|
||||
delete dumpCmd;
|
||||
delete drawCmd;
|
||||
@@ -370,10 +407,10 @@ G4ScoringMessenger::~G4ScoringMessenger()
|
||||
delete floatMinMaxCmd;
|
||||
delete colorMapMinMaxCmd;
|
||||
delete colorMapDir;
|
||||
delete dumpQtyToFileCmd;
|
||||
delete dumpQtyWithFactorCmd;
|
||||
delete dumpQtyWithFactorCmd;
|
||||
delete dumpAllQtsToFileCmd;
|
||||
delete dumpAllQtsWithFactorCmd;
|
||||
delete dumpAllQtsWithFactorCmd;
|
||||
//
|
||||
delete scoreDir;
|
||||
}
|
||||
@@ -545,7 +582,70 @@ void G4ScoringMessenger::SetNewValue(G4UIcommand * command,G4String newVal)
|
||||
command->CommandFailed(ed);
|
||||
}
|
||||
}
|
||||
} else if(command==probeCreateCmd) {
|
||||
auto mesh = fSMan->GetCurrentMesh();
|
||||
if ( mesh ){
|
||||
G4ExceptionDescription ed;
|
||||
ed << "ERROR[" << meshRWLogVolCreateCmd->GetCommandPath()
|
||||
<< "] : Mesh <" << mesh->GetWorldName()
|
||||
<< "> is still open. Close it first. Command ignored.";
|
||||
command->CommandFailed(ed);
|
||||
}
|
||||
else
|
||||
{
|
||||
G4Tokenizer next(newVal);
|
||||
G4String qname = next();
|
||||
G4double halfSize = StoD(next());
|
||||
halfSize *= G4UIcommand::ValueOf(next());
|
||||
G4bool checkOverlap = StoB(next());
|
||||
mesh = fSMan->FindMesh(qname);
|
||||
if(!mesh)
|
||||
{
|
||||
mesh = new G4ScoringProbe(qname,halfSize,checkOverlap);
|
||||
fSMan->RegisterScoringMesh(mesh);
|
||||
}
|
||||
else
|
||||
{
|
||||
G4ExceptionDescription ed;
|
||||
ed << "ERROR[" << probeCreateCmd->GetCommandPath()
|
||||
<< "] : Mesh name <" << qname << "> already exists. Use another name.";
|
||||
command->CommandFailed(ed);
|
||||
}
|
||||
}
|
||||
} else if(command==probeMatCmd || command==probeLocateCmd) {
|
||||
auto mesh = fSMan->GetCurrentMesh();
|
||||
if(!mesh)
|
||||
{
|
||||
G4ExceptionDescription ed;
|
||||
ed << "ERROR : No mesh is currently open. Open/create a mesh first. Command ignored.";
|
||||
command->CommandFailed(ed);
|
||||
return;
|
||||
}
|
||||
if(mesh->GetShape() != MeshShape::probe)
|
||||
{
|
||||
G4ExceptionDescription ed;
|
||||
ed << "ERROR : Inconsistent mesh type. Close current mesh and open Scoring Probe.";
|
||||
command->CommandFailed(ed);
|
||||
return;
|
||||
}
|
||||
|
||||
if(command==probeMatCmd)
|
||||
{
|
||||
G4bool succ = static_cast<G4ScoringProbe*>(mesh)->SetMaterial(newVal);
|
||||
if(!succ)
|
||||
{
|
||||
G4ExceptionDescription ed;
|
||||
ed << "Material <" << newVal << "> is not defind in G4NistManager. Command is ignored.\n"
|
||||
<< "Use /material/nist/listMaterials command to see the available materials.";
|
||||
command->CommandFailed(ed);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if(command==probeLocateCmd)
|
||||
{
|
||||
G4ThreeVector loc = probeLocateCmd->GetNew3VectorValue(newVal);
|
||||
static_cast<G4ScoringProbe*>(mesh)->LocateProbe(loc);
|
||||
}
|
||||
} else if(command==listColorMapCmd) {
|
||||
fSMan->ListScoreColorMaps();
|
||||
} else if(command==floatMinMaxCmd) {
|
||||
|
||||
@@ -0,0 +1,140 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
#include "G4ScoringProbe.hh"
|
||||
|
||||
#include "G4Box.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4LogicalVolumeStore.hh"
|
||||
#include "G4VPhysicalVolume.hh"
|
||||
#include "G4PVPlacement.hh"
|
||||
#include "G4Region.hh"
|
||||
#include "G4RegionStore.hh"
|
||||
#include "G4Threading.hh"
|
||||
#include "G4Material.hh"
|
||||
#include "G4NistManager.hh"
|
||||
|
||||
#include "G4MultiFunctionalDetector.hh"
|
||||
#include "G4SDParticleFilter.hh"
|
||||
#include "G4VPrimitiveScorer.hh"
|
||||
|
||||
#include "G4ScoringManager.hh"
|
||||
#include "G4StatDouble.hh"
|
||||
|
||||
#include "G4SystemOfUnits.hh"
|
||||
#include "G4VisAttributes.hh"
|
||||
|
||||
G4ScoringProbe::G4ScoringProbe(G4String lvName, G4double half_size, G4bool checkOverlap)
|
||||
:G4VScoringMesh(lvName), chkOverlap(checkOverlap),
|
||||
layeredMaterialName("none"), layeredMaterial(nullptr)
|
||||
{
|
||||
fShape = MeshShape::probe;
|
||||
logVolName = lvName;
|
||||
probeSize = half_size;
|
||||
G4double hs[] = {half_size,half_size,half_size};
|
||||
SetSize(hs);
|
||||
G4int nBin[] = {1,1,1};
|
||||
SetNumberOfSegments(nBin);
|
||||
regName = lvName + "_region";
|
||||
if(G4Threading::IsMasterThread())
|
||||
{ new G4Region(regName); }
|
||||
}
|
||||
|
||||
G4ScoringProbe::~G4ScoringProbe()
|
||||
{
|
||||
}
|
||||
|
||||
void G4ScoringProbe::List() const
|
||||
{
|
||||
G4cout << "G4ScoringProbe : " << logVolName << G4endl;
|
||||
G4int np = posVec.size();
|
||||
for(G4int i=0;i<np;i++)
|
||||
{ G4cout << " >> probe #" << i << " at " << posVec[i] << G4endl; }
|
||||
G4VScoringMesh::List();
|
||||
}
|
||||
|
||||
#include "G4AutoLock.hh"
|
||||
namespace { G4Mutex logvolmutex = G4MUTEX_INITIALIZER; }
|
||||
|
||||
void G4ScoringProbe::SetupGeometry(G4VPhysicalVolume* worldPhys)
|
||||
{
|
||||
if(G4Threading::IsMasterThread())
|
||||
{
|
||||
auto worldLog = worldPhys->GetLogicalVolume();
|
||||
auto region = G4RegionStore::GetInstance()->GetRegion(regName);
|
||||
assert(region!=nullptr);
|
||||
region->AddRootLogicalVolume(worldLog);
|
||||
region->SetWorld(worldPhys);
|
||||
|
||||
auto boxSolid = new G4Box(logVolName+"_solid",probeSize,probeSize,probeSize);
|
||||
fMeshElementLogical = new G4LogicalVolume(boxSolid,layeredMaterial,logVolName+"_log");
|
||||
|
||||
G4int np = posVec.size();
|
||||
for(G4int i=0;i<np;i++)
|
||||
{ new G4PVPlacement(0,posVec[i],fMeshElementLogical,logVolName+"_phy",worldLog,false,i,chkOverlap); }
|
||||
|
||||
G4VisAttributes* wisatt = new G4VisAttributes(G4Colour(.5,.5,.5));
|
||||
wisatt->SetVisibility(false);
|
||||
worldLog->SetVisAttributes(wisatt);
|
||||
G4VisAttributes* visatt = new G4VisAttributes(G4Colour(.5,.5,.5));
|
||||
visatt->SetVisibility(true);
|
||||
fMeshElementLogical->SetVisAttributes(visatt);
|
||||
}
|
||||
else
|
||||
{
|
||||
G4AutoLock l(&logvolmutex);
|
||||
fMeshElementLogical = G4LogicalVolumeStore::GetInstance()->GetVolume(logVolName,false);
|
||||
assert(fMeshElementLogical!=nullptr);
|
||||
l.unlock();
|
||||
}
|
||||
|
||||
fMeshElementLogical->SetSensitiveDetector(fMFD);
|
||||
|
||||
}
|
||||
|
||||
G4bool G4ScoringProbe::SetMaterial(G4String val)
|
||||
{
|
||||
if(val == "none")
|
||||
{
|
||||
layeredMaterialName = val;
|
||||
layeredMassFlg = false;
|
||||
layeredMaterial = nullptr;
|
||||
}
|
||||
else
|
||||
{
|
||||
auto mat = G4NistManager::Instance()->FindOrBuildMaterial(val);
|
||||
if(!mat)
|
||||
{ return false; }
|
||||
layeredMaterialName = val;
|
||||
layeredMassFlg = true;
|
||||
layeredMaterial = mat;
|
||||
}
|
||||
auto region = G4RegionStore::GetInstance()->GetRegion(regName);
|
||||
assert(region!=nullptr);
|
||||
region->UpdateMaterialList();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -61,8 +61,11 @@ void G4ScoringRealWorld::List() const
|
||||
G4VScoringMesh::List();
|
||||
}
|
||||
|
||||
#include "G4AutoLock.hh"
|
||||
namespace { G4Mutex logvolmutex = G4MUTEX_INITIALIZER; }
|
||||
void G4ScoringRealWorld::SetupGeometry(G4VPhysicalVolume* )
|
||||
{
|
||||
G4AutoLock l(&logvolmutex);
|
||||
auto store = G4LogicalVolumeStore::GetInstance();
|
||||
auto itr = store->begin();
|
||||
for(;itr!=store->end();itr++)
|
||||
|
||||
@@ -49,7 +49,7 @@ G4VScoringMesh::G4VScoringMesh(const G4String& wName)
|
||||
verboseLevel(0),sizeIsSet(false),nMeshIsSet(false),
|
||||
fDrawUnit(""), fDrawUnitValue(1.), fMeshElementLogical(nullptr),
|
||||
fParallelWorldProcess(nullptr), fGeometryHasBeenDestroyed(false),
|
||||
copyNumberLevel(0)
|
||||
copyNumberLevel(0), layeredMassFlg(false)
|
||||
{
|
||||
G4SDManager::GetSDMpointer()->AddNewDetector(fMFD);
|
||||
|
||||
@@ -76,7 +76,7 @@ void G4VScoringMesh::SetSize(G4double size[3]) {
|
||||
for(int i = 0; i < 3; i++) fSize[i] = size[i];
|
||||
sizeIsSet = true;
|
||||
}else{
|
||||
G4String message = " The size of scoring mesh can not be changed.";
|
||||
G4String message = " The size of scoring mesh is updated.";
|
||||
G4Exception("G4VScoringMesh::SetSize()",
|
||||
"DigiHitsUtilsScoreVScoringMesh000", JustWarning,
|
||||
message);
|
||||
@@ -92,7 +92,7 @@ void G4VScoringMesh::SetCenterPosition(G4double centerPosition[3]) {
|
||||
fCenterPosition = G4ThreeVector(centerPosition[0], centerPosition[1], centerPosition[2]);
|
||||
}
|
||||
void G4VScoringMesh::SetNumberOfSegments(G4int nSegment[3]) {
|
||||
if ( !nMeshIsSet || fShape==MeshShape::realWorldLogVol ){
|
||||
if ( !nMeshIsSet || fShape==MeshShape::realWorldLogVol || fShape==MeshShape::probe ){
|
||||
for(int i = 0; i < 3; i++) fNSegment[i] = nSegment[i];
|
||||
nMeshIsSet = true;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user