BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSLinkBunch.hh
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#ifndef BDSLINKBUNCH_H
20#define BDSLINKBUNCH_H
21
22#include "BDSBunch.hh"
23#include "BDSParticleExternal.hh"
24
25#include <vector>
26
29
37{
38public:
40 virtual ~BDSLinkBunch();
41
44
46 void AddParticle(BDSParticleDefinition* particleDefinitionIn,
47 const BDSParticleCoordsFull& coordsIn,
48 int externalParticleID,
49 int externalParentID);
50
52 void ClearParticles();
53
55 inline size_t Size() const {return particles.size();}
56 inline int CurrentExternalParticleID() const {return currentExternalParticleID;}
57 inline int CurrentExternalParentID() const {return currentExternalParentID;}
59
61 inline virtual const BDSParticleDefinition* ParticleDefinition() const {return currentParticleDefinition;}
62
64 void UpdateGeant4ParticleDefinition(G4int pdgID);
65
67 virtual void UpdateIonDefinition();
68
69private:
70 G4int currentIndex;
71 G4int currentExternalParticleID;
72 G4int currentExternalParentID;
73 BDSParticleDefinition* currentParticleDefinition;
74
75 G4int size;
76 std::vector<BDSParticleExternal*> particles;
77};
78#endif
The base class for bunch distribution generators.
Definition BDSBunch.hh:47
A bunch distribution that holds a bunch from a Link.
virtual void UpdateIonDefinition()
Override method in BDSBunch to use our local currentParticleDefinition member.
void UpdateGeant4ParticleDefinition(G4int pdgID)
TBC.
int CurrentExternalParticleID() const
Accessor.
virtual const BDSParticleDefinition * ParticleDefinition() const
Access the current particle definition of the current particle in the bunch.
int CurrentExternalParentID() const
Accessor.
void AddParticle(BDSParticleDefinition *particleDefinitionIn, const BDSParticleCoordsFull &coordsIn, int externalParticleID, int externalParentID)
Append particle to the bunch for tracking.
void ClearParticles()
Delete all particle objects in the bunch and clear the vector.
G4int size
Number of particles (1 counting).
size_t Size() const
Accessor.
virtual BDSParticleCoordsFull GetNextParticleLocal()
Get the next particle.
A set of particle coordinates including energy and weight.
Wrapper for particle definition.