BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSLaserCompton.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 BDSLASERCOMPTON_H
19#define BDSLASERCOMPTON_H
20
21#include "globals.hh"
22#include "G4VDiscreteProcess.hh"
23#include "G4Electron.hh"
24#include "G4Positron.hh"
25#include "BDSMaterials.hh"
26
27#include <limits>
28
31
32class G4Step;
33class G4Track;
34
35// flag initiated in BDSEventAction
36extern G4bool FireLaserCompton;
37
52class BDSLaserCompton: public G4VDiscreteProcess
53{
54public:
55
56 explicit BDSLaserCompton(const G4String& processName = "eLaser");
57
58 virtual ~BDSLaserCompton();
59
61 virtual G4bool IsApplicable(const G4ParticleDefinition&);
62
64 virtual G4double GetMeanFreePath(const G4Track& track,
65 G4double previousStepSize,
66 G4ForceCondition* condition );
67
68 virtual G4VParticleChange *PostStepDoIt(const G4Track& track,
69 const G4Step& step);
70
71 inline void SetLaserDirection(G4ThreeVector aDirection);
72 inline G4ThreeVector GetLaserDirection() const;
73
74 inline void SetLaserWavelength(G4double aWavelength);
75 inline G4double GetLaserWavelength() const;
76
77protected:
78 G4double ComputeMeanFreePath( const G4ParticleDefinition* ParticleType,
79 G4double KineticEnergy,
80 const G4Material* aMaterial);
81
82private:
83 // assignment and copy constructor not implemented nor used
84 BDSLaserCompton & operator=(const BDSLaserCompton &right);
86
87 BDSGlobalConstants* globals;
88
89 G4double laserWavelength;
90 G4ThreeVector laserDirection;
91 G4double laserEnergy;
92 BDSComptonEngine* comptonEngine;
93};
94
95inline G4bool BDSLaserCompton::IsApplicable(const G4ParticleDefinition& particle)
96{
97 return ( (&particle == G4Electron::Electron()) || (&particle == G4Positron::Positron()) );
98}
99
100inline G4double BDSLaserCompton::GetMeanFreePath(const G4Track& track,
101 G4double /*PreviousStepSize*/,
102 G4ForceCondition* ForceCondition)
103{
104 if ( track.GetMaterial() == BDSMaterials::Instance()->GetMaterial("LaserVac") &&
105 FireLaserCompton )
106 {*ForceCondition = Forced;}
107 return std::numeric_limits<double>::max();
108}
109
110inline void BDSLaserCompton::SetLaserDirection(G4ThreeVector laserDirectionIn)
111{laserDirection = laserDirectionIn;}
112
113inline G4ThreeVector BDSLaserCompton::GetLaserDirection() const
114{return laserDirection;}
115
116inline void BDSLaserCompton::SetLaserWavelength(G4double wavelengthIn)
117{laserWavelength = wavelengthIn;}
118
119inline G4double BDSLaserCompton::GetLaserWavelength() const
120{return laserWavelength;}
121
122#endif
Engine to calculate product of compton scattering process.
A class that holds global options and constants.
Laser compton scattering process to achieve a laserwire.
virtual G4bool IsApplicable(const G4ParticleDefinition &)
Overridden from G4VProcess - whether applicable to a particular particle.
virtual G4double GetMeanFreePath(const G4Track &track, G4double previousStepSize, G4ForceCondition *condition)
Overridden from G4VDiscreteProcess.
static BDSMaterials * Instance()
Singleton pattern access.
G4Material * GetMaterial(G4String material) const
Get material by name.