Skip to content

Commit c9a30de

Browse files
committed
lhc model creation
1 parent 18eca54 commit c9a30de

File tree

5 files changed

+236
-3
lines changed

5 files changed

+236
-3
lines changed
-21.6 KB
Loading
58.1 KB
Loading
5.55 KB
Loading

docs/css/custom_colors.css

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,16 @@
4848
background-color: rgb(226, 46, 46) !important;
4949
color: black !important;
5050
box-shadow: 0 .1rem 0 .05rem var(--md-typeset-kbd-border-color),0 .1rem 0 var(--md-typeset-kbd-border-color),0 -.1rem .2rem rgb(202, 142, 124) inset;;
51+
}
52+
53+
.yellow-gui-button kbd {
54+
background-color: rgb(255, 201, 0) !important;
55+
color: black !important;
56+
box-shadow: 0 .1rem 0 .05rem var(--md-typeset-kbd-border-color),0 .1rem 0 var(--md-typeset-kbd-border-color),0 -.1rem .2rem rgb(202, 177, 124) inset;;
57+
}
58+
59+
.blue-gui-button kbd {
60+
background-color: rgb(0, 0, 255) !important;
61+
color: rgb(250, 247, 247) !important;
62+
box-shadow: 0 .1rem 0 .05rem var(--md-typeset-kbd-border-color),0 .1rem 0 var(--md-typeset-kbd-border-color),0 -.1rem .2rem rgb(124, 125, 202) inset;;
5163
}
Lines changed: 224 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,243 @@
11
# Model Creation
22

3+
## Model Selection Window
4+
5+
The _model selection window_ **opens automatically** after starting the main GUI frame from the [beam selection window](beam_selection.md).
6+
This window can be opened at any time by clicking the **left-most button at the top** of the GUI, depicting a "model".
7+
8+
<figure>
9+
<center>
10+
<img src="../../assets/images/betabeat_gui/top_buttons.png" width="100%" alt="Icons at the top of the GUI." />
11+
<figcaption>Open the model creation window with the left-most button at the top, depicting a model.</figcaption>
12+
</center>
13+
</figure>
14+
15+
16+
If there have been no models previously created, the window will look empty like this:
17+
318
<figure>
419
<center>
520
<img src="../../assets/images/betabeat_gui/model_creation_window.png" width="100%" alt="Model selection window." />
6-
<figcaption>Model selection window.</figcaption>
21+
<figcaption>Blank Model selection window.</figcaption>
722
</center>
823
</figure>
924

