ATLAS Offline Software
Loading...
Searching...
No Matches
PixelSimHelper.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 InDetSimData helper for pixels
7 This is based on the G3/RD-event. The digitization packages may permit or
8 require more possibilities
9 ------------------------------
10 ATLAS Collaboration
11 ***************************************************************************/
12
13// $Id: PixelSimHelper.h,v 1.2 2003-02-21 09:59:12 schaffer Exp $
14
15#ifndef INDETRAWUTILS_PIXELSIMHELPER_H
16# define INDETRAWUTILS_PIXELSIMHELPER_H
17
18//<<<<<< INCLUDES >>>>>>
20//<<<<<< PUBLIC DEFINES >>>>>>
21//<<<<<< PUBLIC CONSTANTS >>>>>>
22//<<<<<< PUBLIC TYPES >>>>>>
23//<<<<<< PUBLIC VARIABLES >>>>>>
24//<<<<<< PUBLIC FUNCTIONS >>>>>>
25//<<<<<< CLASS DECLARATIONS >>>>>>
26
28{
29public:
30 // methods to set characteristics of a new object
31 static void noise(InDetSimData& sdo, bool flag);
32 static void belowThreshold(InDetSimData& sdo, bool flag);
33 static void disabled(InDetSimData& sdo, bool flag);
34 static void badToT(InDetSimData& sdo, bool flag);
35
36 // methods for clients
37 static bool isNoise(const InDetSimData& sdo);
38 static bool isBelowThreshold(const InDetSimData& sdo);
39 static bool isDisabled(const InDetSimData& sdo);
40 static bool hasBadTOT(const InDetSimData& sdo);
41 static bool isRejected(const InDetSimData& sdo,
42 bool rejectOutOfBunch,
43 bool rejectUnconnected,
44 bool rejectBelowThreshold,
45 bool rejectDisabled,
46 bool rejectLostInReadout,
47 bool rejectNotTrack,
48 bool rejectExtraNoise,
49 bool rejectBadTOT);
50private:
51 enum
52 {
53 NOISE_SET = 0x1, NOISE_CLEAR = 0xfffffffe,
54 BT_SET = 0x2, BT_CLEAR = 0xfffffffd,
55 DISABLED_SET = 0x4, DISABLED_CLEAR = 0xfffffffb,
56 BADTOT_SET = 0x8, BADTOT_CLEAR = 0xfffffff7
57 };
58};
59
60inline void PixelSimHelper::noise(InDetSimData& sdo, bool flag)
61{
62 if (flag)
63 {
64 sdo.m_word |= NOISE_SET;
65 }
66 else
67 {
68 sdo.m_word &= NOISE_CLEAR;
69 };
70}
71
72inline void PixelSimHelper::belowThreshold(InDetSimData& sdo, bool flag)
73{
74 if (flag)
75 {
76 sdo.m_word |= BT_SET;
77 }
78 else
79 {
80 sdo.m_word &= BT_CLEAR;
81 };
82}
83
84inline void PixelSimHelper::disabled(InDetSimData& sdo, bool flag)
85{
86 if (flag)
87 {
88 sdo.m_word |= DISABLED_SET;
89 }
90 else
91 {
93 };
94}
95
96inline void PixelSimHelper::badToT(InDetSimData& sdo, bool flag)
97{
98
99 if (flag)
100 {
101 sdo.m_word |= BADTOT_SET;
102 }
103 else
104 {
105 sdo.m_word &= BADTOT_CLEAR;
106 };
107}
108
110{
111 return (sdo.m_word&NOISE_SET) != 0;
112}
113
115{
116 return (sdo.m_word&BT_SET) != 0;
117}
118
120{
121 return (sdo.m_word&DISABLED_SET) != 0;
122}
123
125{
126 return (sdo.m_word&BADTOT_SET) != 0;
127}
128
130 bool /*rejectOutOfBunch*/,
131 bool /*rejectUnconnected*/,
132 bool rejectBelowThreshold,
133 bool rejectDisabled,
134 bool /*rejectLostInReadout*/,
135 bool /*rejectNotTrack*/,
136 bool rejectExtraNoise,
137 bool rejectBadTOT)
138{
139 // rejectOutOfBunch not implemented
140 // rejectUnconnected not implemented
141 if (rejectBelowThreshold && isBelowThreshold(sdo) && !isNoise(sdo))
142 return true; // as in previous PixelDigitTDR_Cnv
143 if (rejectDisabled && isDisabled(sdo)) return true;
144 // rejectLostInReadout not implemented
145 if (rejectBadTOT && hasBadTOT(sdo)) return true;
146 // rejectNotTrack not implemented
147 if (rejectExtraNoise && isNoise(sdo) && isBelowThreshold(sdo))
148 return true;
149 return false;
150}
151
152//<<<<<< INLINE PUBLIC FUNCTIONS >>>>>>
153//<<<<<< INLINE MEMBER FUNCTIONS >>>>>>
154
155#endif // INDETRAWUTILS_PIXELSIMHELPER_H
static bool isBelowThreshold(const InDetSimData &sdo)
static bool hasBadTOT(const InDetSimData &sdo)
static bool isRejected(const InDetSimData &sdo, bool rejectOutOfBunch, bool rejectUnconnected, bool rejectBelowThreshold, bool rejectDisabled, bool rejectLostInReadout, bool rejectNotTrack, bool rejectExtraNoise, bool rejectBadTOT)
static void badToT(InDetSimData &sdo, bool flag)
static void noise(InDetSimData &sdo, bool flag)
static void belowThreshold(InDetSimData &sdo, bool flag)
static bool isNoise(const InDetSimData &sdo)
static void disabled(InDetSimData &sdo, bool flag)
static bool isDisabled(const InDetSimData &sdo)