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

feat: integrate background merger #26

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Conversation

wdconinc
Copy link
Contributor

@wdconinc wdconinc commented Nov 6, 2024

Briefly, what does this PR introduce?

This injects the background merging into the simulation chain.

@wdconinc wdconinc marked this pull request as draft November 6, 2024 16:44
@wdconinc wdconinc requested review from veprbl and rahmans1 November 6, 2024 16:45
@wdconinc
Copy link
Contributor Author

wdconinc commented Nov 6, 2024

@veprbl @rahmans1 Consider this a minimum viable product, but unsatisfactory without changes to background merger:

  • each file segment will be merged with the same background events, and we can't use the number of events we skip since that doesn't map 1:1 on the background events,
  • all backgrounds have to be provided; would prefer this was done automatically based on EBEAMxPBEAM,
  • background frequencies are relative to signal frequencies; would prefer to have this be drawn from input weights and cross sections.

@wdconinc
Copy link
Contributor Author

wdconinc commented Nov 6, 2024

Tested with e.g.

./scripts/run.sh EVGEN/SIDIS/pythia6-eic/1.0.0/10x100/q2_0to1/pythia_ep_noradcor_10x100_q2_0.000000001_1.0_run1.ab.hepmc3.tree.root 1000 2

@wdconinc
Copy link
Contributor Author

wdconinc commented Nov 6, 2024

Or with e.g.

BG1_FREQ=1000 BG1_FILE=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 ./scripts/run.sh EVGEN/SIDIS/pythia6-eic/1.0.0/10x100/q2_0to1/pythia_ep_noradcor_10x100_q2_0.000000001_1.0_run1.ab.hepmc3.tree.root 1000 2

@veprbl
Copy link
Member

veprbl commented Nov 6, 2024

This is already quite satisfactory. We just need to figure out options presets and file naming to start using this.

@veprbl @rahmans1 Consider this a minimum viable product, but unsatisfactory without changes to background merger:

* each file segment will be merged with the same background events, and we can't use the number of events we skip since that doesn't map 1:1 on the background events,

We can have another intermediate file before merging in which we cutout the subset of signal events using abconv, that would make things consistent to the simulation without backgrounds. For background events, I agree, we should add an option to adjust position in the loop.

* all backgrounds have to be provided; would prefer this was done automatically based on EBEAMxPBEAM,

👍

* background frequencies are relative to signal frequencies; would prefer to have this be drawn from input weights and cross sections.

Signal frequency can be calculated from cross section and luminosity. For the first campaigns, it doesn't make sense to use signal frequency mode. The default mode is for one signal event to come at t=0, and that's what we should do because the current version of the EICrecon expects it that way (there are cuts on time). That mode invalidates first part of the statement, because the frequencies, by construction, are only relative to the integration window.

@wdconinc
Copy link
Contributor Author

wdconinc commented Nov 6, 2024

* each file segment will be merged with the same background events, and we can't use the number of events we skip since that doesn't map 1:1 on the background events,

We can have another intermediate file before merging in which we cutout the subset of signal events using abconv, that would make things consistent to the simulation without backgrounds. For background events, I agree, we should add an option to adjust position in the loop.

I think we can also just pick random events from the input background files. Not sure how inefficient it would compared to consecutive, but it would remove the whole skipping aspect.

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