OPAL (Object Oriented Parallel Accelerator Library) 2022.1
OPAL
ParticleMatterInteraction.h
Go to the documentation of this file.
1//
2// Class ParticleMatterInteraction
3// The class for the OPAL PARTICLEMATTERINTERACTION command.
4//
5// Copyright (c) 2012 - 2021, Andreas Adelmann, Paul Scherrer Institut, Villigen PSI, Switzerland
6// Christof Metzger-Kraus, Helmholtz-Zentrum Berlin
7// Pedro Calvo, CIEMAT, Spain
8// All rights reserved
9//
10// Implemented as part of the PhD thesis
11// "Optimizing the radioisotope production of the novel AMIT
12// superconducting weak focusing cyclotron"
13//
14// This file is part of OPAL.
15//
16// OPAL is free software: you can redistribute it and/or modify
17// it under the terms of the GNU General Public License as published by
18// the Free Software Foundation, either version 3 of the License, or
19// (at your option) any later version.
20//
21// You should have received a copy of the GNU General Public License
22// along with OPAL. If not, see <https://www.gnu.org/licenses/>.
23//
24#ifndef OPAL_PARTICLEMATTERINTERACTION_HH
25#define OPAL_PARTICLEMATTERINTERACTION_HH
26
28#include "Algorithms/PartData.h"
30
31class ElementBase;
32class Inform;
33
35
36public:
39
41
43 virtual bool canReplaceBy(Object* object);
44
46 virtual ParticleMatterInteraction* clone(const std::string& name);
47
49 virtual void execute();
50
52 static ParticleMatterInteraction* find(const std::string& name);
53
55 virtual void update();
56
57 void print(std::ostream& os) const;
58
60
61 void updateElement(ElementBase* element);
62
64
65private:
66 enum class InteractionType: unsigned short {
67 SCATTERING,
68 BEAMSTRIPPING
69 };
70
71 // Not implemented.
74
75 // Clone constructor.
76 ParticleMatterInteraction(const std::string& name, ParticleMatterInteraction* parent);
77
78 void getInteractionType();
79
81};
82
83inline std::ostream& operator<<(std::ostream& os, const ParticleMatterInteraction& b) {
84 b.print(os);
85 return os;
86}
87
88#endif // OPAL_PARTICLEMATTERINTERACTION_HH
std::ostream & operator<<(std::ostream &os, const ParticleMatterInteraction &b)
const std::string name
The base class for all OPAL definitions.
Definition: Definition.h:30
The base class for all OPAL objects.
Definition: Object.h:48
virtual void execute()
Check the PARTICLEMATTERINTERACTION data.
virtual ParticleMatterInteraction * clone(const std::string &name)
Make clone.
ParticleMatterInteraction(const ParticleMatterInteraction &)
virtual void update()
Update the PARTICLEMATTERINTERACTION data.
static ParticleMatterInteraction * find(const std::string &name)
Find named PARTICLEMATTERINTERACTION.
virtual bool canReplaceBy(Object *object)
Test if replacement is allowed.
ParticleMatterInteractionHandler * handler_m
ParticleMatterInteraction()
Exemplar constructor.
void operator=(const ParticleMatterInteraction &)
void initParticleMatterInteractionHandler(ElementBase &element)
void print(std::ostream &os) const
Print the object.
void updateElement(ElementBase *element)
Definition: Inform.h:42