OPALX (Object Oriented Parallel Accelerator Library for Exascal) MINIorX
OPALX
Tracker.h
Go to the documentation of this file.
1//
2// Class Tracker
3// Track particles or bunches.
4// An abstract base class for all visitors capable of tracking particles
5// through a beam element.
6// [P]
7// Phase space coordinates (in this order):
8// [DL]
9// [DT]x:[DD]
10// horizontal displacement (metres).
11// [DT]p_x/p_r:[DD]
12// horizontal canonical momentum (no dimension).
13// [DT]y:[DD]
14// vertical displacement (metres).
15// [DT]p_y/p_r:[DD]
16// vertical canonical momentum (no dimension).
17// [DT]delta_p/p_r:[DD]
18// relative momentum error (no dimension).
19// [DT]v*delta_t:[DD]
20// time difference delta_t w.r.t. the reference frame which moves with
21// uniform velocity
22// [P]
23// v_r = c*beta_r = p_r/m
24// [P]
25// along the design orbit, multiplied by the instantaneous velocity v of
26// the particle (metres).
27// [/DL]
28// Where
29// [DL]
30// [DT]p_r:[DD]
31// is the constant reference momentum defining the reference frame velocity.
32// [DT]m:[DD]
33// is the rest mass of the particles.
34// [/DL]
35// Other units used:
36// [DL]
37// [DT]reference momentum:[DD]
38// electron-volts.
39// [DT]accelerating voltage:[DD]
40// volts.
41// [DT]separator voltage:[DD]
42// volts.
43// [DT]frequencies:[DD]
44// hertz.
45// [DT]phase lags:[DD]
46// multiples of (2*pi).
47// [/DL]
48//
49// Copyright (c) 200x - 2020, Paul Scherrer Institut, Villigen PSI, Switzerland
50// All rights reserved
51//
52// This file is part of OPAL.
53//
54// OPAL is free software: you can redistribute it and/or modify
55// it under the terms of the GNU General Public License as published by
56// the Free Software Foundation, either version 3 of the License, or
57// (at your option) any later version.
58//
59// You should have received a copy of the GNU General Public License
60// along with OPAL. If not, see <https://www.gnu.org/licenses/>.
61//
62#ifndef CLASSIC_Tracker_HH
63#define CLASSIC_Tracker_HH
64
66#include "PartBunch/PartBunch.h"
67#include "Algorithms/PartData.h"
68
70
71class BMultipoleField;
72class Euclid3D;
73class OpalParticle;
74
75class Tracker : public AbstractTracker {
76public:
78 // The beam line to be tracked is [b]bl[/b].
79 // The particle reference data are taken from [b]data[/b].
80 // The particle bunch is initially empty.
81 // If [b]backBeam[/b] is true, the beam runs from s = C to s = 0.
82 // If [b]backTrack[/b] is true, we track against the beam.
83 Tracker(const Beamline&, const PartData&, bool backBeam, bool backTrack);
84
86 // The beam line to be tracked is [b]bl[/b].
87 // The particle reference data are taken from [b]data[/b].
88 // The particle bunch is taken from [b]bunch[/b].
89 // If [b]backBeam[/b] is true, the beam runs from s = C to s = 0.
90 // If [b]backTrack[/b] is true, we track against the beam.
91 Tracker(const Beamline&, PartBunch_t* bunch, const PartData&, bool backBeam, bool backTrack);
92
93 virtual ~Tracker();
94
96 const PartBunch_t* getBunch() const;
97
99 void addToBunch(const OpalParticle&);
100
102 //~ void setBunch(const PartBunch &);
103
105 // This override calls the component to track the bunch.
106 virtual void visitComponent(const Component&);
107
109 virtual void setNumBunch(short){};
110
112 virtual short getNumBunch() {
113 return 0;
114 }
115
116 // standing wave structures
118
120
121protected:
124 // typedef PartBunch::iterator iterator;
125
126private:
127 // Not implemented.
130 void operator=(const Tracker&);
131};
132
133#endif // CLASSIC_Tracker_HH
PartBunch< PLayout_t< double, 3 >, double, 3 > PartBunch_t
std::list< ClassicField > FieldList
Interface for a single beam element.
Definition Component.h:50
AbstractTracker(const Beamline &, const PartData &, bool backBeam, bool backTrack)
Constructor.
Particle reference data.
Definition PartData.h:37
void operator=(const Tracker &)
virtual ~Tracker()
Definition Tracker.cpp:87
virtual void setNumBunch(short)
set total number of tracked bunches
Definition Tracker.h:109
FieldList cavities_m
Definition Tracker.h:117
virtual short getNumBunch()
get total number of tracked bunches
Definition Tracker.h:112
Tracker(const Beamline &, const PartData &, bool backBeam, bool backTrack)
Constructor.
Definition Tracker.cpp:75
const Beamline & itsBeamline_m
Definition Tracker.h:119
virtual void visitComponent(const Component &)
Store the bunch.
Definition Tracker.cpp:101
void addToBunch(const OpalParticle &)
Add particle to bunch.
Definition Tracker.cpp:94
const PartBunch_t * getBunch() const
Return the current bunch.
Definition Tracker.cpp:90
Tracker(const Tracker &)
PartBunch_t * itsBunch_m
The bunch of particles to be tracked.
Definition Tracker.h:123
Displacement and rotation in space.
Definition Euclid3D.h:68
An abstract sequence of beam line components.
Definition Beamline.h:34
The magnetic field of a multipole.