pflib v3.9.0-rc3-11-g2537d8f
Pretty Fine HGCROC Interaction Library
Loading...
Searching...
No Matches
pflib::algorithm Namespace Reference

housing of higher-level methods for repeatable tasks More...

Functions

std::array< double, 72 > get_toa_efficiencies (const std::vector< pflib::packing::SingleROCEventPacket > &data)
 calculate the highest TOA_VREF value for each link, for which there is a non-zero TOA efficiency
 
std::map< std::string, std::map< std::string, uint64_t > > level_pedestals (Target *tgt, ROC roc)
 Level pedestals so that they are all within noise of their link median.
 
std::map< std::string, std::map< std::string, uint64_t > > toa_vref_scan (Target *tgt, ROC roc)
 Find TOA threshold voltage reference to align TOA values.
 
std::map< std::string, std::map< std::string, uint64_t > > trim_toa_scan (Target *tgt, ROC roc)
 Find trim_toa to align TOA for each channel.
 

Detailed Description

housing of higher-level methods for repeatable tasks

Calculate the TRIM_TOA for each channel that best aligns all of them to a common threshold voltage, charge injection pulse (calib).

Note
Not currently operational, but a good place to pickup from.

Function Documentation

◆ get_toa_efficiencies()

std::array< double, 72 > pflib::algorithm::get_toa_efficiencies ( const std::vector< pflib::packing::SingleROCEventPacket > & data)

calculate the highest TOA_VREF value for each link, for which there is a non-zero TOA efficiency

reserve a vector of the appropriate size to avoid repeating allocation time for all 72 channels

we assume that the data provided is not empty otherwise the efficiency calculation is meaningless

◆ level_pedestals()

std::map< std::string, std::map< std::string, uint64_t > > pflib::algorithm::level_pedestals ( Target * tgt,
ROC roc )

Level pedestals so that they are all within noise of their link median.

Parameters
[in]tgtpointer to Target to interact with
Note
Only functional for single-ROC targets

do three runs of 100 samples each to have well defined pedestals

◆ toa_vref_scan()

std::map< std::string, std::map< std::string, uint64_t > > pflib::algorithm::toa_vref_scan ( Target * tgt,
ROC roc )

Find TOA threshold voltage reference to align TOA values.

Parameters
[in]tgtpointer to Target to interact with
Note
Only functional for single-ROC targets

do a run of 100 samples per toa_vref to measure the TOA efficiency when looking at pedestal data

◆ trim_toa_scan()

std::map< std::string, std::map< std::string, uint64_t > > pflib::algorithm::trim_toa_scan ( Target * tgt,
ROC roc )

Find trim_toa to align TOA for each channel.

Parameters
[in]tgtpointer to Target to interact with
Note
Only functional for single-ROC targets

Charge injection scan (100 samples) while varying TRIM_TOA. Purpose is to align TRIM_TOA for each channel. Calculates TOA efficiency while looking at charge injection data. Then uses Siegel Linear Regression to calculate the aligned TRIM_TOA value for each channel to match a common "calib" value.

Note
Reduce the sample size (ex: 100 to 10) to decrease the scan time.

Now that we have the data, we need to analyze it.

We'll be looking for the turn-on (threshold) points for each channel at each trim_toa value. The turn-on (threshold) point is the first point where toa_efficiency goes from 0 to non-zero. The toa_efficiency is simply the number of times TOA triggers divided by the sample size, for a given trim_toa/calib/channel combination.

We'll be using the Siegel Linear Regression because it's less sensitive to outliers, since sometimes changing the trim_toa causes the threshold (turn-on) points to "wrap around".