ATLAS Offline Software
Loading...
Searching...
No Matches
CaloCellPackerUtils.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
5// $Id: CaloCellPackerUtils.cxx,v 1.1 2007-11-08 18:14:22 ssnyder Exp $
12
13
14#include "CaloCellPackerUtils.h"
15#include <cassert>
16
17
19
20
25Bitfield::Bitfield (unsigned int mask /*= 1*/)
26{
27 // Shift the mask until the rightmost bit is non-zero.
28 assert (mask != 0);
29 m_shift = 0;
30 while ((mask & 1) == 0) {
31 mask >>= 1;
32 ++m_shift;
33 }
34 m_mask = mask;
35}
36
37
44Floatfield::Floatfield (unsigned int mask/*=1*/,
45 double xmin/*=1*/,
46 double xmax/*=0*/)
47 : Bitfield (mask),
48 m_xmin (xmin),
49 m_xmax (xmax),
50 m_fact ((xmax-xmin) / (m_mask + 1)),
51 m_ifact (1/m_fact)
52{
53}
54
55
61Floatfield2::Floatfield2 (unsigned int mask/*=1*/,
62 double xmax/*=1*/)
63 : Bitfield (mask),
64 m_xmax (xmax),
65 m_fact (xmax / (m_mask + 1)),
66 m_ifact (1/m_fact)
67{
68}
69
70
71} // namespace CaloCellPackerUtils
Utilities for compacting calorimeter cells.
unsigned int m_mask
Bitmask. Lower bit should be 1.
unsigned int m_shift
Shift count.
Bitfield(unsigned int mask=1)
Constructor.
double m_xmax
Largest representable value.
double m_ifact
Cached factor for float->int conversions.
double m_fact
Cached factor for int->float conversions.
Floatfield2(unsigned int mask=1, double xmax=1)
Constructor.
double m_xmin
Smallest representable value.
Floatfield(unsigned int mask=1, double xmin=1, double xmax=0)
Constructor.
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