Import Geant4 9.6.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 17:01:34 +02:00
parent b1eb5424d2
commit e2d2f9810a
10384 changed files with 698580 additions and 628834 deletions
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4DefaultLinearColorMap.cc,v 1.3 2008-08-29 02:50:05 akimura Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
#include "G4DefaultLinearColorMap.hh"
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4ScoreLogColorMap.cc,v 1.11 2010-11-14 14:18:36 akimura Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
#include "G4ScoreLogColorMap.hh"
@@ -24,14 +24,15 @@
// ********************************************************************
//
//
// $Id: G4ScoreQuantityMessenger.cc,v 1.10 2010-11-03 08:28:42 taso Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
// ---------------------------------------------------------------------
// Modifications
// 08-Oct-2010 T.Aso remove unit of G4PSPassageCellCurrent.
// 24-Mar-2011 T.Aso Add StepChecker for debugging.
// 24-Mar-2011 T.Aso Size and segmentation for replicated cylinder.
// 01-Jun-2012 T.Aso Support weighted/dividedByArea options
// in flatCurrent and flatFulx commands.
// ---------------------------------------------------------------------
#include "G4ScoreQuantityMessenger.hh"
@@ -334,13 +335,23 @@ void G4ScoreQuantityMessenger::SetNewValue(G4UIcommand * command,G4String newVal
new G4PSFlatSurfaceCurrent3D(token[0],StoI(token[1]));
ps->Weighted(StoB(token[2]));
ps->DivideByArea(StoB(token[3]));
ps->SetUnit(token[4]);
if ( StoB(token[3]) ){
ps->SetUnit(token[4]);
}else{
ps->SetUnit("");
}
mesh->SetPrimitiveScorer(ps);
}
} else if(command== qFlatSurfFluxCmd){
if( CheckMeshPS(mesh, token[0] )) {
G4PSFlatSurfaceFlux3D* ps = new G4PSFlatSurfaceFlux3D(token[0],StoI(token[1]));
ps->SetUnit(token[2]);
ps->Weighted(StoB(token[2]));
ps->DivideByArea(StoB(token[3]));
if ( StoB(token[3]) ){
ps->SetUnit(token[4]);
}else{
ps->SetUnit("");
}
mesh->SetPrimitiveScorer(ps);
}
// } else if(command== qSphereSurfCurrCmd){
@@ -349,13 +360,23 @@ void G4ScoreQuantityMessenger::SetNewValue(G4UIcommand * command,G4String newVal
// new G4PSSphereSurfaceCurrent3D(token[0],StoI(token[1]));
// ps->Weighted(StoB(token[2]));
// ps->DivideByArea(StoB(token[3]));
// ps->SetUnit(token[4]);
// if ( StoB(token[3]) ){
// ps->SetUnit(token[4]);
// }else{
// ps->SetUnit("");
// }
// mesh->SetPrimitiveScorer(ps);
// }
// } else if(command== qSphereSurfFluxCmd){
// if( CheckMeshPS(mesh,token[0])) {
// G4PSSphereSurfaceFlux3D* ps = new G4PSSphereSurfaceFlux3D(token[0], StoI(token[1]));
// ps->SetUnit(token[2]);
// ps->Weighted(StoB(token[2]));
// ps->DivideByArea(StoB(token[3]));
// if ( StoB(token[3]) ){
// ps->SetUnit(token[4]);
// }else{
// ps->SetUnit("");
// }
// mesh->SetPrimitiveScorer(ps);
// }
// } else if(command== qCylSurfCurrCmd){
@@ -364,13 +385,24 @@ void G4ScoreQuantityMessenger::SetNewValue(G4UIcommand * command,G4String newVal
// new G4PSCylinderSurfaceCurrent3D(token[0],StoI(token[1]));
// ps->Weighted(StoB(token[2]));
// ps->DivideByArea(StoB(token[3]));
// if ( StoB(token[3]) ){
// ps->SetUnit(token[4]);
// }else{
// ps->SetUnit("");
// }
// ps->SetUnit(token[4]);
// mesh->SetPrimitiveScorer(ps);
// }
// } else if(command== qCylSurfFluxCmd){
// if( CheckMeshPS(mesh, token[0] ) {
// G4PSCylinerSurfaceFlux3D* ps =new G4PSCylinderSurfaceFlux3D(token[0], StoI(token[1]));
// ps->SetUnit(token[2]);
// ps->Weighted(StoB(token[2]));
// ps->DivideByArea(StoB(token[3]));
// if ( StoB(token[3]) ){
// ps->SetUnit(token[4]);
// }else{
// ps->SetUnit("");
// }
// mesh->SetPrimitiveScorer(ps);
// }
} else if(command== qNofCollisionCmd){
@@ -24,12 +24,13 @@
// ********************************************************************
//
//
// $Id: G4ScoreQuantityMessengerQCmd.cc,v 1.8 2010-11-03 08:29:02 taso Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
// ---------------------------------------------------------------------
// Modifications
// 08-Oct-2010 T.Aso remove unit of G4PSPassageCellCurrent.
// 01-Jun-2012 T.Aso Support weighted/dividedByArea options
// in flatCurrent and flatFulx commands.
// ---------------------------------------------------------------------
#include "G4ScoreQuantityMessenger.hh"
@@ -265,12 +266,20 @@ void G4ScoreQuantityMessenger::QuantityCommands()
qFlatSurfFluxCmd->SetGuidance(" : 0 = Both In and Out");
qFlatSurfFluxCmd->SetGuidance(" : 1 = In only");
qFlatSurfFluxCmd->SetGuidance(" : 2 = Out only");
qFlatSurfFluxCmd->SetGuidance(" wflag :(Bool) weighted");
qFlatSurfFluxCmd->SetGuidance(" aflag :(Bool) divide by area");
qFlatSurfFluxCmd->SetGuidance(" unit :(String) unit");
param = new G4UIparameter("qname",'s',false);
qFlatSurfFluxCmd->SetParameter(param);
param = new G4UIparameter("dflag",'i',true);
param->SetDefaultValue("0");
qFlatSurfFluxCmd->SetParameter(param);
param = new G4UIparameter("wflag",'b',true);
param->SetDefaultValue("true");
qFlatSurfFluxCmd->SetParameter(param);
param = new G4UIparameter("aflag",'b',true);
param->SetDefaultValue("true");
qFlatSurfFluxCmd->SetParameter(param);
param = new G4UIparameter("unit",'s',true);
param->SetDefaultValue("percm2");
qFlatSurfFluxCmd->SetParameter(param);
@@ -312,12 +321,20 @@ void G4ScoreQuantityMessenger::QuantityCommands()
// qSphereSurfFluxCmd->SetGuidance(" : 0 = Both In and Out");
// qSphereSurfFluxCmd->SetGuidance(" : 1 = In only");
// qSphereSurfFluxCmd->SetGuidance(" : 2 = Out only");
// qSphereSurfFluxCmd->SetGuidance(" wflag :(Bool) weighted");
// qSphereSurfFluxCmd->SetGuidance(" aflag :(Bool) divide by area");
// qSphereSurfFluxCmd->SetGuidance(" unit :(String) unit");
// param = new G4UIparameter("qname",'s',false);
// qSphereSurfFluxCmd->SetParameter(param);
// param = new G4UIparameter("dflag",'i',true);
// param->SetDefaultValue("0");
// qSphereSurfFluxCmd->SetParameter(param);
// param = new G4UIparameter("wflag",'b',true);
// param->SetDefaultValue("true");
// qSphereSurfFluxCmd->SetParameter(param);
// param = new G4UIparameter("aflag",'b',true);
// param->SetDefaultValue("true");
// qSphereSurfFluxCmd->SetParameter(param);
// param = new G4UIparameter("unit",'s',true);
// param->SetDefaultValue("percm2");
// qSphereSurfFluxCmd->SetParameter(param);
@@ -349,7 +366,7 @@ void G4ScoreQuantityMessenger::QuantityCommands()
// param = new G4UIparameter("unit",'s',true);
// param->SetDefaultValue("percm2");
// qCylSurfCurrCmd->SetParameter(param);
//
//
// qCylSurfFluxCmd = new G4UIcommand("/score/quantity/cylinderSurfaceFlux",this);
// qCylSurfFluxCmd->SetGuidance("Cylinder surface Flux Scorer.");
// qCylSurfFluxCmd->
@@ -359,12 +376,20 @@ void G4ScoreQuantityMessenger::QuantityCommands()
// qCylSurfFluxCmd->SetGuidance(" : 0 = Both In and Out");
// qCylSurfFluxCmd->SetGuidance(" : 1 = In only");
// qCylSurfFluxCmd->SetGuidance(" : 2 = Out only");
// qCylSurfFluxCmd->SetGuidance(" wflag :(Bool) weighted");
// qCylSurfFluxCmd->SetGuidance(" aflag :(Bool) divide by area");
// qCylSurfFluxCmd->SetGuidance(" unit :(String) unit");
// param = new G4UIparameter("qname",'s',false);
// qCylSurfFluxCmd->SetParameter(param);
// param = new G4UIparameter("dflag",'i',true);
// param->SetDefaultValue("0");
// qCylSurfFluxCmd->SetParameter(param);
// param = new G4UIparameter("wflag",'b',true);
// param->SetDefaultValue("true");
// qCylSurfFluxCmd->SetParameter(param);
// param = new G4UIparameter("aflag",'b',true);
// param->SetDefaultValue("true");
// qCylSurfFluxCmd->SetParameter(param);
// param = new G4UIparameter("unit",'s',true);
// param->SetDefaultValue("percm2");
// qCylSurfFluxCmd->SetParameter(param);
+2 -2
View File
@@ -24,12 +24,12 @@
// ********************************************************************
//
//
// $Id: G4ScoringBox.cc,v 1.61 2010-07-27 01:44:54 akimura Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
#include "G4ScoringBox.hh"
#include "G4SystemOfUnits.hh"
#include "G4Box.hh"
#include "G4LogicalVolume.hh"
#include "G4VPhysicalVolume.hh"
@@ -24,13 +24,14 @@
// ********************************************************************
//
//
// $Id: G4ScoringCylinder.cc,v 1.16 2010-08-30 08:15:20 akimura Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
#include "G4ScoringCylinder.hh"
#include "G4VPhysicalVolume.hh"
#include "G4PhysicalConstants.hh"
#include "G4SystemOfUnits.hh"
#include "G4VPhysicalVolume.hh"
#include "G4Tubs.hh"
#include "G4LogicalVolume.hh"
#include "G4VPhysicalVolume.hh"
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4ScoringManager.cc,v 1.33 2010-09-24 05:51:27 asaim Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
#include "G4ScoringManager.hh"
@@ -92,7 +91,7 @@ void G4ScoringManager::Accumulate(G4VHitsCollection* map)
sm->Accumulate(static_cast<G4THitsMap<double>*>(map));
}
G4VScoringMesh* G4ScoringManager::FindMesh(G4String wName)
G4VScoringMesh* G4ScoringManager::FindMesh(const G4String& wName)
{
G4VScoringMesh* sm = 0;
for(MeshVecItr itr = fMeshVec.begin(); itr != fMeshVec.end(); itr++) {
@@ -123,7 +122,9 @@ void G4ScoringManager::Dump() const
}
}
void G4ScoringManager::DrawMesh(G4String meshName,G4String psName,G4String colorMapName,G4int axflg)
void G4ScoringManager::DrawMesh(const G4String& meshName,
const G4String& psName,
const G4String& colorMapName, G4int axflg)
{
G4VScoringMesh* mesh = FindMesh(meshName);
if(mesh)
@@ -141,7 +142,10 @@ void G4ScoringManager::DrawMesh(G4String meshName,G4String psName,G4String color
}
}
void G4ScoringManager::DrawMesh(G4String meshName,G4String psName,G4int idxPlane,G4int iColumn,G4String colorMapName)
void G4ScoringManager::DrawMesh(const G4String& meshName,
const G4String& psName,
G4int idxPlane, G4int iColumn,
const G4String& colorMapName)
{
G4VScoringMesh* mesh = FindMesh(meshName);
if(mesh)
@@ -159,7 +163,10 @@ void G4ScoringManager::DrawMesh(G4String meshName,G4String psName,G4int idxPlane
}
}
void G4ScoringManager::DumpQuantityToFile(G4String meshName,G4String psName,G4String fileName, G4String option)
void G4ScoringManager::DumpQuantityToFile(const G4String& meshName,
const G4String& psName,
const G4String& fileName,
const G4String& option)
{
G4VScoringMesh* mesh = FindMesh(meshName);
if(mesh) {
@@ -171,7 +178,9 @@ void G4ScoringManager::DumpQuantityToFile(G4String meshName,G4String psName,G4St
}
}
void G4ScoringManager::DumpAllQuantitiesToFile(G4String meshName,G4String fileName, G4String option)
void G4ScoringManager::DumpAllQuantitiesToFile(const G4String& meshName,
const G4String& fileName,
const G4String& option)
{
G4VScoringMesh* mesh = FindMesh(meshName);
if(mesh) {
@@ -196,7 +205,7 @@ void G4ScoringManager::RegisterScoreColorMap(G4VScoreColorMap* colorMap)
}
}
G4VScoreColorMap* G4ScoringManager::GetScoreColorMap(G4String mapName)
G4VScoreColorMap* G4ScoringManager::GetScoreColorMap(const G4String& mapName)
{
ColorMapDictItr mItr = fColorMapDict->find(mapName);
if(mItr == fColorMapDict->end()) { return 0; }
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4ScoringMessenger.cc,v 1.42 2010-07-26 03:52:33 akimura Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
// ---------------------------------------------------------------------
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4VScoreColorMap.cc,v 1.8 2010-07-26 03:52:33 akimura Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
#include "G4VScoreColorMap.hh"
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4VScoreWriter.cc,v 1.10 2010-07-27 01:44:54 akimura Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
#include "G4VScoreWriter.hh"
@@ -51,7 +50,9 @@ void G4VScoreWriter::SetScoringMesh(G4VScoringMesh * sm) {
fScoringMesh->GetNumberOfSegments(fNMeshSegments);
}
void G4VScoreWriter::DumpQuantityToFile(G4String & psName, G4String & fileName, G4String & option) {
void G4VScoreWriter::DumpQuantityToFile(const G4String& psName,
const G4String& fileName,
const G4String& option) {
// change the option string into lowercase to the case-insensitive.
G4String opt = option;
@@ -146,7 +147,8 @@ void G4VScoreWriter::DumpQuantityToFile(G4String & psName, G4String & fileName,
}
void G4VScoreWriter::DumpAllQuantitiesToFile(G4String & fileName, G4String & option) {
void G4VScoreWriter::DumpAllQuantitiesToFile(const G4String& fileName,
const G4String& option) {
// change the option string into lowercase to the case-insensitive.
G4String opt = option;
+36 -14
View File
@@ -24,18 +24,26 @@
// ********************************************************************
//
//
// $Id: G4VScoringMesh.cc,v 1.43 2010-11-09 00:29:55 asaim Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
// ---------------------------------------------------------------------
// Modifications
// 17-Apr-2012 T.Aso SetSize() and SetNumberOfSegments() is not allowed
// to call twice in same geometrical mesh. Add warning
// message to notify.
//
// ---------------------------------------------------------------------
#include "G4VScoringMesh.hh"
#include "G4SystemOfUnits.hh"
#include "G4VPhysicalVolume.hh"
#include "G4MultiFunctionalDetector.hh"
#include "G4VPrimitiveScorer.hh"
#include "G4VSDFilter.hh"
#include "G4SDManager.hh"
G4VScoringMesh::G4VScoringMesh(G4String wName)
G4VScoringMesh::G4VScoringMesh(const G4String& wName)
: fWorldName(wName),fCurrentPS(0),fConstructed(false),fActive(true),
fRotationMatrix(0), fMFD(new G4MultiFunctionalDetector(wName)),
verboseLevel(0),sizeIsSet(false),nMeshIsSet(false),
@@ -62,8 +70,15 @@ void G4VScoringMesh::ResetScore() {
}
}
void G4VScoringMesh::SetSize(G4double size[3]) {
for(int i = 0; i < 3; i++) fSize[i] = size[i];
sizeIsSet = true;
if ( !sizeIsSet ){
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.";
G4Exception("G4VScoringMesh::SetSize()",
"DigiHitsUtilsScoreVScoringMesh000", JustWarning,
message);
}
}
G4ThreeVector G4VScoringMesh::GetSize() const {
if(sizeIsSet)
@@ -75,8 +90,15 @@ void G4VScoringMesh::SetCenterPosition(G4double centerPosition[3]) {
fCenterPosition = G4ThreeVector(centerPosition[0], centerPosition[1], centerPosition[2]);
}
void G4VScoringMesh::SetNumberOfSegments(G4int nSegment[3]) {
for(int i = 0; i < 3; i++) fNSegment[i] = nSegment[i];
nMeshIsSet = true;
if ( !nMeshIsSet ){
for(int i = 0; i < 3; i++) fNSegment[i] = nSegment[i];
nMeshIsSet = true;
} else {
G4String message = " The size of scoring segments can not be changed.";
G4Exception("G4VScoringMesh::SetNumberOfSegments()",
"DigiHitsUtilsScoreVScoringMesh000", JustWarning,
message);
}
}
void G4VScoringMesh::GetNumberOfSegments(G4int nSegment[3]) {
for(int i = 0; i < 3; i++) nSegment[i] = fNSegment[i];
@@ -139,7 +161,7 @@ void G4VScoringMesh::SetFilter(G4VSDFilter * filter) {
fCurrentPS->SetFilter(filter);
}
void G4VScoringMesh::SetCurrentPrimitiveScorer(G4String & name) {
void G4VScoringMesh::SetCurrentPrimitiveScorer(const G4String & name) {
fCurrentPS = GetPrimitiveScorer(name);
if(fCurrentPS == 0) {
G4cerr << "ERROR : G4VScoringMesh::SetCurrentPrimitiveScorer() : The primitive scorer <"
@@ -147,13 +169,13 @@ void G4VScoringMesh::SetCurrentPrimitiveScorer(G4String & name) {
}
}
G4bool G4VScoringMesh::FindPrimitiveScorer(G4String & psname) {
G4bool G4VScoringMesh::FindPrimitiveScorer(const G4String & psname) {
std::map<G4String, G4THitsMap<G4double>* >::iterator itr = fMap.find(psname);;
if(itr == fMap.end()) return false;
return true;
}
G4String G4VScoringMesh::GetPSUnit(G4String & psname) {
G4String G4VScoringMesh::GetPSUnit(const G4String & psname) {
std::map<G4String, G4THitsMap<G4double>* >::iterator itr = fMap.find(psname);;
if(itr == fMap.end()) {
return G4String("");
@@ -184,7 +206,7 @@ void G4VScoringMesh::SetCurrentPSUnit(const G4String& unit){
}
}
G4double G4VScoringMesh::GetPSUnitValue(G4String & psname) {
G4double G4VScoringMesh::GetPSUnitValue(const G4String & psname) {
std::map<G4String, G4THitsMap<G4double>* >::iterator itr = fMap.find(psname);;
if(itr == fMap.end()) {
return 1.;
@@ -197,7 +219,7 @@ void G4VScoringMesh::GetDivisionAxisNames(G4String divisionAxisNames[3]) {
for(int i = 0; i < 3; i++) divisionAxisNames[i] = fDivisionAxisNames[i];
}
G4VPrimitiveScorer * G4VScoringMesh::GetPrimitiveScorer(G4String & name) {
G4VPrimitiveScorer * G4VScoringMesh::GetPrimitiveScorer(const G4String & name) {
if(fMFD == 0) return 0;
G4int nps = fMFD->GetNumberOfPrimitives();
@@ -263,7 +285,7 @@ void G4VScoringMesh::Dump() {
}
void G4VScoringMesh::DrawMesh(G4String psName,G4VScoreColorMap* colorMap,G4int axflg)
void G4VScoringMesh::DrawMesh(const G4String& psName,G4VScoreColorMap* colorMap,G4int axflg)
{
fDrawPSName = psName;
std::map<G4String, G4THitsMap<G4double>* >::const_iterator fMapItr = fMap.find(psName);
@@ -276,7 +298,7 @@ void G4VScoringMesh::DrawMesh(G4String psName,G4VScoreColorMap* colorMap,G4int a
}
}
void G4VScoringMesh::DrawMesh(G4String psName,G4int idxPlane,G4int iColumn,G4VScoreColorMap* colorMap)
void G4VScoringMesh::DrawMesh(const G4String& psName,G4int idxPlane,G4int iColumn,G4VScoreColorMap* colorMap)
{
fDrawPSName = psName;
std::map<G4String, G4THitsMap<G4double>* >::const_iterator fMapItr = fMap.find(psName);