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

Add Truth plugins to fuse #99

Merged
merged 57 commits into from
Mar 4, 2024
Merged

Add Truth plugins to fuse #99

merged 57 commits into from
Mar 4, 2024

Conversation

HenningSE
Copy link
Collaborator

This PR will add truth output to fuse. The logic differs from the one used in WFSim so one has to be a bit careful with the interpretation of the output.

The code in the PR works as follows:

  • The cluster_id from the microphysics clustering will be propagated up to the propagated_photons level. For each photon, it is now possible to tell which cluster it came from.
  • The PMTResponseAndDAQ puts these photons into waveforms and splits the waveforms into raw_records. It will now save an additional output called contributing_clusters. This output contains the information which cluster contributed with how many photons to a given raw_record.
  • In the next step a new PeakTruth plugin evaluates which clusters contribute to a peak and calculates truth data for each peak. One of the provided columns is the observable_energy_truth (we can rename columns if needed), indicating how large the energy was that went into a certain peak. Some examples:
    • Let's assume there would be a cluster of 100 keV creating 100 S2 photons. If just 95 photons make it into a peak, the observable energy for this peak will be given as 95 keV.
    • If strax would split the S2 originating to this cluster in two peaks each with 50 photons, the observable energy for each peak would be listed as 50 keV.

@HenningSE
Copy link
Collaborator Author

The columns provided by PeakTruth are now:

  • s1_photon_number_truth: Number of S1 photons in the peak
  • s2_photon_number_truth: Number of S2 photons in the peak
  • ap_photon_number_truth: Number of PMT afterpulse 'photons' in the peak
  • raw_area_truth: Sum of the photon_gains for the peak decided by the channels PMT gain
  • observable_energy_truth: Energy associated to the peak. (see description and example above)
  • number_of_contributing_clusters: Number of clusters contributing to the peak
  • average_x_of_contributing_clusters: Weighted average of the contributing clusters x position. The weights are the number of photons in the peak from a certain cluster divided by the total number of photons in the peak.
  • average_y_of_contributing_clusters: See average_x_of_contributing_clusters, but for y
  • average_z_of_contributing_clusters: See average_x_of_contributing_clusters, but for z

If there are more columns needed as output for the truth plugin, please comment below.

@HenningSE HenningSE mentioned this pull request Jan 22, 2024
@HenningSE
Copy link
Collaborator Author

HenningSE commented Jan 22, 2024

These are the things that I want to add next:

  • Plugin that returns the clusters that do not make it into a peak
  • Example notebook explaining how to use the truth plugins

@HenningSE
Copy link
Collaborator Author

Right now the weighted x and y position in the PeakTruth plugin are computed from the "real" position in the TPC. We should add the observed positions as well to allow a better comparison with our PosRec output.

@HenningSE HenningSE marked this pull request as ready for review January 30, 2024 12:07
@HenningSE HenningSE marked this pull request as ready for review February 15, 2024 08:52
@HenningSE
Copy link
Collaborator Author

I will now bump the plugin versions & update the documentation. When merging this PR we should also bump the overall fuse version to 1.1.0.

@mhliu0001
Copy link
Contributor

@HenningSE In tagged clusters, can you also include how many S1/S2 photons created by a certain cluster are detected? Just by counting the propagated_photons, should be easy. Maybe call them photons_s1 and photons_s2?

@HenningSE
Copy link
Collaborator Author

@HenningSE In tagged clusters, can you also include how many S1/S2 photons created by a certain cluster are detected? Just by counting the propagated_photons, should be easy. Maybe call them photons_s1 and photons_s2?

We can use n_s1_photon_hits of the S1PhotonHits plugin and sum_s2_photons of the SecondaryScintillation plugin for these numbers or? They can be loaded together with the clusters.

@HenningSE HenningSE mentioned this pull request Feb 19, 2024
This was linked to issues Feb 27, 2024
@dachengx dachengx self-requested a review March 2, 2024 06:58
@ramirezdiego ramirezdiego merged commit 7c97473 into main Mar 4, 2024
3 checks passed
@ramirezdiego ramirezdiego deleted the truth_data branch March 4, 2024 16:44
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.

Add S2 tagging in fuse Truth Information
5 participants