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

#include <Aperture.h>

Inheritance diagram for Aperture:
Inheritance graph
[legend]
Collaboration diagram for Aperture:
Collaboration graph
[legend]

Classes

class  A_row
 
struct  coord
 
struct  Data
 

Public Types

typedef TBeamline< A_rowA_Tline
 
- Public Types inherited from Table
typedef std::vector< CellCellArray
 An array of cell descriptors. More...
 

Public Member Functions

 Aperture ()
 
 Aperture (const std::string &name, Aperture *parent)
 
virtual ~Aperture ()
 
double getBETXMAX (const A_row &, int i1=0, int i2=0) const
 
double getBETYMAX (const A_row &, int i1=0, int i2=0) const
 
double getAPERTMIN (const A_row &row, int i1=0, int i2=0) const
 
std::vector< Aperture::coordgetShape (std::vector< double > vec)
 
void calcul_Apert (A_row &a, int slice, Twiss *tp)
 
virtual double getLength ()
 Return the length of the table. More...
 
virtual double getCell (const PlaceRep &place, const std::string &colName)
 Return value in selected table cell. More...
 
virtual const BeamlinegetLine () const
 Return embedded CLASSIC beamline. More...
 
virtual CellArray getDefault () const
 Return the default print columns. More...
 
virtual std::vector< double > getColumn (const RangeRep &rng, const std::string &colName)
 Return column [b]col[/b] of this table, limited by [b]range[/b]. More...
 
virtual std::vector< double > getRow (const PlaceRep &pos, const std::vector< std::string > &cols)
 Return a table row. More...
 
virtual bool isDependent (const std::string &name) const
 Find out if table depends on the object identified by [b]name[/b]. More...
 
virtual bool matches (Table *rhs) const
 Check that [b]rhs[/b] is of same type as [b]this[/b]. More...
 
virtual
Expressions::PtrToScalar
< double > 
makeColumnExpression (const std::string &colname) const
 
virtual Objectclone (const std::string &name)
 Return a clone. More...
 
virtual void printTable (std::ostream &, const CellArray &) const
 Print list for the table. More...
 
virtual void fill ()
 Refill the buffer. More...
 
A_Tline::const_iterator begin () const
 
A_Tline::iterator begin ()
 
A_Tline::const_iterator end () const
 
A_Tline::iterator end ()
 
const A_rowgetCurrent () const
 
virtual void visitMultipole (const Multipole &)
 Apply the algorithm to a multipole. More...
 
virtual void visitRBend (const RBend &)
 Apply the algorithm to a rectangular bend. More...
 
virtual void visitSBend (const SBend &)
 Apply the algorithm to a sector bend. More...
 
virtual void visitCyclotron (const Cyclotron &)
 Apply the algorithm to an cyclotron. More...
 
virtual void applyDefault (const ElementBase &)
 
void execute ()
 Apply the algorithm to the top-level beamline. More...
 
void run ()
 
void calcul (Twiss::TLine::iterator i, A_row &a, int order, Twiss *tp)
 
- Public Member Functions inherited from DefaultVisitor
 DefaultVisitor (const Beamline &beamline, bool backBeam, bool backTrack)
 Constructor. More...
 
virtual ~DefaultVisitor ()=0
 
virtual void visitBeamBeam (const BeamBeam &)
 Apply the algorithm to a beam-beam. More...
 
virtual void visitBeamStripping (const BeamStripping &)
 Apply the algorithm to a beam stripping. More...
 
virtual void visitCCollimator (const CCollimator &)
 Apply the algorithm to a collimator. More...
 
virtual void visitComponent (const Component &)
 Apply the algorithm to an arbitrary component. More...
 
virtual void visitRing (const Ring &)
 Apply the algorithm to an opal ring.. More...
 
virtual void visitCorrector (const Corrector &)
 Apply the algorithm to a corrector. More...
 
virtual void visitDegrader (const Degrader &)
 Apply the algorithm to a drift. More...
 
virtual void visitDiagnostic (const Diagnostic &)
 Apply the algorithm to a diagnostic. More...
 
virtual void visitDrift (const Drift &)
 Apply the algorithm to a drift. More...
 
virtual void visitFlexibleCollimator (const FlexibleCollimator &)
 Apply the algorithm to a flexible collimator. More...
 
