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
+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);