OPAL (Object Oriented Parallel Accelerator Library) 2024.2
OPAL
CCollimator.h
Go to the documentation of this file.
1//
2// Class CCollimator
3// Interface for cyclotron collimator
4//
5// Copyright (c) 2018-2022, 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_CCollimator_HH
19#define CLASSIC_CCollimator_HH
20
23
24#include <string>
25
26class BeamlineVisitor;
27template <class T, unsigned int Dim> class PartBunchBase;
29
31
32public:
34 explicit CCollimator(const std::string& name);
35
37 CCollimator(const CCollimator& rhs);
38 void operator=(const CCollimator&) = delete;
39 virtual ~CCollimator();
40
42 virtual void accept(BeamlineVisitor&) const override;
44 virtual void goOnline(const double& kineticEnergy) override;
45 virtual ElementType getType() const override;
46 virtual void getDimensions(double& zBegin, double& zEnd) const override;
48
50 // bool checkCollimator(Vector_t r, Vector_t rmin, Vector_t rmax);
51
53 void print();
54
56 void setDimensions(double xstart, double xend,
57 double ystart, double yend,
58 double zstart, double zend,
59 double width);
62
64 double getZStart() ;
65 double getZEnd() ;
66 double getWidth() ;
68private:
70 virtual void doInitialise(PartBunchBase<double, 3>* bunch) override;
72 virtual bool doCheck(PartBunchBase<double, 3>* bunch, const int turnnumber, const double t, const double tstep) override;
74 virtual void doSetGeom() override;
76 virtual void doFinalise() override;
78 virtual bool doPreCheck(PartBunchBase<double, 3>*) override;
80 virtual bool doFinaliseCheck(PartBunchBase<double, 3>* bunch, bool flagNeedUpdate) override;
81
82 bool informed_m = false;
83
85 double zstart_m;
86 double zend_m;
87 double width_m;
89 double rmax_m;
90
92};
93
94inline
96 return zstart_m;
97}
98
99inline
101 return zend_m;
102}
103
104inline
106 return width_m;
107}
108#endif // CLASSIC_CCollimator_HH
ElementType
Definition ElementBase.h:89
const std::string name
double zend_m
Definition CCollimator.h:86
virtual void doSetGeom() override
Calculate extend in r.
double getWidth()
virtual void accept(BeamlineVisitor &) const override
Apply visitor to CCollimator.
virtual void goOnline(const double &kineticEnergy) override
Override implementation of PluginElement.
void operator=(const CCollimator &)=delete
virtual void getDimensions(double &zBegin, double &zEnd) const override
double getZStart()
Member variable access.
Definition CCollimator.h:95
double getZEnd()
void setDimensions(double xstart, double xend, double ystart, double yend, double zstart, double zend, double width)
Set dimensions and consistency checks.
virtual ElementType getType() const override
Get element type std::string.
virtual bool doPreCheck(PartBunchBase< double, 3 > *) override
Virtual hook for preCheck.
bool informed_m
Flag if error information already printed.
Definition CCollimator.h:82
virtual void doInitialise(PartBunchBase< double, 3 > *bunch) override
Initialise particle matter interaction.
double zstart_m
input geometry positions
Definition CCollimator.h:85
void print()
unused check method
virtual bool doFinaliseCheck(PartBunchBase< double, 3 > *bunch, bool flagNeedUpdate) override
Virtual hook for finaliseCheck.
virtual bool doCheck(PartBunchBase< double, 3 > *bunch, const int turnnumber, const double t, const double tstep) override
Record hits when bunch particles pass.
double width_m
Definition CCollimator.h:87
double rmax_m
maximum extend in r
Definition CCollimator.h:89
ParticleMatterInteractionHandler * parmatint_m
Definition CCollimator.h:91
virtual ~CCollimator()
virtual void doFinalise() override
Virtual hook for finalise.
void setDimensions(double xstart, double xend, double ystart, double yend)
Set dimensions and consistency checks.