ATLAS Offline Software
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 $
14 #include "CaloCellPackerUtils.h"
15 #include <cassert>
16 
17 
19 
20 
25 Bitfield::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 
44 Floatfield::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 
61 Floatfield2::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
CaloCellPackerUtils::Floatfield::Floatfield
Floatfield(unsigned int mask=1, double xmin=1, double xmax=0)
Constructor.
Definition: CaloCellPackerUtils.cxx:44
CaloCellPackerUtils::Bitfield::m_shift
unsigned int m_shift
Shift count.
Definition: CaloCellPackerUtils.h:67
CaloCellPackerUtils::Bitfield
Helper for packing into/out of a bit field.
Definition: CaloCellPackerUtils.h:37
python.utils.AtlRunQueryLookup.mask
string mask
Definition: AtlRunQueryLookup.py:460
CaloCellPackerUtils::Bitfield::Bitfield
Bitfield(unsigned int mask=1)
Constructor.
Definition: CaloCellPackerUtils.cxx:25
xmin
double xmin
Definition: listroot.cxx:60
CaloCellPackerUtils.h
Utilities for compacting calorimeter cells.
CaloCellPackerUtils::Floatfield2::Floatfield2
Floatfield2(unsigned int mask=1, double xmax=1)
Constructor.
Definition: CaloCellPackerUtils.cxx:61
CaloCellPackerUtils::Bitfield::m_mask
unsigned int m_mask
Bitmask. Lower bit should be 1.
Definition: CaloCellPackerUtils.h:64
xmax
double xmax
Definition: listroot.cxx:61
CaloCellPackerUtils
Definition: CaloCellPackerUtils.cxx:18