OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
Loading...
Searching...
No Matches
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:
30 CavityAutophaser(const PartData& ref, std::shared_ptr<Component> cavity);
31
33
35 const Vector_t<double, 3>& R, const Vector_t<double, 3>& P, double t, double dt);
36
37private:
38 double guessCavityPhase(double t);
39 std::pair<double, double> optimizeCavityPhase(double initialGuess, double t, double dt);
40
41 double track(double t, const double dt, const double phase, std::ofstream* out = nullptr) const;
42
44 std::shared_ptr<Component> itsCavity_m;
45
48};
49
50#endif
Defines the abstract interface for a single beamline component in the accelerator model.
ippl::Vector< T, Dim > Vector_t
Vector_t< double, 3 > initialR_m
double getPhaseAtMaxEnergy(const Vector_t< double, 3 > &R, const Vector_t< double, 3 > &P, double t, double dt)
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)
Vector_t< double, 3 > initialP_m
std::shared_ptr< Component > itsCavity_m
Particle reference data.
Definition PartData.h:37