Focus Z Scan

  • Upon Focusing Beam as best as possible on the YAG, you can begin scanning the minimum focus
  • You should have optimized Slits and Pre-focus and Transfocator lenses
  • Turn off lights
  • Open Inline Camera
    • LCLS Tab>DAQ Control Button>Online AMI MFX
    • Inline
  • Open Shutter
  • On Inline Image click X/Y Selection
  • Click GRAB for ROI selection> highlight a symmetric square around Beam Focus on YAG
  • Projection Tab
    • Sum     X
  • Plot Button (a new plot appears)
  • In new window (Projection) click Peak Button
  • In another new window (PeakFit Plot) click GRAB in the Baseline section
    • In MFX Home go to TFS and middle click the RBV (MFX:TFS:MMS:21.RBV)
    • Click on the baseline of your plot (noise floor)
    • Select Quantity dropdown to FWHM
    • Set Plot Type to Mean v Var Tab
    • In the blank field middle click the Z translation position variable in
    • Set bins 300, lo 0, hi 300
    • Click PLOT>New window pops up (Peak plot_FWHM)
    • Go back to PeakFit Plot and change Quantity to Position and click Plot button again>New Window pops up (Peak plot_position)
  • CLOSE PeakFit Plot
  • Go back to Projection Tab and Set it to sum Y and repeat


SCREENSHOT the FINAL TFS motor positions (ALL). The motors accurately go back to the encoder set point typed in, but do not reliably go in and out as the GUI might indicate.


Move the Z Translation (form 0-300) until you see minimums on the FWHM plots. This is the tightest focus.

The beam can be astigmatic and have different focal positions as seen by the X and Y minima at different positions. Determine (with the users) which direction should be preferentially focused.


Measure the distance between the YAG's face being viewed and the interaction region. Move the TFS to the focal position. THEN move the TFS back the YAG distance to move the focus to the interaction region.


If you cannot find the Minimum focus, the beam and the safety interlocks might not allow you to reach this. Here move the PreFocus to the Bottom Lens and re-tune the transfocator on the YAG. This bottom lens lightly focuses the beam compared to the mid and thus the minima will be more visible.


Current version (2024-05-05): 

Transfocator scan script

  • cd bin
  • Open slits: >= 2mm
  • take out time tool target!
  • PV of the cameras: camViewer-c <camera name>
  • Crosshairs (remove rotation on the cameras! red below right, blue upper left)
  • focus_scan <camera name (proper PV! like MFX:GIGE:LBL:...> -p for projection
  • focus_scan <camera name> -s for scan
  • eloggrab and be merry


And compute lens config: 

tfs.find_best_combo(energy = 9551, target = 400.37)