OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
ParticleMatterInteractionHandler.hh
Go to the documentation of this file.
1 #ifndef PARTICLEMATTERINTERACTIONHANDLER_HH
2 #define PARTICLEMATTERINTERACTIONHANDLER_HH
3 
4 #include <string>
5 #include "Algorithms/Vektor.h"
6 
7 class ElementBase;
8 
9 template <class T, unsigned Dim>
10 class PartBunchBase;
11 class Inform;
12 
14 public:
17  virtual void apply(PartBunchBase<double, 3> *bunch,
18  const std::pair<Vector_t, double> &boundingSphere,
19  size_t numParticlesInSimulation = 0) = 0;
20  virtual const std::string getType() const = 0;
21  virtual void print(Inform& os) = 0;
22  virtual bool stillActive() = 0;
23  virtual bool stillAlive(PartBunchBase<double, 3> *bunch) = 0;
24  virtual double getTime() = 0;
25  virtual std::string getName() = 0;
26  virtual size_t getParticlesInMat() = 0;
27  virtual unsigned getRediffused() = 0;
28  virtual unsigned int getNumEntered() = 0;
29  void setFlagAllParticlesIn(bool p);
30  bool getFlagAllParticlesIn() const;
31  void updateElement(ElementBase *newref);
33 
34  virtual bool computeEnergyLoss(Vector_t &P,//double &Eng,
35  const double deltat,
36  bool includeFluctuations = true) const = 0;
37 protected:
40 private:
41  const std::string name_m;
42 
43 };
44 
45 inline
47  element_ref_m(elref),
48  allParticleInMat_m(false),
49  name_m(name)
50 {}
51 
52 inline
54  element_ref_m = newref;
55 }
56 
57 inline
59  return element_ref_m;
60 }
61 
62 inline
65 }
66 
67 inline
69  return allParticleInMat_m;
70 }
71 #endif // PARTICLEMATTERINTERACTION_HH
virtual void apply(PartBunchBase< double, 3 > *bunch, const std::pair< Vector_t, double > &boundingSphere, size_t numParticlesInSimulation=0)=0
virtual bool computeEnergyLoss(Vector_t &P, const double deltat, bool includeFluctuations=true) const =0
Interface for basic beam line object.
Definition: ElementBase.h:128
Definition: TSVMeta.h:24
virtual bool stillAlive(PartBunchBase< double, 3 > *bunch)=0
virtual const std::string getType() const =0
bool allParticleInMat_m
if all particles are in matter stay inside the particle matter interaction
Class: DataSink.
Definition: OpalData.h:29
virtual unsigned getRediffused()=0
ParticleMatterInteractionHandler(std::string name, ElementBase *elref)
virtual void print(Inform &os)=0
virtual unsigned int getNumEntered()=0
const std::string name
Definition: Inform.h:41
virtual size_t getParticlesInMat()=0
virtual std::string getName()=0