Skip to content

Conversation

@asanchezcastillo
Copy link
Contributor

@asanchezcastillo asanchezcastillo commented Nov 19, 2025

Description

This PR aims at providing a realistic PMT MC simulation at the detsim stage. In particular it modifies the following items:

  • PMT response simulation: with this PR the response of each PMT is simulated independently using a SER retrieved from the calibration database.
  • PMT noise simulation: with this PR the simulated noise for each PMT is randomly sampled from a file containing 1000 noise templates for each PMT.
  • PMT Gain Fluctuation: this PR introduces a new tool PMTGaussianGainFluctuation_tool.cc that allows simulating a different gaussian gain fluctuation for each PMT.
  • PMT Non-linearities: this PR introduces a new tool PMTNonLinearityTF1ChannelByChannel_tool.cc that allows simulating pmt non-linearity on a channel by channel basis.
  • PMT Pulse Oscillation: this PR introduces a new module PMTPulseOscillation_module.cc that reproduces the low-frequency oscillations that have been observed after large-amplitude signals. More information here ().
  • PMT Detection Efficiency: this PR modifies the PMT detection efficiencies to improve the data/MC agreement.

This PR does all the mentioned changes to the standard simulation workflow. It does also refactor the PMT-related fcl configuration files so there is only one single configuration file that contains ideal MC, realistic MC and data configurations.

$${\color{red}!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!}$$

$${\color{red}\bf{\textrm{IMPORTANT UPDATE June 22nd 2025:}}}$$ If you are making a PR which is intended as a patch for the CURRENT production (which started in Spring 2025), you must make two PRs: one for develop and one for the production/v10_06_00 branch.

$${\color{red}!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!}$$

Checklist

  • Added at least 1 label from available labels.
  • Assigned at least 1 reviewer under Reviewers,
  • Assigned all contributers including yourself under Assignees
  • Linked any relevant issues under Developement
  • Does this PR affect CAF data format? If so, please assign a CAF maintainer (PetrilloAtWork or JosiePaton) as additional reviewer.
  • Does this affect the standard workflow?
  • Is this PR a patch for the ongoing production? If so, separate PR must also be made for production/v10_06_00 branch!

Relevant PR links (optional)

Does this PR require merging another PR in a different repository (such as sbnanobj/sbnobj etc.)?
This PR requires merging
#863
SBNSoftware/sbnd_data#4

Link(s) to docdb describing changes (optional)

Most of the changes are described here https://sbn-docdb.fnal.gov/cgi-bin/sso/ShowDocument?docid=43468

@asanchezcastillo asanchezcastillo self-assigned this Nov 19, 2025
@asanchezcastillo asanchezcastillo added the detsim Detector simulation label Nov 19, 2025
@linyan-w linyan-w moved this to Expected for validation II in SBND 2025 Fall Production Nov 19, 2025
@asanchezcastillo asanchezcastillo marked this pull request as ready for review November 19, 2025 19:22
@lynnt20
Copy link
Contributor

lynnt20 commented Nov 21, 2025

Yeah agreed, I'd like to wait to change the input label to avoid any conflicts, and we can put in a patch for final version. I don't think the pulse oscillation will have a meaningful impact on the validation II sample (for the software trigger) since we'll primarily be concerned with agreement for low energies, not high.

@nathanielerowe nathanielerowe moved this from Expected for validation II MC to Waiting on Reviewer in SBND 2025 Fall Production Nov 21, 2025
Comment on lines +138 to +139
void AddOscillationAfterPulse( std::vector<double>& wave);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The oscillation is being handled by a different module right? I think this function is unused.

Suggested change
void AddOscillationAfterPulse( std::vector<double>& wave);

fhicl::ParameterSet GainFluctuationsParams;
bool SimulateNonLinearity; //Fluctuate PMT gain
bool PositivePolarity;
bool OscillateAfterPulse;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also unused

Suggested change
bool OscillateAfterPulse;

