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

Feature/mdolce muon efficiency #154

Merged
merged 27 commits into from
Sep 30, 2024
Merged

Feature/mdolce muon efficiency #154

merged 27 commits into from
Sep 30, 2024

Conversation

mdolce8
Copy link
Member

@mdolce8 mdolce8 commented Sep 12, 2024

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). This

The 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 using uproot. 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.

dune-tms_sd_eff_vs_mu_true_ke_lar_ke

plot_multiple_truth_efficiencies_muon_tms

…stance script reshape to plot the efficiency (and will try to clean up in the process)....
…'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.
… get a divide by zero error: just set denominator to 1 in that case.
…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.
…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.
…he S.D. efficiency ROOT files and using uproot plot them all in a single axis.
@mdolce8 mdolce8 requested a review from LiamOS September 12, 2024 23:29
@mdolce8 mdolce8 added the enhancement New feature or request label Sep 12, 2024
Copy link
Member

@LiamOS LiamOS left a 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. 👍

@mdolce8 mdolce8 merged commit 96d9c4f into main Sep 30, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants