Repository navigation
Add EIC bunch structure for beam-related inputs - #106
johnlajoie wants to merge 17 commits into
Conversation
|
To do:
|
simonge
left a comment
There was a problem hiding this comment.
Thanks for this John, generally looks ok but I want to have a think about whether there is a neater/more generalizable way of achieving this.
| if (!config.already_merged) { | ||
|
|
||
| // Constrain to a valid bunch crossing | ||
| if(config.use_bunch_crossing || config.attach_to_beam){ |
There was a problem hiding this comment.
Should only need use_bunch_crossing here as attach_to_beam is only used to offset after use_bunch_crossing has been applied. Or that's the only way it makes sense but isn't currently the approach.
There was a problem hiding this comment.
I may have a misapprehension/interpretation here. From our email communication I interpreted use_bunch_crossing as being for collision sources, the timing of which needs to be handled carefully to avoid destroying the correlations in the event generator (via the abconv aftreburner). The attach_to_beam was for single beam sources of background, which don't have the same relationship within a beam crossing that collisions do. As I am thinking about it the two are mutually exclusive.
There was a problem hiding this comment.
This will need to be scaled by the (populated-empty)/total bunch crossings in the timeframe.
There was a problem hiding this comment.
I don't think so - not if the rates are calculated as I expect (integrated over the fill pattern). That's certainly true for collisions, but needs to be verified for the backgrounds.
There was a problem hiding this comment.
I believe at the moment, filling a 2us timeframe where 1us of the frame is beam stop will just squash the expected events for 200 bunch crossings into the remaining 100, artificially doubling the backgrounds. I may have missed something.
There was a problem hiding this comment.
Hmm. I see your point. I keep thinking about full timeframes that average over a large number of revolutions, but for what we do in simulations (which I call "tracking frames", is that a thing?) I agree that this would over-populate the filled crossings as it stands now.
Let me think about this more, you may be right about the correction.
There was a problem hiding this comment.
Yeah I think you're right.
There was a problem hiding this comment.
I think this scaling factor needs to be in the mean of the initial sampled Poisson distribution rather than scaling afterwards. Here we will be rounding to integers twice so will end up under sampling backgrounds. The calculation of the livetime would probably have to come in somewhere here:
TimeframeBuilder/src/TimeframeBuilder.cc
Line 37 in 7cc2522
live_fraction as size_t rather than float at the moment will also either be 0 or 1 rather than scaling.
There might need to be a bit more of a structural rethink to better allow more generalized time dependant sampling but probably worth bashing ahead with this for now
Oh I'm sure there's a much neater way to do this than I did it. :-) One nice thing would be to be able to access the global config like you do the source config, instead of passing long parameter lists around. But that should probably be a separate pull request. |
Briefly, what does this PR introduce? Please link to any relevant presentations or discussions.
What is the urgency of this PR?
What kind of change does this PR introduce?
Please check if any of the following apply
This PR adds the EIC bunch structure, including the abort gap, to the output stream for beam-related streams that are merged into the timeframe. It is fully configurable, but in particular can handle both the low-energy electron fill pattern for 5-10 GeV (1160 bunches filled) as well as the 18 GeV electron pattern (290 bunches filled, one every four crossings).
These changes are particularly important, for example, for the 18 GeV configuration with every fourth bunch filled. Before the background and events were spread out over the timeframe, but with these modifications they are concentrated in filled beam crossings.