25+
26+
After [creating a model](#model-creation-window), the window will show the **folder names** in the _Models_ folder of the
27+
accelerator sub-folder selected in the [beam selection window](beam_selection.md).
28+
1029
<figure>
1130
<center>
1231
<img src="../../assets/images/betabeat_gui/model_creation_with_model.png" width="100%" alt="Model selection window with created model." />
1332
<figcaption>Model selection window with a created model</figcaption>
1433
</center>
1534
</figure>
1635

36+
37+
The buttons at the bottom of the window are:
38+
39+
- ++"Create New"++ :
40+
Opens the [model creation window](#model-creation-window) for a new model.
41+
- ++"Load"++{.green-gui-button} _(If a model exists and is selected)_:
42+
Sets the currently chosen model as "selected model" in the GUI and closes this window.<br>
43+
:fontawesome-solid-triangle-exclamation:{.warning-colored} This first checks if certain files are present in the model folder; e.g. if the model is still under creation (check the [running tasks](common_components.md#running-tasks)), it will show an error in the [status bar](common_components.md#console).
44+
- ++"Delete"++{.red-gui-button} _(If a model is selected)_:
45+
Deletes the selected model folder **from disk** :fontawesome-solid-triangle-exclamation:{.warning-colored}.
46+
- ++"Import External"++{.yellow-gui-button} :
47+
Opens a file-dialog
48+
to select a folder with a previously created model at a location outside the current accelerator's _Models_ folder and copies it there.
49+
- ++"Update MQTs"++{.blue-gui-button} _(If a model is selected)_:
50+
Updates the values of the MQTs (which are saved in a separate file) in the currently selected model via extraction from `NXCals`.
51+
52+
## Model Creation Window
53+
54+
After clicking on ++"Create New"++ in the [model selection window](#model-selection-window), _model creation window_ opens.
55+
56+
Currently model creation is only implemented in the GUI for the [LHC](#lhc-model-creation) and the [SPS](#sps-model-creation) accelerators.
57+
58+
They are using **unified window components**, which follow a common structure, described here, and differ in the accelerator specific details, which are explained in the sections below.
59+
60+
#### Base
61+
62+
- **Model Name**:
63+
The name of the model, which will be used to name the folder for the model.
64+
To easily identify a model later on, this should tell the user at a glance **everything important** about the model, e.g. for which **accelerator** the model was created, which optics where used, which **tunes** were set (if particular), if the excitation was special, if **best knowledge** was also created, etc.
65+
Nowadays, the name comes already with a date as prefix-suggestion.
66+
67+
- **Fetcher**:
68+
Which fetcher should be used to get the optics data from [`acc-models`][acc-models] and populate choices in the _Accelerator_ section of this window.
69+
The choices are **AFS**, which uses the default `acc-models` path on `afs`, and **Path**, which allows you to set a custom path
70+
to a local `acc-models` folder.
71+
After selecting the fetcher, a python process is running in the background which fetches the data.
72+
73+
!!! warning "First time running Fetcher"
74+
If this is your first run with this fetcher, **it might take a while to complete** (up to a few minutes). Afterwards, the data is cached and the GUI is updated more quickly.
75+
76+
!!! warning "Fetcher `NONE` not implemented"
77+
In the current GUI implementation, a fetcher/`acc-models` is needed to create a model (see [#202][bbgui_issue_202])!
78+
79+
#### Tunes
80+
81+
This section allows you to define the tunes for the model, including the tunes of the exciter element if applicable.
82+
83+
- **Excitation**:
84+
Choose which exciter was used in the generation of the turn-by-turn data or **`NONE`** if a free-kick was performed.
85+
- **Free Tune**:
86+
The natural tune of the machine, without any driven excitation.
87+
- **Delta Tune** _(Only active if an excication was selected)_:
88+
The tune delta between the _free tune_ and the _driven tune_, using the same convention as in the [multiturn GUI][multiturn], i.e. the difference from the _free tune_ to the _driven tune_ (in contrast to the [tune settigs](settings.md#tunes-tab) in which the _driven tune_ is the starting point).
89+
- **Driven Tune**:
90+
This is the tune of the beam during the excitation and is **automatically computed** from the _free tune_ and the _delta tune_.
91+
92+
#### Full Response
93+
94+
This section allows you to activate and define the creation of the full response matrices.
95+
See _[Dilly et al. - An updated global optics correction scheme][dilly2018]_ and the [`omc3` documentation][global_correction_omc3] for details.
96+
97+
- **Create**:
98+
Activates the creation of the full response matrices.
99+
- **Variables**:
100+
The variables which are changed to calculate a response of the optics.
101+
The names given here can be the MAD-X circuit names directly, or the group names as defined for the accelerator in `omc3`,
102+
i.e. this follows the same logic as the [variables used for global correction](correction_panel.md).
103+
- **Increment K**:
104+
The value by which each variable will be changed to check the response.
105+
_(Note: The circuits often steer a K-value, hence the name. But should be renamed to simply "Increment" in the future)_
106+
107+
!!! tip "Use larger variable groups"
108+
If you do not create a response for a given variable, you will not be able to use it later on in the correction.
109+
Hence, you probably want to use larger groups here, to have a wider range of choice for variables later.
110+
111+
!!! note "FullResponse Task"
112+
The full-response creation will only start after the model is fully created and you have closed the popup-window
113+
asking you to load the model or not (see below).
114+
By that time you can **already use the model** as if it was fully created and you **do not need to wait for this taks to finish** for the _standard_ analysis, until you want to calculate [global corrections](correction_panel.md).<br>
115+
The full-response creation is also heavily parallelized where possible, so expect a few processes to run at the same time.
116+
117+
#### User
118+
119+
- **Modifier**:
120+
Path to a MAD-X file, which will be called in MAD-X **after** the above selected optics are applied.
121+
This can be used to install your own optics modifications.
122+
123+
!!! info "Modifiers in `omc3`"
124+
Any modification to the accelerator sequence in called a "Modifier" in the [model creation in `omc3`][model_creation_omc3]
125+
and are given as a list to the model creator.
126+
The option here simply appends another entry to this list, which already contains the path to the above selected optics file and possibly the `knobs.madx`, if the online-model was used (see below).
127+
If you need to call multiple files, you need to create add the `call, file=...` MAD-X commands into the file you are calling here.
128+
When the model is later built, e.g. for the [global correction checks][global_correction_check], these modifiers
129+
will be identified from tags in the `job.nominal.madx` file.
130+
131+
!!! warning "`modifiers.madx`"
132+
In the past, the modifiers were given as a separate `modifiers.madx` in the model folder.
133+
Due to backwards compatibility, the `modifiers.madx` file is still somewhat supported, but not encouraged.
134+
So **giving here a file called `modifiers.madx` within the model folder might lead to unexpected behavior**.
135+
136+
#### Create
137+
138+
Clicking on the ++"Create New"++{.green-gui-button} button will start the model creation.
139+
If any [extraction](#extraction) is selected, these tasks will run first and they can take a few minutes.
140+
141+
142+
!!! warning "Loading a new Model"
143+
When the model creation is finished (but before the full-response creation), a popup will ask you if you want to load the model or not.
144+
Before you see this window, it is not possible to click on the ++"Load"++{.green-gui-button} button in the [model selection window](#model-selection-window), even though its name is already appearing in the list, because the model is not yet fully created.
145+
146+
### LHC Model Creation
147+
17148
<figure>
18149
<center>
19-
<img src="../../assets/images/betabeat_gui/model_creation_lhc.png" width="100%" alt="Model creation window for the LHC." />
150+
<img src="../../assets/images/betabeat_gui/model_creation_lhc.png" width="500px" alt="Model creation window for LHC Beam1." />
20151
<figcaption>Model creation window for the LHC.</figcaption>
21152
</center>
22-
</figure>
153+
</figure>
154+
155+
#### Tunes
156+
157+
For the LHC the tunes are set by default to `0.28 - 0.01` in horizontal and `0.31 + 0.012` in vertical,
158+
which are our default tunes for LHC measurements.
159+
160+
#### Accelerator
161+
162+
- **Beam**:
163+
The beam is pre-defined by the accelerator choosen in the [beam selection window](beam_selection.md).
164+
- **Year/Tag**:
165+
This field is automatically filled by the frist layer of subfolders in the `acc-models/lhc` repository.
166+
- **Energy**:
167+
The energy at which the accelerator is running in GeV.
168+
- **Optics File**:
169+
The optics used for the model, which has the same name as the one used in the machine.
170+
The **File** dropdown is automatically filled by the files in the `operation/optics` folder within the choosen _year/tag_
171+
of the `acc-models/lhc` repository.
172+
You can search through the list via regular expression in the **Filter** field.
173+
- **dpp**: The momentum deviation for the model.
174+
175+
#### Extraction
176+
177+
This section allows you to extract the actual settings from the LHC via NXCals
178+
at the given time UTC at the top if the section.
179+
Use the :fontawesome-regular-clock:-button to set it to the now.
180+
181+
We distinguish here between two different cases:
182+
183+
- **Online Model**:
184+
The online model settings are applied to the **nominal model**, which is used almost everywhere throughout the analysis.
185+
There will be no model created without these settings!
186+
You can choose which settings you want to extract, and if any of these are activated, a `knobs.madx` file will be created, which contains the extracted settings mapped to the respective MAD-X variables.
187+
- **xing**: Crossing angles
188+
- **sep**: Beam separation
189+
- **chroma**: Chromaticity values
190+
- **ip offset**: Beam offsets at the IPs
191+
- **disp**: Dispersion values
192+
- **mo**: Powering of the landau octupoles (MOs)
193+
- **Best Knowledge Model**:
194+
The best knowledge model is created with the same settings as the **nominal model**,
195+
i.e. all extracted knobs from the _online model_ are also applied.
196+
In addition, this model contains also the $b_2$ errors of the main dipoles from the [magnetic model][fidel_webpage].
197+
This will result in additional `*_best_knowledge.dat` twiss-output files, which are used in the N-BPM method of the beta-from-phase analysis (see _[Langner et al. - Utilizing the N beam position monitor method for turn-by-turn optics measurements][langner2016]_).
198+
- **$b_2$ error table**:
199+
As these errors are dependend on the powering of the dipoles, you need to choose the table with the closest energy to the one you are creating the model for.
200+
- **:fontawesome-solid-triangle-exclamation:{.warning-colored} Extract MQTs**:
201+
As the $b_2$ errors change the tunes, you should **always also extract the MQTs** when creating the best knowledge model.
202+
203+
!!! warning "Java Issues and RBAC token"
204+
Due to Java misconfiguration in the CCC terminals there can be access-issues with the _online model extraction_,
205+
additional steps might need to be taken **before starting the GUI**.
206+
For now, follow the [note in the instructions of the OMC logbook][logbook_workaround_java],
207+
make sure to have a valid KEBEROS token (via `kinit`) and - for good luck - also create a valid
208+
RBAC token via the button at the top of the GUI:
209+
210+
<figure>
211+
<center>
212+
<img src="../../assets/images/betabeat_gui/rbac.png" alt="RBAC GUI elements" width="50%"/>
213+
<figcaption>RBAC GUI-Element (No Token).</figcaption>
214+
</center>
215+
</figure>
216+
217+
218+
219+
220+
221+
### SPS Model Creation
222+
223+
<figure>
224+
<center>
225+
<img src="../../assets/images/betabeat_gui/model_creation_sps.png" width="500px" alt="Model creation window for the SPS." />
226+
<figcaption>Model creation window for the SPS.</figcaption>
227+
</center>
228+
</figure>
229+
230+
231+
[bbgui_issue_202]: https://gitlab.cern.ch/acc-co/lhc/lhc-app-beta-beating/-/issues/202
232+
[acc-models]: https://acc-models.web.cern.ch/acc-models/
233+
[multiturn]: ../multiturn/gui.md
234+
[dilly2018]: http://cds.cern.ch/record/2632945
235+
[model_creation_omc3]: https://pylhc.github.io/omc3/entrypoints/other.html#model-creator
236+
[global_correction_omc3]: https://pylhc.github.io/omc3/entrypoints/correction.html#global-correction
237+
[fidel_webpage]: https://lhc-div-mms.web.cern.ch/tests/MAG/Fidel/
238+
[langner2016]: https://link.aps.org/doi/10.1103/PhysRevAccelBeams.19.092803
239+
[logbook_workaround_java]: https://logbook.cern.ch/elogbook-server/#/logbook/showInstructionInLogbook/30291
240+
241+
*[CCC]: Cern Control Center
242+
*[MQTs]: Tuning Trim Quadrupole Magnets of the LHC
243+
*[RBAC]: Role Based Access Control

0 commit comments

Comments
 (0)