Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions source/persistency/ascii/src/G4tgbGeometryDumper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include "G4BooleanSolid.hh"
#include "G4Box.hh"
#include "G4Cons.hh"
#include "G4CutTubs.hh"
#include "G4Element.hh"
#include "G4Ellipsoid.hh"
#include "G4EllipticalCone.hh"
Expand Down Expand Up @@ -805,6 +806,26 @@ std::vector<G4double> G4tgbGeometryDumper::GetSolidParams(const G4VSolid* so)
params.push_back(tu->GetDeltaPhiAngle() / deg);
}
}
else if (solidType == "CUTTUBS")
{
const G4CutTubs* ctu = dynamic_cast<const G4CutTubs*>(so);
if (ctu != nullptr)
{
G4ThreeVector lowNorm(ctu->GetLowNorm());
G4ThreeVector highNorm(ctu->GetHighNorm());
params.push_back(ctu->GetInnerRadius());
params.push_back(ctu->GetOuterRadius());
params.push_back(ctu->GetZHalfLength());
params.push_back(ctu->GetStartPhiAngle() / deg);
params.push_back(ctu->GetDeltaPhiAngle() / deg);
params.push_back(lowNorm.x());
params.push_back(lowNorm.y());
params.push_back(lowNorm.z());
params.push_back(highNorm.x());
params.push_back(highNorm.y());
params.push_back(highNorm.z());
}
}
else if (solidType == "TRAP")
{
const G4Trap* trp = dynamic_cast<const G4Trap*>(so);
Expand Down
15 changes: 15 additions & 0 deletions source/persistency/ascii/src/G4tgbVolume.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include "G4AssemblyVolume.hh"
#include "G4Box.hh"
#include "G4Cons.hh"
#include "G4CutTubs.hh"
#include "G4Ellipsoid.hh"
#include "G4EllipticalCone.hh"
#include "G4EllipticalTube.hh"
Expand Down Expand Up @@ -254,6 +255,20 @@ G4VSolid* G4tgbVolume::FindOrConstructG4Solid(const G4tgrSolid* sol)
}
solid = new G4Tubs(sname, solParam[0], solParam[1], solParam[2], solParam[3], phiDelta);
}
else if (stype == "CUTTUBS")
{
CheckNoSolidParams(stype, 11, (G4int)solParam.size());
G4double phiDelta = solParam[4];
if (std::fabs(phiDelta - twopi) < angularTolerance)
{
phiDelta = twopi;
}
G4ThreeVector lowNorm(solParam[5], solParam[6], solParam[7]);
G4ThreeVector highNorm(solParam[8], solParam[9], solParam[10]);
solid = new G4CutTubs(sname, solParam[0], solParam[1], solParam[2], // rmin, rmax, dz
solParam[3], solParam[4], // sphi, dphi
lowNorm, highNorm);
}
else if (stype == "TRAP")
{
if (solParam.size() == 11)
Expand Down
4 changes: 4 additions & 0 deletions source/persistency/ascii/src/G4tgrSolid.cc
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ void G4tgrSolid::FillSolidParams(const std::vector<G4String>& wl)
apar.insert(4);
angleParams["TUBS"] = apar;
apar.clear();
apar.insert(3);
apar.insert(4);
angleParams["CUTTUBS"] = apar;
apar.clear();
apar.insert(5);
apar.insert(6);
angleParams["CONS"] = apar;
Expand Down