virtual void visitLambertson (const Lambertson &)
 Apply the algorithm to a Lambertson. More...
 
virtual void visitMarker (const Marker &)
 Apply the algorithm to a marker. More...
 
virtual void visitMonitor (const Monitor &)
 Apply the algorithm to a monitor. More...
 
virtual void visitMultipoleT (const MultipoleT &)
 Apply the algorithm to a multipoleT. More...
 
virtual void visitMultipoleTStraight (const MultipoleTStraight &)
 Apply the algorithm to a multipoleTStraight. More...
 
virtual void visitMultipoleTCurvedConstRadius (const MultipoleTCurvedConstRadius &)
 Apply the algorithm to a multipoleTCurvedConstRadius. More...
 
virtual void visitMultipoleTCurvedVarRadius (const MultipoleTCurvedVarRadius &)
 Apply the algorithm to a multipoleTCurvedVarRadius. More...
 
virtual void visitOffset (const Offset &)
 Apply the algorithm to an Offset. More...
 
virtual void visitPatch (const Patch &pat)
 Apply the algorithm to a patch. More...
 
virtual void visitProbe (const Probe &prob)
 Apply the algorithm to a probe. More...
 
virtual void visitRBend3D (const RBend3D &)
 Apply the algorithm to a rectangular bend. More...
 
virtual void visitVariableRFCavity (const VariableRFCavity &vcav)
 Apply the algorithm to a RF cavity. More...
 
virtual void visitVariableRFCavityFringeField (const VariableRFCavityFringeField &vcav)
 Apply the algorithm to a RF cavity. More...
 
virtual void visitRFCavity (const RFCavity &)
 Apply the algorithm to a RF cavity. More...
 
virtual void visitTravelingWave (const TravelingWave &)
 Apply the algorithm to a RF cavity. More...
 
virtual void visitRFQuadrupole (const RFQuadrupole &)
 Apply the algorithm to a RF quadrupole. More...
 
virtual void visitSBend3D (const SBend3D &)
 Apply the algorithm to a sector bend. More...
 
virtual void visitScalingFFAMagnet (const ScalingFFAMagnet &)
 Apply the algorithm to a scaling FFA magnet. More...
 
virtual void visitVerticalFFAMagnet (const VerticalFFAMagnet &)
 Apply the algorithm to a RF cavity. More...
 
virtual void visitSeparator (const Separator &)
 Apply the algorithm to a separator. More...
 
virtual void visitSeptum (const Septum &)
 Apply the algorithm to a septum. More...
 
virtual void visitSolenoid (const Solenoid &)
 Apply the algorithm to a solenoid. More...
 
virtual void visitSource (const Source &)
 Apply the algorithm to a source. More...
 
virtual void visitParallelPlate (const ParallelPlate &)
 Apply the algorithm to a ParallelPlate. More...
 
virtual void visitCyclotronValley (const CyclotronValley &)
 Apply the algorithm to a CyclotronValley. More...
 
virtual void visitStripper (const Stripper &)
 Apply the algorithm to a charge stripper. More...
 
virtual void visitBeamline (const Beamline &)
 Apply the algorithm to a beam line. More...
 
virtual void visitFlaggedElmPtr (const FlaggedElmPtr &)
 Apply the algorithm to a FlaggedElmPtr. More...
 
virtual void visitAlignWrapper (const AlignWrapper &)
 Apply the algorithm to an align wrapper.. More...
 
virtual void visitCorrectorWrapper (const CorrectorWrapper &)
 Apply the algorithm to an corrector wrapper.. More...
 
virtual void visitCyclotronWrapper (const CyclotronWrapper &)
 Apply the algorithm to an cyclotron wrapper.. More...
 
virtual void visitMultipoleWrapper (const MultipoleWrapper &)
 Apply the algorithm to an multipole wrapper.. More...
 
virtual void visitRBendWrapper (const RBendWrapper &)
 Apply the algorithm to an RBend wrapper.. More...
 
virtual void visitSBendWrapper (const SBendWrapper &)
 Apply the algorithm to an SBend wrapper.. More...
 
virtual void visitIntegrator (const Integrator &)
 Apply the algorithm to a generic integrator. More...
 
