Log of /trunk/geom/gdml/inc/TGDMLParse.h
Parent Directory
Revision
41578 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Oct 25 16:36:15 2011 UTC (3 years, 2 months ago) by
agheata
File length: 9668 byte(s)
Diff to
previous 36390
Change return type of GetScale method to TString. Change of attributes and tags according to gdml schema (e.g. twistTrap -> twistedtrap, twist->Phitwis, ...). Change order of formula and name in creating TGeoElement.
Revision
30745 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Oct 15 12:23:45 2009 UTC (5 years, 3 months ago) by
brun
File length: 9464 byte(s)
Diff to
previous 22923
From daniele.francesco.kruse@cern.ch
"Added support for the 'ellipsoid' GDML tag.
In the solids section of the GDML file, an ellipsoid may be declared.
Unfortunately, the ellipsoid is not supported under ROOT so,
when the ellipsoid keyword is found, this function is called
to convert it to a simple box with corresponding dimensions."
Revision
19562 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Aug 7 07:53:05 2007 UTC (7 years, 5 months ago) by
brun
Original Path:
trunk/gdml/inc/TGDMLParse.h
File length: 9119 byte(s)
Diff to
previous 17111
From Zoltan.Torzsok@cern.ch:
*** Using constants in GDML with ROOT ***
[ORIGINAL APPROACH]
Originally constants could not be used within mathematical expressions in ROOT.
The following example is to illustrate the problem:
<define>
<constant name="size" value="100.0"/>
</define>
<solids>
<box name="MyCube" x="size" y="size" z="size"/>
<box name="MyBox" x="1.0*size" y="2.0*size" z="3.0*size"/>
</solids>
The "MyCube" solid can be parsed since it contains a constant only.
The "MyBox" solid will indicate an error message like "size" is not
recognised as an expression. This happens because in the original method
the whole expression string is searched in the constant map.
If it can be found, it is replaced with its value.
In "MyBox" the expression string for the "x" attribute is "1.0*size"
and there isnt any constant defined with the name of "1.0*size".
We can trick the parser and eliminate the mentioned error message by
adding the following constants:
<constant name="1.0*size" value="100"/>
<constant name="2.0*size" value="200"/>
<constant name="3.0*size" value="300"/>
[MY APPROACH]
I am using a find-and-replace method on the expression string.
If the name of a constant is found within the expression string,
it is replaced with the value of the constant.
This approach fails in special cases, when a constants name contains
an other constants name, like in the following:
<constant name="wi" value="100"/>
<constant name="width" value="200"/>
In this case, every occurence of "width" will look like "100dth"
so that "width" will be no longer recognised. This must be fixed.
[TEST RESULTS]
Applying my method has not got any impact on speed, even with
highly sophisticated models like "cms.gdml".
[FEATURES]
- Works with multiple constants in a single expression (tested)
- Should work with multiple *.gdml files (not tested)
- Works with constants with expressions (tested)
Example:
<constant name="size" value="100.0"/>
<constant name="width" value="2.0*size"/>
<constant name="height" value="4.0*size"/>
<constant name="depth" value="8.0*size"/>
*** Problem with rotation in boolean solids is fixed now ***
Originally, in GDML/Geant4, in a boolean composition of two solids only the second solid could be rotated.
This rotation has opposite winding compared to the rotation of the volume, so that the inverse of the rotation matrix is used.
Later the boolean solid was extended, using the "firstrotation" token, so that the first solid can be rotated too.
But in the code the matrix inversion was omitted for this rotation. By adding matrix inversion to this rotation
the problem is solved.
This form allows you to request diffs between any two revisions of this file.
For each of the two "sides" of the diff,
enter a numeric revision.