Skip to content
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

Always initialize DD4hep geometry in your Marlin analysis #15

Closed
rete opened this issue Aug 16, 2018 · 0 comments
Closed

Always initialize DD4hep geometry in your Marlin analysis #15

rete opened this issue Aug 16, 2018 · 0 comments
Labels
ILDProdIssues Known issues related to ILD MC mass production Reconstruction Issues related to reconstruction

Comments

@rete
Copy link
Contributor

rete commented Aug 16, 2018

Description

  • Samples: all
  • Benchmark analysis: all
  • ILCSoft version: v02-00-01

If you try to run your analysis processor without initializing the geometry before any processor, you won't get any exception with ILCSoft v02-00-01. But it doesn't mean that everything ran correctly. Some processors may need information from the detector geometry, such as the B field. If you try to run the same processors with ILCSoft > v02-00-01, you will get exceptions if you try to access geometry information. Example message when trying to access the B field in this case:

 ***********************************************
 A runtime error occured - (uncaught exception):
      Detector geometry not initialised, cannot get bfield
 Marlin will have to be terminated, sorry.
 ***********************************************

This is due to a change in the DD4hep (version > v01-07-02) and MarlinUtil (version > v01-15) versions, where exceptions are now thrown if the you try to access geometry information but have not initialized it.

Known fix / solution

In order to avoid/fix this problem, always initialize the DD4hep geometry before running any other processor. In your Marlin steering file add this:

<execute>
   <processor name="InitDD4hep"/>
   <!-- Your processors there -->
</execute>
<processor name="InitDD4hep" type="InitializeDD4hep">
    <!--InitializeDD4hep reads a compact xml file and initializes the DD4hep::LCDD object-->
    <!--Name of the DD4hep compact xml file to load-->
    <parameter name="DD4hepXMLFile" type="string"> compact.xml </parameter>
</processor>

and replace compact.xml by the compact geometry file. You can find the detector model in your slcio file by using the dumpevent command on any event like:

dumpevent some_file.slcio 1 | less

and get it from the head:

============================================================================
        Event  : 0 - run:  108598 - timestamp 0 - weight 1
============================================================================
 date:      01.01.1970  00:00:00.000000000
 detector : ILD_l5_v02
 event parameters: 
 parameter BeamPDG0 [int]: 11,
...

The corresponding compact file can be thus found in $lcgeo_DIR/ILD/compact/ILD_l5_v02/ILD_l5_v02.xml in this case.

See also

@rete rete added the ILDProdIssues Known issues related to ILD MC mass production label Aug 16, 2018
@rete rete closed this as completed Aug 16, 2018
@rete rete added the Reconstruction Issues related to reconstruction label Aug 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ILDProdIssues Known issues related to ILD MC mass production Reconstruction Issues related to reconstruction
Projects
None yet
Development

No branches or pull requests

1 participant