OPAL (Object Oriented Parallel Accelerator Library) 2024.2
OPAL
Stripper.h
Go to the documentation of this file.
1//
2// Class Stripper
3// The Stripper element defines the interface for a stripping foil
4//
5// Copyright (c) 2011, Jianjun Yang, Paul Scherrer Institut, Villigen PSI, Switzerland
6// Copyright (c) 2017-2019, Paul Scherrer Institut, Villigen PSI, Switzerland
7// All rights reserved
8//
9// Implemented as part of the PhD thesis
10// "Beam dynamics in high intensity cyclotrons including neighboring bunch effects"
11// and the paper
12// "Beam dynamics in high intensity cyclotrons including neighboring bunch effects:
13// Model, implementation, and application"
14// (https://journals.aps.org/prab/pdf/10.1103/PhysRevSTAB.13.064201)
15//
16// This file is part of OPAL.
17//
18// OPAL is free software: you can redistribute it and/or modify
19// it under the terms of the GNU General Public License as published by
20// the Free Software Foundation, either version 3 of the License, or
21// (at your option) any later version.
22//
23// You should have received a copy of the GNU General Public License
24// along with OPAL. If not, see <https://www.gnu.org/licenses/>.
25//
26#ifndef CLASSIC_Stripper_HH
27#define CLASSIC_Stripper_HH
28
31
32#include <string>
33
34class Stripper: public PluginElement {
35
36public:
38 explicit Stripper(const std::string &name);
39
40 Stripper();
41 Stripper(const Stripper &);
42 void operator=(const Stripper &) = delete;
43 virtual ~Stripper();
44
46 virtual void accept(BeamlineVisitor &) const override;
48 virtual ElementType getType() const override;
50
52 void setOPCharge(double charge);
53 double getOPCharge() const;
54 void setOPMass(double mass);
55 double getOPMass() const;
56 void setOPYield(double yield);
57 double getOPYield() const;
58 void setStop(bool stopflag);
59 bool getStop() const;
61
62 virtual int getRequiredNumberOfTimeSteps() const override;
63
64private:
66 virtual bool doCheck(PartBunchBase<double, 3> *bunch, const int turnnumber, const double t, const double tstep) override;
68 virtual void doFinalise() override;
70 virtual bool doPreCheck(PartBunchBase<double, 3>*) override;
72 virtual bool doFinaliseCheck(PartBunchBase<double, 3> *bunch, bool flagNeedUpdate) override;
73
74 double opcharge_m;
75 double opmass_m;
76 double opyield_m;
77 bool stop_m;
78};
79
80inline
82{
83 return 1;
84}
85
86#endif // CLASSIC_Stripper_HH
ElementType
Definition ElementBase.h:89
const std::string name
double opcharge_m
Charge number of the out-coming particle.
Definition Stripper.h:74
virtual ~Stripper()
Definition Stripper.cpp:64
virtual bool doPreCheck(PartBunchBase< double, 3 > *) override
Virtual hook for preCheck.
Definition Stripper.cpp:106
void setOPCharge(double charge)
Member variable access.
Definition Stripper.cpp:74
double getOPMass() const
Definition Stripper.cpp:94
virtual void accept(BeamlineVisitor &) const override
Apply visitor to Stripper.
Definition Stripper.cpp:66
double getOPCharge() const
Definition Stripper.cpp:90
void operator=(const Stripper &)=delete
virtual int getRequiredNumberOfTimeSteps() const override
Definition Stripper.h:81
void setStop(bool stopflag)
Definition Stripper.cpp:86
bool getStop() const
Definition Stripper.cpp:102
void setOPYield(double yield)
Definition Stripper.cpp:82
void setOPMass(double mass)
Definition Stripper.cpp:78
double opmass_m
Mass of the out-coming particle.
Definition Stripper.h:75
virtual bool doCheck(PartBunchBase< double, 3 > *bunch, const int turnnumber, const double t, const double tstep) override
Record hits when bunch particles pass.
Definition Stripper.cpp:121
double getOPYield() const
Definition Stripper.cpp:98
double opyield_m
Yield of the out-coming particle.
Definition Stripper.h:76
virtual void doFinalise() override
Virtual hook for finalise.
Definition Stripper.cpp:70
bool stop_m
Flag if particles should be stripped or stopped.
Definition Stripper.h:77
virtual ElementType getType() const override
Override implementation of PluginElement.
Definition Stripper.cpp:201
virtual bool doFinaliseCheck(PartBunchBase< double, 3 > *bunch, bool flagNeedUpdate) override
Virtual hook for finaliseCheck.
Definition Stripper.cpp:187