virtual void visitMapIntegrator (const MapIntegrator &)
 Apply the algorithm to an integrator capable of mapping. More...
 
virtual void visitTrackIntegrator (const TrackIntegrator &)
 Apply the algorithm to an integrator capable of tracking. More...
 
- Public Member Functions inherited from BeamlineVisitor
 BeamlineVisitor ()
 
virtual ~BeamlineVisitor ()
 
- Public Member Functions inherited from Table
virtual ~Table ()
 
virtual bool canReplaceBy (Object *newObject)
 Test if object can be replaced. More...
 
virtual const std::string getCategory () const
 Return the object category as a string. More...
 
virtual bool shouldTrace () const
 Trace flag. More...
 
virtual bool shouldUpdate () const
 Update flag. More...
 
virtual void invalidate ()
 Mark this table as invalid, if it is dynamic. More...
 
- Public Member Functions inherited from Object
virtual ~Object ()
 
void copyAttributes (const Object &)
 Copy attributes from another object. More...
 
virtual AttributefindAttribute (const std::string &name)
 Find an attribute by name. More...
 
virtual const AttributefindAttribute (const std::string &name) const
 Find an attribute by name. More...
 
virtual ObjectmakeTemplate (const std::string &, TokenStream &, Statement &)
 Macro handler function. More...
 
virtual ObjectmakeInstance (const std::string &name, Statement &, const Parser *)
 Macro handler function. More...
 
virtual void parse (Statement &)
 Parse the object. More...
 
virtual void parseShortcut (Statement &)
 Parser for single-attribute commands. More...
 
virtual void print (std::ostream &) const
 Print the object. More...
 
virtual void printValue (std::ostream &) const
 
virtual void printHelp (std::ostream &) const
 Print help. More...
 
virtual void replace (Object *oldObject, Object *newObject)
 Replace references. More...
 
virtual void update ()
 Update this object. More...
 
bool isBuiltin () const
 True, if [b]this[/b] is a built-in object. More...
 
virtual bool isShared () const
 Shared flag. More...
 
virtual void setShared (bool)
 Set/reset shared flag. More...
 
void setDirty (bool)
 Set/reset the [b]modified[/b] flag. More...
 
bool isDirty () const
 True, if the [b]modified[/b] flag is set. More...
 
void setFlag (bool)
 Flag/unflag this object, e. g. to control output of objects for. More...
 
bool isFlagged () const
 True, if [b]this[/b] is flagged by setFlag(true). More...
 
const ObjectgetBaseObject () const
 Return the object's base type object. More...
 
const std::string & getOpalName () const
 Return object name. More...
 
ObjectgetParent () const
 Return parent pointer. More...
 
bool isTreeMember (const Object *subTree) const
 Test for tree membership. More...
 
void setOpalName (const std::string &name)
 Set object name. More...
 
void setParent (Object *)
 Set parent object. More...
 
void clear ()
 Clear the occurrence counter. More...
 
int increment ()
 Increment and return the occurrence counter. More...
 
int occurrenceCount ()
 Return the occurrence counter. More...
 
void registerReference (Invalidator *a)
 Register a reference to this object. More...
 
void unregisterReference (Invalidator *a)
 Unegister a reference to this object. More...
 
void registerOwnership (const AttributeHandler::OwnerType &itsClass) const
 
- Public Member Functions inherited from RCObject
int addReference () const
 Increment reference count. More...
 
int removeReference () const
 Decrement the reference count. More...
 
bool isShared () const
 Test for sharing. More...
 

Protected Types

enum  {
  TABLE, BEAM, NSLICE, STATIC,
  DATA, DEFAULTAPERTURE, FILE, SIZE
}
 

Protected Attributes

struct Aperture::Data data
 
double co
 
double K_beta
 
double delta_p
 
double n1
 
double tolerance_x
 
double tolerance_y
 
double offsetx
 
double offsety
 
std::vector< coordShapeBeamScreen
 
std::vector< coordShapeHalo
 
A_Tline itsTable
 
A_Tline::iterator n
 
const Beambeam
 
Twisstp
 
Twiss::TLine::iterator i
 
FMatrix< double, 6, 6 > Transf_mat
 
FVector< double, 3 > Euler_x
 
