| Summary: | G4Trap solid not properly written | ||
|---|---|---|---|
| Product: | Geant4 | Reporter: | Maurik <holtrop> |
| Component: | persistency/gdml | Assignee: | tatiana.nikitina |
| Status: | RESOLVED FIXED | ||
| Severity: | trivial | ||
| Priority: | P5 | ||
| Version: | 9.6 | ||
| Hardware: | All | ||
| OS: | All | ||
The exact same problem occurs on lines 376 and 376 for the G4Para. Thanks for reporting this. The fix is now introduced in the development version and will be part of a future patch/release. |
Any G4Trap volume is not properly written if the "theta" angle is negative, with "phi=0", OR, if "theta" is positive and "phi=180". The fix is rather simple. In the file G4GDMLWriteSolids.cc line 651, method TrapWrite, use the G4ThreeVector methods theta() and phi() to get the angles. See code snippet, instead of the incorrect calculation using aran(y/x), since y is zero and x negative. -------------------------- void G4GDMLWriteSolids:: TrapWrite(xercesc::DOMElement* solElement, const G4Trap* const trap) { const G4String& name = GenerateName(trap->GetName(),trap); const G4ThreeVector& simaxis = trap->GetSymAxis(); const G4double phi = simaxis.phi();// (simaxis.z() != 1.0)? (std::atan(simaxis.y()/simaxis.x())) : (0.0); const G4double theta = simaxis.theta(); //std::acos(simaxis.z());