ATLAS Offline Software
Loading...
Searching...
No Matches
safeLogRatio.h File Reference
#include <cmath>
#include "xAODJet/Jet.h"
#include "xAODBTagging/BTagging.h"
#include "xAODBTagging/BTaggingContainer.h"
#include "xAODJet/JetContainer.h"
Include dependency graph for safeLogRatio.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

float safeLogRatio (float num, float denom)
const xAOD::JetgetJetFromBTagLink (const SG::AuxElement &btag)

Function Documentation

◆ getJetFromBTagLink()

const xAOD::Jet * getJetFromBTagLink ( const SG::AuxElement & btag)

◆ safeLogRatio()

float safeLogRatio ( float num,
float denom )

Definition at line 10 of file safeLogRatio.cxx.

10 {
11 // ep(silon) is the smallest non-subnormal number
12 // the recyprocal of this should not overflow
13 float ep = std::numeric_limits<float>::min();
14 float ratio = (std::abs(denom) < ep ? INFINITY : num / denom);
15 return std::abs(ratio) < ep ? -INFINITY : std::log( ratio );
16}