ATLAS Offline Software
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 {
29 public:
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 
48 private:
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 
57 inline 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 
70 {
71  if (flag)
72  {
73  sdo.m_word |= BT_SET;
74  }
75  else
76  {
77  sdo.m_word &= BT_CLEAR;
78  };
79 }
80 
81 inline void SCT_SimHelper::disabled(InDetSimData& sdo, bool flag)
82 {
83  if (flag)
84  {
85  sdo.m_word |= DISABLED_SET;
86  }
87  else
88  {
89  sdo.m_word &= DISABLED_CLEAR;
90  };
91 }
92 
93 inline 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
SCT_SimHelper::disabled
static void disabled(InDetSimData &sdo, bool flag)
Definition: SCT_SimHelper.h:81
SCT_SimHelper::isDisabled
static bool isDisabled(const InDetSimData &sdo)
Definition: SCT_SimHelper.h:103
SCT_SimHelper::isRejected
static bool isRejected(const InDetSimData &sdo, bool rejectOutOfBunch, bool rejectUnconnected, bool rejectBelowThreshold, bool rejectDisabled, bool rejectLostInReadout, bool rejectNotTrack, bool rejectExtraNoise)
Definition: SCT_SimHelper.h:108
SCT_SimHelper::NOISE_SET
@ NOISE_SET
Definition: SCT_SimHelper.h:57
SCT_SimHelper::belowThreshold
static void belowThreshold(InDetSimData &sdo, bool flag)
Definition: SCT_SimHelper.h:69
SCT_SimHelper::DISABLED_CLEAR
@ DISABLED_CLEAR
Definition: SCT_SimHelper.h:59
SCT_SimHelper::NOISE_CLEAR
@ NOISE_CLEAR
Definition: SCT_SimHelper.h:57
master.flag
bool flag
Definition: master.py:29
InDetSimData
Definition: InDetSimData.h:42
InDetSimData.h
SCT_SimHelper::BT_SET
@ BT_SET
Definition: SCT_SimHelper.h:58
SCT_SimHelper::noise
static void noise(InDetSimData &sdo, bool flag)
Definition: SCT_SimHelper.h:57
SCT_SimHelper::BT_CLEAR
@ BT_CLEAR
Definition: SCT_SimHelper.h:58
SCT_SimHelper::isNoise
static bool isNoise(const InDetSimData &sdo)
Definition: SCT_SimHelper.h:93
InDetSimData::m_word
int m_word
Definition: InDetSimData.h:64
SCT_SimHelper
Definition: SCT_SimHelper.h:28
SCT_SimHelper::DISABLED_SET
@ DISABLED_SET
Definition: SCT_SimHelper.h:59
SCT_SimHelper::isBelowThreshold
static bool isBelowThreshold(const InDetSimData &sdo)
Definition: SCT_SimHelper.h:98