Rev 258 | Rev 263 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 258 | Rev 262 | ||
---|---|---|---|
Line 20... | Line 20... | ||
20 | //static int tfID; |
20 | //static int tfID; |
21 | int pfreq; |
21 | int pfreq; |
22 | static int plothandle[2]= {0,0}; |
22 | static int plothandle[2]= {0,0}; |
23 | static int tdcplothandle[2]= {0,0}; |
23 | static int tdcplothandle[2]= {0,0}; |
24 | static int adcplothandle[2]= {0,0}; |
24 | static int adcplothandle[2]= {0,0}; |
- | 25 | static int excludefirst[2]= {0,0}; |
|
25 | int debug ; |
26 | int debug ; |
26 | int initialized = 0; |
27 | int initialized = 0; |
27 | #define MAX_THREADS 10 |
28 | #define MAX_THREADS 10 |
28 | int nsamples=0; |
29 | int nsamples=0; |
29 | int adctype; |
30 | int adctype; |
Line 345... | Line 346... | ||
345 | nqdc++; |
346 | nqdc++; |
346 | qdc+=fdata[k]; |
347 | qdc+=fdata[k]; |
347 | } |
348 | } |
348 | if (fdata[k]< athreshold && fdata[k-1]> athreshold) { |
349 | if (fdata[k]< athreshold && fdata[k-1]> athreshold) { |
349 | double t0= tp+(athreshold-fdata[k-1])/(fdata[k]-fdata[k-1])* (t-tp); |
350 | double t0= tp+(athreshold-fdata[k-1])/(fdata[k]-fdata[k-1])* (t-tp); |
350 | H1D_Fill(3+id, t0,1); |
351 | if (ntdc>0) H1D_Fill(3+id, t0,1); |
- | 352 | if (ntdc==0 && !excludefirst[id]) H1D_Fill(3+id, t0,1); |
|
351 | finfo[*ninfo+4+ntdc]=t0; |
353 | finfo[*ninfo+4+ntdc]=t0; |
352 | ntdc++; |
354 | ntdc++; |
353 | } |
355 | } |
354 | } |
356 | } |
355 | if (nqdc) qdc/=nqdc; |
357 | if (nqdc) qdc/=nqdc; |
Line 519... | Line 521... | ||
519 | } |
521 | } |
520 | break; |
522 | break; |
521 | case PANEL_START: { |
523 | case PANEL_START: { |
522 | int state; |
524 | int state; |
523 | GetCtrlVal(panel,PANEL_START, &state); |
525 | GetCtrlVal(panel,PANEL_START, &state); |
- | 526 | GetCtrlVal(panel,PANEL_EXCLUDE_1, &excludefirst[0]); |
|
- | 527 | GetCtrlVal(panel,PANEL_EXCLUDE_2, &excludefirst[1]); |
|
524 | if (state && eventData1==0) { |
528 | if (state && eventData1==0) { |
525 | histoinit(); |
529 | histoinit(); |
526 | /* decimation n (=1,8,64...) : frequency = 125/n MHz*/ |
530 | /* decimation n (=1,8,64...) : frequency = 125/n MHz*/ |
527 | for (int i=0; i<nsamples; i++) timebins[i]=(i-nbefore)* (float)decimation /125.; |
531 | for (int i=0; i<nsamples; i++) timebins[i]=(i-nbefore)* (float)decimation /125.; |
528 | if (output) foutput = fopen(filename, "wb"); |
532 | if (output) foutput = fopen(filename, "wb"); |