FVector< double, 3 > Euler_y
 
FVector< double, 2 > Dispx
 
FVector< double, 2 > Dispy
 
- Protected Attributes inherited from DefaultVisitor
const BeamlineitsLine
 
bool back_beam
 
bool back_track
 
bool back_path
 
double flip_B
 
double flip_s
 
- Protected Attributes inherited from Table
bool dynamic
 Flag dynamic table. More...
 
bool refill
 Refill flag. More...
 
- Protected Attributes inherited from Object
bool builtin
 Built-in flag. More...
 
bool modified
 Dirty flag. More...
 
bool flagged
 Object flag. More...
 

Private Member Functions

A_rowfindRow (const PlaceRep &row)
 

Private Attributes

A_Tline::const_iterator current
 
std::string itsLine
 

Additional Inherited Members

- Static Public Member Functions inherited from Table
static Tablefind (const std::string &name)
 Find named Table. More...
 
- Public Attributes inherited from Object
std::vector< AttributeitsAttr
 The object attributes (see Attribute.hh). More...
 
- Protected Member Functions inherited from Table
 Table (int size, const char *name, const char *help)
 Constructor for exemplars. More...
 
 Table (const std::string &name, Table *parent)
 Constructor for clones. More...
 
- Protected Member Functions inherited from Object
 Object (int size, const char *name, const char *help)
 Constructor for exemplars. More...
 
 Object (const std::string &name, Object *parent)
 Constructor for clones. More...
 
- Protected Member Functions inherited from RCObject
 RCObject ()
 Default constructor. More...
 
 RCObject (const RCObject &)
 Copy constructor. More...
 
virtual ~RCObject ()=0
 
RCObjectoperator= (const RCObject &right)
 

Detailed Description

Definition at line 18 of file Aperture.h.

Member Typedef Documentation

Definition at line 82 of file Aperture.h.

Member Enumeration Documentation

anonymous enum
protected
Enumerator
TABLE 
BEAM 
NSLICE 
STATIC 
DATA 
DEFAULTAPERTURE 
FILE 
SIZE 

Definition at line 142 of file Aperture.h.

Constructor & Destructor Documentation

Aperture::Aperture ( )
Aperture::Aperture ( const std::string &  name,
Aperture parent 
)

Definition at line 201 of file Aperture.cpp.

virtual Aperture::~Aperture ( )
inlinevirtual

Definition at line 86 of file Aperture.h.

Member Function Documentation

void Aperture::applyDefault ( const ElementBase eb)
virtual

Reimplemented from DefaultVisitor.

Definition at line 350 of file Aperture.cpp.

References Aperture::Data::courb, data, ElementBase::getElementLength(), Aperture::Data::k0s, Aperture::Data::kq, Aperture::Data::l, Aperture::Data::phi, and Aperture::Data::type.

Here is the call graph for this function:

Aperture::A_Tline::const_iterator Aperture::begin ( ) const

Definition at line 244 of file Aperture.cpp.

References itsTable.

Referenced by findRow(), getColumn(), and isDependent().

Aperture::A_Tline::iterator Aperture::begin ( )

Definition at line 241 of file Aperture.cpp.

References itsTable.

void Aperture::calcul ( Twiss::TLine::iterator  i,
A_row a,
int  order,
Twiss tp 
)
void Aperture::calcul_Apert ( A_row a,
int  slice,
Twiss tp 
)

Definition at line 684 of file Aperture.cpp.

References atan2(), beam, co, cos(), Twiss::getEX(), Twiss::getEY(), PartData::getM(), PartData::getP(), Beam::getReference(), i, Aperture::A_row::Interpol, n1, Physics::pi, ShapeBeamScreen, ShapeHalo, sin(), and sqrt().

Referenced by calcul().

Here is the call graph for this function:

Object * Aperture::clone ( const std::string &  name)
virtual

Return a clone.

Implements Object.

Definition at line 1020 of file Aperture.cpp.

References Aperture().

Here is the call graph for this function:

Aperture::A_Tline::const_iterator Aperture::end ( ) const

Definition at line 250 of file Aperture.cpp.

References itsTable.

Referenced by findRow(), getColumn(), and isDependent().

Aperture::A_Tline::iterator Aperture::end ( )

