OPAL (Object Oriented Parallel Accelerator Library) 2022.1
OPAL
CavityAutophaser.h
Go to the documentation of this file.
1//
2// Class CavityAutophaser
3//
4// This class determines the phase of an RF cavity for which the reference particle
5// is accelerated to the highest energy.
6//
7// Copyright (c) 2016, Christof Metzger-Kraus, Helmholtz-Zentrum Berlin, Germany
8// 2017 - 2020 Christof Metzger-Kraus
9//
10// All rights reserved
11//
12// This file is part of OPAL.
13//
14// OPAL is free software: you can redistribute it and/or modify
15// it under the terms of the GNU General Public License as published by
16// the Free Software Foundation, either version 3 of the License, or
17// (at your option) any later version.
18//
19// You should have received a copy of the GNU General Public License
20// along with OPAL. If not, see <https://www.gnu.org/licenses/>.
21//
22#ifndef CAVITYAUTOPHASER
23#define CAVITYAUTOPHASER
24
26#include "Algorithms/PartData.h"
27
29public:
31 std::shared_ptr<Component> cavity);
32
34
35 double getPhaseAtMaxEnergy(const Vector_t &R,
36 const Vector_t &P,
37 double t,
38 double dt);
39
40private:
41 double guessCavityPhase(double t);
42 std::pair<double, double> optimizeCavityPhase(double initialGuess,
43 double t,
44 double dt);
45
46 double track(double t,
47 const double dt,
48 const double phase,
49 std::ofstream *out = nullptr) const;
50
52 std::shared_ptr<Component> itsCavity_m;
53
56
57};
58
59#endif
double track(double t, const double dt, const double phase, std::ofstream *out=nullptr) const
const PartData & itsReference_m
double guessCavityPhase(double t)
std::pair< double, double > optimizeCavityPhase(double initialGuess, double t, double dt)
double getPhaseAtMaxEnergy(const Vector_t &R, const Vector_t &P, double t, double dt)
std::shared_ptr< Component > itsCavity_m
CavityAutophaser(const PartData &ref, std::shared_ptr< Component > cavity)
Particle reference data.
Definition: PartData.h:35