Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
TRACY3
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
PA
Optics
TRACY3
Commits
f1ebe927
Commit
f1ebe927
authored
14 years ago
by
zhang
Browse files
Options
Downloads
Patches
Plain Diff
01/02/2011
Fix the bug in print out the coupling inforamtion.
parent
40a121ca
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tracy/tools/soltracy.cc
+29
-21
29 additions, 21 deletions
tracy/tools/soltracy.cc
with
29 additions
and
21 deletions
tracy/tools/soltracy.cc
+
29
−
21
View file @
f1ebe927
...
...
@@ -76,11 +76,9 @@ int main(int argc, char *argv[]) {
}
// Chamber factory
if
(
ChamberFlag
==
false
)
ChamberOff
();
// turn off vacuum chamber setting, use the default one
else
if
(
ChamberNoU20Flag
==
true
)
DefineChNoU20
();
// using vacuum chamber setting but without undulator U20
else
if
(
ReadChamberFlag
==
true
)
// if (ChamberFlag == false)
// ChamberOff(); // turn off vacuum chamber setting, use the default +-1 meters
if
(
ReadChamberFlag
==
true
)
ReadCh
(
chamber_file
);
/* read vacuum chamber from a file "Apertures.dat" , soleil version*/
PrintCh
();
// print chamber into chamber.out
...
...
@@ -204,28 +202,36 @@ int main(int argc, char *argv[]) {
if
(
CouplingFlag
==
true
)
{
Ring_GetTwiss
(
chroma
=
true
,
0.0
);
/* Compute and get Twiss parameters */
printlatt
();
/* dump linear lattice functions into "linlat.dat" */
GetEmittance
(
ElemIndex
(
"cav"
),
true
);
//
GetEmittance(ElemIndex("cav"), true);
//only for test
Coupling_Edwards_Teng
();
Ring_GetTwiss
(
chroma
=
true
,
0.0
);
/* Compute and get Twiss parameters */
printglob
();
/* print parameter list */
}
// add coupling by random rotating of the full quadrupole magnets
if
(
ErrorCouplingFlag
==
true
)
{
prtmfile
(
"flat_file.dat"
);
//print the elements without rotation errors
SetErr
(
err_seed
,
err_rms
);
prtmfile
(
"flat_file_errcoupling_full.dat"
);
//print the elements with rotation errors
Ring_GetTwiss
(
chroma
=
true
,
0.0
);
/* Compute and get Twiss parameters */
printlatt
();
/* dump linear lattice functions into "linlat.dat" */
Coupling_Edwards_Teng
();
GetEmittance
(
ElemIndex
(
"cav"
),
true
);
// GetEmittance(ElemIndex("cav"), true); //only for test
Ring_GetTwiss
(
chroma
=
true
,
0.0
);
/* Compute and get Twiss parameters */
// printlatt();
printglob
();
/* print parameter list */
}
// add coupling by random rotating of the half quadrupole magnets, delicated for soleil
if
(
ErrorCoupling2Flag
==
true
)
{
prtmfile
(
"flat_file.dat"
);
//print the elements without rotation errors
SetErr2
(
err_seed
,
err_rms
);
prtmfile
(
"flat_file_errcoupling_half.dat"
);
//print the elements with rotation errors
Ring_GetTwiss
(
chroma
=
true
,
0.0
);
/* Compute and get Twiss parameters */
printlatt
();
/* dump linear lattice functions into "linlat.dat" */
Coupling_Edwards_Teng
();
GetEmittance
(
ElemIndex
(
"cav"
),
true
);
// GetEmittance(ElemIndex("cav"), true);
Ring_GetTwiss
(
chroma
=
true
,
0.0
);
/* Compute and get Twiss parameters */
printglob
();
/* print parameter list */
}
...
...
@@ -237,7 +243,7 @@ int main(int argc, char *argv[]) {
"
\n
Read Multipoles file for lattice with thick sextupoles
\n
"
);
ReadFieldErr
(
multipole_file
);
//first print the full lattice with error as a flat file
prtmfile
(
"flat_file_err
or
.dat"
);
// writes flat file /* very important file for debug*/
prtmfile
(
"flat_file_err
multipole
.dat"
);
// writes flat file
with all element errors
/* very important file for debug*/
Ring_GetTwiss
(
chroma
=
true
,
0.0
);
/* Compute and get Twiss parameters */
printglob
();
}
...
...
@@ -248,14 +254,14 @@ int main(int argc, char *argv[]) {
fprintf
(
stdout
,
"
\n
Setting Multipoles for lattice with thin sextupoles
\n
"
);
Multipole_thinsext
(
fic_hcorr
,
fic_vcorr
,
fic_skew
);
/* for thin sextupoles */
prtmfile
(
"flat_file_err
or
.dat"
);
// writes flat file /* very important file for debug*/
prtmfile
(
"flat_file_err
multipole
.dat"
);
// writes flat file /* very important file for debug*/
Ring_GetTwiss
(
chroma
=
true
,
0.0
);
/* Compute and get Twiss parameters */
printglob
();
}
else
{
fprintf
(
stdout
,
"
\n
Setting Multipoles for lattice with thick sextupoles
\n
"
);
Multipole_thicksext
(
fic_hcorr
,
fic_vcorr
,
fic_skew
);
/* for thick sextupoles */
prtmfile
(
"flat_file_err
or
.dat"
);
// writes flat file /* very important file for debug*/
prtmfile
(
"flat_file_err
multipole
.dat"
);
// writes flat file /* very important file for debug*/
Ring_GetTwiss
(
chroma
=
true
,
0.0
);
/* Compute and get Twiss parameters */
printglob
();
}
...
...
@@ -267,26 +273,26 @@ int main(int argc, char *argv[]) {
// computes TuneShift with amplitudes
if
(
AmplitudeTuneShiftFlag
==
true
)
{
if
(
ChamberFlag
==
true
)
{
//
if (ChamberFlag == true) {
TunesShiftWithAmplitude
(
_AmplitudeTuneShift_nxpoint
,
_AmplitudeTuneShift_nypoint
,
_AmplitudeTuneShift_nturn
,
_AmplitudeTuneShift_xmax
,
_AmplitudeTuneShift_ymax
,
_AmplitudeTuneShift_delta
);
//NuDx(31L,21L,516L,0.025,0.005,dP);
}
else
{
// Utility ?
TunesShiftWithAmplitude
(
50L
,
30L
,
516L
,
0.035
,
0.02
,
dP
);
}
}
//
else { // Utility ?
//
TunesShiftWithAmplitude(50L, 30L, 516L, 0.035, 0.02, dP);
//
}
}
//
}
if
(
EnergyTuneShiftFlag
==
true
)
{
if
(
ChamberFlag
==
true
)
{
//
if (ChamberFlag == true) {
TunesShiftWithEnergy
(
_EnergyTuneShift_npoint
,
_EnergyTuneShift_nturn
,
_EnergyTuneShift_deltamax
);
//NuDp(31L,1026L,0.06);
}
else
{
// utility ?
TunesShiftWithEnergy
(
31L
,
1026L
,
0.06
);
}
}
//
else { // utility ?
//
TunesShiftWithEnergy(31L, 1026L, 0.06);
//
}
}
//
}
// Computes FMA
if
(
FmapFlag
==
true
)
{
...
...
@@ -389,6 +395,8 @@ int main(int argc, char *argv[]) {
globval
.
Cavity_on
=
cavityflag
;
globval
.
radiation
=
radiationflag
;
}
// ????????????? NSRL version, Check with Soleil version "MomentumAcceptance"
// IBS & TOUSCHEK
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment