Navigation

Main Page
Download
Support
Installation
Tutorial
Examples
Reference Manual
   Version 1.0.6dev
      Class Index
      File List
   Version 1.0.6
   Version 1.0.5new_solver
   Version 1.0.5dev
   Version 1.0.5b
   Version 1.0.4dev
   Version 1.0.4
Publications


Hosted by Get Ion Beam Simulator at SourceForge.net. Fast, secure and Free Open Source software downloads

Class for emittance statistics. More...

#include <trajectorydiagnostics.hpp>

Inheritance diagram for Emittance:
EmittanceConv

Public Member Functions

 Emittance ()
 Default constructor for emittance statistics. More...
 
 Emittance (const std::vector< double > &x, const std::vector< double > &xp, const std::vector< double > &I)
 Constructor for emittance statistics from trajectory diagnostic data columns x, xp and current I. More...
 
 Emittance (const std::vector< double > &x, const std::vector< double > &xp)
 Constructor for emittance statistics from trajectory diagnostic data columns x, xp, assuming even weights. More...
 
 Emittance (size_t xsize, size_t xpsize, const double range[4], const std::vector< double > &I)
 Constructor for emittance statistics from trajectory diagnostic data in mesh form. More...
 
double current (void) const
 Return current of beam trajectories used to calculate the emittance. More...
 
double xave (void) const
 Return average position (center location) of emittance distribution. More...
 
double xpave (void) const
 Return average angle (center location) of emittance distribution. More...
 
double alpha (void) const
 Return $\alpha$ of emittance distribution. More...
 
double beta (void) const
 Return $\beta$ of emittance distribution. More...
 
double gamma (void) const
 Return $\gamma$ of emittance distribution. More...
 
double epsilon (void) const
 Return rms emittance. More...
 
double angle (void) const
 Return angle of fitted rms ellipse. More...
 
double rmajor (void) const
 Return major radius of fitted rms ellipse. More...
 
double rminor (void) const
 Return minor radius of fitted rms ellipse. More...
 
void debug_print (std::ostream &os) const
 Print debugging information to os. More...
 

Protected Attributes

double _Isum
 
double _xave
 
double _xpave
 
double _x2
 
double _xp2
 
double _xxp
 
double _alpha
 
double _beta
 
double _gamma
 
double _epsilon
 
double _angle
 
double _rmajor
 
double _rminor
 

Detailed Description

Class for emittance statistics.

Emittance class does a statistical analysis on the particle distribution and it calculates averages $ <x> $ and $ <x'> $ and the expectation values $ <x^2> $, $ <x'^2> $ and $ <x x'> $. From these it calculates the rms-emittance

\[ \epsilon = \sqrt{ <x^2><x'^2> - <x x'>^2 } \]

and the Twiss parameters

\[ \alpha = \frac{-<x x'>}{\epsilon}, \beta = \frac{<x^2>}{\epsilon}, \gamma = \frac{<x'^2>}{\epsilon} \]

In addition to these physical values, the class calculates the angle of the ellipse

\[ \theta = \frac{1}{2} \arctan2{\left( -2\alpha, \beta - \gamma \right)} \]

and the half-axis lengths

\[ r_1 = \sqrt{\frac{\epsilon}{2}} ( \sqrt{H+1} + \sqrt{H-1} ) \]

\[ r_2 = \sqrt{\frac{\epsilon}{2}} ( \sqrt{H+1} - \sqrt{H-1} ), \]

where

\[ H = \frac{\beta + \gamma}{2} \]

Constructor & Destructor Documentation

◆ Emittance() [1/4]

Emittance::Emittance ( )

Default constructor for emittance statistics.

◆ Emittance() [2/4]

Emittance::Emittance ( const std::vector< double > &  x,
const std::vector< double > &  xp,
const std::vector< double > &  I 
)

Constructor for emittance statistics from trajectory diagnostic data columns x, xp and current I.

◆ Emittance() [3/4]

Emittance::Emittance ( const std::vector< double > &  x,
const std::vector< double > &  xp 
)

Constructor for emittance statistics from trajectory diagnostic data columns x, xp, assuming even weights.

◆ Emittance() [4/4]

Emittance::Emittance ( size_t  xsize,
size_t  xpsize,
const double  range[4],
const std::vector< double > &  I 
)

Constructor for emittance statistics from trajectory diagnostic data in mesh form.

The mesh has integer dimensions of (xsize, xpsize) and has the extents defined by range, where range = (xmin, xpmin, xmax, xpmax). Current data at each mesh node is given by vector I, where data is stored in x major order (I[xindex+xpindex*xsize]).

Member Function Documentation

◆ alpha()

double Emittance::alpha ( void  ) const
inline

Return $\alpha$ of emittance distribution.

◆ angle()

double Emittance::angle ( void  ) const
inline

Return angle of fitted rms ellipse.

◆ beta()

double Emittance::beta ( void  ) const
inline

Return $\beta$ of emittance distribution.

◆ current()

double Emittance::current ( void  ) const
inline

Return current of beam trajectories used to calculate the emittance.

The current is only defined in some cases. If emittance constructure Emittance( x, xp ) is used, this functions returns the number of trajectories.

◆ debug_print()

void Emittance::debug_print ( std::ostream &  os) const

Print debugging information to os.

◆ epsilon()

double Emittance::epsilon ( void  ) const
inline

Return rms emittance.

◆ gamma()

double Emittance::gamma ( void  ) const
inline

Return $\gamma$ of emittance distribution.

◆ rmajor()

double Emittance::rmajor ( void  ) const
inline

Return major radius of fitted rms ellipse.

◆ rminor()

double Emittance::rminor ( void  ) const
inline

Return minor radius of fitted rms ellipse.

◆ xave()

double Emittance::xave ( void  ) const
inline

Return average position (center location) of emittance distribution.

◆ xpave()

double Emittance::xpave ( void  ) const
inline

Return average angle (center location) of emittance distribution.


The documentation for this class was generated from the following files:


Reference manual for Ion Beam Simulator 1.0.6dev
Generated by Doxygen 1.9.1 on Thu Sep 11 2025 09:37:24.