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) 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 BDSLINKPRIMARYGENERATORACTION_H
19#define BDSLINKPRIMARYGENERATORACTION_H
20
21#include "BDSExtent.hh"
22
23#include "G4VUserPrimaryGeneratorAction.hh"
24
25class BDSBunch;
27class BDSOutputLoader;
29class G4Event;
30class G4ParticleGun;
31
38class BDSLinkPrimaryGeneratorAction: public G4VUserPrimaryGeneratorAction
39{
40public:
43 int* currentElementIndexIn,
44 BDSLinkDetectorConstruction* constructionIn,
45 G4bool debugIn = false);
47
49 virtual void GeneratePrimaries(G4Event*);
50
52 inline void SetWorldExtent(const BDSExtent worldExtentIn) {worldExtent = worldExtentIn;}
53
54private:
55
59 G4bool debug;
60 G4ParticleGun* particleGun;
61
64
67 //G4bool ionCached;
68};
69
70#endif
The base class for bunch distribution generators.
Definition BDSBunch.hh:46
Holder for +- extents in 3 dimensions.
Definition BDSExtent.hh:38
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.