File indexing completed on 2024-04-06 12:30:29
0001 #include "SimG4Core/PhysicsLists/interface/CMSTrackingCutModel.h"
0002
0003 #include "G4ParticleDefinition.hh"
0004 #include "G4Electron.hh"
0005 #include "G4Positron.hh"
0006 #include "G4PhysicalConstants.hh"
0007 #include "Randomize.hh"
0008
0009 CMSTrackingCutModel::CMSTrackingCutModel(const G4ParticleDefinition* part)
0010 : particle_(part), deltaE_(0.0), factor_(0.0), rms_(0.0) {
0011 if (part == G4Positron::Positron()) {
0012 deltaE_ = 2 * CLHEP::electron_mass_c2;
0013 }
0014 }
0015
0016 CMSTrackingCutModel::~CMSTrackingCutModel() {}
0017
0018 G4double CMSTrackingCutModel::SampleEnergyDepositEcal(G4double kinEnergy) {
0019 G4double edep = kinEnergy * factor_;
0020 if (rms_ > 0.) {
0021 edep *= G4RandGauss::shoot(1.0, rms_);
0022 }
0023 return edep + deltaE_;
0024 }