1 | #ifndef PARTICLEBEAM_SEEN |
---|
2 | #define PARTICLEBEAM_SEEN |
---|
3 | #include <iostream> |
---|
4 | #include <sstream> |
---|
5 | #include <stdio.h> |
---|
6 | |
---|
7 | #include<cmath> |
---|
8 | |
---|
9 | #include <vector> |
---|
10 | |
---|
11 | #include "bareParticle.h" |
---|
12 | //#include "mathematicalTools.h" |
---|
13 | #include "nomdElements.h" |
---|
14 | #include "beam2Moments.h" |
---|
15 | |
---|
16 | using namespace std; |
---|
17 | |
---|
18 | |
---|
19 | |
---|
20 | class particleBeam |
---|
21 | { |
---|
22 | |
---|
23 | bool particleRepresentationOk_; |
---|
24 | bool momentRepresentationOk_; |
---|
25 | |
---|
26 | bareParticle referenceParticle_; |
---|
27 | |
---|
28 | vector<bareParticle> goodPartic_; |
---|
29 | |
---|
30 | beam2Moments rij_; |
---|
31 | |
---|
32 | |
---|
33 | vector<double> centroid_; |
---|
34 | double P0Transport_; |
---|
35 | |
---|
36 | |
---|
37 | |
---|
38 | |
---|
39 | void impressionDesMoments() const; |
---|
40 | void razDesMoments(); |
---|
41 | |
---|
42 | |
---|
43 | public: |
---|
44 | |
---|
45 | particleBeam(); |
---|
46 | |
---|
47 | virtual ~particleBeam() {;} |
---|
48 | |
---|
49 | void buildMomentRepresentation(); |
---|
50 | |
---|
51 | |
---|
52 | void clear(); |
---|
53 | |
---|
54 | int getNbParticles() const; |
---|
55 | |
---|
56 | const beam2Moments& getTransportMoments() const; |
---|
57 | double getSigmaTransportij(unsigned i, unsigned j); |
---|
58 | double getUnnormalizedEmittanceX(); |
---|
59 | double getP0Transport() const; |
---|
60 | bool particleRepresentationOk() const; |
---|
61 | bool momentRepresentationOk() const; |
---|
62 | |
---|
63 | |
---|
64 | void addParticle( bareParticle p); |
---|
65 | |
---|
66 | |
---|
67 | |
---|
68 | const vector<bareParticle>& getParticleVector() const; |
---|
69 | |
---|
70 | vector<bareParticle>& getParticleVector(); |
---|
71 | |
---|
72 | double getXmaxRms(); |
---|
73 | |
---|
74 | void getVariance(double& varx, double& vary, double& varz) const; |
---|
75 | |
---|
76 | void set2Moments(beam2Moments& moments); |
---|
77 | void setWithParticles(vector<double>& centroid, bareParticle& referencePart, vector<bareParticle>& particles); |
---|
78 | void printAllXYZ() const; |
---|
79 | |
---|
80 | |
---|
81 | void Zrange(double& zmin, double& zmax) const; |
---|
82 | |
---|
83 | void donneesDessinEllipseXxp(vector<double>& xcor, vector<double>& ycor); |
---|
84 | |
---|
85 | |
---|
86 | virtual string FileOutputFlow() const; |
---|
87 | |
---|
88 | |
---|
89 | virtual bool FileInput(ifstream& ifs); |
---|
90 | |
---|
91 | void histogramme(vector<double>&xcor,vector<int>& hist,int& cnts); |
---|
92 | }; |
---|
93 | |
---|
94 | |
---|
95 | #endif |
---|