https://halldweb1.jlab.org/wiki/api.php?action=feedcontributions&user=Nsjarvis&feedformat=atomGlueXWiki - User contributions [en]2024-03-29T10:56:22ZUser contributionsMediaWiki 1.24.1https://halldweb1.jlab.org/wiki/index.php?title=FADC_Data_Format_February_17,_2015&diff=63766FADC Data Format February 17, 20152015-02-18T21:33:17Z<p>Nsjarvis: /* Useful Links */</p>
<hr />
<div>= Location and Time =<br />
<br />
'''Room:''' CC L207 ??<br />
<br />
'''Time:''' 2pm.<br />
<br />
= Remote Connection =<br />
(if problems, call phone in conference room: 757-269-6460 might not be the correct number)<br />
# To join via Polycom room system go to the IP Address: 199.48.152.152 ([http://bjn.vc bjn.vc]) and enter the meeting ID: 589693655.<br />
# To join via a Web Browser, go to the page [https://bluejeans.com/589693655] https://bluejeans.com/589693655.<br />
# To join via phone, use one of the following numbers and the Conference ID: 589693655<br />
#* US or Canada: +1 408 740 7256 or <br />
#* US or Canada: +1 888 240 2560<br />
<br />
[[Connect to the Data Challenge Meetings|More information on connecting to bluejeans is here]]<br />
<br />
Specific instructions for connecting via polycom:<br />
<br />
* Turn polycom on if necessary <br />
* With the polycom, place a call at 199.48.152.152<br />
* Press # to enable the polycom keypad, then enter the meeting id: 589693655 and #<br />
* You may have to unmute the microphone: #*4<br />
* Turn the computer on if needed<br />
<br />
= Agenda =<br />
* [[FADC_Data_Format_February_10,_2015|Previous meeting (Feb 10, 2015)]]<br />
* Status of FADC125 Firmware<br />
* Format doc<br />
* Emulation in sim-recon<br />
<br />
== Useful Links ==<br />
* [[CDC_algo|Timing algorithm - updated to include latest revisions]]<br />
* [http://argus.phys.uregina.ca/cgi-bin/private/DocDB/ShowDocument?docid=2274 fADC125 Data Format Specification Document] [[:File:FA125_format_v5_01.pdf|Latest version (5.01) in svn, 17 Feb 2015]]<br />
* [[:File:FADC125_dataformat_250_modes.docx|Data format for 250 modes on fADC125 from Cody, Aug 15 2014]]<br />
* [[:File:FADC250_modes_2.docx|FA250 modes 2 from Ed and Hai, Feb 18 2014]]<br />
* [[:File:FADC250_V2_ADC_FPGA_V90D.docx|FIRMWARE for FADC250 Ver2 ADC FPGA, Sept 2014?]]<br />
* [http://www.jlab.org/Hall-D/detector/fdc/FDC_pulse_data_format.pptx FDC_pulse_data_format]<br />
* [[CDC_readout_requirements|CDC readout needs]] [[CDC_garfield_calcs|Garfield calcs]]<br />
* [[CDC_run_985]] [[CDC_run_970]]<br />
<br />
=Minutes=</div>Nsjarvishttps://halldweb1.jlab.org/wiki/index.php?title=File:FA125_format_v5_01.pdf&diff=63765File:FA125 format v5 01.pdf2015-02-18T21:32:59Z<p>Nsjarvis: uploaded a new version of &quot;File:FA125 format v5 01.pdf&quot;</p>
<hr />
<div></div>Nsjarvishttps://halldweb1.jlab.org/wiki/index.php?title=CDC_algo&diff=63751CDC algo2015-02-17T21:06:18Z<p>Nsjarvis: </p>
<hr />
<div><h1>CDC time & integral algorithm</h1><br />
<br />
When the trigger signal arrives, the presample buffer contains NP (default value 16) samples for pedestal followed by NW (default 100, possibly up to 155) samples to contain full range of drift time. <br />
<br />
<br />
<h2>Quantities to be returned, if a hit is found</h2><br />
*Leading edge time (11 bits, units of sample/10)<br />
*Time quality factor (1 bit) set to 0 if time is good, 1 if time is rough estimate<br />
*Pedestal immediately before the hit (8 bits, all bits set if value > field max)<br />
*Signal integral (n bits, scaled down by factor 2^m, all bits set if greater than range; n,m are 14,4)<br />
*Signal maximum (p bits, scaled down by factor 2^q; p,q approx 8,2) this is the first maximum in the signal after the threshold crossing<br />
*Overflow count (3 bits, set to 7 if >6)<br />
<br />
<br />
<br />
<h2>Configuration constants (all values are integers, σ=pedestal width ~20)</h2><br />
<br />
*NPED: number of samples in pedestal window (default 16, must be 2**integer)<br />
*WINDOW_START: position in buffer of first sample in hit search window, this is immediately after the pedestal window<br />
*WINDOW_END: position in buffer of last sample in hit search window<br />
*HIT_THRES: threshold to identify hit (default 5σ ~100, range 50 to 300)<br />
*NPED2: number of samples to use to calculate pedestal just before hit (default 16, must be 2**integer)<br />
*NSAMPLES: number of ADC samples in subset to pass to time finding module (default 15)<br />
*XTHR_SAMPLE: position in subset of first sample above hit_threshold (default 9, starts with 0)<br />
*PED_SAMPLE: position in subset of sample to be used as local pedestal (default 5, starts with 0)<br />
<br />
<br />
<br />
<h2>Timing algorithm configuration constants</h2><br />
*HIGH_THRESHOLD: High timing threshold (default 4σ ~ 80, range 40 to 270) must be lower than hit threshold<br />
*LOW_THRESHOLD: Low timing threshold (default 1σ ~ 20, range 5 to 30)<br />
*ROUGH_DT: rough time - if timing fails, return hit time of XTHR_SAMPLE - ROUGH_DT (default 24, units sample/10)<br />
*INT_SAMPLE: if timing fails, start integration with this sample (default 6).<br />
*NUPSAMPLED: number of upsampled values to calculate (default 8, minimum 8)<br />
*LIMIT_PED_MAX: do not calculate accurate time if any of samples 0 to PED_SAMPLE in subset exceeds this (default 511)<br />
*LIMIT_ADC_MAX: do not calculate accurate time if any sample in the subset exceeds this (default 4095)<br />
*SET_ADC_MIN: reduce chances of calculating a negative upsampled value by adding a constant offset to the subset values such that the minimum is equal to SET_ADC_MIN (default 20)<br />
*LIMIT_UPS_ERR: do not calculate accurate time if the sum of the error of the 2 upsampled values exceeds this (default 30)<br />
<br />
<br />
<h2>Hit finding module</h2><br />
<br />
#Calculate start_pedestal as mean of NPED samples from WINDOW_START-NPED-1 to WINDOW_START-1<br />
#Search from WINDOW_START to WINDOW_END for the earliest sample with ADC value >= start_pedestal + HIT_THRES. If not found, go back to sleep. If found, continue, this is sample X.<br />
#Call up time-finding module and send in NSAMPLES ADC values from the hit threshold crossing region, with sample X in position XTHR_SAMPLE (starting at 0)<br />
#Call up signal maximum module<br />
#Call up signal integral module<br />
#Return pedestal_at_hit as mean of NPED2 samples ending with sample number X + PED_SAMPLE - XTHR_SAMPLE, or 255 if pedestal_at_hit > field max<br />
#Return overflow count from integral module<br />
#Return q_code from time module<br />
#Return total integral: sum of contributions from time module and integral module<br />
#Return time = (X - XTHR_SAMPLE)*10 + le_time returned from time module, units are 0.1*sample-period (0.8ns)<br />
<br />
<br />
<br />
<h2>Time finding module</h2><br />
This returns an error code q_code and the leading edge time le_time, in units of sample/10 and relative to the first sample in the subset. The hit time returned falls into one of three categories: an accurate estimate of the leading edge time, where the low threshold crossing time was found using upsampled data, a midpoint time, where the low threshold crossing time was found using sample data, and a rough time estimate, XTHR_SAMPLE*10 - ROUGH_DT. If the time returned is the accurate leading edge time, q_code is set to 0, otherwise it is set to 1. <br />
<br />
#Inspect ADC samples 0 to PED_SAMPLE. If any sample values are 0 or greater than LIMIT_PED_MAX, return the rough time, XTHR_SAMPLE*10 - ROUGH_DT, q_code=1 and rough integral=sum of samples INT_SAMPLE to XTHR_SAMPLE-1.<br />
#Inspect ADC samples PED_SAMPLE+1 to NSAMPLES-1. If any sample values are 0 or greater than LIMIT_ADC_MAX, return the rough time, q_code=1 and rough integral. <br />
#Find the minimum sample value in the subset. Subtract a constant offset from all sample values so that the minimum value is now SET_ADC_MIN. This is to decrease the likelihood of calculating any negative upsampled values. <br />
#Calculate the timing thresholds thres_hi = value of sample PED_SAMPLE + HIGH_THRESHOLD and thres_lo = value of sample PED_SAMPLE + LOW_THRESHOLD<br />
#Search the samples from PED_SAMPLE+1 to NSAMPLES-1 for the first sample with value >= thres_hi. If this threshold is not met, return the rough time, q_code=1 and rough integral.<br />
#Search the samples from the first sample with value >= thres_hi down to PED_SAMPLE to find the first sample (Y) with value <= thres_lo<br />
#If Y is > NSAMPLES-7, there are not enough samples to calculate upsampled values, return the rough time, q_code=1 and rough integral.<br />
#Calculate NUPSAMPLED (8) upsampled values, starting with Y-0.2. <br />
#If any upsampled value is negative, return the midpoint time, Y*10+5, q_code=1, and good integral=sum of samples from Y to XTHR_SAMPLE-1.<br />
#Calculate two upsampling errors, as the difference between upsampled point 1 and sample Y, and the difference between upsampled point 6 and sample Y+1<br />
#Sum the errors and compare them with LIMIT_UPS_ERR, if this is exceeded then return the midpoint time, Y*10+5, q_code=1, and good integral.<br />
#Calculate the mean of the 2 errors, ups_err and the adjusted threshold, thres_adj = thres_lo + ups_err<br />
#Search the upsampled values from NUPSAMPLED-1 down to 0 to find upsampled point Z where the value <= thres_adj<br />
#If Z=NUPSAMPLED-1 or Z is not found, return the midpoint time, Y*10+5, q_code=1, and good integral.<br />
#Interpolate between the upsampled points Z and Z+1 to find the crossing time in units of sample/10 and relative to the first upsampled point<br />
#Calculate the leading edge time, le_time, as the crossing time found in previous step + Y*10-2, in units of sample/10 and relative to subset sample 0<br />
#Return time=le_time, q_code=0 and good integral<br />
<br />
<br />
<br />
<h2>Signal maximum module</h2><br />
This returns the signal maximum<br />
#Inspect ADC values after sample X, find the first value which is less than its predecessor<br />
#Return value of the predecessor scaled down by 2^p <br />
<br />
<br />
<br />
<h2>Signal integral module</h2><br />
This returns the signal integral and overflow count<br />
#Sum ADC values from sample X to sample WINDOW_END, and count the number of samples with overflow bit set<br />
#Return integral scaled down by 2^m (return all bits set if value exceeds range maximum)<br />
#Return overflow count (return 7 if count>6)<br />
<br />
<br />
<br />
<br />
<br />
<br />
<h1> Error codes from Run 1602 </h1><br />
<br />
<br />
Settings used:<br />
<pre><br />
#define WINDOW_START 46 //earliest sample for start of hit<br />
#define WINDOW_END 130 //last sample for hit arrival, and last sample included in integral<br />
<br />
#define HIT_THRES 300 // "5 sigma" hit threshold *** set this VERY high to cut out persistent noise in a handful of channels ***<br />
#define NPED 16 // number of samples used for pedestal used to find hit. must be 2**integer<br />
#define NPED2 16 // number of samples used for pedestal calculated just before hit (returned, not used here). must be 2**integer<br />
<br />
// cdc_time<br />
#define HIGH_THRESHOLD 80 // 4 sigma threshold<br />
#define LOW_THRESHOLD 20 // 1 sigma threshold<br />
#define ROUGH_DT 24 // if pulse fails QA, return this many tenth-samples before threshold xing<br />
#define INT_SAMPLE 6 // if pulse fails QA, start integration with this sample <br />
<br />
//cdc_time good pulse criteria<br />
#define LIMIT_PED_MAX 511 //return rough time if any sample in 0 to PED_SAMPLE exceeds this<br />
#define LIMIT_ADC_MAX 4095 // return rough time if any sample in PED_SAMPLE+1 to NSAMPLES exceeds this<br />
<br />
// cdc_time upsampling<br />
#define NSAMPLES 15 //number of samples in subset of array to pass to cdc_time<br />
#define XTHR_SAMPLE 9 // the hit_thres xing sample is sample[9] passed into cdc_time, starting with sample[0]<br />
#define PED_SAMPLE 5 // take local ped as sample[5] passed into cdc_time<br />
#define NUPSAMPLED 8 // number of upsampled values to calculate, minimum is 8<br />
#define SET_ADC_MIN 20 // add an offset to the adc values to set the min value equal to SET_ADC_MIN<br />
#define LIMIT_UPS_ERR 30 // upsampling error tolerance, return midpoint time if error is greater than this<br />
</pre><br />
<br />
<br />
==Error codes with faulty channels included==<br />
<br />
Error codes are listed in the order that the event is removed from processing. ADC overflows are not identified by the C++ code as it only looks at Df125WindowRawData.<br />
<br />
{| border="1px" cellpadding="2" style="border-style:solid;"<br />
! q_code !! reason !! entries !! percent of total !! percent of q>0 entries<br />
|-<br />
| 5 || ADC value = 0 || 26458 || 2.3% || 31%<br />
|-<br />
| 6 || ADC value > 4095 || 0 || 0% || 0%<br />
|-<br />
| 7 || Pedestal > 511 || 44830 || 3.9% || 53%<br />
|-<br />
| 1 || ADC data did not go over threshold adc_thres_hi || 576 || 0.050% || 0.6888%<br />
|-<br />
| 2 || Leading edge time is too late in the buffer to upsample || 82 || 0.007% || 0.096%<br />
|-<br />
| 8 || Upsampled value is negative || 15 || 0.001% || 0.018%<br />
|-<br />
| 9 || Upsampling error sum > 30 || 13225 || 1.1% || 16%<br />
|-<br />
| 3 || Last upsampled point is too low (below or equal to low timing threshold) || 28 || 0.002% || 0.033%<br />
|-<br />
| 4 || Upsampled points are too high (did not go below low timing threshold) || 2 || 0.000% || 0.002%<br />
|-<br />
| 0 || Good || 1078072 || 93% || <br />
|}<br />
<br/><br />
<br />
==Error codes with most of faulty channels excluded from data==<br />
<br />
Error codes are listed in the order that the event is removed from processing. ADC overflows are not identified by the C++ code as it only looks at Df125WindowRawData.<br />
<br />
{| border="1px" cellpadding="2" style="border-style:solid;"<br />
! q_code !! reason !! entries !! percent of total !! percent of q>0 entries<br />
|-<br />
| 5 || ADC value = 0 || 26433 || 2.3% || 31%<br />
|-<br />
| 6 || ADC value > 4095 || 0 || 0% || 0%<br />
|-<br />
| 7 || Pedestal > 511 || 44747 || 3.9% || 53%<br />
|-<br />
| 1 || ADC data did not go over threshold adc_thres_hi || 575 || 0.050% || 0.68%<br />
|-<br />
| 2 || Leading edge time is too late in the buffer to upsample || 82 || 0.007% || 0.096%<br />
|-<br />
| 8 || Upsampled value is negative || 0 || 0% || 0%<br />
|-<br />
| 9 || Upsampling error sum > 30 || 13188 || 1.2% || 16%<br />
|-<br />
| 3 || Last upsampled point is too low (below or equal to low timing threshold) || 2 || 0.000% || 0.002%<br />
|-<br />
| 4 || Upsampled points are too high (did not go below low timing threshold) || 0 || 0% || 0%<br />
|-<br />
| 0 || Good || 1075754 || 93% || <br />
|}<br />
<br/><br />
<br />
==Error codes with faulty channels included, mimicked overflow detection in C++ code==<br />
The C++ code is not finding overflows because it is only using Df125WindowRawData; overflows are in a different branch of DAQTree.<br />
The VHDL code will be able to find overflows by testing for sample value > 4095 because the overflow bit is passed in as a 13th sample value bit (bits 0-11 are the ADC value), so samples with the overflow bit set will have value > 4095. This was mimicked in the C++ code by testing for ADC value > 4094.<br />
<pre><br />
#define LIMIT_ADC_MAX 4094 // return rough time if any sample in PED_SAMPLE+1 to NSAMPLES exceeds this<br />
</pre><br />
<br />
{| border="1px" cellpadding="2" style="border-style:solid;"<br />
! q_code !! reason !! entries !! percent of total !! percent of q>0 entries<br />
|-<br />
| 5 || ADC value = 0 || 52559 || 3.9% || 25%<br />
|-<br />
| 6 || ADC value > 4094 || 97939 || 7.2% || 46%<br />
|-<br />
| 7 || Pedestal > 511 || 51244 || 3.8% || 24%<br />
|-<br />
| 1 || ADC data did not go over threshold adc_thres_hi || 9787 || 0.72% || 4.6%<br />
|-<br />
| 2 || Leading edge time is too late in the buffer to upsample || 700 || 0.051% || 0.33%<br />
|-<br />
| 8 || Upsampled value is negative || 15 || 0.001% || 0.007%<br />
|-<br />
| 9 || Upsampling error sum > 30 || 61 || 0.004% || 0.029%<br />
|-<br />
| 3 || Last upsampled point is too low (below or equal to low timing threshold) || 813 || 0.060% || 0.38%<br />
|-<br />
| 4 || Upsampled points are too high (did not go below low timing threshold) || 8 || 0.001% || 0.004%<br />
|-<br />
| 0 || Good || 1148835 || 84% || <br />
|}<br />
<br />
<br />
<br />
<br />
==Examples, in order of q code population (click image twice to expand)==<br />
<br />
=== Q=0, good ===<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_run1602_e0q0.png.png|thumb|x200px|entry 0 q 0]]<br />
|[[Image:cdc_run1602_e1q0.png.png|thumb|x200px|entry 1 q 0]]<br />
|[[Image:cdc_run1602_e2q0.png.png|thumb|x200px|entry 2 q 0]]<br />
|[[Image:cdc_run1602_e3q0.png.png|thumb|x200px|entry 3 q 0]]<br />
|}<br />
<br />
=== Q=6, overflow ===<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_run1602_e7q6.png.png|thumb|x200px|entry 7 q 6]]<br />
|[[Image:cdc_run1602_e8q6.png.png|thumb|x200px|entry 8 q 6]]<br />
|[[Image:cdc_run1602_e9q6.png.png|thumb|x200px|entry 9 q 6]]<br />
|[[Image:cdc_run1602_e16q6.png.png|thumb|x200px|entry 16 q 6]]<br />
|}<br />
<br />
=== Q=5, ADC value=0 ===<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_run1602_e51q5.png.png|thumb|x200px|entry 51 q 5]]<br />
|[[Image:cdc_run1602_e120q5.png.png|thumb|x200px|entry 120 q 5]]<br />
|[[Image:cdc_run1602_e125q5.png.png|thumb|x200px|entry 125 q 5]]<br />
|[[Image:cdc_run1602_e198q5.png.png|thumb|x200px|entry 198 q 5]]<br />
|}<br />
<br />
=== Q=7, Pedestal>511 ===<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_run1602_e6q7.png.png|thumb|x200px|entry 6 q 7]]<br />
|[[Image:cdc_run1602_e21q7.png.png|thumb|x200px|entry 21 q 7]]<br />
|[[Image:cdc_run1602_e23q7.png.png|thumb|x200px|entry 23 q 7]]<br />
|[[Image:cdc_run1602_e24q7.png.png|thumb|x200px|entry 24 q 7]]<br />
|}<br />
<br />
=== Q=1, ADC data<ADC_subset_value[PED_SAMPLE] + HIGH_THRESHOLD===<br />
<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_run1602_e15q1.png.png|thumb|x200px|entry 15 q 1]]<br />
|[[Image:cdc_run1602_e91q1.png.png|thumb|x200px|entry 91 q 1]]<br />
|[[Image:cdc_run1602_e165q1.png.png|thumb|x200px|entry 165 q 1]]<br />
|[[Image:cdc_run1602_e179q1.png.png|thumb|x200px|entry 179 q 1]]<br />
|}<br />
<br />
=== Q=3, last upsampled point is too low (very rare with fully functioning fADCs) ===<br />
<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_run1602_e4073q3.png.png|thumb|x200px|entry 4073 q 3]]<br />
|[[Image:cdc_run1602_e5548q3.png.png|thumb|x200px|entry 5548 q 3]]<br />
|[[Image:cdc_run1602_e8618q3.png.png|thumb|x200px|entry 8618 q 3]]<br />
|[[Image:cdc_run1602_e9358q3.png.png|thumb|x200px|entry 9358 q 3]]<br />
|}<br />
<br />
=== Q=2, leading edge time too late to upsample (very rare with fully functioning fADCs) ===<br />
<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_run1602_e2091q2.png.png|thumb|x200px|entry 2091 q 2]]<br />
|[[Image:cdc_run1602_e3950q2.png.png|thumb|x200px|entry 3950 q 2]]<br />
|[[Image:cdc_run1602_e6905q2.png.png|thumb|x200px|entry 6905 q 2]]<br />
|[[Image:cdc_run1602_e9876q2.png.png|thumb|x200px|entry 9876 q 2]]<br />
|}<br />
<br />
=== Q=8, calculated an upsampled value < 0 (very rare with fully functioning fADCs) ===<br />
<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_run1602_e4284q8.png|thumb|x200px|entry 4284 q 8]]<br />
|[[Image:cdc_run1602_e99090q8.png|thumb|x200px|entry 99090 q 8]]<br />
|[[Image:cdc_run1602_e251941q8.png|thumb|x200px|entry 251941 q 8]]<br />
|[[Image:cdc_run1602_e544903q8.png|thumb|x200px|entry 544903 q 8]]<br />
|}<br />
<br />
=== Q=4, upsampled values too high (very rare with fully functioning fADCs) ===<br />
<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_run1602_e16257q4.png|thumb|x200px|entry 16257 q 4]]<br />
|[[Image:cdc_run1602_e74085q4.png|thumb|x200px|entry 74085 q 4]]<br />
|[[Image:cdc_run1602_e205536q4.png|thumb|x200px|entry 205536 q 4]]<br />
|[[Image:cdc_run1602_e256051q4.png|thumb|x200px|entry 256051 q 4]]<br />
|}<br />
<br />
==Upsampled data - old example==<br />
<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_upsampled2.png|thumb|x250px|ADC samples in (big circles) and upsampled data out (small blue dots) ]]<br />
|[[Image:cdc_upsampled2_front.png|thumb|x250px|ADC samples in (big circles) and upsampled data out (small blue dots) ]]<br />
|[[Image:cdc_upsampled2_middle.png|thumb|x250px|ADC samples in (big circles) and upsampled data out (small blue dots) ]]<br />
|}<br />
<br />
== Upsampling error check prior to error correction - copied from [[CDC_run_1280_bad_events]]==<br />
<br />
After excluding known [[CDC_bad_channels]] I compared the upsampled data with the original samples for the first 10000 events of run 1602. This is a high-intensity run so some of the pedestals are lower than they should be. <br />
<br/><br />
ups_err1 is the upsampled value iubuf[1] - the original sample adc[adc_sample_lo]<br />
<br/><br />
ups_err2 is the upsampled value iubuf[6] - the original sample adc[adc_sample_lo+1]<br />
<br/><br />
<pre><br />
q_code list:<br />
0: Good<br />
1: ADC data did not go over threshold adc_thres_hi <br />
2: Leading edge time is outside the upsampled region (cross adc_thres_lo too late in the buffer subset ) <br />
3: Last upsampled point is <= low timing threshold<br />
4: Upsampled points did not go below low timing threshold<br />
</pre><br />
Looking at upsampling errors - occur when gradient is very large<br />
<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_adcq0.png|thumb|x200px|ADC sample subset for q code 0 ]]<br />
|[[Image:cdc_adcq4.png|thumb|x200px|ADC sample subset for q code 4]]<br />
|[[Image:cdc_adcq4b.png|thumb|x200px|ADC sample subset for q code 4, normalised to min value]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|[[Image:uerr1_q4.png|thumb|x200px|Error in upsampled value vs original sample value adc_sample_lo, q code 4]]<br />
|[[Image:uerr2_q4.png|thumb|x200px|Error in upsampled value vs original sample value adc_sample_lo+1, q code 4]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|[[Image:ue2e1q0.png|thumb|x200px|Error in upsampled values, q code 0]]<br />
|[[Image:ue2e1q4.png|thumb|x200px|Error in upsampled values, q code 4]]<br />
|[[Image:uediffq0.png|thumb|x200px|Difference in error in upsampled values, q code 0 (blue) and 4 (pink)]]<br />
|}<br />
<br />
Following this the error correction step was added to the algorithm, where the sum of errors ups_err1+ups_err2 is calculated and compared with LIMIT_UPS_ERR and then, if below this limit, halved (to calculate the mean) and subtracted from the upsampled data. The corrected upsampled points are the green circles in the 'example of Q code' plots above.</div>Nsjarvishttps://halldweb1.jlab.org/wiki/index.php?title=FADC_Data_Format_February_17,_2015&diff=63730FADC Data Format February 17, 20152015-02-16T15:34:18Z<p>Nsjarvis: /* Agenda */</p>
<hr />
<div>= Location and Time =<br />
<br />
'''Room:''' CC L207 ??<br />
<br />
'''Time:''' 2pm.<br />
<br />
= Remote Connection =<br />
(if problems, call phone in conference room: 757-269-6460 might not be the correct number)<br />
# To join via Polycom room system go to the IP Address: 199.48.152.152 ([http://bjn.vc bjn.vc]) and enter the meeting ID: 589693655.<br />
# To join via a Web Browser, go to the page [https://bluejeans.com/589693655] https://bluejeans.com/589693655.<br />
# To join via phone, use one of the following numbers and the Conference ID: 589693655<br />
#* US or Canada: +1 408 740 7256 or <br />
#* US or Canada: +1 888 240 2560<br />
<br />
[[Connect to the Data Challenge Meetings|More information on connecting to bluejeans is here]]<br />
<br />
Specific instructions for connecting via polycom:<br />
<br />
* Turn polycom on if necessary <br />
* With the polycom, place a call at 199.48.152.152<br />
* Press # to enable the polycom keypad, then enter the meeting id: 589693655 and #<br />
* You may have to unmute the microphone: #*4<br />
* Turn the computer on if needed<br />
<br />
= Agenda =<br />
* [[FADC_Data_Format_February_10,_2015|Previous meeting (Feb 10, 2015)]]<br />
* Status of FADC125 Firmware<br />
* Format doc<br />
* Emulation in sim-recon<br />
<br />
== Useful Links ==<br />
* [[CDC_algo|Timing algorithm - updated to include latest revisions]]<br />
* [http://argus.phys.uregina.ca/cgi-bin/private/DocDB/ShowDocument?docid=2274 fADC125 Data Format Specification Document] [[:File:FA125_format_v5_01.pdf|Latest version (5.01) in svn, 15 Feb 2015]]<br />
* [[:File:FADC125_dataformat_250_modes.docx|Data format for 250 modes on fADC125 from Cody, Aug 15 2014]]<br />
* [[:File:FADC250_modes_2.docx|FA250 modes 2 from Ed and Hai, Feb 18 2014]]<br />
* [[:File:FADC250_V2_ADC_FPGA_V90D.docx|FIRMWARE for FADC250 Ver2 ADC FPGA, Sept 2014?]]<br />
* [http://www.jlab.org/Hall-D/detector/fdc/FDC_pulse_data_format.pptx FDC_pulse_data_format]<br />
* [[CDC_readout_requirements|CDC readout needs]] [[CDC_garfield_calcs|Garfield calcs]]<br />
* [[CDC_run_985]] [[CDC_run_970]]<br />
<br />
=Minutes=</div>Nsjarvishttps://halldweb1.jlab.org/wiki/index.php?title=FADC_Data_Format_February_17,_2015&diff=63729FADC Data Format February 17, 20152015-02-16T15:34:02Z<p>Nsjarvis: /* Agenda */</p>
<hr />
<div>= Location and Time =<br />
<br />
'''Room:''' CC L207 ??<br />
<br />
'''Time:''' 2pm.<br />
<br />
= Remote Connection =<br />
(if problems, call phone in conference room: 757-269-6460 might not be the correct number)<br />
# To join via Polycom room system go to the IP Address: 199.48.152.152 ([http://bjn.vc bjn.vc]) and enter the meeting ID: 589693655.<br />
# To join via a Web Browser, go to the page [https://bluejeans.com/589693655] https://bluejeans.com/589693655.<br />
# To join via phone, use one of the following numbers and the Conference ID: 589693655<br />
#* US or Canada: +1 408 740 7256 or <br />
#* US or Canada: +1 888 240 2560<br />
<br />
[[Connect to the Data Challenge Meetings|More information on connecting to bluejeans is here]]<br />
<br />
Specific instructions for connecting via polycom:<br />
<br />
* Turn polycom on if necessary <br />
* With the polycom, place a call at 199.48.152.152<br />
* Press # to enable the polycom keypad, then enter the meeting id: 589693655 and #<br />
* You may have to unmute the microphone: #*4<br />
* Turn the computer on if needed<br />
<br />
= Agenda =<br />
* [[FADC_Data_Format_February_10,_2015|Previous meeting (Feb 10, 2015)]]<br />
* Status of FADC125 Firmware<br />
* Format doc<br />
* Version in sim-recon<br />
<br />
== Useful Links ==<br />
* [[CDC_algo|Timing algorithm - updated to include latest revisions]]<br />
* [http://argus.phys.uregina.ca/cgi-bin/private/DocDB/ShowDocument?docid=2274 fADC125 Data Format Specification Document] [[:File:FA125_format_v5_01.pdf|Latest version (5.01) in svn, 15 Feb 2015]]<br />
* [[:File:FADC125_dataformat_250_modes.docx|Data format for 250 modes on fADC125 from Cody, Aug 15 2014]]<br />
* [[:File:FADC250_modes_2.docx|FA250 modes 2 from Ed and Hai, Feb 18 2014]]<br />
* [[:File:FADC250_V2_ADC_FPGA_V90D.docx|FIRMWARE for FADC250 Ver2 ADC FPGA, Sept 2014?]]<br />
* [http://www.jlab.org/Hall-D/detector/fdc/FDC_pulse_data_format.pptx FDC_pulse_data_format]<br />
* [[CDC_readout_requirements|CDC readout needs]] [[CDC_garfield_calcs|Garfield calcs]]<br />
* [[CDC_run_985]] [[CDC_run_970]]<br />
<br />
=Minutes=</div>Nsjarvishttps://halldweb1.jlab.org/wiki/index.php?title=FADC_Data_Format_February_17,_2015&diff=63728FADC Data Format February 17, 20152015-02-16T15:33:19Z<p>Nsjarvis: /* Location and Time */</p>
<hr />
<div>= Location and Time =<br />
<br />
'''Room:''' CC L207 ??<br />
<br />
'''Time:''' 2pm.<br />
<br />
= Remote Connection =<br />
(if problems, call phone in conference room: 757-269-6460 might not be the correct number)<br />
# To join via Polycom room system go to the IP Address: 199.48.152.152 ([http://bjn.vc bjn.vc]) and enter the meeting ID: 589693655.<br />
# To join via a Web Browser, go to the page [https://bluejeans.com/589693655] https://bluejeans.com/589693655.<br />
# To join via phone, use one of the following numbers and the Conference ID: 589693655<br />
#* US or Canada: +1 408 740 7256 or <br />
#* US or Canada: +1 888 240 2560<br />
<br />
[[Connect to the Data Challenge Meetings|More information on connecting to bluejeans is here]]<br />
<br />
Specific instructions for connecting via polycom:<br />
<br />
* Turn polycom on if necessary <br />
* With the polycom, place a call at 199.48.152.152<br />
* Press # to enable the polycom keypad, then enter the meeting id: 589693655 and #<br />
* You may have to unmute the microphone: #*4<br />
* Turn the computer on if needed<br />
<br />
= Agenda =<br />
* [[FADC_Data_Format_February_10,_2015|Previous meeting (Feb 10, 2015)]]<br />
* Status of FADC125 Firmware<br />
* Format doc<br />
<br />
== Useful Links ==<br />
* [[CDC_algo|Timing algorithm - updated to include latest revisions]]<br />
* [http://argus.phys.uregina.ca/cgi-bin/private/DocDB/ShowDocument?docid=2274 fADC125 Data Format Specification Document] [[:File:FA125_format_v5_01.pdf|Latest version (5.01) in svn, 15 Feb 2015]]<br />
* [[:File:FADC125_dataformat_250_modes.docx|Data format for 250 modes on fADC125 from Cody, Aug 15 2014]]<br />
* [[:File:FADC250_modes_2.docx|FA250 modes 2 from Ed and Hai, Feb 18 2014]]<br />
* [[:File:FADC250_V2_ADC_FPGA_V90D.docx|FIRMWARE for FADC250 Ver2 ADC FPGA, Sept 2014?]]<br />
* [http://www.jlab.org/Hall-D/detector/fdc/FDC_pulse_data_format.pptx FDC_pulse_data_format]<br />
* [[CDC_readout_requirements|CDC readout needs]] [[CDC_garfield_calcs|Garfield calcs]]<br />
* [[CDC_run_985]] [[CDC_run_970]]<br />
<br />
=Minutes=</div>Nsjarvishttps://halldweb1.jlab.org/wiki/index.php?title=FADC_Data_Format_February_17,_2015&diff=63727FADC Data Format February 17, 20152015-02-16T15:31:56Z<p>Nsjarvis: /* Agenda */</p>
<hr />
<div>= Location and Time =<br />
<br />
'''Room:''' CC L207<br />
<br />
'''Time:''' 2pm.<br />
<br />
= Remote Connection =<br />
(if problems, call phone in conference room: 757-269-6460 might not be the correct number)<br />
# To join via Polycom room system go to the IP Address: 199.48.152.152 ([http://bjn.vc bjn.vc]) and enter the meeting ID: 589693655.<br />
# To join via a Web Browser, go to the page [https://bluejeans.com/589693655] https://bluejeans.com/589693655.<br />
# To join via phone, use one of the following numbers and the Conference ID: 589693655<br />
#* US or Canada: +1 408 740 7256 or <br />
#* US or Canada: +1 888 240 2560<br />
<br />
[[Connect to the Data Challenge Meetings|More information on connecting to bluejeans is here]]<br />
<br />
Specific instructions for connecting via polycom:<br />
<br />
* Turn polycom on if necessary <br />
* With the polycom, place a call at 199.48.152.152<br />
* Press # to enable the polycom keypad, then enter the meeting id: 589693655 and #<br />
* You may have to unmute the microphone: #*4<br />
* Turn the computer on if needed<br />
<br />
= Agenda =<br />
* [[FADC_Data_Format_February_10,_2015|Previous meeting (Feb 10, 2015)]]<br />
* Status of FADC125 Firmware<br />
* Format doc<br />
<br />
== Useful Links ==<br />
* [[CDC_algo|Timing algorithm - updated to include latest revisions]]<br />
* [http://argus.phys.uregina.ca/cgi-bin/private/DocDB/ShowDocument?docid=2274 fADC125 Data Format Specification Document] [[:File:FA125_format_v5_01.pdf|Latest version (5.01) in svn, 15 Feb 2015]]<br />
* [[:File:FADC125_dataformat_250_modes.docx|Data format for 250 modes on fADC125 from Cody, Aug 15 2014]]<br />
* [[:File:FADC250_modes_2.docx|FA250 modes 2 from Ed and Hai, Feb 18 2014]]<br />
* [[:File:FADC250_V2_ADC_FPGA_V90D.docx|FIRMWARE for FADC250 Ver2 ADC FPGA, Sept 2014?]]<br />
* [http://www.jlab.org/Hall-D/detector/fdc/FDC_pulse_data_format.pptx FDC_pulse_data_format]<br />
* [[CDC_readout_requirements|CDC readout needs]] [[CDC_garfield_calcs|Garfield calcs]]<br />
* [[CDC_run_985]] [[CDC_run_970]]<br />
<br />
=Minutes=</div>Nsjarvishttps://halldweb1.jlab.org/wiki/index.php?title=File:FA125_format_v5_01.pdf&diff=63726File:FA125 format v5 01.pdf2015-02-16T15:31:03Z<p>Nsjarvis: uploaded a new version of &quot;File:FA125 format v5 01.pdf&quot;</p>
<hr />
<div></div>Nsjarvishttps://halldweb1.jlab.org/wiki/index.php?title=FADC_Data_Format_February_17,_2015&diff=63725FADC Data Format February 17, 20152015-02-16T15:10:39Z<p>Nsjarvis: /* Useful Links */</p>
<hr />
<div>= Location and Time =<br />
<br />
'''Room:''' CC L207<br />
<br />
'''Time:''' 2pm.<br />
<br />
= Remote Connection =<br />
(if problems, call phone in conference room: 757-269-6460 might not be the correct number)<br />
# To join via Polycom room system go to the IP Address: 199.48.152.152 ([http://bjn.vc bjn.vc]) and enter the meeting ID: 589693655.<br />
# To join via a Web Browser, go to the page [https://bluejeans.com/589693655] https://bluejeans.com/589693655.<br />
# To join via phone, use one of the following numbers and the Conference ID: 589693655<br />
#* US or Canada: +1 408 740 7256 or <br />
#* US or Canada: +1 888 240 2560<br />
<br />
[[Connect to the Data Challenge Meetings|More information on connecting to bluejeans is here]]<br />
<br />
Specific instructions for connecting via polycom:<br />
<br />
* Turn polycom on if necessary <br />
* With the polycom, place a call at 199.48.152.152<br />
* Press # to enable the polycom keypad, then enter the meeting id: 589693655 and #<br />
* You may have to unmute the microphone: #*4<br />
* Turn the computer on if needed<br />
<br />
= Agenda =<br />
* [[FADC_Data_Format_February_3,_2015|Previous meeting (Feb 3, 2015)]]<br />
* Status of FADC125 Firmware<br />
<br />
<br />
== Useful Links ==<br />
* [[CDC_algo|Timing algorithm - updated to include latest revisions]]<br />
* [http://argus.phys.uregina.ca/cgi-bin/private/DocDB/ShowDocument?docid=2274 fADC125 Data Format Specification Document] [[:File:FA125_format_v5_01.pdf|Latest version (5.01) in svn, 15 Feb 2015]]<br />
* [[:File:FADC125_dataformat_250_modes.docx|Data format for 250 modes on fADC125 from Cody, Aug 15 2014]]<br />
* [[:File:FADC250_modes_2.docx|FA250 modes 2 from Ed and Hai, Feb 18 2014]]<br />
* [[:File:FADC250_V2_ADC_FPGA_V90D.docx|FIRMWARE for FADC250 Ver2 ADC FPGA, Sept 2014?]]<br />
* [http://www.jlab.org/Hall-D/detector/fdc/FDC_pulse_data_format.pptx FDC_pulse_data_format]<br />
* [[CDC_readout_requirements|CDC readout needs]] [[CDC_garfield_calcs|Garfield calcs]]<br />
* [[CDC_run_985]] [[CDC_run_970]]<br />
<br />
=Minutes=</div>Nsjarvishttps://halldweb1.jlab.org/wiki/index.php?title=FADC_Data_Format_February_17,_2015&diff=63724FADC Data Format February 17, 20152015-02-16T15:08:36Z<p>Nsjarvis: /* Useful Links */</p>
<hr />
<div>= Location and Time =<br />
<br />
'''Room:''' CC L207<br />
<br />
'''Time:''' 2pm.<br />
<br />
= Remote Connection =<br />
(if problems, call phone in conference room: 757-269-6460 might not be the correct number)<br />
# To join via Polycom room system go to the IP Address: 199.48.152.152 ([http://bjn.vc bjn.vc]) and enter the meeting ID: 589693655.<br />
# To join via a Web Browser, go to the page [https://bluejeans.com/589693655] https://bluejeans.com/589693655.<br />
# To join via phone, use one of the following numbers and the Conference ID: 589693655<br />
#* US or Canada: +1 408 740 7256 or <br />
#* US or Canada: +1 888 240 2560<br />
<br />
[[Connect to the Data Challenge Meetings|More information on connecting to bluejeans is here]]<br />
<br />
Specific instructions for connecting via polycom:<br />
<br />
* Turn polycom on if necessary <br />
* With the polycom, place a call at 199.48.152.152<br />
* Press # to enable the polycom keypad, then enter the meeting id: 589693655 and #<br />
* You may have to unmute the microphone: #*4<br />
* Turn the computer on if needed<br />
<br />
= Agenda =<br />
* [[FADC_Data_Format_February_3,_2015|Previous meeting (Feb 3, 2015)]]<br />
* Status of FADC125 Firmware<br />
<br />
<br />
== Useful Links ==<br />
* [[CDC_algo|Timing algorithm - updated to include latest revisions]]<br />
* [http://argus.phys.uregina.ca/cgi-bin/private/DocDB/ShowDocument?docid=2274 fADC125 Data Format Specification Document] [[FA125_format_v5_01.pdf|Latest version (5.01) in svn, 15 Feb 2015]]<br />
* [[:File:FADC125_dataformat_250_modes.docx|Data format for 250 modes on fADC125 from Cody, Aug 15 2014]]<br />
* [[:File:FADC250_modes_2.docx|FA250 modes 2 from Ed and Hai, Feb 18 2014]]<br />
* [[:File:FADC250_V2_ADC_FPGA_V90D.docx|FIRMWARE for FADC250 Ver2 ADC FPGA, Sept 2014?]]<br />
* [http://www.jlab.org/Hall-D/detector/fdc/FDC_pulse_data_format.pptx FDC_pulse_data_format]<br />
* [[CDC_readout_requirements|CDC readout needs]] [[CDC_garfield_calcs|Garfield calcs]]<br />
* [[CDC_run_985]] [[CDC_run_970]]<br />
<br />
=Minutes=</div>Nsjarvishttps://halldweb1.jlab.org/wiki/index.php?title=File:FA125_format_v5_01.pdf&diff=63723File:FA125 format v5 01.pdf2015-02-16T15:06:32Z<p>Nsjarvis: </p>
<hr />
<div></div>Nsjarvishttps://halldweb1.jlab.org/wiki/index.php?title=FADC_Data_Format_February_17,_2015&diff=63722FADC Data Format February 17, 20152015-02-16T15:05:50Z<p>Nsjarvis: /* Useful Links */</p>
<hr />
<div>= Location and Time =<br />
<br />
'''Room:''' CC L207<br />
<br />
'''Time:''' 2pm.<br />
<br />
= Remote Connection =<br />
(if problems, call phone in conference room: 757-269-6460 might not be the correct number)<br />
# To join via Polycom room system go to the IP Address: 199.48.152.152 ([http://bjn.vc bjn.vc]) and enter the meeting ID: 589693655.<br />
# To join via a Web Browser, go to the page [https://bluejeans.com/589693655] https://bluejeans.com/589693655.<br />
# To join via phone, use one of the following numbers and the Conference ID: 589693655<br />
#* US or Canada: +1 408 740 7256 or <br />
#* US or Canada: +1 888 240 2560<br />
<br />
[[Connect to the Data Challenge Meetings|More information on connecting to bluejeans is here]]<br />
<br />
Specific instructions for connecting via polycom:<br />
<br />
* Turn polycom on if necessary <br />
* With the polycom, place a call at 199.48.152.152<br />
* Press # to enable the polycom keypad, then enter the meeting id: 589693655 and #<br />
* You may have to unmute the microphone: #*4<br />
* Turn the computer on if needed<br />
<br />
= Agenda =<br />
* [[FADC_Data_Format_February_3,_2015|Previous meeting (Feb 3, 2015)]]<br />
* Status of FADC125 Firmware<br />
<br />
<br />
== Useful Links ==<br />
* [[CDC_algo|Timing algorithm - updated to include latest revisions]]<br />
* [http://argus.phys.uregina.ca/cgi-bin/private/DocDB/ShowDocument?docid=2274 fADC125 Data Format Specification Document] [[File:FA125_format_v5_01.pdf|Latest version (5.01) in svn, 15 Feb 2015]]<br />
* [[:File:FADC125_dataformat_250_modes.docx|Data format for 250 modes on fADC125 from Cody, Aug 15 2014]]<br />
* [[:File:FADC250_modes_2.docx|FA250 modes 2 from Ed and Hai, Feb 18 2014]]<br />
* [[:File:FADC250_V2_ADC_FPGA_V90D.docx|FIRMWARE for FADC250 Ver2 ADC FPGA, Sept 2014?]]<br />
* [http://www.jlab.org/Hall-D/detector/fdc/FDC_pulse_data_format.pptx FDC_pulse_data_format]<br />
* [[CDC_readout_requirements|CDC readout needs]] [[CDC_garfield_calcs|Garfield calcs]]<br />
* [[CDC_run_985]] [[CDC_run_970]]<br />
<br />
=Minutes=</div>Nsjarvishttps://halldweb1.jlab.org/wiki/index.php?title=FADC_Data_Format_February_17,_2015&diff=63721FADC Data Format February 17, 20152015-02-16T15:05:22Z<p>Nsjarvis: /* Useful Links */</p>
<hr />
<div>= Location and Time =<br />
<br />
'''Room:''' CC L207<br />
<br />
'''Time:''' 2pm.<br />
<br />
= Remote Connection =<br />
(if problems, call phone in conference room: 757-269-6460 might not be the correct number)<br />
# To join via Polycom room system go to the IP Address: 199.48.152.152 ([http://bjn.vc bjn.vc]) and enter the meeting ID: 589693655.<br />
# To join via a Web Browser, go to the page [https://bluejeans.com/589693655] https://bluejeans.com/589693655.<br />
# To join via phone, use one of the following numbers and the Conference ID: 589693655<br />
#* US or Canada: +1 408 740 7256 or <br />
#* US or Canada: +1 888 240 2560<br />
<br />
[[Connect to the Data Challenge Meetings|More information on connecting to bluejeans is here]]<br />
<br />
Specific instructions for connecting via polycom:<br />
<br />
* Turn polycom on if necessary <br />
* With the polycom, place a call at 199.48.152.152<br />
* Press # to enable the polycom keypad, then enter the meeting id: 589693655 and #<br />
* You may have to unmute the microphone: #*4<br />
* Turn the computer on if needed<br />
<br />
= Agenda =<br />
* [[FADC_Data_Format_February_3,_2015|Previous meeting (Feb 3, 2015)]]<br />
* Status of FADC125 Firmware<br />
<br />
<br />
== Useful Links ==<br />
* [[CDC_algo|Timing algorithm - updated to include latest revisions]]<br />
* [http://argus.phys.uregina.ca/cgi-bin/private/DocDB/ShowDocument?docid=2274 fADC125 Data Format Specification Document] [[File:FA125_format_v5_01|Latest version (5.01) in svn, 15 Feb 2015]]<br />
* [[:File:FADC125_dataformat_250_modes.docx|Data format for 250 modes on fADC125 from Cody, Aug 15 2014]]<br />
* [[:File:FADC250_modes_2.docx|FA250 modes 2 from Ed and Hai, Feb 18 2014]]<br />
* [[:File:FADC250_V2_ADC_FPGA_V90D.docx|FIRMWARE for FADC250 Ver2 ADC FPGA, Sept 2014?]]<br />
* [http://www.jlab.org/Hall-D/detector/fdc/FDC_pulse_data_format.pptx FDC_pulse_data_format]<br />
* [[CDC_readout_requirements|CDC readout needs]] [[CDC_garfield_calcs|Garfield calcs]]<br />
* [[CDC_run_985]] [[CDC_run_970]]<br />
<br />
=Minutes=</div>Nsjarvishttps://halldweb1.jlab.org/wiki/index.php?title=FADC_Data_Format_February_17,_2015&diff=63720FADC Data Format February 17, 20152015-02-16T15:05:07Z<p>Nsjarvis: /* Useful Links */</p>
<hr />
<div>= Location and Time =<br />
<br />
'''Room:''' CC L207<br />
<br />
'''Time:''' 2pm.<br />
<br />
= Remote Connection =<br />
(if problems, call phone in conference room: 757-269-6460 might not be the correct number)<br />
# To join via Polycom room system go to the IP Address: 199.48.152.152 ([http://bjn.vc bjn.vc]) and enter the meeting ID: 589693655.<br />
# To join via a Web Browser, go to the page [https://bluejeans.com/589693655] https://bluejeans.com/589693655.<br />
# To join via phone, use one of the following numbers and the Conference ID: 589693655<br />
#* US or Canada: +1 408 740 7256 or <br />
#* US or Canada: +1 888 240 2560<br />
<br />
[[Connect to the Data Challenge Meetings|More information on connecting to bluejeans is here]]<br />
<br />
Specific instructions for connecting via polycom:<br />
<br />
* Turn polycom on if necessary <br />
* With the polycom, place a call at 199.48.152.152<br />
* Press # to enable the polycom keypad, then enter the meeting id: 589693655 and #<br />
* You may have to unmute the microphone: #*4<br />
* Turn the computer on if needed<br />
<br />
= Agenda =<br />
* [[FADC_Data_Format_February_3,_2015|Previous meeting (Feb 3, 2015)]]<br />
* Status of FADC125 Firmware<br />
<br />
<br />
== Useful Links ==<br />
* [[CDC_algo|Timing algorithm - updated to include latest revisions]]<br />
* [http://argus.phys.uregina.ca/cgi-bin/private/DocDB/ShowDocument?docid=2274 fADC125 Data Format Specification Document] [File:FA125_format_v5_01|Latest version (5.01) in svn, 15 Feb 2015]<br />
* [[:File:FADC125_dataformat_250_modes.docx|Data format for 250 modes on fADC125 from Cody, Aug 15 2014]]<br />
* [[:File:FADC250_modes_2.docx|FA250 modes 2 from Ed and Hai, Feb 18 2014]]<br />
* [[:File:FADC250_V2_ADC_FPGA_V90D.docx|FIRMWARE for FADC250 Ver2 ADC FPGA, Sept 2014?]]<br />
* [http://www.jlab.org/Hall-D/detector/fdc/FDC_pulse_data_format.pptx FDC_pulse_data_format]<br />
* [[CDC_readout_requirements|CDC readout needs]] [[CDC_garfield_calcs|Garfield calcs]]<br />
* [[CDC_run_985]] [[CDC_run_970]]<br />
<br />
=Minutes=</div>Nsjarvishttps://halldweb1.jlab.org/wiki/index.php?title=FADC_Data_Format_February_17,_2015&diff=63719FADC Data Format February 17, 20152015-02-16T15:04:31Z<p>Nsjarvis: /* Useful Links */</p>
<hr />
<div>= Location and Time =<br />
<br />
'''Room:''' CC L207<br />
<br />
'''Time:''' 2pm.<br />
<br />
= Remote Connection =<br />
(if problems, call phone in conference room: 757-269-6460 might not be the correct number)<br />
# To join via Polycom room system go to the IP Address: 199.48.152.152 ([http://bjn.vc bjn.vc]) and enter the meeting ID: 589693655.<br />
# To join via a Web Browser, go to the page [https://bluejeans.com/589693655] https://bluejeans.com/589693655.<br />
# To join via phone, use one of the following numbers and the Conference ID: 589693655<br />
#* US or Canada: +1 408 740 7256 or <br />
#* US or Canada: +1 888 240 2560<br />
<br />
[[Connect to the Data Challenge Meetings|More information on connecting to bluejeans is here]]<br />
<br />
Specific instructions for connecting via polycom:<br />
<br />
* Turn polycom on if necessary <br />
* With the polycom, place a call at 199.48.152.152<br />
* Press # to enable the polycom keypad, then enter the meeting id: 589693655 and #<br />
* You may have to unmute the microphone: #*4<br />
* Turn the computer on if needed<br />
<br />
= Agenda =<br />
* [[FADC_Data_Format_February_3,_2015|Previous meeting (Feb 3, 2015)]]<br />
* Status of FADC125 Firmware<br />
<br />
<br />
== Useful Links ==<br />
* [[CDC_algo|Timing algorithm - updated to include latest revisions]]<br />
* [http://argus.phys.uregina.ca/cgi-bin/private/DocDB/ShowDocument?docid=2274 fADC125 Data Format Specification Document] [[:File:FA125_format_v5_01|Latest version (5.01) in svn, 15 Feb 2015]]<br />
* [[:File:FADC125_dataformat_250_modes.docx|Data format for 250 modes on fADC125 from Cody, Aug 15 2014]]<br />
* [[:File:FADC250_modes_2.docx|FA250 modes 2 from Ed and Hai, Feb 18 2014]]<br />
* [[:File:FADC250_V2_ADC_FPGA_V90D.docx|FIRMWARE for FADC250 Ver2 ADC FPGA, Sept 2014?]]<br />
* [http://www.jlab.org/Hall-D/detector/fdc/FDC_pulse_data_format.pptx FDC_pulse_data_format]<br />
* [[CDC_readout_requirements|CDC readout needs]] [[CDC_garfield_calcs|Garfield calcs]]<br />
* [[CDC_run_985]] [[CDC_run_970]]<br />
<br />
=Minutes=</div>Nsjarvishttps://halldweb1.jlab.org/wiki/index.php?title=FADC_Data_Format_February_17,_2015&diff=63718FADC Data Format February 17, 20152015-02-16T15:00:42Z<p>Nsjarvis: Created page with "= Location and Time = '''Room:''' CC L207 '''Time:''' 2pm. = Remote Connection = (if problems, call phone in conference room: 757-269-6460 might not be the correct number) # T..."</p>
<hr />
<div>= Location and Time =<br />
<br />
'''Room:''' CC L207<br />
<br />
'''Time:''' 2pm.<br />
<br />
= Remote Connection =<br />
(if problems, call phone in conference room: 757-269-6460 might not be the correct number)<br />
# To join via Polycom room system go to the IP Address: 199.48.152.152 ([http://bjn.vc bjn.vc]) and enter the meeting ID: 589693655.<br />
# To join via a Web Browser, go to the page [https://bluejeans.com/589693655] https://bluejeans.com/589693655.<br />
# To join via phone, use one of the following numbers and the Conference ID: 589693655<br />
#* US or Canada: +1 408 740 7256 or <br />
#* US or Canada: +1 888 240 2560<br />
<br />
[[Connect to the Data Challenge Meetings|More information on connecting to bluejeans is here]]<br />
<br />
Specific instructions for connecting via polycom:<br />
<br />
* Turn polycom on if necessary <br />
* With the polycom, place a call at 199.48.152.152<br />
* Press # to enable the polycom keypad, then enter the meeting id: 589693655 and #<br />
* You may have to unmute the microphone: #*4<br />
* Turn the computer on if needed<br />
<br />
= Agenda =<br />
* [[FADC_Data_Format_February_3,_2015|Previous meeting (Feb 3, 2015)]]<br />
* Status of FADC125 Firmware<br />
<br />
<br />
== Useful Links ==<br />
* [[CDC_algo|Timing algorithm - updated to include latest revisions]]<br />
* [http://argus.phys.uregina.ca/cgi-bin/private/DocDB/ShowDocument?docid=2274 fADC125 Data Format Specification Document]<br />
* [[:File:FADC125_dataformat_250_modes.docx|Data format for 250 modes on fADC125 from Cody, Aug 15 2014]]<br />
* [[:File:FADC250_modes_2.docx|FA250 modes 2 from Ed and Hai, Feb 18 2014]]<br />
* [[:File:FADC250_V2_ADC_FPGA_V90D.docx|FIRMWARE for FADC250 Ver2 ADC FPGA, Sept 2014?]]<br />
* [http://www.jlab.org/Hall-D/detector/fdc/FDC_pulse_data_format.pptx FDC_pulse_data_format]<br />
* [[CDC_readout_requirements|CDC readout needs]] [[CDC_garfield_calcs|Garfield calcs]]<br />
* [[CDC_run_985]] [[CDC_run_970]]<br />
<br />
=Minutes=</div>Nsjarvishttps://halldweb1.jlab.org/wiki/index.php?title=FADC_FPGA_Programming_Meetings&diff=63717FADC FPGA Programming Meetings2015-02-16T15:00:04Z<p>Nsjarvis: </p>
<hr />
<div>This series of meetings discusses schedules and requirements for the fADC125 and fADC250 FPGA programming.<br />
<hr><br />
*[[FADC Data Format February 17, 2015| February 17, 2015]]<br />
*[[FADC Data Format February 10, 2015| February 10, 2015]]<br />
*[[FADC Data Format February 3, 2015| February 3, 2015]]<br />
*[[FADC Data Format January 27, 2015| January 27, 2015]]<br />
*[[FADC Data Format January 20, 2015| January 20, 2015]]<br />
*[[FADC Data Format January 13, 2015| January 13, 2015]]<br />
*[[FADC Data Format December 9, 2014| December 9, 2014]]<br />
*[[FADC Data Format November 25, 2014| November 25, 2014]]<br />
*[[FADC Data Format November 11, 2014| November 11, 2014]]<br />
*[[FADC Data Format October 14, 2014| October 14, 2014]]<br />
*[[FADC Data Format October 1, 2014| October 1, 2014]]<br />
*[[FADC Data Format September 16, 2014| September 16, 2014]]<br />
*[[FADC Data Format September 2, 2014| September 2, 2014]]<br />
*[[FADC Data Format August 19, 2014| August 19, 2014]]<br />
*[[FADC Data Format July 22, 2014| July 22, 2014]]<br />
*[[FADC Data Format June 17, 2014| June 17, 2014]]<br />
*[[FADC Data Format May 20, 2014| May 20, 2014]]<br />
*[[FADC Data Format Apr 22, 2014| Apr 22, 2014]]<br />
*[[FADC Data Format Apr 8, 2014| Apr 8, 2014]]<br />
*[[FADC Data Format Mar 25, 2014| Mar 25, 2014]]<br />
*[[FADC Data Format Mar 11, 2014| Mar 11, 2014]]<br />
*[[FADC Data Format Feb 25, 2014| Feb 25, 2014]]<br />
*[[FADC Data Format Feb 11, 2014| Feb 11, 2014]]<br />
*[[FADC Data Format Jan 28, 2014| Jan 28, 2014]]<br />
*[[FADC FPGA Programming Jan 14, 2014| Jan 14, 2014]]<br />
*[[December 17, 2013 Tracking FADC| Dec 17, 2013]]</div>Nsjarvishttps://halldweb1.jlab.org/wiki/index.php?title=CDC_algo&diff=63694CDC algo2015-02-13T18:46:22Z<p>Nsjarvis: </p>
<hr />
<div><h1>CDC time & integral algorithm</h1><br />
<br />
When the trigger signal arrives, the presample buffer contains NP (default value 16) samples for pedestal followed by NW (default 100, possibly up to 155) samples to contain full range of drift time. <br />
<br />
<br />
<h2>Quantities to be returned, if a hit is found</h2><br />
*Leading edge time (11 bits, units of sample/10)<br />
*Time quality factor (1 bit) set to 0 if time is good, 1 if time is rough estimate<br />
*Pedestal immediately before the hit (8 bits, all bits set if value > field max)<br />
*Signal integral (n bits, scaled down by factor 2^m, all bits set if greater than range; n,m are 14,4)<br />
*Signal maximum (p bits, scaled down by factor 2^q; p,q approx 8,2) this is the first maximum in the signal after the threshold crossing<br />
*Overflow count (3 bits, set to 7 if >6)<br />
<br />
<br />
<br />
<h2>Configuration constants (all values are integers, σ=pedestal width ~20)</h2><br />
<br />
*NPED: number of samples in pedestal window (default 16, must be 2**integer)<br />
*WINDOW_START: position in buffer of first sample in hit search window, this is immediately after the pedestal window<br />
*WINDOW_END: position in buffer of last sample in hit search window<br />
*HIT_THRES: threshold to identify hit (default 5σ ~100, range 50 to 300)<br />
*NPED2: number of samples to use to calculate pedestal just before hit (default 16, must be 2**integer)<br />
*NSAMPLES: number of ADC samples in subset to pass to time finding module (default 15)<br />
*XTHR_SAMPLE: position in subset of first sample above hit_threshold (default 9, starts with 0)<br />
*PED_SAMPLE: position in subset of sample to be used as local pedestal (default 5, starts with 0)<br />
<br />
<br />
<br />
<h2>Timing algorithm configuration constants</h2><br />
*HIGH_THRESHOLD: High timing threshold (default 4σ ~ 80, range 40 to 270) must be lower than hit threshold<br />
*LOW_THRESHOLD: Low timing threshold (default 1σ ~ 20, range 5 to 30)<br />
*ROUGH_DT: rough time - if timing fails, return hit time of XTHR_SAMPLE - ROUGH_DT (default 24, units sample/10)<br />
*INT_SAMPLE: if timing fails, start integration with this sample (default 6).<br />
*NUPSAMPLED: number of upsampled values to calculate (default 8, minimum 8)<br />
*LIMIT_PED_MAX: do not calculate accurate time if any of samples 0 to PED_SAMPLE in subset exceeds this (default 511)<br />
*LIMIT_ADC_MAX: do not calculate accurate time if any sample in the subset exceeds this (default 4095)<br />
*SET_ADC_MIN: reduce chances of calculating a negative upsampled value by adding a constant offset to the subset values such that the minimum is equal to SET_ADC_MIN (default 20)<br />
*LIMIT_UPS_ERR: do not calculate accurate time if the sum of the error of the 2 upsampled values exceeds this (default 30)<br />
<br />
<br />
<h2>Hit finding module</h2><br />
<br />
#Calculate start_pedestal as mean of NPED samples from WINDOW_START-NPED-1 to WINDOW_START-1<br />
#Search from WINDOW_START to WINDOW_END for the earliest sample with ADC value >= start_pedestal + HIT_THRES. If not found, go back to sleep. If found, continue, this is sample X.<br />
#Call up time-finding module and send in NSAMPLES ADC values from the hit threshold crossing region, with sample X in position XTHR_SAMPLE (starting at 0)<br />
#Call up signal maximum module<br />
#Call up signal integral module<br />
#Return pedestal_at_hit as mean of NPED2 samples ending with sample number X + PED_SAMPLE - XTHR_SAMPLE, or 255 if pedestal_at_hit > field max<br />
#Return overflow count from integral module<br />
#Return q_code from time module<br />
#Return total integral: sum of contributions from time module and integral module<br />
#Return time = (X - XTHR_SAMPLE)*10 + le_time returned from time module, units are 0.1*sample-period (0.8ns)<br />
<br />
<br />
<br />
<h2>Time finding module</h2><br />
This returns an error code q_code and the leading edge time le_time, in units of sample/10 and relative to the first sample in the subset. The hit time returned falls into one of three categories: an accurate estimate of the leading edge time, where the low threshold crossing time was found using upsampled data, a midpoint time, where the low threshold crossing time was found using sample data, and a rough time estimate, XTHR_SAMPLE*10 - ROUGH_DT. If the time returned is the accurate leading edge time, q_code is set to 0, otherwise it is set to 1. <br />
<br />
#Inspect ADC samples 0 to PED_SAMPLE. If any sample values are 0 or greater than LIMIT_PED_MAX, return the rough time, XTHR_SAMPLE*10 - ROUGH_DT, and q_code=1.<br />
#Inspect ADC samples PED_SAMPLE+1 to NSAMPLES-1. If any sample values are 0 or greater than LIMIT_ADC_MAX, return the rough time and q_code=1. <br />
#Find the minimum sample value in the subset. Subtract a constant offset from all sample values so that the minimum value is now SET_ADC_MIN. This is to decrease the likelihood of calculating any negative upsampled values. <br />
#Calculate the timing thresholds thres_hi = value of sample PED_SAMPLE + HIGH_THRESHOLD and thres_lo = value of sample PED_SAMPLE + LOW_THRESHOLD<br />
#Search the samples from PED_SAMPLE+1 to NSAMPLES-1 for the first sample with value >= thres_hi. If this threshold is not met, return the rough time and q_code=1.<br />
#Search the samples from the first sample with value >= thres_hi down to PED_SAMPLE to find the first sample (Y) with value <= thres_lo<br />
#If Y is > NSAMPLES-7, there are not enough samples to calculate upsampled values, return the rough time and q_code=1.<br />
#Calculate NUPSAMPLED (8) upsampled values, starting with Y-0.2. <br />
#If any upsampled value is negative, return the midpoint time, Y*10+5, and q_code=1.<br />
#Calculate two upsampling errors, as the difference between upsampled point 1 and sample Y, and the difference between upsampled point 6 and sample Y+1<br />
#Sum the errors and compare them with LIMIT_UPS_ERR, if this is exceeded then return the midpoint time, Y*10+5, and q_code=1.<br />
#Calculate the mean of the 2 errors, ups_err and the adjusted threshold, thres_adj = thres_lo + ups_err<br />
#Search the upsampled values from NUPSAMPLED-1 down to 0 to find upsampled point Z where the value <= thres_adj<br />
#If Z=NUPSAMPLED-1 or Z is not found, return the midpoint time, Y*10+5, and q_code=1.<br />
#Interpolate between the upsampled points Z and Z+1 to find the crossing time in units of sample/10 and relative to the first upsampled point<br />
#Calculate the leading edge time, le_time, as the crossing time found in previous step + Y*10-2, in units of sample/10 and relative to subset sample 0<br />
#Return time=le_time and q_code=0<br />
<br />
<br />
<br />
<h2>Signal maximum module</h2><br />
This returns the signal maximum<br />
#Inspect ADC values after sample X, find the first value which is less than its predecessor<br />
#Return value of the predecessor scaled down by 2^p <br />
<br />
<br />
<br />
<h2>Signal integral module</h2><br />
This returns the signal integral and overflow count<br />
#Sum ADC values from sample X to sample WINDOW_END, and count the number of samples with overflow bit set<br />
#Return integral scaled down by 2^m (return all bits set if value exceeds range maximum)<br />
#Return overflow count (return 7 if count>6)<br />
<br />
<br />
<br />
<br />
<br />
<br />
<h1> Error codes from Run 1602 </h1><br />
<br />
<br />
Settings used:<br />
<pre><br />
#define WINDOW_START 46 //earliest sample for start of hit<br />
#define WINDOW_END 130 //last sample for hit arrival, and last sample included in integral<br />
<br />
#define HIT_THRES 300 // "5 sigma" hit threshold *** set this VERY high to cut out persistent noise in a handful of channels ***<br />
#define NPED 16 // number of samples used for pedestal used to find hit. must be 2**integer<br />
#define NPED2 16 // number of samples used for pedestal calculated just before hit (returned, not used here). must be 2**integer<br />
<br />
// cdc_time<br />
#define HIGH_THRESHOLD 80 // 4 sigma threshold<br />
#define LOW_THRESHOLD 20 // 1 sigma threshold<br />
#define ROUGH_DT 24 // if pulse fails QA, return this many tenth-samples before threshold xing<br />
#define INT_SAMPLE 6 // if pulse fails QA, start integration with this sample <br />
<br />
//cdc_time good pulse criteria<br />
#define LIMIT_PED_MAX 511 //return rough time if any sample in 0 to PED_SAMPLE exceeds this<br />
#define LIMIT_ADC_MAX 4095 // return rough time if any sample in PED_SAMPLE+1 to NSAMPLES exceeds this<br />
<br />
// cdc_time upsampling<br />
#define NSAMPLES 15 //number of samples in subset of array to pass to cdc_time<br />
#define XTHR_SAMPLE 9 // the hit_thres xing sample is sample[9] passed into cdc_time, starting with sample[0]<br />
#define PED_SAMPLE 5 // take local ped as sample[5] passed into cdc_time<br />
#define NUPSAMPLED 8 // number of upsampled values to calculate, minimum is 8<br />
#define SET_ADC_MIN 20 // add an offset to the adc values to set the min value equal to SET_ADC_MIN<br />
#define LIMIT_UPS_ERR 30 // upsampling error tolerance, return midpoint time if error is greater than this<br />
</pre><br />
<br />
<br />
==Error codes with faulty channels included==<br />
<br />
Error codes are listed in the order that the event is removed from processing. ADC overflows are not identified by the C++ code as it only looks at Df125WindowRawData.<br />
<br />
{| border="1px" cellpadding="2" style="border-style:solid;"<br />
! q_code !! reason !! entries !! percent of total !! percent of q>0 entries<br />
|-<br />
| 5 || ADC value = 0 || 26458 || 2.3% || 31%<br />
|-<br />
| 6 || ADC value > 4095 || 0 || 0% || 0%<br />
|-<br />
| 7 || Pedestal > 511 || 44830 || 3.9% || 53%<br />
|-<br />
| 1 || ADC data did not go over threshold adc_thres_hi || 576 || 0.050% || 0.6888%<br />
|-<br />
| 2 || Leading edge time is too late in the buffer to upsample || 82 || 0.007% || 0.096%<br />
|-<br />
| 8 || Upsampled value is negative || 15 || 0.001% || 0.018%<br />
|-<br />
| 9 || Upsampling error sum > 30 || 13225 || 1.1% || 16%<br />
|-<br />
| 3 || Last upsampled point is too low (below or equal to low timing threshold) || 28 || 0.002% || 0.033%<br />
|-<br />
| 4 || Upsampled points are too high (did not go below low timing threshold) || 2 || 0.000% || 0.002%<br />
|-<br />
| 0 || Good || 1078072 || 93% || <br />
|}<br />
<br/><br />
<br />
==Error codes with most of faulty channels excluded from data==<br />
<br />
Error codes are listed in the order that the event is removed from processing. ADC overflows are not identified by the C++ code as it only looks at Df125WindowRawData.<br />
<br />
{| border="1px" cellpadding="2" style="border-style:solid;"<br />
! q_code !! reason !! entries !! percent of total !! percent of q>0 entries<br />
|-<br />
| 5 || ADC value = 0 || 26433 || 2.3% || 31%<br />
|-<br />
| 6 || ADC value > 4095 || 0 || 0% || 0%<br />
|-<br />
| 7 || Pedestal > 511 || 44747 || 3.9% || 53%<br />
|-<br />
| 1 || ADC data did not go over threshold adc_thres_hi || 575 || 0.050% || 0.68%<br />
|-<br />
| 2 || Leading edge time is too late in the buffer to upsample || 82 || 0.007% || 0.096%<br />
|-<br />
| 8 || Upsampled value is negative || 0 || 0% || 0%<br />
|-<br />
| 9 || Upsampling error sum > 30 || 13188 || 1.2% || 16%<br />
|-<br />
| 3 || Last upsampled point is too low (below or equal to low timing threshold) || 2 || 0.000% || 0.002%<br />
|-<br />
| 4 || Upsampled points are too high (did not go below low timing threshold) || 0 || 0% || 0%<br />
|-<br />
| 0 || Good || 1075754 || 93% || <br />
|}<br />
<br/><br />
<br />
==Error codes with faulty channels included, mimicked overflow detection in C++ code==<br />
The C++ code is not finding overflows because it is only using Df125WindowRawData; overflows are in a different branch of DAQTree.<br />
The VHDL code will be able to find overflows by testing for sample value > 4095 because the overflow bit is passed in as a 13th sample value bit (bits 0-11 are the ADC value), so samples with the overflow bit set will have value > 4095. This was mimicked in the C++ code by testing for ADC value > 4094.<br />
<pre><br />
#define LIMIT_ADC_MAX 4094 // return rough time if any sample in PED_SAMPLE+1 to NSAMPLES exceeds this<br />
</pre><br />
<br />
{| border="1px" cellpadding="2" style="border-style:solid;"<br />
! q_code !! reason !! entries !! percent of total !! percent of q>0 entries<br />
|-<br />
| 5 || ADC value = 0 || 52559 || 3.9% || 25%<br />
|-<br />
| 6 || ADC value > 4094 || 97939 || 7.2% || 46%<br />
|-<br />
| 7 || Pedestal > 511 || 51244 || 3.8% || 24%<br />
|-<br />
| 1 || ADC data did not go over threshold adc_thres_hi || 9787 || 0.72% || 4.6%<br />
|-<br />
| 2 || Leading edge time is too late in the buffer to upsample || 700 || 0.051% || 0.33%<br />
|-<br />
| 8 || Upsampled value is negative || 15 || 0.001% || 0.007%<br />
|-<br />
| 9 || Upsampling error sum > 30 || 61 || 0.004% || 0.029%<br />
|-<br />
| 3 || Last upsampled point is too low (below or equal to low timing threshold) || 813 || 0.060% || 0.38%<br />
|-<br />
| 4 || Upsampled points are too high (did not go below low timing threshold) || 8 || 0.001% || 0.004%<br />
|-<br />
| 0 || Good || 1148835 || 84% || <br />
|}<br />
<br />
<br />
<br />
<br />
==Examples, in order of q code population (click image twice to expand)==<br />
<br />
=== Q=0, good ===<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_run1602_e0q0.png.png|thumb|x200px|entry 0 q 0]]<br />
|[[Image:cdc_run1602_e1q0.png.png|thumb|x200px|entry 1 q 0]]<br />
|[[Image:cdc_run1602_e2q0.png.png|thumb|x200px|entry 2 q 0]]<br />
|[[Image:cdc_run1602_e3q0.png.png|thumb|x200px|entry 3 q 0]]<br />
|}<br />
<br />
=== Q=6, overflow ===<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_run1602_e7q6.png.png|thumb|x200px|entry 7 q 6]]<br />
|[[Image:cdc_run1602_e8q6.png.png|thumb|x200px|entry 8 q 6]]<br />
|[[Image:cdc_run1602_e9q6.png.png|thumb|x200px|entry 9 q 6]]<br />
|[[Image:cdc_run1602_e16q6.png.png|thumb|x200px|entry 16 q 6]]<br />
|}<br />
<br />
=== Q=5, ADC value=0 ===<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_run1602_e51q5.png.png|thumb|x200px|entry 51 q 5]]<br />
|[[Image:cdc_run1602_e120q5.png.png|thumb|x200px|entry 120 q 5]]<br />
|[[Image:cdc_run1602_e125q5.png.png|thumb|x200px|entry 125 q 5]]<br />
|[[Image:cdc_run1602_e198q5.png.png|thumb|x200px|entry 198 q 5]]<br />
|}<br />
<br />
=== Q=7, Pedestal>511 ===<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_run1602_e6q7.png.png|thumb|x200px|entry 6 q 7]]<br />
|[[Image:cdc_run1602_e21q7.png.png|thumb|x200px|entry 21 q 7]]<br />
|[[Image:cdc_run1602_e23q7.png.png|thumb|x200px|entry 23 q 7]]<br />
|[[Image:cdc_run1602_e24q7.png.png|thumb|x200px|entry 24 q 7]]<br />
|}<br />
<br />
=== Q=1, ADC data<ADC_subset_value[PED_SAMPLE] + HIGH_THRESHOLD===<br />
<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_run1602_e15q1.png.png|thumb|x200px|entry 15 q 1]]<br />
|[[Image:cdc_run1602_e91q1.png.png|thumb|x200px|entry 91 q 1]]<br />
|[[Image:cdc_run1602_e165q1.png.png|thumb|x200px|entry 165 q 1]]<br />
|[[Image:cdc_run1602_e179q1.png.png|thumb|x200px|entry 179 q 1]]<br />
|}<br />
<br />
=== Q=3, last upsampled point is too low (very rare with fully functioning fADCs) ===<br />
<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_run1602_e4073q3.png.png|thumb|x200px|entry 4073 q 3]]<br />
|[[Image:cdc_run1602_e5548q3.png.png|thumb|x200px|entry 5548 q 3]]<br />
|[[Image:cdc_run1602_e8618q3.png.png|thumb|x200px|entry 8618 q 3]]<br />
|[[Image:cdc_run1602_e9358q3.png.png|thumb|x200px|entry 9358 q 3]]<br />
|}<br />
<br />
=== Q=2, leading edge time too late to upsample (very rare with fully functioning fADCs) ===<br />
<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_run1602_e2091q2.png.png|thumb|x200px|entry 2091 q 2]]<br />
|[[Image:cdc_run1602_e3950q2.png.png|thumb|x200px|entry 3950 q 2]]<br />
|[[Image:cdc_run1602_e6905q2.png.png|thumb|x200px|entry 6905 q 2]]<br />
|[[Image:cdc_run1602_e9876q2.png.png|thumb|x200px|entry 9876 q 2]]<br />
|}<br />
<br />
=== Q=8, calculated an upsampled value < 0 (very rare with fully functioning fADCs) ===<br />
<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_run1602_e4284q8.png|thumb|x200px|entry 4284 q 8]]<br />
|[[Image:cdc_run1602_e99090q8.png|thumb|x200px|entry 99090 q 8]]<br />
|[[Image:cdc_run1602_e251941q8.png|thumb|x200px|entry 251941 q 8]]<br />
|[[Image:cdc_run1602_e544903q8.png|thumb|x200px|entry 544903 q 8]]<br />
|}<br />
<br />
=== Q=4, upsampled values too high (very rare with fully functioning fADCs) ===<br />
<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_run1602_e16257q4.png|thumb|x200px|entry 16257 q 4]]<br />
|[[Image:cdc_run1602_e74085q4.png|thumb|x200px|entry 74085 q 4]]<br />
|[[Image:cdc_run1602_e205536q4.png|thumb|x200px|entry 205536 q 4]]<br />
|[[Image:cdc_run1602_e256051q4.png|thumb|x200px|entry 256051 q 4]]<br />
|}<br />
<br />
==Upsampled data - old example==<br />
<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_upsampled2.png|thumb|x250px|ADC samples in (big circles) and upsampled data out (small blue dots) ]]<br />
|[[Image:cdc_upsampled2_front.png|thumb|x250px|ADC samples in (big circles) and upsampled data out (small blue dots) ]]<br />
|[[Image:cdc_upsampled2_middle.png|thumb|x250px|ADC samples in (big circles) and upsampled data out (small blue dots) ]]<br />
|}<br />
<br />
== Upsampling error check prior to error correction - copied from [[CDC_run_1280_bad_events]]==<br />
<br />
After excluding known [[CDC_bad_channels]] I compared the upsampled data with the original samples for the first 10000 events of run 1602. This is a high-intensity run so some of the pedestals are lower than they should be. <br />
<br/><br />
ups_err1 is the upsampled value iubuf[1] - the original sample adc[adc_sample_lo]<br />
<br/><br />
ups_err2 is the upsampled value iubuf[6] - the original sample adc[adc_sample_lo+1]<br />
<br/><br />
<pre><br />
q_code list:<br />
0: Good<br />
1: ADC data did not go over threshold adc_thres_hi <br />
2: Leading edge time is outside the upsampled region (cross adc_thres_lo too late in the buffer subset ) <br />
3: Last upsampled point is <= low timing threshold<br />
4: Upsampled points did not go below low timing threshold<br />
</pre><br />
Looking at upsampling errors - occur when gradient is very large<br />
<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_adcq0.png|thumb|x200px|ADC sample subset for q code 0 ]]<br />
|[[Image:cdc_adcq4.png|thumb|x200px|ADC sample subset for q code 4]]<br />
|[[Image:cdc_adcq4b.png|thumb|x200px|ADC sample subset for q code 4, normalised to min value]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|[[Image:uerr1_q4.png|thumb|x200px|Error in upsampled value vs original sample value adc_sample_lo, q code 4]]<br />
|[[Image:uerr2_q4.png|thumb|x200px|Error in upsampled value vs original sample value adc_sample_lo+1, q code 4]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|[[Image:ue2e1q0.png|thumb|x200px|Error in upsampled values, q code 0]]<br />
|[[Image:ue2e1q4.png|thumb|x200px|Error in upsampled values, q code 4]]<br />
|[[Image:uediffq0.png|thumb|x200px|Difference in error in upsampled values, q code 0 (blue) and 4 (pink)]]<br />
|}<br />
<br />
Following this the error correction step was added to the algorithm, where the sum of errors ups_err1+ups_err2 is calculated and compared with LIMIT_UPS_ERR and then, if below this limit, halved (to calculate the mean) and subtracted from the upsampled data. The corrected upsampled points are the green circles in the 'example of Q code' plots above.</div>Nsjarvishttps://halldweb1.jlab.org/wiki/index.php?title=FADC_Data_Format_February_10,_2015&diff=63554FADC Data Format February 10, 20152015-02-10T20:55:40Z<p>Nsjarvis: /* Minutes */</p>
<hr />
<div>= Location and Time =<br />
<br />
'''Room:''' CC L207<br />
<br />
'''Time:''' 2pm.<br />
<br />
= Remote Connection =<br />
(if problems, call phone in conference room: 757-269-6460 might not be the correct number)<br />
# To join via Polycom room system go to the IP Address: 199.48.152.152 ([http://bjn.vc bjn.vc]) and enter the meeting ID: 589693655.<br />
# To join via a Web Browser, go to the page [https://bluejeans.com/589693655] https://bluejeans.com/589693655.<br />
# To join via phone, use one of the following numbers and the Conference ID: 589693655<br />
#* US or Canada: +1 408 740 7256 or <br />
#* US or Canada: +1 888 240 2560<br />
<br />
[[Connect to the Data Challenge Meetings|More information on connecting to bluejeans is here]]<br />
<br />
Specific instructions for connecting via polycom:<br />
<br />
* Turn polycom on if necessary <br />
* With the polycom, place a call at 199.48.152.152<br />
* Press # to enable the polycom keypad, then enter the meeting id: 589693655 and #<br />
* You may have to unmute the microphone: #*4<br />
* Turn the computer on if needed<br />
<br />
= Agenda =<br />
* [[FADC_Data_Format_February_3,_2015|Previous meeting (Feb 3, 2015)]]<br />
* Status of FADC125 Firmware<br />
<br />
<br />
== Useful Links ==<br />
* [[CDC_algo|Timing algorithm - updated to include latest revisions]]<br />
* [http://argus.phys.uregina.ca/cgi-bin/private/DocDB/ShowDocument?docid=2274 fADC125 Data Format Specification Document]<br />
* [[:File:FADC125_dataformat_250_modes.docx|Data format for 250 modes on fADC125 from Cody, Aug 15 2014]]<br />
* [[:File:FADC250_modes_2.docx|FA250 modes 2 from Ed and Hai, Feb 18 2014]]<br />
* [[:File:FADC250_V2_ADC_FPGA_V90D.docx|FIRMWARE for FADC250 Ver2 ADC FPGA, Sept 2014?]]<br />
* [http://www.jlab.org/Hall-D/detector/fdc/FDC_pulse_data_format.pptx FDC_pulse_data_format]<br />
* [[CDC_readout_requirements|CDC readout needs]] [[CDC_garfield_calcs|Garfield calcs]]<br />
* [[CDC_run_985]] [[CDC_run_970]]<br />
<br />
=Minutes=<br />
Present: Naomi (CMU), Cody, Beni, Sergey (JLab)<br />
<br />
#Cody has been testing the firmware with a pulser to find the minimum time between triggers with which the 250-modified firmware can be used successfully. He has been testing this with trigger pulse at constant rate and increasing that rate and monitoring for errors. The problems occur in multiblock mode (this is with more than 1 event per block) when two triggers occur too close together and the second trigger arrives before the fadc is ready to be read out; it gives a block error but its buffer is not emptied and after the next trigger it reads out the old data in the buffer; from then on the data are out of sync with the data read out from the other modules, and the whole block has to be discarded. <br />
#He has found that in mode 8, with 200 samples, the firmware is good at rates up to 5kHz, and with mode 7, 200 samples, it is good for rates up to 34 kHz. This was with NSA=2, NSB=15. Next he will try NSA=5, NSB=60.<br />
#David has ported the new firmware timing algorithm into the analysis library. Naomi will try it out.<br />
#Naomi suggested giving the new firmware's time module a time limit - we know the max number of clock cycles that it should use, if it takes more than this then something is wrong. She has not found any example pulses which would cause this.<br />
#We talked about the error conditions returned by the time module, including some rare conditions caused by faulty fADCs.</div>Nsjarvishttps://halldweb1.jlab.org/wiki/index.php?title=FADC_Data_Format_February_10,_2015&diff=63553FADC Data Format February 10, 20152015-02-10T20:55:04Z<p>Nsjarvis: /* Minutes */</p>
<hr />
<div>= Location and Time =<br />
<br />
'''Room:''' CC L207<br />
<br />
'''Time:''' 2pm.<br />
<br />
= Remote Connection =<br />
(if problems, call phone in conference room: 757-269-6460 might not be the correct number)<br />
# To join via Polycom room system go to the IP Address: 199.48.152.152 ([http://bjn.vc bjn.vc]) and enter the meeting ID: 589693655.<br />
# To join via a Web Browser, go to the page [https://bluejeans.com/589693655] https://bluejeans.com/589693655.<br />
# To join via phone, use one of the following numbers and the Conference ID: 589693655<br />
#* US or Canada: +1 408 740 7256 or <br />
#* US or Canada: +1 888 240 2560<br />
<br />
[[Connect to the Data Challenge Meetings|More information on connecting to bluejeans is here]]<br />
<br />
Specific instructions for connecting via polycom:<br />
<br />
* Turn polycom on if necessary <br />
* With the polycom, place a call at 199.48.152.152<br />
* Press # to enable the polycom keypad, then enter the meeting id: 589693655 and #<br />
* You may have to unmute the microphone: #*4<br />
* Turn the computer on if needed<br />
<br />
= Agenda =<br />
* [[FADC_Data_Format_February_3,_2015|Previous meeting (Feb 3, 2015)]]<br />
* Status of FADC125 Firmware<br />
<br />
<br />
== Useful Links ==<br />
* [[CDC_algo|Timing algorithm - updated to include latest revisions]]<br />
* [http://argus.phys.uregina.ca/cgi-bin/private/DocDB/ShowDocument?docid=2274 fADC125 Data Format Specification Document]<br />
* [[:File:FADC125_dataformat_250_modes.docx|Data format for 250 modes on fADC125 from Cody, Aug 15 2014]]<br />
* [[:File:FADC250_modes_2.docx|FA250 modes 2 from Ed and Hai, Feb 18 2014]]<br />
* [[:File:FADC250_V2_ADC_FPGA_V90D.docx|FIRMWARE for FADC250 Ver2 ADC FPGA, Sept 2014?]]<br />
* [http://www.jlab.org/Hall-D/detector/fdc/FDC_pulse_data_format.pptx FDC_pulse_data_format]<br />
* [[CDC_readout_requirements|CDC readout needs]] [[CDC_garfield_calcs|Garfield calcs]]<br />
* [[CDC_run_985]] [[CDC_run_970]]<br />
<br />
=Minutes=<br />
Present: Naomi (CMU), Cody, Beni, Sergey (JLab)<br />
<br />
#Cody has been testing the firmware with a pulser to find the minimum time between triggers with which the 250-modified firmware can be used successfully. He has been testing this with trigger pulse at constant rate and increasing that rate and monitoring for errors. The problems occur in multiblock mode (this is with more than 1 event per block) when two triggers occur too close together and the second trigger arrives before the fadc is ready to be read out; it gives a block error but its buffer is not emptied and after the next trigger it reads out the old data in the buffer; from then on the events are out of sync and the whole block has to be discarded. <br />
#He has found that in mode 8, with 200 samples, the firmware is good at rates up to 5kHz, and with mode 7, 200 samples, it is good for rates up to 34 kHz. This was with NSA=2, NSB=15. Next he will try NSA=5, NSB=60.<br />
#David has ported the new firmware timing algorithm into the analysis library. Naomi will try it out.<br />
#Naomi suggested giving the new firmware's time module a time limit - we know the max number of clock cycles that it should use, if it takes more than this then something is wrong. She has not found any example pulses which would cause this.<br />
#We talked about the error conditions returned by the time module, including some rare conditions caused by faulty fADCs.</div>Nsjarvishttps://halldweb1.jlab.org/wiki/index.php?title=FADC_Data_Format_February_10,_2015&diff=63552FADC Data Format February 10, 20152015-02-10T20:53:51Z<p>Nsjarvis: /* Minutes */</p>
<hr />
<div>= Location and Time =<br />
<br />
'''Room:''' CC L207<br />
<br />
'''Time:''' 2pm.<br />
<br />
= Remote Connection =<br />
(if problems, call phone in conference room: 757-269-6460 might not be the correct number)<br />
# To join via Polycom room system go to the IP Address: 199.48.152.152 ([http://bjn.vc bjn.vc]) and enter the meeting ID: 589693655.<br />
# To join via a Web Browser, go to the page [https://bluejeans.com/589693655] https://bluejeans.com/589693655.<br />
# To join via phone, use one of the following numbers and the Conference ID: 589693655<br />
#* US or Canada: +1 408 740 7256 or <br />
#* US or Canada: +1 888 240 2560<br />
<br />
[[Connect to the Data Challenge Meetings|More information on connecting to bluejeans is here]]<br />
<br />
Specific instructions for connecting via polycom:<br />
<br />
* Turn polycom on if necessary <br />
* With the polycom, place a call at 199.48.152.152<br />
* Press # to enable the polycom keypad, then enter the meeting id: 589693655 and #<br />
* You may have to unmute the microphone: #*4<br />
* Turn the computer on if needed<br />
<br />
= Agenda =<br />
* [[FADC_Data_Format_February_3,_2015|Previous meeting (Feb 3, 2015)]]<br />
* Status of FADC125 Firmware<br />
<br />
<br />
== Useful Links ==<br />
* [[CDC_algo|Timing algorithm - updated to include latest revisions]]<br />
* [http://argus.phys.uregina.ca/cgi-bin/private/DocDB/ShowDocument?docid=2274 fADC125 Data Format Specification Document]<br />
* [[:File:FADC125_dataformat_250_modes.docx|Data format for 250 modes on fADC125 from Cody, Aug 15 2014]]<br />
* [[:File:FADC250_modes_2.docx|FA250 modes 2 from Ed and Hai, Feb 18 2014]]<br />
* [[:File:FADC250_V2_ADC_FPGA_V90D.docx|FIRMWARE for FADC250 Ver2 ADC FPGA, Sept 2014?]]<br />
* [http://www.jlab.org/Hall-D/detector/fdc/FDC_pulse_data_format.pptx FDC_pulse_data_format]<br />
* [[CDC_readout_requirements|CDC readout needs]] [[CDC_garfield_calcs|Garfield calcs]]<br />
* [[CDC_run_985]] [[CDC_run_970]]<br />
<br />
=Minutes=<br />
Present: Naomi (CMU), Cody, Beni, Sergey (JLab)<br />
<br />
#Cody has been testing the firmware with a pulser to find the minimum time between triggers with which the 250-modified firmware can be used successfully. He has been testing this with trigger pulse at constant rate and increasing that rate and monitoring for errors. The problems occur in multiblock mode (this is with more than 1 event per block) when two triggers occur too close together, the fadc is not ready to be read out, it gives a block error but the buffer is not emptied, the next event reads out the old data in the buffer from then on the events are out of sync and the whole block has to be discarded. <br />
#He has found that in mode 8, with 200 samples, the firmware is good at rates up to 5kHz, and with mode 7, 200 samples, it is good for rates up to 34 kHz. This was with NSA=2, NSB=15. Next he will try NSA=5, NSB=60.<br />
#David has ported the new firmware timing algorithm into the analysis library. Naomi will try it out.<br />
#Naomi suggested giving the new firmware's time module a time limit - we know the max number of clock cycles that it should use, if it takes more than this then something is wrong. She has not found any example pulses which would cause this.<br />
#We talked about the error conditions returned by the time module, including some rare conditions caused by faulty fADCs.</div>Nsjarvishttps://halldweb1.jlab.org/wiki/index.php?title=FADC_Data_Format_February_10,_2015&diff=63551FADC Data Format February 10, 20152015-02-10T20:49:12Z<p>Nsjarvis: /* Minutes */</p>
<hr />
<div>= Location and Time =<br />
<br />
'''Room:''' CC L207<br />
<br />
'''Time:''' 2pm.<br />
<br />
= Remote Connection =<br />
(if problems, call phone in conference room: 757-269-6460 might not be the correct number)<br />
# To join via Polycom room system go to the IP Address: 199.48.152.152 ([http://bjn.vc bjn.vc]) and enter the meeting ID: 589693655.<br />
# To join via a Web Browser, go to the page [https://bluejeans.com/589693655] https://bluejeans.com/589693655.<br />
# To join via phone, use one of the following numbers and the Conference ID: 589693655<br />
#* US or Canada: +1 408 740 7256 or <br />
#* US or Canada: +1 888 240 2560<br />
<br />
[[Connect to the Data Challenge Meetings|More information on connecting to bluejeans is here]]<br />
<br />
Specific instructions for connecting via polycom:<br />
<br />
* Turn polycom on if necessary <br />
* With the polycom, place a call at 199.48.152.152<br />
* Press # to enable the polycom keypad, then enter the meeting id: 589693655 and #<br />
* You may have to unmute the microphone: #*4<br />
* Turn the computer on if needed<br />
<br />
= Agenda =<br />
* [[FADC_Data_Format_February_3,_2015|Previous meeting (Feb 3, 2015)]]<br />
* Status of FADC125 Firmware<br />
<br />
<br />
== Useful Links ==<br />
* [[CDC_algo|Timing algorithm - updated to include latest revisions]]<br />
* [http://argus.phys.uregina.ca/cgi-bin/private/DocDB/ShowDocument?docid=2274 fADC125 Data Format Specification Document]<br />
* [[:File:FADC125_dataformat_250_modes.docx|Data format for 250 modes on fADC125 from Cody, Aug 15 2014]]<br />
* [[:File:FADC250_modes_2.docx|FA250 modes 2 from Ed and Hai, Feb 18 2014]]<br />
* [[:File:FADC250_V2_ADC_FPGA_V90D.docx|FIRMWARE for FADC250 Ver2 ADC FPGA, Sept 2014?]]<br />
* [http://www.jlab.org/Hall-D/detector/fdc/FDC_pulse_data_format.pptx FDC_pulse_data_format]<br />
* [[CDC_readout_requirements|CDC readout needs]] [[CDC_garfield_calcs|Garfield calcs]]<br />
* [[CDC_run_985]] [[CDC_run_970]]<br />
<br />
=Minutes=<br />
Present: Naomi (CMU), Cody, Beni, Sergey (JLab)<br />
<br />
#Cody has been testing the firmware with a pulser to find the maximum trigger rate before the firmware runs into trouble. The problems are in multiblock mode (this is with more than 1 event per block) when two triggers occur too close together, the fadc is not ready to be read out, it gives a block error but the buffer is not emptied, the next event reads out the old data in the buffer from then on the events are out of sync and the whole block has to be discarded. <br />
#He has found that in mode 8, with 200 samples, the firmware is good at rates up to 5kHz, and with mode 7, 200 samples, it is good for rates up to 34 kHz. This was with NSA=2, NSB=15. Next he will try NSA=5, NSB=60.<br />
#David has ported the new firmware timing algorithm into the analysis library. Naomi will try it out.<br />
#Naomi suggested giving the new firmware's time module a time limit - we know the max number of clock cycles that it should use, if it takes more than this then something is wrong. She has not found any example pulses which would cause this.<br />
#We talked about the error conditions returned by the time module, including some rare conditions caused by faulty fADCs.</div>Nsjarvishttps://halldweb1.jlab.org/wiki/index.php?title=CDC_algo&diff=63546CDC algo2015-02-10T13:57:12Z<p>Nsjarvis: /* Error codes with most of faulty channels excluded from data */</p>
<hr />
<div><h1>CDC time & integral algorithm</h1><br />
<br />
When the trigger signal arrives, the presample buffer contains NP (default value 16) samples for pedestal followed by NW (default 100, possibly up to 155) samples to contain full range of drift time. <br />
<br />
<br />
<h2>Quantities to be returned, if a hit is found</h2><br />
*Leading edge time (11 bits, units of sample/10)<br />
*Time quality factor (1 bit) set to 0 if time is good, 1 if time is rough estimate<br />
*Pedestal immediately before the hit (8 bits, all bits set if value > field max)<br />
*Signal integral (n bits, scaled down by factor 2^m, all bits set if greater than range; n,m are 14,4)<br />
*Signal maximum (p bits, scaled down by factor 2^q; p,q approx 8,2) this is the first maximum in the signal after the threshold crossing<br />
*Overflow count (3 bits, set to 7 if >6)<br />
<br />
<br />
<br />
<h2>Configuration constants (all values are integers, σ=pedestal width ~20)</h2><br />
<br />
*NPED: number of samples in pedestal window (default 16, must be 2**integer)<br />
*WINDOW_START: position in buffer of first sample in hit search window, this is immediately after the pedestal window<br />
*WINDOW_END: position in buffer of last sample in hit search window<br />
*HIT_THRES: threshold to identify hit (default 5σ ~100, range 50 to 300)<br />
*NPED2: number of samples to use to calculate pedestal just before hit (default 16, must be 2**integer)<br />
*NSAMPLES: number of ADC samples in subset to pass to time finding module (default 15)<br />
*XTHR_SAMPLE: position in subset of first sample above hit_threshold (default 9, starts with 0)<br />
*PED_SAMPLE: position in subset of sample to be used as local pedestal (default 5, starts with 0)<br />
<br />
<br />
<br />
<h2>Timing algorithm configuration constants</h2><br />
*HIGH_THRESHOLD: High timing threshold (default 4σ ~ 80, range 40 to 270) must be lower than hit threshold<br />
*LOW_THRESHOLD: Low timing threshold (default 1σ ~ 20, range 5 to 30)<br />
*ROUGH_DT: rough time - if timing fails, return hit time of XTHR_SAMPLE - ROUGH_DT (default 24, units sample/10)<br />
*INT_SAMPLE: if timing fails, start integration with this sample (default 6).<br />
*NUPSAMPLED: number of upsampled values to calculate (default 8, minimum 8)<br />
*LIMIT_PED_MAX: do not calculate accurate time if any of samples 0 to PED_SAMPLE in subset exceeds this (default 511)<br />
*LIMIT_ADC_MAX: do not calculate accurate time if any sample in the subset exceeds this (default 4095)<br />
*SET_ADC_MIN: reduce chances of calculating a negative upsampled value by adding a constant offset to the subset values such that the minimum is equal to SET_ADC_MIN (default 20)<br />
*LIMIT_UPS_ERR: do not calculate accurate time if the sum of the error of the 2 upsampled values exceeds this (default 30)<br />
<br />
<br />
<h2>Hit finding module</h2><br />
<br />
#Calculate start_pedestal as mean of NPED samples from WINDOW_START-NPED-1 to WINDOW_START-1<br />
#Search from WINDOW_START to WINDOW_END for the earliest sample with ADC value >= start_pedestal + HIT_THRES. If not found, go back to sleep. If found, continue, this is sample X.<br />
#Call up time-finding module and send in NSAMPLES ADC values from the hit threshold crossing region, with sample X in position XTHR_SAMPLE (starting at 0)<br />
#Call up signal maximum module<br />
#Call up signal integral module<br />
#Return pedestal_at_hit as mean of NPED2 samples ending with sample number X + PED_SAMPLE - XTHR_SAMPLE, or 255 if pedestal_at_hit > field max<br />
#Return overflow count from integral module<br />
#Return q_code from time module<br />
#Return total integral: sum of contributions from time module and integral module<br />
#Return time = (X - XTHR_SAMPLE)*10 + le_time returned from time module, units are 0.1*sample-period (0.8ns)<br />
<br />
<br />
<br />
<h2>Time finding module</h2><br />
This returns an error code q_code and the leading edge time le_time, in units of sample/10 and relative to the first sample in the subset. The hit time returned falls into one of three categories: an accurate estimate of the leading edge time, where the low threshold crossing time was found using upsampled data, a midpoint time, where the low threshold crossing time was found using sample data, and a rough time estimate, XTHR_SAMPLE*10 - ROUGH_DT. If the time returned is the accurate leading edge time, q_code is set to 0, otherwise it is set to 1. <br />
<br />
#Inspect ADC samples 0 to PED_SAMPLE. If any sample values are 0 or greater than LIMIT_PED_MAX, return the rough time, XTHR_SAMPLE*10 - ROUGH_DT, and q_code=1.<br />
#Inspect ADC samples PED_SAMPLE+1 to NSAMPLES-1. If any sample values are 0 or greater than LIMIT_ADC_MAX, return the rough time and q_code=1. <br />
#Find the minimum sample value in the subset. Subtract a constant offset from all sample values so that the minimum value is now SET_ADC_MIN. This is to decrease the likelihood of calculating any negative upsampled values. <br />
#Calculate the timing thresholds thres_hi = value of sample PED_SAMPLE + HIGH_THRESHOLD and thres_lo = value of sample PED_SAMPLE + LOW_THRESHOLD<br />
#Search the samples from PED_SAMPLE+1 to NSAMPLES-1 for the first sample with value >= thres_hi. If this threshold is not met, return the rough time and q_code=1.<br />
#Search the samples from the first sample with value >= thres_hi down to PED_SAMPLE to find the first sample (Y) with value <= thres_lo<br />
#If Y is > NSAMPLES-7, there are not enough samples to calculate upsampled values, return the rough time and q_code=1.<br />
#Calculate NUPSAMPLED (8) upsampled values, starting with Y-0.2. <br />
#If any upsampled value is negative, return the midpoint time, Y*10+5, and q_code=1.<br />
#Calculate two upsampling errors, as the difference between upsampled point 1 and sample Y, and the difference between upsampled point 2 and sample Y+1<br />
#Sum the errors and compare them with LIMIT_UPS_ERR, if this is exceeded then return the midpoint time, Y*10+5, and q_code=1.<br />
#Calculate the mean of the 2 errors, ups_err and the adjusted threshold, thres_adj = thres_lo + ups_err<br />
#Search the upsampled values from NUPSAMPLED-1 down to 0 to find upsampled point Z where the value <= thres_adj<br />
#If Z=NUPSAMPLED-1 or Z is not found, return the midpoint time, Y*10+5, and q_code=1.<br />
#Interpolate between the upsampled points Z and Z+1 to find the crossing time in units of sample/10 and relative to the first upsampled point<br />
#Calculate the leading edge time, le_time, as the crossing time found in previous step + Y*10-2, in units of sample/10 and relative to subset sample 0<br />
#Return time=le_time and q_code=0<br />
<br />
<br />
<br />
<h2>Signal maximum module</h2><br />
This returns the signal maximum<br />
#Inspect ADC values after sample X, find the first value which is less than its predecessor<br />
#Return value of the predecessor scaled down by 2^p <br />
<br />
<br />
<br />
<h2>Signal integral module</h2><br />
This returns the signal integral and overflow count<br />
#Sum ADC values from sample X to sample WINDOW_END, and count the number of samples with overflow bit set<br />
#Return integral scaled down by 2^m (return all bits set if value exceeds range maximum)<br />
#Return overflow count (return 7 if count>6)<br />
<br />
<br />
<br />
<br />
<br />
<br />
<h1> Error codes from Run 1602 </h1><br />
<br />
<br />
Settings used:<br />
<pre><br />
#define WINDOW_START 46 //earliest sample for start of hit<br />
#define WINDOW_END 130 //last sample for hit arrival, and last sample included in integral<br />
<br />
#define HIT_THRES 300 // "5 sigma" hit threshold *** set this VERY high to cut out persistent noise in a handful of channels ***<br />
#define NPED 16 // number of samples used for pedestal used to find hit. must be 2**integer<br />
#define NPED2 16 // number of samples used for pedestal calculated just before hit (returned, not used here). must be 2**integer<br />
<br />
// cdc_time<br />
#define HIGH_THRESHOLD 80 // 4 sigma threshold<br />
#define LOW_THRESHOLD 20 // 1 sigma threshold<br />
#define ROUGH_DT 24 // if pulse fails QA, return this many tenth-samples before threshold xing<br />
#define INT_SAMPLE 6 // if pulse fails QA, start integration with this sample <br />
<br />
//cdc_time good pulse criteria<br />
#define LIMIT_PED_MAX 511 //return rough time if any sample in 0 to PED_SAMPLE exceeds this<br />
#define LIMIT_ADC_MAX 4095 // return rough time if any sample in PED_SAMPLE+1 to NSAMPLES exceeds this<br />
<br />
// cdc_time upsampling<br />
#define NSAMPLES 15 //number of samples in subset of array to pass to cdc_time<br />
#define XTHR_SAMPLE 9 // the hit_thres xing sample is sample[9] passed into cdc_time, starting with sample[0]<br />
#define PED_SAMPLE 5 // take local ped as sample[5] passed into cdc_time<br />
#define NUPSAMPLED 8 // number of upsampled values to calculate, minimum is 8<br />
#define SET_ADC_MIN 20 // add an offset to the adc values to set the min value equal to SET_ADC_MIN<br />
#define LIMIT_UPS_ERR 30 // upsampling error tolerance, return midpoint time if error is greater than this<br />
</pre><br />
<br />
<br />
==Error codes with faulty channels included==<br />
<br />
Error codes are listed in the order that the event is removed from processing. ADC overflows are not identified by the C++ code as it only looks at Df125WindowRawData.<br />
<br />
{| border="1px" cellpadding="2" style="border-style:solid;"<br />
! q_code !! reason !! entries !! percent of total !! percent of q>0 entries<br />
|-<br />
| 5 || ADC value = 0 || 26458 || 2.3% || 31%<br />
|-<br />
| 6 || ADC value > 4095 || 0 || 0% || 0%<br />
|-<br />
| 7 || Pedestal > 511 || 44830 || 3.9% || 53%<br />
|-<br />
| 1 || ADC data did not go over threshold adc_thres_hi || 576 || 0.050% || 0.6888%<br />
|-<br />
| 2 || Leading edge time is too late in the buffer to upsample || 82 || 0.007% || 0.096%<br />
|-<br />
| 8 || Upsampled value is negative || 15 || 0.001% || 0.018%<br />
|-<br />
| 9 || Upsampling error sum > 30 || 13225 || 1.1% || 16%<br />
|-<br />
| 3 || Last upsampled point is too low (below or equal to low timing threshold) || 28 || 0.002% || 0.033%<br />
|-<br />
| 4 || Upsampled points are too high (did not go below low timing threshold) || 2 || 0.000% || 0.002%<br />
|-<br />
| 0 || Good || 1078072 || 93% || <br />
|}<br />
<br/><br />
<br />
==Error codes with most of faulty channels excluded from data==<br />
<br />
Error codes are listed in the order that the event is removed from processing. ADC overflows are not identified by the C++ code as it only looks at Df125WindowRawData.<br />
<br />
{| border="1px" cellpadding="2" style="border-style:solid;"<br />
! q_code !! reason !! entries !! percent of total !! percent of q>0 entries<br />
|-<br />
| 5 || ADC value = 0 || 26433 || 2.3% || 31%<br />
|-<br />
| 6 || ADC value > 4095 || 0 || 0% || 0%<br />
|-<br />
| 7 || Pedestal > 511 || 44747 || 3.9% || 53%<br />
|-<br />
| 1 || ADC data did not go over threshold adc_thres_hi || 575 || 0.050% || 0.68%<br />
|-<br />
| 2 || Leading edge time is too late in the buffer to upsample || 82 || 0.007% || 0.096%<br />
|-<br />
| 8 || Upsampled value is negative || 0 || 0% || 0%<br />
|-<br />
| 9 || Upsampling error sum > 30 || 13188 || 1.2% || 16%<br />
|-<br />
| 3 || Last upsampled point is too low (below or equal to low timing threshold) || 2 || 0.000% || 0.002%<br />
|-<br />
| 4 || Upsampled points are too high (did not go below low timing threshold) || 0 || 0% || 0%<br />
|-<br />
| 0 || Good || 1075754 || 93% || <br />
|}<br />
<br/><br />
<br />
==Error codes with faulty channels included, mimicked overflow detection in C++ code==<br />
The C++ code is not finding overflows because it is only using Df125WindowRawData; overflows are in a different branch of DAQTree.<br />
The VHDL code will be able to find overflows by testing for sample value > 4095 because the overflow bit is passed in as a 13th sample value bit (bits 0-11 are the ADC value), so samples with the overflow bit set will have value > 4095. This was mimicked in the C++ code by testing for ADC value > 4094.<br />
<pre><br />
#define LIMIT_ADC_MAX 4094 // return rough time if any sample in PED_SAMPLE+1 to NSAMPLES exceeds this<br />
</pre><br />
<br />
{| border="1px" cellpadding="2" style="border-style:solid;"<br />
! q_code !! reason !! entries !! percent of total !! percent of q>0 entries<br />
|-<br />
| 5 || ADC value = 0 || 52559 || 3.9% || 25%<br />
|-<br />
| 6 || ADC value > 4094 || 97939 || 7.2% || 46%<br />
|-<br />
| 7 || Pedestal > 511 || 51244 || 3.8% || 24%<br />
|-<br />
| 1 || ADC data did not go over threshold adc_thres_hi || 9787 || 0.72% || 4.6%<br />
|-<br />
| 2 || Leading edge time is too late in the buffer to upsample || 700 || 0.051% || 0.33%<br />
|-<br />
| 8 || Upsampled value is negative || 15 || 0.001% || 0.007%<br />
|-<br />
| 9 || Upsampling error sum > 30 || 61 || 0.004% || 0.029%<br />
|-<br />
| 3 || Last upsampled point is too low (below or equal to low timing threshold) || 813 || 0.060% || 0.38%<br />
|-<br />
| 4 || Upsampled points are too high (did not go below low timing threshold) || 8 || 0.001% || 0.004%<br />
|-<br />
| 0 || Good || 1148835 || 84% || <br />
|}<br />
<br />
<br />
<br />
<br />
==Examples, in order of q code population (click image twice to expand)==<br />
<br />
=== Q=0, good ===<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_run1602_e0q0.png.png|thumb|x200px|entry 0 q 0]]<br />
|[[Image:cdc_run1602_e1q0.png.png|thumb|x200px|entry 1 q 0]]<br />
|[[Image:cdc_run1602_e2q0.png.png|thumb|x200px|entry 2 q 0]]<br />
|[[Image:cdc_run1602_e3q0.png.png|thumb|x200px|entry 3 q 0]]<br />
|}<br />
<br />
=== Q=6, overflow ===<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_run1602_e7q6.png.png|thumb|x200px|entry 7 q 6]]<br />
|[[Image:cdc_run1602_e8q6.png.png|thumb|x200px|entry 8 q 6]]<br />
|[[Image:cdc_run1602_e9q6.png.png|thumb|x200px|entry 9 q 6]]<br />
|[[Image:cdc_run1602_e16q6.png.png|thumb|x200px|entry 16 q 6]]<br />
|}<br />
<br />
=== Q=5, ADC value=0 ===<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_run1602_e51q5.png.png|thumb|x200px|entry 51 q 5]]<br />
|[[Image:cdc_run1602_e120q5.png.png|thumb|x200px|entry 120 q 5]]<br />
|[[Image:cdc_run1602_e125q5.png.png|thumb|x200px|entry 125 q 5]]<br />
|[[Image:cdc_run1602_e198q5.png.png|thumb|x200px|entry 198 q 5]]<br />
|}<br />
<br />
=== Q=7, Pedestal>511 ===<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_run1602_e6q7.png.png|thumb|x200px|entry 6 q 7]]<br />
|[[Image:cdc_run1602_e21q7.png.png|thumb|x200px|entry 21 q 7]]<br />
|[[Image:cdc_run1602_e23q7.png.png|thumb|x200px|entry 23 q 7]]<br />
|[[Image:cdc_run1602_e24q7.png.png|thumb|x200px|entry 24 q 7]]<br />
|}<br />
<br />
=== Q=1, ADC data<ADC_subset_value[PED_SAMPLE] + HIGH_THRESHOLD===<br />
<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_run1602_e15q1.png.png|thumb|x200px|entry 15 q 1]]<br />
|[[Image:cdc_run1602_e91q1.png.png|thumb|x200px|entry 91 q 1]]<br />
|[[Image:cdc_run1602_e165q1.png.png|thumb|x200px|entry 165 q 1]]<br />
|[[Image:cdc_run1602_e179q1.png.png|thumb|x200px|entry 179 q 1]]<br />
|}<br />
<br />
=== Q=3, last upsampled point is too low (very rare with fully functioning fADCs) ===<br />
<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_run1602_e4073q3.png.png|thumb|x200px|entry 4073 q 3]]<br />
|[[Image:cdc_run1602_e5548q3.png.png|thumb|x200px|entry 5548 q 3]]<br />
|[[Image:cdc_run1602_e8618q3.png.png|thumb|x200px|entry 8618 q 3]]<br />
|[[Image:cdc_run1602_e9358q3.png.png|thumb|x200px|entry 9358 q 3]]<br />
|}<br />
<br />
=== Q=2, leading edge time too late to upsample (very rare with fully functioning fADCs) ===<br />
<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_run1602_e2091q2.png.png|thumb|x200px|entry 2091 q 2]]<br />
|[[Image:cdc_run1602_e3950q2.png.png|thumb|x200px|entry 3950 q 2]]<br />
|[[Image:cdc_run1602_e6905q2.png.png|thumb|x200px|entry 6905 q 2]]<br />
|[[Image:cdc_run1602_e9876q2.png.png|thumb|x200px|entry 9876 q 2]]<br />
|}<br />
<br />
=== Q=8, calculated an upsampled value < 0 (very rare with fully functioning fADCs) ===<br />
<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_run1602_e4284q8.png|thumb|x200px|entry 4284 q 8]]<br />
|[[Image:cdc_run1602_e99090q8.png|thumb|x200px|entry 99090 q 8]]<br />
|[[Image:cdc_run1602_e251941q8.png|thumb|x200px|entry 251941 q 8]]<br />
|[[Image:cdc_run1602_e544903q8.png|thumb|x200px|entry 544903 q 8]]<br />
|}<br />
<br />
=== Q=4, upsampled values too high (very rare with fully functioning fADCs) ===<br />
<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_run1602_e16257q4.png|thumb|x200px|entry 16257 q 4]]<br />
|[[Image:cdc_run1602_e74085q4.png|thumb|x200px|entry 74085 q 4]]<br />
|[[Image:cdc_run1602_e205536q4.png|thumb|x200px|entry 205536 q 4]]<br />
|[[Image:cdc_run1602_e256051q4.png|thumb|x200px|entry 256051 q 4]]<br />
|}<br />
<br />
==Upsampled data - old example==<br />
<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_upsampled2.png|thumb|x250px|ADC samples in (big circles) and upsampled data out (small blue dots) ]]<br />
|[[Image:cdc_upsampled2_front.png|thumb|x250px|ADC samples in (big circles) and upsampled data out (small blue dots) ]]<br />
|[[Image:cdc_upsampled2_middle.png|thumb|x250px|ADC samples in (big circles) and upsampled data out (small blue dots) ]]<br />
|}<br />
<br />
== Upsampling error check prior to error correction - copied from [[CDC_run_1280_bad_events]]==<br />
<br />
After excluding known [[CDC_bad_channels]] I compared the upsampled data with the original samples for the first 10000 events of run 1602. This is a high-intensity run so some of the pedestals are lower than they should be. <br />
<br/><br />
ups_err1 is the upsampled value iubuf[1] - the original sample adc[adc_sample_lo]<br />
<br/><br />
ups_err2 is the upsampled value iubuf[6] - the original sample adc[adc_sample_lo+1]<br />
<br/><br />
<pre><br />
q_code list:<br />
0: Good<br />
1: ADC data did not go over threshold adc_thres_hi <br />
2: Leading edge time is outside the upsampled region (cross adc_thres_lo too late in the buffer subset ) <br />
3: Last upsampled point is <= low timing threshold<br />
4: Upsampled points did not go below low timing threshold<br />
</pre><br />
Looking at upsampling errors - occur when gradient is very large<br />
<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_adcq0.png|thumb|x200px|ADC sample subset for q code 0 ]]<br />
|[[Image:cdc_adcq4.png|thumb|x200px|ADC sample subset for q code 4]]<br />
|[[Image:cdc_adcq4b.png|thumb|x200px|ADC sample subset for q code 4, normalised to min value]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|[[Image:uerr1_q4.png|thumb|x200px|Error in upsampled value vs original sample value adc_sample_lo, q code 4]]<br />
|[[Image:uerr2_q4.png|thumb|x200px|Error in upsampled value vs original sample value adc_sample_lo+1, q code 4]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|[[Image:ue2e1q0.png|thumb|x200px|Error in upsampled values, q code 0]]<br />
|[[Image:ue2e1q4.png|thumb|x200px|Error in upsampled values, q code 4]]<br />
|[[Image:uediffq0.png|thumb|x200px|Difference in error in upsampled values, q code 0 (blue) and 4 (pink)]]<br />
|}<br />
<br />
Following this the error correction step was added to the algorithm, where the sum of errors ups_err1+ups_err2 is calculated and compared with LIMIT_UPS_ERR and then, if below this limit, halved (to calculate the mean) and subtracted from the upsampled data. The corrected upsampled points are the green circles in the 'example of Q code' plots above.</div>Nsjarvishttps://halldweb1.jlab.org/wiki/index.php?title=CDC_algo&diff=63545CDC algo2015-02-10T13:56:58Z<p>Nsjarvis: /* Error codes with faulty channels included */</p>
<hr />
<div><h1>CDC time & integral algorithm</h1><br />
<br />
When the trigger signal arrives, the presample buffer contains NP (default value 16) samples for pedestal followed by NW (default 100, possibly up to 155) samples to contain full range of drift time. <br />
<br />
<br />
<h2>Quantities to be returned, if a hit is found</h2><br />
*Leading edge time (11 bits, units of sample/10)<br />
*Time quality factor (1 bit) set to 0 if time is good, 1 if time is rough estimate<br />
*Pedestal immediately before the hit (8 bits, all bits set if value > field max)<br />
*Signal integral (n bits, scaled down by factor 2^m, all bits set if greater than range; n,m are 14,4)<br />
*Signal maximum (p bits, scaled down by factor 2^q; p,q approx 8,2) this is the first maximum in the signal after the threshold crossing<br />
*Overflow count (3 bits, set to 7 if >6)<br />
<br />
<br />
<br />
<h2>Configuration constants (all values are integers, σ=pedestal width ~20)</h2><br />
<br />
*NPED: number of samples in pedestal window (default 16, must be 2**integer)<br />
*WINDOW_START: position in buffer of first sample in hit search window, this is immediately after the pedestal window<br />
*WINDOW_END: position in buffer of last sample in hit search window<br />
*HIT_THRES: threshold to identify hit (default 5σ ~100, range 50 to 300)<br />
*NPED2: number of samples to use to calculate pedestal just before hit (default 16, must be 2**integer)<br />
*NSAMPLES: number of ADC samples in subset to pass to time finding module (default 15)<br />
*XTHR_SAMPLE: position in subset of first sample above hit_threshold (default 9, starts with 0)<br />
*PED_SAMPLE: position in subset of sample to be used as local pedestal (default 5, starts with 0)<br />
<br />
<br />
<br />
<h2>Timing algorithm configuration constants</h2><br />
*HIGH_THRESHOLD: High timing threshold (default 4σ ~ 80, range 40 to 270) must be lower than hit threshold<br />
*LOW_THRESHOLD: Low timing threshold (default 1σ ~ 20, range 5 to 30)<br />
*ROUGH_DT: rough time - if timing fails, return hit time of XTHR_SAMPLE - ROUGH_DT (default 24, units sample/10)<br />
*INT_SAMPLE: if timing fails, start integration with this sample (default 6).<br />
*NUPSAMPLED: number of upsampled values to calculate (default 8, minimum 8)<br />
*LIMIT_PED_MAX: do not calculate accurate time if any of samples 0 to PED_SAMPLE in subset exceeds this (default 511)<br />
*LIMIT_ADC_MAX: do not calculate accurate time if any sample in the subset exceeds this (default 4095)<br />
*SET_ADC_MIN: reduce chances of calculating a negative upsampled value by adding a constant offset to the subset values such that the minimum is equal to SET_ADC_MIN (default 20)<br />
*LIMIT_UPS_ERR: do not calculate accurate time if the sum of the error of the 2 upsampled values exceeds this (default 30)<br />
<br />
<br />
<h2>Hit finding module</h2><br />
<br />
#Calculate start_pedestal as mean of NPED samples from WINDOW_START-NPED-1 to WINDOW_START-1<br />
#Search from WINDOW_START to WINDOW_END for the earliest sample with ADC value >= start_pedestal + HIT_THRES. If not found, go back to sleep. If found, continue, this is sample X.<br />
#Call up time-finding module and send in NSAMPLES ADC values from the hit threshold crossing region, with sample X in position XTHR_SAMPLE (starting at 0)<br />
#Call up signal maximum module<br />
#Call up signal integral module<br />
#Return pedestal_at_hit as mean of NPED2 samples ending with sample number X + PED_SAMPLE - XTHR_SAMPLE, or 255 if pedestal_at_hit > field max<br />
#Return overflow count from integral module<br />
#Return q_code from time module<br />
#Return total integral: sum of contributions from time module and integral module<br />
#Return time = (X - XTHR_SAMPLE)*10 + le_time returned from time module, units are 0.1*sample-period (0.8ns)<br />
<br />
<br />
<br />
<h2>Time finding module</h2><br />
This returns an error code q_code and the leading edge time le_time, in units of sample/10 and relative to the first sample in the subset. The hit time returned falls into one of three categories: an accurate estimate of the leading edge time, where the low threshold crossing time was found using upsampled data, a midpoint time, where the low threshold crossing time was found using sample data, and a rough time estimate, XTHR_SAMPLE*10 - ROUGH_DT. If the time returned is the accurate leading edge time, q_code is set to 0, otherwise it is set to 1. <br />
<br />
#Inspect ADC samples 0 to PED_SAMPLE. If any sample values are 0 or greater than LIMIT_PED_MAX, return the rough time, XTHR_SAMPLE*10 - ROUGH_DT, and q_code=1.<br />
#Inspect ADC samples PED_SAMPLE+1 to NSAMPLES-1. If any sample values are 0 or greater than LIMIT_ADC_MAX, return the rough time and q_code=1. <br />
#Find the minimum sample value in the subset. Subtract a constant offset from all sample values so that the minimum value is now SET_ADC_MIN. This is to decrease the likelihood of calculating any negative upsampled values. <br />
#Calculate the timing thresholds thres_hi = value of sample PED_SAMPLE + HIGH_THRESHOLD and thres_lo = value of sample PED_SAMPLE + LOW_THRESHOLD<br />
#Search the samples from PED_SAMPLE+1 to NSAMPLES-1 for the first sample with value >= thres_hi. If this threshold is not met, return the rough time and q_code=1.<br />
#Search the samples from the first sample with value >= thres_hi down to PED_SAMPLE to find the first sample (Y) with value <= thres_lo<br />
#If Y is > NSAMPLES-7, there are not enough samples to calculate upsampled values, return the rough time and q_code=1.<br />
#Calculate NUPSAMPLED (8) upsampled values, starting with Y-0.2. <br />
#If any upsampled value is negative, return the midpoint time, Y*10+5, and q_code=1.<br />
#Calculate two upsampling errors, as the difference between upsampled point 1 and sample Y, and the difference between upsampled point 2 and sample Y+1<br />
#Sum the errors and compare them with LIMIT_UPS_ERR, if this is exceeded then return the midpoint time, Y*10+5, and q_code=1.<br />
#Calculate the mean of the 2 errors, ups_err and the adjusted threshold, thres_adj = thres_lo + ups_err<br />
#Search the upsampled values from NUPSAMPLED-1 down to 0 to find upsampled point Z where the value <= thres_adj<br />
#If Z=NUPSAMPLED-1 or Z is not found, return the midpoint time, Y*10+5, and q_code=1.<br />
#Interpolate between the upsampled points Z and Z+1 to find the crossing time in units of sample/10 and relative to the first upsampled point<br />
#Calculate the leading edge time, le_time, as the crossing time found in previous step + Y*10-2, in units of sample/10 and relative to subset sample 0<br />
#Return time=le_time and q_code=0<br />
<br />
<br />
<br />
<h2>Signal maximum module</h2><br />
This returns the signal maximum<br />
#Inspect ADC values after sample X, find the first value which is less than its predecessor<br />
#Return value of the predecessor scaled down by 2^p <br />
<br />
<br />
<br />
<h2>Signal integral module</h2><br />
This returns the signal integral and overflow count<br />
#Sum ADC values from sample X to sample WINDOW_END, and count the number of samples with overflow bit set<br />
#Return integral scaled down by 2^m (return all bits set if value exceeds range maximum)<br />
#Return overflow count (return 7 if count>6)<br />
<br />
<br />
<br />
<br />
<br />
<br />
<h1> Error codes from Run 1602 </h1><br />
<br />
<br />
Settings used:<br />
<pre><br />
#define WINDOW_START 46 //earliest sample for start of hit<br />
#define WINDOW_END 130 //last sample for hit arrival, and last sample included in integral<br />
<br />
#define HIT_THRES 300 // "5 sigma" hit threshold *** set this VERY high to cut out persistent noise in a handful of channels ***<br />
#define NPED 16 // number of samples used for pedestal used to find hit. must be 2**integer<br />
#define NPED2 16 // number of samples used for pedestal calculated just before hit (returned, not used here). must be 2**integer<br />
<br />
// cdc_time<br />
#define HIGH_THRESHOLD 80 // 4 sigma threshold<br />
#define LOW_THRESHOLD 20 // 1 sigma threshold<br />
#define ROUGH_DT 24 // if pulse fails QA, return this many tenth-samples before threshold xing<br />
#define INT_SAMPLE 6 // if pulse fails QA, start integration with this sample <br />
<br />
//cdc_time good pulse criteria<br />
#define LIMIT_PED_MAX 511 //return rough time if any sample in 0 to PED_SAMPLE exceeds this<br />
#define LIMIT_ADC_MAX 4095 // return rough time if any sample in PED_SAMPLE+1 to NSAMPLES exceeds this<br />
<br />
// cdc_time upsampling<br />
#define NSAMPLES 15 //number of samples in subset of array to pass to cdc_time<br />
#define XTHR_SAMPLE 9 // the hit_thres xing sample is sample[9] passed into cdc_time, starting with sample[0]<br />
#define PED_SAMPLE 5 // take local ped as sample[5] passed into cdc_time<br />
#define NUPSAMPLED 8 // number of upsampled values to calculate, minimum is 8<br />
#define SET_ADC_MIN 20 // add an offset to the adc values to set the min value equal to SET_ADC_MIN<br />
#define LIMIT_UPS_ERR 30 // upsampling error tolerance, return midpoint time if error is greater than this<br />
</pre><br />
<br />
<br />
==Error codes with faulty channels included==<br />
<br />
Error codes are listed in the order that the event is removed from processing. ADC overflows are not identified by the C++ code as it only looks at Df125WindowRawData.<br />
<br />
{| border="1px" cellpadding="2" style="border-style:solid;"<br />
! q_code !! reason !! entries !! percent of total !! percent of q>0 entries<br />
|-<br />
| 5 || ADC value = 0 || 26458 || 2.3% || 31%<br />
|-<br />
| 6 || ADC value > 4095 || 0 || 0% || 0%<br />
|-<br />
| 7 || Pedestal > 511 || 44830 || 3.9% || 53%<br />
|-<br />
| 1 || ADC data did not go over threshold adc_thres_hi || 576 || 0.050% || 0.6888%<br />
|-<br />
| 2 || Leading edge time is too late in the buffer to upsample || 82 || 0.007% || 0.096%<br />
|-<br />
| 8 || Upsampled value is negative || 15 || 0.001% || 0.018%<br />
|-<br />
| 9 || Upsampling error sum > 30 || 13225 || 1.1% || 16%<br />
|-<br />
| 3 || Last upsampled point is too low (below or equal to low timing threshold) || 28 || 0.002% || 0.033%<br />
|-<br />
| 4 || Upsampled points are too high (did not go below low timing threshold) || 2 || 0.000% || 0.002%<br />
|-<br />
| 0 || Good || 1078072 || 93% || <br />
|}<br />
<br/><br />
<br />
==Error codes with most of faulty channels excluded from data==<br />
<br />
Error codes are listed in the order that the event is removed from processing. ADC overflows are not identified by the C++ code as it only looks at Df125WindowRawData.<br />
<br />
{| border="1px" cellpadding="2" style="border-style:solid;"<br />
! q_code !! reason !! entries !! percent of total !! percent of q>0 entries<br />
|-<br />
| 5 || ADC value = 0 || 26433 || 2.3% || 31%<br />
|-<br />
| 6 || ADC value > 4095 || 0 || 0% || 0%<br />
|-<br />
| 7 || Pedestal > 511 || 44747 || 3.9% || 53%<br />
|-<br />
| 1 || ADC data did not go over threshold adc_thres_hi || 575 || 0.050% || 0.68%<br />
|-<br />
| 2 || Leading edge time is too late in the buffer to upsample || 82 || 0.007% || 0.096%<br />
|-<br />
| 8 || Upsampled value is negative || 0 || 0% || 0%<br />
|-<br />
| 9 || Upsampling error sum > 30 || 13188 || 1.2% || 16%<br />
|-<br />
| 3 || Last upsampled point is too low (below or equal to low timing threshold) || 2 || 0.000% || 0.002%<br />
|-<br />
| 4 || Upsampled points are too high (did not go below low timing threshold) || 0 || 0% || 0%<br />
|-<br />
| 0 || Good || 1075754 || 93% || <br />
|}<br />
<br />
==Error codes with faulty channels included, mimicked overflow detection in C++ code==<br />
The C++ code is not finding overflows because it is only using Df125WindowRawData; overflows are in a different branch of DAQTree.<br />
The VHDL code will be able to find overflows by testing for sample value > 4095 because the overflow bit is passed in as a 13th sample value bit (bits 0-11 are the ADC value), so samples with the overflow bit set will have value > 4095. This was mimicked in the C++ code by testing for ADC value > 4094.<br />
<pre><br />
#define LIMIT_ADC_MAX 4094 // return rough time if any sample in PED_SAMPLE+1 to NSAMPLES exceeds this<br />
</pre><br />
<br />
{| border="1px" cellpadding="2" style="border-style:solid;"<br />
! q_code !! reason !! entries !! percent of total !! percent of q>0 entries<br />
|-<br />
| 5 || ADC value = 0 || 52559 || 3.9% || 25%<br />
|-<br />
| 6 || ADC value > 4094 || 97939 || 7.2% || 46%<br />
|-<br />
| 7 || Pedestal > 511 || 51244 || 3.8% || 24%<br />
|-<br />
| 1 || ADC data did not go over threshold adc_thres_hi || 9787 || 0.72% || 4.6%<br />
|-<br />
| 2 || Leading edge time is too late in the buffer to upsample || 700 || 0.051% || 0.33%<br />
|-<br />
| 8 || Upsampled value is negative || 15 || 0.001% || 0.007%<br />
|-<br />
| 9 || Upsampling error sum > 30 || 61 || 0.004% || 0.029%<br />
|-<br />
| 3 || Last upsampled point is too low (below or equal to low timing threshold) || 813 || 0.060% || 0.38%<br />
|-<br />
| 4 || Upsampled points are too high (did not go below low timing threshold) || 8 || 0.001% || 0.004%<br />
|-<br />
| 0 || Good || 1148835 || 84% || <br />
|}<br />
<br />
<br />
<br />
<br />
==Examples, in order of q code population (click image twice to expand)==<br />
<br />
=== Q=0, good ===<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_run1602_e0q0.png.png|thumb|x200px|entry 0 q 0]]<br />
|[[Image:cdc_run1602_e1q0.png.png|thumb|x200px|entry 1 q 0]]<br />
|[[Image:cdc_run1602_e2q0.png.png|thumb|x200px|entry 2 q 0]]<br />
|[[Image:cdc_run1602_e3q0.png.png|thumb|x200px|entry 3 q 0]]<br />
|}<br />
<br />
=== Q=6, overflow ===<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_run1602_e7q6.png.png|thumb|x200px|entry 7 q 6]]<br />
|[[Image:cdc_run1602_e8q6.png.png|thumb|x200px|entry 8 q 6]]<br />
|[[Image:cdc_run1602_e9q6.png.png|thumb|x200px|entry 9 q 6]]<br />
|[[Image:cdc_run1602_e16q6.png.png|thumb|x200px|entry 16 q 6]]<br />
|}<br />
<br />
=== Q=5, ADC value=0 ===<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_run1602_e51q5.png.png|thumb|x200px|entry 51 q 5]]<br />
|[[Image:cdc_run1602_e120q5.png.png|thumb|x200px|entry 120 q 5]]<br />
|[[Image:cdc_run1602_e125q5.png.png|thumb|x200px|entry 125 q 5]]<br />
|[[Image:cdc_run1602_e198q5.png.png|thumb|x200px|entry 198 q 5]]<br />
|}<br />
<br />
=== Q=7, Pedestal>511 ===<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_run1602_e6q7.png.png|thumb|x200px|entry 6 q 7]]<br />
|[[Image:cdc_run1602_e21q7.png.png|thumb|x200px|entry 21 q 7]]<br />
|[[Image:cdc_run1602_e23q7.png.png|thumb|x200px|entry 23 q 7]]<br />
|[[Image:cdc_run1602_e24q7.png.png|thumb|x200px|entry 24 q 7]]<br />
|}<br />
<br />
=== Q=1, ADC data<ADC_subset_value[PED_SAMPLE] + HIGH_THRESHOLD===<br />
<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_run1602_e15q1.png.png|thumb|x200px|entry 15 q 1]]<br />
|[[Image:cdc_run1602_e91q1.png.png|thumb|x200px|entry 91 q 1]]<br />
|[[Image:cdc_run1602_e165q1.png.png|thumb|x200px|entry 165 q 1]]<br />
|[[Image:cdc_run1602_e179q1.png.png|thumb|x200px|entry 179 q 1]]<br />
|}<br />
<br />
=== Q=3, last upsampled point is too low (very rare with fully functioning fADCs) ===<br />
<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_run1602_e4073q3.png.png|thumb|x200px|entry 4073 q 3]]<br />
|[[Image:cdc_run1602_e5548q3.png.png|thumb|x200px|entry 5548 q 3]]<br />
|[[Image:cdc_run1602_e8618q3.png.png|thumb|x200px|entry 8618 q 3]]<br />
|[[Image:cdc_run1602_e9358q3.png.png|thumb|x200px|entry 9358 q 3]]<br />
|}<br />
<br />
=== Q=2, leading edge time too late to upsample (very rare with fully functioning fADCs) ===<br />
<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_run1602_e2091q2.png.png|thumb|x200px|entry 2091 q 2]]<br />
|[[Image:cdc_run1602_e3950q2.png.png|thumb|x200px|entry 3950 q 2]]<br />
|[[Image:cdc_run1602_e6905q2.png.png|thumb|x200px|entry 6905 q 2]]<br />
|[[Image:cdc_run1602_e9876q2.png.png|thumb|x200px|entry 9876 q 2]]<br />
|}<br />
<br />
=== Q=8, calculated an upsampled value < 0 (very rare with fully functioning fADCs) ===<br />
<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_run1602_e4284q8.png|thumb|x200px|entry 4284 q 8]]<br />
|[[Image:cdc_run1602_e99090q8.png|thumb|x200px|entry 99090 q 8]]<br />
|[[Image:cdc_run1602_e251941q8.png|thumb|x200px|entry 251941 q 8]]<br />
|[[Image:cdc_run1602_e544903q8.png|thumb|x200px|entry 544903 q 8]]<br />
|}<br />
<br />
=== Q=4, upsampled values too high (very rare with fully functioning fADCs) ===<br />
<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_run1602_e16257q4.png|thumb|x200px|entry 16257 q 4]]<br />
|[[Image:cdc_run1602_e74085q4.png|thumb|x200px|entry 74085 q 4]]<br />
|[[Image:cdc_run1602_e205536q4.png|thumb|x200px|entry 205536 q 4]]<br />
|[[Image:cdc_run1602_e256051q4.png|thumb|x200px|entry 256051 q 4]]<br />
|}<br />
<br />
==Upsampled data - old example==<br />
<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_upsampled2.png|thumb|x250px|ADC samples in (big circles) and upsampled data out (small blue dots) ]]<br />
|[[Image:cdc_upsampled2_front.png|thumb|x250px|ADC samples in (big circles) and upsampled data out (small blue dots) ]]<br />
|[[Image:cdc_upsampled2_middle.png|thumb|x250px|ADC samples in (big circles) and upsampled data out (small blue dots) ]]<br />
|}<br />
<br />
== Upsampling error check prior to error correction - copied from [[CDC_run_1280_bad_events]]==<br />
<br />
After excluding known [[CDC_bad_channels]] I compared the upsampled data with the original samples for the first 10000 events of run 1602. This is a high-intensity run so some of the pedestals are lower than they should be. <br />
<br/><br />
ups_err1 is the upsampled value iubuf[1] - the original sample adc[adc_sample_lo]<br />
<br/><br />
ups_err2 is the upsampled value iubuf[6] - the original sample adc[adc_sample_lo+1]<br />
<br/><br />
<pre><br />
q_code list:<br />
0: Good<br />
1: ADC data did not go over threshold adc_thres_hi <br />
2: Leading edge time is outside the upsampled region (cross adc_thres_lo too late in the buffer subset ) <br />
3: Last upsampled point is <= low timing threshold<br />
4: Upsampled points did not go below low timing threshold<br />
</pre><br />
Looking at upsampling errors - occur when gradient is very large<br />
<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_adcq0.png|thumb|x200px|ADC sample subset for q code 0 ]]<br />
|[[Image:cdc_adcq4.png|thumb|x200px|ADC sample subset for q code 4]]<br />
|[[Image:cdc_adcq4b.png|thumb|x200px|ADC sample subset for q code 4, normalised to min value]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|[[Image:uerr1_q4.png|thumb|x200px|Error in upsampled value vs original sample value adc_sample_lo, q code 4]]<br />
|[[Image:uerr2_q4.png|thumb|x200px|Error in upsampled value vs original sample value adc_sample_lo+1, q code 4]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|[[Image:ue2e1q0.png|thumb|x200px|Error in upsampled values, q code 0]]<br />
|[[Image:ue2e1q4.png|thumb|x200px|Error in upsampled values, q code 4]]<br />
|[[Image:uediffq0.png|thumb|x200px|Difference in error in upsampled values, q code 0 (blue) and 4 (pink)]]<br />
|}<br />
<br />
Following this the error correction step was added to the algorithm, where the sum of errors ups_err1+ups_err2 is calculated and compared with LIMIT_UPS_ERR and then, if below this limit, halved (to calculate the mean) and subtracted from the upsampled data. The corrected upsampled points are the green circles in the 'example of Q code' plots above.</div>Nsjarvishttps://halldweb1.jlab.org/wiki/index.php?title=CDC_algo&diff=63544CDC algo2015-02-10T13:56:28Z<p>Nsjarvis: /* Error codes with faulty channels included */</p>
<hr />
<div><h1>CDC time & integral algorithm</h1><br />
<br />
When the trigger signal arrives, the presample buffer contains NP (default value 16) samples for pedestal followed by NW (default 100, possibly up to 155) samples to contain full range of drift time. <br />
<br />
<br />
<h2>Quantities to be returned, if a hit is found</h2><br />
*Leading edge time (11 bits, units of sample/10)<br />
*Time quality factor (1 bit) set to 0 if time is good, 1 if time is rough estimate<br />
*Pedestal immediately before the hit (8 bits, all bits set if value > field max)<br />
*Signal integral (n bits, scaled down by factor 2^m, all bits set if greater than range; n,m are 14,4)<br />
*Signal maximum (p bits, scaled down by factor 2^q; p,q approx 8,2) this is the first maximum in the signal after the threshold crossing<br />
*Overflow count (3 bits, set to 7 if >6)<br />
<br />
<br />
<br />
<h2>Configuration constants (all values are integers, σ=pedestal width ~20)</h2><br />
<br />
*NPED: number of samples in pedestal window (default 16, must be 2**integer)<br />
*WINDOW_START: position in buffer of first sample in hit search window, this is immediately after the pedestal window<br />
*WINDOW_END: position in buffer of last sample in hit search window<br />
*HIT_THRES: threshold to identify hit (default 5σ ~100, range 50 to 300)<br />
*NPED2: number of samples to use to calculate pedestal just before hit (default 16, must be 2**integer)<br />
*NSAMPLES: number of ADC samples in subset to pass to time finding module (default 15)<br />
*XTHR_SAMPLE: position in subset of first sample above hit_threshold (default 9, starts with 0)<br />
*PED_SAMPLE: position in subset of sample to be used as local pedestal (default 5, starts with 0)<br />
<br />
<br />
<br />
<h2>Timing algorithm configuration constants</h2><br />
*HIGH_THRESHOLD: High timing threshold (default 4σ ~ 80, range 40 to 270) must be lower than hit threshold<br />
*LOW_THRESHOLD: Low timing threshold (default 1σ ~ 20, range 5 to 30)<br />
*ROUGH_DT: rough time - if timing fails, return hit time of XTHR_SAMPLE - ROUGH_DT (default 24, units sample/10)<br />
*INT_SAMPLE: if timing fails, start integration with this sample (default 6).<br />
*NUPSAMPLED: number of upsampled values to calculate (default 8, minimum 8)<br />
*LIMIT_PED_MAX: do not calculate accurate time if any of samples 0 to PED_SAMPLE in subset exceeds this (default 511)<br />
*LIMIT_ADC_MAX: do not calculate accurate time if any sample in the subset exceeds this (default 4095)<br />
*SET_ADC_MIN: reduce chances of calculating a negative upsampled value by adding a constant offset to the subset values such that the minimum is equal to SET_ADC_MIN (default 20)<br />
*LIMIT_UPS_ERR: do not calculate accurate time if the sum of the error of the 2 upsampled values exceeds this (default 30)<br />
<br />
<br />
<h2>Hit finding module</h2><br />
<br />
#Calculate start_pedestal as mean of NPED samples from WINDOW_START-NPED-1 to WINDOW_START-1<br />
#Search from WINDOW_START to WINDOW_END for the earliest sample with ADC value >= start_pedestal + HIT_THRES. If not found, go back to sleep. If found, continue, this is sample X.<br />
#Call up time-finding module and send in NSAMPLES ADC values from the hit threshold crossing region, with sample X in position XTHR_SAMPLE (starting at 0)<br />
#Call up signal maximum module<br />
#Call up signal integral module<br />
#Return pedestal_at_hit as mean of NPED2 samples ending with sample number X + PED_SAMPLE - XTHR_SAMPLE, or 255 if pedestal_at_hit > field max<br />
#Return overflow count from integral module<br />
#Return q_code from time module<br />
#Return total integral: sum of contributions from time module and integral module<br />
#Return time = (X - XTHR_SAMPLE)*10 + le_time returned from time module, units are 0.1*sample-period (0.8ns)<br />
<br />
<br />
<br />
<h2>Time finding module</h2><br />
This returns an error code q_code and the leading edge time le_time, in units of sample/10 and relative to the first sample in the subset. The hit time returned falls into one of three categories: an accurate estimate of the leading edge time, where the low threshold crossing time was found using upsampled data, a midpoint time, where the low threshold crossing time was found using sample data, and a rough time estimate, XTHR_SAMPLE*10 - ROUGH_DT. If the time returned is the accurate leading edge time, q_code is set to 0, otherwise it is set to 1. <br />
<br />
#Inspect ADC samples 0 to PED_SAMPLE. If any sample values are 0 or greater than LIMIT_PED_MAX, return the rough time, XTHR_SAMPLE*10 - ROUGH_DT, and q_code=1.<br />
#Inspect ADC samples PED_SAMPLE+1 to NSAMPLES-1. If any sample values are 0 or greater than LIMIT_ADC_MAX, return the rough time and q_code=1. <br />
#Find the minimum sample value in the subset. Subtract a constant offset from all sample values so that the minimum value is now SET_ADC_MIN. This is to decrease the likelihood of calculating any negative upsampled values. <br />
#Calculate the timing thresholds thres_hi = value of sample PED_SAMPLE + HIGH_THRESHOLD and thres_lo = value of sample PED_SAMPLE + LOW_THRESHOLD<br />
#Search the samples from PED_SAMPLE+1 to NSAMPLES-1 for the first sample with value >= thres_hi. If this threshold is not met, return the rough time and q_code=1.<br />
#Search the samples from the first sample with value >= thres_hi down to PED_SAMPLE to find the first sample (Y) with value <= thres_lo<br />
#If Y is > NSAMPLES-7, there are not enough samples to calculate upsampled values, return the rough time and q_code=1.<br />
#Calculate NUPSAMPLED (8) upsampled values, starting with Y-0.2. <br />
#If any upsampled value is negative, return the midpoint time, Y*10+5, and q_code=1.<br />
#Calculate two upsampling errors, as the difference between upsampled point 1 and sample Y, and the difference between upsampled point 2 and sample Y+1<br />
#Sum the errors and compare them with LIMIT_UPS_ERR, if this is exceeded then return the midpoint time, Y*10+5, and q_code=1.<br />
#Calculate the mean of the 2 errors, ups_err and the adjusted threshold, thres_adj = thres_lo + ups_err<br />
#Search the upsampled values from NUPSAMPLED-1 down to 0 to find upsampled point Z where the value <= thres_adj<br />
#If Z=NUPSAMPLED-1 or Z is not found, return the midpoint time, Y*10+5, and q_code=1.<br />
#Interpolate between the upsampled points Z and Z+1 to find the crossing time in units of sample/10 and relative to the first upsampled point<br />
#Calculate the leading edge time, le_time, as the crossing time found in previous step + Y*10-2, in units of sample/10 and relative to subset sample 0<br />
#Return time=le_time and q_code=0<br />
<br />
<br />
<br />
<h2>Signal maximum module</h2><br />
This returns the signal maximum<br />
#Inspect ADC values after sample X, find the first value which is less than its predecessor<br />
#Return value of the predecessor scaled down by 2^p <br />
<br />
<br />
<br />
<h2>Signal integral module</h2><br />
This returns the signal integral and overflow count<br />
#Sum ADC values from sample X to sample WINDOW_END, and count the number of samples with overflow bit set<br />
#Return integral scaled down by 2^m (return all bits set if value exceeds range maximum)<br />
#Return overflow count (return 7 if count>6)<br />
<br />
<br />
<br />
<br />
<br />
<br />
<h1> Error codes from Run 1602 </h1><br />
<br />
<br />
Settings used:<br />
<pre><br />
#define WINDOW_START 46 //earliest sample for start of hit<br />
#define WINDOW_END 130 //last sample for hit arrival, and last sample included in integral<br />
<br />
#define HIT_THRES 300 // "5 sigma" hit threshold *** set this VERY high to cut out persistent noise in a handful of channels ***<br />
#define NPED 16 // number of samples used for pedestal used to find hit. must be 2**integer<br />
#define NPED2 16 // number of samples used for pedestal calculated just before hit (returned, not used here). must be 2**integer<br />
<br />
// cdc_time<br />
#define HIGH_THRESHOLD 80 // 4 sigma threshold<br />
#define LOW_THRESHOLD 20 // 1 sigma threshold<br />
#define ROUGH_DT 24 // if pulse fails QA, return this many tenth-samples before threshold xing<br />
#define INT_SAMPLE 6 // if pulse fails QA, start integration with this sample <br />
<br />
//cdc_time good pulse criteria<br />
#define LIMIT_PED_MAX 511 //return rough time if any sample in 0 to PED_SAMPLE exceeds this<br />
#define LIMIT_ADC_MAX 4095 // return rough time if any sample in PED_SAMPLE+1 to NSAMPLES exceeds this<br />
<br />
// cdc_time upsampling<br />
#define NSAMPLES 15 //number of samples in subset of array to pass to cdc_time<br />
#define XTHR_SAMPLE 9 // the hit_thres xing sample is sample[9] passed into cdc_time, starting with sample[0]<br />
#define PED_SAMPLE 5 // take local ped as sample[5] passed into cdc_time<br />
#define NUPSAMPLED 8 // number of upsampled values to calculate, minimum is 8<br />
#define SET_ADC_MIN 20 // add an offset to the adc values to set the min value equal to SET_ADC_MIN<br />
#define LIMIT_UPS_ERR 30 // upsampling error tolerance, return midpoint time if error is greater than this<br />
</pre><br />
<br />
<br />
==Error codes with faulty channels included==<br />
<br />
Error codes are listed in the order that the event is removed from processing. ADC overflows are not identified by the C++ code as it only looks at Df125WindowRawData.<br />
<br />
{| border="1px" cellpadding="2" style="border-style:solid;"<br />
! q_code !! reason !! entries !! percent of total !! percent of q>0 entries<br />
|-<br />
| 5 || ADC value = 0 || 26458 || 2.3% || 31%<br />
|-<br />
| 6 || ADC value > 4095 || 0 || 0% || 0%<br />
|-<br />
| 7 || Pedestal > 511 || 44830 || 3.9% || 53%<br />
|-<br />
| 1 || ADC data did not go over threshold adc_thres_hi || 576 || 0.050% || 0.6888%<br />
|-<br />
| 2 || Leading edge time is too late in the buffer to upsample || 82 || 0.007% || 0.096%<br />
|-<br />
| 8 || Upsampled value is negative || 15 || 0.001% || 0.018%<br />
|-<br />
| 9 || Upsampling error sum > 30 || 13225 || 1.1% || 16%<br />
|-<br />
| 3 || Last upsampled point is too low (below or equal to low timing threshold) || 28 || 0.002% || 0.033%<br />
|-<br />
| 4 || Upsampled points are too high (did not go below low timing threshold) || 2 || 0.000% || 0.002%<br />
|-<br />
| 0 || Good || 1078072 || 93% || <br />
|}<br />
<br />
==Error codes with most of faulty channels excluded from data==<br />
<br />
Error codes are listed in the order that the event is removed from processing. ADC overflows are not identified by the C++ code as it only looks at Df125WindowRawData.<br />
<br />
{| border="1px" cellpadding="2" style="border-style:solid;"<br />
! q_code !! reason !! entries !! percent of total !! percent of q>0 entries<br />
|-<br />
| 5 || ADC value = 0 || 26433 || 2.3% || 31%<br />
|-<br />
| 6 || ADC value > 4095 || 0 || 0% || 0%<br />
|-<br />
| 7 || Pedestal > 511 || 44747 || 3.9% || 53%<br />
|-<br />
| 1 || ADC data did not go over threshold adc_thres_hi || 575 || 0.050% || 0.68%<br />
|-<br />
| 2 || Leading edge time is too late in the buffer to upsample || 82 || 0.007% || 0.096%<br />
|-<br />
| 8 || Upsampled value is negative || 0 || 0% || 0%<br />
|-<br />
| 9 || Upsampling error sum > 30 || 13188 || 1.2% || 16%<br />
|-<br />
| 3 || Last upsampled point is too low (below or equal to low timing threshold) || 2 || 0.000% || 0.002%<br />
|-<br />
| 4 || Upsampled points are too high (did not go below low timing threshold) || 0 || 0% || 0%<br />
|-<br />
| 0 || Good || 1075754 || 93% || <br />
|}<br />
<br />
==Error codes with faulty channels included, mimicked overflow detection in C++ code==<br />
The C++ code is not finding overflows because it is only using Df125WindowRawData; overflows are in a different branch of DAQTree.<br />
The VHDL code will be able to find overflows by testing for sample value > 4095 because the overflow bit is passed in as a 13th sample value bit (bits 0-11 are the ADC value), so samples with the overflow bit set will have value > 4095. This was mimicked in the C++ code by testing for ADC value > 4094.<br />
<pre><br />
#define LIMIT_ADC_MAX 4094 // return rough time if any sample in PED_SAMPLE+1 to NSAMPLES exceeds this<br />
</pre><br />
<br />
{| border="1px" cellpadding="2" style="border-style:solid;"<br />
! q_code !! reason !! entries !! percent of total !! percent of q>0 entries<br />
|-<br />
| 5 || ADC value = 0 || 52559 || 3.9% || 25%<br />
|-<br />
| 6 || ADC value > 4094 || 97939 || 7.2% || 46%<br />
|-<br />
| 7 || Pedestal > 511 || 51244 || 3.8% || 24%<br />
|-<br />
| 1 || ADC data did not go over threshold adc_thres_hi || 9787 || 0.72% || 4.6%<br />
|-<br />
| 2 || Leading edge time is too late in the buffer to upsample || 700 || 0.051% || 0.33%<br />
|-<br />
| 8 || Upsampled value is negative || 15 || 0.001% || 0.007%<br />
|-<br />
| 9 || Upsampling error sum > 30 || 61 || 0.004% || 0.029%<br />
|-<br />
| 3 || Last upsampled point is too low (below or equal to low timing threshold) || 813 || 0.060% || 0.38%<br />
|-<br />
| 4 || Upsampled points are too high (did not go below low timing threshold) || 8 || 0.001% || 0.004%<br />
|-<br />
| 0 || Good || 1148835 || 84% || <br />
|}<br />
<br />
<br />
<br />
<br />
==Examples, in order of q code population (click image twice to expand)==<br />
<br />
=== Q=0, good ===<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_run1602_e0q0.png.png|thumb|x200px|entry 0 q 0]]<br />
|[[Image:cdc_run1602_e1q0.png.png|thumb|x200px|entry 1 q 0]]<br />
|[[Image:cdc_run1602_e2q0.png.png|thumb|x200px|entry 2 q 0]]<br />
|[[Image:cdc_run1602_e3q0.png.png|thumb|x200px|entry 3 q 0]]<br />
|}<br />
<br />
=== Q=6, overflow ===<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_run1602_e7q6.png.png|thumb|x200px|entry 7 q 6]]<br />
|[[Image:cdc_run1602_e8q6.png.png|thumb|x200px|entry 8 q 6]]<br />
|[[Image:cdc_run1602_e9q6.png.png|thumb|x200px|entry 9 q 6]]<br />
|[[Image:cdc_run1602_e16q6.png.png|thumb|x200px|entry 16 q 6]]<br />
|}<br />
<br />
=== Q=5, ADC value=0 ===<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_run1602_e51q5.png.png|thumb|x200px|entry 51 q 5]]<br />
|[[Image:cdc_run1602_e120q5.png.png|thumb|x200px|entry 120 q 5]]<br />
|[[Image:cdc_run1602_e125q5.png.png|thumb|x200px|entry 125 q 5]]<br />
|[[Image:cdc_run1602_e198q5.png.png|thumb|x200px|entry 198 q 5]]<br />
|}<br />
<br />
=== Q=7, Pedestal>511 ===<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_run1602_e6q7.png.png|thumb|x200px|entry 6 q 7]]<br />
|[[Image:cdc_run1602_e21q7.png.png|thumb|x200px|entry 21 q 7]]<br />
|[[Image:cdc_run1602_e23q7.png.png|thumb|x200px|entry 23 q 7]]<br />
|[[Image:cdc_run1602_e24q7.png.png|thumb|x200px|entry 24 q 7]]<br />
|}<br />
<br />
=== Q=1, ADC data<ADC_subset_value[PED_SAMPLE] + HIGH_THRESHOLD===<br />
<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_run1602_e15q1.png.png|thumb|x200px|entry 15 q 1]]<br />
|[[Image:cdc_run1602_e91q1.png.png|thumb|x200px|entry 91 q 1]]<br />
|[[Image:cdc_run1602_e165q1.png.png|thumb|x200px|entry 165 q 1]]<br />
|[[Image:cdc_run1602_e179q1.png.png|thumb|x200px|entry 179 q 1]]<br />
|}<br />
<br />
=== Q=3, last upsampled point is too low (very rare with fully functioning fADCs) ===<br />
<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_run1602_e4073q3.png.png|thumb|x200px|entry 4073 q 3]]<br />
|[[Image:cdc_run1602_e5548q3.png.png|thumb|x200px|entry 5548 q 3]]<br />
|[[Image:cdc_run1602_e8618q3.png.png|thumb|x200px|entry 8618 q 3]]<br />
|[[Image:cdc_run1602_e9358q3.png.png|thumb|x200px|entry 9358 q 3]]<br />
|}<br />
<br />
=== Q=2, leading edge time too late to upsample (very rare with fully functioning fADCs) ===<br />
<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_run1602_e2091q2.png.png|thumb|x200px|entry 2091 q 2]]<br />
|[[Image:cdc_run1602_e3950q2.png.png|thumb|x200px|entry 3950 q 2]]<br />
|[[Image:cdc_run1602_e6905q2.png.png|thumb|x200px|entry 6905 q 2]]<br />
|[[Image:cdc_run1602_e9876q2.png.png|thumb|x200px|entry 9876 q 2]]<br />
|}<br />
<br />
=== Q=8, calculated an upsampled value < 0 (very rare with fully functioning fADCs) ===<br />
<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_run1602_e4284q8.png|thumb|x200px|entry 4284 q 8]]<br />
|[[Image:cdc_run1602_e99090q8.png|thumb|x200px|entry 99090 q 8]]<br />
|[[Image:cdc_run1602_e251941q8.png|thumb|x200px|entry 251941 q 8]]<br />
|[[Image:cdc_run1602_e544903q8.png|thumb|x200px|entry 544903 q 8]]<br />
|}<br />
<br />
=== Q=4, upsampled values too high (very rare with fully functioning fADCs) ===<br />
<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_run1602_e16257q4.png|thumb|x200px|entry 16257 q 4]]<br />
|[[Image:cdc_run1602_e74085q4.png|thumb|x200px|entry 74085 q 4]]<br />
|[[Image:cdc_run1602_e205536q4.png|thumb|x200px|entry 205536 q 4]]<br />
|[[Image:cdc_run1602_e256051q4.png|thumb|x200px|entry 256051 q 4]]<br />
|}<br />
<br />
==Upsampled data - old example==<br />
<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_upsampled2.png|thumb|x250px|ADC samples in (big circles) and upsampled data out (small blue dots) ]]<br />
|[[Image:cdc_upsampled2_front.png|thumb|x250px|ADC samples in (big circles) and upsampled data out (small blue dots) ]]<br />
|[[Image:cdc_upsampled2_middle.png|thumb|x250px|ADC samples in (big circles) and upsampled data out (small blue dots) ]]<br />
|}<br />
<br />
== Upsampling error check prior to error correction - copied from [[CDC_run_1280_bad_events]]==<br />
<br />
After excluding known [[CDC_bad_channels]] I compared the upsampled data with the original samples for the first 10000 events of run 1602. This is a high-intensity run so some of the pedestals are lower than they should be. <br />
<br/><br />
ups_err1 is the upsampled value iubuf[1] - the original sample adc[adc_sample_lo]<br />
<br/><br />
ups_err2 is the upsampled value iubuf[6] - the original sample adc[adc_sample_lo+1]<br />
<br/><br />
<pre><br />
q_code list:<br />
0: Good<br />
1: ADC data did not go over threshold adc_thres_hi <br />
2: Leading edge time is outside the upsampled region (cross adc_thres_lo too late in the buffer subset ) <br />
3: Last upsampled point is <= low timing threshold<br />
4: Upsampled points did not go below low timing threshold<br />
</pre><br />
Looking at upsampling errors - occur when gradient is very large<br />
<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_adcq0.png|thumb|x200px|ADC sample subset for q code 0 ]]<br />
|[[Image:cdc_adcq4.png|thumb|x200px|ADC sample subset for q code 4]]<br />
|[[Image:cdc_adcq4b.png|thumb|x200px|ADC sample subset for q code 4, normalised to min value]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|[[Image:uerr1_q4.png|thumb|x200px|Error in upsampled value vs original sample value adc_sample_lo, q code 4]]<br />
|[[Image:uerr2_q4.png|thumb|x200px|Error in upsampled value vs original sample value adc_sample_lo+1, q code 4]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|[[Image:ue2e1q0.png|thumb|x200px|Error in upsampled values, q code 0]]<br />
|[[Image:ue2e1q4.png|thumb|x200px|Error in upsampled values, q code 4]]<br />
|[[Image:uediffq0.png|thumb|x200px|Difference in error in upsampled values, q code 0 (blue) and 4 (pink)]]<br />
|}<br />
<br />
Following this the error correction step was added to the algorithm, where the sum of errors ups_err1+ups_err2 is calculated and compared with LIMIT_UPS_ERR and then, if below this limit, halved (to calculate the mean) and subtracted from the upsampled data. The corrected upsampled points are the green circles in the 'example of Q code' plots above.</div>Nsjarvishttps://halldweb1.jlab.org/wiki/index.php?title=CDC_algo&diff=63543CDC algo2015-02-10T13:55:22Z<p>Nsjarvis: /* Error codes with most of faulty channels excluded from data */</p>
<hr />
<div><h1>CDC time & integral algorithm</h1><br />
<br />
When the trigger signal arrives, the presample buffer contains NP (default value 16) samples for pedestal followed by NW (default 100, possibly up to 155) samples to contain full range of drift time. <br />
<br />
<br />
<h2>Quantities to be returned, if a hit is found</h2><br />
*Leading edge time (11 bits, units of sample/10)<br />
*Time quality factor (1 bit) set to 0 if time is good, 1 if time is rough estimate<br />
*Pedestal immediately before the hit (8 bits, all bits set if value > field max)<br />
*Signal integral (n bits, scaled down by factor 2^m, all bits set if greater than range; n,m are 14,4)<br />
*Signal maximum (p bits, scaled down by factor 2^q; p,q approx 8,2) this is the first maximum in the signal after the threshold crossing<br />
*Overflow count (3 bits, set to 7 if >6)<br />
<br />
<br />
<br />
<h2>Configuration constants (all values are integers, σ=pedestal width ~20)</h2><br />
<br />
*NPED: number of samples in pedestal window (default 16, must be 2**integer)<br />
*WINDOW_START: position in buffer of first sample in hit search window, this is immediately after the pedestal window<br />
*WINDOW_END: position in buffer of last sample in hit search window<br />
*HIT_THRES: threshold to identify hit (default 5σ ~100, range 50 to 300)<br />
*NPED2: number of samples to use to calculate pedestal just before hit (default 16, must be 2**integer)<br />
*NSAMPLES: number of ADC samples in subset to pass to time finding module (default 15)<br />
*XTHR_SAMPLE: position in subset of first sample above hit_threshold (default 9, starts with 0)<br />
*PED_SAMPLE: position in subset of sample to be used as local pedestal (default 5, starts with 0)<br />
<br />
<br />
<br />
<h2>Timing algorithm configuration constants</h2><br />
*HIGH_THRESHOLD: High timing threshold (default 4σ ~ 80, range 40 to 270) must be lower than hit threshold<br />
*LOW_THRESHOLD: Low timing threshold (default 1σ ~ 20, range 5 to 30)<br />
*ROUGH_DT: rough time - if timing fails, return hit time of XTHR_SAMPLE - ROUGH_DT (default 24, units sample/10)<br />
*INT_SAMPLE: if timing fails, start integration with this sample (default 6).<br />
*NUPSAMPLED: number of upsampled values to calculate (default 8, minimum 8)<br />
*LIMIT_PED_MAX: do not calculate accurate time if any of samples 0 to PED_SAMPLE in subset exceeds this (default 511)<br />
*LIMIT_ADC_MAX: do not calculate accurate time if any sample in the subset exceeds this (default 4095)<br />
*SET_ADC_MIN: reduce chances of calculating a negative upsampled value by adding a constant offset to the subset values such that the minimum is equal to SET_ADC_MIN (default 20)<br />
*LIMIT_UPS_ERR: do not calculate accurate time if the sum of the error of the 2 upsampled values exceeds this (default 30)<br />
<br />
<br />
<h2>Hit finding module</h2><br />
<br />
#Calculate start_pedestal as mean of NPED samples from WINDOW_START-NPED-1 to WINDOW_START-1<br />
#Search from WINDOW_START to WINDOW_END for the earliest sample with ADC value >= start_pedestal + HIT_THRES. If not found, go back to sleep. If found, continue, this is sample X.<br />
#Call up time-finding module and send in NSAMPLES ADC values from the hit threshold crossing region, with sample X in position XTHR_SAMPLE (starting at 0)<br />
#Call up signal maximum module<br />
#Call up signal integral module<br />
#Return pedestal_at_hit as mean of NPED2 samples ending with sample number X + PED_SAMPLE - XTHR_SAMPLE, or 255 if pedestal_at_hit > field max<br />
#Return overflow count from integral module<br />
#Return q_code from time module<br />
#Return total integral: sum of contributions from time module and integral module<br />
#Return time = (X - XTHR_SAMPLE)*10 + le_time returned from time module, units are 0.1*sample-period (0.8ns)<br />
<br />
<br />
<br />
<h2>Time finding module</h2><br />
This returns an error code q_code and the leading edge time le_time, in units of sample/10 and relative to the first sample in the subset. The hit time returned falls into one of three categories: an accurate estimate of the leading edge time, where the low threshold crossing time was found using upsampled data, a midpoint time, where the low threshold crossing time was found using sample data, and a rough time estimate, XTHR_SAMPLE*10 - ROUGH_DT. If the time returned is the accurate leading edge time, q_code is set to 0, otherwise it is set to 1. <br />
<br />
#Inspect ADC samples 0 to PED_SAMPLE. If any sample values are 0 or greater than LIMIT_PED_MAX, return the rough time, XTHR_SAMPLE*10 - ROUGH_DT, and q_code=1.<br />
#Inspect ADC samples PED_SAMPLE+1 to NSAMPLES-1. If any sample values are 0 or greater than LIMIT_ADC_MAX, return the rough time and q_code=1. <br />
#Find the minimum sample value in the subset. Subtract a constant offset from all sample values so that the minimum value is now SET_ADC_MIN. This is to decrease the likelihood of calculating any negative upsampled values. <br />
#Calculate the timing thresholds thres_hi = value of sample PED_SAMPLE + HIGH_THRESHOLD and thres_lo = value of sample PED_SAMPLE + LOW_THRESHOLD<br />
#Search the samples from PED_SAMPLE+1 to NSAMPLES-1 for the first sample with value >= thres_hi. If this threshold is not met, return the rough time and q_code=1.<br />
#Search the samples from the first sample with value >= thres_hi down to PED_SAMPLE to find the first sample (Y) with value <= thres_lo<br />
#If Y is > NSAMPLES-7, there are not enough samples to calculate upsampled values, return the rough time and q_code=1.<br />
#Calculate NUPSAMPLED (8) upsampled values, starting with Y-0.2. <br />
#If any upsampled value is negative, return the midpoint time, Y*10+5, and q_code=1.<br />
#Calculate two upsampling errors, as the difference between upsampled point 1 and sample Y, and the difference between upsampled point 2 and sample Y+1<br />
#Sum the errors and compare them with LIMIT_UPS_ERR, if this is exceeded then return the midpoint time, Y*10+5, and q_code=1.<br />
#Calculate the mean of the 2 errors, ups_err and the adjusted threshold, thres_adj = thres_lo + ups_err<br />
#Search the upsampled values from NUPSAMPLED-1 down to 0 to find upsampled point Z where the value <= thres_adj<br />
#If Z=NUPSAMPLED-1 or Z is not found, return the midpoint time, Y*10+5, and q_code=1.<br />
#Interpolate between the upsampled points Z and Z+1 to find the crossing time in units of sample/10 and relative to the first upsampled point<br />
#Calculate the leading edge time, le_time, as the crossing time found in previous step + Y*10-2, in units of sample/10 and relative to subset sample 0<br />
#Return time=le_time and q_code=0<br />
<br />
<br />
<br />
<h2>Signal maximum module</h2><br />
This returns the signal maximum<br />
#Inspect ADC values after sample X, find the first value which is less than its predecessor<br />
#Return value of the predecessor scaled down by 2^p <br />
<br />
<br />
<br />
<h2>Signal integral module</h2><br />
This returns the signal integral and overflow count<br />
#Sum ADC values from sample X to sample WINDOW_END, and count the number of samples with overflow bit set<br />
#Return integral scaled down by 2^m (return all bits set if value exceeds range maximum)<br />
#Return overflow count (return 7 if count>6)<br />
<br />
<br />
<br />
<br />
<br />
<br />
<h1> Error codes from Run 1602 </h1><br />
<br />
<br />
Settings used:<br />
<pre><br />
#define WINDOW_START 46 //earliest sample for start of hit<br />
#define WINDOW_END 130 //last sample for hit arrival, and last sample included in integral<br />
<br />
#define HIT_THRES 300 // "5 sigma" hit threshold *** set this VERY high to cut out persistent noise in a handful of channels ***<br />
#define NPED 16 // number of samples used for pedestal used to find hit. must be 2**integer<br />
#define NPED2 16 // number of samples used for pedestal calculated just before hit (returned, not used here). must be 2**integer<br />
<br />
// cdc_time<br />
#define HIGH_THRESHOLD 80 // 4 sigma threshold<br />
#define LOW_THRESHOLD 20 // 1 sigma threshold<br />
#define ROUGH_DT 24 // if pulse fails QA, return this many tenth-samples before threshold xing<br />
#define INT_SAMPLE 6 // if pulse fails QA, start integration with this sample <br />
<br />
//cdc_time good pulse criteria<br />
#define LIMIT_PED_MAX 511 //return rough time if any sample in 0 to PED_SAMPLE exceeds this<br />
#define LIMIT_ADC_MAX 4095 // return rough time if any sample in PED_SAMPLE+1 to NSAMPLES exceeds this<br />
<br />
// cdc_time upsampling<br />
#define NSAMPLES 15 //number of samples in subset of array to pass to cdc_time<br />
#define XTHR_SAMPLE 9 // the hit_thres xing sample is sample[9] passed into cdc_time, starting with sample[0]<br />
#define PED_SAMPLE 5 // take local ped as sample[5] passed into cdc_time<br />
#define NUPSAMPLED 8 // number of upsampled values to calculate, minimum is 8<br />
#define SET_ADC_MIN 20 // add an offset to the adc values to set the min value equal to SET_ADC_MIN<br />
#define LIMIT_UPS_ERR 30 // upsampling error tolerance, return midpoint time if error is greater than this<br />
</pre><br />
<br />
<br />
==Error codes with faulty channels included==<br />
<br />
Error codes are listed in the order that the event is removed from processing. ADC overflows are not identified by the C++ code as it only looks at Df125WindowRawData.<br />
<br />
{| border="1px" cellpadding="2" style="border-style:solid;"<br />
! q_code !! reason !! entries !! percent of total !! percent of q>0 entries<br />
|-<br />
| 5 || ADC value = 0 || 26458 || 2.274% || 31.048%<br />
|-<br />
| 6 || ADC value > 4095 || 0 || 0% || 0%<br />
|-<br />
| 7 || Pedestal > 511 || 44830 || 3.854% || 52.607%<br />
|-<br />
| 1 || ADC data did not go over threshold adc_thres_hi || 576 || 0.050% || 0.676%<br />
|-<br />
| 2 || Leading edge time is too late in the buffer to upsample || 82 || 0.007% || 0.096%<br />
|-<br />
| 8 || Upsampled value is negative || 15 || 0.001% || 0.018%<br />
|-<br />
| 9 || Upsampling error sum > 30 || 13225 || 1.137% || 15.519%<br />
|-<br />
| 3 || Last upsampled point is too low (below or equal to low timing threshold) || 28 || 0.002% || 0.033%<br />
|-<br />
| 4 || Upsampled points are too high (did not go below low timing threshold) || 2 || 0.000% || 0.002%<br />
|-<br />
| 0 || Good || 1078072 || 92.675% || <br />
|}<br />
<br />
<br />
<br />
<br />
==Error codes with most of faulty channels excluded from data==<br />
<br />
Error codes are listed in the order that the event is removed from processing. ADC overflows are not identified by the C++ code as it only looks at Df125WindowRawData.<br />
<br />
{| border="1px" cellpadding="2" style="border-style:solid;"<br />
! q_code !! reason !! entries !! percent of total !! percent of q>0 entries<br />
|-<br />
| 5 || ADC value = 0 || 26433 || 2.3% || 31%<br />
|-<br />
| 6 || ADC value > 4095 || 0 || 0% || 0%<br />
|-<br />
| 7 || Pedestal > 511 || 44747 || 3.9% || 53%<br />
|-<br />
| 1 || ADC data did not go over threshold adc_thres_hi || 575 || 0.050% || 0.68%<br />
|-<br />
| 2 || Leading edge time is too late in the buffer to upsample || 82 || 0.007% || 0.096%<br />
|-<br />
| 8 || Upsampled value is negative || 0 || 0% || 0%<br />
|-<br />
| 9 || Upsampling error sum > 30 || 13188 || 1.2% || 16%<br />
|-<br />
| 3 || Last upsampled point is too low (below or equal to low timing threshold) || 2 || 0.000% || 0.002%<br />
|-<br />
| 4 || Upsampled points are too high (did not go below low timing threshold) || 0 || 0% || 0%<br />
|-<br />
| 0 || Good || 1075754 || 93% || <br />
|}<br />
<br />
==Error codes with faulty channels included, mimicked overflow detection in C++ code==<br />
The C++ code is not finding overflows because it is only using Df125WindowRawData; overflows are in a different branch of DAQTree.<br />
The VHDL code will be able to find overflows by testing for sample value > 4095 because the overflow bit is passed in as a 13th sample value bit (bits 0-11 are the ADC value), so samples with the overflow bit set will have value > 4095. This was mimicked in the C++ code by testing for ADC value > 4094.<br />
<pre><br />
#define LIMIT_ADC_MAX 4094 // return rough time if any sample in PED_SAMPLE+1 to NSAMPLES exceeds this<br />
</pre><br />
<br />
{| border="1px" cellpadding="2" style="border-style:solid;"<br />
! q_code !! reason !! entries !! percent of total !! percent of q>0 entries<br />
|-<br />
| 5 || ADC value = 0 || 52559 || 3.9% || 25%<br />
|-<br />
| 6 || ADC value > 4094 || 97939 || 7.2% || 46%<br />
|-<br />
| 7 || Pedestal > 511 || 51244 || 3.8% || 24%<br />
|-<br />
| 1 || ADC data did not go over threshold adc_thres_hi || 9787 || 0.72% || 4.6%<br />
|-<br />
| 2 || Leading edge time is too late in the buffer to upsample || 700 || 0.051% || 0.33%<br />
|-<br />
| 8 || Upsampled value is negative || 15 || 0.001% || 0.007%<br />
|-<br />
| 9 || Upsampling error sum > 30 || 61 || 0.004% || 0.029%<br />
|-<br />
| 3 || Last upsampled point is too low (below or equal to low timing threshold) || 813 || 0.060% || 0.38%<br />
|-<br />
| 4 || Upsampled points are too high (did not go below low timing threshold) || 8 || 0.001% || 0.004%<br />
|-<br />
| 0 || Good || 1148835 || 84% || <br />
|}<br />
<br />
<br />
<br />
<br />
==Examples, in order of q code population (click image twice to expand)==<br />
<br />
=== Q=0, good ===<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_run1602_e0q0.png.png|thumb|x200px|entry 0 q 0]]<br />
|[[Image:cdc_run1602_e1q0.png.png|thumb|x200px|entry 1 q 0]]<br />
|[[Image:cdc_run1602_e2q0.png.png|thumb|x200px|entry 2 q 0]]<br />
|[[Image:cdc_run1602_e3q0.png.png|thumb|x200px|entry 3 q 0]]<br />
|}<br />
<br />
=== Q=6, overflow ===<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_run1602_e7q6.png.png|thumb|x200px|entry 7 q 6]]<br />
|[[Image:cdc_run1602_e8q6.png.png|thumb|x200px|entry 8 q 6]]<br />
|[[Image:cdc_run1602_e9q6.png.png|thumb|x200px|entry 9 q 6]]<br />
|[[Image:cdc_run1602_e16q6.png.png|thumb|x200px|entry 16 q 6]]<br />
|}<br />
<br />
=== Q=5, ADC value=0 ===<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_run1602_e51q5.png.png|thumb|x200px|entry 51 q 5]]<br />
|[[Image:cdc_run1602_e120q5.png.png|thumb|x200px|entry 120 q 5]]<br />
|[[Image:cdc_run1602_e125q5.png.png|thumb|x200px|entry 125 q 5]]<br />
|[[Image:cdc_run1602_e198q5.png.png|thumb|x200px|entry 198 q 5]]<br />
|}<br />
<br />
=== Q=7, Pedestal>511 ===<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_run1602_e6q7.png.png|thumb|x200px|entry 6 q 7]]<br />
|[[Image:cdc_run1602_e21q7.png.png|thumb|x200px|entry 21 q 7]]<br />
|[[Image:cdc_run1602_e23q7.png.png|thumb|x200px|entry 23 q 7]]<br />
|[[Image:cdc_run1602_e24q7.png.png|thumb|x200px|entry 24 q 7]]<br />
|}<br />
<br />
=== Q=1, ADC data<ADC_subset_value[PED_SAMPLE] + HIGH_THRESHOLD===<br />
<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_run1602_e15q1.png.png|thumb|x200px|entry 15 q 1]]<br />
|[[Image:cdc_run1602_e91q1.png.png|thumb|x200px|entry 91 q 1]]<br />
|[[Image:cdc_run1602_e165q1.png.png|thumb|x200px|entry 165 q 1]]<br />
|[[Image:cdc_run1602_e179q1.png.png|thumb|x200px|entry 179 q 1]]<br />
|}<br />
<br />
=== Q=3, last upsampled point is too low (very rare with fully functioning fADCs) ===<br />
<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_run1602_e4073q3.png.png|thumb|x200px|entry 4073 q 3]]<br />
|[[Image:cdc_run1602_e5548q3.png.png|thumb|x200px|entry 5548 q 3]]<br />
|[[Image:cdc_run1602_e8618q3.png.png|thumb|x200px|entry 8618 q 3]]<br />
|[[Image:cdc_run1602_e9358q3.png.png|thumb|x200px|entry 9358 q 3]]<br />
|}<br />
<br />
=== Q=2, leading edge time too late to upsample (very rare with fully functioning fADCs) ===<br />
<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_run1602_e2091q2.png.png|thumb|x200px|entry 2091 q 2]]<br />
|[[Image:cdc_run1602_e3950q2.png.png|thumb|x200px|entry 3950 q 2]]<br />
|[[Image:cdc_run1602_e6905q2.png.png|thumb|x200px|entry 6905 q 2]]<br />
|[[Image:cdc_run1602_e9876q2.png.png|thumb|x200px|entry 9876 q 2]]<br />
|}<br />
<br />
=== Q=8, calculated an upsampled value < 0 (very rare with fully functioning fADCs) ===<br />
<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_run1602_e4284q8.png|thumb|x200px|entry 4284 q 8]]<br />
|[[Image:cdc_run1602_e99090q8.png|thumb|x200px|entry 99090 q 8]]<br />
|[[Image:cdc_run1602_e251941q8.png|thumb|x200px|entry 251941 q 8]]<br />
|[[Image:cdc_run1602_e544903q8.png|thumb|x200px|entry 544903 q 8]]<br />
|}<br />
<br />
=== Q=4, upsampled values too high (very rare with fully functioning fADCs) ===<br />
<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_run1602_e16257q4.png|thumb|x200px|entry 16257 q 4]]<br />
|[[Image:cdc_run1602_e74085q4.png|thumb|x200px|entry 74085 q 4]]<br />
|[[Image:cdc_run1602_e205536q4.png|thumb|x200px|entry 205536 q 4]]<br />
|[[Image:cdc_run1602_e256051q4.png|thumb|x200px|entry 256051 q 4]]<br />
|}<br />
<br />
==Upsampled data - old example==<br />
<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_upsampled2.png|thumb|x250px|ADC samples in (big circles) and upsampled data out (small blue dots) ]]<br />
|[[Image:cdc_upsampled2_front.png|thumb|x250px|ADC samples in (big circles) and upsampled data out (small blue dots) ]]<br />
|[[Image:cdc_upsampled2_middle.png|thumb|x250px|ADC samples in (big circles) and upsampled data out (small blue dots) ]]<br />
|}<br />
<br />
== Upsampling error check prior to error correction - copied from [[CDC_run_1280_bad_events]]==<br />
<br />
After excluding known [[CDC_bad_channels]] I compared the upsampled data with the original samples for the first 10000 events of run 1602. This is a high-intensity run so some of the pedestals are lower than they should be. <br />
<br/><br />
ups_err1 is the upsampled value iubuf[1] - the original sample adc[adc_sample_lo]<br />
<br/><br />
ups_err2 is the upsampled value iubuf[6] - the original sample adc[adc_sample_lo+1]<br />
<br/><br />
<pre><br />
q_code list:<br />
0: Good<br />
1: ADC data did not go over threshold adc_thres_hi <br />
2: Leading edge time is outside the upsampled region (cross adc_thres_lo too late in the buffer subset ) <br />
3: Last upsampled point is <= low timing threshold<br />
4: Upsampled points did not go below low timing threshold<br />
</pre><br />
Looking at upsampling errors - occur when gradient is very large<br />
<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_adcq0.png|thumb|x200px|ADC sample subset for q code 0 ]]<br />
|[[Image:cdc_adcq4.png|thumb|x200px|ADC sample subset for q code 4]]<br />
|[[Image:cdc_adcq4b.png|thumb|x200px|ADC sample subset for q code 4, normalised to min value]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|[[Image:uerr1_q4.png|thumb|x200px|Error in upsampled value vs original sample value adc_sample_lo, q code 4]]<br />
|[[Image:uerr2_q4.png|thumb|x200px|Error in upsampled value vs original sample value adc_sample_lo+1, q code 4]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|[[Image:ue2e1q0.png|thumb|x200px|Error in upsampled values, q code 0]]<br />
|[[Image:ue2e1q4.png|thumb|x200px|Error in upsampled values, q code 4]]<br />
|[[Image:uediffq0.png|thumb|x200px|Difference in error in upsampled values, q code 0 (blue) and 4 (pink)]]<br />
|}<br />
<br />
Following this the error correction step was added to the algorithm, where the sum of errors ups_err1+ups_err2 is calculated and compared with LIMIT_UPS_ERR and then, if below this limit, halved (to calculate the mean) and subtracted from the upsampled data. The corrected upsampled points are the green circles in the 'example of Q code' plots above.</div>Nsjarvishttps://halldweb1.jlab.org/wiki/index.php?title=FADC_Data_Format_February_10,_2015&diff=63542FADC Data Format February 10, 20152015-02-10T13:04:34Z<p>Nsjarvis: /* Location and Time */</p>
<hr />
<div>= Location and Time =<br />
<br />
'''Room:''' CC L207<br />
<br />
'''Time:''' 2pm.<br />
<br />
= Remote Connection =<br />
(if problems, call phone in conference room: 757-269-6460 might not be the correct number)<br />
# To join via Polycom room system go to the IP Address: 199.48.152.152 ([http://bjn.vc bjn.vc]) and enter the meeting ID: 589693655.<br />
# To join via a Web Browser, go to the page [https://bluejeans.com/589693655] https://bluejeans.com/589693655.<br />
# To join via phone, use one of the following numbers and the Conference ID: 589693655<br />
#* US or Canada: +1 408 740 7256 or <br />
#* US or Canada: +1 888 240 2560<br />
<br />
[[Connect to the Data Challenge Meetings|More information on connecting to bluejeans is here]]<br />
<br />
Specific instructions for connecting via polycom:<br />
<br />
* Turn polycom on if necessary <br />
* With the polycom, place a call at 199.48.152.152<br />
* Press # to enable the polycom keypad, then enter the meeting id: 589693655 and #<br />
* You may have to unmute the microphone: #*4<br />
* Turn the computer on if needed<br />
<br />
= Agenda =<br />
* [[FADC_Data_Format_February_3,_2015|Previous meeting (Feb 3, 2015)]]<br />
* Status of FADC125 Firmware<br />
<br />
<br />
== Useful Links ==<br />
* [[CDC_algo|Timing algorithm - updated to include latest revisions]]<br />
* [http://argus.phys.uregina.ca/cgi-bin/private/DocDB/ShowDocument?docid=2274 fADC125 Data Format Specification Document]<br />
* [[:File:FADC125_dataformat_250_modes.docx|Data format for 250 modes on fADC125 from Cody, Aug 15 2014]]<br />
* [[:File:FADC250_modes_2.docx|FA250 modes 2 from Ed and Hai, Feb 18 2014]]<br />
* [[:File:FADC250_V2_ADC_FPGA_V90D.docx|FIRMWARE for FADC250 Ver2 ADC FPGA, Sept 2014?]]<br />
* [http://www.jlab.org/Hall-D/detector/fdc/FDC_pulse_data_format.pptx FDC_pulse_data_format]<br />
* [[CDC_readout_requirements|CDC readout needs]] [[CDC_garfield_calcs|Garfield calcs]]<br />
* [[CDC_run_985]] [[CDC_run_970]]<br />
<br />
=Minutes=</div>Nsjarvishttps://halldweb1.jlab.org/wiki/index.php?title=FADC_Data_Format_February_10,_2015&diff=63541FADC Data Format February 10, 20152015-02-09T23:03:55Z<p>Nsjarvis: Created page with "= Location and Time = '''Room:''' CC F228?? '''Time:''' 2pm. = Remote Connection = (if problems, call phone in conference room: 757-269-6460 might not be the correct number) #..."</p>
<hr />
<div>= Location and Time =<br />
<br />
'''Room:''' CC F228??<br />
<br />
'''Time:''' 2pm.<br />
<br />
= Remote Connection =<br />
(if problems, call phone in conference room: 757-269-6460 might not be the correct number)<br />
# To join via Polycom room system go to the IP Address: 199.48.152.152 ([http://bjn.vc bjn.vc]) and enter the meeting ID: 589693655.<br />
# To join via a Web Browser, go to the page [https://bluejeans.com/589693655] https://bluejeans.com/589693655.<br />
# To join via phone, use one of the following numbers and the Conference ID: 589693655<br />
#* US or Canada: +1 408 740 7256 or <br />
#* US or Canada: +1 888 240 2560<br />
<br />
[[Connect to the Data Challenge Meetings|More information on connecting to bluejeans is here]]<br />
<br />
Specific instructions for connecting via polycom:<br />
<br />
* Turn polycom on if necessary <br />
* With the polycom, place a call at 199.48.152.152<br />
* Press # to enable the polycom keypad, then enter the meeting id: 589693655 and #<br />
* You may have to unmute the microphone: #*4<br />
* Turn the computer on if needed<br />
<br />
= Agenda =<br />
* [[FADC_Data_Format_February_3,_2015|Previous meeting (Feb 3, 2015)]]<br />
* Status of FADC125 Firmware<br />
<br />
<br />
== Useful Links ==<br />
* [[CDC_algo|Timing algorithm - updated to include latest revisions]]<br />
* [http://argus.phys.uregina.ca/cgi-bin/private/DocDB/ShowDocument?docid=2274 fADC125 Data Format Specification Document]<br />
* [[:File:FADC125_dataformat_250_modes.docx|Data format for 250 modes on fADC125 from Cody, Aug 15 2014]]<br />
* [[:File:FADC250_modes_2.docx|FA250 modes 2 from Ed and Hai, Feb 18 2014]]<br />
* [[:File:FADC250_V2_ADC_FPGA_V90D.docx|FIRMWARE for FADC250 Ver2 ADC FPGA, Sept 2014?]]<br />
* [http://www.jlab.org/Hall-D/detector/fdc/FDC_pulse_data_format.pptx FDC_pulse_data_format]<br />
* [[CDC_readout_requirements|CDC readout needs]] [[CDC_garfield_calcs|Garfield calcs]]<br />
* [[CDC_run_985]] [[CDC_run_970]]<br />
<br />
=Minutes=</div>Nsjarvishttps://halldweb1.jlab.org/wiki/index.php?title=FADC_FPGA_Programming_Meetings&diff=63540FADC FPGA Programming Meetings2015-02-09T23:03:02Z<p>Nsjarvis: </p>
<hr />
<div>This series of meetings discusses schedules and requirements for the fADC125 and fADC250 FPGA programming.<br />
<hr><br />
*[[FADC Data Format February 10, 2015| February 10, 2015]]<br />
*[[FADC Data Format February 3, 2015| February 3, 2015]]<br />
*[[FADC Data Format January 27, 2015| January 27, 2015]]<br />
*[[FADC Data Format January 20, 2015| January 20, 2015]]<br />
*[[FADC Data Format January 13, 2015| January 13, 2015]]<br />
*[[FADC Data Format December 9, 2014| December 9, 2014]]<br />
*[[FADC Data Format November 25, 2014| November 25, 2014]]<br />
*[[FADC Data Format November 11, 2014| November 11, 2014]]<br />
*[[FADC Data Format October 14, 2014| October 14, 2014]]<br />
*[[FADC Data Format October 1, 2014| October 1, 2014]]<br />
*[[FADC Data Format September 16, 2014| September 16, 2014]]<br />
*[[FADC Data Format September 2, 2014| September 2, 2014]]<br />
*[[FADC Data Format August 19, 2014| August 19, 2014]]<br />
*[[FADC Data Format July 22, 2014| July 22, 2014]]<br />
*[[FADC Data Format June 17, 2014| June 17, 2014]]<br />
*[[FADC Data Format May 20, 2014| May 20, 2014]]<br />
*[[FADC Data Format Apr 22, 2014| Apr 22, 2014]]<br />
*[[FADC Data Format Apr 8, 2014| Apr 8, 2014]]<br />
*[[FADC Data Format Mar 25, 2014| Mar 25, 2014]]<br />
*[[FADC Data Format Mar 11, 2014| Mar 11, 2014]]<br />
*[[FADC Data Format Feb 25, 2014| Feb 25, 2014]]<br />
*[[FADC Data Format Feb 11, 2014| Feb 11, 2014]]<br />
*[[FADC Data Format Jan 28, 2014| Jan 28, 2014]]<br />
*[[FADC FPGA Programming Jan 14, 2014| Jan 14, 2014]]<br />
*[[December 17, 2013 Tracking FADC| Dec 17, 2013]]</div>Nsjarvishttps://halldweb1.jlab.org/wiki/index.php?title=CDC_prototype_runs_at_CMU&diff=63439CDC prototype runs at CMU2015-02-06T14:41:39Z<p>Nsjarvis: /* CDC measurements */</p>
<hr />
<div>The prototype runs at CMU were made with the prototype sitting along the top of one scintillator. The scintillator is only slightly larger than the prototype.<br/><br />
Run 2016 at JLab was a cosmics run with the BCAL trigger. <br/><br />
The CDC runs at CMU used two scintillators in coincidence, the scintillators were above and below the CDC, separated by approx 2m. We had two sets of scintillators, one set are approx 9" wide and 6ft long, the smaller set are approx 9" x 19". Using the small scintillators, the cosmic rays would have been much closer to vertical than for the recent prototype and JLab measurements. Using the large scintillators, oriented parallel to the straw tubes, the cosmic ray angles would be similar to those with the recent prototype setup and at JLab. <br />
<p> First article/prototype preamp & HVB were used for all but one of the prototype runs. One run was made using JLab preamp & HVB with all other settings unaltered since the previous run; as expected, the resulting data look very similar. </p> <br />
<br />
==Recent prototype runs==<br />
<br />
{| border="0" cellpadding="2" <br />
|+ Prototype, 2100V, 50/50 Ar/CO2<br />
|[[Image:cdc_amp32747.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t32747.png|thumb|x200px|drift time]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|+ Prototype, 2100V, 55/45 Ar/CO2<br />
|[[Image:cdc_amp32759good.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t32759good.png|thumb|x200px|drift time]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|+ Prototype, 2100V, 55/45 Ar/CO2 JLab electronics<br />
|[[Image:cdc_amp32775.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t32775.png|thumb|x200px|drift time]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|+ Prototype, 2100V, 60/40 Ar/CO2<br />
|[[Image:cdc_amp32756.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t32756.png|thumb|x200px|drift time]]<br />
|}<br />
<br />
==CDC measurements at JLab==<br />
<br />
{| border="0" cellpadding="2" <br />
|+ CDC straw 496 2100V JLab run 2016 (cosmics, BCAL trigger)<br />
|[[Image:cdc_amp2016_496.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t2016_496.png|thumb|x200px|drift time]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|+ CDC (sum) 2100V JLab run 2016 (cosmics, BCAL trigger)<br />
|[[Image:cdc_amp2016.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t2016.png|thumb|x200px|drift time]]<br />
|}<br />
<br />
==CDC measurements at CMU in 2013==<br />
<br />
{| border="0" cellpadding="2" <br />
|+ CDC (72ch) at CMU, 2100V, 50/50 Ar/CO2 with large scint paddles along the length of the CDC<br />
|[[Image:cdc_amp32290.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t32290.png|thumb|x200px|drift time w terrible fit]]<br />
|}<br />
<br />
<br />
CDC at CMU had MPV at ~190 for 2110V, 50/50 Ar/CO2. <br/><br />
<br />
CDC wire is 20um and straw radius is 0.77cm, prototype wire is 17.8um (7 mil), and prototype straw radius is 0.79375cm.<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_excerpt.png|thumb|x200px|from Blum & Rolandi]]<br />
|}<br />
<br />
<pre><br />
root [4] Double_t prototype = 1.0/log((Double_t)0.79375/(Double_t)17.8)<br />
root [5] Double_t cdc = 1.0/log((Double_t)0.77/(Double_t)20.0)<br />
root [6] prototype/cdc<br />
(double)1.04723572482852867e+00<br />
</pre><br />
<br />
<pre><br />
root [0] Double_t prototype_observed_mpv = 204<br />
root [1] Double_t cdc_observed_mpv = 172<br />
root [2] prototype_observed_mpv/cdc_observed_mpv<br />
(double)1.18604651162790709e+00<br />
</pre></div>Nsjarvishttps://halldweb1.jlab.org/wiki/index.php?title=CDC_prototype_runs_at_CMU&diff=63438CDC prototype runs at CMU2015-02-06T14:40:35Z<p>Nsjarvis: </p>
<hr />
<div>The prototype runs at CMU were made with the prototype sitting along the top of one scintillator. The scintillator is only slightly larger than the prototype.<br/><br />
Run 2016 at JLab was a cosmics run with the BCAL trigger. <br/><br />
The CDC runs at CMU used two scintillators in coincidence, the scintillators were above and below the CDC, separated by approx 2m. We had two sets of scintillators, one set are approx 9" wide and 6ft long, the smaller set are approx 9" x 19". Using the small scintillators, the cosmic rays would have been much closer to vertical than for the recent prototype and JLab measurements. Using the large scintillators, oriented parallel to the straw tubes, the cosmic ray angles would be similar to those with the recent prototype setup and at JLab. <br />
<p> First article/prototype preamp & HVB were used for all but one of the prototype runs. One run was made using JLab preamp & HVB with all other settings unaltered since the previous run; as expected, the resulting data look very similar. </p> <br />
<br />
==Recent prototype runs==<br />
<br />
{| border="0" cellpadding="2" <br />
|+ Prototype, 2100V, 50/50 Ar/CO2<br />
|[[Image:cdc_amp32747.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t32747.png|thumb|x200px|drift time]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|+ Prototype, 2100V, 55/45 Ar/CO2<br />
|[[Image:cdc_amp32759good.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t32759good.png|thumb|x200px|drift time]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|+ Prototype, 2100V, 55/45 Ar/CO2 JLab electronics<br />
|[[Image:cdc_amp32775.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t32775.png|thumb|x200px|drift time]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|+ Prototype, 2100V, 60/40 Ar/CO2<br />
|[[Image:cdc_amp32756.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t32756.png|thumb|x200px|drift time]]<br />
|}<br />
<br />
==CDC measurements==<br />
<br />
{| border="0" cellpadding="2" <br />
|+ CDC straw 496 2100V JLab run 2016 (cosmics, BCAL trigger)<br />
|[[Image:cdc_amp2016_496.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t2016_496.png|thumb|x200px|drift time]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|+ CDC (sum) 2100V JLab run 2016 (cosmics, BCAL trigger)<br />
|[[Image:cdc_amp2016.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t2016.png|thumb|x200px|drift time]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|+ CDC (72ch) at CMU, 2100V, 50/50 Ar/CO2 with large scint paddles along the length of the CDC<br />
|[[Image:cdc_amp32290.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t32290.png|thumb|x200px|drift time w terrible fit]]<br />
|}<br />
<br />
<br />
CDC at CMU had MPV at ~190 for 2110V, 50/50 Ar/CO2. <br/><br />
<br />
CDC wire is 20um and straw radius is 0.77cm, prototype wire is 17.8um (7 mil), and prototype straw radius is 0.79375cm.<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_excerpt.png|thumb|x200px|from Blum & Rolandi]]<br />
|}<br />
<br />
<pre><br />
root [4] Double_t prototype = 1.0/log((Double_t)0.79375/(Double_t)17.8)<br />
root [5] Double_t cdc = 1.0/log((Double_t)0.77/(Double_t)20.0)<br />
root [6] prototype/cdc<br />
(double)1.04723572482852867e+00<br />
</pre><br />
<br />
<pre><br />
root [0] Double_t prototype_observed_mpv = 204<br />
root [1] Double_t cdc_observed_mpv = 172<br />
root [2] prototype_observed_mpv/cdc_observed_mpv<br />
(double)1.18604651162790709e+00<br />
</pre></div>Nsjarvishttps://halldweb1.jlab.org/wiki/index.php?title=CDC_prototype_runs_at_CMU&diff=63429CDC prototype runs at CMU2015-02-06T00:27:13Z<p>Nsjarvis: </p>
<hr />
<div>The prototype runs at CMU were made with the prototype sitting along the top of one scintillator. The scintillator is only slightly larger than the prototype.<br/><br />
Run 2016 at JLab was a cosmics run with the BCAL trigger. <br/><br />
The CDC run at CMU used two scintillators in coincidence, the scintillators were above and below the CDC, separated by approx 2m, and are 9" wide and 6ft long. <s>The cosmic rays would have been much closer to vertical than for the prototype and JLab measurements.</s>The run data on this page (32990) were collected with the large paddles above and below the CDC, running along its length.<br/> <br />
<p> First article/prototype preamp & HVB were used for all but one of the prototype runs. One run was made using JLab preamp & HVB with all other settings unaltered since the previous run; as expected, the resulting data look very similar. </p> <br />
<br />
<br />
{| border="0" cellpadding="2" <br />
|+ Prototype, 2100V, 50/50 Ar/CO2<br />
|[[Image:cdc_amp32747.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t32747.png|thumb|x200px|drift time]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|+ Prototype, 2100V, 55/45 Ar/CO2<br />
|[[Image:cdc_amp32759good.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t32759good.png|thumb|x200px|drift time]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|+ Prototype, 2100V, 55/45 Ar/CO2 JLab electronics<br />
|[[Image:cdc_amp32775.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t32775.png|thumb|x200px|drift time]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|+ Prototype, 2100V, 60/40 Ar/CO2<br />
|[[Image:cdc_amp32756.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t32756.png|thumb|x200px|drift time]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|+ CDC straw 496 2100V JLab run 2016 (cosmics, BCAL trigger)<br />
|[[Image:cdc_amp2016_496.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t2016_496.png|thumb|x200px|drift time]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|+ CDC (sum) 2100V JLab run 2016 (cosmics, BCAL trigger)<br />
|[[Image:cdc_amp2016.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t2016.png|thumb|x200px|drift time]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|+ CDC (72ch) at CMU, 2100V, 50/50 Ar/CO2 with large scint paddles along the length of the CDC<br />
|[[Image:cdc_amp32290.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t32290.png|thumb|x200px|drift time w terrible fit]]<br />
|}<br />
<br />
<br />
CDC at CMU had MPV at ~190 for 2110V, 50/50 Ar/CO2. <br/><br />
<br />
CDC wire is 20um and straw radius is 0.77cm, prototype wire is 17.8um (7 mil), and prototype straw radius is 0.79375cm.<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_excerpt.png|thumb|x200px|from Blum & Rolandi]]<br />
|}<br />
<br />
<pre><br />
root [4] Double_t prototype = 1.0/log((Double_t)0.79375/(Double_t)17.8)<br />
root [5] Double_t cdc = 1.0/log((Double_t)0.77/(Double_t)20.0)<br />
root [6] prototype/cdc<br />
(double)1.04723572482852867e+00<br />
</pre><br />
<br />
<pre><br />
root [0] Double_t prototype_observed_mpv = 204<br />
root [1] Double_t cdc_observed_mpv = 172<br />
root [2] prototype_observed_mpv/cdc_observed_mpv<br />
(double)1.18604651162790709e+00<br />
</pre></div>Nsjarvishttps://halldweb1.jlab.org/wiki/index.php?title=CDC_prototype_runs_at_CMU&diff=63428CDC prototype runs at CMU2015-02-06T00:25:00Z<p>Nsjarvis: </p>
<hr />
<div>The prototype runs at CMU were made with the prototype sitting along the top of one scintillator. The scintillator is only slightly larger than the prototype.<br/><br />
Run 2016 at JLab was a cosmics run with the BCAL trigger. <br/><br />
The CDC run at CMU used two scintillators in coincidence, the scintillators were above and below the CDC, separated by approx 2m, and are 9" wide and 6ft long. <s>The cosmic rays would have been much closer to vertical than for the prototype and JLab measurements.</s>The run data on this page (32990) were collected with the large paddles above and below the CDC, running along its length.<br/> <br />
<p> First article/prototype preamp & HVB were used for all but one of the prototype runs. One run was made using JLab preamp & HVB with all other settings unaltered since the previous run; as expected, the resulting data look very similar. </p> <br />
<br />
<br />
{| border="0" cellpadding="2" <br />
|+ Prototype, 2100V, 50/50 Ar/CO2<br />
|[[Image:cdc_amp32747.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t32747.png|thumb|x200px|drift time]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|+ Prototype, 2100V, 55/45 Ar/CO2<br />
|[[Image:cdc_amp32759good.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t32759good.png|thumb|x200px|drift time]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|+ Prototype, 2100V, 55/45 Ar/CO2 JLab electronics<br />
|[[Image:cdc_amp32775.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t32775.png|thumb|x200px|drift time]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|+ Prototype, 2100V, 60/40 Ar/CO2<br />
|[[Image:cdc_amp32756.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t32756.png|thumb|x200px|drift time]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|+ CDC straw 496 2100V JLab run 2016 (cosmics, BCAL trigger)<br />
|[[Image:cdc_amp2016_496.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t2016_496.png|thumb|x200px|drift time]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|+ CDC (sum) 2100V JLab run 2016 (cosmics, BCAL trigger)<br />
|[[Image:cdc_amp2016.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t2016.png|thumb|x200px|drift time]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|+ CDC (72ch) at CMU, 2100V, 50/50 Ar/CO2 with large scint paddles along the length of the CDC<br />
|[[Image:cdc_amp32290.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t32290.png|thumb|x200px|drift time w terrible fit]]<br />
|}<br />
<br />
<br />
CDC at CMU had MPV at ~190 for 2110V, 50/50 Ar/CO2. <br/><br />
<br />
CDC wire is 20um and straw radius is 0.77cm, prototype wire is 17.8um (7 mil), and prototype straw radius is 0.79375cm.<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_excerpt.png|thumb|x200px|from Blum & Rolandi]]<br />
|}<br />
<br />
<pre><br />
root [4] Double_t prototype = 1.0/log((Double_t)0.79375/(Double_t)17.8)<br />
root [5] Double_t cdc = 1.0/log((Double_t)0.77/(Double_t)20.0)<br />
root [6] prototype/cdc<br />
(double)1.04723572482852867e+00<br />
</pre></div>Nsjarvishttps://halldweb1.jlab.org/wiki/index.php?title=File:Cdc_excerpt.png&diff=63427File:Cdc excerpt.png2015-02-06T00:17:55Z<p>Nsjarvis: </p>
<hr />
<div></div>Nsjarvishttps://halldweb1.jlab.org/wiki/index.php?title=CDC_prototype_runs_at_CMU&diff=63426CDC prototype runs at CMU2015-02-06T00:17:19Z<p>Nsjarvis: </p>
<hr />
<div>The prototype runs at CMU were made with the prototype sitting along the top of one scintillator. The scintillator is only slightly larger than the prototype.<br/><br />
Run 2016 at JLab was a cosmics run with the BCAL trigger. <br/><br />
The CDC run at CMU used two scintillators in coincidence, the scintillators were above and below the CDC, separated by approx 2m, and are 9" wide and 6ft long. <s>The cosmic rays would have been much closer to vertical than for the prototype and JLab measurements.</s>The run data on this page (32990) were collected with the large paddles above and below the CDC, running along its length.<br/> <br />
<p> First article/prototype preamp & HVB were used for all but one of the prototype runs. One run was made using JLab preamp & HVB with all other settings unaltered since the previous run; as expected, the resulting data look very similar. </p> <br />
<br />
<br />
{| border="0" cellpadding="2" <br />
|+ Prototype, 2100V, 50/50 Ar/CO2<br />
|[[Image:cdc_amp32747.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t32747.png|thumb|x200px|drift time]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|+ Prototype, 2100V, 55/45 Ar/CO2<br />
|[[Image:cdc_amp32759good.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t32759good.png|thumb|x200px|drift time]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|+ Prototype, 2100V, 55/45 Ar/CO2 JLab electronics<br />
|[[Image:cdc_amp32775.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t32775.png|thumb|x200px|drift time]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|+ Prototype, 2100V, 60/40 Ar/CO2<br />
|[[Image:cdc_amp32756.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t32756.png|thumb|x200px|drift time]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|+ CDC straw 496 2100V JLab run 2016 (cosmics, BCAL trigger)<br />
|[[Image:cdc_amp2016_496.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t2016_496.png|thumb|x200px|drift time]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|+ CDC (sum) 2100V JLab run 2016 (cosmics, BCAL trigger)<br />
|[[Image:cdc_amp2016.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t2016.png|thumb|x200px|drift time]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|+ CDC (72ch) at CMU, 2100V, 50/50 Ar/CO2 with large scint paddles along the length of the CDC<br />
|[[Image:cdc_amp32290.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t32290.png|thumb|x200px|drift time w terrible fit]]<br />
|}<br />
<br />
<br />
CDC at CMU had MPV at ~190 for 2110V, 50/50 Ar/CO2. <br/><br />
<br />
CDC wire is 20um and straw radius is 0.77cm, prototype wire is 17.8um (7 mil), and prototype straw radius is 0.79375cm.<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_excerpt.png|thumb|x200px|from Blum & Rolandi]]<br />
|}</div>Nsjarvishttps://halldweb1.jlab.org/wiki/index.php?title=CDC_prototype_runs_at_CMU&diff=63425CDC prototype runs at CMU2015-02-06T00:16:35Z<p>Nsjarvis: </p>
<hr />
<div>The prototype runs at CMU were made with the prototype sitting along the top of one scintillator. The scintillator is only slightly larger than the prototype.<br/><br />
Run 2016 at JLab was a cosmics run with the BCAL trigger. <br/><br />
The CDC run at CMU used two scintillators in coincidence, the scintillators were above and below the CDC, separated by approx 2m, and are 9" wide and 6ft long. <s>The cosmic rays would have been much closer to vertical than for the prototype and JLab measurements.</s>The run data on this page (32990) were collected with the large paddles above and below the CDC, running along its length.<br/> <br />
<p> First article/prototype preamp & HVB were used for all but one of the prototype runs. One run was made using JLab preamp & HVB with all other settings unaltered since the previous run; as expected, the resulting data look very similar. </p> <br />
<br />
<br />
{| border="0" cellpadding="2" <br />
|+ Prototype, 2100V, 50/50 Ar/CO2<br />
|[[Image:cdc_amp32747.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t32747.png|thumb|x200px|drift time]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|+ Prototype, 2100V, 55/45 Ar/CO2<br />
|[[Image:cdc_amp32759good.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t32759good.png|thumb|x200px|drift time]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|+ Prototype, 2100V, 55/45 Ar/CO2 JLab electronics<br />
|[[Image:cdc_amp32775.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t32775.png|thumb|x200px|drift time]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|+ Prototype, 2100V, 60/40 Ar/CO2<br />
|[[Image:cdc_amp32756.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t32756.png|thumb|x200px|drift time]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|+ CDC straw 496 2100V JLab run 2016 (cosmics, BCAL trigger)<br />
|[[Image:cdc_amp2016_496.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t2016_496.png|thumb|x200px|drift time]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|+ CDC (sum) 2100V JLab run 2016 (cosmics, BCAL trigger)<br />
|[[Image:cdc_amp2016.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t2016.png|thumb|x200px|drift time]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|+ CDC (72ch) at CMU, 2100V, 50/50 Ar/CO2 with large scint paddles along the length of the CDC<br />
|[[Image:cdc_amp32290.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t32290.png|thumb|x200px|drift time w terrible fit]]<br />
|}<br />
<br />
<br />
CDC at CMU had MPV at ~190 for 2110V, 50/50 Ar/CO2. <br/><br />
<br />
CDC wire is 20um and straw radius is 0.77cm, prototype wire is 17.8um (7 mil), and prototype straw radius is 0.79375cm.</div>Nsjarvishttps://halldweb1.jlab.org/wiki/index.php?title=CDC_prototype_runs_at_CMU&diff=63420CDC prototype runs at CMU2015-02-05T21:20:20Z<p>Nsjarvis: </p>
<hr />
<div>The prototype runs at CMU were made with the prototype sitting along the top of one scintillator. The scintillator is only slightly larger than the prototype.<br/><br />
Run 2016 at JLab was a cosmics run with the BCAL trigger. <br/><br />
The CDC run at CMU used two scintillators in coincidence, the scintillators were above and below the CDC, separated by approx 2m, and are 9" wide. The cosmic rays would have been much closer to vertical than for the prototype and JLab measurements.<br/> <br />
<p> First article/prototype preamp & HVB were used for all but one of the prototype runs. One run was made using JLab preamp & HVB with all other settings unaltered since the previous run; as expected, the resulting data look very similar. </p> <br />
<br />
<br />
{| border="0" cellpadding="2" <br />
|+ Prototype, 2100V, 50/50 Ar/CO2<br />
|[[Image:cdc_amp32747.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t32747.png|thumb|x200px|drift time]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|+ Prototype, 2100V, 55/45 Ar/CO2<br />
|[[Image:cdc_amp32759good.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t32759good.png|thumb|x200px|drift time]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|+ Prototype, 2100V, 55/45 Ar/CO2 JLab electronics<br />
|[[Image:cdc_amp32775.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t32775.png|thumb|x200px|drift time]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|+ Prototype, 2100V, 60/40 Ar/CO2<br />
|[[Image:cdc_amp32756.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t32756.png|thumb|x200px|drift time]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|+ CDC straw 496 2100V JLab run 2016 (cosmics, BCAL trigger)<br />
|[[Image:cdc_amp2016_496.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t2016_496.png|thumb|x200px|drift time]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|+ CDC (sum) 2100V JLab run 2016 (cosmics, BCAL trigger)<br />
|[[Image:cdc_amp2016.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t2016.png|thumb|x200px|drift time]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|+ CDC (72ch) at CMU, 2100V, 50/50 Ar/CO2 with large scint paddles along the length of the CDC<br />
|[[Image:cdc_amp32290.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t32290.png|thumb|x200px|drift time w terrible fit]]<br />
|}<br />
<br />
<br />
CDC at CMU had MPV at ~190 for 2110V, 50/50 Ar/CO2. <br/><br />
<br />
CDC wire is 20um and straw radius is 0.77cm, prototype wire is 17.8um (7 mil), and prototype straw radius is 0.79375cm.</div>Nsjarvishttps://halldweb1.jlab.org/wiki/index.php?title=CDC_prototype_runs_at_CMU&diff=63419CDC prototype runs at CMU2015-02-05T21:19:43Z<p>Nsjarvis: </p>
<hr />
<div>The prototype runs at CMU were made with the prototype sitting along the top of one scintillator. The scintillator is only slightly larger than the prototype.<br/><br />
Run 2016 at JLab was a cosmics run with the BCAL trigger. <br/><br />
The CDC run at CMU used two scintillators in coincidence, the scintillators were above and below the CDC, separated by approx 2m, and are 9" wide. The cosmic rays would have been much closer to vertical than for the prototype and JLab measurements.<br/> <br />
<p> First article/prototype preamp & HVB were used for all but one of the prototype runs. One run was made using JLab preamp & HVB with all other settings unaltered since the previous run; as expected, the resulting data look very similar. </p> <br />
<br />
<br />
{| border="0" cellpadding="2" <br />
|+ Prototype, 2100V, 50/50 Ar/CO2<br />
|[[Image:cdc_amp32747.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t32747.png|thumb|x200px|drift time]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|+ Prototype, 2100V, 55/45 Ar/CO2<br />
|[[Image:cdc_amp32759good.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t32759good.png|thumb|x200px|drift time]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|+ Prototype, 2100V, 55/45 Ar/CO2 JLab electronics<br />
|[[Image:cdc_amp32775.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t32775.png|thumb|x200px|drift time]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|+ Prototype, 2100V, 60/40 Ar/CO2<br />
|[[Image:cdc_amp32756.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t32756.png|thumb|x200px|drift time]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|+ CDC straw 496 2100V JLab run 2016 (cosmics, BCAL trigger)<br />
|[[Image:cdc_amp2016_496.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t2016_496.png|thumb|x200px|drift time]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|+ CDC (sum) 2100V JLab run 2016 (cosmics, BCAL trigger)<br />
|[[Image:cdc_amp2016.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t2016.png|thumb|x200px|drift time]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|+ CDC (72ch) at CMU, 2100V, 50/50 Ar/CO2 with large scint paddles along the length of the CDC<br />
|[[Image:cdc_amp32290.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t32290.png|thumb|x200px|drift time w terrible fit]]<br />
|}<br />
<br />
<br />
CDC at CMU had MPV at ~190 for 2110V, 50/50 Ar/CO2. <br/><br />
<br />
CDC wire is 20um and straw radius is 0.77cm, prototype wire is 17.8um (7 mil), and prototype straw radius is 0.79375cm.<br />
<br />
{| border="0" cellpadding="2" style="background-color:gray"<br />
|+ THIS TURNED OUT TO BE COMPLETE GARBAGE - accidentally used JLab window settings - note extra time bump<br />
|[[Image:cdc_amp32759.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t32759.png|thumb|x200px|drift time]]<br />
|}</div>Nsjarvishttps://halldweb1.jlab.org/wiki/index.php?title=CDC_prototype_runs_at_CMU&diff=63418CDC prototype runs at CMU2015-02-05T21:04:12Z<p>Nsjarvis: </p>
<hr />
<div>The prototype runs at CMU were made with the prototype sitting along the top of one scintillator. The scintillator is only slightly larger than the prototype.<br/><br />
Run 2016 at JLab was a cosmics run with the BCAL trigger. <br/><br />
The CDC run at CMU used two scintillators in coincidence, the scintillators were above and below the CDC, separated by approx 2m, and are 9" wide. The cosmic rays would have been much closer to vertical than for the prototype and JLab measurements.<br/> <br />
<p> First article/prototype preamp & HVB were used for all but one of the prototype runs. One run was made using JLab preamp & HVB with all other settings unaltered since the previous run; as expected, the resulting data look very similar. </p> <br />
<br />
<br />
{| border="0" cellpadding="2" <br />
|+ Prototype, 2100V, 50/50 Ar/CO2<br />
|[[Image:cdc_amp32747.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t32747.png|thumb|x200px|drift time]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|+ Prototype, 2100V, 55/45 Ar/CO2<br />
|[[Image:cdc_amp32759good.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t32759good.png|thumb|x200px|drift time]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|+ Prototype, 2100V, 55/45 Ar/CO2 JLab electronics<br />
|[[Image:cdc_amp32775.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t32775.png|thumb|x200px|drift time]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|+ Prototype, 2100V, 60/40 Ar/CO2<br />
|[[Image:cdc_amp32756.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t32756.png|thumb|x200px|drift time]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|+ CDC straw 496 2100V JLab run 2016 (cosmics, BCAL trigger)<br />
|[[Image:cdc_amp2016_496.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t2016_496.png|thumb|x200px|drift time]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|+ CDC (sum) 2100V JLab run 2016 (cosmics, BCAL trigger)<br />
|[[Image:cdc_amp2016.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t2016.png|thumb|x200px|drift time]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|+ CDC (72ch) at CMU, 2100V, 50/50 Ar/CO2 with large scint paddles along the length of the CDC<br />
|[[Image:cdc_amp32290.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t32290.png|thumb|x200px|drift time w terrible fit]]<br />
|}<br />
<br />
<br />
CDC at CMU had MPV at ~190 for 2110V, 50/50 Ar/CO2. CDC wire is 20um, prototype wire is 18um (7 mil), and prototype straw radius is also slightly different.<br />
<br />
<br />
{| border="0" cellpadding="2" style="background-color:gray"<br />
|+ THIS TURNED OUT TO BE COMPLETE GARBAGE - accidentally used JLab window settings - note extra time bump<br />
|[[Image:cdc_amp32759.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t32759.png|thumb|x200px|drift time]]<br />
|}</div>Nsjarvishttps://halldweb1.jlab.org/wiki/index.php?title=CDC_prototype_runs_at_CMU&diff=63417CDC prototype runs at CMU2015-02-05T20:30:51Z<p>Nsjarvis: </p>
<hr />
<div>The prototype runs at CMU were made with the prototype sitting along the top of one scintillator. The scintillator is only slightly larger than the prototype.<br/><br />
Run 2016 at JLab was a cosmics run with the BCAL trigger. <br/><br />
The CDC run at CMU used two scintillators in coincidence, the scintillators were above and below the CDC, separated by approx 2m, and are 9" wide. The cosmic rays would have been much closer to vertical than for the prototype and JLab measurements.<br/> <br />
<p> First article/prototype preamp & HVB were used for all but one of the prototype runs. One run was made using JLab preamp & HVB with all other settings unaltered since the previous run; as expected, the resulting data look very similar. </p> <br />
<br />
<br />
{| border="0" cellpadding="2" <br />
|+ Prototype, 2100V, 50/50 Ar/CO2<br />
|[[Image:cdc_amp32747.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t32747.png|thumb|x200px|drift time]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|+ Prototype, 2100V, 55/45 Ar/CO2<br />
|[[Image:cdc_amp32759good.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t32759good.png|thumb|x200px|drift time]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|+ Prototype, 2100V, 55/45 Ar/CO2 JLab electronics<br />
|[[Image:cdc_amp32775.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t32775.png|thumb|x200px|drift time]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|+ Prototype, 2100V, 60/40 Ar/CO2<br />
|[[Image:cdc_amp32756.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t32756.png|thumb|x200px|drift time]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|+ CDC straw 496 2100V JLab run 2016 (cosmics, BCAL trigger)<br />
|[[Image:cdc_amp2016_496.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t2016_496.png|thumb|x200px|drift time]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|+ CDC (sum) 2100V JLab run 2016 (cosmics, BCAL trigger)<br />
|[[Image:cdc_amp2016.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t2016.png|thumb|x200px|drift time]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|+ CDC (72ch) at CMU, 2100V, 50/50 Ar/CO2<br />
|[[Image:cdc_amp32290.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t32290.png|thumb|x200px|drift time w terrible fit]]<br />
|}<br />
<br />
<br />
CDC at CMU had MPV at ~190 for 2110V, 50/50 Ar/CO2. CDC wire is 20um, prototype wire is 18um (7 mil), and prototype straw radius is also slightly different.<br />
<br />
<br />
{| border="0" cellpadding="2" style="background-color:gray"<br />
|+ THIS TURNED OUT TO BE COMPLETE GARBAGE - accidentally used JLab window settings - note extra time bump<br />
|[[Image:cdc_amp32759.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t32759.png|thumb|x200px|drift time]]<br />
|}</div>Nsjarvishttps://halldweb1.jlab.org/wiki/index.php?title=CDC_prototype_runs_at_CMU&diff=63414CDC prototype runs at CMU2015-02-05T20:07:32Z<p>Nsjarvis: </p>
<hr />
<div>The prototype runs at CMU were made with the prototype sitting along the top of one scintillator. The scintillator is only slightly larger than the prototype.<br/><br />
Run 2016 at JLab was a cosmics run with the BCAL trigger. <br/><br />
The CDC run at CMU used two scintillators in coincidence, the scintillators were above and below the CDC, separated by approx 2m, and are 9" wide. The cosmic rays would have been much closer to vertical than for the prototype and JLab measurements.<br/> <br />
<p> First article/prototype preamp & HVB were used for all but one of the prototype runs. One run was made using JLab preamp & HVB with all other settings unaltered since the previous run; as expected, the resulting data look very similar. </p> <br />
<br />
<br />
{| border="0" cellpadding="2" <br />
|+ Prototype, 2100V, 50/50 Ar/CO2<br />
|[[Image:cdc_amp32747.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t32747.png|thumb|x200px|drift time]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|+ Prototype, 2100V, 55/45 Ar/CO2<br />
|[[Image:cdc_amp32759good.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t32759good.png|thumb|x200px|drift time]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|+ Prototype, 2100V, 55/45 Ar/CO2 JLab electronics<br />
|[[Image:cdc_amp32775.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t32775.png|thumb|x200px|drift time]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|+ Prototype, 2100V, 60/40 Ar/CO2<br />
|[[Image:cdc_amp32756.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t32756.png|thumb|x200px|drift time]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|+ CDC straw 496 2100V JLab run 2016 (cosmics, BCAL trigger)<br />
|[[Image:cdc_amp2016_496.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t2016_496.png|thumb|x200px|drift time]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|+ CDC (sum) 2100V JLab run 2016 (cosmics, BCAL trigger)<br />
|[[Image:cdc_amp2016.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t2016.png|thumb|x200px|drift time]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|+ CDC (72ch) at CMU, 2100V, 50/50 Ar/CO2<br />
|[[Image:cdc_amp32290.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t32290.png|thumb|x200px|drift time w terrible fit]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|+ CDC at CMU, 50/50 Ar/CO2 (from [[CDC_straight_straws]])<br />
|[[Image:cdc_run_32269_thr5_maxampfit.png|thumb|x250px|Big scintillators, along CDC, fit to thr5 data]]<br />
|}<br />
<br />
CDC at CMU had MPV at ~190 for 2110V, 50/50 Ar/CO2. CDC wire is 20um, prototype wire is 18um (7 mil), and prototype straw radius is also slightly different.<br />
<br />
<br />
{| border="0" cellpadding="2" style="background-color:gray"<br />
|+ THIS TURNED OUT TO BE COMPLETE GARBAGE - accidentally used JLab window settings - note extra time bump<br />
|[[Image:cdc_amp32759.png|thumb|x200px|max amp]]<br />
|[[Image:cdc_t32759.png|thumb|x200px|drift time]]<br />
|}</div>Nsjarvishttps://halldweb1.jlab.org/wiki/index.php?title=File:Cdc_run1602_e256051q4.png&diff=63413File:Cdc run1602 e256051q4.png2015-02-05T18:56:17Z<p>Nsjarvis: </p>
<hr />
<div></div>Nsjarvishttps://halldweb1.jlab.org/wiki/index.php?title=File:Cdc_run1602_e205536q4.png&diff=63412File:Cdc run1602 e205536q4.png2015-02-05T18:55:39Z<p>Nsjarvis: </p>
<hr />
<div></div>Nsjarvishttps://halldweb1.jlab.org/wiki/index.php?title=File:Cdc_run1602_e74085q4.png&diff=63411File:Cdc run1602 e74085q4.png2015-02-05T18:55:01Z<p>Nsjarvis: </p>
<hr />
<div></div>Nsjarvishttps://halldweb1.jlab.org/wiki/index.php?title=File:Cdc_run1602_e16257q4.png&diff=63410File:Cdc run1602 e16257q4.png2015-02-05T18:54:36Z<p>Nsjarvis: </p>
<hr />
<div></div>Nsjarvishttps://halldweb1.jlab.org/wiki/index.php?title=File:Cdc_run1602_e251941q8.png&diff=63409File:Cdc run1602 e251941q8.png2015-02-05T18:53:49Z<p>Nsjarvis: </p>
<hr />
<div></div>Nsjarvishttps://halldweb1.jlab.org/wiki/index.php?title=File:Cdc_run1602_e544903q8.png&diff=63408File:Cdc run1602 e544903q8.png2015-02-05T18:52:48Z<p>Nsjarvis: </p>
<hr />
<div></div>Nsjarvishttps://halldweb1.jlab.org/wiki/index.php?title=File:Cdc_run1602_e99090q8.png&diff=63407File:Cdc run1602 e99090q8.png2015-02-05T18:52:24Z<p>Nsjarvis: </p>
<hr />
<div></div>Nsjarvishttps://halldweb1.jlab.org/wiki/index.php?title=File:Cdc_run1602_e4284q8.png&diff=63406File:Cdc run1602 e4284q8.png2015-02-05T18:51:55Z<p>Nsjarvis: </p>
<hr />
<div></div>Nsjarvishttps://halldweb1.jlab.org/wiki/index.php?title=CDC_algo&diff=63405CDC algo2015-02-05T18:50:21Z<p>Nsjarvis: /* Q=4, upsampled values too high (very rare with fully functioning fADCs) */</p>
<hr />
<div><h1>CDC time & integral algorithm</h1><br />
<br />
When the trigger signal arrives, the presample buffer contains NP (default value 16) samples for pedestal followed by NW (default 100, possibly up to 155) samples to contain full range of drift time. <br />
<br />
<br />
<h2>Quantities to be returned, if a hit is found</h2><br />
*Leading edge time (11 bits, units of sample/10)<br />
*Time quality factor (1 bit) set to 0 if time is good, 1 if time is rough estimate<br />
*Pedestal immediately before the hit (8 bits, all bits set if value > field max)<br />
*Signal integral (n bits, scaled down by factor 2^m, all bits set if greater than range; n,m are 14,4)<br />
*Signal maximum (p bits, scaled down by factor 2^q; p,q approx 8,2) this is the first maximum in the signal after the threshold crossing<br />
*Overflow count (3 bits, set to 7 if >6)<br />
<br />
<br />
<br />
<h2>Configuration constants (all values are integers, σ=pedestal width ~20)</h2><br />
<br />
*NPED: number of samples in pedestal window (default 16, must be 2**integer)<br />
*WINDOW_START: position in buffer of first sample in hit search window, this is immediately after the pedestal window<br />
*WINDOW_END: position in buffer of last sample in hit search window<br />
*HIT_THRES: threshold to identify hit (default 5σ ~100, range 50 to 300)<br />
*NPED2: number of samples to use to calculate pedestal just before hit (default 16, must be 2**integer)<br />
*NSAMPLES: number of ADC samples in subset to pass to time finding module (default 15)<br />
*XTHR_SAMPLE: position in subset of first sample above hit_threshold (default 9, starts with 0)<br />
*PED_SAMPLE: position in subset of sample to be used as local pedestal (default 5, starts with 0)<br />
<br />
<br />
<br />
<h2>Timing algorithm configuration constants</h2><br />
*HIGH_THRESHOLD: High timing threshold (default 4σ ~ 80, range 40 to 270) must be lower than hit threshold<br />
*LOW_THRESHOLD: Low timing threshold (default 1σ ~ 20, range 5 to 30)<br />
*ROUGH_DT: rough time - if timing fails, return hit time of XTHR_SAMPLE - ROUGH_DT (default 24, units sample/10)<br />
*INT_SAMPLE: if timing fails, start integration with this sample (default 6).<br />
*NUPSAMPLED: number of upsampled values to calculate (default 8, minimum 8)<br />
*LIMIT_PED_MAX: do not calculate accurate time if any of samples 0 to PED_SAMPLE in subset exceeds this (default 511)<br />
*LIMIT_ADC_MAX: do not calculate accurate time if any sample in the subset exceeds this (default 4095)<br />
*SET_ADC_MIN: reduce chances of calculating a negative upsampled value by adding a constant offset to the subset values such that the minimum is equal to SET_ADC_MIN (default 20)<br />
*LIMIT_UPS_ERR: do not calculate accurate time if the sum of the error of the 2 upsampled values exceeds this (default 30)<br />
<br />
<br />
<h2>Hit finding module</h2><br />
<br />
#Calculate start_pedestal as mean of NPED samples from WINDOW_START-NPED-1 to WINDOW_START-1<br />
#Search from WINDOW_START to WINDOW_END for the earliest sample with ADC value >= start_pedestal + HIT_THRES. If not found, go back to sleep. If found, continue, this is sample X.<br />
#Call up time-finding module and send in NSAMPLES ADC values from the hit threshold crossing region, with sample X in position XTHR_SAMPLE (starting at 0)<br />
#Call up signal maximum module<br />
#Call up signal integral module<br />
#Return pedestal_at_hit as mean of NPED2 samples ending with sample number X + PED_SAMPLE - XTHR_SAMPLE, or 255 if pedestal_at_hit > field max<br />
#Return overflow count from integral module<br />
#Return q_code from time module<br />
#Return total integral: sum of contributions from time module and integral module<br />
#Return time = (X - XTHR_SAMPLE)*10 + le_time returned from time module, units are 0.1*sample-period (0.8ns)<br />
<br />
<br />
<br />
<h2>Time finding module</h2><br />
This returns an error code q_code and the leading edge time le_time, in units of sample/10 and relative to the first sample in the subset. The hit time returned falls into one of three categories: an accurate estimate of the leading edge time, where the low threshold crossing time was found using upsampled data, a midpoint time, where the low threshold crossing time was found using sample data, and a rough time estimate, XTHR_SAMPLE*10 - ROUGH_DT. If the time returned is the accurate leading edge time, q_code is set to 0, otherwise it is set to 1. <br />
<br />
#Inspect ADC samples 0 to PED_SAMPLE. If any sample values are 0 or greater than LIMIT_PED_MAX, return the rough time, XTHR_SAMPLE*10 - ROUGH_DT, and q_code=1.<br />
#Inspect ADC samples PED_SAMPLE+1 to NSAMPLES-1. If any sample values are 0 or greater than LIMIT_ADC_MAX, return the rough time and q_code=1. <br />
#Find the minimum sample value in the subset. Subtract a constant offset from all sample values so that the minimum value is now SET_ADC_MIN. This is to decrease the likelihood of calculating any negative upsampled values. <br />
#Calculate the timing thresholds thres_hi = value of sample PED_SAMPLE + HIGH_THRESHOLD and thres_lo = value of sample PED_SAMPLE + LOW_THRESHOLD<br />
#Search the samples from PED_SAMPLE+1 to NSAMPLES-1 for the first sample with value >= thres_hi. If this threshold is not met, return the rough time and q_code=1.<br />
#Search the samples from the first sample with value >= thres_hi down to PED_SAMPLE to find the first sample (Y) with value <= thres_lo<br />
#If Y is > NSAMPLES-7, there are not enough samples to calculate upsampled values, return the rough time and q_code=1.<br />
#Calculate NUPSAMPLED (8) upsampled values, starting with Y-0.2. <br />
#If any upsampled value is negative, return the midpoint time, Y*10+5, and q_code=1.<br />
#Calculate two upsampling errors, as the difference between upsampled point 1 and sample Y, and the difference between upsampled point 2 and sample Y+1<br />
#Sum the errors and compare them with LIMIT_UPS_ERR, if this is exceeded then return the midpoint time, Y*10+5, and q_code=1.<br />
#Calculate the mean of the 2 errors, ups_err and the adjusted threshold, thres_adj = thres_lo + ups_err<br />
#Search the upsampled values from NUPSAMPLED-1 down to 0 to find upsampled point Z where the value <= thres_adj<br />
#If Z=NUPSAMPLED-1 or Z is not found, return the midpoint time, Y*10+5, and q_code=1.<br />
#Interpolate between the upsampled points Z and Z+1 to find the crossing time in units of sample/10 and relative to the first upsampled point<br />
#Calculate the leading edge time, le_time, as the crossing time found in previous step + Y*10-2, in units of sample/10 and relative to subset sample 0<br />
#Return time=le_time and q_code=0<br />
<br />
<br />
<br />
<h2>Signal maximum module</h2><br />
This returns the signal maximum<br />
#Inspect ADC values after sample X, find the first value which is less than its predecessor<br />
#Return value of the predecessor scaled down by 2^p <br />
<br />
<br />
<br />
<h2>Signal integral module</h2><br />
This returns the signal integral and overflow count<br />
#Sum ADC values from sample X to sample WINDOW_END, and count the number of samples with overflow bit set<br />
#Return integral scaled down by 2^m (return all bits set if value exceeds range maximum)<br />
#Return overflow count (return 7 if count>6)<br />
<br />
<br />
<br />
<br />
<br />
<br />
<h1> Error codes from Run 1602 </h1><br />
<br />
<br />
Settings used:<br />
<pre><br />
#define WINDOW_START 46 //earliest sample for start of hit<br />
#define WINDOW_END 130 //last sample for hit arrival, and last sample included in integral<br />
<br />
#define HIT_THRES 300 // "5 sigma" hit threshold *** set this VERY high to cut out persistent noise in a handful of channels ***<br />
#define NPED 16 // number of samples used for pedestal used to find hit. must be 2**integer<br />
#define NPED2 16 // number of samples used for pedestal calculated just before hit (returned, not used here). must be 2**integer<br />
<br />
// cdc_time<br />
#define HIGH_THRESHOLD 80 // 4 sigma threshold<br />
#define LOW_THRESHOLD 20 // 1 sigma threshold<br />
#define ROUGH_DT 24 // if pulse fails QA, return this many tenth-samples before threshold xing<br />
#define INT_SAMPLE 6 // if pulse fails QA, start integration with this sample <br />
<br />
//cdc_time good pulse criteria<br />
#define LIMIT_PED_MAX 511 //return rough time if any sample in 0 to PED_SAMPLE exceeds this<br />
#define LIMIT_ADC_MAX 4095 // return rough time if any sample in PED_SAMPLE+1 to NSAMPLES exceeds this<br />
<br />
// cdc_time upsampling<br />
#define NSAMPLES 15 //number of samples in subset of array to pass to cdc_time<br />
#define XTHR_SAMPLE 9 // the hit_thres xing sample is sample[9] passed into cdc_time, starting with sample[0]<br />
#define PED_SAMPLE 5 // take local ped as sample[5] passed into cdc_time<br />
#define NUPSAMPLED 8 // number of upsampled values to calculate, minimum is 8<br />
#define SET_ADC_MIN 20 // add an offset to the adc values to set the min value equal to SET_ADC_MIN<br />
#define LIMIT_UPS_ERR 30 // upsampling error tolerance, return midpoint time if error is greater than this<br />
</pre><br />
<br />
<br />
==Error codes with faulty channels included==<br />
<br />
Error codes are listed in the order that the event is removed from processing. ADC overflows are not identified by the C++ code as it only looks at Df125WindowRawData.<br />
<br />
{| border="1px" cellpadding="2" style="border-style:solid;"<br />
! q_code !! reason !! entries !! percent of total !! percent of q>0 entries<br />
|-<br />
| 5 || ADC value = 0 || 26458 || 2.274% || 31.048%<br />
|-<br />
| 6 || ADC value > 4095 || 0 || 0% || 0%<br />
|-<br />
| 7 || Pedestal > 511 || 44830 || 3.854% || 52.607%<br />
|-<br />
| 1 || ADC data did not go over threshold adc_thres_hi || 576 || 0.050% || 0.676%<br />
|-<br />
| 2 || Leading edge time is too late in the buffer to upsample || 82 || 0.007% || 0.096%<br />
|-<br />
| 8 || Upsampled value is negative || 15 || 0.001% || 0.018%<br />
|-<br />
| 9 || Upsampling error sum > 30 || 13225 || 1.137% || 15.519%<br />
|-<br />
| 3 || Last upsampled point is too low (below or equal to low timing threshold) || 28 || 0.002% || 0.033%<br />
|-<br />
| 4 || Upsampled points are too high (did not go below low timing threshold) || 2 || 0.000% || 0.002%<br />
|-<br />
| 0 || Good || 1078072 || 92.675% || <br />
|}<br />
<br />
<br />
<br />
<br />
==Error codes with most of faulty channels excluded from data==<br />
<br />
Error codes are listed in the order that the event is removed from processing. ADC overflows are not identified by the C++ code as it only looks at Df125WindowRawData.<br />
<br />
{| border="1px" cellpadding="2" style="border-style:solid;"<br />
! q_code !! reason !! entries !! percent of total !! percent of q>0 entries<br />
|-<br />
| 5 || ADC value = 0 || 26433 || 2.277% || 31.088%<br />
|-<br />
| 6 || ADC value > 4095 || 0 || 0% || 0%<br />
|-<br />
| 7 || Pedestal > 511 || 44747 || 3.855% || 52.627%<br />
|-<br />
| 1 || ADC data did not go over threshold adc_thres_hi || 575 || 0.050% || 0.676%<br />
|-<br />
| 2 || Leading edge time is too late in the buffer to upsample || 82 || 0.007% || 0.096%<br />
|-<br />
| 8 || Upsampled value is negative || 0 || 0% || 0%<br />
|-<br />
| 9 || Upsampling error sum > 30 || 13188 || 1.136% || 15.510%<br />
|-<br />
| 3 || Last upsampled point is too low (below or equal to low timing threshold) || 2 || 0.000% || 0.002%<br />
|-<br />
| 4 || Upsampled points are too high (did not go below low timing threshold) || 0 || 0% || 0%<br />
|-<br />
| 0 || Good || 1075754 || 92.675% || <br />
|}<br />
<br />
<br />
<br />
<br />
==Error codes with faulty channels included, mimicked overflow detection in C++ code==<br />
The C++ code is not finding overflows because it is only using Df125WindowRawData; overflows are in a different branch of DAQTree.<br />
The VHDL code will be able to find overflows by testing for sample value > 4095 because the overflow bit is passed in as a 13th sample value bit (bits 0-11 are the ADC value), so samples with the overflow bit set will have value > 4095. This was mimicked in the C++ code by testing for ADC value > 4094.<br />
<pre><br />
#define LIMIT_ADC_MAX 4094 // return rough time if any sample in PED_SAMPLE+1 to NSAMPLES exceeds this<br />
</pre><br />
<br />
{| border="1px" cellpadding="2" style="border-style:solid;"<br />
! q_code !! reason !! entries !! percent of total !! percent of q>0 entries<br />
|-<br />
| 5 || ADC value = 0 || 52559 || 3.9% || 25%<br />
|-<br />
| 6 || ADC value > 4094 || 97939 || 7.2% || 46%<br />
|-<br />
| 7 || Pedestal > 511 || 51244 || 3.8% || 24%<br />
|-<br />
| 1 || ADC data did not go over threshold adc_thres_hi || 9787 || 0.72% || 4.6%<br />
|-<br />
| 2 || Leading edge time is too late in the buffer to upsample || 700 || 0.051% || 0.33%<br />
|-<br />
| 8 || Upsampled value is negative || 15 || 0.001% || 0.007%<br />
|-<br />
| 9 || Upsampling error sum > 30 || 61 || 0.004% || 0.029%<br />
|-<br />
| 3 || Last upsampled point is too low (below or equal to low timing threshold) || 813 || 0.060% || 0.38%<br />
|-<br />
| 4 || Upsampled points are too high (did not go below low timing threshold) || 8 || 0.001% || 0.004%<br />
|-<br />
| 0 || Good || 1148835 || 84% || <br />
|}<br />
<br />
<br />
<br />
<br />
==Examples, in order of q code population (click image twice to expand)==<br />
<br />
=== Q=0, good ===<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_run1602_e0q0.png.png|thumb|x200px|entry 0 q 0]]<br />
|[[Image:cdc_run1602_e1q0.png.png|thumb|x200px|entry 1 q 0]]<br />
|[[Image:cdc_run1602_e2q0.png.png|thumb|x200px|entry 2 q 0]]<br />
|[[Image:cdc_run1602_e3q0.png.png|thumb|x200px|entry 3 q 0]]<br />
|}<br />
<br />
=== Q=6, overflow ===<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_run1602_e7q6.png.png|thumb|x200px|entry 7 q 6]]<br />
|[[Image:cdc_run1602_e8q6.png.png|thumb|x200px|entry 8 q 6]]<br />
|[[Image:cdc_run1602_e9q6.png.png|thumb|x200px|entry 9 q 6]]<br />
|[[Image:cdc_run1602_e16q6.png.png|thumb|x200px|entry 16 q 6]]<br />
|}<br />
<br />
=== Q=5, ADC value=0 ===<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_run1602_e51q5.png.png|thumb|x200px|entry 51 q 5]]<br />
|[[Image:cdc_run1602_e120q5.png.png|thumb|x200px|entry 120 q 5]]<br />
|[[Image:cdc_run1602_e125q5.png.png|thumb|x200px|entry 125 q 5]]<br />
|[[Image:cdc_run1602_e198q5.png.png|thumb|x200px|entry 198 q 5]]<br />
|}<br />
<br />
=== Q=7, Pedestal>511 ===<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_run1602_e6q7.png.png|thumb|x200px|entry 6 q 7]]<br />
|[[Image:cdc_run1602_e21q7.png.png|thumb|x200px|entry 21 q 7]]<br />
|[[Image:cdc_run1602_e23q7.png.png|thumb|x200px|entry 23 q 7]]<br />
|[[Image:cdc_run1602_e24q7.png.png|thumb|x200px|entry 24 q 7]]<br />
|}<br />
<br />
=== Q=1, ADC data<ADC_subset_value[PED_SAMPLE] + HIGH_THRESHOLD===<br />
<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_run1602_e15q1.png.png|thumb|x200px|entry 15 q 1]]<br />
|[[Image:cdc_run1602_e91q1.png.png|thumb|x200px|entry 91 q 1]]<br />
|[[Image:cdc_run1602_e165q1.png.png|thumb|x200px|entry 165 q 1]]<br />
|[[Image:cdc_run1602_e179q1.png.png|thumb|x200px|entry 179 q 1]]<br />
|}<br />
<br />
=== Q=3, last upsampled point is too low (very rare with fully functioning fADCs) ===<br />
<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_run1602_e4073q3.png.png|thumb|x200px|entry 4073 q 3]]<br />
|[[Image:cdc_run1602_e5548q3.png.png|thumb|x200px|entry 5548 q 3]]<br />
|[[Image:cdc_run1602_e8618q3.png.png|thumb|x200px|entry 8618 q 3]]<br />
|[[Image:cdc_run1602_e9358q3.png.png|thumb|x200px|entry 9358 q 3]]<br />
|}<br />
<br />
=== Q=2, leading edge time too late to upsample (very rare with fully functioning fADCs) ===<br />
<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_run1602_e2091q2.png.png|thumb|x200px|entry 2091 q 2]]<br />
|[[Image:cdc_run1602_e3950q2.png.png|thumb|x200px|entry 3950 q 2]]<br />
|[[Image:cdc_run1602_e6905q2.png.png|thumb|x200px|entry 6905 q 2]]<br />
|[[Image:cdc_run1602_e9876q2.png.png|thumb|x200px|entry 9876 q 2]]<br />
|}<br />
<br />
=== Q=8, calculated an upsampled value < 0 (very rare with fully functioning fADCs) ===<br />
<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_run1602_e4284q8.png|thumb|x200px|entry 4284 q 8]]<br />
|[[Image:cdc_run1602_e99090q8.png|thumb|x200px|entry 99090 q 8]]<br />
|[[Image:cdc_run1602_e251941q8.png|thumb|x200px|entry 251941 q 8]]<br />
|[[Image:cdc_run1602_e544903q8.png|thumb|x200px|entry 544903 q 8]]<br />
|}<br />
<br />
=== Q=4, upsampled values too high (very rare with fully functioning fADCs) ===<br />
<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_run1602_e16257q4.png|thumb|x200px|entry 16257 q 4]]<br />
|[[Image:cdc_run1602_e74085q4.png|thumb|x200px|entry 74085 q 4]]<br />
|[[Image:cdc_run1602_e205536q4.png|thumb|x200px|entry 205536 q 4]]<br />
|[[Image:cdc_run1602_e256051q4.png|thumb|x200px|entry 256051 q 4]]<br />
|}<br />
<br />
==Upsampled data - old example==<br />
<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_upsampled2.png|thumb|x250px|ADC samples in (big circles) and upsampled data out (small blue dots) ]]<br />
|[[Image:cdc_upsampled2_front.png|thumb|x250px|ADC samples in (big circles) and upsampled data out (small blue dots) ]]<br />
|[[Image:cdc_upsampled2_middle.png|thumb|x250px|ADC samples in (big circles) and upsampled data out (small blue dots) ]]<br />
|}<br />
<br />
== Upsampling error check prior to error correction - copied from [[CDC_run_1280_bad_events]]==<br />
<br />
After excluding known [[CDC_bad_channels]] I compared the upsampled data with the original samples for the first 10000 events of run 1602. This is a high-intensity run so some of the pedestals are lower than they should be. <br />
<br/><br />
ups_err1 is the upsampled value iubuf[1] - the original sample adc[adc_sample_lo]<br />
<br/><br />
ups_err2 is the upsampled value iubuf[6] - the original sample adc[adc_sample_lo+1]<br />
<br/><br />
<pre><br />
q_code list:<br />
0: Good<br />
1: ADC data did not go over threshold adc_thres_hi <br />
2: Leading edge time is outside the upsampled region (cross adc_thres_lo too late in the buffer subset ) <br />
3: Last upsampled point is <= low timing threshold<br />
4: Upsampled points did not go below low timing threshold<br />
</pre><br />
Looking at upsampling errors - occur when gradient is very large<br />
<br />
{| border="0" cellpadding="2" <br />
|[[Image:cdc_adcq0.png|thumb|x200px|ADC sample subset for q code 0 ]]<br />
|[[Image:cdc_adcq4.png|thumb|x200px|ADC sample subset for q code 4]]<br />
|[[Image:cdc_adcq4b.png|thumb|x200px|ADC sample subset for q code 4, normalised to min value]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|[[Image:uerr1_q4.png|thumb|x200px|Error in upsampled value vs original sample value adc_sample_lo, q code 4]]<br />
|[[Image:uerr2_q4.png|thumb|x200px|Error in upsampled value vs original sample value adc_sample_lo+1, q code 4]]<br />
|}<br />
<br />
{| border="0" cellpadding="2" <br />
|[[Image:ue2e1q0.png|thumb|x200px|Error in upsampled values, q code 0]]<br />
|[[Image:ue2e1q4.png|thumb|x200px|Error in upsampled values, q code 4]]<br />
|[[Image:uediffq0.png|thumb|x200px|Difference in error in upsampled values, q code 0 (blue) and 4 (pink)]]<br />
|}<br />
<br />
Following this the error correction step was added to the algorithm, where the sum of errors ups_err1+ups_err2 is calculated and compared with LIMIT_UPS_ERR and then, if below this limit, halved (to calculate the mean) and subtracted from the upsampled data. The corrected upsampled points are the green circles in the 'example of Q code' plots above.</div>Nsjarvis