OPAL (Object Oriented Parallel Accelerator Library) 2022.1
OPAL
Septum.h
Go to the documentation of this file.
1//
2// Class Septum
3// Interface for a septum magnet
4//
5// Copyright (c) 2016-2020, Paul Scherrer Institut, Villigen PSI, Switzerland
6// All rights reserved
7//
8// This file is part of OPAL.
9//
10// OPAL is free software: you can redistribute it and/or modify
11// it under the terms of the GNU General Public License as published by
12// the Free Software Foundation, either version 3 of the License, or
13// (at your option) any later version.
14//
15// You should have received a copy of the GNU General Public License
16// along with OPAL. If not, see <https://www.gnu.org/licenses/>.
17//
18#ifndef CLASSIC_Septum_HH
19#define CLASSIC_Septum_HH
20
22
23class Septum: public PluginElement {
24
25public:
27 explicit Septum(const std::string &name);
28
29 Septum();
30 Septum(const Septum &);
31 void operator=(const Septum &) = delete;
32 virtual ~Septum();
33
35 virtual void accept(BeamlineVisitor &) const override;
37 virtual ElementType getType() const override;
38 virtual void initialise(PartBunchBase<double, 3> *bunch, double &startField, double &endField) override;
42
44 void setWidth(double width);
45 double getWidth() const;
47
48private:
50 virtual void doInitialise(PartBunchBase<double, 3> *bunch) override;
52 virtual bool doCheck(PartBunchBase<double, 3> *bunch, const int turnnumber, const double t, const double tstep) override;
54 virtual bool doPreCheck(PartBunchBase<double, 3>*) override;
55
57 double width_m;
59};
60
61#endif // CLASSIC_Septum_HH
ElementType
Definition: ElementBase.h:88
const std::string name
virtual void initialise(PartBunchBase< double, 3 > *bunch, double &startField, double &endField) override
Pure virtual implementation of Component.
Definition: Septum.h:23
virtual bool doCheck(PartBunchBase< double, 3 > *bunch, const int turnnumber, const double t, const double tstep) override
Record hits when bunch particles pass.
Definition: Septum.cpp:81
virtual ~Septum()
Definition: Septum.cpp:41
virtual void initialise(PartBunchBase< double, 3 > *bunch, double &startField, double &endField) override
Pure virtual implementation of Component.
Definition: Septum.cpp:47
virtual bool doPreCheck(PartBunchBase< double, 3 > *) override
Virtual hook for preCheck.
Definition: Septum.cpp:66
virtual ElementType getType() const override
Override implementation of PluginElement.
Definition: Septum.cpp:114
double width_m
input geometry positions
Definition: Septum.h:57
void operator=(const Septum &)=delete
void setWidth(double width)
Member variable access.
Definition: Septum.cpp:61
virtual void accept(BeamlineVisitor &) const override
Apply visitor to Septum.
Definition: Septum.cpp:43
Septum()
Definition: Septum.cpp:27
virtual void doInitialise(PartBunchBase< double, 3 > *bunch) override
Hook for initialise.
Definition: Septum.cpp:53
double getWidth() const
Definition: Septum.cpp:57