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

PWGUD Starlight interface #1663

Merged
merged 5 commits into from
Jun 25, 2024
Merged

PWGUD Starlight interface #1663

merged 5 commits into from
Jun 25, 2024

Conversation

mbroz84
Copy link
Contributor

@mbroz84 mbroz84 commented Jun 11, 2024

Interface to STARlight generator that is used by UPC PAG. Some processes are eventually decayed by EvtGen that is interfaced in DQ, we use our own decay tables to avoid any conflict. Configuration .ini file is created by python script.
There are two issues that needs to be fixed before merging this PR:

  1. STARlight 'as is' create only static library. I didn't manage to make it work that way so I changed the Cmake to make shared one in order to develop this. Is there any trick how to use static library (.a) in O2DPG?
  2. STARlight uses #define printInfo .... that is in conflict with member methods with the same name in Pythia etc. Locally I changed the name of the preprocessor macro to avoid this. Is there any other trick to do this?

Then in the alidist we would need to define $STARLIGHT_ROOT variable and add it to PATH and LD_LIBRARY_PATH.

Copy link

REQUEST FOR PRODUCTION RELEASES:
To request your PR to be included in production software, please add the corresponding labels called "async-" to your PR. Add the labels directly (if you have the permissions) or add a comment of the form (note that labels are separated by a ",")

+async-label <label1>, <label2>, !<label3> ...

This will add <label1> and <label2> and removes <label3>.

The following labels are available
async-2022-pp-apass4
async-2023-pbpb-apass3
async-2023-pbpb-apass4
async-2022-pp-apass6-2023-PbPb-apass2
async-2022-pp-apass4-accepted
async-2022-pp-apass6-2023-PbPb-apass2-accepted
async-2023-pbpb-apass3-accepted
async-2023-pbpb-apass4-accepted
async-2023-pp-apass4
async-2023-pp-apass4-accepted
async-2024-pp-apass1
async-2022-pp-apass7
async-2024-pp-cpass0
async-2024-pp-cpass0-accepted
async-2022-pp-apass7-accepted
async-2024-pp-apass1-accepted

@sawenzel
Copy link
Contributor

@mbroz84 : Interesting development. So you intend to use Starlight as a library and not in HepMC mode?

We need to do the changes in alidist and to Starlight that you have already laied out. No way to use a static lib. I can take care of changes to Starlight + alidist but I would need a testing shell script on your side (an invocation of the generator using an actual ini file). This is anyways required to test your generator setup in the CI (@benedikt-voelkel can give more details).

@mbroz84
Copy link
Contributor Author

mbroz84 commented Jun 13, 2024

Hi, yes we want to STARlight as a library, its more practical and allow simple connection with EvtGen that we used also before in AliRoot. Concerning the script: you mean something like MC/run/PWG... ?

@sawenzel
Copy link
Contributor

Hi, yes we want to STARlight as a library, its more practical and allow simple connection with EvtGen that we used also before in AliRoot. Concerning the script: you mean something like MC/run/PWG... ?

Yes, something of the sort (before comitting, you could send me an example so that I have something to test)

@mbroz84
Copy link
Contributor Author

mbroz84 commented Jun 13, 2024

Hi, yes we want to STARlight as a library, its more practical and allow simple connection with EvtGen that we used also before in AliRoot. Concerning the script: you mean something like MC/run/PWG... ?

Yes, something of the sort (before comitting, you could send me an example so that I have something to test)

Attached is a script that creates the config and runs generator via o2-sim

runGenStarlight.txt

sawenzel added a commit to sawenzel/alidist that referenced this pull request Jun 14, 2024
* build STARlight as a shared library
* fix the installed header files, so that they can
  be included in ROOT macros without symbol shadowing
  (STARlight defines global C++ macro names
   such as `printInfo` which conflict with similar names
   in other packages)

With this commit, it will be possible to use the STARlight system
directly in event generation.

See for instance: AliceO2Group/O2DPG#1663
sawenzel added a commit to sawenzel/alidist that referenced this pull request Jun 14, 2024
* build STARlight as a shared library
* fix the installed header files, so that they can
  be included in ROOT macros without symbol shadowing
  (STARlight defines global C++ macro names
   such as `printInfo` which conflict with similar names
   in other packages)

With this commit, it will be possible to use the STARlight system
directly in event generation.

See for instance: AliceO2Group/O2DPG#1663
sawenzel added a commit to sawenzel/alidist that referenced this pull request Jun 14, 2024
* build STARlight as a shared library
* fix the installed header files, so that they can
  be included in ROOT macros without symbol shadowing
  (STARlight defines global C++ macro names
   such as `printInfo` which conflict with similar names
   in other packages)

With this commit, it will be possible to use the STARlight system
directly in event generation.

See for instance: AliceO2Group/O2DPG#1663
@sawenzel
Copy link
Contributor

In principle everything is prepared. I asked for PRs to STARlight + alidist as described in the ticket https://its.cern.ch/jira/browse/O2-5076. Let's hope the STARlight team reacts quickly.

Copy link
Contributor

@benedikt-voelkel benedikt-voelkel left a comment

