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

Fix for FastSim decays of exotic-descendent SM particles decaying outside pipe #36122

Merged
merged 4 commits into from Dec 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -146,7 +146,8 @@ inline bool isExotic(int pdgid_) {
return ((pdgid >= 1000000 && pdgid < 4000000 && pdgid != 3000022) || // SUSY, R-hadron, and technicolor particles
pdgid == 17 || // 4th generation lepton
pdgid == 34 || // W-prime
pdgid == 37); // charged Higgs
pdgid == 37 || // charged Higgs
pdgid == 39); // bulk graviton
}

#endif
16 changes: 12 additions & 4 deletions FastSimulation/SimplifiedGeometryPropagator/src/ParticleManager.cc
Expand Up @@ -216,19 +216,27 @@ std::unique_ptr<fastsim::Particle> fastsim::ParticleManager::nextGenParticle() {
}
// particles which do not descend from exotics must be produced within the beampipe
int exoticRelativeId = 0;
if (productionVertex->position().perp2() * lengthUnitConversionFactor2_ > beamPipeRadius2_) //
{
const bool producedWithinBeamPipe =
productionVertex->position().perp2() * lengthUnitConversionFactor2_ < beamPipeRadius2_;
if (producedWithinBeamPipe) {
exoticRelativesChecker(productionVertex, exoticRelativeId, 0);
if (!isExotic(exoticRelativeId)) {
continue;
}
}

// particle must not decay before it reaches the beam pipe
if (endVertex && endVertex->position().perp2() * lengthUnitConversionFactor2_ < beamPipeRadius2_) {
// FastSim will not make hits out of particles that decay before reaching the beam pipe
Copy link
Contributor

@perrotta perrotta Nov 28, 2021

Choose a reason for hiding this comment

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

Especially because this is FastSim, it is probably worth trying to avoid repeated computations of the same quantities.
A possibile suggestion:

    // particles which do not descend from exotics must be produced within the beampipe
    int exoticRelativeId = 0;
    const bool producedWithinBeamPipe = 
        productionVertex->position().perp2() * lengthUnitConversionFactor2_ < beamPipeRadius2_;
    if (!producedWithinBeamPipe) {
      exoticRelativesChecker(productionVertex, exoticRelativeId, 0);
      if (!isExotic(exoticRelativeId)) {
        continue;
      }
    }

    // FastSim will not make hits out of particles that decay before reaching the beam pipe
    const bool decayedWithinBeamPipe =
        endVertex && endVertex->position().perp2() * lengthUnitConversionFactor2_ < beamPipeRadius2_;
    if (decayedWithinBeamPipe) {
      continue;
    }

    // SM particles that descend from exotics and cross the beam pipe radius should make hits but not be decayed
    if (producedWithinBeamPipe && !decayedWithinBeamPipe) {
      exoticRelativesChecker(productionVertex, exoticRelativeId, 0);
    }

const bool decayedWithinBeamPipe =
endVertex && endVertex->position().perp2() * lengthUnitConversionFactor2_ < beamPipeRadius2_;
if (decayedWithinBeamPipe) {
continue;
}

// SM particles that descend from exotics and cross the beam pipe radius should make hits but not be decayed
if (producedWithinBeamPipe && !decayedWithinBeamPipe) {
exoticRelativesChecker(productionVertex, exoticRelativeId, 0);
}

// make the particle
std::unique_ptr<Particle> newParticle(
new Particle(particle.pdg_id(),
Expand Down