hps-java/src/main/java/org/lcsim/hps/recon/tracking/apv25
diff -u -r1.5 -r1.6
--- Apv25Full.java 17 Aug 2012 01:17:07 -0000 1.5
+++ Apv25Full.java 28 Aug 2012 07:06:53 -0000 1.6
@@ -6,6 +6,7 @@
import static org.lcsim.hps.recon.tracking.apv25.Apv25Constants.MIP;
import static org.lcsim.hps.recon.tracking.apv25.Apv25Constants.SAMPLING_INTERVAL;
import static org.lcsim.hps.recon.tracking.apv25.Apv25Constants.MULTIPLEXER_GAIN;
+import static org.lcsim.hps.recon.tracking.apv25.Apv25Constants.CHANNELS;
//--- hps-java ---//
import org.lcsim.hps.util.ClockSingleton;
@@ -14,7 +15,7 @@
/**
*
* @author Omar Moreno <[log in to unmask]>
- * @version $Id: Apv25Full.java,v 1.5 2012/08/17 01:17:07 omoreno Exp $
+ * @version $Id: Apv25Full.java,v 1.6 2012/08/28 07:06:53 omoreno Exp $
*/
public class Apv25Full {
@@ -22,22 +23,27 @@
public static boolean readoutBit = false;
// APV25 Channels; An APV25 Readout Chip contains a total of 128 channels
- private Apv25Channel[] channels = new Apv25Channel[128];
-
+ private Apv25Channel[] channels = new Apv25Channel[CHANNELS];
+
+ /**
+ * Default Ctor
+ */
public Apv25Full(){
// Instantiate all APV25 channels
- for(int channel = 0; channel < channels.length; channel++){
- channels[channel] = new Apv25Channel();
+ for(int channelN = 0; channelN < CHANNELS; channelN++){
+ channels[channelN] = new Apv25Channel();
}
}
/**
* Return an instance of an APV25 channel
*
- * @return an instance of Apv25Channel
+ * @param channel: APV25 channel of interest (0-127)
+ * @return an instance of an Apv25Channel
*/
public Apv25Channel getChannel(int channel){
+ if(channel >= CHANNELS) throw new RuntimeException();
return channels[channel];
}
@@ -71,15 +77,14 @@
*/
public Apv25AnalogData readOut(){
- // TODO: Add pedestal and noise to the samples when read out
-
Apv25AnalogData data = new Apv25AnalogData();
- for(int channel = 0; channel < channels.length; channel++){
+ for(int channel = 0; channel < CHANNELS; channel++){
// Only readout the channel if the channel isn't bad
if(!this.getChannel(channel).isBadChannel()){
- double sample = (channels[channel].pipeline.readout()/FRONT_END_GAIN)*MULTIPLEXER_GAIN;
- data.setChannelData(channel, sample);
+ // Readout the value stored in the buffer
+ double sample = (this.getChannel(channel).getPipeline().readout()/FRONT_END_GAIN)*MULTIPLEXER_GAIN;
+ data.setChannelData(channel, sample);
}
}
return data;
@@ -94,8 +99,6 @@
private Apv25Pipeline pipeline = new Apv25Pipeline();
private double shapingTime = 50; // [ns]
- private double baseline = 0;
- private double noise = 0;
boolean badChannel = false;
/**
@@ -116,20 +119,6 @@
/**
*
*/
- public void setBaseline(double baseline){
- this.baseline = baseline;
- }
-
- /**
- *
- */
- public void setNoise(double noise){
- this.noise = noise;
- }
-
- /**
- *
- */
public void markAsBadChannel(){
badChannel = true;
}
@@ -147,21 +136,7 @@
public Apv25Pipeline getPipeline(){
return pipeline;
}
-
- /**
- *
- */
- public double getBaseline(){
- return this.baseline;
- }
-
- /**
- *
- */
- public double getNoise(){
- return this.noise;
- }
-
+
/**
* Shape the injected charge
*
@@ -171,6 +146,9 @@
shaperSignal = new Apv25ShaperSignal(charge);
}
+ /**
+ *
+ */
public void sampleShaperSignal(){
// Obtain the beam time
@@ -188,7 +166,7 @@
double sample = shaperSignal.getAmplitudeAtTime(sampleTime, shapingTime);
// Add the value to the pipeline
- if(sample > .001) pipeline.addToCell(cell, sample);
+ pipeline.addToCell(cell, sample);
}
}
}
@@ -310,4 +288,4 @@
}
-}
\ No newline at end of file
+}
hps-java/src/main/java/org/lcsim/hps/recon/tracking/apv25
diff -u -r1.3 -r1.4
--- SvtHalfModule.java 15 Aug 2012 02:52:59 -0000 1.3
+++ SvtHalfModule.java 28 Aug 2012 07:06:53 -0000 1.4
@@ -12,7 +12,7 @@
/**
*
* @author Omar Moreno
- * @version $Id: SvtHalfModule.java,v 1.3 2012/08/15 02:52:59 omoreno Exp $
+ * @version $Id: SvtHalfModule.java,v 1.4 2012/08/28 07:06:53 omoreno Exp $
*/
public class SvtHalfModule {
@@ -29,14 +29,6 @@
apv25[chip] = new Apv25Full();
for(int channel = 0; channel < CHANNELS; channel++){
int physicalChannel = 639 - (chip*128 + 127 - channel);
- // Set the pedestal and noise found for this channel during QA
- // Note: The pedestals and noise as measured during QA include an RTM amplification of
- // approximately 1.5 (Actual channel values will be extracted using gain measurements
- // at a later time). The simulation amplifies the signal by the same amount so
- // it is necessary to divide the pedestal and noise by the RTM gain in order to get
- // accurate results.
- apv25[chip].getChannel(channel).setBaseline(HPSSVTCalibrationConstants.getPedestal(sensor, physicalChannel)/RTM_GAIN);
- apv25[chip].getChannel(channel).setNoise(HPSSVTCalibrationConstants.getNoise(sensor, physicalChannel)/RTM_GAIN);
// Mark all bad channels which were found during QA
if(HPSSVTCalibrationConstants.isBadChannel(sensor, physicalChannel)){
apv25[chip].getChannel(channel).markAsBadChannel();