Choose a reason for hiding this comment

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

Approve to run CI

sawenzel added a commit to alisw/alidist that referenced this pull request Jun 17, 2024
* build STARlight as a shared library
* fix the installed header files, so that they can
  be included in ROOT macros without symbol shadowing
  (STARlight defines global C++ macro names
   such as `printInfo` which conflict with similar names
   in other packages)

With this commit, it will be possible to use the STARlight system
directly in event generation.

See for instance: AliceO2Group/O2DPG#1663
@benedikt-voelkel
Copy link
Contributor

Hello @mbroz84
the basic CI goes through already.
Now, could I ask you to write an ini file (like e.g. LF has done here https://github.com/AliceO2Group/O2DPG/tree/master/MC/config/PWGLF/ini) and also put the corresponding test of that ini file like done https://github.com/AliceO2Group/O2DPG/tree/master/MC/config/PWGLF/ini/tests ?

In that way, the ini will be picked up for testing.
It's about very basic tests so that in a test script you can check if your generator does in principle what you expect it to do.

Let me know if you have further questions in that direction.

Some documentation is here: https://aliceo2group.github.io/simulation/docs/generators/generatorconfig.html#generator-tests

@mbroz84
Copy link
Contributor Author

mbroz84 commented Jun 19, 2024

Hello @benedikt-voelkel I added two tests, one for STARlight alone and one for STARlight -> EvtGen

@mbroz84
Copy link
Contributor Author

mbroz84 commented Jun 20, 2024

I don't get it... How I'm supposed to load the STARlight library? Apparently none of the two
R__LOAD_LIBRARY(libStarlib)
R__LOAD_LIBRARY($STARlight_ROOT/lib64/libStarlib.so)
works in CI tests even when the second works for me locally (with up-to-date alidist).

@sawenzel
Copy link
Contributor

I don't get it... How I'm supposed to load the STARlight library? Apparently none of the two R__LOAD_LIBRARY(libStarlib) R__LOAD_LIBRARY($STARlight_ROOT/lib64/libStarlib.so) works in CI tests even when the second works for me locally (with up-to-date alidist).

We'll look into it.

@benedikt-voelkel
Copy link
Contributor

I tested locally and both with O2sim and O2PDPSuite environment and I can confirm @mbroz84 observation that both cases pass.
From my point of view, we can merge this PR now. @sawenzel what do you think?

In the CI, the O2sim env should be loaded, so at this point, maybe there is some older cached version loaded for the CI test. Need to check.

@sawenzel
Copy link
Contributor

Works for me in the combination

R__LOAD_LIBRARY(libStarlib.so)
R__ADD_INCLUDE_PATH($STARlight_ROOT/include)

@mbroz84
Copy link
Contributor Author

mbroz84 commented Jun 20, 2024

For me locally (o2-sim environment) works only the second option (with full path) because in the LD_LIBRARY_PATH I see /home/brozmic3/alice/sw/slc7_x86-64/STARlight/20240617-local1/lib when the real one is with lib64

@sawenzel
Copy link
Contributor

sawenzel commented Jun 21, 2024

The issue should be fixed by alisw/alidist#5514. Please just use

R__LOAD_LIBRARY(libStarlib.so)
R__ADD_INCLUDE_PATH($STARlight_ROOT/include)

It is better to avoid too many hard-coded paths

@sawenzel sawenzel merged commit f79426f into AliceO2Group:master Jun 25, 2024
5 of 6 checks passed
@mbroz84
Copy link
Contributor Author

mbroz84 commented Sep 2, 2024

+async-label async-2023-pbpb-apass4

@github-actions github-actions bot added the async-2023-pbpb-apass4 Request porting to async-2023-pbpb-apass4 label Sep 2, 2024
chiarazampolli pushed a commit that referenced this pull request Sep 6, 2024
* PWGUD Starlight interface

(cherry picked from commit f79426f)
chiarazampolli pushed a commit to alisw/alidist that referenced this pull request Sep 6, 2024
* build STARlight as a shared library
* fix the installed header files, so that they can
  be included in ROOT macros without symbol shadowing
  (STARlight defines global C++ macro names
   such as `printInfo` which conflict with similar names
   in other packages)

With this commit, it will be possible to use the STARlight system
directly in event generation.

See for instance: AliceO2Group/O2DPG#1663

(cherry picked from commit d2b3ebd)
@chiarazampolli chiarazampolli removed the async-2023-pbpb-apass4 Request porting to async-2023-pbpb-apass4 label Sep 6, 2024
@chiarazampolli
Copy link
Collaborator

Ported to async-v1-01-18, label removed.

MichaelLettrich pushed a commit to MichaelLettrich/alidist that referenced this pull request Oct 3, 2024
* build STARlight as a shared library
* fix the installed header files, so that they can
  be included in ROOT macros without symbol shadowing
  (STARlight defines global C++ macro names
   such as `printInfo` which conflict with similar names
   in other packages)

With this commit, it will be possible to use the STARlight system
directly in event generation.

See for instance: AliceO2Group/O2DPG#1663
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.

4 participants