BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSPhysicsEMDissociation.cc
1/*
2Beam Delivery Simulation (BDSIM) Copyright (C) Royal Holloway,
3University of London 2001 - 2023.
4
5This file is part of BDSIM.
6
7BDSIM is free software: you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published
9by the Free Software Foundation version 3 of the License.
10
11BDSIM is distributed in the hope that it will be useful, but
12WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with BDSIM. If not, see <http://www.gnu.org/licenses/>.
18*/
19#include "BDSPhysicsEMDissociation.hh"
20
21#include "G4EMDissociation.hh"
22#include "G4EMDissociationCrossSection.hh"
23#include "G4Gamma.hh"
24#include "G4GenericIon.hh"
25#include "G4HadronInelasticProcess.hh"
26#include "G4IonConstructor.hh"
27#include "G4ProcessManager.hh"
28
29#ifdef G4EMDPROCESSID
30#include "G4HadronicProcessType.hh"
31#endif
32
33BDSPhysicsEMDissociation::BDSPhysicsEMDissociation():
34 G4VPhysicsConstructor("BDSPhysicsEMDissociation")
35{;}
36
38{
39 G4Gamma::Gamma();
40 G4GenericIon::GenericIon();
41
42 G4IonConstructor pConstructor;
43 pConstructor.ConstructParticle();
44}
45
47{
48 if (Activated())
49 {return;}
50
51 G4HadronInelasticProcess* inelProcIon = new G4HadronInelasticProcess("EMD", G4GenericIon::GenericIon());
52#ifdef G4EMDPROCESSID
53 // in our customised Geant4 we explicitly label EMD to allow identification and biasing
54 // as opposed to just general fHadronicInelastic
55 inelProcIon->SetProcessSubType(G4HadronicProcessType::fEMDissociation);
56#endif
57
58 G4EMDissociationCrossSection* crossSectionData = new G4EMDissociationCrossSection();
59 inelProcIon->AddDataSet(crossSectionData);
60
61 G4EMDissociation* emdModel = new G4EMDissociation();
62 emdModel->SetMaxEnergy(100*CLHEP::TeV);
63 emdModel->SetMinEnergy(1*CLHEP::MeV);
64 inelProcIon->RegisterMe(emdModel);
65
66 G4ProcessManager* pmanager = G4GenericIon::GenericIon()->GetProcessManager();
67 pmanager->AddDiscreteProcess(inelProcIon);
68
70}
virtual void ConstructParticle()
Construct all leptions, photons (inc optical), and pion +- just in case.
virtual void ConstructProcess()
Construct and attach the processes to the relevant particles.
G4bool Activated() const
Get whether this instance has been activated.
Definition: BDSSingleUse.hh:37
void SetActivated()
Flag this instance as activated for later querying.
Definition: BDSSingleUse.hh:40