Definition at line 247 of file Aperture.cpp.

References itsTable.

void Aperture::execute ( )
virtual

Apply the algorithm to the top-level beamline.

Reimplemented from DefaultVisitor.

Definition at line 831 of file Aperture.cpp.

References BEAM, beam, co, DATA, OPALTimer::Timer::date(), delta_p, Table::dynamic, endl(), FILE, fill(), Beam::find(), Attributes::getBool(), Object::getOpalName(), Attributes::getReal(), Attributes::getRealArray(), getShape(), Attributes::getString(), Object::itsAttr, K_beta, n1, NSLICE, ShapeHalo, STATIC, and OPALTimer::Timer::time().

Here is the call graph for this function:

void Aperture::fill ( )
virtual

Refill the buffer.

Implements Table.

Definition at line 872 of file Aperture.cpp.

References Table::refill, and run().

Referenced by execute().

Here is the call graph for this function:

Aperture::A_row & Aperture::findRow ( const PlaceRep row)
private

Definition at line 1026 of file Aperture.cpp.

References begin(), end(), PlaceRep::enter(), Object::getOpalName(), i, PlaceRep::initialize(), PlaceRep::isActive(), and PlaceRep::leave().

Referenced by getCell(), and getRow().

Here is the call graph for this function:

double Aperture::getAPERTMIN ( const A_row row,
int  i1 = 0,
int  i2 = 0 
) const

Definition at line 275 of file Aperture.cpp.

References Attributes::getReal(), i, Aperture::A_row::Interpol, Object::itsAttr, min(), and NSLICE.

Here is the call graph for this function:

double Aperture::getBETXMAX ( const A_row row,
int  i1 = 0,
int  i2 = 0 
) const

Definition at line 254 of file Aperture.cpp.

References Attributes::getReal(), i, Aperture::A_row::Interpol, Object::itsAttr, max(), and NSLICE.

Here is the call graph for this function:

double Aperture::getBETYMAX ( const A_row row,
int  i1 = 0,
int  i2 = 0 
) const

Definition at line 264 of file Aperture.cpp.

References Attributes::getReal(), i, Aperture::A_row::Interpol, Object::itsAttr, max(), and NSLICE.

Here is the call graph for this function:

double Aperture::getCell ( const PlaceRep row,
const std::string &  col 
)
virtual

Return value in selected table cell.

Implements Table.

Definition at line 948 of file Aperture.cpp.

References findRow().

Here is the call graph for this function:

std::vector< double > Aperture::getColumn ( const RangeRep range,
const std::string &  col 
)
virtual

Return column [b]col[/b] of this table, limited by [b]range[/b].

Implements Table.

Definition at line 965 of file Aperture.cpp.

References begin(), end(), RangeRep::enter(), RangeRep::initialize(), RangeRep::isActive(), and RangeRep::leave().

Here is the call graph for this function:

const Aperture::A_row & Aperture::getCurrent ( ) const

Definition at line 940 of file Aperture.cpp.

References current.

Table::CellArray Aperture::getDefault ( ) const
virtual

Return the default print columns.

Implements Table.

Definition at line 956 of file Aperture.cpp.

double Aperture::getLength ( )
virtual

Return the length of the table.

Implements Table.

Definition at line 944 of file Aperture.cpp.

References TBeamline< T >::getElementLength(), and itsTable.

Here is the call graph for this function:

const Beamline * Aperture::getLine ( ) const
virtual

Return embedded CLASSIC beamline.

Implements Table.

Definition at line 953 of file Aperture.cpp.

References itsTable.

std::vector< double > Aperture::getRow ( const PlaceRep ,
const std::vector< std::string > &   
)
virtual

Return a table row.

Implements Table.

Definition at line 982 of file Aperture.cpp.

References findRow().

Here is the call graph for this function:

vector< Aperture::coord > Aperture::getShape ( std::vector< double >  vec)

Definition at line 737 of file Aperture.cpp.

References acos(), asin(), atan2(), cos(), i, Physics::pi, sin(), tan(), Aperture::coord::x, and Aperture::coord::y.

Referenced by calcul(), and execute().

Here is the call graph for this function:

bool Aperture::isDependent ( const std::string &  name) const
virtual

