ATLAS Offline Software
Loading...
Searching...
No Matches
CaloCellPackerUtils.h
Go to the documentation of this file.
1// This file's extension implies that it's C, but it's really -*- C++ -*-.
2
3/*
4 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
5*/
6
7// $Id: CaloCellPackerUtils.h,v 1.1 2007-11-08 18:14:20 ssnyder Exp $
8
15
16
17#ifndef CALOCELLPACKERUTILS_H
18#define CALOCELLPACKERUTILS_H
19
20
21#include "GaudiKernel/Kernel.h" // For LIKELY
22
23
24namespace CaloCellPackerUtils {
25
26
37{
38public:
43 Bitfield (unsigned int mask = 1);
44
45
51 unsigned int in (unsigned int x) const;
52
53
59 unsigned int out (unsigned int x) const;
60
61
62protected:
64 unsigned int m_mask;
65
67 unsigned int m_shift;
68};
69
70
80 : public Bitfield
81{
82public:
89 Floatfield (unsigned int mask=1, double xmin=1, double xmax=0);
90
91
97 unsigned int in (double x) const;
98
99
106 double out (unsigned int x, int& underflow) const;
107
108
109private:
111 double m_xmin;
112
114 double m_xmax;
115
117 double m_fact;
118
120 double m_ifact;
121};
122
123
131 : public Bitfield
132{
133public:
139 Floatfield2 (unsigned int mask=1, double xmax=1);
140
141
147 unsigned int in (double x) const;
148
149
155 double out (unsigned int x) const;
156
157
158private:
160 double m_xmax;
161
163 double m_fact;
164
166 double m_ifact;
167};
168
169
170} // namespace CaloCellPackerUtils
171
172
174
175
176#endif // not CALOCELLPACKERUTILS_H
#define x
unsigned int out(unsigned int x) const
Extract a value from the bitfield.
unsigned int m_mask
Bitmask. Lower bit should be 1.
unsigned int in(unsigned int x) const
Shift and mask a value into the bitfield.
unsigned int m_shift
Shift count.
Bitfield(unsigned int mask=1)
Constructor.
double m_xmax
Largest representable value.
unsigned int in(double x) const
Shift and mask a value into the bitfield.
double m_ifact
Cached factor for float->int conversions.
double out(unsigned int x) const
Extract a value from the bitfield.
double m_fact
Cached factor for int->float conversions.
Floatfield2(unsigned int mask=1, double xmax=1)
Constructor.
unsigned int in(double x) const
Shift and mask a value into the bitfield.
double m_xmin
Smallest representable value.
Floatfield(unsigned int mask=1, double xmin=1, double xmax=0)
Constructor.
double out(unsigned int x, int &underflow) const
Extract a value from the bitfield.
double m_ifact
Cached factor for float->int conversions.
double m_fact
Cached factor for int->float conversions.
double m_xmax
Largest representable value.
double xmax
Definition listroot.cxx:61
double xmin
Definition listroot.cxx:60