MUO - Program Description

PDF version

Contents

Muon Lifetime Signal Digitizer

First you need to start the “ViewSignals” program and analyze the input Muon signals from the PMT. See below for description of program. After you have determined the settings for the “MuonLifetime Acquire Data Front Panel” program then you can stop the “ViewSignals” program and start the main program “Muon Lifetime Final Version 1.0”. You can not run Both programs at the same time because they use the same Hardware.

Description of Muon Programs and Setup

To use the Muon programs

Muon Lifetime - ViewSignals.vi The ViewSignals.vi allows for calibration before data acquisition is initiated. In this program, a raw signal is imported from the data acquisition card. The offset is then removed from the signal and it is run through a filter to clean up the data.

There are various controls in this VI which may be used to manipulate the signal:

Min sample rate (Hz) – Control – Tells the digitizer the minimum sample rate. The maximum rate at which the digitizer can sample is 2.5x108 Hz. The digitizer will sample at a rate equal to or greater than the set minimum sample rate.

Actual sample rate (Hz) – Indicator – The actual sample rate.

Min record length – Control – Tells the digitizer the minimum number of samples to acquire in each interval. The digitizer will acquire a number of samples equal to or greater than the set minimum interval length.

Trigger level (V) relative to ground – Control – Tells the digitizer the trigger level. This trigger level is relative to the ground, not to any possible offset.

Pulse 1 threshold (V) relative to offset – Control – Sets the voltage threshold for a pulse to be considered a “pulse 1.” A signal must exceed this threshold (be less than this threshold for negative polarity, be greater than this threshold for positive polarity) to be counted. This voltage is relative to any (possibly drifting) offset the signal may have.

Pulse 2 threshold (V) relative to offset – Control – Sets the voltage threshold for the second pulse. In order for a signal to be counted as a “pulse 2,” it is necessary but not sufficient that it exceed this threshold. This voltage is relative to any possible offset.

Pulse 2 delay (microseconds) – Control – Sets the minimum time after the first pulse occurs that a following signal may be counted as a second pulse. This delay can be used to ensure that no characteristic of the first pulse is mistakenly counted as a separate, second pulse.

Range (microseconds) – Control – Sets the time period after the first pulse occurs to look for a second pulse.

Lower cut-off frequency (Hz) – Control – Sets the cut-off frequency of the low-pass filter. Once the data appears to come in cleanly and accurately, The Acquire Data – Final Version 1.0.vi may be used to record pulse information.

Muon Lifetime - Acquire Data.vi Overview

This vi tells the digitizer to acquire data. It then looks for one pulse meeting the first pulse threshold. If there is such a pulse, it looks for a second pulse meeting the second pulse threshold, such that the time difference between the two pulses is within the range and the time of the second pulse is greater than the sum of the time of the first pulse and a delay time. If two pulses exist, the vi records the time difference between the pulses, the amplitude of the first pulse, the width of the first pulse, the amplitude of the second pulse, and the width of the second pulse. The time information is taken off the signal before it is passed through a low-pass filter. The amplitude and width information is passed after the signal is passed through a low-pass filter. The width is the full-width-half-max.

The vi acquires data and looks for pulses for a set acquisition time. During this acquisition time, a real time histogram of the time intervals is plotted on the front page. Once the acquisition time has passed, the vi saves the raw data (time interval, pulse 1 amplitude, pulse 1 width, pulse 2 amplitude, pulse 2 width) to the end of a file. This raw data file accumulates the raw data for every acquisition.

While it is taking the raw data, a sub vi called Histogram 3.7 creates a summed histogram of the data. The vi saves this data to another file, and plots the summed histogram of the time intervals on the front panel.

When the number of acquisitions reaches the set number on the ``Number of Acquisitions’’ control on the front panel, the vi stops acquiring data, and saves the pulse 1 count and pulse 2 count to the raw data file. The program then takes the two files and copies them to a location specified at the beginning of acquisition. Default is My Documents: LabVIEW Data

Muon Lifetime - Acquire Data.vi Front Panel

Pulse polarity – Control – Tell the vi whether the pulse amplitudes are positive or negative. For negative pulses, the edge triggering is set for a negative slope. For positive pulses, the edge triggering is set for a positive slope. The pulse polarity control is also necessary for amplitude and width measurements.

