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 - 2024.
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::ConstructParticle();
43}
44
46{
47 if (Activated())
48 {return;}
49
50 G4HadronInelasticProcess* inelProcIon = new G4HadronInelasticProcess("EMD", G4GenericIon::GenericIon());
51#ifdef G4EMDPROCESSID
52 // in our customised Geant4 we explicitly label EMD to allow identification and biasing
53 // as opposed to just general fHadronicInelastic
54 inelProcIon->SetProcessSubType(G4HadronicProcessType::fEMDissociation);
55#endif
56
57 G4EMDissociationCrossSection* crossSectionData = new G4EMDissociationCrossSection();
58 inelProcIon->AddDataSet(crossSectionData);
59
60 G4EMDissociation* emdModel = new G4EMDissociation();
61 emdModel->SetMaxEnergy(100*CLHEP::TeV);
62 emdModel->SetMinEnergy(1*CLHEP::MeV);
63 inelProcIon->RegisterMe(emdModel);
64
65 G4ProcessManager* pmanager = G4GenericIon::GenericIon()->GetProcessManager();
66 pmanager->AddDiscreteProcess(inelProcIon);
67
69}
virtual void ConstructParticle()
Construct all leptons, 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.
void SetActivated()
Flag this instance as activated for later querying.