bool MakeGainFluctuations; //Fluctuate PMT gain
fhicl::ParameterSet GainFluctuationsParams;
bool SimulateNonLinearity; //Fluctuate PMT gain
bool PositivePolarity;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused? The waveform polarity is directly inferred from the SER in this line

Suggested change
bool PositivePolarity;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gazing at SBNDDecoSimpleFlashTPC0_data and SBNDDecoSimpleFlashTPC0_realisticMC, the parameters look completely identical.

Can we define a common table from which both _data and _realisticMC inherit?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ohh, I just saw you did it for the OpHit configuration, can we follow the same implementation here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here, just define a common table to avoid duplication and possible mis-configurations in the future

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add units for the configuration parameters (frequencies and OscillationThreshold) for easier future reference?

@nathanielerowe nathanielerowe moved this from Waiting on Reviewer to Reviewer Approved in SBND 2025 Fall Production Nov 21, 2025
@nathanielerowe
Copy link
Contributor

trigger build LArSoft/lar*@LARSOFT_SUITE_v10_14_00 SBNSoftware/sbndaq-artdaq-core@v1_10_06 SBNSoftware/sbn*@SBN_SUITE_v10_14_00

@FNALbuild
Copy link
Collaborator

✔️ CI build for LArSoft Succeeded on slf7 for c14:prof -- details available through the CI dashboard

@FNALbuild
Copy link
Collaborator

✔️ CI build for LArSoft Succeeded on slf7 for e26:prof -- details available through the CI dashboard

@FNALbuild
Copy link
Collaborator

❌ CI build for SBND Failed at phase build SBND on slf7 for c14:prof -- details available through the CI dashboard

🚨 For more details about the failed phase, check the build SBND phase logs

parent CI build details are available through the CI dashboard

@FNALbuild
Copy link
Collaborator

❌ CI build for SBND Failed at phase build SBND on slf7 for e26:prof -- details available through the CI dashboard

🚨 For more details about the failed phase, check the build SBND phase logs

parent CI build details are available through the CI dashboard

@nathanielerowe
Copy link
Contributor

trigger build LArSoft/lar*@LARSOFT_SUITE_v10_14_00 SBNSoftware/sbndaq-artdaq-core@v1_10_06 SBNSoftware/sbn*@SBN_SUITE_v10_14_00

@FNALbuild
Copy link
Collaborator

✔️ CI build for LArSoft Succeeded on slf7 for c14:prof -- details available through the CI dashboard

@FNALbuild
Copy link
Collaborator

✔️ CI build for LArSoft Succeeded on slf7 for e26:prof -- details available through the CI dashboard

@FNALbuild
Copy link
Collaborator

❌ CI build for SBND Failed at phase build SBND on slf7 for c14:prof -- details available through the CI dashboard

🚨 For more details about the failed phase, check the build SBND phase logs

parent CI build details are available through the CI dashboard

@FNALbuild
Copy link
Collaborator

❌ CI build for SBND Failed at phase ci_tests SBND on slf7 for e26:prof - ignored failure for unit_test - ignored warnings for build -- details available through the CI dashboard

🚨 For more details about the failed phase, check the ci_tests SBND phase logs

parent CI build details are available through the CI dashboard

@nathanielerowe nathanielerowe merged commit 5616ef6 into develop Nov 22, 2025
@nathanielerowe nathanielerowe moved this from Reviewer Approved to RM Approved in SBND 2025 Fall Production Nov 22, 2025
@nathanielerowe nathanielerowe moved this from RM Approved to In tagged release in SBND 2025 Fall Production Nov 22, 2025
@asanchezcastillo asanchezcastillo deleted the feature/acastill_realistic_pmt_mc branch December 11, 2025 20:27
@lynnt20 lynnt20 mentioned this pull request Dec 17, 2025
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

detsim Detector simulation

Projects

Status: In tagged release

Development

Successfully merging this pull request may close these issues.

7 participants