Functions
SpacePointTestUtils.cxx File Reference

Utilities for tests based on space points (implementation file) More...

#include "SpacePointTestUtils.h"
#include <utility>
#include <cmath>
#include <array>

Go to the source code of this file.

Functions

std::pair< int, int > ComputeRangeIndices (double min, double max, double stepSize)
 

Detailed Description

Utilities for tests based on space points (implementation file)

Author
Gianluca Petrillo (petri.nosp@m.llo@.nosp@m.fnal..nosp@m.gov)
Date
June 3, 2016
See also
SpacePointTestUtils.h

Definition in file SpacePointTestUtils.cxx.

Function Documentation

std::pair< int, int > ComputeRangeIndices ( double  min,
double  max,
double  stepSize 
)

Definition at line 81 of file SpacePointTestUtils.cxx.

82 {
83  if (min >= max) return { 0, 0 };
84 
85  double const center = (min + max) / 2.;
86  return { -int((center - min) / stepSize), int((max - center) / stepSize) };
87 
88 } // ::ComputeRangeIndices()
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
def center(depos, point)
Definition: depos.py:117