Min sample rate (Hz) – Control – Tell the digitizer the minimum sample rate. The maximum rate at which the digitizer can sample is 2.5E8 Hz. The digitizer will sample at a rate equal to or greater than the set minimum sample rate.

Actual sample rate (Hz) – Indicator – The actual sample rate.

Min record length – Control – Tell the digitizer the minimum number of samples to acquire in each record. The digitizer will acquire a number of samples equal to or greater than the set minimum record length.

Trigger level (V) relative to ground – Control – Tell the digitizer the trigger level. This trigger level is relative to the ground, not to any possible offset.

Pulse 1 threshold (V) relative to offset – Control – Set the voltage threshold for a pulse to be considered a “pulse 1.” A signal must exceed this threshold (be less than this threshold for negative polarity, be greater than this threshold for positive polarity) to be counted. This voltage is relative to any (possibly drifting) offset the signal may have.

Pulse 2 threshold (V) relative to offset – Control – Set the voltage threshold for the second pulse. In order for a signal to be counted as a “pulse 2,” it is necessary but not sufficient that it exceed this threshold. This voltage is relative to any possible offset.

Pulse 2 delay (microseconds) – Control – Set the minimum time after the first pulse occurs that a following signal may be counted as a second pulse. This delay can be used to ensure that no characteristic of the first pulse is mistakenly counted as a separate, second pulse.

Range (microseconds) – Control – Set the time period after the first pulse occurs to look for a second pulse.

Lower cut-off frequency (Hz) – Control – Set the cut-off frequency of the low-pass filter.

Real time per acquisition (hh:mm:ss) – Control – Set the acquisition time, the time that the vi acquires data and analyzes it for pulses before saving.

Number of acquisitions – Control – Set the number of acquisitions. After this many of acquisitions have occurred, the vi stops taking more data.

Total acquisition time (hh:mm:ss) – Indicator – The product of the teal time per acquisition and the number of acquisitions. This is the time period that the vi will collect and analyze data.

Start acquisition – Control – Begin taking data. This control prompts you to select two file paths to which to save the different data.

Stop acquisition early – Control – Stop taking data before the acquisition time is up. This control saves the last set of data.

Pulse 1 count – Indicator – The number of pulses the vi has detected that met the first pulse threshold. If in one record two or more pulses met this record, the vi only considers the first to be a “Pulse 1.”

Pulse 2 count – Indicator – The number of pulses the vi has detected that meet the criterion for being a “Pulse 2.”

Real time histogram – Current acquisition – Indicator – This is a histogram of the time intervals of pulses for the current acquisition. This clears every new acquisition.

Summed data histogram – Previous acquisitions – Indicator – This is a histogram of the time intervals of pulses for all previous acquisitions. This sums data for the total acquisition time.

Configure Digitizer.vi

This vi creates a new IVI instrument driver session, configures properties of the digitizer vertical subsystem (vertical range, vertical offset), configures electrical properties of channel 0 (input impedance, maximum input frequency), configures properties of the horizontal subsystem (min sample rate, reference position), configures properties for edge triggering (slope, channel, trigger level), returns the effective sample rate, returns the actual record length, and returns the instrument handle.

Create Files.vi

This vi prompts you to create or replace four files. Two of the files are to be saved as temporary location on the local hard disk. Here both the raw data file are saved and appended to and the histogram is constantly updated. The other two files are raw data and histogram data to be saved on the network drive. If any of the four prompts is cancelled, all execution stops. If you select the same file in two or more prompts, a dialog box appears telling you to select two different files, and all execution stops. This vi saves some initial data, outputted from the Format Raw Data File.vi, to the raw data file.

Format Raw Data File.vi

This vi some of the initial control values (Min sample rate, Min record length, Trigger level, Pulse 1 threshold, Pulse 2 threshold, Range, Pulse 2 delay, Lower-cut off frequency) and formats them into a spreadsheet string. This, along with a string for the pulse counts and a string that has the headers for the columns of the file, are outputted to be saved to the raw data file.

Subtract Offset.vi

This vi averages the first 200 point of a waveform and subtracts this value from each point of the waveform, outputting the new waveform.

Filter, Amplitude and Width.vi

