25 #define CHECK_CYC_FSCANF_EOF(arg) if(arg == EOF)\
26 throw GeneralClassicException("Cyclotron::getFieldFromFile",\
27 "fscanf returned EOF at " #arg);
43 fmapfn_m(right.fmapfn_m),
44 rffrequ_m(right.rffrequ_m),
45 rfphi_m(right.rfphi_m),
46 escale_m(right.escale_m),
47 superpose_m(right.superpose_m),
48 symmetry_m(right.symmetry_m),
49 rinit_m(right.rinit_m),
50 prinit_m(right.prinit_m),
51 phiinit_m(right.phiinit_m),
52 zinit_m(right.zinit_m),
53 pzinit_m(right.pzinit_m),
54 spiral_flag_m(right.spiral_flag_m),
55 trimCoilThreshold_m(right.trimCoilThreshold_m),
58 bscale_m(right.bscale_m),
59 trimcoils_m(right.trimcoils_m),
64 fmLowE_m(right.fmLowE_m),
65 fmHighE_m(right.fmHighE_m),
66 RFfilename_m(right.RFfilename_m),
67 RFFCoeff_fn_m(right.RFFCoeff_fn_m),
68 RFVCoeff_fn_m(right.RFVCoeff_fn_m) {
83 double *br,
double *bz) {
85 trimcoil->applyField(r,tet_rad,z,br,bz);
91 double& br,
double& bz) {
198 if(type == std::string(
"CARBONCYCL")) {
200 }
else if(type == std::string(
"CYCIAE")) {
202 }
else if(type == std::string(
"AVFEQ")) {
204 }
else if(type == std::string(
"FFA")) {
206 }
else if(type == std::string(
"BANDRF")) {
208 }
else if(type == std::string(
"SYNCHROCYCLOTRON")) {
228 "RFFREQ not defined for CYCLOTRON!");
344 bool flagNeedUpdate =
false;
351 flagNeedUpdate =
true;
353 <<
": Particle " <<
id
354 <<
" out of the global aperture of cyclotron!" <<
endl;
362 <<
": Particle "<<
id
363 <<
" out of the field map boundary!" <<
endl;
369 if (flagNeedUpdate) {
375 return flagNeedUpdate;
381 const double rad = std::hypot(R[0],R[1]);
382 const double tempv =
atan(R[1] / R[0]);
387 if ((R[0] < 0) && (R[1] >= 0)) tet =
pi + tempv;
388 else if((R[0] < 0) && (R[1] <= 0)) tet =
pi + tempv;
389 else if((R[0] > 0) && (R[1] <= 0)) tet = 2.0 *
pi + tempv;
390 else if((R[0] == 0) && (R[1] > 0)) tet =
pi / 2.0;
391 else if((R[0] == 0) && (R[1] < 0)) tet = 1.5 *
pi;
393 double tet_rad = tet;
396 tet = tet /
pi * 180.0;
402 double brint = 0.0, btint = 0.0, bzint = 0.0;
404 if ( this->
interpolate(rad, tet_rad, brint, btint, bzint) ) {
407 double br = - brint * R[2];
410 double bt = - btint / rad * R[2];
418 B[0] = br *
cos(tet_rad) - bt *
sin(tet_rad);
419 B[1] = br *
sin(tet_rad) + bt *
cos(tet_rad);
430 std::vector<Fieldmap *>::const_iterator fi =
RFfields_m.begin();
431 std::vector<double>::const_iterator rffi =
rffrequ_m.begin();
432 std::vector<double>::const_iterator rfphii =
rfphi_m.begin();
433 std::vector<double>::const_iterator escali =
escale_m.begin();
434 std::vector<bool>::const_iterator superposei =
superpose_m.begin();
435 std::vector<std::vector<double>>::const_iterator rffci =
rffc_m.begin();
436 std::vector<std::vector<double>>::const_iterator rfvci =
rfvc_m.begin();
438 double xBegin(0), xEnd(0), yBegin(0), yEnd(0), zBegin(0), zEnd(0);
441 for(; fi !=
RFfields_m.end(); ++fi, ++rffi, ++rfphii, ++escali, ++superposei) {
442 (*fi)->getFieldDimensions(xBegin, xEnd, yBegin, yEnd, zBegin, zEnd);
443 if (fcount > 0 && *superposei ==
false)
continue;
449 if (temp_R(0) < xBegin || temp_R(0) > xEnd ||
450 temp_R(1) < yBegin || temp_R(1) > yEnd ||
451 temp_R(2) < zBegin || temp_R(2) > zEnd)
continue;
453 Vector_t tmpE(0.0, 0.0, 0.0), tmpB(0.0, 0.0, 0.0);
455 if ((*fi)->getFieldstrength(temp_R, tmpE, tmpB))
continue;
459 double frequency = (*rffi);
460 double ebscale = (*escali);
464 for(
const double fcoef : (*rffci)) {
465 powert *= (t * 1
e-9);
466 frequency += fcoef * powert;
469 for(
const double vcoef : (*rfvci)) {
470 powert *= (t * 1
e-9);
471 ebscale += vcoef * powert;
475 double phase = 2.0 *
pi * 1.0E-3 * frequency * t + (*rfphii);
477 E += ebscale *
cos(phase) * tmpE;
478 B -= ebscale *
sin(phase) * tmpB;
485 double phase_print = 180.0 * phase /
pi;
486 phase_print =
fmod(phase_print, 360) - 360.0;
488 *gmsg <<
endl <<
"Gap 1 phase = " << phase_print <<
" Deg" <<
endl;
489 *gmsg <<
"Gap 1 E-Field = (" << E[0] <<
"/" << E[1] <<
"/" << E[2] <<
")" <<
endl;
490 *gmsg <<
"Gap 1 B-Field = (" << B[0] <<
"/" << B[1] <<
"/" << B[2] <<
")" <<
endl;
491 *gmsg <<
"RF Frequency = " << frequency <<
" MHz" <<
endl;
497 double phase_print = 180.0 * phase /
pi;
498 phase_print =
fmod(phase_print, 360) - 360.0;
500 *gmsg <<
endl <<
"Gap 2 phase = " << phase_print <<
" Deg" <<
endl;
501 *gmsg <<
"Gap 2 E-Field = (" << E[0] <<
"/" << E[1] <<
"/" << E[2] <<
")" <<
endl;
502 *gmsg <<
"Gap 2 B-Field = (" << B[0] <<
"/" << B[1] <<
"/" << B[2] <<
")" <<
endl;
503 *gmsg <<
"RF Frequency = " << frequency <<
" MHz" <<
endl;
514 const double& tet_rad,
double& br,
515 double& bt,
double& bz) {
524 *gmsg <<
"* Finalize cyclotron" <<
endl;
536 double C[5][5][3], FAC[3];
638 for(j = 0; j < 5; j++) {
639 result += C[j][krl][kor] * *(f + j * lpr);
642 return result / (FAC[kor] *
pow(dx, (kor + 1)));
647 const double& tet_rad,
655 const int ir = (
int)xir;
658 const double wr1 = xir - (double)ir;
660 const double wr2 = 1.0 - wr1;
666 double xit = tet_map /
BP.
dtet;
670 const double wt1 = xit - (double)it;
671 const double wt2 = 1.0 - wt1;
678 int r1t1, r2t1, r1t2, r2t2;
688 r1t1 = it + ntetS * ir - 1;
699 r2t1 =
idx(ir + 1, it);
700 r1t2 =
idx(ir, it + 1);
701 r2t2 =
idx(ir + 1, it + 1);
742 }
else if(fieldflag == 2) {
747 }
else if(fieldflag == 3) {
752 }
else if(fieldflag == 4) {
753 *gmsg <<
"* Read AVFEQ data (Riken) use bfield scale factor bs = " <<
getBScale() <<
endl;
757 }
else if(fieldflag == 5) {
762 }
else if(fieldflag == 6) {
763 *gmsg <<
"* Read both median plane B field map and 3D E field map of RF cavity for compact cyclotron" <<
getBScale() <<
endl;
767 }
else if(fieldflag == 7) {
768 *gmsg <<
"* Read midplane B-field, 3D RF fieldmaps, and text files with RF frequency/Voltage coefficients for Synchrocyclotron. (Midplane scaling = " <<
getBScale() <<
")" <<
endl;
773 ERRORMSG(
"* The field reading function of this TYPE of CYCLOTRON has not implemented yet!" <<
endl);
801 double dtheta =
pi / 180.0 *
BP.
dtet;
808 int dkFromEdge = k - kEdge;
809 int index =
idx(i, k);
810 int indexkEdge =
idx(i, kEdge);
829 int irtak = i - iredg;
830 int index =
idx(i, k);
831 int indexredg =
idx(iredg, k);
850 - 2.0 *
Bfield.
dbtt[index] / rac / rac / rac) / 6.0;
861 int istart =
idx(i, 0);
903 *gmsg <<
"* ----------------------------------------------" <<
endl;
904 *gmsg <<
"* READ IN RING FIELD MAP " <<
endl;
905 *gmsg <<
"* (The first data block is useless) " <<
endl;
906 *gmsg <<
"* ----------------------------------------------" <<
endl;
910 if((f = fopen(
fmapfn_m.c_str(),
"r")) == NULL) {
912 "failed to open file '" +
fmapfn_m +
"', please check if it exists");
916 *gmsg <<
"* Minimal radius of measured field map: " <<
BP.
rmin <<
" [mm]" <<
endl;
922 *gmsg <<
"* Stepsize in radial direction: " <<
BP.
delr <<
" [mm]" <<
endl;
926 *gmsg <<
"* Minimal angle of measured field map: " <<
BP.
tetmin <<
" [deg.]" <<
endl;
931 *gmsg <<
"* Stepsize in azimuth direction: " <<
BP.
dtet <<
" [deg.]" <<
endl;
933 for(
int i = 0; i < 13; i++)
940 *gmsg <<
"* Index in azimuthal direction: " <<
Bfield.
ntet <<
endl;
943 *gmsg <<
"* Accordingly, total grid point along azimuth: " <<
Bfield.
ntetS <<
endl;
945 for(
int i = 0; i < 5; i++) {
951 for(
int i = 0; i < 4; i++) {
955 for(
int i = 0; i < lpar; i++) {
958 for(
int i = 0; i < 6; i++) {
962 for(
int i = 0; i < 10000; i++) {
964 if(strcmp(fout,
"LREC=") == 0)
break;
967 for(
int i = 0; i < 5; i++) {
972 *gmsg <<
"* Total stored grid point number ( ntetS * nrad ) : " <<
Bfield.
ntot <<
endl;
979 *gmsg <<
"* Read-in loop one block per radius" <<
endl;
980 *gmsg <<
"* Rescaling of the fields with factor: " <<
BP.
Bfact <<
endl;
984 for(
int dummy = 0; dummy < 6; dummy++) {
1008 *gmsg <<
"* Field Map read successfully!" << endl <<
endl;
1017 for(
int i = 0; i < nrad; i++) {
1018 BP.
rarr[i] = rmin + i * dr;
1032 this->
read(fieldflag, scaleFactor);
1057 std::vector<double> rv;
1058 std::vector<double> thv;
1059 std::vector<double> xv;
1060 std::vector<double> yv;
1061 std::vector<double> bzv;
1064 *gmsg <<
"* ----------------------------------------------" <<
endl;
1065 *gmsg <<
"* READ IN FFA FIELD MAP " <<
endl;
1066 *gmsg <<
"* ----------------------------------------------" <<
endl;
1070 std::ifstream file_to_read(
fmapfn_m.c_str());
1071 const int max_num_of_char_in_a_line = 128;
1072 const int num_of_header_lines = 1;
1075 for(
int i = 0; i < num_of_header_lines; ++i)
1076 file_to_read.ignore(max_num_of_char_in_a_line,
'\n');
1079 while(!file_to_read.eof()) {
1080 double r, th, x, y, bz;
1081 file_to_read >> r >> th >> x >> y >> bz;
1082 if((
int)th != 360) {
1091 double maxtheta = 360.0;
1092 BP.
dtet = thv[1] - thv[0];
1094 double rmax = rv.back();
1097 for(vit = rv.begin(); *vit <=
BP.
rmin; ++vit) {}
1105 *gmsg <<
"* Minimal radius of measured field map: " << 1000.0 *
BP.
rmin <<
" [mm]" <<
endl;
1106 *gmsg <<
"* Maximal radius of measured field map: " << 1000.0 * rmax <<
" [mm]" <<
endl;
1107 *gmsg <<
"* Stepsize in radial direction: " << 1000.0 *
BP.
delr <<
" [mm]" <<
endl;
1108 *gmsg <<
"* Minimal angle of measured field map: " <<
BP.
tetmin <<
" [deg.]" <<
endl;
1109 *gmsg <<
"* Maximal angle of measured field map: " << maxtheta <<
" [deg.]" <<
endl;
1113 *gmsg <<
"* Stepsize in azimuth direction: " <<
BP.
dtet <<
" [deg.]" <<
endl;
1114 *gmsg <<
"* Total grid point along azimuth: " <<
Bfield.
ntetS <<
endl;
1115 *gmsg <<
"* Total grid point along radius: " <<
Bfield.
nrad <<
endl;
1118 *gmsg <<
"* Total stored grid point number ( ntetS * nrad ) : " <<
Bfield.
ntot <<
endl;
1125 *gmsg <<
"* Rescaling of the fields with factor: " <<
BP.
Bfact <<
endl;
1130 fp.open(
"data/gnu.out", std::ios::out);
1144 *gmsg <<
"* Field Map read successfully nelem= " << count << endl <<
endl;
1150 *gmsg <<
"* ----------------------------------------------" <<
endl;
1151 *gmsg <<
"* READ IN AVFEQ CYCLOTRON FIELD MAP " <<
endl;
1152 *gmsg <<
"* ----------------------------------------------" <<
endl;
1168 BP.
Bfact = scaleFactor / 1000.;
1170 if((f = fopen(
fmapfn_m.c_str(),
"r")) == NULL) {
1172 "Cyclotron::getFieldFromFile_AVFEQ",
1173 "failed to open file '" +
fmapfn_m +
"', please check if it exists");
1177 *gmsg <<
"* Minimal radius of measured field map: " <<
BP.
rmin <<
" [mm]" <<
endl;
1182 *gmsg <<
"* Maximal radius of measured field map: " << rmax <<
" [mm]" <<
endl;
1186 *gmsg <<
"* Stepsize in radial direction: " <<
BP.
delr <<
" [mm]" <<
endl;
1190 *gmsg <<
"* Minimal angle of measured field map: " <<
BP.
tetmin <<
" [deg.]" <<
endl;
1194 *gmsg <<
"* Maximal angle of measured field map: " << tetmax <<
" [deg.]" <<
endl;
1200 *gmsg <<
"* Stepsize in azimuth direction: " <<
BP.
dtet <<
" [deg.]" <<
endl;
1203 *gmsg <<
"* Total grid point along azimuth: " <<
Bfield.
ntetS <<
endl;
1210 *gmsg <<
"* Total stored grid point number ( ntetS * nrad ) : "
1218 *gmsg <<
"* rescaling of the fields with factor: " <<
BP.
Bfact <<
endl;
1222 fp.open(
"data/gnu.out", std::ios::out);
1242 *gmsg <<
"* Field Map read successfully nelem= " << count << endl <<
endl;
1250 *gmsg <<
"* ----------------------------------------------" <<
endl;
1251 *gmsg <<
"* READ IN CARBON CYCLOTRON FIELD MAP " <<
endl;
1252 *gmsg <<
"* ----------------------------------------------" <<
endl;
1256 if((f = fopen(
fmapfn_m.c_str(),
"r")) == NULL) {
1258 "failed to open file '" +
fmapfn_m +
"', please check if it exists");
1262 *gmsg <<
"* Minimal radius of measured field map: " <<
BP.
rmin <<
" [mm]" <<
endl;
1268 *gmsg <<
"* Stepsize in radial direction: " <<
BP.
delr <<
" [mm]" <<
endl;
1272 *gmsg <<
"* Minimal angle of measured field map: " <<
BP.
tetmin <<
" [deg]" <<
endl;
1277 *gmsg <<
"* Stepsize in azimuthal direction: " <<
BP.
dtet <<
" [deg]" <<
endl;
1280 *gmsg <<
"* Grid points along azimuth (ntet): " <<
Bfield.
ntet <<
endl;
1283 *gmsg <<
"* Grid points along radius (nrad): " <<
Bfield.
nrad <<
endl;
1292 *gmsg <<
"* Adding a guard cell along azimuth" <<
endl;
1293 *gmsg <<
"* Total stored grid point number ((ntet+1) * nrad) : " <<
Bfield.
ntot <<
endl;
1299 *gmsg <<
"* rescaling of the fields with factor: " <<
BP.
Bfact <<
endl;
1310 fp1.open(
"data/gnu.out", std::ios::out);
1311 fp2.open(
"data/eb.out", std::ios::out);
1319 Vector_t tmpE(0.0, 0.0, 0.0), tmpB(0.0, 0.0, 0.0);
1322 Vector_t E(0.0, 0.0, 0.0), B(0.0, 0.0, 0.0);
1323 if(!fi->getFieldstrength(tmpR, tmpE, tmpB)) {
1328 fp2 << tmpR <<
" \t E= " << tmpE <<
"\t B= " << tmpB <<
std::endl;
1337 *gmsg <<
"* Field Maps read successfully!" << endl <<
endl;
1348 *gmsg <<
"* ----------------------------------------------" <<
endl;
1349 *gmsg <<
"* READ IN CYCIAE-100 CYCLOTRON FIELD MAP " <<
endl;
1350 *gmsg <<
"* ----------------------------------------------" <<
endl;
1354 if((f = fopen(
fmapfn_m.c_str(),
"r")) == NULL) {
1356 "failed to open file '" +
fmapfn_m +
"', please check if it exists");
1360 *gmsg <<
"* Minimal radius of measured field map: " <<
BP.
rmin <<
" [mm]" <<
endl;
1364 *gmsg <<
"* Stepsize in radial direction: " <<
BP.
delr <<
" [mm]" <<
endl;
1368 *gmsg <<
"* Minimal angle of measured field map: " <<
BP.
tetmin <<
" [deg.]" <<
endl;
1373 *gmsg <<
"* Stepsize in azimuth direction: " <<
BP.
dtet <<
" [deg.]" <<
endl;
1376 *gmsg <<
"* Index in azimuthal direction: " <<
Bfield.
ntet <<
endl;
1382 *gmsg <<
"* Accordingly, total grid point along azimuth: " <<
Bfield.
ntetS <<
endl;
1386 *gmsg <<
"* Total stored grid point number ( ntetS * nrad ) : " <<
Bfield.
ntot <<
endl;
1392 *gmsg <<
"* rescaling of the fields with factor: " <<
BP.
Bfact <<
endl;
1398 for(
int ii = 0; ii < 13; ii++)
1401 for(
int k = 0; k < nHalfPoints; k++) {
1410 for(
int k = nHalfPoints; k <
Bfield.
ntet; k++) {
1417 *gmsg <<
"* Field Map read successfully!" << endl <<
endl;
1426 *gmsg <<
"* Reading " << fm <<
endl;
1430 "Cyclotron::getFieldFromFile_BandRF",
1431 "failed to open file '" + fm +
"', please check if it exists");
1443 std::vector<std::string>::const_iterator fm =
RFfilename_m.begin();
1444 std::vector<std::string>::const_iterator rffcfni =
RFFCoeff_fn_m.begin();
1445 std::vector<std::string>::const_iterator rfvcfni =
RFVCoeff_fn_m.begin();
1452 *gmsg <<
"* ------------------------------------------------------------" <<
endl;
1453 *gmsg <<
"* READ IN 3D RF Fields and Frequency Coefficients " <<
endl;
1454 *gmsg <<
"* ------------------------------------------------------------" <<
endl;
1456 for(; fm !=
RFfilename_m.end(); ++fm, ++rffcfni, ++rfvcfni, ++fcount) {
1460 "Cyclotron::getFieldFromFile_Synchrocyclotron",
1461 "failed to open file '" + *fm +
"', please check if it exists");
1468 *gmsg <<
"RF Frequency Coefficient Filename: " << (*rffcfni) <<
endl;
1470 rffcf = fopen((*rffcfni).c_str(),
"r");
1474 "Cyclotron::getFieldFromFile_Synchrocyclotron",
1475 "failed to open file '" + *rffcfni +
"', please check if it exists");
1478 std::vector<double> fcoeff;
1484 *gmsg <<
"* Number of coefficients in file: " << nc <<
endl;
1485 for(
int k = 0; k < nc; k++) {
1487 fcoeff.push_back(value);
1490 rffc_m.push_back(fcoeff);
1495 *gmsg <<
"RF Voltage Coefficient Filename: " << (*rfvcfni) <<
endl;
1497 rfvcf = fopen((*rfvcfni).c_str(),
"r");
1501 "Cyclotron::getFieldFromFile_Synchrocyclotron",
1502 "failed to open file '" + *rfvcfni +
"', please check if it exists");
1505 std::vector<double> vcoeff;
1508 *gmsg <<
"* Number of coefficients in file: " << nc <<
endl;
1509 for(
int k = 0; k < nc; k++) {
1511 vcoeff.push_back(value);
1514 rfvc_m.push_back(vcoeff);
1526 #undef CHECK_CYC_FSCANF_EOF
virtual double getMaxR() const
virtual double getRmin() const
ParticleAttrib< Vector_t > P
std::vector< std::string > RFfilename_m
void fp1(BareField< T, 1U > &field, bool docomm=true)
bool interpolate(const double &rad, const double &tet_rad, double &br, double &bt, double &bz)
virtual double getTrimCoilThreshold() const
double trimCoilThreshold_m
B-field threshold for applying trim coil.
PETE_TUTree< FnAbs, typename T::PETE_Expr_t > abs(const PETE_Expr< T > &l)
double gutdf5d(double *f, double dx, const int kor, const int krl, const int lpr)
constexpr double e
The value of .
void setRinit(double rinit)
virtual bool getSpiralFlag() const
void setFMHighE(double e)
virtual double getZinit() const
void applyTrimCoil_m(const double r, const double z, const double tet_rad, double *br, double *bz)
Apply trim coils (calculate field contributions)
Interface for a Cyclotron.
std::vector< Fieldmap * > RFfields_m
T::PETE_Expr_t::PETE_Return_t max(const PETE_Expr< T > &expr, NDIndex< D > &loc)
virtual double getPHIinit() const
Tps< T > sin(const Tps< T > &x)
Sine.
std::vector< std::vector< double > > rfvc_m
void getFieldFromFile_AVFEQ(const double &scaleFactor)
void setTrimCoils(const std::vector< TrimCoil * > &trimcoils)
void setFieldMapFN(std::string fmapfn)
void setRFFCoeffFN(std::vector< std::string > rff_coeff_fn)
void setSuperpose(std::vector< bool > flag)
virtual double getSymmetry() const
void fp2(BareField< T, 2U > &field, bool docomm=true)
void getFieldFromFile_CYCIAE(const double &scaleFactor)
const std::string & getCyclotronType() const
virtual const std::string & getName() const
Get element name.
ParticleAttrib< short > bunchNum
std::vector< double > dbt
void applyTrimCoil(const double r, const double z, const double tet_rad, double &br, double &bz)
Apply trim coils (calculate field contributions) with smooth field transition.
std::vector< double > dbtt
static Fieldmap * getFieldmap(std::string Filename, bool fast=false)
Inform & level4(Inform &inf)
std::vector< std::vector< double > > rffc_m
void getFieldFromFile_FFA(const double &scaleFactor)
std::vector< double > bfld
std::vector< std::string > RFVCoeff_fn_m
std::vector< double > dbrt
virtual double getMinZ() const
virtual bool apply(const size_t &id, const double &t, Vector_t &E, Vector_t &B)
void setRfFieldMapFN(std::vector< std::string > rffmapfn)
std::vector< double > dbrr
virtual double getFMHighE() const
#define CHECK_CYC_FSCANF_EOF(arg)
virtual double getCyclHarm() const
virtual double getMinR() const
void setCyclHarm(double h)
virtual void getDimensions(double &zBegin, double &zEnd) const
void getFieldFromFile_Carbon(const double &scaleFactor)
static void readMap(std::string Filename)
void setPZinit(double zinit)
std::vector< double > rarr
constexpr double pi
The value of .
virtual double getBScale() const
std::vector< double > rfphi_m
void setEScale(std::vector< double > bs)
void setPRinit(double prinit)
virtual void initialise(PartBunchBase< double, 3 > *bunch, double &startField, double &endField)
PETE_TUTree< FnArcTan, typename T::PETE_Expr_t > atan(const PETE_Expr< T > &l)
void setRfPhi(std::vector< double > f)
void getFieldFromFile_BandRF(const double &scaleFactor)
void setType(std::string t)
virtual double getPZinit() const
std::vector< std::string > RFFCoeff_fn_m
void setRfFrequ(std::vector< double > f)
virtual std::string getFieldMapFN() const
PartBunchBase< double, 3 > * RefPartBunch_m
unsigned int getNumberOfTrimcoils() const
Tps< T > pow(const Tps< T > &x, int y)
Integer power.
virtual double getPRinit() const
Vektor< double, 3 > Vector_t
void getFieldFromFile(const double &scaleFactor)
virtual double getFMLowE() const
std::vector< double > dbr
virtual void accept(BeamlineVisitor &) const
Apply visitor to Cyclotron.
int getFieldFlag(const std::string &type) const
std::unique_ptr< LossDataSink > lossDs_m
PETE_TBTree< FnFmod, PETE_Scalar< Vektor< T1, Dim > >, typename T2::PETE_Expr_t > fmod(const Vektor< T1, Dim > &l, const PETE_Expr< T2 > &r)
void setPHIinit(double phiinit)
BFieldType myBFieldType_m
std::vector< double > rffrequ_m
T rad(T x)
Convert degrees to radians.
void setZinit(double zinit)
virtual double getRmax() const
void setRFVCoeffFN(std::vector< std::string > rfv_coeff_fn)
std::vector< double > escale_m
std::vector< TrimCoil * > trimcoils_m
Trim coils.
virtual double getRinit() const
int idx(int irad, int ktet)
Tps< T > cos(const Tps< T > &x)
Cosine.
double getRfFrequ() const
std::vector< double > dbttt
void setBScale(double bs)
ParticleAttrib< int > Bin
void setSymmetry(double symmetry)
std::string::iterator iterator
void setTrimCoilThreshold(double)
virtual double getMaxZ() const
Interface for a single beam element.
virtual void visitCyclotron(const Cyclotron &)=0
Apply the algorithm to a cyclotron.
std::vector< bool > superpose_m
void setSpiralFlag(bool spiral_flag)
T::PETE_Expr_t::PETE_Return_t min(const PETE_Expr< T > &expr, NDIndex< D > &loc)
virtual bool bends() const
std::vector< double > dbrrr
Inform & endl(Inform &inf)
void initR(double rmin, double dr, int nrad)
void getFieldFromFile_Synchrocyclotron(const double &scaleFactor)
void read(const int &fieldflag, const double &scaleFactor)
std::vector< double > dbrtt
virtual ElementBase::ElementType getType() const
Get element type std::string.
std::vector< double > dbrrt