ATLAS Offline Software
Loading...
Searching...
No Matches
TRT_BarrelCode.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
6#include <string>
7#include <sstream>
8
9namespace InDetDD {
10//
11// Mask
12//
13const int TRT_BarrelCode::Z_MASK = 0x00000001; // lowest six bits
14const int TRT_BarrelCode::MODULE_MASK = 0x00000003; // lowest two
15const int TRT_BarrelCode::PHI_MASK = 0x0000001F; // lowest five
16const int TRT_BarrelCode::STRAWLAYER_MASK = 0x0000001F; // lowest five
17
18//
19// Shifts
20//
21const int TRT_BarrelCode::Z_SHIFT = 0;
23const int TRT_BarrelCode::PHI_SHIFT = 3;
25
26
31
32TRT_BarrelCode::TRT_BarrelCode(unsigned isPos, unsigned moduleIndex, unsigned phiIndex, unsigned strawLayerIndex)
33 :
34 m_key ((( isPos & Z_MASK ) << Z_SHIFT) |
35 (( moduleIndex & MODULE_MASK ) << MODULE_SHIFT) |
36 (( phiIndex & PHI_MASK ) << PHI_SHIFT) |
37 (( strawLayerIndex & STRAWLAYER_MASK ) << STRAWLAYER_SHIFT))
38{
39}
40
41std::string TRT_BarrelCode::getName() const {
42 std::ostringstream outputStream;
43 outputStream << this;
44 return outputStream.str();
45}
46
47}
static const int STRAWLAYER_SHIFT
std::string getName() const
static const int MODULE_SHIFT
unsigned short int m_key
static const int STRAWLAYER_MASK
static const int Z_MASK
static const int Z_SHIFT
static const int MODULE_MASK
static const int PHI_MASK
static const int PHI_SHIFT
Message Stream Member.