Page History
Introduction
XTCAV is a detector that is used to determine the laser-power vs. time of each LCLS shot. Some detailed documentation from Tim Maxwell on this device is Here. Alvaro Sanchez-Gonzalez authored the original psana-python code to do the rather complex analysis of images from the XTCAV camera to determine these quantities. This current version has been updated to run more quickly and to fix some analysis errors.
These scripts use some XTCAV data that was made public so they should be runnable by all users. The scripts can be found in /reg/g/psdm/tutorials/examplePython/xtcav/ in the files xtcavDark.py, xtcavLasingOff.py, xtcavLasingOn.py.
Analysis Setup
Two things must be done before XTCAV analysis will function: a "dark run" must be analyzed to get the pedestal values for cameras, and a "no lasing" run must be analyzed to generate sets of "no lasing" images (the latter is quite a complex process). Note that for demonstration these first two scripts write constants to a "local" calibration directory called "calib". For a real-experiment you won't need these lines because you will have permission to write to your official experiment calibration-constants directory.
...
Once the dark/lasing-off analysis has been completed, users can analyze the lasing-on events using a standard psana-python script similar to the one below.
Example Analysis Script
This script assumes that dark/lasing-off data has been analyzed (see above). Unlike the previous two scripts it reads dark/lasing-off constants from the official calibration-directory. This script can be found in /reg/g/psdm/tutorials/examplePython/xtcav/xtcavLasingOn.py:
...
- Look at the distribution of the "agreement" parameter that is returned by the ReconstructionAgreement() method. This value represents the "dot product" of the power-spectrum from the first-moment-analysis of the XTCAV image with the power-spectrum from the second-moment-analysis of the XTCAV image. Only believe the data where the agreement is good (in the past >0.5 has been useful for some analyses)
- Ignore shots where the X-ray intensity is low, but cutting on the FEEGasDetector value to select stronger shots
Examining The "Ingredients" of the XTCAV Analysis
This is a utility that can help users understand why XTCAV results look the way they do. Run it like this:
...
Close the existing plot window to show the plots for the next event. If you want to modify the 105-line "xtcavDisp" python script (e.g. to change which events are displayed) you can find it in /reg/g/psdm/sw/releases/ana-current/xtcav/src/xtcavDisp.
How Often to Take a Lasing Off Run
(courtesy of Tim Maxwell)
For very stable accelerator conditions, you don't really need to update but every hour or two. However, with some special configurations it can drift measurably over as short as twenty minutes. That's typically for cases where we have to leave feedbacks open (two bucket and some twin bunch configurations).
There's not really a hard, fast rule here. Definitely when necessary due to known changes in beam conditions and otherwise as often as time allows is the practical answer so far.
Lasing-off Analysis Parameters
(courtesy of Alvaro Sanchez-Gonzalez)
...
- normal sase (not many beam-related fluctuations): take sqrt of number shots and use that many groups (beat down background noise with lots of averaging). Tim suggests perhaps a maximum of 100 groups.
- two-bunch slotted foil (many beam-related of fluctuations): restrict it to 5-10 images per group, make as many groups as possible using typically 30 seconds to a minute of data at 60Hz.
- split undulator, single bunch, head and tail lase in separate sections of the split undulator: Tim expects this to be somewhat more chaotic than SASE, but not as chaotic as slotted-foil, so some number of groups in between.
seeded beam: For any results, I would use the SASE settings. However, note that reconstruction for seeding is a little ambiguous. The beam first seeds, so is partly spoiled before seeding itself in the second stage. Therefore it isn't clear exactly with one lasing off reference which part lased more for the seeded part. It is similar to the case when one bunch is used to make two pulses with the split undulator. However, if seeding amplification was strong and intense, this may be enough.
Detector Resolution
(From Tim Maxwell)
Time resolution is around 1.1 fs RMS for soft x-rays, 2.5 fs fwhm (in quadrature, of course). So actually pulse length is probably 4.3 - 9.7 fs FWHM.
...