BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSBunchEventGenerator.hh
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#ifndef BDSBUNCHEVENTGENERATOR_H
19#define BDSBUNCHEVENTGENERATOR_H
20
21#include "BDSBunchFileBased.hh"
22
23#include "G4RotationMatrix.hh"
24#include "G4Types.hh"
25
26#include <set>
27
36{
37public:
39 virtual ~BDSBunchEventGenerator();
44
45 // Make friends so they can access protected members
48
49 virtual void SetOptions(const BDSParticleDefinition* beamParticle,
50 const GMAD::Beam& beam,
51 const BDSBunchType& distrType,
52 G4Transform3D beamlineTransformIn = G4Transform3D::Identity,
53 G4double beamlineS = 0);
54 virtual void CheckParameters();
55
58 G4bool AcceptParticle(const BDSParticleCoordsFull& coords,
59 G4double rpOriginal,
60 G4double kineticEnergy,
61 G4int pdgID);
62
64 G4RotationMatrix ReferenceBeamMomentumOffset() const;
65
66protected:
71
92 G4double Rp0;
94
96 std::set<G4int> acceptedParticles;
97
98private:
99 G4bool firstTime;
102};
103
104#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.
G4int eventGeneratorNEventsSkip
Cache of limit.
G4double eventGeneratorMaxZ
Cache of limit.
std::set< G4int > acceptedParticles
Vector (sorted) of permitted particles.
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.
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)
Pull out the relevant options and then pass through to BDSBunch::SetOptions().
G4double eventGeneratorMaxZp
Cache of limit.
G4bool AcceptParticle(const BDSParticleCoordsFull &coords, G4double rpOriginal, G4double kineticEnergy, G4int pdgID)
An intermediate layer for any bunch classes that are file based.
G4double beamlineS
Beamline initial S position.
Definition BDSBunch.hh:218
A set of particle coordinates including energy and weight.
Wrapper for particle definition.
Loader to use any HepMC3 compatible file.
Loader to read a specific sampler from a BDSIM ROOT output file.
Improve type-safety of native enum data type in C++.
Beam class.
Definition beam.h:43