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

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 410 of file BinnedDiffusion_transform.cxx.

411 {
412  int ncount = -1;
413  double vmin=0, vmax=0;
414  for (auto gd : gds) {
415  ++ncount;
416 
417  const double lvmin = gd.center - gd.sigma*nsigma;
418  const double lvmax = gd.center + gd.sigma*nsigma;
419  if (!ncount) {
420  vmin = lvmin;
421  vmax = lvmax;
422  continue;
423  }
424  vmin = std::min(vmin, lvmin);
425  vmax = std::max(vmax, lvmax);
426  }
427  return std::make_pair(vmin,vmax);
428 }
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