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) BDSIM Collaboration, 2001 - 2026.
3
4This file is part of BDSIM.
5
6BDSIM is free software: you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published
8by the Free Software Foundation version 3 of the License.
9
10BDSIM is distributed in the hope that it will be useful, but
11WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with BDSIM. If not, see <http://www.gnu.org/licenses/>.
17*/
18#include "BDSPhysicsEMDissociation.hh"
19
20#include "G4EMDissociation.hh"
21#include "G4EMDissociationCrossSection.hh"
22#include "G4Gamma.hh"
23#include "G4GenericIon.hh"
24#include "G4HadronInelasticProcess.hh"
25#include "G4IonConstructor.hh"
26#include "G4ProcessManager.hh"
27
28#ifdef G4EMDPROCESSID
29#include "G4HadronicProcessType.hh"
30#endif
31
32BDSPhysicsEMDissociation::BDSPhysicsEMDissociation():
33 G4VPhysicsConstructor("BDSPhysicsEMDissociation")
34{;}
35
37{
38 G4Gamma::Gamma();
39 G4GenericIon::GenericIon();
40
41 G4IonConstructor::ConstructParticle();
42}
43
45{
46 if (Activated())
47 {return;}
48
49 G4HadronInelasticProcess* inelProcIon = new G4HadronInelasticProcess("EMD", G4GenericIon::GenericIon());
50#ifdef G4EMDPROCESSID
51 // in our customised Geant4 we explicitly label EMD to allow identification and biasing
52 // as opposed to just general fHadronicInelastic
53 inelProcIon->SetProcessSubType(G4HadronicProcessType::fEMDissociation);
54#endif
55
56 G4EMDissociationCrossSection* crossSectionData = new G4EMDissociationCrossSection();
57 inelProcIon->AddDataSet(crossSectionData);
58
59 G4EMDissociation* emdModel = new G4EMDissociation();
60 emdModel->SetMaxEnergy(100*CLHEP::TeV);
61 emdModel->SetMinEnergy(1*CLHEP::MeV);
62 inelProcIon->RegisterMe(emdModel);
63
64 G4ProcessManager* pmanager = G4GenericIon::GenericIon()->GetProcessManager();
65 pmanager->AddDiscreteProcess(inelProcIon);
66
68}
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.