ATLAS Offline Software
Loading...
Searching...
No Matches
TRT_EndcapCode.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//
12// Mask
13//
14const int TRT_EndcapCode::Z_MASK = 0x00000001; // lowest six bits
15const int TRT_EndcapCode::WHEEL_MASK = 0x0000001F; // lowest five
16const int TRT_EndcapCode::STRAWLAYER_MASK = 0x0000001F; // lowest five
17const int TRT_EndcapCode::PHIPOS_MASK = 0x0000001F;
18
19//
20// Shifts
21//
22const int TRT_EndcapCode::Z_SHIFT = 0;
23const int TRT_EndcapCode::WHEEL_SHIFT = 1;
25const int TRT_EndcapCode::PHIPOS_SHIFT = 11;
26
31
32TRT_EndcapCode::TRT_EndcapCode(unsigned isPos, unsigned wheelIndex, unsigned strawLayerIndex, unsigned int phiIndex)
33 :
34 m_key ((( isPos & Z_MASK ) << Z_SHIFT) |
35 (( wheelIndex & WHEEL_MASK ) << WHEEL_SHIFT) |
36 (( strawLayerIndex & STRAWLAYER_MASK ) << STRAWLAYER_SHIFT) |
37 (( phiIndex & PHIPOS_MASK ) << PHIPOS_SHIFT))
38{
39}
40
42{
43 m_key = right.getKey();
44}
45
46
47
48
49
50
51
53{
54 if (this != &right){
55 m_key = right.getKey();
56 }
57 return *this;
58}
59
60
61
62std::string TRT_EndcapCode::getName() const {
63 std::ostringstream outputStream;
64 outputStream << this;
65 return outputStream.str();
66}
67
68}
static const int Z_MASK
static const int STRAWLAYER_MASK
static const int Z_SHIFT
static const int PHIPOS_SHIFT
std::string getName() const
static const int WHEEL_MASK
static const int STRAWLAYER_SHIFT
unsigned short int m_key
static const int WHEEL_SHIFT
TRT_EndcapCode & operator=(const TRT_EndcapCode &right)
static const int PHIPOS_MASK
unsigned int getKey() const
Message Stream Member.