Functions
BinnedDiffusion.cxx File Reference
#include "WireCellGen/BinnedDiffusion.h"
#include "WireCellGen/GaussianDiffusion.h"
#include "WireCellUtil/Units.h"
#include <iostream>

Go to the source code of this file.

Functions

static std::pair< double, double > gausdesc_range (const std::vector< Gen::GausDesc > gds, double nsigma)
 

Function Documentation

static std::pair<double,double> gausdesc_range ( const std::vector< Gen::GausDesc gds,
double  nsigma 
)
static

Definition at line 141 of file BinnedDiffusion.cxx.

142 {
143  int ncount = -1;
144  double vmin=0, vmax=0;
145  for (auto gd : gds) {
146  ++ncount;
147 
148  const double lvmin = gd.center - gd.sigma*nsigma;
149  const double lvmax = gd.center + gd.sigma*nsigma;
150  if (!ncount) {
151  vmin = lvmin;
152  vmax = lvmax;
153  continue;
154  }
155  vmin = std::min(vmin, lvmin);
156  vmax = std::max(vmax, lvmax);
157  }
158  return std::make_pair(vmin,vmax);
159 }
static int max(int a, int b)
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:55