Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

TESMap.pdf

 

PDF
nameTESMap.pdf

 

PseudoCode

 

This is a proposed algorithm to handle the data produced by the TES detectors for LCLS-II.

 

The data is assumed to consist of several time streams per FPGA (250) sampled at 1 MHz. The beam repetition rate is 10 kHz, for a total of 100 samples minimum between valid (photon generated) events. The samples are assumed to be 16 bits.

Parfor : Parallel For

NumberOfChannels : number of channels to be handles by the FPGA

Samples per Window : Number of samples in a single pulse window

TotalNumberOfWindows : Maximum number of windows to be kept in memory for the configured filters. Currently only 3 for a total of four cases. The active window, the preceding one and the following one. Possibly more windows to be added before/after for more precision in the energy measurement.

Active Window : Window on which we are performing the filter calculation

Current Window : Window that is currently loading in buffers.

EventMatrix : Matrix containgin information about the presence of events in each window of each channel.

 

Code Block
languagepy
titleTES Algorithm
linenumberstrue
collapsetrue
CreateCircularBuffers (NumberOfChannels,
SamplesPerWindow, TotalNumberOfWindows)
LoadFilters()
ConfigureDataChannel()

While IncomingData:
            LoadDatainBuffers()
            ApplyCrosstalkCorrection(All_Channels,CurrentWindow)

            EventMatrix = TagEvents(All_Channels)

	For each ActiveWindow : 
            WindowIncrement=+1
				Parfor each Channel:            
                	Switch (CheckEvents(EventMatrix)):
						Case No Event Before And After
						Energy = ApplyFilter(Filter00)
						Case Event Before And After
						Energy = ApplyFilter(Filter11)

						Case Event Before Only
						Energy = ApplyFilter(Filter10)

						Case Event After Only
						Energy = ApplyFilter(Filter00)


            SaveEnergyAndTimestamp(xtcFile)


		If WindowIncrement == SaveIncrement
			SaveWaveformtoXTC(xtcFile, TotalTimeWindow, AllChannels)


 


Def TagEvents:
	Parfor each channel : 
		If Slope > MinimumSlope:
			CurrentWindowEvent=True
		Else:
			CurrentWindowEvent=False
	
		EventMatrix(channel, currentWindowIndex) = CurrentWindowEvent
	Return EventMatrix

Def ApplyFilter(Filter):
	For each i, sample :
		Temp = linearFunction(sample) * sample 
		sum1 = temp* Filter(i) 
		sum2 = sample*Filter2(i) %More filters added if necessary
		Energy = sum1+sum2

 

 

 

Benchmarks

This table lists the latest benchmarks.

...

TaskStatusComment
Create fake data vectors
Status
titleNot started
Using random number vectors
Implement event detection algorithm
Status
titleNot started
 
Program arguments for benchmarking
Status
colourGreen
titleDone

Arguments for the size of the vectors and the number of array products used

Preprocessor arguments

Decision tree for event cases
Status
colourGreen
titleDone
Switch case tree for given number of filters - reusable for different cases
Input data from simulation
Status
titleNot started
 
Create circular buffer
Status
colourGreen
titleNot startedDone
 
Optimize loop behavior
Status
colourYellow
titlein progress