OPAL (Object Oriented Parallel Accelerator Library)  2024.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 
31 class ElementBase;
32 class Inform;
33 
35 
36 public:
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 
65 private:
66  enum class InteractionType: unsigned short {
67  SCATTERING,
69  };
70 
71  // Not implemented.
74 
75  // Clone constructor.
76  ParticleMatterInteraction(const std::string& name, ParticleMatterInteraction* parent);
77 
78  void getInteractionType();
79 
81 };
82 
83 inline std::ostream& operator<<(std::ostream& os, const ParticleMatterInteraction& b) {
84  b.print(os);
85  return os;
86 }
87 
88 #endif // OPAL_PARTICLEMATTERINTERACTION_HH
The base class for all OPAL objects.
Definition: Object.h:48
void operator=(const ParticleMatterInteraction &)
std::ostream & operator<<(std::ostream &os, const Attribute &attr)
Definition: Attribute.cpp:169
virtual void update()
Update the PARTICLEMATTERINTERACTION data.
static ParticleMatterInteraction * find(const std::string &name)
Find named PARTICLEMATTERINTERACTION.
void updateElement(ElementBase *element)
virtual void execute()
Check the PARTICLEMATTERINTERACTION data.
Definition: Inform.h:42
void initParticleMatterInteractionHandler(ElementBase &element)
const std::string name
ParticleMatterInteractionHandler * handler_m
virtual ParticleMatterInteraction * clone(const std::string &name)
Make clone.
The base class for all OPAL definitions.
Definition: Definition.h:30
ParticleMatterInteraction()
Exemplar constructor.
void print(std::ostream &os) const
Print the object.
virtual bool canReplaceBy(Object *object)
Test if replacement is allowed.