Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
8b5eb26
finished implementing D meson DB, but lower energies decay still is a…
Jun 12, 2024
f1fb7cf
add examples
Jun 12, 2024
3ce2b8f
preparing for PR
MiaochenJin Aug 22, 2024
a6d66aa
Update DetectorModel.cxx for PR
nickkamp1 Aug 22, 2024
4414cbb
Update Injector.cxx to fixes failed_tries bug
nickkamp1 Aug 22, 2024
e1da327
Merge branch 'Harvard-Neutrino:main' into dev/DMeson
MiaochenJin Aug 22, 2024
7e21f18
updated file for PR comments, preparing for PR again
MiaochenJin Aug 22, 2024
9f5b7d9
Delete resources/Examples/DMesonExample/paper.mplstyle
MiaochenJin Aug 22, 2024
a9c3ac1
Delete resources/Examples/DMesonExample/parse_output.py
MiaochenJin Aug 22, 2024
6a54bd0
Merge branch 'Harvard-Neutrino:main' into dev/DMeson
MiaochenJin Oct 9, 2024
8ea969d
update handling of numerical instabilities
MiaochenJin Nov 13, 2024
abf6883
new stuff
MiaochenJin Nov 19, 2024
4dfb9ce
quarkDIS completed
MiaochenJin Dec 12, 2024
5a40bff
fix current type issue
MiaochenJin Feb 3, 2025
526c057
newest update for Di Muon extensions preparations (Pavel)
MiaochenJin Mar 31, 2025
10d86d5
update before codebasing into WHAMS
MiaochenJin Dec 8, 2025
4a70aec
fixed TotalCrossSection for QuarkDISFromSpline to take signature and …
MiaochenJin Mar 25, 2026
ddf7d2c
fixed TotalCrossSection for QuarkDISFromSpline to take signature and …
MiaochenJin Mar 25, 2026
d94184c
fix typos in charm decay: previous Q^2 distribution is incorrect, but…
MiaochenJin Mar 25, 2026
206c13d
fixing CDF sampling in charm meson decay
MiaochenJin Apr 2, 2026
252d7be
partonic cross section updates
nickkamp1 Apr 7, 2026
435eaab
add kinematic gaurd to charm decay
nickkamp1 Apr 7, 2026
86a9e56
keep old treatment as a comment
nickkamp1 Apr 7, 2026
b234445
fixed repeating seed issue
Mar 9, 2026
2f57b2c
incorporate Pavel's PR: new 3 body decay class and PythiaDISCrossSect…
MiaochenJin Apr 14, 2026
e3a7398
Merge upstream/main into dev/DMeson (2026-04-14)
MiaochenJin Apr 14, 2026
51fd813
Patch vendored photospline to restore missing bspline symbols
MiaochenJin Apr 14, 2026
0abd9f2
SIREN_Controller: back-compat with upstream python-interface refactor
MiaochenJin Apr 14, 2026
1c30c18
SIREN_Controller: replace old Add*Distribution/Injector API with upst…
MiaochenJin Apr 14, 2026
8e58b32
Add DIS_IceCube_charm example using the new Injector/Weighter idiom
MiaochenJin Apr 14, 2026
562679d
Remove dead CharmDISFromSpline + CharmHadronization pathway
MiaochenJin May 3, 2026
3341768
QuarkDISFromSpline: per-primary D-meson selection + remove vestigial …
MiaochenJin May 3, 2026
1110a2d
Constants: swap D0Mass / DPlusMass to match PDG conventions (Bug #12)
MiaochenJin May 3, 2026
60925fd
Merge upstream/main into dev/DMeson
MiaochenJin May 3, 2026
d77526f
Add PythiaDISCrossSection and improve CharmMesonDecay
Apr 8, 2026
1d43080
Sub-merge 1: photospline patch — cholmod.h outside extern "C"
Apr 29, 2026
2cbd4d0
QuarkDISFromSpline: reject events with xi >= 1 instead of clamping
Apr 30, 2026
99c0d82
Add c-bar flavor and Ds support to CharmMesonDecay / DMesonELoss
May 5, 2026
5241785
PythiaDISCrossSection: Ds + isoscalar target + per-event reinit
May 5, 2026
e97f340
PythiaDISCrossSection: align Ds fragfrac with thesis convention (0.15)
May 5, 2026
8560b14
Switch QuarkDISFromSpline to (xi, y) slow-rescaling sampling
May 8, 2026
e00a15e
Fix log10 guards, burn-in trial cap, and dead-code in slow-rescaling …
May 8, 2026
8a2f6b0
Add 100-event smoke test for slow-rescaling QuarkDIS sampling
May 8, 2026
163862b
Add 10k-event smoke + spline re-evaluation check for slow-rescaling Q…
May 8, 2026
be32bd1
Avoid rk::P4::m() FP-roundoff assertion on hadronic remnant
May 8, 2026
409dea8
QuarkDISFromSpline: NaN-guard pqy_lab precision loop
May 9, 2026
0a3dffd
QuarkDISFromSpline: drop spurious TotalCrossSectionAllFinalStates ove…
May 9, 2026
0f0c8c4
QuarkDISFromSpline: add Ds+/Ds- support
May 9, 2026
eb5efcd
Update hardcoded D0 mass references to PDG value (1.86484)
May 9, 2026
9d32939
smoke tests: drop removed quark_type ctor argument
May 9, 2026
24f298a
QuarkDIS precision loop + smoke test retry on NaN-guard InjectionFailure
May 9, 2026
cd7366b
PythiaDISCrossSection: register correct-sign D mesons for antineutrin…
pavelzhelnin May 10, 2026
dd67478
Merge pavelzhelnin#3: slow-rescaling charm DIS, Ds support, c-bar sym…
MiaochenJin May 12, 2026
3842959
CharmMesonDecay: restore physical PDG branching ratios for semilepton…
MiaochenJin May 12, 2026
588709c
Merge Harvard-Neutrino:main (1b1998e2) into dev/DMeson
MiaochenJin May 12, 2026
52fa76d
address PR#74 comments
MiaochenJin May 20, 2026
d7764ae
more PR#74 edits, especially vendor updates and pythia cmake gating
MiaochenJin May 21, 2026
b301354
fix a controller error, seems to be introduced by an upstream PR on c…
MiaochenJin May 21, 2026
08d410e
retracted some erroneous commits that accidentally appended NUL to th…
MiaochenJin May 21, 2026
b95d84e
remove whitespace changes
nickkamp1 May 21, 2026
9d1c99a
remove extraneous comments
nickkamp1 May 21, 2026
799d53e
one more whitespace reversion
nickkamp1 May 21, 2026
46b0542
Apply suggestion from @austinschneider
nickkamp1 May 21, 2026
bc99e8c
revert unncessary changes to Injector/Weighter logic
nickkamp1 May 21, 2026
3908809
Apply suggestion from @austinschneider
MiaochenJin May 21, 2026
34d5dd9
revert changes to SIREN_Controller, minor edits to solve duplicate ch…
MiaochenJin May 22, 2026
3731160
Merge branch 'main' into dev/DMeson
nickkamp1 May 27, 2026
2c31202
fix a latent hard-coded distance threshold
nickkamp1 May 27, 2026
f1751c6
remove photospline patches, gaurd against gcc < 9
nickkamp1 Jun 25, 2026
4b7baf4
Remove TotalCrossSectionAllFinalStates override
austinschneider Jun 26, 2026
10ca063
PythiaDISCrossSection: partition charm cross section by fragmentation…
austinschneider Jun 26, 2026
497d2ab
raise error instead of using FASRC lhapdf path
nickkamp1 Jun 26, 2026
58c36a1
Fix degenerate trajectory-direction handling in DetectorModel/Vector3D
austinschneider Jun 26, 2026
9b8517a
QuarkDISFromSpline: fix precision-loop kinematics, sampling robustnes…
austinschneider Jun 27, 2026
4b2ce81
CharmMesonDecay/3Body: closure-correct FinalStateProbability, exclusi…
austinschneider Jun 27, 2026
5686bff
DMesonELoss: bound inelasticity sampler to the density support and ca…
austinschneider Jun 27, 2026
6027ca6
PythiaDISCrossSection: renormalize fragmentation fractions and ASCII …
austinschneider Jun 27, 2026
6f754ae
Add charm-DIS unit tests, detector degenerate-direction regression, a…
austinschneider Jun 27, 2026
b8e761a
Charm-DIS cleanups: RNG reproducibility note, build tidy, example and…
austinschneider Jun 27, 2026
5c0cc37
CharmMesonDecay/3Body: analytic V-A angle-average in weighting, numer…
austinschneider Jun 27, 2026
dea7873
Fix charm decay serialization and re-enable Weighter save/load
austinschneider Jun 27, 2026
87f7703
Make load_and_construct static in HNL/EW/dipole/elastic interaction c…
austinschneider Jun 27, 2026
db997b6
Tighten charm-DIS code comments: concise, targeted, no development hi…
austinschneider Jun 27, 2026
d0b2dde
DMesonELoss: apply the energy-dependent kinematic cut in the density …
austinschneider Jun 27, 2026
530a75c
PythiaDISCrossSection: generalize outgoing-lepton ID, recoverable fai…
austinschneider Jun 28, 2026
c9335c1
PythiaDISCrossSection: optional differential spline, constant FSP fal…
austinschneider Jun 28, 2026
a97d23d
PythiaDISCrossSection: add Pythia spline generators (total + optional…
austinschneider Jun 28, 2026
62f498b
PythiaDISCharmClosure_TEST: assert constant FinalStateProbability wit…
austinschneider Jun 28, 2026
21baf78
PythiaDIS/CharmMesonDecay: reject misuse with actionable errors
austinschneider Jun 28, 2026
a335b96
Add charm-DIS physics validation tests
austinschneider Jun 28, 2026
7458466
Document charm-DIS usage and add a Pythia spline generator
austinschneider Jun 28, 2026
7273556
Raise on out-of-range differential cross section instead of returning 0
austinschneider Jun 28, 2026
718f63f
Add quantitative rate closure, out-of-range coverage, and QuarkDIS no…
austinschneider Jun 28, 2026
bafdcab
Add charm slow-rescaling spline generator and dimuon kinematics example
austinschneider Jun 28, 2026
516d890
Fix injector/weighter serialization API in SIREN_Controller and Weighter
austinschneider Jun 28, 2026
4705b58
CharmSerialization_TEST: guard under cibuildwheel so wheel builds con…
austinschneider Jun 28, 2026
cb8c074
charm-DIS: remove unused code paths and dead members
austinschneider Jun 29, 2026
685e498
charm-DIS: dedupe shared logic into header-only helpers
austinschneider Jun 29, 2026
79715cb
charm-DIS tests: trim verbose comments
austinschneider Jun 29, 2026
67c9d48
charm-DIS: fix swapped QuarkDIS pybind arg names, includes, example, …
austinschneider Jun 29, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions projects/dataclasses/private/Particle.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,16 @@ bool isCharged(ParticleType p){
p==ParticleType::Hadrons);
}

bool isQuark(Particle::ParticleType p){
return(p==Particle::ParticleType::Charm || p==Particle::ParticleType::CharmBar);
}

bool isHadron(Particle::ParticleType p){
return(p==Particle::ParticleType::Hadrons ||
p==Particle::ParticleType::D0 || p==Particle::ParticleType::D0Bar ||
p==Particle::ParticleType::DPlus || p==Particle::ParticleType::DMinus);
}


} // namespace utilities
} // namespace siren
3 changes: 3 additions & 0 deletions projects/dataclasses/public/SIREN/dataclasses/Particle.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ class Particle {
bool isLepton(ParticleType p);
bool isCharged(ParticleType p);
bool isNeutrino(ParticleType p);
bool isQuark(Particle::ParticleType p);
bool isHadron(Particle::ParticleType p);


} // namespace dataclasses
} // namespace siren
Expand Down
Comment thread
nickkamp1 marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ X(TauPlus, -15)
X(TauMinus, 15)
X(NuTau, 16)
X(NuTauBar, -16)
X(Charm, 4)
X(CharmBar, -4)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

