ATLAS Offline Software
Loading...
Searching...
No Matches
SiHelper Class Reference

#include <SiHelper.h>

Collaboration diagram for SiHelper:

Static Public Member Functions

static void noise (SiChargedDiode &chDiode, bool flag, bool mask=false)
static void belowThreshold (SiChargedDiode &chDiode, bool flag, bool mask=false)
static void disabled (SiChargedDiode &chDiode, bool flag, bool mask=false)
static void badToT (SiChargedDiode &chDiode, bool flag, bool mask=false)
static void disconnected (SiChargedDiode &chDiode, bool flag, bool mask=false)
static void maskOut (SiChargedDiode &chDiode, bool flag)
static void ClusterUsed (SiChargedDiode &chDiode, bool flag)
static void SetBunch (SiChargedDiode &chDiode, int bunch, MsgStream *log=nullptr)
static void SetStripNum (SiChargedDiode &chDiode, int nstrip, MsgStream *log=nullptr)
static void SetTimeBin (SiChargedDiode &chDiode, int time, MsgStream *log=nullptr)
static bool isUsable (SiChargedDiode &chDiode)
static bool isNoise (SiChargedDiode &chDiode)
static bool isBelowThreshold (SiChargedDiode &chDiode)
static bool isDisabled (SiChargedDiode &chDiode)
static bool isBadToT (SiChargedDiode &chDiode)
static bool isDisconnected (SiChargedDiode &chDiode)
static bool isMaskOut (SiChargedDiode &chDiode)
static bool isClusterUsed (SiChargedDiode &chDiode)
static int GetBunch (SiChargedDiode &chDiode)
static int GetStripNum (SiChargedDiode &chDiode)
static int GetTimeBin (SiChargedDiode &chDiode)

Private Types

enum  {
  NOISE_SET = 0x1 , BT_SET = 0x2 , DISABLED_SET = 0x4 , BADTOT_SET = 0x8 ,
  DISCONNECTED_SET = 0x10 , CLUSTERUSED_SET = 0x20 , MASKOUT_SET = 0x40
}

Detailed Description

Definition at line 27 of file SiHelper.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private
Enumerator
NOISE_SET 
BT_SET 
DISABLED_SET 
BADTOT_SET 
DISCONNECTED_SET 
CLUSTERUSED_SET 
MASKOUT_SET 

Definition at line 56 of file SiHelper.h.

56 {
57 NOISE_SET = 0x1, // main charge is noise
58 BT_SET = 0x2, // below threshold
59 DISABLED_SET = 0x4, // disabled
60 BADTOT_SET = 0x8, // bad TOT
61 DISCONNECTED_SET = 0x10, // disconnected
62 CLUSTERUSED_SET = 0x20, // used in cluster - used by anyone???
63 MASKOUT_SET = 0x40 // charge diode is masked out, not to be used for RDO creation
64 };
@ NOISE_SET
Definition SiHelper.h:57
@ DISCONNECTED_SET
Definition SiHelper.h:61
@ CLUSTERUSED_SET
Definition SiHelper.h:62
@ DISABLED_SET
Definition SiHelper.h:59
@ MASKOUT_SET
Definition SiHelper.h:63
@ BADTOT_SET
Definition SiHelper.h:60

Member Function Documentation

◆ badToT()

void SiHelper::badToT ( SiChargedDiode & chDiode,
bool flag,
bool mask = false )
inlinestatic

Definition at line 102 of file SiHelper.h.

102 {
103 if (flag) {
104 chDiode.m_word |= BADTOT_SET;
105 } else {
106 chDiode.m_word &= ~BADTOT_SET;
107 }
108 if (mask) SiHelper::maskOut(chDiode,true);
109}
static void maskOut(SiChargedDiode &chDiode, bool flag)
Definition SiHelper.h:67

◆ belowThreshold()

void SiHelper::belowThreshold ( SiChargedDiode & chDiode,
bool flag,
bool mask = false )
inlinestatic

Definition at line 84 of file SiHelper.h.

84 {
85 if (flag) {
86 chDiode.m_word |= BT_SET;
87 } else {
88 chDiode.m_word &= ~BT_SET;
89 }
90 if (mask) SiHelper::maskOut(chDiode,true);
91}

◆ ClusterUsed()

void SiHelper::ClusterUsed ( SiChargedDiode & chDiode,
bool flag )
inlinestatic

Definition at line 121 of file SiHelper.h.

121 {
122 if (flag) {
123 chDiode.m_word |= CLUSTERUSED_SET;
124 } else {
125 chDiode.m_word &= ~CLUSTERUSED_SET;
126 }
127}

◆ disabled()

void SiHelper::disabled ( SiChargedDiode & chDiode,
bool flag,
bool mask = false )
inlinestatic

Definition at line 93 of file SiHelper.h.

93 {
94 if (flag) {
95 chDiode.m_word |= DISABLED_SET;
96 } else {
97 chDiode.m_word &= ~DISABLED_SET;
98 }
99 if (mask) SiHelper::maskOut(chDiode,true);
100}

◆ disconnected()

void SiHelper::disconnected ( SiChargedDiode & chDiode,
bool flag,
bool mask = false )
inlinestatic

Definition at line 111 of file SiHelper.h.

111 {
112 if (flag) {
113 chDiode.m_word |= DISCONNECTED_SET;
114 } else {
115 chDiode.m_word &= ~DISCONNECTED_SET;
116 }
117 if (mask) SiHelper::maskOut(chDiode,true);
118}

◆ GetBunch()

int SiHelper::GetBunch ( SiChargedDiode & chDiode)
inlinestatic

