New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using a colon for a variable passed to DD4hep Evaluator: "namespace:name" rather then "namespace_name" #421

Closed
ianna opened this Issue Jul 24, 2018 · 5 comments

Comments

Projects
None yet
3 participants
@ianna

ianna commented Jul 24, 2018

CMS XML description widely uses "_" in the volume names, constants, etc. Hence it is not appropriate to define it as a namespace separator. DD4hep Evaluator does not recognize "namespace:name", however it has no problem recognizing "namespace_name".

It looks like both DD4hep and CMS DD use CLHEP evaluator as a backend. CMS DD XML parser does a separate pass to expand all the constants. Are there any better ideas to avoid the following problem?

...
DDCMS                +++ Add constant object: cmsextent:Rmin                           = 0*fm [type:number]
...
Constant               Unresolved: cms:Rmin -> [cmsextent:Rmin]
...
DDCMS                +++ RESOLVING 11 unknown constants.....
...
DDCMS                +++ [000003] ----------  cms:Rmin                                 = [cmsextent:Rmin]
DDCMS                +++ Add constant object: cms:Rmin                                 = (0*fm) [type:number]
...
cms:Rmin: Evaluator : unknown variable : cms:Rmin
...
dd4hep: Error interpreting XML nodes of type <SolidSection/>
----- Begin Fatal Exception 24-Jul-2018 11:04:48 CEST-----------------------
An exception of category 'StdException' occurred while
   [0] Processing  Event run: 1 lumi: 1 event: 1 stream: 0
   [1] Running path 'p'
   [2] Calling method for module DDCMSDetector/'test'
Exception Message:
A std::exception was thrown.
dd4hep: Severe error during expression evaluation of cms:Rmin
dd4hep: Error interpreting XML nodes of type <SolidSection/>
dd4hep: while parsing /build/yana/DD4HEP/CMSSW_10_2_X_2018-07-15-0000/src/DetectorDescription/DDCMS/data/cms-mf-geometry.xml
dd4hep: with plugin:DD4hep_CompactLoader
----- End Fatal Exception -------------------------------------------------

@petricm petricm added the help wanted label Aug 6, 2018

@MarkusFrankATcernch

This comment has been minimized.

Contributor

MarkusFrankATcernch commented Aug 9, 2018

Hi Yana,
is there any new from the CMS experts how they patched the expression evaluator to accept the namespace-decorated names ?

@ianna

This comment has been minimized.

ianna commented Aug 9, 2018

Hi Markus,
We do a first pass to expand all expressions, then feed them to the evaluator on the second pass.

@MarkusFrankATcernch

This comment has been minimized.

Contributor

MarkusFrankATcernch commented Aug 10, 2018

Yana,
I think it is worth having a look at #433

Cheers,
Markus

@ianna

This comment has been minimized.

ianna commented Aug 14, 2018

@MarkusFrankATcernch - thanks, I'll check it.

@ianna

This comment has been minimized.

ianna commented Aug 14, 2018

Thanks, @MarkusFrankATcernch ! It's fixed.

@ianna ianna closed this Aug 14, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment