From 1066de4072e4f2c65e933b892b1cad066ad686a4 Mon Sep 17 00:00:00 2001 From: sbein Date: Sun, 14 Nov 2021 22:29:00 +0100 Subject: [PATCH 1/4] added lines to skip FastSim decays for SM particles that cross the beam pipe. --- .../interface/ParticleManager.h | 4 +++- .../SimplifiedGeometryPropagator/src/ParticleManager.cc | 8 +++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/FastSimulation/SimplifiedGeometryPropagator/interface/ParticleManager.h b/FastSimulation/SimplifiedGeometryPropagator/interface/ParticleManager.h index 2654f68b24244..ab49035ae98cc 100644 --- a/FastSimulation/SimplifiedGeometryPropagator/interface/ParticleManager.h +++ b/FastSimulation/SimplifiedGeometryPropagator/interface/ParticleManager.h @@ -146,7 +146,9 @@ 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 diff --git a/FastSimulation/SimplifiedGeometryPropagator/src/ParticleManager.cc b/FastSimulation/SimplifiedGeometryPropagator/src/ParticleManager.cc index a62571af2fdb5..f1b9eda44243e 100644 --- a/FastSimulation/SimplifiedGeometryPropagator/src/ParticleManager.cc +++ b/FastSimulation/SimplifiedGeometryPropagator/src/ParticleManager.cc @@ -224,11 +224,17 @@ std::unique_ptr fastsim::ParticleManager::nextGenParticle() { } } - // particle must not decay before it reaches the beam pipe + // FastSim will not make hits out of particles that decay before reaching the beam pipe if (endVertex && endVertex->position().perp2() * lengthUnitConversionFactor2_ < beamPipeRadius2_) { continue; } + // SM particles that descend from exotics and cross the beam pipe radius should make hits but not be decayed + if (productionVertex->position().perp2() * lengthUnitConversionFactor2_ < beamPipeRadius2_ && + endVertex && endVertex->position().perp2() * lengthUnitConversionFactor2_ > beamPipeRadius2_) { + exoticRelativesChecker(productionVertex, exoticRelativeId, 0); + } + // make the particle std::unique_ptr newParticle( new Particle(particle.pdg_id(), From 3cdd06b56e2719f821e68e2bb63a855ab29bd780 Mon Sep 17 00:00:00 2001 From: sbein Date: Mon, 15 Nov 2021 22:38:12 +0100 Subject: [PATCH 2/4] post code checks --- .../interface/ParticleManager.h | 3 +-- .../SimplifiedGeometryPropagator/src/ParticleManager.cc | 8 ++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/FastSimulation/SimplifiedGeometryPropagator/interface/ParticleManager.h b/FastSimulation/SimplifiedGeometryPropagator/interface/ParticleManager.h index ab49035ae98cc..5f2f1cc87bb37 100644 --- a/FastSimulation/SimplifiedGeometryPropagator/interface/ParticleManager.h +++ b/FastSimulation/SimplifiedGeometryPropagator/interface/ParticleManager.h @@ -146,9 +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 diff --git a/FastSimulation/SimplifiedGeometryPropagator/src/ParticleManager.cc b/FastSimulation/SimplifiedGeometryPropagator/src/ParticleManager.cc index f1b9eda44243e..31337abe23c88 100644 --- a/FastSimulation/SimplifiedGeometryPropagator/src/ParticleManager.cc +++ b/FastSimulation/SimplifiedGeometryPropagator/src/ParticleManager.cc @@ -229,11 +229,11 @@ std::unique_ptr fastsim::ParticleManager::nextGenParticle() { continue; } - // SM particles that descend from exotics and cross the beam pipe radius should make hits but not be decayed - if (productionVertex->position().perp2() * lengthUnitConversionFactor2_ < beamPipeRadius2_ && - endVertex && endVertex->position().perp2() * lengthUnitConversionFactor2_ > beamPipeRadius2_) { + // SM particles that descend from exotics and cross the beam pipe radius should make hits but not be decayed + if (productionVertex->position().perp2() * lengthUnitConversionFactor2_ < beamPipeRadius2_ && endVertex && + endVertex->position().perp2() * lengthUnitConversionFactor2_ > beamPipeRadius2_) { exoticRelativesChecker(productionVertex, exoticRelativeId, 0); - } + } // make the particle std::unique_ptr newParticle( From d3a116f242029cf5e8bdc8cb0119d43d1ea2828c Mon Sep 17 00:00:00 2001 From: sbein Date: Tue, 30 Nov 2021 17:18:50 +0100 Subject: [PATCH 3/4] taking @perrotta's suggestion and reducing repetition of calculations --- .../SimplifiedGeometryPropagator/src/ParticleManager.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/FastSimulation/SimplifiedGeometryPropagator/src/ParticleManager.cc b/FastSimulation/SimplifiedGeometryPropagator/src/ParticleManager.cc index 31337abe23c88..afe144d60c654 100644 --- a/FastSimulation/SimplifiedGeometryPropagator/src/ParticleManager.cc +++ b/FastSimulation/SimplifiedGeometryPropagator/src/ParticleManager.cc @@ -216,7 +216,8 @@ std::unique_ptr 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)) { @@ -225,13 +226,13 @@ std::unique_ptr fastsim::ParticleManager::nextGenParticle() { } // FastSim will not make hits out of particles that decay before reaching the beam pipe - if (endVertex && endVertex->position().perp2() * lengthUnitConversionFactor2_ < beamPipeRadius2_) { + 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 (productionVertex->position().perp2() * lengthUnitConversionFactor2_ < beamPipeRadius2_ && endVertex && - endVertex->position().perp2() * lengthUnitConversionFactor2_ > beamPipeRadius2_) { + if (producedWithinBeamPipe && !decayedWithinBeamPipe) { exoticRelativesChecker(productionVertex, exoticRelativeId, 0); } From 2fe14d6b98fa4c99cf0ecd947dd9614d7507a2f0 Mon Sep 17 00:00:00 2001 From: sbein Date: Wed, 1 Dec 2021 00:12:51 +0100 Subject: [PATCH 4/4] ran formatting again --- .../SimplifiedGeometryPropagator/src/ParticleManager.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/FastSimulation/SimplifiedGeometryPropagator/src/ParticleManager.cc b/FastSimulation/SimplifiedGeometryPropagator/src/ParticleManager.cc index afe144d60c654..509ef1cee4df6 100644 --- a/FastSimulation/SimplifiedGeometryPropagator/src/ParticleManager.cc +++ b/FastSimulation/SimplifiedGeometryPropagator/src/ParticleManager.cc @@ -216,9 +216,9 @@ std::unique_ptr fastsim::ParticleManager::nextGenParticle() { } // 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) - { + const bool producedWithinBeamPipe = + productionVertex->position().perp2() * lengthUnitConversionFactor2_ < beamPipeRadius2_; + if (producedWithinBeamPipe) { exoticRelativesChecker(productionVertex, exoticRelativeId, 0); if (!isExotic(exoticRelativeId)) { continue; @@ -226,7 +226,8 @@ std::unique_ptr fastsim::ParticleManager::nextGenParticle() { } // FastSim will not make hits out of particles that decay before reaching the beam pipe - const bool decayedWithinBeamPipe = endVertex && endVertex->position().perp2() * lengthUnitConversionFactor2_ < beamPipeRadius2_; + const bool decayedWithinBeamPipe = + endVertex && endVertex->position().perp2() * lengthUnitConversionFactor2_ < beamPipeRadius2_; if (decayedWithinBeamPipe) { continue; }