BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
BDSBunchEventGenerator.hh
1/*
2Beam Delivery Simulation (BDSIM) Copyright (C) Royal Holloway,
3University of London 2001 - 2022.
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 BDSBUNCHEVENTGENERATOR_H
20#define BDSBUNCHEVENTGENERATOR_H
21
22#include "BDSBunch.hh"
23
24#include "G4RotationMatrix.hh"
25#include "G4Types.hh"
26
27#include <vector>
28
37{
38public:
40 virtual ~BDSBunchEventGenerator();
45 virtual void SetOptions(const BDSParticleDefinition* beamParticle,
46 const GMAD::Beam& beam,
47 const BDSBunchType& distrType,
48 G4Transform3D beamlineTransformIn = G4Transform3D::Identity,
49 G4double beamlineS = 0);
50 virtual void CheckParameters();
51
54 G4bool AcceptParticle(const BDSParticleCoordsFull& coords,
55 G4double rpOriginal,
56 G4double kineticEnergy,
57 G4int pdgID);
58
60 G4RotationMatrix ReferenceBeamMomentumOffset() const;
61
62protected:
67
87 G4double Rp0;
89
91 std::vector<G4int> acceptedParticles;
92
93private:
94 G4bool firstTime;
97};
98
99#endif
A wrapper of BDSBunch to include a filter for the events loaded by an event generator.
G4RotationMatrix ReferenceBeamMomentumOffset() const
Get a rotation matrix according to Xp0 and Yp0.
G4double Rp0
Cache of limit.
G4double eventGeneratorMinRp
Cache of limit.
G4double eventGeneratorMaxZ
Cache of limit.
BDSBunchEventGenerator(BDSBunchEventGenerator &)=delete
Assignment and copy constructor not implemented nor used.
G4double eventGeneratorMaxXp
Cache of limit.
G4double eventGeneratorMinXp
Cache of limit.
G4String acceptedParticlesString
Cache of string for parsing on first query.
G4double eventGeneratorMaxEK
Cache of limit.
G4double eventGeneratorMinY
Cache of limit.
G4double eventGeneratorMaxRp
Cache of limit.
G4double eventGeneratorMaxT
Cache of limit.
BDSBunchEventGenerator & operator=(const BDSBunchEventGenerator &)=delete
Assignment and copy constructor not implemented nor used.
G4double eventGeneratorMinT
Cache of limit.
G4double eventGeneratorMaxYp
Cache of limit.
G4double eventGeneratorMinZp
Cache of limit.
G4double eventGeneratorMaxX
Cache of limit.
G4bool firstTime
Flag to prepare acceptedParticles on first call.
G4double eventGeneratorMinZ
Cache of limit.
G4double eventGeneratorMaxY
Cache of limit.
std::vector< G4int > acceptedParticles
Vector (sorted) of permitted particles.
G4bool testOnParticleType
Flag whether to bother applying search.
G4double eventGeneratorMinEK
Cache of limit.
G4double eventGeneratorMinYp
Cache of limit.
G4double eventGeneratorMinX
Cache of limit.
virtual void SetOptions(const BDSParticleDefinition *beamParticle, const GMAD::Beam &beam, const BDSBunchType &distrType, G4Transform3D beamlineTransformIn=G4Transform3D::Identity, G4double beamlineS=0)
G4double eventGeneratorMaxZp
Cache of limit.
G4bool AcceptParticle(const BDSParticleCoordsFull &coords, G4double rpOriginal, G4double kineticEnergy, G4int pdgID)
The base class for bunch distribution generators.
Definition: BDSBunch.hh:47
G4double beamlineS
Beamline initial S position.
Definition: BDSBunch.hh:201
A set of particle coordinates including energy and weight.
Wrapper for particle definition.
Improve type-safety of native enum data type in C++.
Beam class.
Definition: beam.h:44