ATLAS Offline Software
MdtTubeInChamberHashTable.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 /***************************************************************************
6  * Mdt Calibration Data Model
7  * -----------------------------------------
8  *
9  * Author : Martin Woudstra
10  * Creation Date: 5 April 2004
11  * Last Update : 9 May 2005
12  ***************************************************************************/
13 
16 #ifndef MUONCALIBIDENTIFIERS_MDTTUBEINCHAMBERHASHTABLE_H
17 # define MUONCALIBIDENTIFIERS_MDTTUBEINCHAMBERHASHTABLE_H
18 // std
19 
20 // other packages
21 
22 // this package
23 #include "MuonCalibIdentifier/MdtFixedIds.h"
26 
28 public:
31  const MdtChamberId& chamberId );
34  const MdtChamberId& chamberId, unsigned int globalHashOffset );
36  void clear();
38  void setGlobalHashOffset( unsigned int offset );
40  MdtChamberId chamberId() const;
42  unsigned int nMultilayers() const;
44  unsigned int nLayers() const;
46  unsigned int nTubes() const;
48  unsigned int nTotalTubes() const;
50  MdtTubeHash localHash( const MdtTubeId& id ) const;
52  MdtTubeHash globalHash( const MdtTubeId& id ) const;
54  unsigned int localHashMax() const;
57  unsigned int globalHashMin() const;
60  unsigned int globalHashMax() const;
62  MdtTubeId tubeIdFromLocalHash( const MdtTubeHash& localHash ) const;
64  MdtTubeId tubeIdFromGlobalHash( const MdtTubeHash& globalHash ) const;
65 private:
67  MdtChamberId m_chamberId;
68  unsigned int m_globalHashOffset;
69 };
70 
72  const MdtTubeInChamberHashTableType* type, const MdtChamberId& id )
73  : m_localHashTable(type), m_chamberId(id), m_globalHashOffset(0)
74 {}
75 
77  const MdtTubeInChamberHashTableType* type, const MdtChamberId& id, unsigned int offset )
78  : m_localHashTable(type), m_chamberId(id), m_globalHashOffset(offset)
79 {}
80 
81 inline MdtChamberId MdtTubeInChamberHashTable::chamberId() const {
82  return m_chamberId;
83 }
84 
85 inline unsigned int MdtTubeInChamberHashTable::localHashMax() const {
86  return m_localHashTable->size();
87 }
88 
89 inline MdtTubeHash MdtTubeInChamberHashTable::localHash( const MdtTubeId& id ) const {
90  return m_localHashTable->getHash( id );
91 }
92 
93 inline unsigned int MdtTubeInChamberHashTable::globalHashMin() const {
94  return m_globalHashOffset;
95 }
96 
97 inline unsigned int MdtTubeInChamberHashTable::globalHashMax() const {
99 }
100 
101 inline unsigned int MdtTubeInChamberHashTable::nMultilayers() const {
102  return m_localHashTable->nMultilayers();
103 }
104 
105 inline unsigned int MdtTubeInChamberHashTable::nLayers() const {
106  return m_localHashTable->nLayers();
107 }
108 
109 inline unsigned int MdtTubeInChamberHashTable::nTubes() const {
110  return m_localHashTable->nTubes();
111 }
112 
113 inline unsigned int MdtTubeInChamberHashTable::nTotalTubes() const {
114  return m_localHashTable->nTotalTubes();
115 }
116 
117 inline MdtTubeHash
118 MdtTubeInChamberHashTable::globalHash( const MdtTubeId& id ) const {
119  return MdtTubeHash( m_globalHashOffset + localHash( id ) );
120 }
121 
122 inline MdtTubeId
123 MdtTubeInChamberHashTable::tubeIdFromLocalHash( const MdtTubeHash& locHash ) const {
124  return MdtTubeId( m_chamberId, m_localHashTable->getIdentifier( locHash ) );
125 }
126 
127 inline MdtTubeId
128 MdtTubeInChamberHashTable::tubeIdFromGlobalHash( const MdtTubeHash& globHash ) const {
129  return tubeIdFromLocalHash( MdtTubeHash( globHash - globalHashMin() ) );
130 }
131 
132 
133 #endif // MUONCALIBIDENTIFIERS_MDTTUBEINCHAMBERHASHTABLE_H
IdentifierHashCalc::getHash
HashType getHash(const IdType &id) const
Get hash from 0 to size()-1.
MdtTubeInChamberHashTable::globalHashMax
unsigned int globalHashMax() const
Return maximum global hash plus 1 for this chamber.
Definition: MdtTubeInChamberHashTable.h:97
MdtTubeInChamberHashTable::nTubes
unsigned int nTubes() const
Return the number of tubes per layer.
Definition: MdtTubeInChamberHashTable.h:109
MdtTubeInChamberHashTable::m_globalHashOffset
unsigned int m_globalHashOffset
Definition: MdtTubeInChamberHashTable.h:75
MdtTubeInChamberHashTable::tubeIdFromLocalHash
MdtTubeId tubeIdFromLocalHash(const MdtTubeHash &localHash) const
Get (full) tube identifier from local hash.
Definition: MdtTubeInChamberHashTable.h:123
MdtTubeInChamberHashTable::MdtTubeInChamberHashTable
MdtTubeInChamberHashTable(const MdtTubeInChamberHashTableType *type, const MdtChamberId &chamberId)
constructor
Definition: MdtTubeInChamberHashTable.h:71
MdtTubeInChamberHashTable::m_localHashTable
const MdtTubeInChamberHashTableType * m_localHashTable
Definition: MdtTubeInChamberHashTable.h:73
MdtTubeInChamberHashTable::nMultilayers
unsigned int nMultilayers() const
Return the number of multilayers in the chamber.
Definition: MdtTubeInChamberHashTable.h:101
MdtTubeInChamberHashTable::nTotalTubes
unsigned int nTotalTubes() const
Return the total number of tubes in the chamber.
Definition: MdtTubeInChamberHashTable.h:113
MdtTubeInChamberHashTable::chamberId
MdtChamberId chamberId() const
Return the chamber identifier.
Definition: MdtTubeInChamberHashTable.h:81
MdtTubeInChamberHashTable::nLayers
unsigned int nLayers() const
Return the number of layers per multilayer.
Definition: MdtTubeInChamberHashTable.h:105
MdtTubeInChamberHashTableType::nTubes
unsigned int nTubes() const
Return the number of tubes per layer.
Definition: MdtTubeInChamberHashTableType.h:85
MdtTubeInChamberHashTableType.h
MdtTubeInChamberHashTable::globalHash
MdtTubeHash globalHash(const MdtTubeId &id) const
Return the global tube hash.
Definition: MdtTubeInChamberHashTable.h:118
MdtTubeInChamberHashTable::setGlobalHashOffset
void setGlobalHashOffset(unsigned int offset)
Set global hash offset to offset.
MdtTubeInChamberHashTable
class for making an MDT tube hash within one chamber.
Definition: MdtTubeInChamberHashTable.h:27
MdtTubeInChamberHashTableType
holds the MDT chamber type information in the form of a MdtChamberTypeInfo data member.
Definition: MdtTubeInChamberHashTableType.h:30
MdtTubeInChamberHashTableType::nTotalTubes
unsigned int nTotalTubes() const
Return the total number of tubes in the chamber.
Definition: MdtTubeInChamberHashTableType.h:89
MdtTubeInChamberHashTable::globalHashMin
unsigned int globalHashMin() const
Return minimum global hash for this chamber.
Definition: MdtTubeInChamberHashTable.h:93
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:227
MdtTubeInChamberHashTable::localHashMax
unsigned int localHashMax() const
Returns the maximum local hash value plus 1.
Definition: MdtTubeInChamberHashTable.h:85
MdtFixedHashes.h
MdtTubeInChamberHashTableType::nLayers
unsigned int nLayers() const
Return the number of layers per multilayer.
Definition: MdtTubeInChamberHashTableType.h:81
MdtTubeInChamberHashTable::localHash
MdtTubeHash localHash(const MdtTubeId &id) const
Return the hash-within-chamber from 0 to numberOfTubes()-1.
Definition: MdtTubeInChamberHashTable.h:89
MdtTubeInChamberHashTable::m_chamberId
MdtChamberId m_chamberId
Definition: MdtTubeInChamberHashTable.h:74
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
MdtTubeInChamberHashTableType::nMultilayers
unsigned int nMultilayers() const
Return the number of multilayers in the chamber.
Definition: MdtTubeInChamberHashTableType.h:68
convertTimingResiduals.offset
offset
Definition: convertTimingResiduals.py:71
MdtTubeInChamberHashTable::tubeIdFromGlobalHash
MdtTubeId tubeIdFromGlobalHash(const MdtTubeHash &globalHash) const
Get (full) tube identifier from global hash.
Definition: MdtTubeInChamberHashTable.h:128
IdentifierHashCalc::size
unsigned int size() const
Number of hashes in the table.
IdentifierHashCalc::getIdentifier
IdType getIdentifier(const HashType &idHash) const
Get identifier from hash.
MdtTubeInChamberHashTable::clear
void clear()
Clear the hashtable.