41 description_m(right.description_m),
44 informed_m(right.informed_m),
49 for (
const std::shared_ptr<mslang::Base>& obj: right.
holes_m) {
50 holes_m.emplace_back(obj->clone());
83 const double z =
R(2);
112 double frac = -
R(2) / singleStep(2);
114 R + frac * singleStep, P,
164 *gmsg <<
"* Finalize flexible collimator " <<
getName() <<
endl;
178 std::ofstream omsg(
"errormsg.txt", std::ios_base::app);
214 "Couldn't parse input file");
218 if (
holes_m.size() == 0)
return;
220 for (std::shared_ptr<mslang::Base>&
it:
holes_m) {
221 it->computeBoundingBox();
224 std::shared_ptr<mslang::Base>& first = holes_m.front();
234 for (
const std::shared_ptr<mslang::Base>&
it: holes_m) {
242 double width = urc[0] - llc[0];
243 double height = urc[1] - llc[1];
245 llc[0] -= 1
e-3 * width;
246 urc[0] += 1
e-3 * width;
247 llc[1] -= 1
e-3 * height;
248 urc[1] += 1
e-3 * height;
266 std::ofstream out(fname +
"_quadtree.gpl");
270 out.open(fname +
"_holes.gpl");
271 for (
const std::shared_ptr<mslang::Base> &obj:
holes_m) {
272 obj->writeGnuplot(out);
static OpalData * getInstance()
constexpr double c
The velocity of light in m/s.
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two distribute and or modify the software for each author s protection and we want to make certain that everyone understands that there is no warranty for this free software If the software is modified by someone else and passed we want its recipients to know that what they have is not the so that any problems introduced by others will not reflect on the original authors reputations any free program is threatened constantly by software patents We wish to avoid the danger that redistributors of a free program will individually obtain patent in effect making the program proprietary To prevent we have made it clear that any patent must be licensed for everyone s free use or not licensed at all The precise terms and conditions for distribution and modification follow GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR DISTRIBUTION AND MODIFICATION This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License The refers to any such program or and a work based on the Program means either the Program or any derivative work under copyright a work containing the Program or a portion of it
ParticleAttrib< Vector_t > P
bool isInside(const Vector_t &X) const
virtual void initialise(PartBunchBase< double, 3 > *bunch, double &startField, double &endField) override
bool isInside(const Vector_t &R) const
ParticleAttrib< double > M
virtual ~FlexibleCollimator()
PartBunchBase< double, 3 > * RefPartBunch_m
static std::string typeset_msg(const std::string &msg, const std::string &title)
virtual const std::string & getName() const
Get element name.
virtual void visitFlexibleCollimator(const FlexibleCollimator &)=0
Apply the algorithm to a flexible collimator.
Inform & endl(Inform &inf)
T::PETE_Expr_t::PETE_Return_t min(const PETE_Expr< T > &expr, NDIndex< D > &loc)
virtual void getDimensions(double &zBegin, double &zEnd) const override
T::PETE_Expr_t::PETE_Return_t max(const PETE_Expr< T > &expr, NDIndex< D > &loc)
std::unique_ptr< LossDataSink > lossDs_m
bool getFlagDeleteOnTransverseExit() const
std::string getAuxiliaryOutputDirectory() const
get the name of the the additional data directory
std::vector< std::shared_ptr< mslang::Base > > holes_m
bool parse(std::string str, Function *&fun)
Vector_t getBeta(Vector_t p)
virtual bool applyToReferenceParticle(const Vector_t &R, const Vector_t &P, const double &t, Vector_t &E, Vector_t &B) override
virtual void goOffline() override
ParticleAttrib< double > Q
virtual double getElementLength() const
Get design length.
void setDescription(const std::string &desc)
ParticleAttrib< double > dt
virtual void goOnline(const double &kineticEnergy) override
bool isInsideTransverse(const Vector_t &r) const
virtual void finalise() override
std::string combineFilePath(std::initializer_list< std::string > ilist)
virtual bool checkCollimator(PartBunchBase< double, 3 > *bunch, const int turnnumber, const double t, const double tstep)
ParticleMatterInteractionHandler * parmatint_m
virtual ParticleMatterInteractionHandler * getParticleMatterInteraction() const
Inform & level3(Inform &inf)
constexpr double e
The value of .
mslang::BoundingBox2D bb_m
virtual void accept(BeamlineVisitor &) const override
Apply visitor to FlexibleCollimator.
virtual ElementType getType() const override
Get element type std::string.
Interface for a single beam element.
bool isStopped(const Vector_t &R)
std::string getOutputFN() const
Get output filename.
virtual bool apply(const size_t &i, const double &t, Vector_t &E, Vector_t &B) override
virtual void apply(std::vector< std::shared_ptr< Base >> &bfuncs)=0
void writeHolesAndQuadtree(const std::string &baseFilename) const
void writeGnuplot(std::ostream &out) const
std::list< std::shared_ptr< Base > > objects_m