mirror of
https://github.com/slsdetectorgroup/aare.git
synced 2025-06-21 03:07:59 +02:00
clear pedestal
This commit is contained in:
@ -33,6 +33,12 @@ typedef enum {
|
||||
pTopRight = 8
|
||||
} pixel;
|
||||
|
||||
struct Eta2 {
|
||||
double x;
|
||||
double y;
|
||||
corner c;
|
||||
};
|
||||
|
||||
struct ClusterAnalysis {
|
||||
uint32_t c;
|
||||
int32_t tot;
|
||||
@ -74,7 +80,8 @@ int analyze_data(int32_t *data, int32_t *t2, int32_t *t3, char *quad,
|
||||
int analyze_cluster(Cluster3x3& cl, int32_t *t2, int32_t *t3, char *quad,
|
||||
double *eta2x, double *eta2y, double *eta3x, double *eta3y);
|
||||
|
||||
|
||||
NDArray<double, 2> calculate_eta2( ClusterVector<int>& clusters);
|
||||
std::array<double,2> calculate_eta2( Cluster3x3& cl);
|
||||
Eta2 calculate_eta2( Cluster3x3& cl);
|
||||
|
||||
} // namespace aare
|
||||
|
@ -47,6 +47,7 @@ class ClusterFinder {
|
||||
|
||||
NDArray<PEDESTAL_TYPE, 2> pedestal() { return m_pedestal.mean(); }
|
||||
NDArray<PEDESTAL_TYPE, 2> noise() { return m_pedestal.std(); }
|
||||
void clear_pedestal() { m_pedestal.clear(); }
|
||||
|
||||
/**
|
||||
* @brief Move the clusters from the ClusterVector in the ClusterFinder to a
|
||||
|
@ -215,6 +215,15 @@ class ClusterFinderMT {
|
||||
m_current_thread++;
|
||||
}
|
||||
|
||||
void clear_pedestal() {
|
||||
if (!m_processing_threads_stopped) {
|
||||
throw std::runtime_error("ClusterFinderMT is still running");
|
||||
}
|
||||
for (auto &cf : m_cluster_finders) {
|
||||
cf->clear_pedestal();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Return the pedestal currently used by the cluster finder
|
||||
* @param thread_index index of the thread
|
||||
|
@ -89,6 +89,7 @@ template <typename SUM_TYPE = double> class Pedestal {
|
||||
m_sum = 0;
|
||||
m_sum2 = 0;
|
||||
m_cur_samples = 0;
|
||||
m_mean = 0;
|
||||
}
|
||||
|
||||
|
||||
@ -97,6 +98,7 @@ template <typename SUM_TYPE = double> class Pedestal {
|
||||
m_sum(row, col) = 0;
|
||||
m_sum2(row, col) = 0;
|
||||
m_cur_samples(row, col) = 0;
|
||||
m_mean(row, col) = 0;
|
||||
}
|
||||
|
||||
|
||||
@ -119,7 +121,7 @@ template <typename SUM_TYPE = double> class Pedestal {
|
||||
|
||||
/**
|
||||
* Push but don't update the cached mean. Speeds up the process
|
||||
* when intitializing the pedestal.
|
||||
* when initializing the pedestal.
|
||||
*
|
||||
*/
|
||||
template <typename T> void push_no_update(NDView<T, 2> frame) {
|
||||
|
Reference in New Issue
Block a user