Find out if table depends on the object identified by [b]name[/b].

Implements Table.

Definition at line 1003 of file Aperture.cpp.

References begin(), end(), itsLine, and name.

Here is the call graph for this function:

Expressions::PtrToScalar< double > Aperture::makeColumnExpression ( const std::string &  colname) const
virtual

Implements Table.

Definition at line 1016 of file Aperture.cpp.

bool Aperture::matches ( Table rhs) const
virtual

Check that [b]rhs[/b] is of same type as [b]this[/b].

Implements Table.

Definition at line 1015 of file Aperture.cpp.

void Aperture::printTable ( std::ostream &  ,
const CellArray  
) const
virtual

Print list for the table.

Implements Table.

Definition at line 1024 of file Aperture.cpp.

void Aperture::run ( )
void Aperture::visitCyclotron ( const Cyclotron cyc)
virtual

Apply the algorithm to an cyclotron.

Reimplemented from DefaultVisitor.

Definition at line 324 of file Aperture.cpp.

References ERRORMSG.

void Aperture::visitMultipole ( const Multipole mult)
virtual
void Aperture::visitRBend ( const RBend bend)
virtual
void Aperture::visitSBend ( const SBend bend)
virtual

Member Data Documentation

const Beam* Aperture::beam
protected

Definition at line 155 of file Aperture.h.

Referenced by calcul_Apert(), execute(), visitMultipole(), visitRBend(), and visitSBend().

double Aperture::co
protected

Definition at line 28 of file Aperture.h.

Referenced by calcul_Apert(), and execute().

A_Tline::const_iterator Aperture::current
mutableprivate

Definition at line 172 of file Aperture.h.

Referenced by getCurrent().

struct Aperture::Data Aperture::data
protected
double Aperture::delta_p
protected

Definition at line 28 of file Aperture.h.

Referenced by calcul(), and execute().

FVector<double, 2> Aperture::Dispx
protected

Definition at line 167 of file Aperture.h.

Referenced by calcul().

FVector<double, 2> Aperture::Dispy
protected

Definition at line 168 of file Aperture.h.

Referenced by calcul().

FVector<double, 3> Aperture::Euler_x
protected

Definition at line 163 of file Aperture.h.

Referenced by calcul().

FVector<double, 3> Aperture::Euler_y
protected

Definition at line 164 of file Aperture.h.

Referenced by calcul().

Twiss::TLine::iterator Aperture::i
protected

Definition at line 157 of file Aperture.h.

Referenced by calcul_Apert(), findRow(), getAPERTMIN(), getBETXMAX(), getBETYMAX(), getShape(), and run().

std::string Aperture::itsLine
private

Definition at line 174 of file Aperture.h.

Referenced by isDependent(), and run().

A_Tline Aperture::itsTable
protected

Definition at line 153 of file Aperture.h.

Referenced by begin(), end(), getLength(), getLine(), and run().

double Aperture::K_beta
protected

Definition at line 28 of file Aperture.h.

Referenced by calcul(), and execute().

A_Tline::iterator Aperture::n
protected

Definition at line 154 of file Aperture.h.

double Aperture::n1
protected

Definition at line 28 of file Aperture.h.

Referenced by calcul_Apert(), and execute().

double Aperture::offsetx
protected

Definition at line 30 of file Aperture.h.

Referenced by calcul().

double Aperture::offsety
protected

Definition at line 30 of file Aperture.h.

Referenced by calcul().

std::vector<coord> Aperture::ShapeBeamScreen
protected

Definition at line 37 of file Aperture.h.

Referenced by calcul(), and calcul_Apert().

std::vector<coord> Aperture::ShapeHalo
protected

Definition at line 38 of file Aperture.h.

Referenced by calcul_Apert(), and execute().

double Aperture::tolerance_x
protected

Definition at line 30 of file Aperture.h.

Referenced by calcul().

double Aperture::tolerance_y
protected

Definition at line 30 of file Aperture.h.

Referenced by calcul().

Twiss* Aperture::tp
protected

Definition at line 156 of file Aperture.h.

Referenced by run().

FMatrix<double, 6, 6> Aperture::Transf_mat
protected

Definition at line 160 of file Aperture.h.

Referenced by calcul().


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