-
Notifications
You must be signed in to change notification settings - Fork 2
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
Feature/mdolce muon efficiency #154
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…stance script reshape to plot the efficiency (and will try to clean up in the process)....
…ates, so shouldn't include them
…'ll use to keep tallies of S.D. and bin numbers to fill the hists.
…ng (100 MeV bins), use this to determine the bin number via the KE -- get_muon_ke_index(). Moved to using dictionaries (key=bin number, value=[SD>0, SD<0, SD=0]) to record the counts of the S.D. Then we increment the number based on S.D. value (whichever index). Also cut out three separate if statements for the regions. Addressing that would be a good todo...
…at 0, but we want the bin number count to start at 1 (because bin 0 is the underflow).
…values of KEs from Truth_Info of tmsreco.root files (especially from the April files). So let's just ignore them, add them up, and print them out at the end.
…e third index [0,0,0] for S.D. = 0
… get a divide by zero error: just set denominator to 1 in that case.
…d: last bin + width.
…d: last bin + width. typo
…ex string, can we separate, them?
…tail: this loop allows both [13, -13]. Need separate containers for muons and amuons, only. This should fix the flat ~50% efficiency. And make the denominator 'inf' if no events.
…here returns inf as the bin content when i wanted ti for the number of events. so just return 0.
…es are still less than expected.
…s opposite in region 2 bc B field is opposite :-(.Have to add more code to account for this, unfortunately.
…ts have z-component of momentum of 0. We need this info to get S.D. se we skip them. Check it once var is defined and not within the loop.
…ove the print statements for debugging.
… would be good to have for future.
…he S.D. efficiency ROOT files and using uproot plot them all in a single axis.
LiamOS
approved these changes
Sep 30, 2024
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.
Sorry for leaving this floating for so long. Two new files that nothing else depends on so am happy to approve. 👍
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was interest in seeing what the truth efficiencies are for the True Signed Distance distributions for differing magnetic fields. These two scripts do that; the scripts to create the Efficiency vs. Muon KE plots for muons (and mu+) for different B fields.
The first script,
sign_distance_efficiency_vs_muon_true_ke.py
creates reads in a TMS Reco file and actually does the "calculation". The output is a ROOT file and pngs and pdfs (see first image below, of red and blue hists). ThisThe second script
plot_multiple_truth_signed_distances.py
doesn't do any "work". It reads in the ROOT files made from the above script and plots them on the same axis usinguproot
. The result is a single plot of efficiencies for different B fields. So in the case here, TMS Reco files were read in for 0 T, 1 T, and 2 T fields. The output of this script is the second plot below with three curves on it.This was presented at the Santa Fe meeting.