emittance measurement quad scan question

Moderators: cyao, michael_borland

michael_borland
Posts: 1933
Joined: 19 May 2008, 09:33
Location: Argonne National Laboratory
Contact:

emittance measurement quad scan question

Post by michael_borland » 19 Jun 2008, 16:06

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
Attachments
emitProc4.tar
tar archive with example files
(10 KiB) Downloaded 4288 times

mjoyce
Posts: 15
Joined: 28 Jul 2008, 12:56

Re: emittance measurement quad scan question

Post by mjoyce » 10 Oct 2008, 10:54

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?

michael_borland
Posts: 1933
Joined: 19 May 2008, 09:33
Location: Argonne National Laboratory
Contact:

Re: emittance measurement quad scan question

Post by michael_borland » 10 Oct 2008, 11:00

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

mjoyce
Posts: 15
Joined: 28 Jul 2008, 12:56

Re: emittance measurement quad scan question

Post by mjoyce » 10 Oct 2008, 11:10

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?

michael_borland
Posts: 1933
Joined: 19 May 2008, 09:33
Location: Argonne National Laboratory
Contact:

Re: emittance measurement quad scan question

Post by michael_borland » 10 Oct 2008, 12:29

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

mjoyce
Posts: 15
Joined: 28 Jul 2008, 12:56

Re: emittance measurement quad scan question

Post by mjoyce » 17 Oct 2008, 09:48

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.
Attachments
jlab_emit.tar.gz
(4.66 KiB) Downloaded 289 times

michael_borland
Posts: 1933
Joined: 19 May 2008, 09:33
Location: Argonne National Laboratory
Contact:

Re: emittance measurement quad scan question

Post by michael_borland » 17 Oct 2008, 10:13

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

michael_borland
Posts: 1933
Joined: 19 May 2008, 09:33
Location: Argonne National Laboratory
Contact:

Re: emittance measurement quad scan question

Post by michael_borland » 17 Oct 2008, 10:16

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

mjoyce
Posts: 15
Joined: 28 Jul 2008, 12:56

Re: emittance measurement quad scan question

Post by mjoyce » 17 Oct 2008, 10:36

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?

michael_borland
Posts: 1933
Joined: 19 May 2008, 09:33
Location: Argonne National Laboratory
Contact:

Re: emittance measurement quad scan question

Post by michael_borland » 17 Oct 2008, 10:50

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

Post Reply