can we not use the c and cBar particles defined above? also probably good to group K0/K0Bar with the other mesons

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done — removed X(Charm, 4) and X(CharmBar, -4); they were PDG-code duplicates of the X(c, 4) / X(cBar, -4)
entries defined above. Also moved X(K0, 311) / X(K0Bar, -311) next to X(K0_Short, 310) in the mesons section. The
only Charm/CharmBar callers were isQuark() (in Particle.cxx) and a switch case in
QuarkDISFromSpline::getHadronMass, both removed as dead code now that QuarkDIS emits D mesons directly rather than
bare charm quarks. The c / cBar entries (used by HNL and electroweak decay code via Constants::charmMass) stay as
the canonical charm-quark tag.

X(K0, 311)
X(K0Bar, -311)



/* Nuclei */
X(HNucleus, 1000010010)
Expand Down
6 changes: 5 additions & 1 deletion projects/detector/private/DetectorModel.cxx

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Was there a specific issue that the distance.magnitude() <= 1e-5 checks fixed?

I'm wondering if there is another underlying issue that this is covering up, or if we really need this fix.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Comment thread
nickkamp1 marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ double DetectorModel::GetInteractionDensity(Geometry::IntersectionList const & i
std::vector<double> const & total_cross_sections,
double const & total_decay_length) const {
Vector3D direction = p0 - intersections.position;
if(direction.magnitude() == 0) {
if(direction.magnitude() == 0 || direction.magnitude() <= 1e-6) {
direction = intersections.direction;
} else {
direction.normalize();
Expand Down Expand Up @@ -978,6 +978,7 @@ double DetectorModel::GetInteractionDepthInCGS(Geometry::IntersectionList const
std::vector<siren::dataclasses::ParticleType> const & targets,
std::vector<double> const & total_cross_sections,
double const & total_decay_length) const {

if(p0 == p1) {
return 0.0;
}
Expand All @@ -986,6 +987,9 @@ double DetectorModel::GetInteractionDepthInCGS(Geometry::IntersectionList const
if(distance == 0.0) {
return 0.0;
}
if(direction.magnitude() <= 1e-6) {
direction = intersections.direction;
}
direction.normalize();

double dot = intersections.direction * direction;
Expand Down
Comment thread
MiaochenJin marked this conversation as resolved.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Instead of adding special login in this class checks for a hadronization interaction to change the class behavior, you should implement a new secondary vertex distribution that has the appropriate behavior for hadronization.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@MiaochenJin are we still using Secondary{Bounded,Physical}VertexDistribution for charms? I think it's probably ok as long as we add a check that any particle with hadronization interactions has no scattering or decay interactions present, since hadronization would override those

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

You are right. we do not currently have any hadronization logic any more. A new commit will remove all dead code, and we shouldn't need to change the Secondary*Distribution definitions any more.

Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,17 @@ double log_one_minus_exp_of_negative(double x) {


void SecondaryBoundedVertexDistribution::SampleVertex(std::shared_ptr<siren::utilities::SIREN_random> rand, std::shared_ptr<siren::detector::DetectorModel const> detector_model, std::shared_ptr<siren::interactions::InteractionCollection const> interactions, siren::dataclasses::SecondaryDistributionRecord & record) const {
// std::cout << "in sample bounded vertex" << std::endl;

siren::math::Vector3D pos = record.initial_position;
siren::math::Vector3D dir = record.direction;

siren::math::Vector3D endcap_0 = pos;
// skip computation of endpoint if interaction is hadronization
if (interactions->HasHadronizations()) {
record.SetLength(0);
return;
}
siren::math::Vector3D endcap_1 = endcap_0 + max_length * dir;

siren::detector::Path path(detector_model, DetectorPosition(endcap_0), DetectorDirection(dir), max_length);
Expand Down Expand Up @@ -116,11 +123,21 @@ void SecondaryBoundedVertexDistribution::SampleVertex(std::shared_ptr<siren::uti
}

double SecondaryBoundedVertexDistribution::GenerationProbability(std::shared_ptr<siren::detector::DetectorModel const> detector_model, std::shared_ptr<siren::interactions::InteractionCollection const> interactions, siren::dataclasses::InteractionRecord const & record) const {
// std::cout << "in sample bounded vertex gen prob" << std::endl;

siren::math::Vector3D dir(record.primary_momentum[1], record.primary_momentum[2], record.primary_momentum[3]);
dir.normalize();
siren::math::Vector3D vertex(record.interaction_vertex);

siren::math::Vector3D endcap_0 = record.primary_initial_position;
// hadrnoization treated differently, but also check for misconducting
if (interactions->HasHadronizations()) {
if (vertex == endcap_0) {
return 1.0;
} else {
return 0.0;
}
}
siren::math::Vector3D endcap_1 = endcap_0 + max_length * dir;

siren::detector::Path path(detector_model, DetectorPosition(endcap_0), DetectorDirection(dir), max_length);
Expand Down

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Same comment as for the bounded vertex distribution:

Instead of adding special login in this class checks for a hadronization interaction to change the class behavior, you should implement a new secondary vertex distribution that has the appropriate behavior for hadronization.

Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,21 @@ double log_one_minus_exp_of_negative(double x) {


void SecondaryPhysicalVertexDistribution::SampleVertex(std::shared_ptr<siren::utilities::SIREN_random> rand, std::shared_ptr<siren::detector::DetectorModel const> detector_model, std::shared_ptr<siren::interactions::InteractionCollection const> interactions, siren::dataclasses::SecondaryDistributionRecord & record) const {
// // std::cout << "in sample physical vertex" << std::endl;
siren::math::Vector3D pos = record.initial_position;
siren::math::Vector3D dir = record.direction;
// // std::cout << "in sample physical vertex-1" << std::endl;

siren::math::Vector3D endcap_0 = pos;
// treat hadronizations differntely
if (interactions->HasHadronizations()) {
// std::cout << "in sample physical vertex-hadron" << std::endl;

record.SetLength(0);
return;
}
// // std::cout << "in sample physical vertex-shouldnm't be here" << std::endl;


siren::detector::Path path(detector_model, DetectorPosition(endcap_0), DetectorDirection(dir), std::numeric_limits<double>::infinity());
path.ClipToOuterBounds();
Expand All @@ -75,6 +86,7 @@ void SecondaryPhysicalVertexDistribution::SampleVertex(std::shared_ptr<siren::ut

double total_interaction_depth = path.GetInteractionDepthInBounds(targets, total_cross_sections, total_decay_length);
if(total_interaction_depth == 0) {
// std::cout << "error is here" << std::endl;
throw(siren::utilities::InjectionFailure("No available interactions along path!"));
}

Expand All @@ -96,11 +108,20 @@ void SecondaryPhysicalVertexDistribution::SampleVertex(std::shared_ptr<siren::ut
}

double SecondaryPhysicalVertexDistribution::GenerationProbability(std::shared_ptr<siren::detector::DetectorModel const> detector_model, std::shared_ptr<siren::interactions::InteractionCollection const> interactions, siren::dataclasses::InteractionRecord const & record) const {
// std::cout << "in sample physical vertex gen prob" << std::endl;

siren::math::Vector3D dir(record.primary_momentum[1], record.primary_momentum[2], record.primary_momentum[3]);
dir.normalize();
siren::math::Vector3D vertex(record.interaction_vertex);

siren::math::Vector3D endcap_0 = record.primary_initial_position;
if (interactions->HasHadronizations()) {
if (vertex == endcap_0) {
return 1.0;
} else {
return 0.0;
}
}

siren::detector::Path path(detector_model, DetectorPosition(endcap_0), DetectorDirection(dir), std::numeric_limits<double>::infinity());
path.ClipToOuterBounds();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ namespace distributions {
// class SecondaryVertexPositionDistribution : InjectionDistribution
//---------------
void SecondaryVertexPositionDistribution::Sample(std::shared_ptr<siren::utilities::SIREN_random> rand, std::shared_ptr<siren::detector::DetectorModel const> detector_model, std::shared_ptr<siren::interactions::InteractionCollection const> interactions, siren::dataclasses::SecondaryDistributionRecord & record) const {
// // // // // std::cout << "sampling vertex" << std::endl;
SampleVertex(rand, detector_model, interactions, record);
}

Expand Down
Loading