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
21namespace CaloCellPackerUtils {
22
23
34{
35public:
40 Bitfield (unsigned int mask = 1);
41
42
48 unsigned int in (unsigned int x) const;
49
50
56 unsigned int out (unsigned int x) const;
57
58
59protected:
61 unsigned int m_mask;
62
64 unsigned int m_shift;
65};
66
67
77 : public Bitfield
78{
79public:
86 Floatfield (unsigned int mask=1, double xmin=1, double xmax=0);
87
88
94 unsigned int in (double x) const;
95
96
103 double out (unsigned int x, int& underflow) const;
104
105
106private:
108 double m_xmin;
109
111 double m_xmax;
112
114 double m_fact;
115
117 double m_ifact;
118};
119
120
128 : public Bitfield
129{
130public:
136 Floatfield2 (unsigned int mask=1, double xmax=1);
137
138
144 unsigned int in (double x) const;
145
146
152 double out (unsigned int x) const;
153
154
155private:
157 double m_xmax;
158
160 double m_fact;
161
163 double m_ifact;
164};
165
166
167} // namespace CaloCellPackerUtils
168
169
171
172
173#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