Page 1 of 2

emittance measurement quad scan question

Posted: 19 Jun 2008, 16:06
by michael_borland
Michele Joyce (JLab) wants to know if it is possible to scan a series of quadrupoles sequentially in elegant as part of an emittance measurement, instead of the common method of scanning several quads together.

This can be done using the enumeration_file feature of vary_element, which allows enumerating the values that each varied parameter takes. This is done by creating an SDDS file, each row of which has values for, say, the strength of Q1 and Q2. By chosing the values appropriately, only one quadrupole varies at a time:
Q1 Q2
----------------
-2.00 0.10
-1.50 0.10
-1.00 0.10
-0.50 0.10
-0.10 0.10
-0.10 0.50
-0.10 1.00
-0.10 1.50
-0.10 2.00
-0.10 2.50

Details of how to do this in a simulated emittance measurement are shown in the attached files.

--Michael

Re: emittance measurement quad scan question

Posted: 10 Oct 2008, 10:54
by mjoyce
In you example, both sets of quad values (Q1&Q2) were in the same file. Will the results be different if I have two files, each containing a single set of quad values?

Re: emittance measurement quad scan question

Posted: 10 Oct 2008, 11:00
by michael_borland
Michele,

There should be no difference. You might see small differences because of random number seeding, but it the results should pretty much agree within the error bars.

--Michael

Re: emittance measurement quad scan question

Posted: 10 Oct 2008, 11:10
by mjoyce
If I have real data -- one quad scanned to get sigmaX, and the other scanned to get sigmaY, should I use the -ignore=(x|y) argument on sddsemitproc?

Re: emittance measurement quad scan question

Posted: 10 Oct 2008, 12:29
by michael_borland
Michele,

Yes, in that case you should use the -ignore option.

It is not a bad idea to try to scan several quads together just to keep the beam size reasonable in both planes. This is useful even if you don't form a waist in both planes.

--Michael

Re: emittance measurement quad scan question

Posted: 17 Oct 2008, 09:48
by mjoyce
I'm having trouble putting this into practice.
I have one quad that I would like to scan to get the X data (MQD0L06) and one to get the Y data (MQD0L07) Both sets of scans produce waists, but I'm not getting answers. I don't know how to create the sdds file so that sddsemitproc looks at the right sigmas for the right plane...
Attached are the files that I'm using. I'm pretty confident that my data is clean.
Any and all help is greatly appreciated.

Re: emittance measurement quad scan question

Posted: 17 Oct 2008, 10:13
by michael_borland
Michele,

I plotted your data and the errorX and errorY values seem large when the beam size is large. I wonder if there is a misunderstanding about the meaning of these columns. If you've taken N measurements of beam size Sx at each point, then the error value should be E=StandardDeviation(Sx)/sqrt(N). sddsemitproc will use E to generation random perturbations of the measured values in order to perform error propagation. The assumption of the analysis is that each hypothetical repeated measurement would involve N measurements of the beam size of at each quad setting.

I don't think this is the only problem, because if I artificially set the errors to a small value, I still get poor fits.

Another possible problem is that the beamline doesn't end at the location of the imaging device in the real system. I noticed in your lattice file, for example, that the beamline ends immediately after a quad, which suggests that it doesn't end at the location of a flag/screen.

Yet another potential pitfall is that the method is correct only for true RMS beam sizes computed from statistics on the intensity distribution. If you are, for example, fitting gaussians to the beam distribution or using FWHM to infer rms size, I would not expect good results unless your beam was truly gaussian.

I hope one of these suggestions helps. Let me know if not.

--Michael

Re: emittance measurement quad scan question

Posted: 17 Oct 2008, 10:16
by michael_borland
Michele,

By the way, I see that I didn't address all of your issues. The command I used is

# Combine measured beam sizes and matrix data
sddscollapse INJquadscan.fin -pipe=out | sddsxref -pipe=in beamsizes.sdds -take=* input.sdds
# Run emittance processing
sddsemitproc input.sdds output.sdds -sigmaData=sigmaX,sigmaY -errorData=errorX,errorY -nErrorSets=100

You don't need to separate the x and y scan data as long as you always have a valid measurement in both planes. If I just use the simulation data, it works fine and that is what I expect.

--Michael

Re: emittance measurement quad scan question

Posted: 17 Oct 2008, 10:36
by mjoyce
My lattice file ends at IHA0L08, which is the harp at which I measured the data, so that should be ok, right?
The program that I'm using to analyze the harp files gives me
Sigma X(mm) and Sigma Y(mm) in addition to RMS Width(mm) (along with error bars) I've been using the calculated sigmas, should I try the RMS values instead? Are you saying that I cannot use the calculated error bars for the -errorData?

Re: emittance measurement quad scan question

Posted: 17 Oct 2008, 10:50
by michael_borland
Michele,

Yes, ending at the harp is the right thing to do.

You should be able to use calculated error bars, provided they are calculated correctly. People sometimes quote the "error bar" as the standard deviation, without dividing by the sqrt(N). This makes the error bars look very large.

Perhaps the RMS values are true RMS quantities. If so, those are the right things to use.

--Michael