diff --git a/tracy/tracy/inc/tracy_global.h b/tracy/tracy/inc/tracy_global.h index 7f2b37f9a96c6ea328340bdf8260cbdcfd1e488b..53b5ff5a916a79e55dd80d9dc1d21f0b71a16758 100644 --- a/tracy/tracy/inc/tracy_global.h +++ b/tracy/tracy/inc/tracy_global.h @@ -17,10 +17,10 @@ typedef struct globvalrec { failing */ double CODeps; // precision for closed orbit finder Vector CODvect; // closed orbit - long int bpm; // bpm number - long int hcorr; // horizontal corrector number - long int vcorr; // vertical corrector number - long int qt; // vertical corrector number + long int bpm; // family index of bpm + long int hcorr; // family index of horizontal corrector for orbit correction + long int vcorr; // family index of vertical corrector for orbit correction + long int qt; // family index of skew quadrupole int gs; // girder start marker int ge; // girder end marker Matrix OneTurnMat, // oneturn matrix @@ -83,15 +83,15 @@ struct MpoleType { Vector2 PdSrms; // rms [m] Vector2 PdSrnd; // random number // Roll angle - double PdTpar; // design [deg] + double PdTpar; // design [deg], if not equal zero, then skew multipole double PdTsys; // systematic [deg] double PdTrms; // rms [deg] double PdTrnd; // random number // Multipole strengths mpolArray PBpar; // design - mpolArray PBsys; // systematic + mpolArray PBsys; // systematic, with multipole errors mpolArray PBrms; // rms - mpolArray PBrnd; // random number + mpolArray PBrnd; // random number, random error? mpolArray PB; // total int Porder; // The highest order in PB int n_design; // multipole order (design) @@ -100,7 +100,7 @@ struct MpoleType { double PTx1; // horizontal entrance angle [deg] double PTx2; // horizontal exit angle [deg] double Pgap; // total magnet gap [m] - double Pirho; // 1/rho [1/m] + double Pirho; // angle/strength of the dipole, 1/rho [1/m] double Pc0, Pc1, Ps1; // corrections for roll error of bend Matrix AU55, // Upstream 5x5 matrix AD55; // Downstream 5x5 matrix @@ -245,8 +245,8 @@ struct elemtype { struct ElemFamType { elemtype ElemF; /* Structure (name, type) */ - int nKid; /* Kid number */ - int KidList[nKidMax]; + int nKid; /* number of Kids in a family */ + int KidList[nKidMax]; /* list of kid index in the total lattice*/ int NoDBN; DBNameType DBNlist[nKidMax]; }; @@ -255,7 +255,7 @@ struct ElemFamType { struct CellType { long int Fnum; // Element Family # long int Knum; // Element Kid # - double S; // Position in the ring + double S; // Position in the ring [m] CellType* next_ptr; // pointer to next cell (for tracking) Vector2 dS, // Transverse displacement dT; // dT = (cos(dT), sin(dT)) diff --git a/tracy/tracy/src/t2elem.cc b/tracy/tracy/src/t2elem.cc index fe2a04a69df2955c7b739be6a3c1f8e60d4bb6bc..5cec54848b1ab18ed50cb304b5e26106712d75d7 100644 --- a/tracy/tracy/src/t2elem.cc +++ b/tracy/tracy/src/t2elem.cc @@ -2519,7 +2519,7 @@ void putelem(long i, CellType *cellrec) /* int GetnKid(const int Fnum1) Purpose: - return the kid number of the family + return the number of kid in the family Input: Fnum1 : family number @@ -3521,14 +3521,39 @@ void Solenoid_Init(int Fnum1) } } - +/************************************************************************************** void Mpole_SetPB(int Fnum1, int Knum1, int Order) -{ - /* called by Cell_SetdP + + Purpose: + called by Cell_SetdP Compute full multipole composent as sum of design, systematic and random part Compute transport matrix if quadrupole (Order=2) - Set multipole order to Order if multipole (Order >2) */ + Set multipole order to Order if multipole (Order >2) + + Input: + Fnum1 family name + Knum1 kid number + Order maximum order of the multipole + + Output: + None + + Return: + None + + Gloval variables: + None + + Specific functions: + + Comments: + None + +**************************************************************************************/ +void Mpole_SetPB(int Fnum1, int Knum1, int Order) +{ + /* */ CellType *cellp; /* pointer on the Cell */ elemtype *elemp; /* pointer on the Elemetype */ diff --git a/tracy/tracy/src/t2lat.cc b/tracy/tracy/src/t2lat.cc index bc9d0b3baaff30207580fded57d5e4680065b0ff..1a87ff446831254c34773156e7651397d6531013 100644 --- a/tracy/tracy/src/t2lat.cc +++ b/tracy/tracy/src/t2lat.cc @@ -4284,7 +4284,7 @@ void PrintResult(struct LOC_Lattice_Read *LINK) comfortably accessed using the element name. This is no longer possible because we gave up on the interpretive PASCAL-S. Input: - name Family name + name Family name Output: none diff --git a/tracy/tracy/src/tpsa_lin_pm.cc b/tracy/tracy/src/tpsa_lin_pm.cc index dc00ba999d628c4bc6d802bdc01b72da456e36da..3f087f35e9967cb8bf5af405363ec3a1c92c1d54 100644 --- a/tracy/tracy/src/tpsa_lin_pm.cc +++ b/tracy/tracy/src/tpsa_lin_pm.cc @@ -199,6 +199,12 @@ tps& tps::operator/=(const tps &x) { dadiv_(ltps, x.ltps, ltps); return *this; } +/********************************************************* +tps sqrt(const tps &a) + + Purpose: + Calculate sqrt(a), and return it. +*********************************************************/ tps sqrt(const tps &a) { tps b; @@ -207,6 +213,12 @@ tps sqrt(const tps &a) return b; } +/********************************************************* +tps pow(const tps &a, const int n) + + Purpose: + Calculate a^n, and return it. +*********************************************************/ tps pow(const tps &a, const int n) { if (n < 0) @@ -225,6 +237,12 @@ tps pow(const tps &a, const int n) } } +/********************************************************* +tps exp(const tps &a) + + Purpose: + Calculate exp(a), and return it. +*********************************************************/ tps exp(const tps &a) { tps b; @@ -233,6 +251,12 @@ tps exp(const tps &a) return b; } +/********************************************************* +tps log(const tps &a) + + Purpose: + Calculate log(a), and return it. +*********************************************************/ tps log(const tps &a) { tps b; @@ -241,6 +265,12 @@ tps log(const tps &a) return b; } +/********************************************************* +tps sin(const tps &a) + + Purpose: + Calculate sin(a), and return it. +*********************************************************/ tps sin(const tps &a) { tps b; @@ -249,7 +279,12 @@ tps sin(const tps &a) return b; } +/********************************************************* +tps cos(const tps &a) + Purpose: + Calculate cos(a), and return it. +*********************************************************/ tps cos(const tps &a) { tps b; @@ -258,6 +293,12 @@ tps cos(const tps &a) return b; } +/********************************************************* +tps tan(const tps &a) + + Purpose: + Calculate tan(a), and return it. +*********************************************************/ tps tan(const tps &a) { tps b; @@ -266,6 +307,12 @@ tps tan(const tps &a) return b; } +/********************************************************* +tps asin(const tps &a) + + Purpose: + Calculate asin(a), and return it. +*********************************************************/ tps asin(const tps &a) { tps b; @@ -274,6 +321,12 @@ tps asin(const tps &a) return b; } +/********************************************************* +tps atan(const tps &a) + + Purpose: + Calculate atan(a), and return it. +*********************************************************/ tps atan(const tps &a) { tps b; @@ -282,7 +335,12 @@ tps atan(const tps &a) return b; } +/********************************************************* +tps log(const tps &a) + Purpose: + Calculate log(a), and return it. +*********************************************************/ tps atan2(const tps &b,const tps &a) { tps c; @@ -303,7 +361,12 @@ tps atan2(const tps &b,const tps &a) { return c; } +/********************************************************* +tps sinh(const tps &a) + Purpose: + Calculate sinh(a), and return it. +*********************************************************/ tps sinh(const tps &a) { tps b; @@ -312,6 +375,12 @@ tps sinh(const tps &a) return b; } +/********************************************************* +tps cosh(const tps &a) + + Purpose: + Calculate cosh(a), and return it. +*********************************************************/ tps cosh(const tps &a) { tps b; @@ -320,6 +389,12 @@ tps cosh(const tps &a) return b; } +/********************************************************* +tps log(const tps &a) + + Purpose: + Calculate log(a), and return it. +*********************************************************/ const double tps::cst(void) const { int i; @@ -332,6 +407,12 @@ const double tps::cst(void) const return r; } +/********************************************************* +tps log(const tps &a) + + Purpose: + Calculate log(a), and return it. +*********************************************************/ double abs(const tps &a) { double r; @@ -340,6 +421,12 @@ double abs(const tps &a) return r; } +/********************************************************* +tps log(const tps &a) + + Purpose: + Calculate log(a), and return it. +*********************************************************/ double abs2(const tps &a) { double r;