Peak Class

  A Peak object is created by the getPeaks() method of a Waveform object.  A vector of Peaks is then returned.  From there, one can query a Peak for it's attributes.  Here is an example of code:
            Vector peaksVector = null;

            try {

                peaksVector = waveform.getPeaks();

                Peak peakOne = ( Peak ) peaksVector.get( 1 );
                double value = peakOne.getPeakArea();

                Peak peakTwo = ( Peak ) peaksVector.get( 2 );
                double valueTwo = peakTwo.getPeakArea();

            } catch (NoPeakException e) {

                e.printStackTrace();
            }

 In the above example, it is assumed that waveform is a Waveform object whose pulse has at least two peaks on it.  You can see how a vector is formed by the getPeaks() method of Waveform, and then how to recover the waveform's Peak objects from there.  The exception is meant to catch any waveform that does not have a peak.  Information on the getPeakArea() method can be found below.  The Peak objects can be queried for their pulses similarly to the Waveform class:

                    peakOne.getPulse(); - returns double[]
                    peakTwo.getShortPulse(); - returns short[]
                    peakThree.getBytePulse(); - returns byte[]

The arrays will only contain voltage values from the beginning of the peak to the end.  No information about the voltage values around the peak in the parent Waveform's pulse will be contained.




    Once the Peak objects of a waveform are accessed, you can query them for information about the waveform they came form.  Examples:

                    baseline - using getBaseline()
                    error on the baseline - using getBaselineError()
                    pedestal RMS - using getPedestalRMS()
                    error on the pedestal RMS - using getPedestalRMSError()
                    trigger tick - using getTriggerTick()

These quantities are not calculated, but are set upon creation by the PeakMaker class.  They cannot be changed during the life of a Peak object.  The trigger tick is the tick in the parent waveform's pulse that the peak's pulse begins at.  


    The Peak object can also be queried for information about the Peak itself that may need to be calculated.  Examples:

                    maximum voltage - using getMaxVoltage() or getMaxVoltage( int algorithm )
                    error on the maximum voltage - using getMaxVoltageError() or getMaxVoltageError( int algorithm )  ( more information on the int algorithm located on the algorithm
                                                                                                                                                                                               information page, accessible from the main page ).
                    leading edge - using getLeadingEdge()
                    error on the leading edge - using getLeadingEdgeError()
                    area under the peak - using getPeakArea() or getPeakArea( int algorithm )
                    error on the area under the peak - using getPeakAreaError() or getPeakAreaError( int algorithm )  ( more information on the int algorithm located on the algorithm
                                                                                                                                                                                               information page, accessible from the main page ).

All of these methods will return doubles.  More information about the algorithm interger can be found in the class page that describes each of those algorithms.