Definition at line 195 of file SiHelper.h.

195 {
196return ( (chDiode.m_word >> 8) & 0xff );
197}

◆ GetStripNum()

int SiHelper::GetStripNum ( SiChargedDiode & chDiode)
inlinestatic

Definition at line 199 of file SiHelper.h.

199 {
200 return ( (chDiode.m_word >> 16) & 0xfff );
201}

◆ GetTimeBin()

int SiHelper::GetTimeBin ( SiChargedDiode & chDiode)
inlinestatic

Definition at line 203 of file SiHelper.h.

203 {
204return ( (chDiode.m_word >> 28) & 0xf );
205}

◆ isBadToT()

bool SiHelper::isBadToT ( SiChargedDiode & chDiode)
inlinestatic

Definition at line 183 of file SiHelper.h.

183 {
184 return (chDiode.m_word & BADTOT_SET);
185}

◆ isBelowThreshold()

bool SiHelper::isBelowThreshold ( SiChargedDiode & chDiode)
inlinestatic

Definition at line 175 of file SiHelper.h.

175 {
176 return (chDiode.m_word & BT_SET);
177}

◆ isClusterUsed()

bool SiHelper::isClusterUsed ( SiChargedDiode & chDiode)
inlinestatic

Definition at line 191 of file SiHelper.h.

191 {
192 return (chDiode.m_word & CLUSTERUSED_SET);
193}

◆ isDisabled()

bool SiHelper::isDisabled ( SiChargedDiode & chDiode)
inlinestatic

Definition at line 179 of file SiHelper.h.

179 {
180 return (chDiode.m_word & DISABLED_SET);
181}

◆ isDisconnected()

bool SiHelper::isDisconnected ( SiChargedDiode & chDiode)
inlinestatic

Definition at line 187 of file SiHelper.h.

187 {
188 return (chDiode.m_word & DISCONNECTED_SET);
189}

◆ isMaskOut()

bool SiHelper::isMaskOut ( SiChargedDiode & chDiode)
inlinestatic

Definition at line 171 of file SiHelper.h.

171 {
172 return (chDiode.m_word & MASKOUT_SET);
173}

◆ isNoise()

bool SiHelper::isNoise ( SiChargedDiode & chDiode)
inlinestatic

Definition at line 167 of file SiHelper.h.

167 {
168 return (chDiode.m_word & NOISE_SET);
169}

◆ isUsable()

bool SiHelper::isUsable ( SiChargedDiode & chDiode)
inlinestatic

Definition at line 161 of file SiHelper.h.

161 {
162 return !SiHelper::isMaskOut(chDiode);
163 // return (((chDiode.m_word & 0xff) == 0) || // no special status bits sets, either track, xtalk or random noise
164 // (SiHelper::isClusterUsed(chDiode)) ); // cluster used - whatever that means - not set in digitization
165}
static bool isMaskOut(SiChargedDiode &chDiode)
Definition SiHelper.h:171

◆ maskOut()

void SiHelper::maskOut ( SiChargedDiode & chDiode,
bool flag )
inlinestatic

Definition at line 67 of file SiHelper.h.

67 {
68 if (flag) {
69 chDiode.m_word |= MASKOUT_SET;
70 } else {
71 chDiode.m_word &= ~MASKOUT_SET;
72 }
73}

◆ noise()

void SiHelper::noise ( SiChargedDiode & chDiode,
bool flag,
bool mask = false )
inlinestatic

Definition at line 75 of file SiHelper.h.

75 {
76 if (flag) {
77 chDiode.m_word |= NOISE_SET;
78 } else {
79 chDiode.m_word &= ~NOISE_SET;
80 }
81 if (mask) SiHelper::maskOut(chDiode,true);
82}

◆ SetBunch()

void SiHelper::SetBunch ( SiChargedDiode & chDiode,
int bunch,
MsgStream * log = nullptr )
inlinestatic

Definition at line 129 of file SiHelper.h.

129 {
130 //
131 // Code the bunch number in the 8 bits set corresponding to xx in xx00
132 //
133 if (bunch > 0xff) {
134 if (log) (*log) << MSG::ERROR << "Bunch Number not allowed" << endmsg;
135 }
136 chDiode.m_word = chDiode.m_word | ( (bunch&0xff) <<8 ) ;
137}
#define endmsg

◆ SetStripNum()

void SiHelper::SetStripNum ( SiChargedDiode & chDiode,
int nstrip,
MsgStream * log = nullptr )
inlinestatic

Definition at line 139 of file SiHelper.h.

139 {
140 //
141 // Code the number of strips in the 12 bits set corresponding to xxx in 0xxx0000
142 //
143 if (nstrip > 0xfff) {
144 if (log) (*log) << MSG::ERROR << "Number of strips not allowed" << endmsg;
145 }
146 chDiode.m_word = chDiode.m_word | ((nstrip&0xfff) << 16 ) ;
147}

◆ SetTimeBin()

void SiHelper::SetTimeBin ( SiChargedDiode & chDiode,
int time,
MsgStream * log = nullptr )
inlinestatic

Definition at line 149 of file SiHelper.h.

149 {
150 //
151 // Code the SCT Timebin number in the 3 bits set corresponding to x in x0000000
152 //
153 if (time > 0xf) {
154 if (log) (*log) << MSG::ERROR << "TimeBin not allowed" << endmsg;
155 }
156 chDiode.m_word = chDiode.m_word | ( (static_cast<unsigned int>(time)&0xf) <<28 ) ;
157}
time(flags, cells_name, *args, **kw)

The documentation for this class was generated from the following file: