ATLAS Offline Software
Loading...
Searching...
No Matches
TRT_DriftCircle.icc
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
4
5namespace InDet {
6
7inline unsigned int
8TRT_DriftCircle::getWord() const
9{
10 return m_word;
11}
12
13inline int
14TRT_DriftCircle::driftTimeBin() const
15{
16 if (!m_island.isValid()) {
17 Island tmpIsland;
18 TRT_LoLumRawData::findLargestIsland(m_word, tmpIsland);
19 m_island.set(tmpIsland);
20 }
21 return m_island.ptr()->m_leadingEdge;
22}
23
24inline int
25TRT_DriftCircle::trailingEdge() const
26{
27 if (!m_island.isValid()) {
28 Island tmpIsland;
29 TRT_LoLumRawData::findLargestIsland(m_word, tmpIsland);
30 m_island.set(tmpIsland);
31 }
32 return m_island.ptr()->m_trailingEdge;
33}
34
35inline bool
36TRT_DriftCircle::highLevel() const
37{
38 return TRT_LoLumRawData::highLevel(m_word);
39}
40
41inline bool
42TRT_DriftCircle::firstBinHigh() const
43{
44 return (m_word & 0x02000000);
45}
46
47inline bool
48TRT_DriftCircle::lastBinHigh() const
49{
50 return (m_word & 0x1);
51}
52
53inline double
54TRT_DriftCircle::timeOverThreshold() const {
55 unsigned int leadingEdge = driftTimeBin();
56 unsigned int trailingEdge = this->trailingEdge();
57 if (leadingEdge && trailingEdge) {
58 return (trailingEdge - leadingEdge + 1) *
59 TRT_LoLumRawData::getDriftTimeBinWidth();
60 };
61 return 0.;
62}
63
64inline double
65TRT_DriftCircle::rawDriftTime() const {
66 return (driftTimeBin() + 0.5) * TRT_LoLumRawData::getDriftTimeBinWidth();
67}
68
69inline bool
70TRT_DriftCircle::driftTimeValid() const
71{
72 return m_word & 0x08000000;
73}
74
75inline double
76TRT_DriftCircle::driftTime(bool& valid) const
77{
78 valid = driftTimeValid();
79 return rawDriftTime();
80}
81
82inline void
83TRT_DriftCircle::setDriftTimeValid(bool valid)
84{
85 unsigned maskfalse = 0xF7FFFFFF;
86 unsigned masktrue = 0x08000000;
87 if (valid) {
88 m_word |= masktrue;
89 } else {
90 m_word &= maskfalse;
91 }
92}
93
94
95inline int
96TRT_DriftCircle::numberOfHighsBetweenEdges() const
97{
98 // should return always 0 with the largest island algorithm
99 int LE = driftTimeBin();
100 int TE = trailingEdge();
101 unsigned mask = 0x02000000;
102 int nhigh = 0;
103 int i;
104 for (i = 0; i < 24; ++i) {
105 if ((m_word & mask) && i >= LE && i <= TE)
106 nhigh++;
107 mask >>= 1;
108 if (i == 7 || i == 15)
109 mask >>= 1;
110 }
111 return nhigh;
112}
113
114inline int
115TRT_DriftCircle::numberOfLowsBetweenEdges() const
116{
117 // should return always 0 with the largest island algorithm
118 int LE = driftTimeBin();
119 int TE = trailingEdge();
120 return (TE - LE + 1 - numberOfHighsBetweenEdges());
121}
122
123inline bool
124TRT_DriftCircle::isNoise() const
125{
126 if (numberOfHighsBetweenEdges() < 3)
127 return true;
128 if (timeOverThreshold() < 7.)
129 return true;
130 return false;
131}
132
133inline Trk::PrepRawDataType
134TRT_DriftCircle::prdType() const {
135 return Trk::PrepRawDataType::TRT_DriftCircle;
136}
137
138inline const InDetDD::TRT_BaseElement*
139TRT_DriftCircle::detectorElement() const
140{
141 return m_detEl;
142}
143
144}