The inputs of this vi are an unfiltered signal, an index, a lower cut-off frequency, and a pulse polarity. This vi takes a subset of the unfiltered signal. The starting index of this subset is 15 indices before the inputted index. The length of this subset is 120 indices. The vi passes this subset through a low-pass filter with the inputted lower cut-off frequency as the cut-off frequency. If the pulse polarity is negative, the vi takes the minimum value of the filtered signal and outputs it as the pulse amplitude. The vi takes the index, n, of this minimum value and looks at the voltages of previous indices, n-1, n-2,…, until it finds the first index, m, such that the voltage of m is greater than or equal to half of the (negative) pulse amplitude. The vi takes this index, m, the index the vi considered before it, m+1, and the voltages associated with these two indices, V(m) and V(m+1). The vi extrapolates between these points to find the value, l, such that V(l) = half the amplitude. The vi repeats this process for indices above n, and extrapolates another value, o, such that V(o) = half the amplitude. The vi converts these two values, l and o, into time values, and outputs the difference as the width. This width is approximately the full-width at half-max.

If the pulse polarity is positive, two things change. The vi takes the maximum value of the filtered signal and outputs it as the pulse amplitude. The vi looks for the first index on either side of the index of the amplitude such that the voltage of these indices is less than half the (positive) amplitude.

RT Histogram.vi

The input of this vi is an array. The vi plots a 256-bin histogram of the data in this array. 256 bins corresponds to the resolution of the digitizer.

MUO Save and Plot Histogram 3.7.vi

The inputs of this vi include an appended array and a file path of the raw data. The vi takes the subset of the array beginning at the fourth row. This is to remove the headings. The vi converts each column of the raw data file into a 256-bin histogram. Then the vi places the raw data file path into the header so that the file may be identified as being associated with that raw data file. This is useful to keep track of which histogram file corresponds to which raw data file. The vi outputs the time interval histogram. The vi then converts the histogram data into a spreadsheet string and concatenates it with string headings for each column. It then outputs this string.

Muon Lifetime – Acquire Data Final Version 1.0.vi explanation

The outermost structure is a while loop. Inside the while loop is a case structure. When the button Start Acquisition has not been pressed, the Start Acquisition boolean value is false, and the vi executes the false case. In this case, the vi waits 100 ms, then re-evaluates the boolean. When the Start Acquisition button is pressed, the vi enters the true case. Inside the true case is a sequence structure. In the first frame, Format Raw Data File.vi is executed. The output of this vi is sent to Create Files.vi, which is also executed. Configure Digitizer.vi is executed. The vi calculates the total acquisition time and displays it on the front panel.

In the second frame, there is a while loop. Inside the while loop is another sequence structure. In the first frame there is another while loop. The vi converts the range and second pulse delay into seconds, and then into number of samples. niScope Read WDT.vi executes. This tells the digitizer to acquire a record and returns the waveform. If the digitizer times out before acquiring a record, a dialog box appears telling you to check the signal., and all execution is stopped. The digitizer will not return a signal if the trigger level is not met. The waveform is sent to Subtract Offset.vi.

After Subtract Offset.vi, the signal goes to a case structure. If the pulse polarity is negative, the signal, the first pulse amplitude, and the second pulse amplitude are negated so all are positive. If the pulse polarity is positive, no changes are made. This is necessary because the Threshold Peak Detector.vi is used and it only looks for peaks, not valleys. The signal and the first pulse threshold are inputted to Threshold Peak Detector.vi. If it does not detect any peak exceeding the first pulse threshold, the vi enters the false case of the case structure. In the false case, nothing happens, and another iteration of the while loop is executed. If Threshold Peak Detector.vi detects one or more peaks, the first is considered the “Pulse 1,” and the true case of the case structure is executed.

In the true case, the pulse 1 count is increased by one. Threshold Peak Detector.vi is called again with the second pulse threshold. The second pulse threshold is assumed to be less than or equal to the first pulse threshold. If the Threshold Peak Detector.vi detects only one pulse meeting the second pulse threshold, it must then be the first pulse. If the Threshold Peak Detector.vi does not detect more than one peak, the false case of the following case structure is executed, nothing happens, and the while loop is executed again.

