Skip to content

Commit

Permalink
Fix upper bound of the scale in SUEP shower simulation
Browse files Browse the repository at this point in the history
  • Loading branch information
tvami committed Nov 1, 2023
1 parent e4bfeac commit 6c8dd57
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 6c8dd57

Please sign in to comment.