CDC algo tuning

From GlueXWiki
Jump to: navigation, search

Using prototype data from CDC_50_50 (run 31942) with offline analysis

50/50 Ar/CO2 and cosmics, 2100V, prototype horizontal

Original code, many samples upsampled

  1. Event pedestal is mean of 100 samples ending at trigger time
  2. Upsample 200 samples starting 50 before trigger time
  3. Find hit threshold crossing
  4. Step back <pedlead> points to find new local pedestal
  5. Search forward to find high threshold crossing
  6. Search backward to find low threshold crossing
  7. Project through both thresholds to find pedestal crossing time
Thresholds 5-4-1 pedlead 16 tz 7 tfix 1000


Only 20 samples upsampled

  1. Event pedestal is mean of 100 samples ending at trigger time
  2. Find hit threshold crossing
  3. Upsample 20 samples starting 10 before hit threshold crossing
  4. Find hit threshold crossing again in upsampled data
  5. Step back <pedlead> points to find new local pedestal
  6. Search forward to find high threshold crossing
  7. Search backward to find low threshold crossing
  8. Project through both thresholds to find pedestal crossing time

Net difference between this and the previous code with 200 samples upsampled is the range of the upsampled data available to the high threshold search in step 5 and 6 respectively.

Thresholds 5-4-1 pedlead 16 tz 7 tfix 1000


Trying out ideas for simplification

Ideas

  1. Check whether interpolating threshold xings makes any difference.
  2. Use the 3rd sample or 4th sample (or mean of 3rd & 4th samples) before hit threshold as local pedestal
  3. Try reverting to one threshold crossing instead of the extrapolation
  4. Try something easier for event pedestal - mean of 4 samples immediately before trigger

Pics below try these out one at a time (not cumulative)

Simplified versions, all with 20 samples upsampled
Event pedestal is mean of 4 samples
No interpolation when finding high and low thresholds
Hit time is low threshold crossing time (with interpolation)
Local pedestal 4 samples before hit threshold
Local ped mean of 4 and 5 samples before hit threshold


Combined simplifications (20 samples upsampled)
Event ped is mean of 4 samples, local ped is mean of 4 and 5 samples before hit_thr
As left, but no interpolation when finding high and low thresholds
As far left, hit time is interpolated low threshold crossing time
As far left, hit time is interpolated high threshold crossing time
As above, hit time is low threshold crossing time without interpolation
As left, but local ped is 4th sample before hit_thr
As left, but local ped is 5th sample before hit_thr

Image with blue and green borders are from single threshold crossings; images with green borders are without interpolation.

Data below from code with event ped = mean of 4 samples, local ped = mean of 4 and 5 samples before hit threshold, hit time is projection of high and low threshold crossings (interpolated) to the local pedestal

Max amplitude
Leading edge gradient
Max amplitude vs resolution
Leading edge gradient vs max amplitude
Leading edge gradient vs resolution






Original code, many samples upsampled. This section is a bit confusing. Replacement is above.

  1. Event pedestal is mean of 100 samples ending at trigger time
  2. Find hit threshold crossing
  3. Step back <pedlead> points to find new local pedestal
  4. Search forward to find high threshold crossing
  5. Search backward to find low threshold crossing
  6. Project through both thresholds to find pedestal crossing time
All thresholds found using upsampled data, with interpolation
Thresholds 5-4-1 pedlead 16 tz 7 tfix 1000
Thresholds 5-4-2 pedlead 16 tz 7 tfix 1000
Thresholds 5-4-3 pedlead 16 tz 7 tfix 1000


Trying out ideas for simplification

Ideas

  1. Check whether interpolating threshold xings makes any difference - no, not if extrapolating through thresholds to pedestal.
  2. Use the 3rd sample (or mean of 3rd & 4th samples) before hit threshold as local pedestal
  3. Try reverting to one threshold crossing instead of the extrapolation - only slight increase to res width
  4. Try something easier for event pedestal - mean of 4 samples immediately before trigger - this might be an improvement, probably because the pedestal is closer in time to the hits


All thresholds found using upsampled data, without interpolation at the high and low threshold xings
Thresholds 5-4-1 pedlead 16 tz 7 tfix 1000


Both thresholds found using upsampled data; for timing, used low threshold xing only, with interpolation
Thresholds 5-1 pedlead 16 tz 7 tfix 1000
  1. Event pedestal is mean of 4 samples ending at trigger time
Both thresholds found using upsampled data; for timing, used low threshold xing only, with interpolation; 4 sample event pedestal
Thresholds 5-1 pedlead 16 tz 7 tfix 1000


Fewer samples upsampled

  1. Event pedestal is mean of 100 samples ending at trigger time
  2. Find hit threshold crossing
  3. Upsample region (20 samples) around threshold crossing, with threshold crossing sample in set position (10th sample)
  4. Search again for hit threshold in small region of upsampled data
  5. Step back <pedlead> points to find new pedestal
  6. Search forward to find high threshold crossing
  7. Search backward to find low threshold crossing
  8. Project through both thresholds to find pedestal crossing time
Thresholds 5-4-1 pedlead 16 tz 7 tfix 1000

This is not exactly the same as the first case (when 100 samples are upsampled) because after the hit threshold is found using regular samples, the search through the upsampled data is restricted to a small region. If the upsampled values (every 5th point) are not exactly the same as the sampled data, the wider search could run on further.

Did not search again for hit threshold, used sample 9, High and low thresholds found using upsampled data, with interpolation
Thresholds 5-4-1 pedlead 16 tz 7 tfix 1000


  1. Event pedestal is mean of 4 samples ending at trigger time
  2. Find hit threshold crossing
  3. Upsample region (20 samples) around threshold crossing, with threshold crossing sample in set position (10th sample)
  4. Search again for hit threshold in small region of upsampled data
  5. Step back <pedlead> points to find new pedestal
  6. Search forward to find high threshold crossing
  7. Search backward to find low threshold crossing
  8. Project through both thresholds to find pedestal crossing time
Thresholds 5-4-1 pedlead 16 tz 7 tfix 1000

Use low threshold instead of projection from high threshold through low threshold to pedestal

  1. Event pedestal is mean of 4 samples ending at trigger time
  2. Find hit threshold crossing
  3. Upsample region (20 samples) around threshold crossing, with threshold crossing sample in set position (10th sample)
  4. Search again for hit threshold in small region of upsampled data
  5. Take local pedestal as <pedlead> points before hit threshold crossing (upsampled)
  6. Search backward from hit threshold to find low threshold crossing, take this to be hit time (no extrapolation)
Thresholds 5-1 pedlead 16 tz 7 tfix 1000

Do not search again for hit threshold in upsampled data, use original value

  1. Event pedestal is mean of 4 samples ending at trigger time
  2. Find hit threshold crossing
  3. Upsample region (20 samples) around threshold crossing, with threshold crossing sample in set position (10th sample)
  4. Take local pedestal as <pedlead> points before hit threshold crossing
  5. Search backward from hit threshold to find low threshold crossing, take this to be hit time (no extrapolation)
Thresholds 5-1 pedlead 16 tz 7 tfix 1000
pedlead 20 (optimal), thres xing in 11th sample