5#ifndef INDETPHYSVALMONITORINGUTILITIES
6#define INDETPHYSVALMONITORINGUTILITIES
18 operator "" _GeV (
long double energy) {
19 return energy * 0.001;
23 operator "" _GeV (
unsigned long long energy) {
24 return energy * 0.001;
30 inRange(
const T& value,
const T& minVal,
const T& maxVal) {
31 return not ((value < minVal)or(value > maxVal));
36 inRange(
const T& value,
const T& absoluteMax) {
37 return not (std::abs(value) > absoluteMax);
43 binIndex(
const T& val,
const std::vector<T>& partitions) {
47 while (nf and i != partitions.size()) {
48 nf = (val > partitions[i++]);
50 return nf ? i : i - 1;
57 return (pTrk.pt() > safePtThreshold) ? (pTrk.eta()) : std::nan(
"");
63 return (pTrk->pt() > safePtThreshold) ? (pTrk->eta()) : std::nan(
"");
Class to retrieve associated truth from a track, implementing a cached response.
bool inRange(const T &value, const T &minVal, const T &maxVal)
general utility function to check value is in range
float safelyGetEta(const T &pTrk, const float safePtThreshold=0.1)
Safely get eta.
unsigned int binIndex(const T &val, const std::vector< T > &partitions)
general utility function to return bin index given a value and the upper endpoints of each bin