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

Using constants in XML files #20

Merged
merged 8 commits into from
Sep 27, 2017
Merged

Using constants in XML files #20

merged 8 commits into from
Sep 27, 2017

Conversation

rete
Copy link
Contributor

@rete rete commented Sep 25, 2017

BEGINRELEASENOTES

  • Added a constants section in XMLParser parsing :
    • Allows to write constants and refer to in processor parameter values and global parameter values
    • Makes use of ${constantName} to refer to a constant
    • Use command line argument to override a constant
    • example:
  <constants>
    <constant name="MCParticleCollection" value="MCParticle"/>
    <constant name="FilePath" value="../../test/testmarlin"/>
    <constant name="InputFile" value="${FilePath}/simjob.slcio"/>
  </constants>
Marlin --constant.InputFile=aDifferentFile.slcio  marlin.xml

ENDRELEASENOTES

This has been tested with the test processor in the examples/mymarlin directory as for #19 .
Test it with this file : marlin.txt (rename it with .xml extension)

# from Marlin root dir :
cd examples/mymarlin/
mkdir build
cd build
cmake -C $ILCSOFT/ILCSoft.cmake .. && make install
cd ..
Marlin marlin.xml

@gaede
Copy link
Contributor

gaede commented Sep 26, 2017

Remi, can you add command line overwrite for the constants to this PR as well ?
Syntax should be the same as for the parameters: --constant.constanName=Value.

@rete
Copy link
Contributor Author

rete commented Sep 26, 2017

@gaede : Should have I to add also the feature with environment variables we talked about ?
If not, I'm done with this PR

@rete
Copy link
Contributor Author

rete commented Sep 26, 2017

I also added a cmake test to test this feature, plus the recent include mechanism from #19

…ng exception throw when constant not found while replacing processor parameter
@gaede gaede changed the title [WIP] Using constants in XML files Using constants in XML files Sep 26, 2017
@gaede gaede merged commit 67c47ce into iLCSoft:master Sep 27, 2017
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.

2 participants