SynAPSE  0.6.0
Synergistic Analysis of Phase Space Evolution
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends
Public Member Functions | Private Member Functions | Private Attributes
Beam::Stream Class Reference

Holds a set of particle bunches. More...

#include <Stream.hh>

Public Member Functions

 Stream ()
 Default constructor, initilizes everything to 0. More...
 
 Stream (const std::map< size_t, Bunch > &samples, const std::vector< size_t > reaches=std::vector< size_t >())
 Map constructor, sets the particle stream from a map of bunches. More...
 
 Stream (const Stream &stream)
 Copy constructor. More...
 
Stream & operator= (const Stream &stream)
 Equality operator. More...
 
 ~Stream ()
 Destructor. More...
 
const size_t Size () const
 Returns the number of bunches. More...
 
const std::map< size_t, Bunch >
::const_iterator 
begin () const
 Returns the first iterator of the list of bunches. More...
 
const std::map< size_t, Bunch >
::const_iterator 
end () const
 Returns the last iterator of the list of bunches. More...
 
const Bunch & Front () const
 Returns the most upstream bunch in the stream. More...
 
const Bunch & Back () const
 Returns the most downstream bunch in the stream. More...
 
const Bunch & operator[] (const size_t plane_id) const
 Overload the subscript operator, return a bunch. More...
 
Bunch & operator[] (const size_t plane_id)
 Overload the subscript operator, return a bunch, allows mods. More...
 
const std::vector< size_t > & GetPlaneIds () const
 Returns the list of plane ids that compose the stream. More...
 
const std::vector< size_t > & GetReaches () const
 Returns the reaches of all the particles that compose the stream. More...
 
const size_t & GetReach (const size_t id) const
 Returns the reach of the particle of requested id. More...
 
double Transmission (const size_t plane_id) const
 Returns an the transmission in the requested plane id. More...
 
void SetCoreFraction (const double frac)
 Sets the core fraction of all the bunches in the stream. More...
 
TGraphErrors * EvolutionGraph (const SumStat &stat) const
 Returns an evolution graph of the requested statistic. More...
 
TGraphErrors * TransmissionGraph () const
 Returns an evolution graph of the beam transmission. More...
 
std::map< SumStat, TGraphErrors * > FractionalGraphs (const size_t idu, const size_t idd)
 Returns the relative change in a fractional quantities as a function of the fraction. More...
 
TF1 * FractionalFunction (const SumStat &stat) const
 Returns a function that expresses the fractional quantify as a function of emittance. More...
 

Private Member Functions

void Initialize ()
 Normal initializer, sets the list global variables. More...
 
void SetCoreSize (const size_t size)
 Sets the number of particles contained in the core of all the bunches in the stream. More...
 
bool Contains (const size_t plane_id) const
 Returns true if the stream contains the requested plane id. More...
 

Private Attributes

std::map< size_t, Bunch > _bunches
 Map of beam bunches that compose the stream. More...
 
std::vector< size_t > _plane_ids
 List of plane ids that compose the stream. More...
 
std::vector< size_t > _reaches
 Reach of each particle in the beam. More...
 
double _fraction
 Fraction of the first bunch in the core. More...
 

Detailed Description

Holds a set of particle bunches.

Holds particle bunches at an array of z positions, or planes, to evaluate global characteristics of a stream of particle along a the full extent of a beam line.

Constructor & Destructor Documentation

Beam::Stream::Stream ( )

Default constructor, initilizes everything to 0.

Beam::Stream::Stream ( const std::map< size_t, Bunch > &  samples,
const std::vector< size_t >  reaches = std::vector<size_t>() 
)

Map constructor, sets the particle stream from a map of bunches.

Parameters
bunchesDictionary that maps each plane id onto a Bunch
reachesReach of each particle in the beam (max plane id)
Beam::Stream::Stream ( const Stream &  stream)

Copy constructor.

Beam::Stream::~Stream ( )

Destructor.

Member Function Documentation

const Bunch & Beam::Stream::Back ( ) const

Returns the most downstream bunch in the stream.

const std::map<size_t, Bunch>::const_iterator Beam::Stream::begin ( ) const
inline

Returns the first iterator of the list of bunches.

bool Beam::Stream::Contains ( const size_t  plane_id) const
private

Returns true if the stream contains the requested plane id.

const std::map<size_t, Bunch>::const_iterator Beam::Stream::end ( ) const
inline

Returns the last iterator of the list of bunches.

TGraphErrors * Beam::Stream::EvolutionGraph ( const SumStat &  stat) const

Returns an evolution graph of the requested statistic.

Parameters
statTag of the summary statistics to be drawn
Returns
Pointer to a TGraphErrors
TF1 * Beam::Stream::FractionalFunction ( const SumStat &  stat) const

Returns a function that expresses the fractional quantify as a function of emittance.

std::map< SumStat, TGraphErrors * > Beam::Stream::FractionalGraphs ( const size_t  idu,
const size_t  idd 
)

Returns the relative change in a fractional quantities as a function of the fraction.

idu Id of the upstream reference plane idd Id of the downstream reference plane

Returns
Map of TGraphErrors
const Bunch & Beam::Stream::Front ( ) const

Returns the most upstream bunch in the stream.

const std::vector<size_t>& Beam::Stream::GetPlaneIds ( ) const
inline

Returns the list of plane ids that compose the stream.

const size_t& Beam::Stream::GetReach ( const size_t  id) const
inline

Returns the reach of the particle of requested id.

const std::vector<size_t>& Beam::Stream::GetReaches ( ) const
inline

Returns the reaches of all the particles that compose the stream.

void Beam::Stream::Initialize ( )
private

Normal initializer, sets the list global variables.

Stream & Beam::Stream::operator= ( const Stream &  stream)

Equality operator.

const Bunch& Beam::Stream::operator[] ( const size_t  plane_id) const
inline

Overload the subscript operator, return a bunch.

Bunch& Beam::Stream::operator[] ( const size_t  plane_id)
inline

Overload the subscript operator, return a bunch, allows mods.

void Beam::Stream::SetCoreFraction ( const double  frac)

Sets the core fraction of all the bunches in the stream.

void Beam::Stream::SetCoreSize ( const size_t  size)
private

Sets the number of particles contained in the core of all the bunches in the stream.

const size_t Beam::Stream::Size ( ) const
inline

Returns the number of bunches.

double Beam::Stream::Transmission ( const size_t  plane_id) const

Returns an the transmission in the requested plane id.

TGraphErrors * Beam::Stream::TransmissionGraph ( ) const

Returns an evolution graph of the beam transmission.

Returns
Pointer to a TGraphErrors

Field Documentation

std::map<size_t, Bunch> Beam::Stream::_bunches
private

Map of beam bunches that compose the stream.

double Beam::Stream::_fraction
private

Fraction of the first bunch in the core.

std::vector<size_t> Beam::Stream::_plane_ids
private

List of plane ids that compose the stream.

std::vector<size_t> Beam::Stream::_reaches
private

Reach of each particle in the beam.


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