OPAL (Object Oriented Parallel Accelerator Library) 2022.1
OPAL
Classes | Public Types | Public Member Functions | Private Attributes | List of all members
MultiBunchHandler Class Reference

#include <MultiBunchHandler.h>

Collaboration diagram for MultiBunchHandler:
Collaboration graph
[legend]

Classes

struct  beaminfo_t
 
struct  injection_t
 

Public Types

enum class  MultiBunchMode : unsigned short { FORCE = 0 , AUTO = 1 }
 
enum class  MultiBunchBinning : unsigned short { GAMMA = 0 , BUNCH = 1 }
 

Public Member Functions

 MultiBunchHandler (PartBunchBase< double, 3 > *beam, const int &numBunch, const double &eta, const double &para, const std::string &mode, const std::string &binning)
 
void saveBunch (PartBunchBase< double, 3 > *beam)
 
bool readBunch (PartBunchBase< double, 3 > *beam, const PartData &ref)
 
short injectBunch (PartBunchBase< double, 3 > *beam, const PartData &ref, bool &flagTransition)
 
void updateParticleBins (PartBunchBase< double, 3 > *beam)
 
void setMode (const std::string &mbmode)
 set the working sub-mode for multi-bunch mode: "FORCE" or "AUTO" More...
 
void setBinning (std::string binning)
 
void setRadiusTurns (const double &radius)
 
void setNumBunch (short n)
 
short getNumBunch () const
 
bool isForceMode () const
 
bool calcBunchBeamParameters (PartBunchBase< double, 3 > *beam, short bunchNr)
 
beaminfo_tgetBunchInfo (short bunchNr)
 
const beaminfo_tgetBunchInfo (short bunchNr) const
 
injection_tgetInjectionValues ()
 
void updateTime (const double &dt)
 
void updatePathLength (const std::vector< double > &lpaths)
 

Private Attributes

std::string onebunch_m
 
short numBunch_m
 The number of bunches specified in TURNS of RUN command. More...
 
double eta_m
 
MultiBunchMode mode_m
 
MultiBunchBinning binning_m
 
double coeffDBunches_m
 
double radiusLastTurn_m
 
double radiusThisTurn_m
 
short bunchCount_m
 
std::vector< beaminfo_tbinfo_m
 
injection_t injection_m
 

Detailed Description

Definition at line 35 of file MultiBunchHandler.h.

Member Enumeration Documentation

◆ MultiBunchBinning

enum class MultiBunchHandler::MultiBunchBinning : unsigned short
strong
Enumerator
GAMMA 
BUNCH 

Definition at line 92 of file MultiBunchHandler.h.

◆ MultiBunchMode

enum class MultiBunchHandler::MultiBunchMode : unsigned short
strong
Enumerator
FORCE 
AUTO 

Definition at line 86 of file MultiBunchHandler.h.

Constructor & Destructor Documentation

◆ MultiBunchHandler()

MultiBunchHandler::MultiBunchHandler ( PartBunchBase< double, 3 > *  beam,
const int &  numBunch,
const double &  eta,
const double &  para,
const std::string &  mode,
const std::string &  binning 
)

Member Function Documentation

◆ calcBunchBeamParameters()

bool MultiBunchHandler::calcBunchBeamParameters ( PartBunchBase< double, 3 > *  beam,
short  bunchNr 
)

◆ getBunchInfo() [1/2]

MultiBunchHandler::beaminfo_t & MultiBunchHandler::getBunchInfo ( short  bunchNr)
inline

◆ getBunchInfo() [2/2]

const MultiBunchHandler::beaminfo_t & MultiBunchHandler::getBunchInfo ( short  bunchNr) const
inline

Definition at line 218 of file MultiBunchHandler.h.

References binfo_m, PAssert_GE, and PAssert_LT.

◆ getInjectionValues()

MultiBunchHandler::injection_t & MultiBunchHandler::getInjectionValues ( )
inline

Definition at line 226 of file MultiBunchHandler.h.

References injection_m.

◆ getNumBunch()

short MultiBunchHandler::getNumBunch ( ) const
inline

◆ injectBunch()

