BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSBunchFileBased.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 BDSBUNCHFILEBASED_H
19#define BDSBUNCHFILEBASED_H
20
21#include "BDSBunch.hh"
22
23#include "G4String.hh"
24
37{
38public:
39 explicit BDSBunchFileBased(const G4String& distributionName);
40 virtual ~BDSBunchFileBased();
45
48 virtual void BeginOfRunAction(G4int numberOfEvents,
49 G4bool batchMode);
50
52 unsigned long long int NOriginalEvents() const {return nOriginalEvents;}
53 unsigned long long int NEventsInFile() const {return nEventsInFile;}
54 unsigned long long int NEventsInFileSkipped() const {return nEventsInFileSkipped;}
55 G4int DistrFileLoopNTimes() const {return distrFileLoopNTimes;}
57
58 void SetNEventsInFile(unsigned long long int nEventsInFileIn) {nEventsInFile = nEventsInFileIn;}
59 void SetNOriginalEvents(unsigned long long int nOriginalEventsIn) {nOriginalEvents = nOriginalEventsIn;}
60
61 void IncrementNEventsInFileSkipped() {nEventsInFileSkipped += 1;}
62 void IncrementNEventsInFileSkipped(unsigned long long int plus) {nEventsInFileSkipped += plus;}
63
65 virtual void SetOptions(const BDSParticleDefinition* beamParticle,
66 const GMAD::Beam& beam,
67 const BDSBunchType& distrType,
68 G4Transform3D beamlineTransformIn = G4Transform3D::Identity,
69 const G4double beamlineS = 0);
70
71protected:
72 unsigned long long int nOriginalEvents;
73 unsigned long long int nEventsInFile;
74 unsigned long long int nEventsInFileSkipped;
75 G4bool distrFileLoop;
76 G4int distrFileLoopNTimes;
77};
78
79#endif
An intermediate layer for any bunch classes that are file based.
BDSBunchFileBased(BDSBunchFileBased &)=delete
Assignment and copy constructor not implemented nor used.
unsigned long long int nEventsInFile
The number of entries in the file loaded.
unsigned long long int NOriginalEvents() const
Accessor.
virtual void BeginOfRunAction(G4int numberOfEvents, G4bool batchMode)
unsigned long long int NEventsInFileSkipped() const
Accessor.
unsigned long long int nEventsInFileSkipped
Number that are skipped as we go through the file due to filters.
G4int DistrFileLoopNTimes() const
Accessor.
unsigned long long int nOriginalEvents
nOriginalEvents from upstream file if skimmed - need to pass through.
virtual void SetOptions(const BDSParticleDefinition *beamParticle, const GMAD::Beam &beam, const BDSBunchType &distrType, G4Transform3D beamlineTransformIn=G4Transform3D::Identity, const G4double beamlineS=0)
Pull out the relevant options and then pass through to BDSBunch::SetOptions().
BDSBunchFileBased & operator=(const BDSBunchFileBased &)=delete
Assignment and copy constructor not implemented nor used.
unsigned long long int NEventsInFile() const
Accessor.
The base class for bunch distribution generators.
Definition BDSBunch.hh:46
G4double beamlineS
Beamline initial S position.
Definition BDSBunch.hh:218
Wrapper for particle definition.
Improve type-safety of native enum data type in C++.
Beam class.
Definition beam.h:43