Commit in hps-java/src/main/java/org/lcsim/hps/recon/tracking/apv25 on MAIN | |||
HPSAPV25.java | +67 | -50 | 1.1 -> 1.2 |
Modified to make use of sensor Identifier
diff -u -r1.1 -r1.2 --- HPSAPV25.java 5 Jan 2012 17:47:00 -0000 1.1 +++ HPSAPV25.java 12 Mar 2012 23:00:27 -0000 1.2 @@ -17,7 +17,7 @@
/** * * @author Omar Moreno <[log in to unmask]>
- * @version $Id: HPSAPV25.java,v 1.1 2012/01/05 17:47:00 omoreno Exp $
+ * @version $Id: HPSAPV25.java,v 1.2 2012/03/12 23:00:27 omoreno Exp $
*/ public class HPSAPV25 {
@@ -25,19 +25,16 @@
//------------------------// private static final double APV25_FRONT_END_GAIN = 100.0; // [mV/MIP]
- private static final double APV25_NOISE_INTERCEPT_PEAK = 36.0; // e- RMS - private static final double APV25_NOISE_INTERCEPT_DECON = 59.4; //e- RMS - private static final double APV25_NOISE_SLOPE_PEAK = 246; // e- rms/pF - private static final double APV25_NOISE_SLOPE_DECON = 396; // e- rms/pF
+ private static final double APV25_MULTIPLEXER_GAIN = 1; // mA/MIP + private static final double APV25_NOISE_INTERCEPT_PEAK = 270; // e- RMS + private static final double APV25_NOISE_INTERCEPT_DECON = 396; //e- RMS + private static final double APV25_NOISE_SLOPE_PEAK = 36; // e- rms/pF + private static final double APV25_NOISE_SLOPE_DECON = 59.4; // e- rms/pF
// Number of electron-hole pairs created by a min. ionizing particle // in 300 micrometers of Si private static final int MIP = 25000; // electron-hole pairs
- // Total number of channels ... I don't like how it is currently being - // implemented - private static final int SVT_CHANNELS = 13340; -
// Total number of channels per APV25 chip private static final int APV25_CHANNELS = 128;
@@ -46,9 +43,10 @@
// private int apv25ShapingTime = 35; // [ns]
+ private int apv25SamplingTime = 24; // [ns] + private double analogDCLevel = 0; // [mA] (Pedestal) + public int apv25ClockCycle = 0;
private String apv25Mode = "multi-peak";
- private int apv25SamplingTime = 24; // ns - public int apv25ClockCycle = 0;
// APV25 Channel private APV25Channel channel;
@@ -100,6 +98,14 @@
{ apv25SamplingTime = sampleTime; }
+ + /** + * + */ + public void setAnalogDCLevel(double dcLevel) + { + analogDCLevel = dcLevel; + }
/** * Return an instance of an APV25 channel. Currently, there is only a
@@ -166,46 +172,40 @@
public void stepAPV25Clock(){ apv25ClockCycle += 1; }
-
+
/** * */ public Map<Integer, double[]> APV25Multiplexer(
- Map<Integer, APV25AnalogPipeline> analogPipelineMap ) - { - Map<Integer /* chip */, double[]> apv25Map - = new HashMap<Integer, double[]>();
+ Map<Integer, APV25AnalogPipeline> pipelineMap){ + + Map<Integer /* chip */, double[]> apv25Map = new HashMap<Integer, double[]>();
- // The address of the APV. There is only a single address for all - // chips
+ // The address of the APV25. There is only a single address for all + // chips
double[] apv25Address = { 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0 };
+ double[] output;
- // Create the array which will contain the output format - double[] output = createOutputArray( apv25Address, -4.0 );
+ // Create the data streams + for(int chipIndex = 0; + chipIndex < Math.ceil((double) pipelineMap.size()/APV25_CHANNELS); + chipIndex++){
- // Loop over all channels and readout the cells which the
+ apv25Map.put(chipIndex, createOutputArray(apv25Address, -4)); + } + + // Loop over all channels and readout the cells which the
// trigger pointer points to
- for(int channel = 1; channel <= SVT_CHANNELS; channel++ ){ - - if( (channel%(APV25_CHANNELS)-1) == 0 && channel != 1 ){ - - //---> -// System.out.println("Chip #: " + Math.floor(channel/APV25_CHANNELS) + ", channel: " + channel); - //---> - apv25Map.put((int) Math.floor(channel/APV25_CHANNELS), output); - output = createOutputArray(apv25Address, -4.0 ); - } - - // If the channel does not contain any data, move on to the next - // channel - if(!analogPipelineMap.containsKey(channel)){ - continue; - }
+ for(int channel = 0; channel < pipelineMap.size(); channel++ ){
- output[(channel%APV25_CHANNELS + 12 )] - += analogPipelineMap.get(channel).readOut()/APV25_FRONT_END_GAIN;
+ output + = apv25Map.get((int) Math.floor(channel/APV25_CHANNELS)); + + output[channel%128 + 12] + += (pipelineMap.get(channel).readOut()/APV25_FRONT_END_GAIN)*APV25_MULTIPLEXER_GAIN + analogDCLevel; +
}
- return apv25Map;
+ return apv25Map;
} /**
@@ -225,7 +225,7 @@
// Fill the array with the header, address and error bit and tick System.arraycopy( header, 0, output, 0, 3);
- output[ header.length + 1 ] = error;
+ output[header.length] = error;
System.arraycopy( address, 0, output, 4, 8); output[ output.length - 1 ] = 4.0;
@@ -310,7 +310,7 @@
// the apv25, however, it will clean up the signal a bit // for simulation purposes // This should be done by the data processing module
- if( sample > (3*noiseRMS/MIP)*APV25_FRONT_END_GAIN) {
+ if( sample > 0.001 /*(1*noiseRMS/MIP)*APV25_FRONT_END_GAIN)*/) {
analogPipeline.addToCell(cell, sample ); } }
@@ -344,7 +344,6 @@
maxAmp = (charge/MIP)*APV25_FRONT_END_GAIN; // mV //--->
-// System.out.println("Maximum Amplitude: " + maxAmp);
aida.histogram1D("Shaper Signal Max Amplitude", 100, 0, 500).fill(maxAmp); //---> }
@@ -374,7 +373,7 @@
public int _trigger_pointer = 0; public int _writer_pointer = 0;
- int _trigger_latency = 100;
+ int _trigger_latency = 200;
int overflow_pos = 0;
@@ -394,7 +393,7 @@
// Set the position of the trigger pointer _trigger_pointer = _writer_pointer
- - (int) Math.ceil(_trigger_latency/apv25SamplingTime );
+ - (int) Math.floor(_trigger_latency/apv25SamplingTime );
if( _trigger_pointer < 0 ) _trigger_pointer += ANALOG_PIPELINE_LENGTH;
@@ -493,13 +492,31 @@
public void printAnalogPipeline() { System.out.print("[ ");
- for(double element : pipeline ){ - System.out.print(element + ","); - } - System.out.println(" ]"); - System.out.println("");
+ for(int index = 0; index < pipeline.length; index++){ + if(index == _trigger_pointer){ + System.out.print("TP====>"); + } + if(index == _writer_pointer){ + System.out.print("WP====>"); + } + System.out.print(pipeline[index] + ", "); + } + System.out.println("] ");
}
+ /** + * + */ + public double getTriggerPointerValue() + { + return pipeline[_trigger_pointer]; + } + + public double getTriggerPointerValuePlusOne() + { + if(_trigger_pointer + 1 == 192) return pipeline[0]; + return pipeline[_trigger_pointer + 1]; + }
/**
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