short MultiBunchHandler::injectBunch ( PartBunchBase< double, 3 > *  beam,
const PartData ref,
bool &  flagTransition 
)

◆ isForceMode()

bool MultiBunchHandler::isForceMode ( ) const
inline

Definition at line 204 of file MultiBunchHandler.h.

References FORCE, and mode_m.

◆ readBunch()

bool MultiBunchHandler::readBunch ( PartBunchBase< double, 3 > *  beam,
const PartData ref 
)

◆ saveBunch()

void MultiBunchHandler::saveBunch ( PartBunchBase< double, 3 > *  beam)

◆ setBinning()

void MultiBunchHandler::setBinning ( std::string  binning)

Definition at line 376 of file MultiBunchHandler.cpp.

References binning_m, BUNCH, endl(), GAMMA, and gmsg.

Referenced by MultiBunchHandler().

Here is the call graph for this function:

◆ setMode()

void MultiBunchHandler::setMode ( const std::string &  mbmode)

set the working sub-mode for multi-bunch mode: "FORCE" or "AUTO"

Definition at line 361 of file MultiBunchHandler.cpp.

References AUTO, coeffDBunches_m, endl(), FORCE, gmsg, and mode_m.

Referenced by MultiBunchHandler().

Here is the call graph for this function:

◆ setNumBunch()

void MultiBunchHandler::setNumBunch ( short  n)
inline

Definition at line 192 of file MultiBunchHandler.h.

References bunchCount_m, and Hypervolume::n.

◆ setRadiusTurns()

void MultiBunchHandler::setRadiusTurns ( const double &  radius)

Definition at line 388 of file MultiBunchHandler.cpp.

References AUTO, endl(), OpalData::getInstance(), gmsg, mode_m, radiusLastTurn_m, and radiusThisTurn_m.

Here is the call graph for this function:

◆ updateParticleBins()

void MultiBunchHandler::updateParticleBins ( PartBunchBase< double, 3 > *  beam)

◆ updatePathLength()

void MultiBunchHandler::updatePathLength ( const std::vector< double > &  lpaths)

Definition at line 558 of file MultiBunchHandler.cpp.

References binfo_m, bunchCount_m, and PAssert_EQ.

◆ updateTime()

void MultiBunchHandler::updateTime ( const double &  dt)

Definition at line 551 of file MultiBunchHandler.cpp.

References binfo_m, and bunchCount_m.

Member Data Documentation

◆ binfo_m

std::vector<beaminfo_t> MultiBunchHandler::binfo_m
private

◆ binning_m

MultiBunchBinning MultiBunchHandler::binning_m
private

Definition at line 171 of file MultiBunchHandler.h.

Referenced by setBinning(), and updateParticleBins().

◆ bunchCount_m

short MultiBunchHandler::bunchCount_m
private

◆ coeffDBunches_m

double MultiBunchHandler::coeffDBunches_m
private

Definition at line 174 of file MultiBunchHandler.h.

Referenced by injectBunch(), and setMode().

◆ eta_m

double MultiBunchHandler::eta_m
private

Definition at line 162 of file MultiBunchHandler.h.

Referenced by updateParticleBins().

◆ injection_m

injection_t MultiBunchHandler::injection_m
private

Definition at line 187 of file MultiBunchHandler.h.

Referenced by getInjectionValues(), and readBunch().

◆ mode_m

MultiBunchMode MultiBunchHandler::mode_m
private

◆ numBunch_m

short MultiBunchHandler::numBunch_m
private

The number of bunches specified in TURNS of RUN command.

Definition at line 159 of file MultiBunchHandler.h.

Referenced by injectBunch().

◆ onebunch_m

std::string MultiBunchHandler::onebunch_m
private

Definition at line 156 of file MultiBunchHandler.h.

Referenced by readBunch(), and saveBunch().

◆ radiusLastTurn_m

double MultiBunchHandler::radiusLastTurn_m
private

Definition at line 177 of file MultiBunchHandler.h.

Referenced by injectBunch(), and setRadiusTurns().

◆ radiusThisTurn_m

double MultiBunchHandler::radiusThisTurn_m
private

Definition at line 178 of file MultiBunchHandler.h.

Referenced by injectBunch(), and setRadiusTurns().


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