BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSModulatorLinearT.hh
1/*
2Beam Delivery Simulation (BDSIM) Copyright (C) Royal Holloway,
3University of London 2001 - 2024.
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 BDSMODULATORLINEART_H
20#define BDSMODULATORLINEART_H
21
22#include "BDSModulator.hh"
23
24#include "G4Types.hh"
25
35{
36public:
37 BDSModulatorLinearT() = delete;
38 explicit BDSModulatorLinearT(G4double T0,
39 G4double T1,
40 G4double slopeIn = 0.0,
41 G4double yInterceptIn = 1.0);
42 virtual ~BDSModulatorLinearT() = default;
43
45 virtual G4double Factor(const G4ThreeVector& xyz,
46 G4double T) const;
47
48 virtual G4bool VariesWithTime() const {return true;}
49
51 virtual G4double RecommendedMaxStepLength() const;
52
53private:
54 G4double T0;
55 G4double T1;
56 G4double slope;
57 G4double yIntercept;
58};
59
60#endif
Top-hat modulator as a function of T.
virtual G4double Factor(const G4ThreeVector &xyz, G4double T) const
Returns value of equation in brief at the top of this file.
virtual G4bool VariesWithTime() const
Each derived class should override this.
virtual G4double RecommendedMaxStepLength() const
Return difference in T0, T1 / 20.
Base class for a modulator.