Skip to content

Make all paths relative#95

Draft
Zehvogel wants to merge 3 commits into
key4hep:mainfrom
Zehvogel:relative-paths
Draft

Make all paths relative#95
Zehvogel wants to merge 3 commits into
key4hep:mainfrom
Zehvogel:relative-paths

Conversation

@Zehvogel
Copy link
Copy Markdown
Collaborator

@Zehvogel Zehvogel commented May 21, 2026

BEGINRELEASENOTES

ENDRELEASENOTES

passes all our tests, but when you try to actually run the reconstruction from a different directory, it fails because of

<HistogramFile>PandoraSettingsCLD/PandoraLikelihoodData9EBin.xml</HistogramFile>

Handling this without creating a new file every time would need an extension of Pandora and its API to offer a copy of Pandora::ReadSettings that takes the XML as a string directly. Then we could dynamically rewrite the path from our side.


MyDDMarlinPandora.Parameters |= {
"PandoraSettingsXmlFile": ["PandoraSettingsCLD/PandoraSettingsDefault.xml"],
"PandoraSettingsXmlFile": [f"{dir_path}/../PandoraSettingsCLD/PandoraSettingsDefault.xml"],
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we do something even better, check in Python if this exists and fail otherwise? Countless of times I start running only to see that it fails when initializing Pandora, which is not too late but still

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great idea! We could already add a helpful error message now, I might add it tomorrow if I remember.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Countless of times I start running only to see that it fails when initializing Pandora, which is not too late but still

I tried, but how do you even get to that point? If I run it from somewhere else it already fails at the py_utils import...

I could change this PR to include the warning for Pandora, then stuff like tracking only should be runnable from anywhere and only when Pandora is needed it will warn.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make CLDReconstruction.py runnable from other directories

2 participants