Skip to content

Commit

Permalink
Merge pull request #43182 from tvami/FixSUEPshower_130X
Browse files Browse the repository at this point in the history
[130X] Fix upper bound of the scale in SUEP shower simulation
  • Loading branch information
cmsbuild authored Nov 7, 2023
2 parents 7d69a86 + 6c3b655 commit a946723
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions GeneratorInterface/Pythia8Interface/src/SuepShower.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ std::vector<Pythia8::Vec4> SuepShower::generateShower(double energy) {
double shower_energy = 0.0;

// Fill up shower record
while (shower_energy < mediator_energy_) {
while (shower_energy < mediator_energy_ || shower.size() < 2) {
shower.push_back(generateFourVector());
shower_energy += (shower.back()).e();
}
Expand All @@ -73,9 +73,18 @@ std::vector<Pythia8::Vec4> SuepShower::generateShower(double energy) {

// With momentum conserved, balance energy. scale is the multiplicative factor needed such that sum_daughters((scale*p)^2+m^2) = E_parent, i.e. energy is conserved
double scale;
double minscale = 0.0;
double maxscale = 2.0;
while (SuepShower::reballanceFunction(minscale, shower) * SuepShower::reballanceFunction(maxscale, shower) > 0) {
minscale = maxscale;
maxscale *= 2;
}

scale =
(boost::math::tools::bisect(
boost::bind(&SuepShower::reballanceFunction, this, boost::placeholders::_1, shower), 0.0, 2.0, tolerance_))
(boost::math::tools::bisect(boost::bind(&SuepShower::reballanceFunction, this, boost::placeholders::_1, shower),
minscale,
maxscale,
tolerance_))
.first;

for (auto& daughter : shower) {
Expand Down

0 comments on commit a946723

Please sign in to comment.