GSI Forum
GSI Helmholtzzentrum für Schwerionenforschung

Home » NUSTAR » NUSTAR PRESPEC » Position calculations on start/stop scintillators
Position calculations on start/stop scintillators [message #18119] Wed, 08 April 2015 18:24 Go to next message
LScruton is currently offline  LScruton
Messages: 3
Registered: July 2014
occasional visitor
From: *york.ac.uk
index.php?t=getfile&id=8356&private=0Hello,

I was wondering whether anyone could give some advice on getting the correct position information for the x-y hits on the LYCCA start scintillator. I currently have the "always_compute_position" parameter in the membrane.par file for the startToF set to zero, so it calculates the position of the interaction point from the PMT data only if there is no data available from the TPCs at S4. However, I get a very strange x-y map for the start scintillator as a result of this which I have attached.

The central region is generated by the extrapolation of the TPC data, and the odd region in the upper left of the x-y map is caused by the position calculation from the PMT data (i.e., when there is no TPC position data available). I can see that one can alter the shear and rotation of the computed position, which will help this odd region to align with the tracked positions from the TPCs, but don't have a clue how to do this.

Has anybody else had this problem?

Thanks,

Lianne

index.php?t=getfile&id=8356&private=0
Re: Position calculations on start/stop scintillators [message #18126 is a reply to message #18119] Thu, 09 April 2015 15:16 Go to previous messageGo to next message
miree is currently offline  miree
Messages: 71
Registered: June 2014
continuous participant
From: *ikp.physik.tu-darmstadt.de
Hi,

I guess it is not optimally calibrated. The ToF position determination is very dependent on a good calibration of all PMTs.
By PMT calibration I mean position correction, i.e. the dependence of delta_t(delta_x), where delta_t is the time delay between particle hit and PMT signal, and delta_x is the distance between the particle hit position and the PMT position.

The calibration goes like this: Plotting delta_t over delta_x and determine the slope and offset of the resulting structure
How this structure should look like a straight line (see Figure 1 of this GSI report: http://repository.gsi.de/record/52088/files/PHN-ENNA-EXP-55.pdf)
The offset (intersection of the line with y-axis) and slope (of the line) for each PMT have to be copied into the calibration file for the ToF processor "ToFStart.cal"

This calibration might change between experiments (mainly because of differences in PMT voltages, I guess).

In the prespec analysis script, these corellation plots are created in this section:

########################################################################
# Time of flight start detector
########################################################################
processor Lycca/ToFStart/Preproc   UTILS.MhTdcPreprocessor
	input[0:15]     <-   LyccaTargetTofCrate.mhtdc0[0:15]
	input[16:31]    <-   LyccaTargetTofCrate.mhtdc1[16:31]
	# ...
end
processor Lycca/ToFStart/Membrane         LYCCA.CircularMembraneScintillator
	pmt_time[0:31]   <-    Lycca/ToFStart/Preproc.output[0:31]
	x_hit            <-    Frs/S4tracking.xs[5]
	y_hit            <-    Frs/S4tracking.ys[5]
        #....
end
# create the delata_t vs. distance corellation plots for all 32 PMTs
# Membrane.dist[i] is the distance of PMT_i to the particle impact point
# Membrane.T_Tp[i] is the time of PMT_i minus the estimated time of particle impact
for $i in [0:31]
	processor Lycca/ToFStart/Diagnostics/Tdist0$i     UTILS.Pair
		first   <-   Lycca/ToFStart/Membrane.dist[$i]
		second  <-   Lycca/ToFStart/Membrane.T_Tp[$i]
		display first:second 256,0,300:512,-35,55       in   TofStart_Tdist_corrlation
	end
end


Note that the corellation plot depends on the calibration parameters, the complete process is iterative:
1)start with initial values for offsets and slopes in the calibration file: 0 and 0.01 are good starting values
2)determine offsets and slopes from the corellation plot
3)go to 1)

(2 to 3 iterations are usually enough)

