#ifndef PARTICLEBEAM_SEEN #define PARTICLEBEAM_SEEN #include #include #include #include #include #include "bareParticle.h" #include "mathematicalTools.h" #include "nomdElements.h" #include "transportMoments.h" using namespace std; typedef struct { float xx, xxp, begamx,yy,yyp,begamy,z, begamz,phi,wz; float phi0, ksi1,ksi2,ksi3; int ne,np,ngood,npart; int readFromParmelaFile(FILE* fp) { return fscanf(fp, " %e %e %e %e %e %e %e %e %e %e %d %d %d %d %e %e %e %e \n", &xx, &xxp, &begamx,&yy,&yyp,&begamy,&z, &begamz,&phi,&wz,&ne,&np,&ngood,&npart,&phi0, &ksi1,&ksi2,&ksi3); } void imprim() { printf( " %e %e %e %e %e %e %e %e %e %e %d %d %d, %d %e %e %e %e \n", xx, xxp, begamx,yy,yyp,begamy,z, begamz,phi,wz,ne,np,ngood,npart,phi0, ksi1,ksi2,ksi3); } } parmelaParticle; class particleBeam { bool particleRepresentationOk_; bool momentRepresentationOk_; bareParticle referenceParticle_; vector goodPartic_; transportMoments rij_; // vector< vector > rij_transportMoments_; vector centroid_; double P0Transport_; void readTransportMoments(ifstream& inp); void impressionDesMoments() const; void razDesMoments(); public: particleBeam(); ~particleBeam() {;} bool setFromParmela(unsigned numeroElement,double referencefrequency); void buildMomentRepresentation(); bool setFromTransport(string elementLabel, const nomdElements elem); // void setFromBeamParameters(double x, double xp, double y, double yp, double dl, double del, double P0); void clear(); int getNbParticles() const; const transportMoments& getTransportMoments() const; double getP0Transport() const; bool particleRepresentationOk() const; bool momentRepresentationOk() const; void addParticle( bareParticle p); const vector& getParticleVector() const; vector& getParticleVector(); double getXmaxRms(); void getVariance(double& varx, double& vary, double& varz) const; void printAllXYZ() const; void Zrange(double& zmin, double& zmax) const; void donneesDessinEllipseXxp(vector& xcor, vector& ycor); virtual string FileOutputFlow() const; virtual bool FileInput(ifstream& ifs); }; #endif