Commit in hps-java/src/main/java/org/lcsim/hps/recon/tracking on MAIN | |||
RearTransitionModule.java | +12 | -3 | 1.2 -> 1.3 |
DataProcessingModule.java | +18 | -11 | 1.1 -> 1.2 |
+30 | -14 |
Small Changes ...
diff -u -r1.2 -r1.3 --- RearTransitionModule.java 13 Aug 2012 23:08:12 -0000 1.2 +++ RearTransitionModule.java 17 Aug 2012 01:15:34 -0000 1.3 @@ -13,10 +13,13 @@
import org.lcsim.hps.recon.tracking.apv25.Apv25AnalogData; import org.lcsim.hps.recon.tracking.apv25.Apv25DigitalData;
+//--- Constants ---// +import static org.lcsim.hps.recon.tracking.apv25.Apv25Constants.CHANNELS; +
/** * * @author Omar Moreno <[log in to unmask]>
- * @version $Id: RearTransitionModule.java,v 1.2 2012/08/13 23:08:12 omoreno Exp $
+ * @version $Id: RearTransitionModule.java,v 1.3 2012/08/17 01:15:34 omoreno Exp $
*/ public class RearTransitionModule extends Driver {
@@ -79,7 +82,7 @@
// If the event does not contain any analog data that needs to be digitized, skip the event if(!event.hasCollection(Apv25AnalogData.class, apv25AnalogDataCollectionName)) return;
-
+
// Get the analog data from the event List<Apv25AnalogData> analogData = event.get(Apv25AnalogData.class, apv25AnalogDataCollectionName);
@@ -106,8 +109,14 @@
apv25Output[index] = Math.floor((apv25Output[index] - adcVLowRef)/adcVoltageResolution); }
+ // Add pedestal and noise + for(int channel = 0; channel < CHANNELS; channel++){ + int physicalChannel = 639 - (analogDatum.getApvNumber()*128 + 127 - channel); + apv25Output[channel + 12] += HPSSVTCalibrationConstants.getPedestal(analogDatum.getSensor(), physicalChannel); + } +
// Add the digital data to the list
- digitalData.add(new Apv25DigitalData(analogDatum.getSensor(), analogDatum.getApv(), apv25Output));
+ digitalData.add(new Apv25DigitalData(analogDatum.getSensor(), analogDatum.getApvNumber(), apv25Output));
} event.put(apv25DigitalDataCollectionName, digitalData, Apv25DigitalData.class, 0);
diff -u -r1.1 -r1.2 --- DataProcessingModule.java 13 Aug 2012 23:08:12 -0000 1.1 +++ DataProcessingModule.java 17 Aug 2012 01:15:34 -0000 1.2 @@ -16,7 +16,7 @@
/** * * @author Omar Moreno <[log in to unmask]>
- * @version $Id: DataProcessingModule.java,v 1.1 2012/08/13 23:08:12 omoreno Exp $
+ * @version $Id: DataProcessingModule.java,v 1.2 2012/08/17 01:15:34 omoreno Exp $
*/ public class DataProcessingModule extends Driver {
@@ -73,10 +73,12 @@
for(Map.Entry<SiSensor, SvtDataBlocks> sensor : sensorToDataBlocks.entrySet()){ SvtDataBlocks blocks = sensor.getValue();
+
for(int channel = 0; channel < 640; channel++){
- short[] samples = blocks.getSamples(channel);
+ short[] samples = blocks.getSamples(channel); +
if(!this.samplesAboveThreshold(sensor.getKey(), channel, samples)) continue; // Create a RawTrackerHit
@@ -86,6 +88,7 @@
} }
+ System.out.println(this.getClass().getSimpleName() + ": Number of RawTrackerHits created: " + rawHits.size());
return rawHits; }
@@ -107,14 +110,17 @@
SiSensor sensor = digitalDatum.getSensor(); int apvN = digitalDatum.getApv();
- double[] apv25DigitalOutput = new double[140]; - System.arraycopy(digitalDatum.getApv25DigitalOutput(), 0, apv25DigitalOutput, 0, apv25DigitalOutput.length);
+ double[] apv25DigitalOutput = new double[128]; + System.arraycopy(digitalDatum.getSamples(), 0, apv25DigitalOutput, 0, apv25DigitalOutput.length);
for(int channel = 0; channel < apv25DigitalOutput.length; channel++){ // Calculate the physical number int physicalChannel = 639 - (apvN*128 + 127 - channel);
+ // if(apv25DigitalOutput[channel] > 3276) + // System.out.println(this.getClass().getSimpleName() + ": Channel " + channel + " Sample " + apv25DigitalOutput[channel]); +
sensorToDataBlocks.get(sensor).addSample(physicalChannel, nSamples, (short) apv25DigitalOutput[channel]); } }
@@ -126,12 +132,13 @@
// Add RawTrackerHits to the event event.put(rawTrackerHitsCollectionName, this.findRawHits(), RawTrackerHit.class, 0);
+ nSamples = 0;
} } public class SvtDataBlocks {
- List<short[]> samples = new ArrayList<short[]>();
+ Map<Integer, short[]> channelToSamples = new HashMap<Integer, short[]>();
/** * Default Ctor
@@ -142,16 +149,16 @@
/** * */
- public void addSample(int physicalChannel, int sampleN, short value){ - if(samples.get(physicalChannel) == null) samples.add(physicalChannel, new short[6]); - samples.get(physicalChannel)[sampleN] = value;
+ public void addSample(Integer physicalChannel, int sampleN, short value){ + if(!channelToSamples.containsKey(physicalChannel)) channelToSamples.put(physicalChannel, new short[6]); + channelToSamples.get(physicalChannel)[sampleN] = value;
} /** * */ public short[] getSamples(int physicalChannel){
- return samples.get(physicalChannel);
+ return channelToSamples.get(physicalChannel);
} }
@@ -166,13 +173,13 @@
// Get the pedestal and noise for this channel double pedestal = HPSSVTCalibrationConstants.getPedestal(sensor, channel); double noise = HPSSVTCalibrationConstants.getNoise(sensor, channel);
- double threshold = pedestal + noise*this.noiseThreshold;
+ double threshold = 3276 + pedestal + noise*this.noiseThreshold;
for(short sample : samples){ if(sample > threshold) nSamplesAboveThreshold++; }
- if(nSamplesAboveThreshold == this.nSamplesAboveTreshold) return true;
+ if(nSamplesAboveThreshold >= this.nSamplesAboveTreshold) return true;
return false; }
Use REPLY-ALL to reply to list
To unsubscribe from the LCD-CVS list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=LCD-CVS&A=1