ATLAS Offline Software
Loading...
Searching...
No Matches
CopyFloatWithErrorcode.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
5//Dear emacs, this is -*-c++-*-
6#ifndef COPYFLOATWITHERRORCODE_H
7#define COPYFLOATWITHERRORCODE_H
8
15
17#include <math.h>
18
19//A copy rountine to get floats from persistency,
20// protected against roundoff problems and nans
21inline float copyFloatPT(const float& pers) {
22 //Protect against rounding effects and nans.
23 if (std::isnan(pers) || pers<=1.0+LArElecCalib::ERRORCODE)
24 return (float)LArElecCalib::ERRORCODE;
25 else
26 return pers;
27}
28
29
30#endif
float copyFloatPT(const float &pers)
Defines a common ERRORCODE enum for LAr-Calibration objects.