Problem 1912 - replicavol around direction phi requires width in length unit instead of angle unit
Summary: replicavol around direction phi requires width in length unit instead of angl...
Status: RESOLVED FIXED
Alias: None
Product: Geant4
Classification: Unclassified
Component: persistency/gdml (show other problems)
Version: 10.2
Hardware: All All
: P4 minor
Assignee: Witold.Pokorski
URL:
Depends on:
Blocks:
 
Reported: 2016-11-16 17:43 CET by Wouter Deconinck
Modified: 2016-11-23 17:18 CET (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
Description Wouter Deconinck 2016-11-16 17:43:43 CET
When using <replicavol> to create replicated volumes in gdml, the <width value="" unit=""> tag does not accept units other than lengths. When replicating around direction="phi", this requires the user to enter a width value in radians with unit mm (which is defined identical to 1). 

Code that fails to run:
    <replicavol number="7">
      <volumeref ref="pionDetectorGEMOpenSector_logical"/>
      <replicate_along_axis>
        <direction phi="1"/>
        <width value="360.0/7.0" unit="deg"/>
        <offset value="0.0" unit="deg"/>
      </replicate_along_axis>
    </replicavol>

Work-around:
    <replicavol number="7">
      <volumeref ref="pionDetectorGEMOpenSector_logical"/>
      <replicate_along_axis>
        <direction phi="1"/>
        <width value="2.0*pi/7.0" unit="mm"/> <!-- bug geant4.10.02.p02: unit must be a length, but mm == 1 -->
        <offset value="0.0" unit="mm"/>
      </replicate_along_axis>
    </replicavol>

The bug is caused by G4GDMLReadStructure::QuantityRead which throws an exception in line 559 when the unit is not of the category length.

Suggested solution could be to relax the requirement in QuantityRead, or to pass the axis in ReplicaRead and check accordingly (this requires the <direction> tag to appear before <width> and <offset>).
Comment 1 Gabriele Cosmo 2016-11-23 17:18:46 CET
Thanks, the problem is now fixed in the development version and will be available in the next release of Geant4.