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

Add hepmcmerger #647

Merged
merged 13 commits into from
Nov 5, 2024
Merged

Add hepmcmerger #647

merged 13 commits into from
Nov 5, 2024

Conversation

kkauder
Copy link
Contributor

@kkauder kkauder commented Jun 17, 2024

Briefly, what does this PR introduce?

Add a package for https://github.com/eic/HEPMC_Merger

What kind of change does this PR introduce?

  • Bug fix (issue #__)
  • New feature (issue #__)
  • Documentation update
  • Other: __

Please check if this PR fulfills the following:

  • Tests for the changes have been added
  • Documentation has been added / updated
  • Changes have been communicated to collaborators

Does this PR introduce breaking changes? What changes might users need to make to their code?

No

Does this PR change default behavior?

No

@kkauder kkauder requested a review from wdconinc June 17, 2024 18:18
@veprbl veprbl changed the title Addhepmcmerger Add hepmcmerger Jun 17, 2024
Copy link
Contributor

@wdconinc wdconinc left a comment

Choose a reason for hiding this comment

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

Did you test that this actually works? Maybe you didn't submit all changes to this PR since you define cmake_args without defining this package as a CMakePackage.

packages/hepmcmerger/package.py Outdated Show resolved Hide resolved
@kkauder
Copy link
Contributor Author

kkauder commented Jun 18, 2024

I couldn't test it, can you tell me how? This is something assembed from looking at existing packages but I'm flying blind

@wdconinc
Copy link
Contributor

I couldn't test it, can you tell me how? This is something assembed from looking at existing packages but I'm flying blind

You can do something like:

docker run --rm -it spack/ubuntu-noble:0.21.0
git clone https://github.com/eic/eic-spack
git -C eic-spack checkout <branch>
spack repo add eic-spack
spack install <pkg>

(This could have typos, on my phone.)

@kkauder
Copy link
Contributor Author

kkauder commented Jun 18, 2024

After chewing on this command for three hours, it just failed with the unrelated

 >> 9686    FAILED: tools/clang/lib/ASTMatchers/Dynamic/CMakeFiles/obj.clangDynamicASTMatchers.dir/Re
             gistry.cpp.o
     9687    /opt/spack/lib/spack/env/gcc/g++ -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_M

Is there anything else I can do?

@wdconinc
Copy link
Contributor

Is there anything else I can do?

Not in this PR, apparently. Can you copy the full error message (with more than 'FAILED') and file it on spack?

@wdconinc
Copy link
Contributor

Is there anything else I can do?

Not in this PR, apparently. Can you copy the full error message (with more than 'FAILED') and file it on spack?

And tag me in the issue on spack.

@kkauder
Copy link
Contributor Author

kkauder commented Jun 25, 2024

I undid the f-string. It didn't work and this syntax is literally the same throughout the repo according to grep -r DCMAKE_CXX_STANDARD

@wdconinc
Copy link
Contributor

Use single quotes inside the f-string arguments.

@wdconinc
Copy link
Contributor

See last two examples in https://peps.python.org/pep-0498/#escape-sequences for correct f-string syntax.

@kkauder
Copy link
Contributor Author

kkauder commented Jun 25, 2024

Thanks for all the help, @wdconinc ! Is the fact that the checks pass good enough to try including it in eic-shell?

@wdconinc
Copy link
Contributor

Not at all. The checks don't do anything ;-)

Copy link
Contributor

@wdconinc wdconinc left a comment

Choose a reason for hiding this comment

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

Works

$ SignalBackgroundMerger 
==================================================================
=== EPIC HEPMC MERGER ===
authors: Benjamen Sterwerf* ([email protected]), Kolja Kauder** ([email protected]), Reynier Cruz-Torres***
* University of California, Berkeley
** Brookhaven National Laboratory
*** formerly Lawrence Berkeley National Laboratory

For more information, run 
./signal_background_merger --help
Number of Slices:10000
Signal events file and frequency:
        - root://dtn-eic.jlab.org//work/eic2/EPIC/EVGEN/SIDIS/pythia6-eic/1.0.0/10x100/q2_0to1/pythia_ep_noradcor_10x100_q2_0.000000001_1.0_run1.ab.hepmc3.tree.root    (one event per time slice)

Background files and their respective frequencies:
        - root://dtn-eic.jlab.org//work/eic2/EPIC/EVGEN/BACKGROUNDS/BEAMGAS/proton/pythia8.306-1.0/100GeV/pythia8.306-1.0_ProtonBeamGas_100GeV_run082.hepmc3.tree.root  31.900000 kHz
        - root://dtn-eic.jlab.org//work/eic2/EPIC/EVGEN/BACKGROUNDS/BEAMGAS/electron/beam_gas_ep_10GeV_foam_emin10keV_30Mevt.hepmc3.tree.root   3177.250000 kHz
Writing to bgmerged.hepmc3.tree.root
Prepping root://dtn-eic.jlab.org//work/eic2/EPIC/EVGEN/SIDIS/pythia6-eic/1.0.0/10x100/q2_0to1/pythia_ep_noradcor_10x100_q2_0.000000001_1.0_run1.ab.hepmc3.tree.root
Prepping root://dtn-eic.jlab.org//work/eic2/EPIC/EVGEN/BACKGROUNDS/BEAMGAS/proton/pythia8.306-1.0/100GeV/pythia8.306-1.0_ProtonBeamGas_100GeV_run082.hepmc3.tree.root
Prepping root://dtn-eic.jlab.org//work/eic2/EPIC/EVGEN/BACKGROUNDS/BEAMGAS/electron/beam_gas_ep_10GeV_foam_emin10keV_30Mevt.hepmc3.tree.root
Initiation time: 8 sec

==================================================================

Working on slice 1
Current memory usage: 366 MB
Working on slice 101
Current memory usage: 399 MB
Working on slice 201
Current memory usage: 456 MB
<snip>
Current memory usage: 486 MB
Working on slice 9801
Current memory usage: 486 MB
Working on slice 9901
Current memory usage: 486 MB
Finished all requested slices.
Slice loop time: 0 min
 -- 1919 us / slice
From root://dtn-eic.jlab.org//work/eic2/EPIC/EVGEN/BACKGROUNDS/BEAMGAS/electron/beam_gas_ep_10GeV_foam_emin10keV_30Mevt.hepmc3.tree.root
  placed 63568 events
  --> on average 6
  placed 127136 final state particles
  --> on average 12
From root://dtn-eic.jlab.org//work/eic2/EPIC/EVGEN/BACKGROUNDS/BEAMGAS/proton/pythia8.306-1.0/100GeV/pythia8.306-1.0_ProtonBeamGas_100GeV_run082.hepmc3.tree.root
  placed 655 events
  --> on average 0
  placed 8816 final state particles
  --> on average 0
From root://dtn-eic.jlab.org//work/eic2/EPIC/EVGEN/SIDIS/pythia6-eic/1.0.0/10x100/q2_0to1/pythia_ep_noradcor_10x100_q2_0.000000001_1.0_run1.ab.hepmc3.tree.root
  placed 10000 events
  --> on average 1
  placed 133302 final state particles
  --> on average 13

Maximum Resident Memory 486.938 MB

==================================================================
Overall running time: 0 min

@wdconinc wdconinc merged commit dbb5442 into develop Nov 5, 2024
1 of 2 checks passed
@wdconinc wdconinc deleted the addhepmcmerger branch November 5, 2024 20:29
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