4 #include "G4CoulombScattering.hh" 5 #include "G4UrbanMscModel.hh" 6 #include "G4WentzelVIModel.hh" 7 #include "G4eBremsstrahlung.hh" 8 #include "G4eCoulombScatteringModel.hh" 9 #include "G4eIonisation.hh" 10 #include "G4eMultipleScattering.hh" 11 #include "G4eplusAnnihilation.hh" 13 #include "G4ElectroVDNuclearModel.hh" 14 #include "G4ElectronNuclearProcess.hh" 15 #include "G4PositronNuclearProcess.hh" 17 #include "G4ComptonScattering.hh" 18 #include "G4GammaConversion.hh" 19 #include "G4PhotoElectricEffect.hh" 21 #include "G4CascadeInterface.hh" 22 #include "G4CrossSectionDataSetRegistry.hh" 23 #include "G4ExcitedStringDecay.hh" 24 #include "G4GammaNuclearXS.hh" 25 #include "G4GammaParticipants.hh" 26 #include "G4GeneratorPrecompoundInterface.hh" 27 #include "G4HadronInelasticProcess.hh" 28 #include "G4HadronicParameters.hh" 29 #include "G4LowEGammaNuclearModel.hh" 30 #include "G4PhotoNuclearCrossSection.hh" 31 #include "G4QGSMFragmentation.hh" 32 #include "G4QGSModel.hh" 33 #include "G4TheoFSGenerator.hh" 35 #include "G4GammaGeneralProcess.hh" 36 #include "G4LossTableManager.hh" 38 #include "G4EmParameters.hh" 39 #include <CLHEP/Units/SystemOfUnits.h> 41 #include "G4Electron.hh" 43 #include "G4Positron.hh" 45 #include "G4RegionStore.hh" 46 #include "G4Region.hh" 55 fLambdaLimit =
p.getParameter<
double>(
"G4MscLambdaLimit") * CLHEP::mm;
58 if (
msc ==
"UseSafetyPlus") {
60 }
else if (
msc ==
"Minimal") {
64 G4EmParameters *param = G4EmParameters::Instance();
65 G4double highEnergyLimit = param->MscEnergyLimit();
67 const G4Region *aRegion = G4RegionStore::GetInstance()->GetRegion(
"HcalRegion",
false);
68 const G4Region *bRegion = G4RegionStore::GetInstance()->GetRegion(
"HGCalRegion",
false);
72 G4eMultipleScattering *
msc =
new G4eMultipleScattering;
73 G4UrbanMscModel *msc1 =
new G4UrbanMscModel;
74 G4WentzelVIModel *msc2 =
new G4WentzelVIModel;
75 msc1->SetHighEnergyLimit(highEnergyLimit);
76 msc2->SetLowEnergyLimit(highEnergyLimit);
77 msc->SetEmModel(msc1);
78 msc->SetEmModel(msc2);
81 if (
nullptr != aRegion ||
nullptr != bRegion) {
82 G4UrbanMscModel *msc3 =
new G4UrbanMscModel();
83 msc3->SetHighEnergyLimit(highEnergyLimit);
89 msc3->SetLocked(
true);
90 if (
nullptr != aRegion) {
91 msc->AddEmModel(-1, msc3, aRegion);
93 if (
nullptr != bRegion) {
94 msc->AddEmModel(-1, msc3, bRegion);
101 electron.brems =
new G4eBremsstrahlung;
103 G4CoulombScattering *
ss =
new G4CoulombScattering;
104 G4eCoulombScatteringModel *ssm =
new G4eCoulombScatteringModel;
105 ssm->SetLowEnergyLimit(highEnergyLimit);
106 ssm->SetActivationLowEnergyLimit(highEnergyLimit);
108 ss->SetMinKinEnergy(highEnergyLimit);
114 G4eMultipleScattering *
msc =
new G4eMultipleScattering;
115 G4UrbanMscModel *msc1 =
new G4UrbanMscModel;
116 G4WentzelVIModel *msc2 =
new G4WentzelVIModel;
117 msc1->SetHighEnergyLimit(highEnergyLimit);
118 msc2->SetLowEnergyLimit(highEnergyLimit);
119 msc->SetEmModel(msc1);
120 msc->SetEmModel(msc2);
123 if (
nullptr != aRegion ||
nullptr != bRegion) {
124 G4UrbanMscModel *msc3 =
new G4UrbanMscModel();
125 msc3->SetHighEnergyLimit(highEnergyLimit);
131 msc3->SetLocked(
true);
132 if (
nullptr != aRegion) {
133 msc->AddEmModel(-1, msc3, aRegion);
135 if (
nullptr != bRegion) {
136 msc->AddEmModel(-1, msc3, bRegion);
143 positron.brems =
new G4eBremsstrahlung;
144 positron.annihilation =
new G4eplusAnnihilation;
146 G4CoulombScattering *
ss =
new G4CoulombScattering;
147 G4eCoulombScatteringModel *ssm =
new G4eCoulombScatteringModel;
148 ssm->SetLowEnergyLimit(highEnergyLimit);
149 ssm->SetActivationLowEnergyLimit(highEnergyLimit);
151 ss->SetMinKinEnergy(highEnergyLimit);
159 gammaProc->AddEmProcess(
new G4PhotoElectricEffect);
160 gammaProc->AddEmProcess(
new G4ComptonScattering);
161 gammaProc->AddEmProcess(
new G4GammaConversion);
163 G4HadronInelasticProcess *
nuc =
new G4HadronInelasticProcess(
"photonNuclear", G4Gamma::Definition());
164 auto xsreg = G4CrossSectionDataSetRegistry::Instance();
165 G4VCrossSectionDataSet *xs =
nullptr;
166 bool useGammaNuclearXS =
true;
167 if (useGammaNuclearXS) {
168 xs = xsreg->GetCrossSectionDataSet(
"GammaNuclearXS");
170 xs =
new G4GammaNuclearXS;
172 xs = xsreg->GetCrossSectionDataSet(
"PhotoNuclearXS");
174 xs =
new G4PhotoNuclearCrossSection;
178 G4QGSModel<G4GammaParticipants> *theStringModel =
new G4QGSModel<G4GammaParticipants>;
179 G4QGSMFragmentation *theFrag =
new G4QGSMFragmentation;
180 G4ExcitedStringDecay *theStringDecay =
new G4ExcitedStringDecay(theFrag);
181 theStringModel->SetFragmentationModel(theStringDecay);
183 G4GeneratorPrecompoundInterface *theCascade =
new G4GeneratorPrecompoundInterface;
185 G4TheoFSGenerator *theModel =
new G4TheoFSGenerator;
186 theModel->SetTransport(theCascade);
187 theModel->SetHighEnergyGenerator(theStringModel);
189 G4HadronicParameters *param = G4HadronicParameters::Instance();
191 G4CascadeInterface *cascade =
new G4CascadeInterface;
194 G4double gnLowEnergyLimit = 200 * CLHEP::MeV;
195 if (gnLowEnergyLimit > 0.0) {
196 G4LowEGammaNuclearModel *lemod =
new G4LowEGammaNuclearModel;
197 lemod->SetMaxEnergy(gnLowEnergyLimit);
198 nuc->RegisterMe(lemod);
199 cascade->SetMinEnergy(gnLowEnergyLimit - CLHEP::MeV);
201 cascade->SetMaxEnergy(param->GetMaxEnergyTransitionFTF_Cascade());
202 nuc->RegisterMe(cascade);
203 theModel->SetMinEnergy(param->GetMinEnergyTransitionFTF_Cascade());
204 theModel->SetMaxEnergy(param->GetMaxEnergy());
205 nuc->RegisterMe(theModel);
208 G4LossTableManager::Instance()->SetGammaGeneralProcess(
gammaProc);
213 G4ElectroVDNuclearModel *eModel =
new G4ElectroVDNuclearModel;
216 G4ElectronNuclearProcess *
nuc =
new G4ElectronNuclearProcess;
217 nuc->RegisterMe(eModel);
221 G4PositronNuclearProcess *
nuc =
new G4PositronNuclearProcess;
222 nuc->RegisterMe(eModel);
253 if (&
part == G4Electron::Definition()) {
259 }
else if (&
part == G4Positron::Definition()) {
266 }
else if (&
part == G4Gamma::Definition()) {
272 if (&
part == G4Electron::Definition()) {
278 }
else if (&
part == G4Positron::Definition()) {
285 }
else if (&
part == G4Gamma::Definition()) {
295 void StartTracking(G4Track *aTrack)
override {
298 electron.msc->StartTracking(aTrack);
299 electron.ioni->StartTracking(aTrack);
300 electron.brems->StartTracking(aTrack);
302 electron.nuc->StartTracking(aTrack);
304 fPreviousStepLength = 0;
306 void EndTracking()
override {
316 G4double GetPhysicalInteractionLength(
const G4Track &
track)
override {
318 G4double physIntLength, proposedSafety = DBL_MAX;
319 G4ForceCondition condition;
322 fProposedStep = DBL_MAX;
325 physIntLength =
electron.nuc->PostStepGPIL(
track, fPreviousStepLength, &condition);
326 if (physIntLength < fProposedStep) {
327 fProposedStep = physIntLength;
331 physIntLength =
electron.ss->PostStepGPIL(
track, fPreviousStepLength, &condition);
332 if (physIntLength < fProposedStep) {
333 fProposedStep = physIntLength;
337 physIntLength =
electron.brems->PostStepGPIL(
track, fPreviousStepLength, &condition);
338 if (physIntLength < fProposedStep) {
339 fProposedStep = physIntLength;
343 physIntLength =
electron.ioni->PostStepGPIL(
track, fPreviousStepLength, &condition);
344 if (physIntLength < fProposedStep) {
345 fProposedStep = physIntLength;
351 if (physIntLength < fProposedStep) {
352 fProposedStep = physIntLength;
358 if (physIntLength < fProposedStep) {
359 fProposedStep = physIntLength;
362 if (
selection == CandidateForSelection) {
367 return fProposedStep;
370 void AlongStepDoIt(G4Track &
track, G4Step &
step, G4TrackVector &)
override {
371 if (
step.GetStepLength() == fProposedStep) {
372 step.GetPostStepPoint()->SetStepStatus(fAlongStepDoItProc);
378 G4VParticleChange *particleChange;
381 particleChange->UpdateStepForAlongStep(&
step);
382 track.SetTrackStatus(particleChange->GetTrackStatus());
383 particleChange->Clear();
386 particleChange->UpdateStepForAlongStep(&
step);
387 track.SetTrackStatus(particleChange->GetTrackStatus());
388 particleChange->Clear();
390 fPreviousStepLength =
step.GetStepLength();
393 void PostStepDoIt(G4Track &
track, G4Step &
step, G4TrackVector &secondaries)
override {
397 step.GetPostStepPoint()->SetStepStatus(fPostStepDoItProc);
401 G4VParticleChange *particleChange =
nullptr;
422 particleChange->UpdateStepForPostStep(&
step);
425 int numSecondaries = particleChange->GetNumberOfSecondaries();
426 for (
int i = 0;
i < numSecondaries;
i++) {
427 G4Track *secondary = particleChange->GetSecondary(
i);
428 secondary->SetParentID(
track.GetTrackID());
429 secondary->SetCreatorProcess(
process);
430 secondaries.push_back(secondary);
433 track.SetTrackStatus(particleChange->GetTrackStatus());
434 particleChange->Clear();
439 G4double fPreviousStepLength;
440 G4double fProposedStep;
444 ElectronPhysics
physics(*
this);
453 void StartTracking(G4Track *aTrack)
override {
456 positron.msc->StartTracking(aTrack);
457 positron.ioni->StartTracking(aTrack);
458 positron.brems->StartTracking(aTrack);
459 positron.annihilation->StartTracking(aTrack);
461 positron.nuc->StartTracking(aTrack);
463 fPreviousStepLength = 0;
465 void EndTracking()
override {
471 positron.annihilation->EndTracking();
476 G4double GetPhysicalInteractionLength(
const G4Track &
track)
override {
478 G4double physIntLength, proposedSafety = DBL_MAX;
479 G4ForceCondition condition;
482 fProposedStep = DBL_MAX;
485 physIntLength =
positron.nuc->PostStepGPIL(
track, fPreviousStepLength, &condition);
486 if (physIntLength < fProposedStep) {
487 fProposedStep = physIntLength;
491 physIntLength =
positron.ss->PostStepGPIL(
track, fPreviousStepLength, &condition);
492 if (physIntLength < fProposedStep) {
493 fProposedStep = physIntLength;
497 physIntLength =
positron.annihilation->PostStepGPIL(
track, fPreviousStepLength, &condition);
498 if (physIntLength < fProposedStep) {
499 fProposedStep = physIntLength;
503 physIntLength =
positron.brems->PostStepGPIL(
track, fPreviousStepLength, &condition);
504 if (physIntLength < fProposedStep) {
505 fProposedStep = physIntLength;
509 physIntLength =
positron.ioni->PostStepGPIL(
track, fPreviousStepLength, &condition);
510 if (physIntLength < fProposedStep) {
511 fProposedStep = physIntLength;
517 if (physIntLength < fProposedStep) {
518 fProposedStep = physIntLength;
524 if (physIntLength < fProposedStep) {
525 fProposedStep = physIntLength;
528 if (
selection == CandidateForSelection) {
533 return fProposedStep;
536 void AlongStepDoIt(G4Track &
track, G4Step &
step, G4TrackVector &)
override {
537 if (
step.GetStepLength() == fProposedStep) {
538 step.GetPostStepPoint()->SetStepStatus(fAlongStepDoItProc);
544 G4VParticleChange *particleChange;
547 particleChange->UpdateStepForAlongStep(&
step);
548 track.SetTrackStatus(particleChange->GetTrackStatus());
549 particleChange->Clear();
552 particleChange->UpdateStepForAlongStep(&
step);
553 track.SetTrackStatus(particleChange->GetTrackStatus());
554 particleChange->Clear();
556 fPreviousStepLength =
step.GetStepLength();
559 void PostStepDoIt(G4Track &
track, G4Step &
step, G4TrackVector &secondaries)
override {
563 step.GetPostStepPoint()->SetStepStatus(fPostStepDoItProc);
567 G4VParticleChange *particleChange =
nullptr;
592 particleChange->UpdateStepForPostStep(&
step);
595 int numSecondaries = particleChange->GetNumberOfSecondaries();
596 for (
int i = 0;
i < numSecondaries;
i++) {
597 G4Track *secondary = particleChange->GetSecondary(
i);
598 secondary->SetParentID(
track.GetTrackID());
599 secondary->SetCreatorProcess(
process);
600 secondaries.push_back(secondary);
603 track.SetTrackStatus(particleChange->GetTrackStatus());
604 particleChange->Clear();
607 G4bool HasAtRestProcesses()
override {
return true; }
609 void AtRestDoIt(G4Track &
track, G4Step &
step, G4TrackVector &secondaries)
override {
612 G4VParticleChange *particleChange =
positron.annihilation->AtRestDoIt(
track,
step);
613 particleChange->UpdateStepForAtRest(&
step);
616 int numSecondaries = particleChange->GetNumberOfSecondaries();
617 for (
int i = 0;
i < numSecondaries;
i++) {
618 G4Track *secondary = particleChange->GetSecondary(
i);
619 secondary->SetParentID(
track.GetTrackID());
620 secondary->SetCreatorProcess(
positron.annihilation);
621 secondaries.push_back(secondary);
624 track.SetTrackStatus(particleChange->GetTrackStatus());
625 particleChange->Clear();
630 G4double fPreviousStepLength;
631 G4double fProposedStep;
635 PositronPhysics
physics(*
this);
644 void StartTracking(G4Track *aTrack)
override {
645 fMgr.gammaProc->StartTracking(aTrack);
647 fPreviousStepLength = 0;
649 void EndTracking()
override { fMgr.gammaProc->EndTracking(); }
651 G4double GetPhysicalInteractionLength(
const G4Track &
track)
override {
652 G4double physIntLength;
653 G4ForceCondition condition;
655 fProposedStep = DBL_MAX;
658 physIntLength = fMgr.gammaProc->PostStepGPIL(
track, fPreviousStepLength, &condition);
659 if (physIntLength < fProposedStep) {
660 fProposedStep = physIntLength;
664 return fProposedStep;
667 void AlongStepDoIt(G4Track &, G4Step &
step, G4TrackVector &)
override {
668 if (
step.GetStepLength() == fProposedStep) {
669 step.GetPostStepPoint()->SetStepStatus(fAlongStepDoItProc);
674 fPreviousStepLength =
step.GetStepLength();
677 void PostStepDoIt(G4Track &
track, G4Step &
step, G4TrackVector &secondaries)
override {
681 step.GetPostStepPoint()->SetStepStatus(fPostStepDoItProc);
683 G4VProcess *
process = fMgr.gammaProc;
684 G4VParticleChange *particleChange = fMgr.gammaProc->PostStepDoIt(
track,
step);
686 particleChange->UpdateStepForPostStep(&
step);
689 int numSecondaries = particleChange->GetNumberOfSecondaries();
690 for (
int i = 0;
i < numSecondaries;
i++) {
691 G4Track *secondary = particleChange->GetSecondary(
i);
692 secondary->SetParentID(
track.GetTrackID());
693 secondary->SetCreatorProcess(
process);
694 secondaries.push_back(secondary);
697 track.SetTrackStatus(particleChange->GetTrackStatus());
698 particleChange->Clear();
703 G4double fPreviousStepLength;
704 G4double fProposedStep;
713 const G4ParticleDefinition *
part = aTrack->GetParticleDefinition();
715 if (
part == G4Electron::Definition()) {
717 }
else if (
part == G4Positron::Definition()) {
719 }
else if (
part == G4Gamma::Definition()) {
723 aTrack->SetTrackStatus(fStopAndKill);
static void TrackNeutralParticle(G4Track *aTrack, PhysicsImpl &physics)
~CMSEmStandardPhysicsTrackingManager() override
void TrackGamma(G4Track *aTrack)
G4eplusAnnihilation * annihilation
G4MscStepLimitType fStepLimitType
void TrackElectron(G4Track *aTrack)
G4eMultipleScattering * msc
G4GammaGeneralProcess * gammaProc
void PreparePhysicsTable(const G4ParticleDefinition &) override
static void TrackChargedParticle(G4Track *aTrack, PhysicsImpl &physics)
void HandOverOneTrack(G4Track *aTrack) override
void BuildPhysicsTable(const G4ParticleDefinition &) override
void TrackPositron(G4Track *aTrack)
struct CMSEmStandardPhysicsTrackingManager::@991 electron
CMSEmStandardPhysicsTrackingManager(const edm::ParameterSet &p)
G4ElectronNuclearProcess * nuc
struct CMSEmStandardPhysicsTrackingManager::@992 positron
static CMSEmStandardPhysicsTrackingManager * masterTrackingManager
G4eBremsstrahlung * brems