BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSLinkPrimaryGeneratorAction.hh
1/*
2Beam Delivery Simulation (BDSIM) Copyright (C) Royal Holloway,
3University of London 2001 - 2023.
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 BDSLINKPRIMARYGENERATORACTION_H
20#define BDSLINKPRIMARYGENERATORACTION_H
21
22#include "BDSExtent.hh"
23
24#include "G4VUserPrimaryGeneratorAction.hh"
25
26class BDSBunch;
28class BDSOutputLoader;
30class G4Event;
31class G4ParticleGun;
32
39class BDSLinkPrimaryGeneratorAction: public G4VUserPrimaryGeneratorAction
40{
41public:
44 int* currentElementIndexIn,
45 BDSLinkDetectorConstruction* constructionIn,
46 G4bool debugIn = false);
48
50 virtual void GeneratePrimaries(G4Event*);
51
53 inline void SetWorldExtent(const BDSExtent worldExtentIn) {worldExtent = worldExtentIn;}
54
55private:
56
60 G4bool debug;
61 G4ParticleGun* particleGun;
62
65
68 //G4bool ionCached;
69};
70
71#endif
The base class for bunch distribution generators.
Definition: BDSBunch.hh:47
Holder for +- extents in 3 dimensions.
Definition: BDSExtent.hh:39
Construction of the geometry in the case of a link model.
Generates primary particle vertices using BDSBunch.
BDSBunch * bunch
BDSIM particle generator.
virtual void GeneratePrimaries(G4Event *)
Main interface for Geant4. Prepare primary(ies) for the event.
void SetWorldExtent(const BDSExtent worldExtentIn)
Set the world extent that particle coordinates will be checked against.
int * currentElementIndex
External integer for which element to track in.
G4ParticleGun * particleGun
Geant4 particle gun that creates single particles.
BDSExtent worldExtent
World extent that particle coordinates are checked against to ensure they're inside it.
BDSLinkDetectorConstruction * construction
Cache of detector construction for link registry of transforms.
Loader of ROOT Event output for recreating events.
Class to load and use PTC 1 turn map.