BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSBeamlineIntegral.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 BDSBEAMLINEINTEGRAL_H
19#define BDSBEAMLINEINTEGRAL_H
20
21#include "BDSParticleDefinition.hh"
22
23#include "G4Types.hh"
24
25namespace GMAD
26{
27 struct Element;
28}
29
40{
41public:
42 BDSBeamlineIntegral() = delete;
43 explicit BDSBeamlineIntegral(const BDSParticleDefinition& incomingParticle,
44 G4double T0In = 0,
45 G4double integratedArcLength = 0,
46 G4bool integrateKineticEnergyIn = true);
48
51 void Integrate(const GMAD::Element& componentAsDefined);
52
58
62
63 G4double MomentumAtStartOfLastElement() const {return designParticle.Momentum();}
64 G4double KineticEnergyAtStartOfLastElement() const {return designParticle.KineticEnergy();}
65
67 G4double synchronousTAtEnd;
68 G4double synchronousTAtMiddleOfLastElement;
69 G4double arcLength;
70 BDSParticleDefinition designParticle;
71 G4bool changeOfEnergyEncountered;
73};
74
75#endif
A class that holds the current integrated quantities along a beam line.
void Integrate(const GMAD::Element &componentAsDefined)
G4bool integrateKineticEnergy
On by default, but allow control to not integrate it for old behaviour.
G4double ProvideSynchronousTAtEndOfNextElement(const GMAD::Element *el) const
G4int rigidityCount
Which change in rigidity we're at. Starts at 0, +1 after each change. Used for naming.
G4double ProvideSynchronousTAtCentreOfNextElement(const GMAD::Element *el) const
Wrapper for particle definition.
G4double Momentum() const
Accessor.
G4double KineticEnergy() const
Accessor.
Parser namespace for GMAD language. Combination of Geant4 and MAD.
Element class.
Definition element.h:47