Michael
Re: Position calculations on start/stop scintillators [message #18194 is a reply to message #18126] Thu, 07 May 2015 17:29 Go to previous messageGo to next message
thuyuk is currently offline  thuyuk
Messages: 68
Registered: July 2014
continuous participant

From: 84.79.220*
Hi Michael,

How one should fit a Tdist histogram like this:

index.php?t=getfile&id=8376&private=0

as one can see from the image that not all of the histograms form a linear distribution. Is this due to one of malfunctional PMT? What would you suggest in such a case?

Thank you!
Tayfun
Re: Position calculations on start/stop scintillators [message #18195 is a reply to message #18119] Fri, 08 May 2015 11:23 Go to previous messageGo to next message
miree is currently offline  miree
Messages: 71
Registered: June 2014
continuous participant
From: *ikp.physik.tu-darmstadt.de
Ideally, the 2D histogram should look like the one in the GSI report in my earlier post.
To get these nice lined, every PMT has to work fine.
In your case something is wrong, but it is hard to tell from this single picture.
Whenever I didn't get the good looking lines, I tried to exclude signals from some PMTs (by trial and error), sometimes a single PMT can disturb all histograms.
If this doesn't help one can also start with a small number of PMTs (2 or 3) for which the correlation plots look good, and successively add more. Each time one hast to check if the histograms still look good. If they don't look good after adding the PMT #n, you know that PMT #n is not good and skip it.

Another (possibly simpler) way is to determine the correlations not using the signals from the LYCCA.CircularMembraneScintillator outputs, but by subtracting from each ToF-PMT the Sc41 time, and plot this over the distance between impact point of particle and respective PMT.
This produces correlation plots that are not so sharp (because the Sc41 time resolution is not as good as the LYCCA ToF time resolution) but allows to treat each PMT individually without any influence from other PMTs. I'll try to post a code-snippet that does it later today.




Re: Position calculations on start/stop scintillators [message #18198 is a reply to message #18195] Mon, 11 May 2015 13:12 Go to previous messageGo to next message
miree is currently offline  miree
Messages: 71
Registered: June 2014
continuous participant
From: *ikp.physik.tu-darmstadt.de
Hi, here comes the code (sorry for the delay)

This is taking not the particle time from the Membrane as reference
for the time-distance correlation plot, but the time from Sc41.
Advantages:

    the calibration procedure is simplified
    easyer to detect fautly PMTs, etc.
Disadvantages:

    the correlation is not that precise (because of the inferior time resolution of Sc41).
    One cannot determine the intrinsic PMT resolution (for the same reason).

Of course one can first do the simplified version and later the other method to fine-tune the parameters and determine the intrinsic detector resolution.

#########################################################################
# The following two processors extract the Sc41 time
# Don't forget to set the gates around the peak in the preprocessing
#########################################################################
processor Lycca/ToFfrs/SciPreproc   UTILS.MhTdcPreprocessor
	input[0]     <-   LyccaTargetTofCrate.mhtdc0[16] // Sci21
	input[1]     <-   LyccaTargetTofCrate.mhtdc0[18] // Sci21
	input[2]     <-   LyccaTargetTofCrate.mhtdc0[20] // Sci41
	input[3]     <-   LyccaTargetTofCrate.mhtdc0[22] // Sci41
	display diff   1,0.1,4096,200  | diff_gate   in Preproc/diff
	display output 1,0.1,4096,200                in Preproc/output
end
processor Lycca/ToFfrs/Sc41  UTILS.Pair
	first  <- Lycca/ToFfrs/SciPreproc.output[2]
	second <- Lycca/ToFfrs/SciPreproc.output[3]
	display average
end
#########################################################################
# The following two processors do the normal ToFStart Membrane processing
#########################################################################
processor Lycca/ToFStart/Preproc   UTILS.MhTdcPreprocessor
	input[0:15]     <-   LyccaTargetTofCrate.mhtdc0[0:15]
	input[16:31]    <-   LyccaTargetTofCrate.mhtdc1[16:31]
	display diff 1,0.1,4096,200  | diff_gate   in Preproc/diff
	display output 1,0.1,4096,200              in Preproc/output
end
processor Lycca/ToFStart/Membrane         LYCCA.CircularMembraneScintillator
	pmt_time[0:31]   <-    Lycca/ToFStart/Preproc.output[0:31]
	x_hit            <-    Frs/S4tracking.xs[5]
	y_hit            <-    Frs/S4tracking.ys[5]
	display   x:y               256,-150,150:256,-150,150
	display x_hit:x
	display y_hit:y
end
########################################################################
# Do the correlation of  Sc41-PMTi vs. PMTdistance and determine the 
# slope of the line the 2d histograms
########################################################################
for $i in [0:31]
	processor Lycca/ToFStart/Diagnostics/TSc41_diff$i       UTILS.Pair
		first   <- Lycca/ToFStart/Membrane.pmt_time[$i]
		second  <- Lycca/ToFfrs/Sc41.average
	end
	processor Lycca/ToFStart/Diagnostics/TSc41_dist$i     UTILS.Pair
		first   <-   Lycca/ToFStart/Membrane.dist[$i]
		second  <-   Lycca/ToFStart/Diagnostics/TSc41_diff$i.difference
		display first:second  100,0,300:200,-15,15  in   TofStart_TSc41_dist_corrlation
	end
end

Re: Position calculations on start/stop scintillators [message #18202 is a reply to message #18198] Tue, 12 May 2015 13:06 Go to previous messageGo to next message
thuyuk is currently offline  thuyuk
Messages: 68
Registered: July 2014
continuous participant

From: *ific.uv.es
Hi Michael,

thanks for the piece of code to create the correlation plots of the Lycca scintillator together with the Sci41.

I plotted them and saw something like the attached image.

What I don't understand is why do you see a triple-like structure, and I don't. How one should determine the malfunctioning PMT by looking at these plots? I get, as you can see, that some of the PMTs produce double-like structure and some of them not; just to be precise, 15 of them produce a double-like structure. What all these mean? Why we should see triples? My instincts say that there is still one or more mulfunctioning PMTs; and do you think trying different combinations of ignoring them would be the best option to make everything work properly?

Sorry for too many questions. I understand that the analysis of these detectors are complicated. I might addressed my questions to Michael, but anybody who has the understanding is very welcome to bring explanation.

Thank you,
Tayfun
Re: Position calculations on start/stop scintillators [message #18209 is a reply to message #18202] Tue, 12 May 2015 15:24 Go to previous messageGo to next message
miree is currently offline  miree
Messages: 71
Registered: June 2014
continuous participant
From: *ikp.physik.tu-darmstadt.de
Hi Tayfun,

I didn't understand what you mean by "triple-like structure". Do you refer to the picture in the GSI report?

Are the plots in your last post from the ToF-start or from the ToF-stop detector?
For the ToF-start, it is important to also have a good calibration of both FRS-TPCs at S4 in order to get a good extrapolated particle position at the ToF detector.
Did you use the simplified correlation plots (code from my last post) these plots or are they done in the "standard way".

Michael
Re: Position calculations on start/stop scintillators [message #18210 is a reply to message #18209] Tue, 12 May 2015 15:39 Go to previous messageGo to next message
thuyuk is currently offline  thuyuk
Messages: 68
Registered: July 2014
continuous participant

From: *ific.uv.es
Hi Michael,

Sorry for not being precise in my previous post.

Yes, I meant the figure in your GSI report by "triple-like" structure.
index.php?t=getfile&id=8378&private=0

in fact, I just noticed with a larger view of the figure that there are four areas separated from each other. Why do you think that there is this kind of structure in this plot? Is this because of the beam structure, in such a way that there was a composition of several different type of ions in the secondary beam in the data you have analysed?

The plots I posted were from the ToFStart scintillator, and I used the code from your last post.

The thing is that I'm not able to use TPCs for the position determination, because somehow the time gates were not properly set (reported after the experiment by Stephane), and I don't have a good y-axis position information from them. Therefore, I'm trying to determine the positions from the ToFStart scintillator only.

Thanks,
Tayfun
Re: Position calculations on start/stop scintillators [message #18212 is a reply to message #18210] Tue, 12 May 2015 16:40 Go to previous messageGo to next message
miree is currently offline  miree
Messages: 71
Registered: June 2014
continuous participant
From: *ikp.physik.tu-darmstadt.de
Hi,

in this case, the gaps in the line are from the gaps in the DSSSDs. The position for the correlation plot is taken from the LYCCA Wall DSSSDs and they do have gaps. The gaps are not equally well visible for all PMTs but in this particular case, the PMT#7 was on the right (or left) of the disk.
Other than this, the correlation plot should be one single line. I wouldn't know how to interpret any other structure (double peak, ...) in terms of the physics of this detector.

> The thing is that I'm not able to use TPCs for
> the position determination, because somehow the
> time gates were not properly set(reported after
> the experiment by Stephane), and I don't have a
> good y-axis position information from them.
> Therefore, I'm trying to determine the positions
> from the ToFStart scintillator only.

Ah! you want to get position from the ToF detectors without any reference position. I believe this is possible, but I have never done this. The calibration procedure that I described is depending on other position information.

In order to do what you want/need to do, you need another approach: one possibility would be to make a global minimization of a quantity that describes the quality of the calibration coefficients for a given number of events in the detector. Treat the calibration coefficients as parameters in the minimization. The quantity to minimize could be for example the sum of the variances of the distance-corrected PMT signals... or their product.... This is numerically involved since you have a 64 parameter space (2*32 coefficients). But I am confident that this works (Christian Stahl has done something like this for DSSSD detectors with a similar amount of parameters).

Michael
Re: Position calculations on start/stop scintillators [message #18217 is a reply to message #18212] Wed, 13 May 2015 10:56 Go to previous messageGo to next message
thuyuk is currently offline  thuyuk
Messages: 68
Registered: July 2014
continuous participant

From: *ific.uv.es
Hi Michael,

thank you very much for your comments.

Would it be enough to run the minimum search algorithm inside CircularMembraneScintillator.cpp which has been implemented for the cases where there are no valid signals from the reference hit point in DSSSD or in TPC, by assuming all the reference signals are not valid?

Cheers,
Tayfun
Re: Position calculations on start/stop scintillators [message #18225 is a reply to message #18217] Wed, 13 May 2015 14:56 Go to previous messageGo to next message
miree is currently offline  miree
Messages: 71
Registered: June 2014
continuous participant
From: *ikp.physik.tu-darmstadt.de
Hi Tayfun,

I'll try to summarize some facts about the CircularMembrane first, and then try to outline of a Membrane selfcalibration algorithm:

The time and position calculation of the CircularMembraneScintillator processor needs to be calibrated in order to work. Especially the position determination depends strongly on the quality of the calibration.
The processor is not doing any calibration on it's own (like the DSSSD). It only provides some output that is useful to find good coefficients. All calibration procedures that I've seen so far need particle position information from other tracking detectors.

A minimization routine as described in my last post requires additional code: It needs to work with a given number (say 10000) of events. These events have to be analyzed over and over again, each time with slightly different calibration coefficients. The result of each single analysis schould be a quantity that allows to judge the quality of the calibration. Calculating this quantity involves an analysis similar to the current CircularMembraneScintillator. As minimization algorithm I would take a library such as the GNU scientific library. It contains the "simplex minimizer" which I would try first. It worked well in the case of Christian's DSSSD calibration.

I think it would be cool to have such an algorithm. But it will require some work to get it running, i.e. it is not a simple modification of the existing processor.
Re: Position calculations on start/stop scintillators [message #18231 is a reply to message #18225] Thu, 14 May 2015 12:07 Go to previous messageGo to next message
thuyuk is currently offline  thuyuk
Messages: 68
Registered: July 2014
continuous participant

From: *ific.uv.es
Hi Michael,

I'm sorry if I'm being a meathead, but in the following part of the code, it seemed to me that you are doing more or less what you described, am I wrong?

	if (time_computed == false || parameter(always_compute_position) != 0)
	{
		// We haven't been informed about the position of the particle impact
		// position or we want to compute the particle position in any case. 
		// It will be determined by the following minimum search algorithm.
		double radius_sqr = parameter(radius)*parameter(radius);
		
		// Tiny random jitter around the beam axis is the starting point.
		x_particle = 0.2*parameter(radius)*(rand()%2000 - 1000)/1000.0;
		y_particle = 0.2*parameter(radius)*(rand()%2000 - 1000)/1000.0;
		
		// Select the start step size more or less arbitrary.
		// 1/7 of the disk radius seems to be a reasonable choice.
		double stepsize = parameter(radius)/7;
		int direction = 0;
		double last_variance = analyze(x_particle, y_particle, true);
		for (int n = 0;; ++n)
		{
			if (x_particle*x_particle + y_particle*y_particle > 4*radius_sqr) // we left the circular membrane
			{
				//std::cerr << n << " steps to break the circle at position "
				//		  << x_particle << " " << y_particle
				//		  << "   stepsize was " << stepsize << std::endl;
				return;
			}
			double variance;
			// From the current position go strictly downhill
			// in one of the four directions (+x,-x,+y,-y)
			// on the chi^2 plane.
			if (     (variance = analyze(x_particle + stepsize, y_particle,            true)) < last_variance)
				x_particle += stepsize;
			else if ((variance = analyze(x_particle - stepsize, y_particle,            true)) < last_variance)
				x_particle -= stepsize;
			else if ((variance = analyze(x_particle,            y_particle + stepsize, true)) < last_variance)
				y_particle += stepsize;
			else if ((variance = analyze(x_particle,            y_particle - stepsize, true)) < last_variance)
				y_particle -= stepsize;
			else
			{
				// If a minimum is found and the stepsize is not small
				// enough, reduce the stepsize and restart searching.
				if (stepsize > 2.0)
				{
					stepsize /= 2;
				}
				else
				{
					// If the stepsize was small enough (less than 2mm
					// seems to be reasonable, because the spacial
					// resolution of the device is approx. 6-7mm)
					// we are done.
					//std::cerr << n << " steps to find the position " << x_particle << " " << y_particle << std::endl;
					break;
				}
			}
			
			last_variance = variance;
		}


In this part, you never use an initial position nor calibration, you search the position starting from the beam axis. Then hit position vs. PMT time difference calibration should also work here, right?

Thank you for your patience!

Tayfun
Re: Position calculations on start/stop scintillators [message #18233 is a reply to message #18231] Fri, 15 May 2015 10:48 Go to previous messageGo to next message
miree is currently offline  miree
Messages: 71
Registered: June 2014
continuous participant
From: *ikp.physik.tu-darmstadt.de
Hi Tayfun,

The existing code finds the position based on a grid search on (the 2-dimensional) surface of the Detector. It assumes that the detector was hit at point x,y and calculates how big the variance in the position-corrected time signal is. It moves the point x,y around until it finds a minimum in this variance.

However, the procedure assumes that one can calculate the time delay (caused by light propagation from particle to PMT) correctly based on a known relation (this is used in the "analyze" function that is called in the code). During calibration one has to find for each PMT the exact (linear) relation between particle-PMT-distance and time delay caused by this distance. You might ask: "Isn't the time delay exactly the distance divided by the speed of light in the scintillator material?". Initially I thought the same, but empirically this is not the case. So far, I didn't understand why. Especially why this value is different for each PMT. But so far the empirical lesson that I learned is: reliable position determination only works after a careful calibration of each PMT based on measured data. This calibration is done by plotting the time delay versus the distance. But this requires knowledge of the position.

As far as I understood, you are in the situation that you do not have any reliable position information (faulty TPCs) at the location of the ToF detectors. Consequently, you cannot create the plot that is required to determine the calibration coefficients. You can do the plot using the time difference and the position coming from the (uncalibrated) ToF detector. But this will not improve your calibration coefficients.

What you have to do (formally) is the following: Try all possible combinations of the 64 calibration coefficients (32 slopes + 32 offsets). For all of these you have to make a qualitative statement of how good they are. Eventually you will find a set of coefficients that is best (gives the highest quality value) and you take the corresponding calibration coefficients. This is what I tried to describe as an algorithm before. Basically this is searching a minimum/maximum in a 64-dimensional space. Each of theses search steps requires to make the 2-dimensional search for the minimum variance that is done in the code, so ... yes, the existing code could be part of this algorithm. Maybe there are some tricks that can be applied that I'm not aware of. Maybe someone has a good idea to achieve the same with simpler means.

Best regards,
Michael
Re: Position calculations on start/stop scintillators [message #18250 is a reply to message #18233] Tue, 19 May 2015 12:19 Go to previous messageGo to next message
thuyuk is currently offline  thuyuk
Messages: 68
Registered: July 2014
continuous participant

From: *ific.uv.es
Hi Michael,

Thanks for the explanation in detail.

For the anomaly you detected regarding to the time delay for each PMT, this might be due to the scintillator material, that it seems to have 1.58 of refraction index according to the data sheet of the BC420 of Saint Gobain. So the theoretical formula would allready need a correction just because of the n constant, what do you think? Considering that there might be imperfections inside the scintillator plastic, the times from the PMTs would differ slightly. This is my first impression, maybe I'm totally wrong.

Regarding to the part that you explained how should one treat the data without any reference interaction point, I think I'm lost when you say;

Quote:

... all possible combinations of the 64 calibration coefficients ...


What are the all possible combinations? Do you mean all combinations of the PMT pairs?

Thanks!
Tayfun
Re: Position calculations on start/stop scintillators [message #18251 is a reply to message #18250] Tue, 19 May 2015 14:29 Go to previous messageGo to next message
miree is currently offline  miree
Messages: 71
Registered: June 2014
continuous participant
From: *gsi.de
Hi Tayfun,

The second calibration coefficient (the slope) corresponds to how many ns delay per mm scintillator material the light has. Yes, it should be the inverse of the speed of light in that medium. But empirically the slope is in the order of 0.01 ns/mm. If the speed of light inside the scintillator would be c/n, the value of n would be n=3 which is twice the expected value. That means there must be other mechanisms that delay the light. Perhaps it is simply the geometry of the multiple reflections...

Quote:

Regarding to the part that you explained how should one treat the data without any reference interaction point, I think I'm lost when you say;

Quote:
... all possible combinations of the 64 calibration coefficients ...

What are the all possible combinations? Do you mean all combinations of the PMT pairs?


I mean all possible calibration coefficients of all PMTs.
I'll give an example: the first calibration coefficient (the offset) has values around 0ns in the range of approx. -10 ns ... +10 ns.
The second coefficient for a PMT is in the range of 0.005 ns/mm .... 0.015 ns/mm.
If you know nothing else about the calibration coefficients, you can (theoretically) do the following: choose some values (32 offsets and 32 slopes) in the given ranges for each PMTs and analyze some data with this calibration. Then you see how good the chosen calibration coefficients are. Then do the same choosing a different calibration for all PMTs (again 32 offsets and 32 slopes) and analyze some data again. This you continue until you have found a good set of calibration coefficients.

In principle you randomly choose a set of calibration coefficients for all PMTs and hope that it is the right one. Of course, it is extremely unlikely to get by chance the correct calibration coefficients. In practice one would choose an algorithm for this kind of high-dimensional search, for example: http://en.wikipedia.org/wiki/Nelder%E2%80%93Mead_method , is what I meant with "simplex method" in my earlier post, but apparently it is also known as "NelderMead method". If one has reasonable starting values, maybe set all offsets to 0 and all slopes to 0.01, the algorithm will make small modifications to all calibration coefficients and eventually find better ones. If you let it run for long enough, you can hope to get the best possible calibration.

I don't know if that was any more clear than the previous post... It is a problem of multidimensional optimization. Maybe you can read something about this technique in general.

Best regards,
Michael
Re: Position calculations on start/stop scintillators [message #18254 is a reply to message #18210] Wed, 20 May 2015 14:13 Go to previous messageGo to next message
miree is currently offline  miree
Messages: 71
Registered: June 2014
continuous participant
From: *ikp.physik.tu-darmstadt.de
Hi Tayfun,

Liliana was suggesting to recheck if the TPCs are really all broken. You have 2 TPCs at S4, each of which has 4-fold y-position measurement. If you could get only one valid y-measurements ( out of 8 ), you could calibrate your ToF detector. You could interpolate between the working TPC and the target DSSSD.

Michael
Re: Position calculations on start/stop scintillators [message #18262 is a reply to message #18254] Thu, 21 May 2015 15:28 Go to previous message
thuyuk is currently offline  thuyuk
Messages: 68
Registered: July 2014
continuous participant

From: *ific.uv.es
Hey Michael,

Unfortunately, I cannot recover any y-distribution data from both TPCs.

Thanks for the comment.

Tayfun
Previous Topic: PRESPEC GEANT
Next Topic: FRS Calibration Issue
Goto Forum:
  


Current Time: Sun Nov 24 08:40:41 CET 2024

Total time taken to generate the page: 0.00878 seconds