-
Notifications
You must be signed in to change notification settings - Fork 73
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
Event mixer #808
base: master
Are you sure you want to change the base?
Event mixer #808
Conversation
About the get_nevents_from_db function in mixer.py:
my recommendations:
|
As we talked offline, I renamed the function, added an explanatory comment and implemented keyword defaults. Also, as we decided, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The documentaion of Event_Mixer class is now clear and helps to follow the flow of the instance when running. Nevertheless, it is good to clarify i) what are the columns/labels of the DF that the get_mixer_events function returns, ii) the procedure of the _get_component_data method, indicating that the nevts decreases when the correspondent number of events per file is written in the output. That is that nevts is a dynamic variable that indicate sin every-moment the number of events still to write out. If I am correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In Event_Mixer, the way the indices of the input data files (stores in maps) and how the are accessed in _get_component_data are obscure, please document how this works better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test functions are file in mixer_text.py, but again, please comment what is testing each one!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the PR is in good state, ready for my approval, but please add the comments indicated before!
There are still some issues, I guess, pending: i) shuffle the index of the output-files ii) to generate nevents of each sample via Poisson. I guess both can be added in this pull-request, otherwise, indicate why not.
I have resolved the comments (except the shuffling which we can maybe avoid as talked offline), plus some additions:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In Computing the 2nubb events, you are hardwaring 100 kg for the mass of 'NEXT-100', but the final kg should be a parameters of a value in the DB. Discuss it with @msorel!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The verbosity configuration parameters is a must!
I think the new commits improve the PR and solve the comments about better documenting the code. The issue of the 100 kg mass hardware, could led to confusions later, unless it is clear and documented, that the mass will be consider always for NEXT-100 as 100 kg! When this issues is solved, I think the PR is ready for approval! |
Yes, even with fixed detector geometry, mass will depend on average pressure/temperature of the run, which we do not know now. Detector mass must be a configuration parameter. Same for enrichment factor, I think now hard-coded to one. We will have at least two values, one for depleted and one for enriched xenon, so this is probably another configurable parameter (or a choice from a list of options; probably best a config parameter?). Final comment on this issue of computing bb2nu events. You now assume K-Zen's latest central value. However, EXO-200 value still has smaller errors, so I would probably go with 2.165e21 yr instead, as we did for bb2nu sensitivity studies for NEXT-White paper. The other option is to do a weighted average between EXO and K-Zen, but probably not worth it. Reference for EXO-200 paper: Phys.Rev. C 89 (2014) 1, 015502. Sorry for not commenting on the rest of this pull request. But from what @jahernando says, this is pretty much ready to go: great! Thanks a lot for the work. |
ce38056
to
36ed978
Compare
2258fec
to
e2e8f28
Compare
This PR adds a Event Mixer implementation. This PR requires #807 to be merged since it uses newer
pandas
functionality.The Event Mixer is the program that reads MC events from different detector volume and isotope (component) and selects the number of events for each component based on the activity-assumptions and desired exposure.
The isotopes can be background like (Bi214, Tl208, Co60, K40) or signal like (0nubb, 2nubb).
The Event Mixer reads high level isaura files, selects the events and writes them in same isaura-like files.
The Event Mixer configuration parameters are obtained in the
mixer.conf
file, and the program is called similarly as IC cities, such that:event_mixer /path/to/conf/mixer.conf
. The user must name the input and output files as described in the config file.The
event_mixer
script is divided in several parts, which allows unit testing:The most important part is carried out in point 3 by the
Event_Mixer
class. The class computes the number of output files based on the total number of events and number of events per file (being the latter a config parameter). Then it creates an event counter to keep track of the events that are saved. Each output file will contain events for each MC component based on proportionality.Since each MC component (g4volume, isotope) are processed separately,
event
label might be repeated. Then the output files also save the MC component label as new columns in the dsts. Besides this information is required to do MC analysis (background fits). The file number is also saved inRun/events
if lower level data consults are required.