1 | #ifndef PARTICLE_H |
---|
2 | #define PARTICLE_H |
---|
3 | #include <iostream> |
---|
4 | #include <vector> |
---|
5 | #include <string> |
---|
6 | #include "stdlib.h" |
---|
7 | #include <math.h> |
---|
8 | using namespace std; |
---|
9 | |
---|
10 | /* |
---|
11 | ############################################################################################################################################################################################# |
---|
12 | |
---|
13 | This class describes the particles in the experiment. It has as attribute the 6-dimensional coordinates and as methods some usefull tools related to the tracking of the particles. |
---|
14 | |
---|
15 | This is also here that we have the method which generates particles. |
---|
16 | |
---|
17 | ############################################################################################################################################################################################# |
---|
18 | */ |
---|
19 | |
---|
20 | |
---|
21 | class Particle |
---|
22 | { |
---|
23 | |
---|
24 | public: |
---|
25 | |
---|
26 | //==================Constructors, destructor========================================= |
---|
27 | |
---|
28 | Particle(double x = 0, double dx = 0, double y = 0, double dy = 0, double deltaE = 0, double t = 0, double massnumber = 208, double chargestate = 82, double moment = 1.2); |
---|
29 | |
---|
30 | Particle(const Particle& obj); |
---|
31 | |
---|
32 | virtual ~Particle() {}; |
---|
33 | |
---|
34 | |
---|
35 | //method which display the 6 coordinates of a particles before and after the passage through an element |
---|
36 | |
---|
37 | void afficheCoordonnees(); |
---|
38 | |
---|
39 | |
---|
40 | //displays only the 6 coordinates of the particle before the passage through an element |
---|
41 | |
---|
42 | void afficheFirstCoordonnees(); |
---|
43 | |
---|
44 | |
---|
45 | //generates a particle. We can choose between the following distributions: kv, waterbag or r1r2. |
---|
46 | |
---|
47 | void genpartdist(const int& i0, const int& n, const string& type, const double& r1r2skin, const double& emx, const double& emy, const double& sigdpp, const double& bx, const double& ax, const double& dx, const double& dpx, const double& by, const double& ay, const double& dy, const double& dpy, const double& nsigi); |
---|
48 | |
---|
49 | |
---|
50 | //gamma incomplete function; the base source code is taken from www.crbond.com/math.htm, but has been modified |
---|
51 | |
---|
52 | int incog(double a, double x, double& gin, double& gim, double& gip); |
---|
53 | |
---|
54 | |
---|
55 | //returns a random double in the interval [0,1]. The distribution is uniformed. |
---|
56 | |
---|
57 | double random(); |
---|
58 | |
---|
59 | |
---|
60 | //linear interpolation method |
---|
61 | |
---|
62 | double interp1(double x1, double y1, double x2, double y2, double x); |
---|
63 | |
---|
64 | |
---|
65 | //get and set methodes for the identification |
---|
66 | |
---|
67 | int getidentification() const; |
---|
68 | |
---|
69 | void setidentification(int id); |
---|
70 | |
---|
71 | Particle& operator=(Particle const& source); |
---|
72 | |
---|
73 | |
---|
74 | double Ap0; //massnumber of particle |
---|
75 | double Zp0; //chargestate of particle |
---|
76 | double dpoporiginal; //momentum (normalement on n en a pas besoin, = p1.coordonnees[][4] |
---|
77 | int inabs; //0 if gets lost, 1 if continue |
---|
78 | |
---|
79 | long double coordonnees[2][6]; |
---|
80 | long double dt; |
---|
81 | int nrevhitp; |
---|
82 | int in;//0 if gets lost, 1 if continue (used only in trackensemblelinearnew) |
---|
83 | |
---|
84 | private: |
---|
85 | |
---|
86 | int identification;//id of the particle |
---|
87 | |
---|
88 | |
---|
89 | |
---|
90 | }; |
---|
91 | |
---|
92 | |
---|
93 | #endif |
---|