Skip to content

Commit

Permalink
Merge pull request #40821 from civanch/fix_gflash_ecal_1
Browse files Browse the repository at this point in the history
[13_0_X] Fixed low energy GFLASH
  • Loading branch information
cmsbuild authored Mar 9, 2023
2 parents df0d92a + e78a42d commit e897442
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions SimG4Core/Application/src/LowEnergyFastSimModel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include "G4PhysicalConstants.hh"

constexpr G4double twomass = 2 * CLHEP::electron_mass_c2;
constexpr G4double scaleFactor = 1.05;
constexpr G4double scaleFactor = 1.025;

LowEnergyFastSimModel::LowEnergyFastSimModel(const G4String& name, G4Region* region, const edm::ParameterSet& parSet)
: G4VFastSimulationModel(name, region),
Expand Down Expand Up @@ -62,13 +62,10 @@ G4bool LowEnergyFastSimModel::ModelTrigger(const G4FastTrack& fastTrack) {
if (nullptr == fTrackingAction) {
fTrackingAction = static_cast<const TrackingAction*>(G4EventManager::GetEventManager()->GetUserTrackingAction());
}
const G4Track* mother = fTrackingAction->geant4Track();
const TrackInformation* ptr = static_cast<TrackInformation*>(mother->GetUserInformation());
if (ptr->isPrimary()) {
int pdgMother = mother->GetDefinition()->GetPDGEncoding();
if (std::abs(pdgMother) == 11 || pdgMother == 22)
return false;
}
const TrackInformation* ptrti = static_cast<TrackInformation*>(track->GetUserInformation());
int pdg = ptrti->genParticlePID();
if (std::abs(pdg) == 11 || pdg == 22)
return false;
}
return true;
}
Expand Down

0 comments on commit e897442

Please sign in to comment.