/
Photocathode.pm
75 lines (52 loc) · 1.95 KB
/
Photocathode.pm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
package Physics::UEMColumn::Photocathode;
=head1 NAME
Physics::UEMColumn::Photocathode - Class representing a photocathode for the Physics::UEMColumn simulation
=head1 SYNOPSIS
use strict;
use warnings;
use Physics::UEMColumn alias => ':standard';
my $photocathode = Photocathode->new(
energy_fermi => '5.3 eV',
work_function => '4.25 eV',
);
=cut
use Moose;
use namespace::autoclean;
use Method::Signatures;
use MooseX::Types::NumUnit qw/num_of_unit/;
use Physics::UEMColumn::Pulse;
use Physics::UEMColumn::Auxiliary qw/:constants/;
my $type_energy = num_of_unit( 'J' );
has 'energy_fermi' => ( isa => $type_energy, is => 'ro', required => 1 );
has 'work_function' => ( isa => $type_energy, is => 'ro', required => 1 );
has 'location' => ( isa => num_of_unit('m'), is => 'ro', default => 0 );
has 'column' => ( isa => 'Physics::UEMColumn::Column', is => 'rw', predicate => 'has_column' );
method generate_pulse ( Num $num ) {
die 'Photocathode requires access to column object' unless $self->has_column;
my $column = $self->column;
my $laser = $column->laser;
my $acc = $column->accelerator;
my $tau = $laser->duration;
my $e_laser = $laser->energy;
my $work_function = $self->work_function;
my $e_fermi = $self->energy_fermi;
my $field = $acc->field;
my $delta_E = $e_laser - $work_function;
my $velfront = sqrt( 2 * $delta_E / me );
my $eta_t = me * $e_fermi / 3 * ( $e_laser - $work_function ) / ( $e_laser + $e_fermi );
my $sigma_z = (($velfront*$tau)**2) / 2 + ( qe / ( 4 * me ) * $field * ($tau**2))**2;
my $pulse = Physics::UEMColumn::Pulse->new(
velocity => 0,
location => $self->location(),
number => $num,
sigma_t => (($laser->width)**2) / 2,
sigma_z => $sigma_z,
eta_t => $eta_t,
eta_z => $eta_t / 4,
gamma_t => 0,
gamma_z => sqrt($sigma_z) * ( 0.06 * me * $velfront + qe / sqrt(2) * $field * $tau),
);
return $pulse;
}
__PACKAGE__->meta->make_immutable;
1;