Import Geant4 11.3.0 source tree
This commit is contained in:
@@ -23,18 +23,16 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// G4ScoreQuantityMessenger
|
||||
//
|
||||
// ---------------------------------------------------------------------
|
||||
// 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.
|
||||
// 27-Mar-2013 T.Aso Unit option in the kineticEnergy filter was
|
||||
// supported.
|
||||
//
|
||||
// 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.
|
||||
// 27-Mar-2013 T.Aso Unit option in the kineticEnergy filter was supported.
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
#include "G4ScoreQuantityMessenger.hh"
|
||||
@@ -1062,7 +1060,7 @@ G4String G4ScoreQuantityMessenger::GetCurrentValue(G4UIcommand* /*command*/)
|
||||
return val;
|
||||
}
|
||||
|
||||
void G4ScoreQuantityMessenger::FillTokenVec(G4String newValues,
|
||||
void G4ScoreQuantityMessenger::FillTokenVec(const G4String& newValues,
|
||||
G4TokenVec& token)
|
||||
{
|
||||
G4Tokenizer next(newValues);
|
||||
@@ -1108,7 +1106,7 @@ void G4ScoreQuantityMessenger::FParticleWithEnergyCommand(G4VScoringMesh* mesh,
|
||||
}
|
||||
|
||||
G4bool G4ScoreQuantityMessenger::CheckMeshPS(G4VScoringMesh* mesh,
|
||||
G4String& psname,
|
||||
const G4String& psname,
|
||||
G4UIcommand* command)
|
||||
{
|
||||
if(!mesh->FindPrimitiveScorer(psname))
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
//
|
||||
// G4ScoringBox
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
#include "G4ScoringBox.hh"
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
#include <map>
|
||||
#include <fstream>
|
||||
|
||||
G4ScoringBox::G4ScoringBox(G4String wName)
|
||||
G4ScoringBox::G4ScoringBox(const G4String& wName)
|
||||
: G4VScoringMesh(wName)
|
||||
, fSegmentDirection(-1)
|
||||
{
|
||||
@@ -242,29 +242,29 @@ void G4ScoringBox::Draw(RunScore* map, G4VScoreColorMap* colorMap, G4int axflg)
|
||||
if(pVisManager != nullptr)
|
||||
{
|
||||
// cell vectors
|
||||
std::vector<std::vector<std::vector<double>>> cell; // cell[X][Y][Z]
|
||||
std::vector<double> ez;
|
||||
for(int z = 0; z < fNSegment[2]; z++)
|
||||
std::vector<std::vector<std::vector<G4double>>> cell; // cell[X][Y][Z]
|
||||
std::vector<G4double> ez;
|
||||
for(G4int z = 0; z < fNSegment[2]; z++)
|
||||
ez.push_back(0.);
|
||||
std::vector<std::vector<double>> eyz;
|
||||
for(int y = 0; y < fNSegment[1]; y++)
|
||||
std::vector<std::vector<G4double>> eyz;
|
||||
for(G4int y = 0; y < fNSegment[1]; y++)
|
||||
eyz.push_back(ez);
|
||||
for(int x = 0; x < fNSegment[0]; x++)
|
||||
for(G4int x = 0; x < fNSegment[0]; x++)
|
||||
cell.push_back(eyz);
|
||||
|
||||
std::vector<std::vector<double>> xycell; // xycell[X][Y]
|
||||
std::vector<double> ey;
|
||||
for(int y = 0; y < fNSegment[1]; y++)
|
||||
std::vector<std::vector<G4double>> xycell; // xycell[X][Y]
|
||||
std::vector<G4double> ey;
|
||||
for(G4int y = 0; y < fNSegment[1]; y++)
|
||||
ey.push_back(0.);
|
||||
for(int x = 0; x < fNSegment[0]; x++)
|
||||
for(G4int x = 0; x < fNSegment[0]; x++)
|
||||
xycell.push_back(ey);
|
||||
|
||||
std::vector<std::vector<double>> yzcell; // yzcell[Y][Z]
|
||||
for(int y = 0; y < fNSegment[1]; y++)
|
||||
std::vector<std::vector<G4double>> yzcell; // yzcell[Y][Z]
|
||||
for(G4int y = 0; y < fNSegment[1]; y++)
|
||||
yzcell.push_back(ez);
|
||||
|
||||
std::vector<std::vector<double>> xzcell; // xzcell[X][Z]
|
||||
for(int x = 0; x < fNSegment[0]; x++)
|
||||
std::vector<std::vector<G4double>> xzcell; // xzcell[X][Z]
|
||||
for(G4int x = 0; x < fNSegment[0]; x++)
|
||||
xzcell.push_back(ez);
|
||||
|
||||
// projections
|
||||
@@ -282,16 +282,16 @@ void G4ScoringBox::Draw(RunScore* map, G4VScoreColorMap* colorMap, G4int axflg)
|
||||
// search max. & min. values in each slice
|
||||
G4double xymin = DBL_MAX, yzmin = DBL_MAX, xzmin = DBL_MAX;
|
||||
G4double xymax = 0., yzmax = 0., xzmax = 0.;
|
||||
for(int x = 0; x < fNSegment[0]; x++)
|
||||
for(G4int x = 0; x < fNSegment[0]; x++)
|
||||
{
|
||||
for(int y = 0; y < fNSegment[1]; y++)
|
||||
for(G4int y = 0; y < fNSegment[1]; y++)
|
||||
{
|
||||
if(xymin > xycell[x][y])
|
||||
xymin = xycell[x][y];
|
||||
if(xymax < xycell[x][y])
|
||||
xymax = xycell[x][y];
|
||||
}
|
||||
for(int z = 0; z < fNSegment[2]; z++)
|
||||
for(G4int z = 0; z < fNSegment[2]; z++)
|
||||
{
|
||||
if(xzmin > xzcell[x][z])
|
||||
xzmin = xzcell[x][z];
|
||||
@@ -299,9 +299,9 @@ void G4ScoringBox::Draw(RunScore* map, G4VScoreColorMap* colorMap, G4int axflg)
|
||||
xzmax = xzcell[x][z];
|
||||
}
|
||||
}
|
||||
for(int y = 0; y < fNSegment[1]; y++)
|
||||
for(G4int y = 0; y < fNSegment[1]; y++)
|
||||
{
|
||||
for(int z = 0; z < fNSegment[2]; z++)
|
||||
for(G4int z = 0; z < fNSegment[2]; z++)
|
||||
{
|
||||
if(yzmin > yzcell[y][z])
|
||||
yzmin = yzcell[y][z];
|
||||
@@ -326,9 +326,9 @@ void G4ScoringBox::Draw(RunScore* map, G4VScoreColorMap* colorMap, G4int axflg)
|
||||
colorMap->SetMinMax(xymin, xymax);
|
||||
}
|
||||
G4ThreeVector zhalf(0., 0., fSize[2] / fNSegment[2] - thick);
|
||||
for(int x = 0; x < fNSegment[0]; x++)
|
||||
for(G4int x = 0; x < fNSegment[0]; x++)
|
||||
{
|
||||
for(int y = 0; y < fNSegment[1]; y++)
|
||||
for(G4int y = 0; y < fNSegment[1]; y++)
|
||||
{
|
||||
G4ThreeVector pos(GetReplicaPosition(x, y, 0) - zhalf);
|
||||
G4ThreeVector pos2(GetReplicaPosition(x, y, fNSegment[2] - 1) +
|
||||
@@ -378,9 +378,9 @@ void G4ScoringBox::Draw(RunScore* map, G4VScoreColorMap* colorMap, G4int axflg)
|
||||
colorMap->SetMinMax(yzmin, yzmax);
|
||||
}
|
||||
G4ThreeVector xhalf(fSize[0] / fNSegment[0] - thick, 0., 0.);
|
||||
for(int y = 0; y < fNSegment[1]; y++)
|
||||
for(G4int y = 0; y < fNSegment[1]; y++)
|
||||
{
|
||||
for(int z = 0; z < fNSegment[2]; z++)
|
||||
for(G4int z = 0; z < fNSegment[2]; z++)
|
||||
{
|
||||
G4ThreeVector pos(GetReplicaPosition(0, y, z) - xhalf);
|
||||
G4ThreeVector pos2(GetReplicaPosition(fNSegment[0] - 1, y, z) +
|
||||
@@ -430,9 +430,9 @@ void G4ScoringBox::Draw(RunScore* map, G4VScoreColorMap* colorMap, G4int axflg)
|
||||
colorMap->SetMinMax(xzmin, xzmax);
|
||||
}
|
||||
G4ThreeVector yhalf(0., fSize[1] / fNSegment[1] - thick, 0.);
|
||||
for(int x = 0; x < fNSegment[0]; x++)
|
||||
for(G4int x = 0; x < fNSegment[0]; x++)
|
||||
{
|
||||
for(int z = 0; z < fNSegment[2]; z++)
|
||||
for(G4int z = 0; z < fNSegment[2]; z++)
|
||||
{
|
||||
G4ThreeVector pos(GetReplicaPosition(x, 0, z) - yhalf);
|
||||
G4ThreeVector pos2(GetReplicaPosition(x, fNSegment[1] - 1, z) +
|
||||
@@ -518,29 +518,29 @@ void G4ScoringBox::DrawColumn(RunScore* map, G4VScoreColorMap* colorMap,
|
||||
pVisManager->BeginDraw();
|
||||
|
||||
// cell vectors
|
||||
std::vector<std::vector<std::vector<double>>> cell; // cell[X][Y][Z]
|
||||
std::vector<double> ez;
|
||||
for(int z = 0; z < fNSegment[2]; z++)
|
||||
std::vector<std::vector<std::vector<G4double>>> cell; // cell[X][Y][Z]
|
||||
std::vector<G4double> ez;
|
||||
for(G4int z = 0; z < fNSegment[2]; z++)
|
||||
ez.push_back(0.);
|
||||
std::vector<std::vector<double>> eyz;
|
||||
for(int y = 0; y < fNSegment[1]; y++)
|
||||
std::vector<std::vector<G4double>> eyz;
|
||||
for(G4int y = 0; y < fNSegment[1]; y++)
|
||||
eyz.push_back(ez);
|
||||
for(int x = 0; x < fNSegment[0]; x++)
|
||||
for(G4int x = 0; x < fNSegment[0]; x++)
|
||||
cell.push_back(eyz);
|
||||
|
||||
std::vector<std::vector<double>> xycell; // xycell[X][Y]
|
||||
std::vector<double> ey;
|
||||
for(int y = 0; y < fNSegment[1]; y++)
|
||||
std::vector<std::vector<G4double>> xycell; // xycell[X][Y]
|
||||
std::vector<G4double> ey;
|
||||
for(G4int y = 0; y < fNSegment[1]; y++)
|
||||
ey.push_back(0.);
|
||||
for(int x = 0; x < fNSegment[0]; x++)
|
||||
for(G4int x = 0; x < fNSegment[0]; x++)
|
||||
xycell.push_back(ey);
|
||||
|
||||
std::vector<std::vector<double>> yzcell; // yzcell[Y][Z]
|
||||
for(int y = 0; y < fNSegment[1]; y++)
|
||||
std::vector<std::vector<G4double>> yzcell; // yzcell[Y][Z]
|
||||
for(G4int y = 0; y < fNSegment[1]; y++)
|
||||
yzcell.push_back(ez);
|
||||
|
||||
std::vector<std::vector<double>> xzcell; // xzcell[X][Z]
|
||||
for(int x = 0; x < fNSegment[0]; x++)
|
||||
std::vector<std::vector<G4double>> xzcell; // xzcell[X][Z]
|
||||
for(G4int x = 0; x < fNSegment[0]; x++)
|
||||
xzcell.push_back(ez);
|
||||
|
||||
// projections
|
||||
@@ -567,16 +567,16 @@ void G4ScoringBox::DrawColumn(RunScore* map, G4VScoreColorMap* colorMap,
|
||||
// search max. & min. values in each slice
|
||||
G4double xymin = DBL_MAX, yzmin = DBL_MAX, xzmin = DBL_MAX;
|
||||
G4double xymax = 0., yzmax = 0., xzmax = 0.;
|
||||
for(int x = 0; x < fNSegment[0]; x++)
|
||||
for(G4int x = 0; x < fNSegment[0]; x++)
|
||||
{
|
||||
for(int y = 0; y < fNSegment[1]; y++)
|
||||
for(G4int y = 0; y < fNSegment[1]; y++)
|
||||
{
|
||||
if(xymin > xycell[x][y])
|
||||
xymin = xycell[x][y];
|
||||
if(xymax < xycell[x][y])
|
||||
xymax = xycell[x][y];
|
||||
}
|
||||
for(int z = 0; z < fNSegment[2]; z++)
|
||||
for(G4int z = 0; z < fNSegment[2]; z++)
|
||||
{
|
||||
if(xzmin > xzcell[x][z])
|
||||
xzmin = xzcell[x][z];
|
||||
@@ -584,9 +584,9 @@ void G4ScoringBox::DrawColumn(RunScore* map, G4VScoreColorMap* colorMap,
|
||||
xzmax = xzcell[x][z];
|
||||
}
|
||||
}
|
||||
for(int y = 0; y < fNSegment[1]; y++)
|
||||
for(G4int y = 0; y < fNSegment[1]; y++)
|
||||
{
|
||||
for(int z = 0; z < fNSegment[2]; z++)
|
||||
for(G4int z = 0; z < fNSegment[2]; z++)
|
||||
{
|
||||
if(yzmin > yzcell[y][z])
|
||||
yzmin = yzcell[y][z];
|
||||
@@ -607,9 +607,9 @@ void G4ScoringBox::DrawColumn(RunScore* map, G4VScoreColorMap* colorMap,
|
||||
{
|
||||
colorMap->SetMinMax(xymin, xymax);
|
||||
}
|
||||
for(int x = 0; x < fNSegment[0]; x++)
|
||||
for(G4int x = 0; x < fNSegment[0]; x++)
|
||||
{
|
||||
for(int y = 0; y < fNSegment[1]; y++)
|
||||
for(G4int y = 0; y < fNSegment[1]; y++)
|
||||
{
|
||||
G4Box xyplate("xy", fSize[0] / fNSegment[0], fSize[1] / fNSegment[1],
|
||||
fSize[2] / fNSegment[2]);
|
||||
@@ -644,9 +644,9 @@ void G4ScoringBox::DrawColumn(RunScore* map, G4VScoreColorMap* colorMap,
|
||||
{
|
||||
colorMap->SetMinMax(yzmin, yzmax);
|
||||
}
|
||||
for(int y = 0; y < fNSegment[1]; y++)
|
||||
for(G4int y = 0; y < fNSegment[1]; y++)
|
||||
{
|
||||
for(int z = 0; z < fNSegment[2]; z++)
|
||||
for(G4int z = 0; z < fNSegment[2]; z++)
|
||||
{
|
||||
G4Box yzplate("yz", fSize[0] / fNSegment[0], fSize[1] / fNSegment[1],
|
||||
fSize[2] / fNSegment[2]);
|
||||
@@ -681,9 +681,9 @@ void G4ScoringBox::DrawColumn(RunScore* map, G4VScoreColorMap* colorMap,
|
||||
{
|
||||
colorMap->SetMinMax(xzmin, xzmax);
|
||||
}
|
||||
for(int x = 0; x < fNSegment[0]; x++)
|
||||
for(G4int x = 0; x < fNSegment[0]; x++)
|
||||
{
|
||||
for(int z = 0; z < fNSegment[2]; z++)
|
||||
for(G4int z = 0; z < fNSegment[2]; z++)
|
||||
{
|
||||
G4Box xzplate("xz", fSize[0] / fNSegment[0], fSize[1] / fNSegment[1],
|
||||
fSize[2] / fNSegment[2]);
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
//
|
||||
// G4ScoringCylinder
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
#include "G4ScoringCylinder.hh"
|
||||
|
||||
@@ -45,7 +45,16 @@
|
||||
#include "G4VVisManager.hh"
|
||||
#include "G4VisAttributes.hh"
|
||||
|
||||
G4ScoringCylinder::G4ScoringCylinder(G4String wName)
|
||||
#include "G4LogicalVolumeStore.hh"
|
||||
#include "G4Material.hh"
|
||||
#include "G4PhysicalVolumeStore.hh"
|
||||
#include "G4SolidStore.hh"
|
||||
#include "G4UnitsTable.hh"
|
||||
#include "G4VSensitiveDetector.hh"
|
||||
#include "G4VSolid.hh"
|
||||
|
||||
|
||||
G4ScoringCylinder::G4ScoringCylinder(const G4String& wName)
|
||||
: G4VScoringMesh(wName)
|
||||
{
|
||||
fShape = MeshShape::cylinder;
|
||||
@@ -248,16 +257,16 @@ void G4ScoringCylinder::Draw(RunScore* map, G4VScoreColorMap* colorMap,
|
||||
if(pVisManager != nullptr)
|
||||
{
|
||||
// cell vectors
|
||||
std::vector<double> ephi;
|
||||
for(int phi = 0; phi < fNSegment[IPHI]; phi++)
|
||||
std::vector<G4double> ephi;
|
||||
for(G4int phi = 0; phi < fNSegment[IPHI]; phi++)
|
||||
ephi.push_back(0.);
|
||||
//-
|
||||
std::vector<std::vector<double>> zphicell; // zphicell[Z][PHI]
|
||||
for(int z = 0; z < fNSegment[IZ]; z++)
|
||||
std::vector<std::vector<G4double>> zphicell; // zphicell[Z][PHI]
|
||||
for(G4int z = 0; z < fNSegment[IZ]; z++)
|
||||
zphicell.push_back(ephi);
|
||||
//-
|
||||
std::vector<std::vector<double>> rphicell; // rphicell[R][PHI]
|
||||
for(int r = 0; r < fNSegment[IR]; r++)
|
||||
std::vector<std::vector<G4double>> rphicell; // rphicell[R][PHI]
|
||||
for(G4int r = 0; r < fNSegment[IR]; r++)
|
||||
rphicell.push_back(ephi);
|
||||
|
||||
// projections
|
||||
@@ -279,16 +288,16 @@ void G4ScoringCylinder::Draw(RunScore* map, G4VScoreColorMap* colorMap,
|
||||
// search min./max. values
|
||||
G4double zphimin = DBL_MAX, rphimin = DBL_MAX;
|
||||
G4double zphimax = 0., rphimax = 0.;
|
||||
for(int iphi = 0; iphi < fNSegment[IPHI]; iphi++)
|
||||
for(G4int iphi = 0; iphi < fNSegment[IPHI]; iphi++)
|
||||
{
|
||||
for(int iz = 0; iz < fNSegment[IZ]; iz++)
|
||||
for(G4int iz = 0; iz < fNSegment[IZ]; iz++)
|
||||
{
|
||||
if(zphimin > zphicell[iz][iphi])
|
||||
zphimin = zphicell[iz][iphi];
|
||||
if(zphimax < zphicell[iz][iphi])
|
||||
zphimax = zphicell[iz][iphi];
|
||||
}
|
||||
for(int ir = 0; ir < fNSegment[IR]; ir++)
|
||||
for(G4int ir = 0; ir < fNSegment[IR]; ir++)
|
||||
{
|
||||
if(rphimin > rphicell[ir][iphi])
|
||||
rphimin = rphicell[ir][iphi];
|
||||
@@ -318,9 +327,9 @@ void G4ScoringCylinder::Draw(RunScore* map, G4VScoreColorMap* colorMap,
|
||||
}
|
||||
|
||||
G4double zhalf = fSize[2] / fNSegment[IZ];
|
||||
for(int phi = 0; phi < fNSegment[IPHI]; phi++)
|
||||
for(G4int phi = 0; phi < fNSegment[IPHI]; phi++)
|
||||
{
|
||||
for(int z = 0; z < fNSegment[IZ]; z++)
|
||||
for(G4int z = 0; z < fNSegment[IZ]; z++)
|
||||
{
|
||||
//-
|
||||
G4double angle = fAngle[0] + fAngle[1] / fNSegment[IPHI] * phi;
|
||||
@@ -368,9 +377,9 @@ void G4ScoringCylinder::Draw(RunScore* map, G4VScoreColorMap* colorMap,
|
||||
}
|
||||
|
||||
G4double rsize = (fSize[1] - fSize[0]) / fNSegment[IR];
|
||||
for(int phi = 0; phi < fNSegment[IPHI]; phi++)
|
||||
for(G4int phi = 0; phi < fNSegment[IPHI]; phi++)
|
||||
{
|
||||
for(int r = 0; r < fNSegment[IR]; r++)
|
||||
for(G4int r = 0; r < fNSegment[IR]; r++)
|
||||
{
|
||||
G4double rs[2] = { fSize[0] + rsize * r, fSize[0] + rsize * (r + 1) };
|
||||
G4double angle = fAngle[0] + fAngle[1] / fNSegment[IPHI] * phi;
|
||||
@@ -448,29 +457,29 @@ void G4ScoringCylinder::DrawColumn(RunScore* map, G4VScoreColorMap* colorMap,
|
||||
if(pVisManager != nullptr)
|
||||
{
|
||||
// cell vectors
|
||||
std::vector<std::vector<std::vector<double>>> cell; // cell[R][Z][PHI]
|
||||
std::vector<double> ephi;
|
||||
for(int phi = 0; phi < fNSegment[IPHI]; phi++)
|
||||
std::vector<std::vector<std::vector<G4double>>> cell; // cell[R][Z][PHI]
|
||||
std::vector<G4double> ephi;
|
||||
for(G4int phi = 0; phi < fNSegment[IPHI]; phi++)
|
||||
ephi.push_back(0.);
|
||||
std::vector<std::vector<double>> ezphi;
|
||||
for(int z = 0; z < fNSegment[IZ]; z++)
|
||||
std::vector<std::vector<G4double>> ezphi;
|
||||
for(G4int z = 0; z < fNSegment[IZ]; z++)
|
||||
ezphi.push_back(ephi);
|
||||
for(int r = 0; r < fNSegment[IR]; r++)
|
||||
for(G4int r = 0; r < fNSegment[IR]; r++)
|
||||
cell.push_back(ezphi);
|
||||
|
||||
std::vector<std::vector<double>> rzcell; // rzcell[R][Z]
|
||||
std::vector<double> ez;
|
||||
for(int z = 0; z < fNSegment[IZ]; z++)
|
||||
std::vector<std::vector<G4double>> rzcell; // rzcell[R][Z]
|
||||
std::vector<G4double> ez;
|
||||
for(G4int z = 0; z < fNSegment[IZ]; z++)
|
||||
ez.push_back(0.);
|
||||
for(int r = 0; r < fNSegment[IR]; r++)
|
||||
for(G4int r = 0; r < fNSegment[IR]; r++)
|
||||
rzcell.push_back(ez);
|
||||
|
||||
std::vector<std::vector<double>> zphicell; // zphicell[Z][PHI]
|
||||
for(int z = 0; z < fNSegment[IZ]; z++)
|
||||
std::vector<std::vector<G4double>> zphicell; // zphicell[Z][PHI]
|
||||
for(G4int z = 0; z < fNSegment[IZ]; z++)
|
||||
zphicell.push_back(ephi);
|
||||
|
||||
std::vector<std::vector<double>> rphicell; // rphicell[R][PHI]
|
||||
for(int r = 0; r < fNSegment[IR]; r++)
|
||||
std::vector<std::vector<G4double>> rphicell; // rphicell[R][PHI]
|
||||
for(G4int r = 0; r < fNSegment[IR]; r++)
|
||||
rphicell.push_back(ephi);
|
||||
|
||||
// projections
|
||||
@@ -502,16 +511,16 @@ void G4ScoringCylinder::DrawColumn(RunScore* map, G4VScoreColorMap* colorMap,
|
||||
// search min./max. values
|
||||
G4double rzmin = DBL_MAX, zphimin = DBL_MAX, rphimin = DBL_MAX;
|
||||
G4double rzmax = 0., zphimax = 0., rphimax = 0.;
|
||||
for(int r = 0; r < fNSegment[IR]; r++)
|
||||
for(G4int r = 0; r < fNSegment[IR]; r++)
|
||||
{
|
||||
for(int phi = 0; phi < fNSegment[IPHI]; phi++)
|
||||
for(G4int phi = 0; phi < fNSegment[IPHI]; phi++)
|
||||
{
|
||||
if(rphimin > rphicell[r][phi])
|
||||
rphimin = rphicell[r][phi];
|
||||
if(rphimax < rphicell[r][phi])
|
||||
rphimax = rphicell[r][phi];
|
||||
}
|
||||
for(int z = 0; z < fNSegment[IZ]; z++)
|
||||
for(G4int z = 0; z < fNSegment[IZ]; z++)
|
||||
{
|
||||
if(rzmin > rzcell[r][z])
|
||||
rzmin = rzcell[r][z];
|
||||
@@ -519,9 +528,9 @@ void G4ScoringCylinder::DrawColumn(RunScore* map, G4VScoreColorMap* colorMap,
|
||||
rzmax = rzcell[r][z];
|
||||
}
|
||||
}
|
||||
for(int z = 0; z < fNSegment[IZ]; z++)
|
||||
for(G4int z = 0; z < fNSegment[IZ]; z++)
|
||||
{
|
||||
for(int phi = 0; phi < fNSegment[IPHI]; phi++)
|
||||
for(G4int phi = 0; phi < fNSegment[IPHI]; phi++)
|
||||
{
|
||||
if(zphimin > zphicell[z][phi])
|
||||
zphimin = zphicell[z][phi];
|
||||
@@ -593,9 +602,9 @@ void G4ScoringCylinder::DrawColumn(RunScore* map, G4VScoreColorMap* colorMap,
|
||||
}
|
||||
|
||||
G4double rsize = (fSize[1] - fSize[0]) / fNSegment[IR];
|
||||
for(int phi = 0; phi < fNSegment[IPHI]; phi++)
|
||||
for(G4int phi = 0; phi < fNSegment[IPHI]; phi++)
|
||||
{
|
||||
for(int r = 0; r < fNSegment[IR]; r++)
|
||||
for(G4int r = 0; r < fNSegment[IR]; r++)
|
||||
{
|
||||
G4double rs[2] = { fSize[0] + rsize * r, fSize[0] + rsize * (r + 1) };
|
||||
G4double angle = fAngle[0] + fAngle[1] / fNSegment[IPHI] * phi;
|
||||
@@ -639,9 +648,9 @@ void G4ScoringCylinder::DrawColumn(RunScore* map, G4VScoreColorMap* colorMap,
|
||||
G4double zhalf = fSize[2] / fNSegment[IZ];
|
||||
G4double angle = fAngle[0] + fAngle[1] / fNSegment[IPHI] * idxColumn;
|
||||
G4double dphi = fAngle[1] / fNSegment[IPHI];
|
||||
for(int z = 0; z < fNSegment[IZ]; z++)
|
||||
for(G4int z = 0; z < fNSegment[IZ]; z++)
|
||||
{
|
||||
for(int r = 0; r < fNSegment[IR]; r++)
|
||||
for(G4int r = 0; r < fNSegment[IR]; r++)
|
||||
{
|
||||
G4double rs[2] = { fSize[0] + rsize * r, fSize[0] + rsize * (r + 1) };
|
||||
G4Tubs cylinder("z-phi", rs[0], rs[1], zhalf, angle, dphi);
|
||||
@@ -692,14 +701,6 @@ void G4ScoringCylinder::GetRZPhi(G4int index, G4int q[3]) const
|
||||
q[k] = index - q[j] * fNSegment[k] - q[i] * jk;
|
||||
}
|
||||
|
||||
#include "G4LogicalVolumeStore.hh"
|
||||
#include "G4Material.hh"
|
||||
#include "G4PhysicalVolumeStore.hh"
|
||||
#include "G4SolidStore.hh"
|
||||
#include "G4UnitsTable.hh"
|
||||
#include "G4VSensitiveDetector.hh"
|
||||
#include "G4VSolid.hh"
|
||||
|
||||
void G4ScoringCylinder::DumpVolumes()
|
||||
{
|
||||
G4int lvl = 2;
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
//
|
||||
// G4ScoringManager
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
#include "G4ScoringManager.hh"
|
||||
#include "G4ScoringMessenger.hh"
|
||||
@@ -102,7 +102,7 @@ G4VScoringMesh* G4ScoringManager::FindMesh(G4VHitsCollection* map)
|
||||
auto msh = fMeshMap.find(colID);
|
||||
if(msh == fMeshMap.end())
|
||||
{
|
||||
auto wName = map->GetSDname();
|
||||
const auto& wName = map->GetSDname();
|
||||
sm = FindMesh(wName);
|
||||
fMeshMap[colID] = sm;
|
||||
}
|
||||
@@ -263,7 +263,7 @@ void G4ScoringManager::ListScoreColorMaps()
|
||||
|
||||
void G4ScoringManager::Merge(const G4ScoringManager* mgr)
|
||||
{
|
||||
for(G4int i = 0; i < (G4int)GetNumberOfMesh(); ++i)
|
||||
for(auto i = 0; i < (G4int)GetNumberOfMesh(); ++i)
|
||||
{
|
||||
G4VScoringMesh* fMesh = GetMesh(i);
|
||||
G4VScoringMesh* scMesh = mgr->GetMesh(i);
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// ---------------------------------------------------------------------
|
||||
// G4ScoringMessenger
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
#include "G4ScoringMessenger.hh"
|
||||
#include "G4ScoringManager.hh"
|
||||
@@ -47,6 +47,9 @@
|
||||
#include "G4UnitsTable.hh"
|
||||
#include "G4VScoreColorMap.hh"
|
||||
|
||||
#include "G4VPrimitivePlotter.hh"
|
||||
#include "G4VScoreHistFiller.hh"
|
||||
|
||||
G4ScoringMessenger::G4ScoringMessenger(G4ScoringManager* SManager)
|
||||
: fSMan(SManager)
|
||||
{
|
||||
@@ -927,7 +930,7 @@ G4String G4ScoringMessenger::GetCurrentValue(G4UIcommand* command)
|
||||
return val;
|
||||
}
|
||||
|
||||
void G4ScoringMessenger::FillTokenVec(G4String newValues, G4TokenVec& token)
|
||||
void G4ScoringMessenger::FillTokenVec(const G4String& newValues, G4TokenVec& token)
|
||||
{
|
||||
G4Tokenizer next(newValues);
|
||||
G4String val;
|
||||
@@ -970,10 +973,7 @@ void G4ScoringMessenger::MeshBinCommand(G4VScoringMesh* mesh, G4TokenVec& token)
|
||||
mesh->SetNumberOfSegments(nSegment);
|
||||
}
|
||||
|
||||
#include "G4VPrimitivePlotter.hh"
|
||||
#include "G4VScoreHistFiller.hh"
|
||||
|
||||
void G4ScoringMessenger::Fill1D(G4UIcommand* cmd, G4String newVal)
|
||||
void G4ScoringMessenger::Fill1D(G4UIcommand* cmd, const G4String& newVal)
|
||||
{
|
||||
using MeshShape = G4VScoringMesh::MeshShape;
|
||||
|
||||
|
||||
@@ -23,7 +23,9 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// G4ScoringProbe
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
#include "G4ScoringProbe.hh"
|
||||
|
||||
#include "G4Box.hh"
|
||||
@@ -46,7 +48,14 @@
|
||||
#include "G4SystemOfUnits.hh"
|
||||
#include "G4VisAttributes.hh"
|
||||
|
||||
G4ScoringProbe::G4ScoringProbe(G4String lvName, G4double half_size,
|
||||
#include "G4AutoLock.hh"
|
||||
|
||||
namespace
|
||||
{
|
||||
G4Mutex logvolmutex = G4MUTEX_INITIALIZER;
|
||||
}
|
||||
|
||||
G4ScoringProbe::G4ScoringProbe(const G4String& lvName, G4double half_size,
|
||||
G4bool checkOverlap)
|
||||
: G4VScoringMesh(lvName)
|
||||
, chkOverlap(checkOverlap)
|
||||
@@ -78,12 +87,6 @@ void G4ScoringProbe::List() const
|
||||
G4VScoringMesh::List();
|
||||
}
|
||||
|
||||
#include "G4AutoLock.hh"
|
||||
namespace
|
||||
{
|
||||
G4Mutex logvolmutex = G4MUTEX_INITIALIZER;
|
||||
}
|
||||
|
||||
void G4ScoringProbe::SetupGeometry(G4VPhysicalVolume* worldPhys)
|
||||
{
|
||||
if(G4Threading::IsMasterThread())
|
||||
|
||||
@@ -23,6 +23,9 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// G4ScoringRealWorld
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
#include "G4ScoringRealWorld.hh"
|
||||
|
||||
#include "G4LogicalVolume.hh"
|
||||
@@ -39,7 +42,14 @@
|
||||
|
||||
#include "G4SystemOfUnits.hh"
|
||||
|
||||
G4ScoringRealWorld::G4ScoringRealWorld(G4String lvName)
|
||||
#include "G4AutoLock.hh"
|
||||
|
||||
namespace
|
||||
{
|
||||
G4Mutex logvolmutex = G4MUTEX_INITIALIZER;
|
||||
}
|
||||
|
||||
G4ScoringRealWorld::G4ScoringRealWorld(const G4String& lvName)
|
||||
: G4VScoringMesh(lvName)
|
||||
{
|
||||
fShape = MeshShape::realWorldLogVol;
|
||||
@@ -56,17 +66,12 @@ 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++)
|
||||
for(; itr != store->end(); ++itr)
|
||||
{
|
||||
if((*itr)->GetName() == logVolName)
|
||||
{
|
||||
@@ -74,7 +79,7 @@ void G4ScoringRealWorld::SetupGeometry(G4VPhysicalVolume*)
|
||||
G4int nb = 0;
|
||||
auto pvStore = G4PhysicalVolumeStore::GetInstance();
|
||||
auto pvItr = pvStore->begin();
|
||||
for(; pvItr != pvStore->end(); pvItr++)
|
||||
for(; pvItr != pvStore->end(); ++pvItr)
|
||||
{
|
||||
if((*pvItr)->GetLogicalVolume() == (*itr))
|
||||
{
|
||||
|
||||
@@ -23,14 +23,10 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
//
|
||||
// G4VScoreColorMap
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
#include "G4VScoreColorMap.hh"
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
#include <iomanip>
|
||||
|
||||
#include "G4VVisManager.hh"
|
||||
#include "G4VisAttributes.hh"
|
||||
#include "G4Text.hh"
|
||||
@@ -39,7 +35,11 @@
|
||||
#include "G4Colour.hh"
|
||||
#include "G4Polyhedron.hh"
|
||||
|
||||
G4VScoreColorMap::G4VScoreColorMap(G4String mName)
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
#include <iomanip>
|
||||
|
||||
G4VScoreColorMap::G4VScoreColorMap(const G4String& mName)
|
||||
: fName(mName)
|
||||
{}
|
||||
|
||||
@@ -91,13 +91,13 @@ void G4VScoreColorMap::DrawColorChartText(G4int _nPoint)
|
||||
|
||||
fVisManager->BeginDraw2D();
|
||||
|
||||
for(int n = 0; n < _nPoint; n++)
|
||||
for(G4int n = 0; n < _nPoint; n++)
|
||||
{
|
||||
G4double a = n / (_nPoint - 1.), b = 1. - a;
|
||||
G4double v = (a * max + b * min) / (a + b);
|
||||
// background color
|
||||
|
||||
for(int l = 0; l < 21; l++)
|
||||
for(G4int l = 0; l < 21; l++)
|
||||
{
|
||||
G4Polyline line;
|
||||
line.push_back(G4Point3D(-0.9, -0.905 + 0.05 * n + 0.002 * l, 0.));
|
||||
@@ -128,7 +128,7 @@ void G4VScoreColorMap::DrawColorChartText(G4int _nPoint)
|
||||
G4double lpsname = 2. + fPSName.size() * 0.95;
|
||||
if(lpsname > 0)
|
||||
{
|
||||
for(int l = 0; l < 22; l++)
|
||||
for(G4int l = 0; l < 22; l++)
|
||||
{
|
||||
G4Polyline line;
|
||||
line.push_back(G4Point3D(-0.92, -0.965 + 0.002 * l, 0.));
|
||||
@@ -154,7 +154,7 @@ void G4VScoreColorMap::DrawColorChartText(G4int _nPoint)
|
||||
G4double len = 2. + fPSUnit.size();
|
||||
if(len > 0)
|
||||
{
|
||||
for(int l = 0; l < 21; l++)
|
||||
for(G4int l = 0; l < 21; l++)
|
||||
{
|
||||
G4Polyline line;
|
||||
line.push_back(G4Point3D(-0.7, -0.9 + 0.002 * l, 0.));
|
||||
|
||||
@@ -23,8 +23,9 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// G4VScoreNtupleWriter
|
||||
//
|
||||
// Author: Ivana Hrivnacova, 11/09/2018 (ivana@ipno.in2p3.fr)
|
||||
// Author: Ivana Hrivnacova, 11/09/2018
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
#include "G4VScoreNtupleWriter.hh"
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
//
|
||||
// G4VScoreWriter
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
#include "G4VScoreWriter.hh"
|
||||
|
||||
@@ -110,13 +110,13 @@ void G4VScoreWriter::DumpQuantityToFile(const G4String& psName,
|
||||
}
|
||||
|
||||
// write quantity
|
||||
long count = 0;
|
||||
G4long count = 0;
|
||||
ofile << std::setprecision(16); // for double value with 8 bytes
|
||||
for(int x = 0; x < fNMeshSegments[0]; x++)
|
||||
for(G4int x = 0; x < fNMeshSegments[0]; x++)
|
||||
{
|
||||
for(int y = 0; y < fNMeshSegments[1]; y++)
|
||||
for(G4int y = 0; y < fNMeshSegments[1]; y++)
|
||||
{
|
||||
for(int z = 0; z < fNMeshSegments[2]; z++)
|
||||
for(G4int z = 0; z < fNMeshSegments[2]; z++)
|
||||
{
|
||||
G4int idx = GetIndex(x, y, z);
|
||||
|
||||
@@ -161,7 +161,7 @@ void G4VScoreWriter::DumpAllQuantitiesToFile(const G4String& fileName,
|
||||
{
|
||||
// change the option string into lowercase to the case-insensitive.
|
||||
G4String opt = option;
|
||||
std::transform(opt.begin(), opt.end(), opt.begin(), (int (*)(int))(tolower));
|
||||
std::transform(opt.begin(), opt.end(), opt.begin(), (G4int (*)(G4int))(tolower));
|
||||
|
||||
// confirm the option
|
||||
if(opt.empty())
|
||||
@@ -220,13 +220,13 @@ void G4VScoreWriter::DumpAllQuantitiesToFile(const G4String& fileName,
|
||||
}
|
||||
|
||||
// write quantity
|
||||
long count = 0;
|
||||
G4long count = 0;
|
||||
ofile << std::setprecision(16); // for double value with 8 bytes
|
||||
for(int x = 0; x < fNMeshSegments[0]; x++)
|
||||
for(G4int x = 0; x < fNMeshSegments[0]; x++)
|
||||
{
|
||||
for(int y = 0; y < fNMeshSegments[1]; y++)
|
||||
for(G4int y = 0; y < fNMeshSegments[1]; y++)
|
||||
{
|
||||
for(int z = 0; z < fNMeshSegments[2]; z++)
|
||||
for(G4int z = 0; z < fNMeshSegments[2]; z++)
|
||||
{
|
||||
G4int idx = GetIndex(x, y, z);
|
||||
|
||||
|
||||
@@ -23,14 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
//
|
||||
// ---------------------------------------------------------------------
|
||||
// Modifications
|
||||
// 17-Apr-2012 T.Aso SetSize() and SetNumberOfSegments() is not allowed
|
||||
// to call twice in same geometrical mesh. Add warning
|
||||
// message to notify.
|
||||
//
|
||||
// G4VScoringMesh
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
#include "G4VScoringMesh.hh"
|
||||
@@ -384,7 +377,7 @@ void G4VScoringMesh::Accumulate(G4THitsMap<G4double>* map)
|
||||
{
|
||||
G4String psName = map->GetName();
|
||||
const auto fMapItr = fMap.find(psName);
|
||||
*(fMapItr->second) += *map;
|
||||
if (fMapItr != fMap.cend()) { *(fMapItr->second) += *map; }
|
||||
|
||||
if(verboseLevel > 9)
|
||||
{
|
||||
@@ -408,7 +401,7 @@ void G4VScoringMesh::Accumulate(G4THitsMap<G4StatDouble>* map)
|
||||
{
|
||||
G4String psName = map->GetName();
|
||||
const auto fMapItr = fMap.find(psName);
|
||||
*(fMapItr->second) += *map;
|
||||
if (fMapItr != fMap.cend()) { *(fMapItr->second) += *map; }
|
||||
|
||||
if(verboseLevel > 9)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user