From cb329ef04d82eecc405975f1745620334b943fed Mon Sep 17 00:00:00 2001 From: Nathan Baltzell Date: Mon, 2 Nov 2026 11:27:25 -0500 Subject: [PATCH 1/2] removed unused stuff --- .../detector/decode/ExtendedFADCFitter.java | 70 ++----------------- 1 file changed, 4 insertions(+), 66 deletions(-) diff --git a/common-tools/clas-detector/src/main/java/org/jlab/detector/decode/ExtendedFADCFitter.java b/common-tools/clas-detector/src/main/java/org/jlab/detector/decode/ExtendedFADCFitter.java index 245c5c84d8..eb84f9b74f 100644 --- a/common-tools/clas-detector/src/main/java/org/jlab/detector/decode/ExtendedFADCFitter.java +++ b/common-tools/clas-detector/src/main/java/org/jlab/detector/decode/ExtendedFADCFitter.java @@ -6,41 +6,16 @@ */ public class ExtendedFADCFitter implements IFADCFitter { - private int pedistalMinBin = 1; - private int pedistalMaxBin = 5; + private final int pedistalMaxBin = 5; int p1=1,p2=15; - int mmsum,summing_in_progress; public int t0,adc,ped,pedsum; public int thresholdCrossing,pulsePeakValue, pulsePeakPosition, pulseWidth; public double baseline, rms; private int tcourse, tfine; - public ExtendedFADCFitter(){ - - } - - public void fitCourseTime(int nsa, int nsb, int tet, int pedr, short[] pulse) { - pedsum=0;adc=0;mmsum=0;summing_in_progress=0; - for (int mm=0; mmp1 && mm<=p2) pedsum+=pulse[mm]; - if(mm==p2) pedsum=pedsum/(p2-p1); - if(mm>p2) { - if (pedr==0) ped=pedsum; - if (pedr!=0) ped=pedr; - if ((summing_in_progress==0) && pulse[mm]>ped+tet) { - summing_in_progress=1; - tcourse = mm; - t0 = (tcourse << 6); - for (int ii=1; ii0 && mmsum>(nsa+nsb)) summing_in_progress=-1; - if(summing_in_progress>0) {adc+=(pulse[mm]-ped); mmsum++;} - } - } - } + public ExtendedFADCFitter(){} public void fit(int nsa, int nsb, int tet, int pedr, short[] pulse) { t0=0; adc=0; ped=0; pedsum=0; baseline=0; rms=0; @@ -115,51 +90,14 @@ public void fit(int nsa, int nsb, int tet, int pedr, short[] pulse) { t0 = (tcourse << 6) + tfine; } if(s1>-1 && s0>-1) { - int a0 = pulse[s1]; - int a1 = pulse[s1+1]; pulseWidth = s1 - s0; } } } - - private double findPedestal(DetectorDataDgtz.ADCData data){ - int ped = 0; - for(int i = this.pedistalMinBin; i < this.pedistalMaxBin; i++){ - ped += data.getPulseValue(i); - } - double ped_norm = ((double) ped) / (Math.abs(this.pedistalMaxBin-this.pedistalMinBin)); - return ped_norm; - } - - private int findMaximumADC(DetectorDataDgtz.ADCData data){ - int bin = this.pedistalMaxBin ; - int max = data.getPulseValue(pedistalMaxBin); - - for(int i = this.pedistalMaxBin; i < data.getPulseSize(); i++){ - if(data.getPulseValue(i)>max){ - max = data.getPulseValue(i); - bin = i; - } - } - return bin; - } - - private int findPulseIntegral(DetectorDataDgtz.ADCData data, int maxValueBin, int nsa, int nsb){ - int min_bin = maxValueBin - nsb; - int max_bin = maxValueBin + nsa; - if(min_bin>=0&&max_binthis.pedistalMaxBin){ - double ped = this.findPedestal(data); - } + throw new UnsupportedOperationException("Not supported yet."); } - + } From 652576a2bdea539891255ca40579b9e9847c342c Mon Sep 17 00:00:00 2001 From: Nathan Baltzell Date: Mon, 2 Nov 2026 11:30:28 -0500 Subject: [PATCH 2/2] remove deprecated method --- .../org/jlab/detector/decode/FADCData.java | 97 ------------------- 1 file changed, 97 deletions(-) diff --git a/common-tools/clas-detector/src/main/java/org/jlab/detector/decode/FADCData.java b/common-tools/clas-detector/src/main/java/org/jlab/detector/decode/FADCData.java index fb3670a76a..643342474c 100644 --- a/common-tools/clas-detector/src/main/java/org/jlab/detector/decode/FADCData.java +++ b/common-tools/clas-detector/src/main/java/org/jlab/detector/decode/FADCData.java @@ -130,103 +130,6 @@ public List getDecoded(){ return result; } - public void decode(){ - - List result = new ArrayList<>(); - - short[] bucket = new short[16]; - - //int channel; - //int minimum; - int nwords; - int nskip; - int position = 0; - int headerWord; - int pedestal ; - int compressedWord; - byte[] array = new byte[4]; - - System.out.println(desc.toString()); - System.out.println("------------------------------------------------------"); - for(int i = 0 ; i < adcBuffer.length/2; i++){ - System.out.print(String.format("%04X ", adcBuffer[i*2+1])); - System.out.print(String.format("%04X ", adcBuffer[i*2])); - if((i+1)%8==0) System.out.println(); - } - System.out.println(); - System.out.println("------------------------------------------------------"); - ByteBuffer buffer = ByteBuffer.wrap(array); - buffer.order(ByteOrder.LITTLE_ENDIAN); - - while(position> 23) & 0x0F; - nwords = (headerWord&0x07); - nskip = (dataH>>4) &0x0F; - pedestal = (headerWord>>8)&0x0FFF; - compressedWord = (headerWord>>27)&0x0F; - - position+=2; - if(compressedWord==5){ - - short value; - result.clear(); - for(int i = 0; i < 4; i++){ - value = (short) (adcBuffer[position+i]&0x000F); - - bucket[i*4] = (short) (value+pedestal); - result.add( (short) (value+pedestal)); - - value = (short) ((adcBuffer[position+i] >> 4)&0x000F); - - bucket[i*4+1] = (short) (value+pedestal); - result.add( (short) (value+pedestal)); - - value = (short) ((adcBuffer[position+i] >> 8)&0x000F); - bucket[i*4+2] = (short) (value+pedestal); - result.add( (short) (value+pedestal)); - - value = (short) ((adcBuffer[position+i] >> 12)&0x000F); - bucket[i*4+3] = (short) (value+pedestal); - result.add( (short) (value+pedestal)); - } - - position += 4; - - if(nwords>0){ - - for(int i = 0; i < nwords*2; i++){ - short first = (short) ( (adcBuffer[i+position]&0x00FF) << 4); - short second = (short) ( ((adcBuffer[i+position] >>8)&0x00FF)<<4); - if( (nskip+i*2)<=15) - bucket[nskip+i*2] += first; - if( (nskip+i*2+1)<=15) - bucket[nskip+i*2+1] += second; - } - - position += nwords*2; - } - result.clear(); - for(int k = 0 ; k < bucket.length; k++){ - result.add(bucket[k]); - } - for(int i = 0; i < result.size(); i++){ - System.out.print(String.format("%6d", result.get(i))); - } - System.out.println(); - } - } - } - public void show(){ int length = 0; if(adcBuffer!=null) length = adcBuffer.length;