If Threshold Peak Detector.vi detects more than one peak meeting the second pulse threshold, the true case is executed. Inside the true case is a while loop. If the pulse polarity is negative, the first case structure negates the signal again to bring it back to its original form (it had been negated earlier). The vi goes through the peaks detected to determine if one of them satisfies the criterion of a “Pulse 2”: the index of the second pulse must be greater than the sum of the index of the first pulse and the second pulse delay converted into number of samples; and the difference between the indices of the first and second pulses must be less than the range converted into number of samples. If while loop goes through the detected peaks one by one. If the while loop is investigating a given peak and the difference in indices of the peak and the first peak is greater than the range converted into number of samples, the while loop is stopped. If the while loop finds a peak that does satisfy the criterion, the while loop is stopped after the case structure is executed. If the while loop has gone through all the peaks detected by Threshold Peak Detector.vi the while loop is stopped. If the boolean “Stop” is true, the while loop stops. When any detected peak does not meet the criterion, the false case of the case structure is executed. When a detected peak does meet the criterion, the true case is executed.

In the true case, the Pulse 2 count is incremented by one. The difference of indices of the two pulses is calculated and converted into time. The waveform goes into two copies of Filter, Amplitude and Width.vi. The index of the first pulse is the input index of one of the vis, and the index of the second pulse is the input index of the second vi. The output of these vis are the amplitude and width of the first pulse and the amplitude and width of the second pulse. The time difference between the peaks, the amplitudes and the widths are appended to a 1D array. This information is then appended to a 2D array, which has all the information for all previous pairs of pulses for a given acquisition.

Outside of the case structure, while loop, case structure, and second case structure , two indicators send to the front panel the Pulse 1 count and Pulse 2 count. The 2D array is inputted to RT Histogram.vi, which plots a real time histogram of time intervals for the current acquisition. There is also a ``get date/time in seconds’’ command which gets the time inside the loop and subtracts it from the current time. This gives the total elapsed time which is displayed on the front panel.

The while loop reiterates. The digitizer gets another record of data, this data is analyzed, and the process repeats. Elapsed Time.vi returns “true” when the time the while loop has been running is equal to the control “Real time per acquisition.” When Elapsed Time.vi returns “true” or when the button “Stop acquisition early” is pressed, the while loop stops, and the vi executes the next frame of the sequence structure.

In the next frame, the 2D array is converted into a spreadsheet string. Open File.vi opens the raw data file on the local hard disk and appends the spreadsheet string to the end of the raw data file. Write File.vi input “offset” tells it where to start writing. Write File.vi outputs a new offset, so in the next iteration, the new data is again saved to the end of the file. Here, there is also a sequence structure which takes the array containing the header information and appends the raw data array. This is then brought to the next sequence where the appended array is fed into the MUO Save and Plot Histogram 3.7 vi . The Histogram file is then opened by Open File.vi and the string from the output of MUO Save and Plot Histogram 3.7.vi is fed into Write File.vi. The offset is set to zero so that it continually overwrites the file with the new summed histogram. The 2D array is reinitialized to zero. Pulse 1 count and Pulse 2 count are not reinitialized to zero. Instead, they keep a running count over all acquisitions. When the number of iterations is equal to the number of acquisitions set on the front panel, the while loop ends and the vi enters the final sequence frame. Pulse 1 count and Pulse 2 count are converted into strings and are saved to the beginning of the raw data file.

The next sequence reads the two files (histogram and raw data) that have been created on the local hard disk. It then copies these data to the network location specified when the program was initiated.

View signals Defaults

The ViewSignals Program Defaults are as follows:

  • Pulse Polarity: Negative
  • Minimum Sample Rate: 2.5 x 108Hz
  • Minimum Record Length: 11250
  • Trigger Level Relative to Ground: -0.800 V
  • Pulse 1 Threshold relative to offset: -0.800 V
  • Pulse 2 Threshold relative to offset: -0.150 V
  • Pulse 2 Delay: 0.500 μs
  • Range: 40.0 μs
  • Lower Cut-off Frequency: 1.0 x 106 Hz

The MuonLifetime program is then complete.

Program Default Values:

  • Pulse Polarity: Negative
  • Minimum Sample Rate: 2.5 x 108 Hz
  • Minimum Record Length: 11250
  • Trigger Level Relative to Ground: -0.800 V
  • Pulse 1 Threshold relative to offset: -0.800 V
  • Pulse 2 Threshold relative to offset: -0.150 V
  • Pulse 2 Delay: 0.500 μs
  • Range: 40.0 μs
  • Lower Cut-off Frequency: 1.0 x 106 Hz