ATLAS Offline Software
Loading...
Searching...
No Matches
SCT_SimHelper.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 SCT
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: SCT_SimHelper.h,v 1.2 2003-02-21 09:59:12 schaffer Exp $
14
15#ifndef INDETRAWUTILS_SCT_SIMHELPER_H
16# define INDETRAWUTILS_SCT_SIMHELPER_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
35 // methods for clients
36 static bool isNoise(const InDetSimData& sdo);
37 static bool isBelowThreshold(const InDetSimData& sdo);
38 static bool isDisabled(const InDetSimData& sdo);
39 static bool isRejected(const InDetSimData& sdo,
40 bool rejectOutOfBunch,
41 bool rejectUnconnected,
42 bool rejectBelowThreshold,
43 bool rejectDisabled,
44 bool rejectLostInReadout,
45 bool rejectNotTrack,
46 bool rejectExtraNoise);
47
48private:
49 enum
50 {
51 NOISE_SET = 0x1, NOISE_CLEAR = 0xfffffffe,
52 BT_SET = 0x2, BT_CLEAR = 0xfffffffd,
53 DISABLED_SET = 0x4, DISABLED_CLEAR = 0xfffffffb
54 };
55};
56
57inline void SCT_SimHelper::noise(InDetSimData& sdo, bool flag)
58{
59 if (flag)
60 {
61 sdo.m_word |= NOISE_SET;
62 }
63 else
64 {
65 sdo.m_word &= NOISE_CLEAR;
66 };
67}
68
69inline void SCT_SimHelper::belowThreshold(InDetSimData& sdo, bool flag)
70{
71 if (flag)
72 {
73 sdo.m_word |= BT_SET;
74 }
75 else
76 {
77 sdo.m_word &= BT_CLEAR;
78 };
79}
80
81inline void SCT_SimHelper::disabled(InDetSimData& sdo, bool flag)
82{
83 if (flag)
84 {
85 sdo.m_word |= DISABLED_SET;
86 }
87 else
88 {
90 };
91}
92
93inline bool SCT_SimHelper::isNoise(const InDetSimData& sdo)
94{
95 return (sdo.m_word&NOISE_SET) != 0;
96}
97
99{
100 return (sdo.m_word&BT_SET) != 0;
101}
102
104{
105 return (sdo.m_word&DISABLED_SET) != 0;
106}
107
109 bool /*rejectOutOfBunch*/,
110 bool /*rejectUnconnected*/,
111 bool rejectBelowThreshold,
112 bool rejectDisabled,
113 bool /*rejectLostInReadout*/,
114 bool /*rejectNotTrack*/,
115 bool rejectExtraNoise)
116{
117 // rejectOutOfBunch not implemented
118 // rejectUnconnected not implemented
119 if (rejectBelowThreshold && isBelowThreshold(sdo) && !isNoise(sdo))
120 return true; // as in previous SCT_DigitTDR_Cnv
121 if (rejectDisabled && isDisabled(sdo)) return true;
122 // rejectLostInReadout not implemented
123 // rejectNotTrack not implemented
124 if (rejectExtraNoise && isNoise(sdo) && isBelowThreshold(sdo))
125 return true;
126 return false;
127}
128
129//<<<<<< INLINE PUBLIC FUNCTIONS >>>>>>
130//<<<<<< INLINE MEMBER FUNCTIONS >>>>>>
131
132#endif // INDETRAWUTILS_SCT_SIMHELPER_H
static bool isNoise(const InDetSimData &sdo)
static bool isRejected(const InDetSimData &sdo, bool rejectOutOfBunch, bool rejectUnconnected, bool rejectBelowThreshold, bool rejectDisabled, bool rejectLostInReadout, bool rejectNotTrack, bool rejectExtraNoise)
static void noise(InDetSimData &sdo, bool flag)
static bool isBelowThreshold(const InDetSimData &sdo)
static bool isDisabled(const InDetSimData &sdo)
static void disabled(InDetSimData &sdo, bool flag)
static void belowThreshold(InDetSimData &sdo, bool flag)